(e=>{const t=e.RLG||(e.RLG={}),i=e=>e&&"function"==typeof e.sanitize;t.getPurifier=()=>i(t.DOMPurify)?t.DOMPurify:i(e.DOMPurify)?e.DOMPurify:null,t.sanitizeConfig=t.sanitizeConfig||{ALLOWED_TAGS:["a","abbr","b","br","code","em","i","li","ol","p","pre","small","strong","sub","sup","u","ul","img","div","span"],ALLOWED_ATTR:["href","src","alt","title","width","height","class","id","rel","target","data-*"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel):|[^a-z]|data:image\/(?:png|jpeg|gif|webp);base64,)/i},t.isAllowedEmbedUrl=e=>{try{const i=new URL(e,location.href);if(i.hostname===location.hostname)return!0;if(Array.isArray(t.sanitizeAllowedHosts)){const e=i.hostname.toLowerCase();return t.sanitizeAllowedHosts.some(t=>(t=(t||"").toLowerCase(),e===t||e.endsWith("."+t)))}return!1}catch(i){return!1}};const o=t.getPurifier();o&&"function"==typeof o.addHook&&o.addHook("uponSanitizeElement",function(e){if("iframe"===(e&&e.nodeName&&e.nodeName.toLowerCase&&e.nodeName.toLowerCase())){const i=e.getAttribute&&e.getAttribute("src");i&&t.isAllowedEmbedUrl(i)||e.parentNode&&e.parentNode.removeChild(e)}}),t.sanitizeHtml=(e,i=null)=>{const o=t.getPurifier();return o?o.sanitize(e,i||t.sanitizeConfig||{}):e}})(window);
