{"version":3,"file":"HoverUnderline.BiioUiM_.mjs","names":["useState","useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/f2BoxK5Mj3FvjhXWNRay/t8xKvNrRixhvLPmOS8d1/HoverUnderline.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useRef,useState}from\"react\";// User request: Create a Framer code override named withHoverUnderline that preserves canvas styling and only adds an underline on hover.\nexport function withHoverUnderline(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[isHovered,setIsHovered]=useState(false);const[resolvedUnderlineColor,setResolvedUnderlineColor]=useState(undefined);const internalRef=useRef(null);const setMergedRef=useCallback(node=>{internalRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);const resolveRenderedTextColor=useCallback(()=>{if(typeof window===\"undefined\"){return props.style?.color??\"inherit\";}const element=internalRef.current;if(!element){return props.style?.color??\"inherit\";}const matches=element.querySelectorAll(\"p, h1, h2, h3, h4, h5, h6, span\");const target=matches.length>0?matches[matches.length-1]:element;const computedColor=window.getComputedStyle(target).color;if(computedColor&&computedColor.trim().length>0){return computedColor;}return props.style?.color??\"inherit\";},[props.style]);const handleMouseEnter=useCallback(event=>{const nextColor=resolveRenderedTextColor();startTransition(()=>setResolvedUnderlineColor(nextColor));startTransition(()=>setIsHovered(true));props.onMouseEnter?.(event);},[props,resolveRenderedTextColor]);const handleMouseLeave=useCallback(event=>{startTransition(()=>setIsHovered(false));props.onMouseLeave?.(event);},[props]);const hoverStyle=isHovered?{textDecoration:\"underline\",WebkitTextDecorationLine:\"underline\",textDecorationThickness:\"2px\",WebkitTextDecorationThickness:\"2px\",textUnderlineOffset:\"0.15em\",textDecorationColor:resolvedUnderlineColor??props.style?.color??\"inherit\",WebkitTextDecorationColor:resolvedUnderlineColor??props.style?.color??\"inherit\",textDecorationSkipInk:\"none\"}:{};return /*#__PURE__*/_jsx(Component,{ref:setMergedRef,...props,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{...props.style,...hoverStyle}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withHoverUnderline\":{\"type\":\"reactHoc\",\"name\":\"withHoverUnderline\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverUnderline.map"],"mappings":"4JACA,SAAgB,EAAmB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAuB,GAA2BA,EAAS,IAAA,EAAS,EAAQ,EAAYC,EAAO,IAAI,EAAQ,EAAaC,EAAY,GAAM,CAAC,EAAY,QAAQ,EAAQ,OAAO,GAAM,WAAY,EAAI,CAAI,EAAW,GAAK,OAAO,GAAM,WAAU,EAAI,QAAQ,EAAM,EAAE,CAAC,CAAG,CAAC,EAAQ,EAAyBA,MAAgB,CAAC,GAAU,IAAS,OAAa,OAAO,EAAM,OAAO,OAAO,UAAW,IAAM,EAAQ,EAAY,QAAQ,GAAG,CAAC,EAAS,OAAO,EAAM,OAAO,OAAO,UAAW,IAAM,EAAQ,EAAQ,iBAAiB,iCAAiC,EAAQ,EAAO,EAAQ,OAAO,EAAE,EAAQ,EAAQ,OAAO,GAAG,EAAc,EAAc,EAAO,iBAAiB,CAAM,CAAC,CAAC,MAA6E,OAApE,GAAe,EAAc,KAAK,CAAC,CAAC,OAAO,EAAU,EAAsB,EAAM,OAAO,OAAO,SAAU,EAAE,CAAC,EAAM,KAAK,CAAC,EAAQ,EAAiBA,EAAY,GAAO,CAAC,IAAM,EAAU,EAAyB,EAAE,MAAoB,EAA0B,CAAS,CAAC,EAAE,MAAoB,EAAa,EAAI,CAAC,EAAE,EAAM,eAAe,CAAK,CAAE,EAAE,CAAC,EAAM,CAAwB,CAAC,EAAQ,EAAiBA,EAAY,GAAO,CAAC,MAAoB,EAAa,EAAK,CAAC,EAAE,EAAM,eAAe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