{"version":3,"file":"MenuOverride.CSqYY3go.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/UbG3WI1Rt8wMVUohv9cm/YV8u3h7JoMucrOd9dSIz/MenuOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst activeMenuItemStyle={textDecorationLine:\"underline\",textDecorationColor:\"white\",textDecorationThickness:\"2px\"};const defaultMenuItemStyle={};export function UnderLine(Component){return props=>{const ref=useRef(null);const[isInView,setInView]=useState(false);const rawSectID=props===null||props===void 0?void 0:props.href;const sectID=rawSectID===null||rawSectID===void 0?void 0:rawSectID.substring(rawSectID.indexOf(\"#\")+1);function checkInView(offSetY,windowHeight,sectTop,sectBot){const midViewPort=offSetY+.5*windowHeight;let scrolledUntil;let scrolledPast;scrolledUntil=midViewPort>sectTop;scrolledPast=midViewPort>sectBot;return scrolledUntil&&!scrolledPast;}function handleScroll(){let checkView=checkInView(window.pageYOffset,window.innerHeight,ref===null||ref===void 0?void 0:ref.current.top,ref===null||ref===void 0?void 0:ref.current.bottom);if(checkView){setInView(true);}else{setInView(false);}}useEffect(()=>{const el=document.getElementById(sectID);const rect=el===null||el===void 0?void 0:el.getBoundingClientRect();ref.current=rect;window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[]);let style={};if(isInView){style=activeMenuItemStyle;}else{style=defaultMenuItemStyle;}return /*#__PURE__*/ _jsx(Component,{...props,style:style});};}\nexport const __FramerMetadata__ = {\"exports\":{\"UnderLine\":{\"type\":\"reactHoc\",\"name\":\"UnderLine\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MenuOverride.map"],"mappings":"mNACmJ,SAAgB,EAAU,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAM,CAAC,EAAS,GAAWC,EAAS,GAAM,CAAO,EAAU,GAA0C,KAAW,EAAO,GAAsD,UAAU,EAAU,QAAQ,IAAI,CAAC,EAAE,CAAC,SAAS,EAAY,EAAQ,EAAa,EAAQ,EAAQ,CAAC,IAAM,EAAY,EAAQ,GAAG,EAAiB,EAAkB,EAAgF,MAAnE,GAAc,EAAY,EAAQ,EAAa,EAAY,EAAe,GAAe,CAAC,EAAc,SAAS,GAAc,CAAe,EAAY,EAAO,YAAY,EAAO,YAAY,GAAoC,QAAQ,IAAI,GAAoC,QAAQ,OAAO,CAAe,EAAU,GAAK,CAAO,EAAU,GAAM,CAAG,OAA4H,EAAI,QAAxG,SAAS,eAAe,EAAO,EAA6C,uBAAuB,CAAkB,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAC,IAAI,EAAM,EAAE,CAA0E,MAAzE,CAA6C,EAA1C,EAAgB,EAAgC,EAA2C,EAAK,EAAU,CAAC,GAAG,EAAY,QAAM,CAAC,2BADrvC,IAA6C,CAClF,EAAoB,CAAC,mBAAmB,YAAY,oBAAoB,QAAQ,wBAAwB,MAAM,CAAO,EAAqB,EAAE"}