import{d as C,e as d,a as g,w as k,f as u,i as p,x as a,z as f,n as S}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as T,r as A,u as E}from"./vendor-vue-reactivity-CheHbvBM.js";import{a as m}from"./vendor-vue-shared-DrzsEcag.js";const H=["innerHTML"],B=C({__name:"Html",props:{field:{}},setup(y){const v=y,{field:r}=T(v),c=d(()=>r.value.additionalStyles||""),_=d(()=>{const e=r.value.htmlContent;return e?e.replace(/<[^>]*>/g,"").trim().length===0&&!/<(img|iframe|video|audio|canvas|svg|embed|object)\b/i.test(e):!0}),o=A(null);function b(e){var i;const n=Array.from(e.querySelectorAll("script"));for(const t of n){const s=document.createElement("script");for(const{name:h,value:x}of Array.from(t.attributes))try{s.setAttribute(h,x)}catch{}t.src?s.src=t.src:s.textContent=t.textContent||"",(i=t.parentNode)==null||i.replaceChild(s,t)}}async function l(){o.value&&(await S(),b(o.value))}return g(()=>{l()}),k(()=>r.value.htmlContent,()=>{l()}),(e,n)=>_.value?(p(),u("div",{key:0,class:m(["ccb-field ccb-field--html-empty",{[c.value]:!0}])},n[0]||(n[0]=[a("div",{class:"ccb-field__empty-placeholder"},[a("p",{class:"ccb-field__empty-text",style:{padding:"10px"}},[f(" No HTML content yet. Open the "),a("strong",null,"HTML field settings"),f(" and add your custom content. ")])],-1)]),2)):(p(),u("div",{key:1,class:m(["ccb-field",{[c.value]:!0}]),ref_key:"rootEl",ref:o,innerHTML:E(r).htmlContent},null,10,H))}});export{B as default};
//# sourceMappingURL=Html-BLvjzYE3.js.map
