{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/8gyLYEUCAvcoVpGQaNpg/FiqXvrC2M1HLoetHcZY2/Random_cursor_movement.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{useAnimation}from\"framer-motion\";function getRandomPosition(minDistance=20,maxDistance=40// you can customize maximum distance from the current position\n){const angle=Math.random()*2*Math.PI;const distance=Math.random()*(maxDistance-minDistance)+minDistance;return{x:Math.cos(angle)*distance,y:Math.sin(angle)*distance};}// you can customize the random delay between movements by tweaking the minimum and maximum values\nfunction getRandomDelay(min=500,max=1500){return Math.random()*(max-min)+min;}export function withRandomCursorMovement(Component){return props=>{const controls=useAnimation();const lastPosition=useRef({x:0,y:0});const instanceId=useRef(Math.random());useEffect(()=>{const moveRandomly=async()=>{// Initial random delay\nawait new Promise(resolve=>setTimeout(resolve,getRandomDelay(0,3e3)));while(true){const newPosition=getRandomPosition();while(Math.abs(newPosition.x-lastPosition.current.x)<5&&Math.abs(newPosition.y-lastPosition.current.y)<5){Object.assign(newPosition,getRandomPosition());}lastPosition.current=newPosition;await controls.start({x:newPosition.x,y:newPosition.y,transition:{// you can customize animation\nduration:2,type:\"spring\",stiffness:50,damping:10}});await new Promise(resolve=>setTimeout(resolve,getRandomDelay()));}};moveRandomly();return()=>{controls.stop();};},[controls,instanceId.current]);return /*#__PURE__*/_jsx(Component,{...props,animate:controls});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomCursorMovement\":{\"type\":\"reactHoc\",\"name\":\"withRandomCursorMovement\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Random_cursor_movement.map"],
  "mappings": "yIAAAA,IAAuH,SAASC,EAAkBC,EAAY,GAAGC,EAAY,GAC5K,CAAC,IAAMC,EAAM,KAAK,OAAO,EAAE,EAAE,KAAK,GAASC,EAAS,KAAK,OAAO,GAAGF,EAAYD,GAAaA,EAAY,MAAM,CAAC,EAAE,KAAK,IAAIE,CAAK,EAAEC,EAAS,EAAE,KAAK,IAAID,CAAK,EAAEC,CAAQ,CAAE,CACvK,SAASC,EAAeC,EAAI,IAAIC,EAAI,KAAK,CAAC,OAAO,KAAK,OAAO,GAAGA,EAAID,GAAKA,CAAI,CAAQ,SAASE,EAAyBC,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMC,EAASC,EAAa,EAAQC,EAAaC,EAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAQC,EAAWD,EAAO,KAAK,OAAO,CAAC,EAAE,OAAAE,EAAU,MAAwB,SAAS,CAChO,IAAtE,MAAM,IAAI,QAAQC,GAAS,WAAWA,EAAQZ,EAAe,EAAE,GAAG,CAAC,CAAC,IAAa,CAAC,IAAMa,EAAYlB,EAAkB,EAAE,KAAM,KAAK,IAAIkB,EAAY,EAAEL,EAAa,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAIK,EAAY,EAAEL,EAAa,QAAQ,CAAC,EAAE,GAAG,OAAO,OAAOK,EAAYlB,EAAkB,CAAC,EAAGa,EAAa,QAAQK,EAAY,MAAMP,EAAS,MAAM,CAAC,EAAEO,EAAY,EAAE,EAAEA,EAAY,EAAE,WAAW,CACpX,SAAS,EAAE,KAAK,SAAS,UAAU,GAAG,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,IAAI,QAAQD,GAAS,WAAWA,EAAQZ,EAAe,CAAC,CAAC,CAAE,CAAC,GAAe,EAAQ,IAAI,CAACM,EAAS,KAAK,CAAE,GAAI,CAACA,EAASI,EAAW,OAAO,CAAC,EAAsBI,EAAKV,EAAU,CAAC,GAAGC,EAAM,QAAQC,CAAQ,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "getRandomPosition", "minDistance", "maxDistance", "angle", "distance", "getRandomDelay", "min", "max", "withRandomCursorMovement", "Component", "props", "controls", "useAnimation", "lastPosition", "pe", "instanceId", "ue", "resolve", "newPosition", "p"]
}
