{"version":3,"file":"shared-lib.BAiaKVRI.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/vlGYqAjDpnzcITcuj7JS/7rqgYBedEI0Nhwjdp7eZ/BottomPageLink_prod.js","https:/framerusercontent.com/modules/6oZjaFxPhnE3brQWxyDZ/BGQcM3NfKfvLe5QNDd4Z/siteMetadata.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useEffect,useRef}from\"react\";// @ts-ignore Framer's runtime router hook is not included in its public typings.\nimport{useRouter}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function BottomPageLink({url=\"\",newTab=false,delay=1}){const{navigate,routes}=useRouter()||{};const hasNavigatedRef=useRef(false);const timeoutRef=useRef(null);const frameRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\"){return;}hasNavigatedRef.current=false;const getIsAtBottom=()=>{const root=document.documentElement;const body=document.body;const viewportHeight=window.innerHeight||root.clientHeight;const scrollTop=window.scrollY||root.scrollTop;const documentHeight=Math.max(root.scrollHeight,root.clientHeight,body?.scrollHeight??0);return scrollTop+viewportHeight>=documentHeight-1;};let wasAtBottom=getIsAtBottom();const checkBottom=()=>{frameRef.current=null;if(hasNavigatedRef.current)return;const isAtBottom=getIsAtBottom();const reachedBottom=isAtBottom&&!wasAtBottom;wasAtBottom=isAtBottom;if(!reachedBottom||!url)return;if(timeoutRef.current!==null){clearTimeout(timeoutRef.current);}timeoutRef.current=setTimeout(()=>{timeoutRef.current=null;if(hasNavigatedRef.current)return;hasNavigatedRef.current=true;if(newTab){window.open(url,\"_blank\",\"noopener,noreferrer\");return;}if(!navigate||!routes)return;const[path,hash]=url.split(\"#\");const routeEntry=Object.entries(routes).find(([,value])=>value?.path===path);if(routeEntry){startTransition(()=>navigate(routeEntry[0],hash));}},Math.max(0,delay)*1e3);};const handleScroll=()=>{if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches){checkBottom();return;}if(frameRef.current!==null)return;frameRef.current=window.requestAnimationFrame(checkBottom);};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",handleScroll);if(frameRef.current!==null){window.cancelAnimationFrame(frameRef.current);frameRef.current=null;}if(timeoutRef.current!==null){clearTimeout(timeoutRef.current);timeoutRef.current=null;}};},[delay,navigate,newTab,routes,url]);return /*#__PURE__*/_jsx(\"div\",{\"data-build\":\"bottom-page-link-prod-20260922-01\",style:{display:\"none\",position:\"relative\"}});}addPropertyControls(BottomPageLink,{url:{type:ControlType.Link,title:\"URL\"},newTab:{type:ControlType.Boolean,title:\"Open In\",defaultValue:false,enabledTitle:\"New Tab\",disabledTitle:\"Same Tab\"},delay:{type:ControlType.Number,title:\"Delay (s)\",defaultValue:1,min:0,max:5,step:.1,unit:\"s\",description:\"More components at [Framer University](https://frameruni.link/cc).\"}});BottomPageLink.displayName=\"Bottom Link\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BottomPageLink\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BottomPageLink_prod.map","// Generated by Framer (4c4b00b)\nexport default function metadata(params,activeLocale){return{description:\"Auto Page Switch for Framer. Created by Framer University.\",favicon:\"https://framerusercontent.com/assets/5cobUGTEj03dPTNLhGrQTXXW7M.png\",robots:\"max-image-preview:large\",title:\"Auto Page Switch by Framer University\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"m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