{"version":3,"file":"RawHTML.CGeM7Vzv.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Y6IlPyd6vH9fcSBzyu4k/RULZsMeEVTVC8cK2ciex/RawHTML.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Renders raw HTML directly in the page DOM (no iframe), so it sizes\n * naturally with the surrounding layout and scrolls with the page.\n * Re-executes any <script> tags in the HTML after mount, since scripts\n * inserted via innerHTML do not run automatically.\n *\n * Also handles an optional element marked [data-sticky-bottom] inside the\n * HTML: it is moved to a real position:fixed placement on document.body\n * (bypassing any transformed ancestor in the published site that would\n * otherwise silently break position:sticky/fixed). Visibility is driven by\n * two independent, redundant checks so it can never get stuck visible once\n * this component's content is hidden by an ancestor (e.g. a parent whose\n * `visible` binding turned false): an IntersectionObserver (for the normal\n * scroll-past-the-section release) and a ResizeObserver plus rAF poll that\n * force it hidden the instant the container collapses to a zero-size /\n * display:none box, regardless of what caused that.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RawHTML(props){const{html}=props;const ref=useRef(null);useEffect(()=>{const container=ref.current;if(!container)return;const scripts=Array.from(container.querySelectorAll(\"script\"));scripts.forEach(oldScript=>{const newScript=document.createElement(\"script\");Array.from(oldScript.attributes).forEach(attr=>{newScript.setAttribute(attr.name,attr.value);});newScript.textContent=oldScript.textContent;if(oldScript.parentNode){oldScript.parentNode.replaceChild(newScript,oldScript);}});const stickyEl=container.querySelector(\"[data-sticky-bottom]\");let intersectionObserver=null;let resizeObserver=null;let rafId=null;let placeholder=null;if(stickyEl){placeholder=document.createElement(\"div\");placeholder.style.display=\"none\";stickyEl.parentNode?.insertBefore(placeholder,stickyEl);stickyEl.style.position=\"fixed\";stickyEl.style.left=\"0\";stickyEl.style.right=\"0\";stickyEl.style.bottom=\"0\";stickyEl.style.width=\"100%\";stickyEl.style.zIndex=\"9999\";stickyEl.style.display=\"none\";document.body.appendChild(stickyEl);let isHostHidden=false;let isIntersecting=false;const applyVisibility=()=>{stickyEl.style.display=!isHostHidden&&isIntersecting?\"flex\":\"none\";};const checkHostHidden=()=>{const hidden=container.offsetParent===null&&getComputedStyle(container).position!==\"fixed\";if(hidden!==isHostHidden){isHostHidden=hidden;applyVisibility();}};intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{isIntersecting=entry.isIntersecting;applyVisibility();});},{threshold:0});intersectionObserver.observe(container);resizeObserver=new ResizeObserver(()=>{checkHostHidden();});resizeObserver.observe(container);// Belt-and-suspenders: a lightweight rAF poll catches an\n// ancestor's display:none toggling even in the rare case\n// neither observer fires for it, and stops itself on unmount.\nlet stopped=false;const poll=()=>{if(stopped)return;checkHostHidden();rafId=requestAnimationFrame(poll);};rafId=requestAnimationFrame(poll);return()=>{stopped=true;if(rafId!==null)cancelAnimationFrame(rafId);intersectionObserver?.disconnect();resizeObserver?.disconnect();if(stickyEl&&placeholder&&placeholder.parentNode){placeholder.parentNode.replaceChild(stickyEl,placeholder);stickyEl.style.position=\"\";stickyEl.style.left=\"\";stickyEl.style.right=\"\";stickyEl.style.bottom=\"\";stickyEl.style.width=\"\";stickyEl.style.zIndex=\"\";stickyEl.style.display=\"\";}};}return undefined;},[html]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",position:\"relative\"},dangerouslySetInnerHTML:{__html:html||\"\"}});}addPropertyControls(RawHTML,{html:{type:ControlType.String,displayTextArea:true,defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RawHTML\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RawHTML.map"],"mappings":"iLAmBG,SAAwB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