{"version":3,"file":"UsePageVisibility.B6y6LXZ_.mjs","names":[],"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":"sIAA4F,SAAgB,GAA0B,CAAK,MAAW,CAAQ,IAAU,SAAS,gBACjL,MAAM,sBAAmC,SAAS,kBAAwB,MAAM,wBAAqC,SAAS,sBAA4B,MAAM,wBAAA,CAA2B,UAAgB,GAA8B,CAAK,MAAW,CAAQ,IAAU,SAAS,gBAAsB,MAAM,YAAyB,SAAS,kBAAwB,MAAM,cAA2B,SAAS,sBAA4B,MAAM,cAAA,CAAiB,UAAgB,GAAqB,CAAK,MAAW,CAAQ,OAAO,SAAS,GAA8B,CAAG,UAAgB,GAAmB,CAAC,IAAI,GAAW,CAAC,OAAO,GAAK,CAAC,EAAU,EAAa,CAAC,EAAS,GAAqB,CAAC,CAAO,EAAmB,IAAI,EAAa,GAAqB,CAAC,CAAyN,MAAxN,GAAU,IAAI,CAAC,IAAM,EAAiB,GAA0B,CAAsE,MAArE,UAAS,iBAAiB,EAAiB,GAAmB,EAAM,CAAO,IAAI,CAAC,SAAS,oBAAoB,EAAiB,EAAmB,AAAE,CAAE,EAAC,CAAQ,CAAW,gBADt6B,AAAnD,GAAsC,CAAa,EAAU,WAAW,UAAW"}