{"version":3,"file":"BlogVideoHero.CSWyuNSA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/rovncNtja5ENL91vV0O7/nNu7xHf9ZBtJ2rPe2Y7x/BlogVideoHero.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n * YouTubeVideoReplacer Component\n * Moves YouTube iframe from rich text to a target container in the DOM\n */export default function YouTubeVideoReplacer(){useEffect(()=>{let hasRun=false// Prevent multiple runs\n;const moveYouTubeVideo=()=>{if(hasRun)return;// Exit if already processed\n// Find the YouTube iframe in the rich text\nconst sourceIframe=document.querySelector('.framer-text-module iframe[src*=\"youtube.com/embed\"]');if(!sourceIframe){return;}// Find the target container\nconst targetContainer=document.querySelector(\".framer-1jej1ta\");if(!targetContainer){return;}// Check if we've already added our iframe\nif(targetContainer.querySelector(\".youtube-moved-iframe\")){return;}hasRun=true// Mark as processed\n;// Hide the original rich text container\nconst sourceContainer=sourceIframe.closest(\".framer-text-module\");if(sourceContainer){sourceContainer.style.display=\"none\";}// Extract video ID and create clean embed URL\nconst extractVideoId=url=>{const regExp=/^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#&?]*).*/;const match=url.match(regExp);return match&&match[7].length===11?match[7]:null;};const videoId=extractVideoId(sourceIframe.src);if(videoId){// Create a new iframe with clean URL and your styling\nconst newIframe=document.createElement(\"iframe\");newIframe.src=`https://www.youtube.com/embed/${videoId}?iv_load_policy=3&rel=0&modestbranding=1&playsinline=1&autoplay=0&color=white`;newIframe.setAttribute(\"loading\",\"lazy\");newIframe.setAttribute(\"title\",\"Youtube Video\");newIframe.setAttribute(\"allow\",\"presentation; fullscreen; accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\");newIframe.setAttribute(\"frameborder\",\"0\");newIframe.className=\"youtube-moved-iframe\"// Add identifier class\n;newIframe.style.cssText=`\n                    width: 100%;\n                    height: 100%;\n                    border-radius: 12px;\n                    display: block;\n                `;// Create a wrapper div to control sizing\nconst wrapper=document.createElement(\"div\");wrapper.style.cssText=`\n                    width: 100%;\n                    aspect-ratio: 16 / 9;\n                    max-width: 100%;\n                `;wrapper.appendChild(newIframe);// Add the iframe to the target container\ntargetContainer.appendChild(wrapper);}};// Run when DOM is ready\nif(document.readyState===\"loading\"){document.addEventListener(\"DOMContentLoaded\",moveYouTubeVideo);}else{// Try immediately and with delays to catch dynamic content\nmoveYouTubeVideo();setTimeout(moveYouTubeVideo,100);setTimeout(moveYouTubeVideo,500);}// Simplified observer - only watch for new rich text content, not our changes\nconst observer=new MutationObserver(mutations=>{if(hasRun)return;// Don't run if already processed\nlet foundNewRichText=false;mutations.forEach(mutation=>{mutation.addedNodes.forEach(node=>{if(node.nodeType===1&&(node.classList?.contains(\"framer-text-module\")||node.querySelector?.(\".framer-text-module\"))){foundNewRichText=true;}});});if(foundNewRichText){setTimeout(moveYouTubeVideo,100);}});observer.observe(document.body,{childList:true,subtree:true});// Cleanup function\nreturn()=>{observer.disconnect();};},[]);// Return invisible div\nreturn /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:\"1px\",height:\"1px\",opacity:0,pointerEvents:\"none\",overflow:\"hidden\"}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YouTubeVideoReplacer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogVideoHero.map"],"mappings":"kHAGG,SAAwB,GAAsB,CA2BjD,OA3BkD,MAAc,CAAC,IAAI,EAAO,GACrE,MAAqB,CAAC,GAAG,EAAO,OAEvC,IAAM,EAAa,SAAS,cAAc,uDAAuD,CAAC,GAAG,CAAC,EAAc,OACpH,IAAM,EAAgB,SAAS,cAAc,kBAAkB,CAC/D,GADmE,CAAC,GACjE,EAAgB,cAAc,wBAAwB,CAAE,OAAQ,EAAO,GAE1E,IAAM,EAAgB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