var p=Object.defineProperty;var s=(t,a)=>p(t,"name",{value:a,configurable:!0});import{bx as c,cM as v,cN as w,r,E as g,c as k,d as b,e as M,l as V,s as y,v as $,z as x,I as i,by as B,n as h}from"./vendor-other-CSX7WseZ.js";import{a9 as z}from"./vendor-primevue-B6rcS73U.js";import{bq as E}from"./index-2-qFLlQP.js";import"./vendor-vue-CXt3ZZQ3.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-BKWXAgVe.js";import"./vendor-tiptap-BkFTmTb3.js";const H=["innerHTML"],K=c({__name:"WidgetMarkdown",props:v({widget:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=w(t,"modelValue"),l=r(!1),n=r(),d=g(()=>E(a.value||"")),u=s(async()=>{l.value||t.widget.options?.read_only||(l.value=!0,await h(),n.value?.$el?.focus())},"startEditing"),m=s(()=>{l.value=!1},"handleBlur");return(o,e)=>(b(),k("div",{class:"widget-markdown relative w-full",onDblclick:u},[M("div",{class:y(["comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm",l.value===!1?"visible":"invisible"]),innerHTML:d.value},null,10,H),V(x(B(z),{ref_key:"textareaRef",ref:n,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"]),[[$,l.value]])],32))}});export{K as default};
//# sourceMappingURL=WidgetMarkdown-DIMd79hN.js.map
