UNPKG

native-fn

Version:
2 lines (1 loc) 19.8 kB
var e,n,r,o,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",a={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"},l="loading",s=[],u=0,c={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:o.Unknown,version:""},crossPlatformFramework:i.Unknown,userAgent:t,get readyState(){return l},get locale(){return function(){var e={language:null,languages:[],timezone:null,timezoneOffset:0};function n(e){for(var n=0;n<e.length;n++)r(e[n])}function r(n){"string"==typeof(n=F(n))&&-1===e.languages.indexOf(n)&&(null===e.language&&(e.language=n),e.languages.push(n))}if(c.crossPlatformFramework===i.ReactNative)try{var o=require("react-native").NativeModules;if(void 0!==o.SettingsManager){var t=o.SettingsManager;if(void 0!==t)if(void 0!==(l="function"==typeof t.getConstants?t.getConstants():t)&&void 0!==l.settings){var a=l.settings;"string"==typeof a.AppleLocale&&r(a.AppleLocale),Array.isArray(a.AppleLanguages)&&a.AppleLanguages.length>0&&n(a.AppleLanguages)}}if(void 0!==o.I18nManager){var l,s=o.I18nManager;if(void 0!==s)void 0!==(l="function"==typeof s.getConstants?s.getConstants():s)&&void 0!==l.localeIdentifier&&r(l.localeIdentifier)}}catch(e){}if(c.crossPlatformFramework===i.Electron)try{var u=require("electron").app;void 0!==u.getLocale&&r(u.getLocale()),void 0!==u.getSystemLocale&&r(u.getSystemLocale()),void 0!==u.getPreferredSystemLanguages&&n(u.getPreferredSystemLanguages())}catch(e){}if("undefined"!=typeof Intl){try{r(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&n(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&r(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&r(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&r(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&r(globalThis.navigator.systemLanguage));try{e.timezoneOffset=(new Date).getTimezoneOffset()}catch(e){}return e}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?n.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?n.Desktop:n.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches},onready:function(e){if("complete"===this.readyState)try{e(this)}catch(e){}else s.push(e)}};function m(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function d(e){return void 0===e?"":e.replace(/_/g,".")}var g=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,d],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,d],[/cfnetwork\/.+darwin/i,e.iOS,d],[/mac os x ?([\w. ]*)/i,e.MacOS,d],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,d],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],f=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function b(){u--,w()}function w(){if(0===u&&"loading"===l){l="complete";for(var e=0;e<s.length;e++)try{s[e](c)}catch(e){}s.length=0}}function h(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function p(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}function T(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}function k(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function E(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}function S(){if(c.crossPlatformFramework=i.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":c.os={name:e.Android,version:globalThis.device.version};break;case"iOS":c.os={name:e.iOS,version:globalThis.device.version}}b()}function F(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e.toLowerCase())return"en-US";if(-1!==e.indexOf("."))return F(e.split(".")[0]);if(-1!==e.indexOf("@"))return F(e.split("@")[0]);var n=e.split("-");return 0===n.length?null:(n[0]=n[0].toLowerCase(),n.length>1&&2===n[1].length&&(n[1]=n[1].toUpperCase()),n.length>2&&4===n[1].length&&(n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase()),n.join("-"))}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(c.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(c.crossPlatformFramework=i.ReactNative);for(var r=0;r<g.length;r++){var l=(F=g[r])[0],s=F[1],m=F[2];if(null!==(j=c.userAgent.match(l))){c.os={name:s,version:k(j[1],m)};break}}for(c.os.name===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var a=void 0,l=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(l=t<o.length?parseInt(o[t],10):0))return 1;if(a<l)return-1}return 0}(c.os.version,"18.6")&&null!==(O=/\) Version\/([\d.]+)/.exec(c.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(c.os.version=O[1]),r=0;r<f.length;r++){l=(F=f[r])[0];var d=F[1];m=F[2];if(null!==(j=c.userAgent.match(l))){c.engine={name:d,version:k(j[1],m)};break}}for(r=0;r<v.length;r++){l=(F=v[r])[0];var F,j,y=F[1];m=F[2];if(null!==(j=c.userAgent.match(l))){c.browser={name:y,version:k(j[1],m)};break}}if(c.crossPlatformFramework===i.ReactNative)try{s=(M=require("react-native").Platform).OS;var O=E(x=""+M.Version);switch(s){case"android":c.os={name:e.Android,version:T(O,x)};break;case"ios":c.os={name:e.iOS,version:x};break;case"windows":c.os={name:e.Windows,version:h(O,x)};break;case"macos":c.os={name:e.MacOS,version:x}}}catch(e){}if(c.isNode)try{var x,M=(s=require("os")).platform();O=E(x=s.release());switch(M){case"win32":c.os={name:e.Windows,version:h(O,x)};break;case"darwin":c.os={name:e.MacOS,version:p(O,x)};break;case"android":c.os={name:e.Android,version:x};break;case"linux":/android/i.test(x)&&(c.os={name:e.Android,version:x})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?S():globalThis.document.addEventListener("deviceready",S,!1)),void 0!==globalThis.navigator&&void 0!==globalThis.navigator.userAgentData&&void 0!==globalThis.navigator.userAgentData.getHighEntropyValues&&(u++,globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){try{for(var i=r.fullVersionList||r.brands||[],t=r.platformVersion,l=r.platform,s=c.browser.name,u=null,m=0;m<i.length;m++){var d=null==(v=i[m])?{brand:"",version:""}:"string"==typeof v?{brand:v,version:""}:{brand:v.brand,version:v.version},g=d.version,f=d.brand;/not.a.brand/i.test(f)||((null===u||/Chrom/.test(u)&&"Chromium"!==f||"Edge"===u&&/WebView2/.test(f))&&(f=a[f]||f,null!==(u=s)&&!/Chrom/.test(u)&&/Chrom/.test(f)||("Chrome"===(s=f)||"Chrome WebView"===s||"Chrome Headless"===s?c.browser.name=o.Chrome:"Edge"===s||"Edge WebView2"===s?c.browser.name=o.Edge:"Opera Mobi"===s&&(c.browser.name=o.Opera),c.browser.version=g),u=f),"Chromium"===f&&(c.engine.version=g))}"string"==typeof t&&(c.os.name===e.Windows?c.os.version=parseInt(t.split(".")[0],10)>=13?"11":"10":c.os.version=t),"string"==typeof l&&(/android/i.test(l)?c.os.name=e.Android:/ios|iphone|ipad/i.test(l)?c.os.name=e.iOS:/windows|win32/i.test(l)?c.os.name=e.Windows:/macos|macintel/i.test(l)&&(c.os.name=e.MacOS)),!0===r.mobile&&(c.device=n.Mobile)}catch(e){}finally{b()}var v}))),w()}();var j={get enabled(){return function(){if(c.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===C){if(c.os.name!==e.iOS)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[C.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[C.element]}()},get element(){return P()},get isFullscreen(){return N()},request:q,exit:I,toggle:function(e,n){return N()?I():q(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},y=null,O=null,x=null,M=!1,C=function(){if(c.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return A.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],t=A[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var a={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:A.webkit.events};return"webkitRequestFullScreen"in e&&(a.request="webkitRequestFullScreen"),a}return null}(),A={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function L(){null!==x&&(null!==O&&(O.fullScreenable=x.fullScreenable,O.autoHideMenuBar=x.autoHideMenuBar),x=null),O=null}function W(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function P(){if(c.crossPlatformFramework===i.Electron){if(null!==O)return O;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||c.os.name===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===C)return y&&y.webkitDisplayingFullscreen?y:null;var t=globalThis.document[C.element];return null!=t?t:null}function N(){return null!==P()}function q(n,r){if(void 0===n&&(n=function(){if(c.crossPlatformFramework===i.Electron){var n=require("electron").BrowserWindow,r=n.getFocusedWindow()||n.getAllWindows()[0];if(void 0===r)throw new Error;return r}if(c.os.name===e.iOS){var o=globalThis.document.querySelector("video");if(null===o)throw new Error;return o}return globalThis.document.documentElement}()),c.crossPlatformFramework===i.Electron){var o=n;return new Promise((function(e,n){try{return null===O&&(x={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),O=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==C){var t=n[C.request];if("function"==typeof t)try{var a=t.call(n,r);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){c.os.name===e.iOS?l():i()})):void o()}catch(n){if(c.os.name!==e.iOS)return void i()}}function l(){if(c.os.name===e.iOS&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return y=r,W(),r.webkitEnterFullscreen(),void o()}i()}l()}))}function I(){return c.crossPlatformFramework===i.Electron?new Promise((function(e,n){try{if(null!==O)O.setFullScreen(!1),L();else{var r=P();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(n,r){if(null!==C){var o=globalThis.document[C.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(c.os.name===e.iOS&&null!==y){if("function"==typeof y.webkitExitFullscreen&&!0===y.webkitDisplayingFullscreen)return y.webkitExitFullscreen(),y=null,void n();for(var t=globalThis.document.querySelectorAll("video"),a=0;a<t.length;a++){var l=t[a];if("function"==typeof l.webkitExitFullscreen&&!0===l.webkitDisplayingFullscreen)return l.webkitExitFullscreen(),void n()}}P()?r():n()}))}!function(){if(!M){M=!0;var n=!1;if(c.crossPlatformFramework===i.Electron)try{for(var r=require("electron").BrowserWindow,o=r.getAllWindows(),t=function(e){var n=o[e];n.on("enter-full-screen",(function(){O=n,m()})),n.on("leave-full-screen",(function(){L(),m()}))},a=0;a<o.length;a++)t(a);"function"==typeof r.on&&r.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){O=n,m()})),n.on("leave-full-screen",(function(){L(),m()}))}))}catch(e){}var l=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(a=0;a<l.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(l[a],m,!1);for(a=0;a<s.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[a],d,!1);if(c.os.name===e.iOS)if(W(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){W()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function u(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function m(){u("fullscreenchange")}function d(){u("fullscreenerror")}}();var R={installed:!1,name:"Fullscreen",module:j,Constants:{},Errors:{}};export{R as default};