import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{s as t}from"./vendor-primevue-DyvCA8Nd.js";import{D as n,G as r,I as i,Lt as a,O as o,Ot as s,R as c,b as l,et as u,j as d,q as f,ut as p,v as m,vt as h,zt as g}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-markdown-8POvMhty.js";import{t as _}from"./markdownRendererUtil-DH1PCfUd.js";var v=[`innerHTML`],y=c({__name:`WidgetMarkdown`,props:r({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=p(e,`modelValue`),c=s(!1),y=s(),b=n(()=>_(r.value||``)),startEditing=async()=>{c.value||e.widget.options?.read_only||(c.value=!0,await f(),y.value?.$el?.focus())},handleBlur=()=>{c.value=!1};return(e,n)=>(u(),d(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[o(`div`,{class:g([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,c.value===!1?`visible`:`invisible`]),tabindex:`0`,"data-capture-wheel":`true`,innerHTML:b.value},null,10,v),h(i(a(t),{ref_key:`textareaRef`,ref:y,modelValue:r.value,"onUpdate:modelValue":n[0]||=e=>r.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:n[1]||=l(()=>{},[`stop`]),onPointermoveCapture:n[2]||=l(()=>{},[`stop`]),onPointerupCapture:n[3]||=l(()=>{},[`stop`]),onClick:n[4]||=l(()=>{},[`stop`]),onKeydown:n[5]||=l(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[m,c.value]])],32))}});export{y as default};
//# sourceMappingURL=WidgetMarkdown-CmHOlK2l.js.map