{"version":3,"file":"toggleScrollAndFocusForOverlay.D5EdWivC.mjs","names":[],"sources":["https:/framerusercontent.com/modules/5xHj4XO7vjZ0IKnRi95x/ZxpcAN5x4xOWfN6CXPDP/toggleScrollAndFocusForOverlay.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function toggleScrollForChatOverlay(Component){return props=>{useEffect(()=>{const overlay=document.getElementById(\"chat-widget-overlay\");const disableScroll=()=>{document.body.style.overflow=\"hidden\";};const enableScroll=()=>{document.body.style.overflow=\"\";};const checkOverlayVisibility=()=>{if(overlay&&getComputedStyle(overlay).display!==\"none\"){disableScroll();}else{enableScroll();}};// Set up a MutationObserver to monitor changes in overlay visibility\nconst observer=new MutationObserver(()=>{checkOverlayVisibility();});if(overlay){observer.observe(overlay,{attributes:true,attributeFilter:[\"style\",\"class\"]});// Initial check in case it's already open\ncheckOverlayVisibility();}return()=>{enableScroll()// Ensure scroll is enabled when unmounting\n;observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"toggleScrollForChatOverlay\":{\"type\":\"reactHoc\",\"name\":\"toggleScrollForChatOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./toggleScrollAndFocusForOverlay.map"],"mappings":"2JAAwE,SAAgB,EAA2B,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAC,IAAM,EAAQ,SAAS,eAAe,uBAA6B,MAAkB,CAAC,SAAS,KAAK,MAAM,SAAS,QAAU,EAAO,MAAiB,CAAC,SAAS,KAAK,MAAM,SAAS,EAAI,EAAO,MAA2B,CAAI,GAAS,iBAAiB,GAAS,UAAU,OAAQ,IAAsB,GAAiB,EAC/c,EAAS,IAAI,qBAAqB,CAAC,GAA0B,UAAK,IAAS,EAAS,QAAQ,EAAQ,CAAC,WAAW,GAAK,gBAAgB,CAAC,QAAQ,QAAQ,CAAC,EAC7J,SAAoC,CAAC,IACpC,EAAS,YAAc,CAAE,EAAC,EAAE,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,EAAK"}