{"version":3,"file":"UsePageVisibility.Txp4uFuP.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/V9ryrjN5Am9WM1dJeyyJ/9mrJHeWj7rhvLTLu7Yzt/UsePageVisibility.js"],"sourcesContent":["import{useState,useEffect}from\"react\";export const isBrowser=()=>typeof document===\"object\";export function getBrowserVisibilityProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){// Opera 12.10 and Firefox 18 and later support\nreturn\"visibilitychange\";}else if(typeof document.msHidden!==\"undefined\"){return\"msvisibilitychange\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitvisibilitychange\";}}export function getBrowserDocumentHiddenProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){return\"hidden\";}else if(typeof document.msHidden!==\"undefined\"){return\"msHidden\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitHidden\";}}export function getIsDocumentHidden(){if(!isBrowser())return;return!document[getBrowserDocumentHiddenProp()];}export function usePageVisibility(){if(!isBrowser())return;const[isVisible,setIsVisible]=useState(getIsDocumentHidden());const onVisibilityChange=()=>setIsVisible(getIsDocumentHidden());useEffect(()=>{const visibilityChange=getBrowserVisibilityProp();document.addEventListener(visibilityChange,onVisibilityChange,false);return()=>{document.removeEventListener(visibilityChange,onVisibilityChange);};});return isVisible;}\nexport const __FramerMetadata__ = {\"exports\":{\"getBrowserVisibilityProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getIsDocumentHidden\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"usePageVisibility\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isBrowser\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBrowserDocumentHiddenProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UsePageVisibility.map"],"mappings":"2GAA4F,SAAgB,GAA0B,CAAK,MAAW,CAAQ,IAAU,SAAS,SAAS,OAC1L,MAAM,sBAAmC,SAAS,WAAW,OAAa,MAAM,wBAAqC,SAAS,eAAe,OAAa,MAAM,0BAA2B,SAAgB,GAA8B,CAAK,MAAW,CAAQ,IAAU,SAAS,SAAS,OAAa,MAAM,YAAyB,SAAS,WAAW,OAAa,MAAM,cAA2B,SAAS,eAAe,OAAa,MAAM,gBAAiB,SAAgB,GAAqB,CAAK,MAAW,CAAQ,MAAM,CAAC,SAAS,GAA8B,EAAG,SAAgB,GAAmB,CAAC,GAAG,CAAC,GAAW,CAAC,OAAO,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAqB,CAAC,CAAO,MAAuB,EAAa,GAAqB,CAAC,CAAyN,OAAxN,MAAc,CAAC,IAAM,EAAiB,GAA0B,CAAsE,OAArE,SAAS,iBAAiB,EAAiB,EAAmB,GAAM,KAAW,CAAC,SAAS,oBAAoB,EAAiB,EAAmB,GAAK,CAAQ,qBADx6B,CAAa,MAAc,OAAO,UAAW"}