{"version":3,"file":"fscreen.esm.js","sources":["../src/fscreen.js"],"sourcesContent":["const key = {\n fullscreenEnabled: 0,\n fullscreenElement: 1,\n requestFullscreen: 2,\n exitFullscreen: 3,\n fullscreenchange: 4,\n fullscreenerror: 5,\n fullscreen: 6\n};\n\nconst webkit = [\n 'webkitFullscreenEnabled',\n 'webkitFullscreenElement',\n 'webkitRequestFullscreen',\n 'webkitExitFullscreen',\n 'webkitfullscreenchange',\n 'webkitfullscreenerror',\n '-webkit-full-screen',\n];\n\nconst moz = [\n 'mozFullScreenEnabled',\n 'mozFullScreenElement',\n 'mozRequestFullScreen',\n 'mozCancelFullScreen',\n 'mozfullscreenchange',\n 'mozfullscreenerror',\n '-moz-full-screen',\n];\n\nconst ms = [\n 'msFullscreenEnabled',\n 'msFullscreenElement',\n 'msRequestFullscreen',\n 'msExitFullscreen',\n 'MSFullscreenChange',\n 'MSFullscreenError',\n '-ms-fullscreen',\n];\n\n// so it doesn't throw if no window or document\nconst document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};\n\nconst vendor = (\n ('fullscreenEnabled' in document && Object.keys(key)) ||\n (webkit[0] in document && webkit) ||\n (moz[0] in document && moz) ||\n (ms[0] in document && ms) ||\n []\n);\n\nexport default {\n requestFullscreen: element => element[vendor[key.requestFullscreen]](),\n requestFullscreenFunction: element => element[vendor[key.requestFullscreen]],\n get exitFullscreen() { return document[vendor[key.exitFullscreen]].bind(document); },\n get fullscreenPseudoClass() { return `:${vendor[key.fullscreen]}`; },\n addEventListener: (type, handler, options) => document.addEventListener(vendor[key[type]], handler, options),\n removeEventListener: (type, handler, options) => document.removeEventListener(vendor[key[type]], handler, options),\n get fullscreenEnabled() { return Boolean(document[vendor[key.fullscreenEnabled]]); },\n set fullscreenEnabled(val) {},\n get fullscreenElement() { return document[vendor[key.fullscreenElement]]; },\n set fullscreenElement(val) {},\n get onfullscreenchange() { return document[`on${vendor[key.fullscreenchange]}`.toLowerCase()]; },\n set onfullscreenchange(handler) { return document[`on${vendor[key.fullscreenchange]}`.toLowerCase()] = handler; },\n get onfullscreenerror() { return document[`on${vendor[key.fullscreenerror]}`.toLowerCase()]; },\n set onfullscreenerror(handler) { return document[`on${vendor[key.fullscreenerror]}`.toLowerCase()] = handler; },\n};\n"],"names":[],"mappings":"AAAA,IAAM,GAAG,GAAG;IACV,iBAAiB,EAAE,CAAC;IACpB,iBAAiB,EAAE,CAAC;IACpB,iBAAiB,EAAE,CAAC;IACpB,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,CAAC;IACnB,eAAe,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC;CACd,CAAC;AAEF,IAAM,MAAM,GAAG;IACb,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;IACzB,sBAAsB;IACtB,wBAAwB;IACxB,uBAAuB;IACvB,qBAAqB;CACtB,CAAC;AAEF,IAAM,GAAG,GAAG;IACV,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;CACnB,CAAC;AAEF,IAAM,EAAE,GAAG;IACT,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,gBAAgB;CACjB,CAAC;AAEF;AACA,IAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,GAAG,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;AAEhH,IAAM,MAAM,IACV,CAAC,mBAAmB,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;KACnD,MAAM,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC;KAChC,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,GAAG,CAAC;KAC1B,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,IAAI,EAAE,CAAC;IACzB,EA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