{"version":3,"file":"ScrollToTopOnLoad.BCZsaKYq.mjs","names":[],"sources":["https:/framerusercontent.com/modules/ColmFwfdQgL70qBk4rVY/powFYWL6dubvxlCWab8R/ScrollToTopOnLoad.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{useNavigation}from\"framer\";export default function LenisScrollTopManager(){const navigation=useNavigation();React.useEffect(()=>{// Prevent multiple instances (templates/pages)\nif(window.__lenisScrollTopManagerInstalled)return;window.__lenisScrollTopManagerInstalled=true;let cancelled=false;const getLenis=()=>window.lenis??window.__lenis;const ensureStarted=()=>{const lenis=getLenis();try{// Some builds expose isStopped, but even if not, calling start() is safe.\nlenis?.start?.();}catch{}};// Watchdog: if Lenis appears later or gets stuck stopped, start it.\nconst tick=()=>{if(cancelled)return;ensureStarted();requestAnimationFrame(tick);};requestAnimationFrame(tick);return()=>{cancelled=true;ensureStarted();window.__lenisScrollTopManagerInstalled=false;};},[]);React.useEffect(()=>{const lenis=window.lenis??window.__lenis;if(!lenis)return;// Run when navigation ENDS\nif(navigation?.isNavigating)return;try{// Do NOT leave it stopped\nlenis.stop?.();lenis.scrollTo?.(0,{immediate:true,force:true});}finally{lenis.start?.();}},[navigation?.isNavigating]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}});}LenisScrollTopManager.displayName=\"Lenis Scroll Top Manager\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LenisScrollTopManager\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopOnLoad.map"],"mappings":"kLAAyG,SAAwB,GAAuB,CAAC,IAAM,EAAW,EAAc,EAKjE,OALmE,MAAoB,CAC9M,GAAG,EAAO,iCAAiC,OAAO,EAAO,iCAAiC,GAAK,IAAI,EAAU,GAAY,MAAa,EAAO,OAAO,EAAO,QAAc,MAAkB,CAAC,IAAM,EAAM,EAAS,EAAE,GAAG,CACtN,GAAO,QAAQ,CAAE,MAAM,CAAC,CAAC,EACnB,MAAS,CAAI,IAAiB,EAAc,EAAE,sBAAsB,CAAI,EAAE,EAA8B,OAA5B,sBAAsB,CAAI,MAAY,CAAC,EAAU,GAAK,EAAc,EAAE,EAAO,iCAAiC,EAAM,CAAE,EAAE,CAAC,CAAC,EAAE,MAAoB,CAAC,IAAM,EAAM,EAAO,OAAO,EAAO,QAAY,MAC7Q,IAAY,aAAoB,GAAG,CACtC,EAAM,OAAO,EAAE,EAAM,WAAW,EAAE,CAAC,UAAU,GAAK,MAAM,EAAI,CAAC,CAAE,QAAQ,CAAC,EAAM,QAAQ,CAAE,CAAC,EAAE,CAAC,GAAY,YAAY,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAE,qBALtI,IAA4B,IAAkC,EAKyE,EAAsB,YAAY"}