{"version":3,"file":"HoverButton.aOFGHc35.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/wFHc7x7ljaC9ZxUFhZxf/QgmXalrpV9Iwe3qJK5gF/HoverButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Create a shared store to manage state for mouse position and background position\nconst useStore=createStore({mousePos:{x:0,y:0},backgroundPos:{x:0,y:0}});/**\n * Override to add a hover-fill effect to a component.\n * The effect tracks the mouse position and animates a background shape\n * (e.g., a circular fill) to follow the mouse and appear on hover.\n *\n * @param Component The component to enhance with the hover-fill effect.\n * @returns The enhanced component with hover-fill behavior.\n */export function withFillFollowCursor(Component){return props=>{// Ref to the container element to track its size and position\nconst ref=useRef(null);// Use the shared store for managing state\nconst[store,setStore]=useStore();// Local state to track hover status\nconst[isHover,setIsHover]=useState(null);/**\n         * Handles the mouse entering or moving within the component area.\n         * Updates the mouse position in the store and sets hover state.\n         */const handleMouseOver=event=>{const rect=event.target.getBoundingClientRect();const x=event.clientX-rect.left;const y=event.clientY-rect.top;if(!isHover){setIsHover(true);}setStore({mousePos:{x:x,y:y}});};/**\n         * Handles the mouse leaving the component area.\n         * Updates the mouse position in the store and unsets hover state.\n         */const handleMouseLeave=event=>{const rect=event.target.getBoundingClientRect();const x=event.clientX-rect.left;const y=event.clientY-rect.top;setStore({mousePos:{x:x,y:y}});if(isHover){setIsHover(false);}};/**\n         * Reacts to hover state changes to update the background's position.\n         * Background position is synchronized with the current mouse position.\n         */useEffect(()=>{const x=store.mousePos.x;const y=store.mousePos.y;setStore({backgroundPos:{x:x,y:y}});},[isHover]);// Styles for the container to occupy full area\nconst containerStyle={width:\"100%\",height:\"100%\",position:\"absolute\"};// Render the wrapped component with hover-fill behavior\nreturn /*#__PURE__*/_jsx(\"div\",{ref:ref,style:containerStyle,onMouseOver:handleMouseOver,onMouseLeave:handleMouseLeave,children:/*#__PURE__*/_jsx(Component,{...props,style:{...props.style,position:\"absolute\",minWidth:\"225%\",aspectRatio:1,pointerEvents:\"none\",borderRadius:\"50%\",visibility:isHover?\"visible\":\"hidden\",transformOrigin:\"center center\",top:store.backgroundPos.y,left:store.backgroundPos.x},animate:{scale:isHover?1:0},/* ADJUST THE ANIMATION BEHAVIOUR HERE */transition:{default:{type:\"tween\",duration:.4,ease:\"easeOut\"}}})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFillFollowCursor\":{\"type\":\"reactHoc\",\"name\":\"withFillFollowCursor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverButton.map"],"mappings":"sLAQG,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CACjE,IAAM,EAAIA,EAAO,IAAI,EAChB,CAAC,EAAM,GAAU,EAAS,EAC1B,CAAC,EAAQ,GAAYC,EAAS,IAAI,EAWvC,OAFW,MAAc,CAAC,IAAM,EAAE,EAAM,SAAS,EAAQ,EAAE,EAAM,SAAS,EAAE,EAAS,CAAC,cAAc,CAAG,IAAI,GAAC,CAAC,CAAC,CAAE,EAAE,CAAC,CAAO,CAAC,EAEvG,EAAK,MAAM,CAAK,MAAI,MAAM,CADxB,MAAM,OAAO,OAAO,OAAO,SAAS,UACC,EAAE,YAR5B,GAAO,CAAC,IAAM,EAAK,EAAM,OAAO,sBAAsB,EAAQ,EAAE,EAAM,QAAQ,EAAK,KAAW,EAAE,EAAM,QAAQ,EAAK,IAAQ,GAAS,EAAW,EAAI,EAAG,EAAS,CAAC,SAAS,CAAG,IAAI,GAAC,CAAC,CAAC,CAAE,EAQ7H,aALvD,GAAO,CAAC,IAAM,EAAK,EAAM,OAAO,sBAAsB,EAAQ,EAAE,EAAM,QAAQ,EAAK,KAAW,EAAE,EAAM,QAAQ,EAAK,IAAI,EAAS,CAAC,SAAS,CAAG,IAAI,GAAC,CAAC,CAAC,EAAK,GAAS,EAA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