const isGoodPrngAvailable = ( ) => { if ( window . crypto && ! ! window . crypto . getRandomValues ) { return true ; } return typeof window . msCrypto === 'object' && typeof window . msCrypto . getRandomValues === 'function' ; } ; const hasCookies = ( ) => { try { return navigator . cookieEnabled ; } catch ( e ) { return false ; } } ; const hasSessionStorage = ( ) => { try { return ! ! window . sessionStorage ; } catch ( e ) { return false ; } } ; const hasLocalStorage = ( ) => { try { return ! ! window . localStorage ; } catch ( e ) { return false ; } } ; export const getCompatibilityList = ( ) => { const isSSR = typeof window === 'undefined' ; return [ { name : 'Cookies' , valid : isSSR || hasCookies ( ) , text : 'Please enable cookies in your browser.' , } , { name : 'Storage' , valid : isSSR || hasSessionStorage ( ) , text : 'Please enable sessionStorage in your browser.' , } , { name : 'Storage' , valid : isSSR || hasLocalStorage ( ) , text : 'Please enable localStorage in your browser.' , } , { name : 'PRNG' , valid : isSSR || isGoodPrngAvailable ( ) , text : 'Please update to a modern browser with support for PRNG.' , } , ] ; } ;