const t=t=>{try{if(t instanceof c)return t.value;if(!s()||"string"!=typeof t||""===t)return t;const e=document.createDocumentFragment(),i=document.createElement("div");e.appendChild(i),i.innerHTML=t,r.forEach((t=>{const s=e.querySelectorAll(t);for(let t=s.length-1;t>=0;t--){const r=s[t];r.parentNode?r.parentNode.removeChild(r):e.removeChild(r);const c=o(r);for(let t=0;t<c.length;t++)n(c[t])}}));const l=o(e);for(let t=0;t<l.length;t++)n(l[t]);const u=document.createElement("div");u.appendChild(e);const a=u.querySelector("div");return null!==a?a.innerHTML:u.innerHTML}catch(t){return console.error(t),""}},n=t=>{if(t.nodeType&&1!==t.nodeType)return;for(let n=t.attributes.length-1;n>=0;n--){const o=t.attributes.item(n),s=o.name;if(!e.includes(s.toLowerCase())){t.removeAttribute(s);continue}const r=o.value;null!=r&&r.toLowerCase().includes("javascript:")&&t.removeAttribute(s)}const s=o(t);for(let t=0;t<s.length;t++)n(s[t])},o=t=>null!=t.children?t.children:t.childNodes,s=()=>{var t;const n=window,o=null===(t=null==n?void 0:n.Gasco)||void 0===t?void 0:t.config;return!o||(o.get?o.get("sanitizerEnabled",!0):!0===o.sanitizerEnabled||void 0===o.sanitizerEnabled)},e=["class","id","href","src","name","slot"],r=["script","style","iframe","meta","link","object","embed"];class c{constructor(t){this.value=t}}export{c as G,t as s}