{"version":3,"file":"Auto_close_menu.DIBxKA4Z.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/z0CdYdhfeN8f67Qy5VlW/uVD8qg4YQUJhRiAcwMFn/Auto_close_menu.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function CloseOnScroll(Component){return props=>{// 1. Set up state to track if the menu is open\nconst[variant,setVariant]=useState(props.variant||\"Closed\");useEffect(()=>{const handleScroll=()=>{// 2. If the user scrolls, force the variant back to Closed\nsetVariant(\"Closed\");};window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:variant,// 3. Handle the click to toggle between Open and Closed\nonClick:()=>{if(variant===\"Closed\"){setVariant(\"Open\");}else{setVariant(\"Closed\");}}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"CloseOnScroll\":{\"type\":\"reactHoc\",\"name\":\"CloseOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Auto_close_menu.map"],"mappings":"kIAAiF,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CACxI,GAAK,CAAC,EAAQ,GAAYA,EAAS,EAAM,SAAS,SAAS,CAC6E,OAD5E,MAAc,CAAC,IAAM,MAAiB,CAClG,EAAW,SAAS,EAAkD,OAA/C,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAc,UAC7L,YAAY,CAAwB,EAApB,IAAU,SAAqB,OAAyB,SAAS,EAAI,CAAC,uBAH3C,IAAsC"}