import{r as registerInstance,h,H as Host}from"./index-b7735e0d.js";import{h as hasLink,l as linkify}from"./utils-c4a3ab3b.js";var dvnFieldDisplayTextCss="dvn-field-display-text{display:block;--line-count:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--line-count);-webkit-box-orient:vertical;line-height:var(--line-height);min-height:calc(var(--line-count) * var(--line-height))}";var DvnFieldDisplayText=function(){function t(t){registerInstance(this,t);this.meta={}}t.prototype.render=function(){var t=this,e=t.field,i=t.meta;var n=this.value;var l=i.lines,s=l===void 0?0:l;if(!n){return h(Host,{style:{"--line-count":s}},"-")}if(e.inputType==="url"){n=h("a",{href:n.startsWith("http")?n:"http://".concat(n),target:"_blank"},n)}if(hasLink(n)){return h(Host,{style:{"--line-count":s},innerHTML:linkify(this.value)})}if(e.format==="markdown"){return h(Host,{style:{"--line-count":s}},h("dvn-markdown",{content:n}))}return h(Host,{style:{"--line-count":s}},n)};return t}();DvnFieldDisplayText.style=dvnFieldDisplayTextCss;export{DvnFieldDisplayText as dvn_field_display_text};