!function(){"use strict";var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},n="undefined"!=typeof module&&module.exports,l="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,r=function(){for(var n,l=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,t=l.length,u={};r<t;r++)if((n=l[r])&&n[1]in e){for(r=0;r<n.length;r++)u[l[0][r]]=n[r];return u}return!1}(),t={change:r.fullscreenchange,error:r.fullscreenerror},u={request:function(n){var t=r.requestFullscreen;n=n||e.documentElement,/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)?n[t]():n[t](l&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){e[r.exitFullscreen]()},toggle:function(e){this.isFullscreen?this.exit():this.request(e)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(n,l){var r=t[n];r&&e.addEventListener(r,l,!1)},off:function(n,l){var r=t[n];r&&e.removeEventListener(r,l,!1)},raw:r};if(!r)return void(n?module.exports=!1:window.screenfull=!1);Object.defineProperties(u,{isFullscreen:{get:function(){return Boolean(e[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[r.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(e[r.fullscreenEnabled])}}}),n?module.exports=u:window.screenfull=u}();