var p=Object.defineProperty;var s=(l,a)=>p(l,"name",{value:a,configurable:!0});import{a2 as c,dk as v,dl as w,r as n,E as g,c as k,d as V,e as M,l as b,s as $,v as y,z as x,I as i,a8 as B,n as h}from"./vendor-other-Dsj-QuOx.js";import{aa as z}from"./vendor-primevue-Cif--Rbw.js";import{bt as E}from"./index-Bc79VbnU.js";import"./vendor-vue-DNQSPQQ2.js";import"./vendor-reka-ui-WjwjFuZo.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-ByuY8CdW.js";import"./vendor-tiptap-YMjM2h-Z.js";const H=["innerHTML"],U=c({__name:"WidgetMarkdown",props:v({widget:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const a=w(l,"modelValue"),t=n(!1),r=n(),d=g(()=>E(a.value||"")),u=s(async()=>{t.value||l.widget.options?.read_only||(t.value=!0,await h(),r.value?.$el?.focus())},"startEditing"),m=s(()=>{t.value=!1},"handleBlur");return(o,e)=>(V(),k("div",{class:"widget-markdown relative w-full",onDblclick:u},[M("div",{class:$(["comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm",t.value===!1?"visible":"invisible"]),innerHTML:d.value},null,10,H),b(x(B(z),{ref_key:"textareaRef",ref:r,modelValue:a.value,"onUpdate:modelValue":e[0]||(e[0]=f=>a.value=f),"aria-label":`${o.$t("g.edit")} ${o.widget.name||o.$t("g.markdown")} ${o.$t("g.content")}`,class:"absolute inset-0 min-h-[60px] w-full resize-none",pt:{root:{class:"text-sm w-full h-full",onBlur:m}},"data-capture-wheel":"true",onClick:e[1]||(e[1]=i(()=>{},["stop"])),onKeydown:e[2]||(e[2]=i(()=>{},["stop"]))},null,8,["modelValue","aria-label","pt"]),[[y,t.value]])],32))}});export{U as default};
//# sourceMappingURL=WidgetMarkdown-Bqcf7Vpy.js.map
