import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{i as n,t as r}from"./emotion-styled.browser.esm.BYv_Qzcq.js";import{t as i}from"./purify.es.DrVcFY1Q.js";var a=e(t(),1),o=`data-temp-href-target`;i.addHook(`beforeSanitizeAttributes`,function(e){e instanceof HTMLElement&&e.hasAttribute(`target`)&&e.getAttribute(`target`)===`_blank`&&e.setAttribute(o,`_blank`)}),i.addHook(`afterSanitizeAttributes`,function(e){e instanceof HTMLElement&&e.hasAttribute(o)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),e.removeAttribute(o))});var s={USE_PROFILES:{html:!0},FORCE_BODY:!0},c=i,l=r(`div`,{target:`e1o5kn6k0`})(({theme:e})=>({width:`100%`,"ul, ol, dl":{paddingLeft:e.spacing.threeXL}})),u=(0,a.forwardRef)(function(e,t){return n(l,{className:`stHtml`,"data-testid":`stHtml`,ref:t,...e})}),d={...s,ADD_TAGS:[`script`,`style`],ADD_ATTR:[`src`,`type`,`async`,`defer`,`nonce`,`crossorigin`,`referrerpolicy`,`integrity`]};function f(e){return c.sanitize(e,d)}var p=(0,a.memo)(({body:e})=>{let t=(0,a.useRef)(null),r=(0,a.useMemo)(()=>f(e),[e]);return(0,a.useEffect)(()=>{let e=t.current;if(e)return e.innerHTML=r,Array.from(e.querySelectorAll(`script`)).forEach(e=>{let t=document.createElement(`script`);for(let{name:n,value:r}of Array.from(e.attributes))try{t.setAttribute(n,r)}catch{}e.src||(t.textContent=e.textContent),e.parentNode?.replaceChild(t,e)}),()=>{e.innerHTML=``}},[r]),n(u,{ref:t})});function m(e){return c.sanitize(e,s)}function h({body:e}){let t=(0,a.useMemo)(()=>m(e),[e]);return t?n(u,{dangerouslySetInnerHTML:{__html:t}}):null}var g=(0,a.memo)(h);function _({element:e}){let{body:t,unsafeAllowJavascript:r}=e;return n(r?p:g,{body:t})}var v=(0,a.memo)(_);export{v as default};