{"version":3,"file":"MenuOverride.CSFoXlau.mjs","names":[],"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,CAAA,GAAO,CAAC,IAAM,EAAI,EAAO,KAAK,CAAM,CAAC,EAAS,EAAU,CAAC,GAAS,EAAM,CAAO,EAAU,GAA0C,KAAW,EAAmD,AAA5C,GAAsD,UAAU,EAAU,QAAQ,IAAI,CAAC,EAAE,CAAC,SAAS,EAAY,EAAQ,EAAa,EAAQ,EAAQ,CAAC,IAAM,EAAY,EAAQ,GAAG,EAAiB,EAAkB,EAAgF,OAAnE,EAAc,EAAY,EAAQ,EAAa,EAAY,EAAe,IAAgB,CAAc,UAAS,GAAc,CAAC,IAAI,EAAU,EAAY,EAAO,YAAY,EAAO,YAAY,GAAoC,QAAQ,IAAI,GAAoC,QAAQ,OAAO,CAAC,AAAc,IAAX,EAAiD,AAAG,GAAU,IAAI,CAAC,IAAM,EAAG,SAAS,eAAe,EAAO,CAAO,EAAmC,AAA9B,GAAiC,uBAAuB,CAAiE,OAAhE,EAAI,QAAQ,EAAK,EAAO,iBAAiB,SAAS,EAAa,CAAO,IAAI,EAAO,oBAAoB,SAAS,EAAa,AAAE,EAAC,CAAE,EAAC,CAAC,IAAI,EAAM,CAAE,EAA0E,OAA5B,EAA1C,EAAgB,EAAgC,EAA2C,EAAK,EAAU,CAAC,GAAG,EAAY,OAAM,EAAC,AAAE,CAAE,kBAAzqC,IAD3H,GAA2C,IAA6C,CAClF,EAAoB,CAAC,mBAAmB,YAAY,oBAAoB,QAAQ,wBAAwB,KAAM,EAAO,EAAqB,CAAE"}