native-fn 1.0.61 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/native.cjs +20 -7
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +20 -7
  5. package/dist/native.umd.js +20 -7
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +134 -89
  8. package/dist/plugin/app/index.d.ts +6 -0
  9. package/dist/plugin/app/index.min.cjs +1 -1
  10. package/dist/plugin/app/index.min.mjs +1 -1
  11. package/dist/plugin/app/index.mjs +134 -89
  12. package/dist/plugin/app/index.umd.js +134 -89
  13. package/dist/plugin/app/index.umd.min.js +1 -1
  14. package/dist/plugin/app/src/constants/platform.d.ts +10 -0
  15. package/dist/plugin/app/src/plugin/app/utils/try-open-url.d.ts +15 -0
  16. package/dist/plugin/app/src/types/platform.d.ts +0 -3
  17. package/dist/plugin/camera/index.cjs +19 -6
  18. package/dist/plugin/camera/index.min.cjs +1 -1
  19. package/dist/plugin/camera/index.min.mjs +1 -1
  20. package/dist/plugin/camera/index.mjs +19 -6
  21. package/dist/plugin/camera/index.umd.js +19 -6
  22. package/dist/plugin/camera/index.umd.min.js +1 -1
  23. package/dist/plugin/camera/src/constants/platform.d.ts +10 -0
  24. package/dist/plugin/camera/src/plugin/app/utils/try-open-url.d.ts +15 -0
  25. package/dist/plugin/camera/src/types/platform.d.ts +0 -3
  26. package/dist/plugin/clipboard/index.cjs +225 -212
  27. package/dist/plugin/clipboard/index.min.cjs +1 -1
  28. package/dist/plugin/clipboard/index.min.mjs +1 -1
  29. package/dist/plugin/clipboard/index.mjs +225 -212
  30. package/dist/plugin/clipboard/index.umd.js +225 -212
  31. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  32. package/dist/plugin/clipboard/src/constants/platform.d.ts +10 -0
  33. package/dist/plugin/clipboard/src/plugin/app/utils/try-open-url.d.ts +15 -0
  34. package/dist/plugin/clipboard/src/types/platform.d.ts +0 -3
  35. package/dist/plugin/fullscreen/index.cjs +26 -13
  36. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  37. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  38. package/dist/plugin/fullscreen/index.mjs +26 -13
  39. package/dist/plugin/fullscreen/index.umd.js +26 -13
  40. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  41. package/dist/plugin/fullscreen/src/constants/platform.d.ts +10 -0
  42. package/dist/plugin/fullscreen/src/plugin/app/utils/try-open-url.d.ts +15 -0
  43. package/dist/plugin/fullscreen/src/types/platform.d.ts +0 -3
  44. package/dist/plugin/theme/index.cjs +24 -11
  45. package/dist/plugin/theme/index.min.cjs +1 -1
  46. package/dist/plugin/theme/index.min.mjs +1 -1
  47. package/dist/plugin/theme/index.mjs +24 -11
  48. package/dist/plugin/theme/index.umd.js +24 -11
  49. package/dist/plugin/theme/index.umd.min.js +1 -1
  50. package/dist/plugin/theme/src/constants/platform.d.ts +10 -0
  51. package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +15 -0
  52. package/dist/plugin/theme/src/types/platform.d.ts +0 -3
  53. package/dist/src/constants/platform.d.ts +10 -0
  54. package/dist/src/plugin/app/utils/try-open-url.d.ts +15 -0
  55. package/dist/src/types/platform.d.ts +0 -3
  56. package/package.json +1 -1
@@ -13,7 +13,4 @@ export declare interface PlatformInstance {
13
13
  isMobile: boolean;
14
14
  isDesktop: boolean;
15
15
  isWebview: boolean;
16
- isNodeJS: boolean;
17
- isElectron: boolean;
18
- isReactNative: boolean;
19
16
  }
@@ -62,7 +62,10 @@ var Browsers;
62
62
  Browsers["IE"] = "IE";
63
63
  Browsers["SamsungInternet"] = "SamsungInternet";
64
64
  })(Browsers || (Browsers = {}));
65
- var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
65
+ var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
66
+ var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
67
+ var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
68
+ var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
66
69
  var Platform = {
67
70
  device: Devices.Unknown,
68
71
  os: OS.Unknown,
@@ -77,9 +80,6 @@ var Platform = {
77
80
  isDesktop: false,
78
81
  isStandalone: false,
79
82
  isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
80
- isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
81
- isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
82
- isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
83
83
  };
84
84
  var OS_RESOLVER_MAP = [
85
85
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
@@ -389,7 +389,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
389
389
  break;
390
390
  }
391
391
  }
392
- if (Platform.isReactNative) {
392
+ if (IS_REACT_NATIVE) {
393
393
  try {
394
394
  var reactNative = require('react-native');
395
395
  var platform = reactNative.Platform;
@@ -418,7 +418,7 @@ if (Platform.isReactNative) {
418
418
  catch (_) {
419
419
  }
420
420
  }
421
- if (Platform.isNodeJS) {
421
+ if (IS_NODE_JS) {
422
422
  try {
423
423
  var os = require('os');
424
424
  var platform = os.platform();
@@ -448,6 +448,19 @@ if (Platform.isNodeJS) {
448
448
  catch (_) {
449
449
  }
450
450
  }
451
+ document.addEventListener("deviceready", function () {
452
+ if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
453
+ switch (globalThis.device.platform) {
454
+ case 'Android':
455
+ Platform.os = OS.Android;
456
+ break;
457
+ case 'iOS':
458
+ Platform.os = OS.iOS;
459
+ break;
460
+ }
461
+ Platform.osVersion = globalThis.device.version;
462
+ }
463
+ }, false);
451
464
  if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
452
465
  navigator
453
466
  .userAgentData
@@ -508,7 +521,7 @@ var API_VARIANTS = {
508
521
  },
509
522
  };
510
523
  function detectApi() {
511
- if (Platform.isElectron)
524
+ if (IS_ELECTRON)
512
525
  return null;
513
526
  var element = globalThis.document.documentElement;
514
527
  if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
@@ -545,7 +558,7 @@ function createFullscreenUtils() {
545
558
  var lastElectronBrowserWindowOptions = null;
546
559
  var eventsBridged = false;
547
560
  function getDefaultTarget() {
548
- if (Platform.isElectron) {
561
+ if (IS_ELECTRON) {
549
562
  var electron = require('electron');
550
563
  var focusedWindow = electron.BrowserWindow.getFocusedWindow();
551
564
  if (focusedWindow !== null)
@@ -592,7 +605,7 @@ function createFullscreenUtils() {
592
605
  function emitError() {
593
606
  emit('fullscreenerror');
594
607
  }
595
- if (Platform.isElectron) {
608
+ if (IS_ELECTRON) {
596
609
  try {
597
610
  var electron = require('electron');
598
611
  var allWindows = electron.BrowserWindow.getAllWindows();
@@ -662,7 +675,7 @@ function createFullscreenUtils() {
662
675
  }
663
676
  }
664
677
  function getEnabled() {
665
- if (Platform.isElectron) {
678
+ if (IS_ELECTRON) {
666
679
  try {
667
680
  var electron = require('electron');
668
681
  return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
@@ -688,7 +701,7 @@ function createFullscreenUtils() {
688
701
  return typeof globalThis.document[api.element] !== 'undefined';
689
702
  }
690
703
  function getElement() {
691
- if (Platform.isElectron) {
704
+ if (IS_ELECTRON) {
692
705
  if (lastElectronBrowserWindow !== null)
693
706
  return lastElectronBrowserWindow;
694
707
  try {
@@ -720,7 +733,7 @@ function createFullscreenUtils() {
720
733
  }
721
734
  function request(target, options) {
722
735
  if (target === void 0) { target = getDefaultTarget(); }
723
- if (Platform.isElectron) {
736
+ if (IS_ELECTRON) {
724
737
  var browserWindow_1 = target;
725
738
  return new Promise(function (resolve, reject) {
726
739
  try {
@@ -792,7 +805,7 @@ function createFullscreenUtils() {
792
805
  });
793
806
  }
794
807
  function exit() {
795
- if (Platform.isElectron) {
808
+ if (IS_ELECTRON) {
796
809
  return new Promise(function (resolve, reject) {
797
810
  try {
798
811
  if (lastElectronBrowserWindow !== null) {
@@ -1 +1 @@
1
- "use strict";var e,n,r,o;!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={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/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]],s=[[/\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 u(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 c(e){return void 0===e?"":e.replace(/_/g,".")}function d(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 m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(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?"4.4W":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}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(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}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={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"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){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 u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(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 b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),y={installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}};module.exports=y;
1
+ "use strict";var e,n,r,o;!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={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/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,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/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]],d=[[/\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 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 f(e){return void 0===e?"":e.replace(/_/g,".")}function b(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 w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(O=require("react-native").Platform).OS;var F=g(x=""+O.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(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?"4.4W":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}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,O=(p=require("os")).platform();F=g(x=p.release());switch(O){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(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}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.iOS}s.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var y={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"}}};var M=function(){var n=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return y.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=y[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:y.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,t=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function u(){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 c(){if(l){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),t=0;t<i.length;t++){var a=i[t];if(a.isFullScreen()||s.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var u=globalThis.document[n.element];return null!=u?u:null}function d(){return null!==c()}function m(t,a){if(void 0===t&&(t=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var c=t;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:c.fullScreenable,autoHideMenuBar:c.autoHideMenuBar},c.fullScreenable=!0,c.autoHideMenuBar=!0),c.setFullScreen(!0),o=c,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var l=t[n.request];if("function"==typeof l)try{var c=l.call(t,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===s.os?d():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function d(){if(e.iOS===s.os&&"VIDEO"===t.tagName.toUpperCase()){var n=t;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,u(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function f(){return new Promise(l?function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=c();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(o,i){if(null!==n){var t=globalThis.document[n.exit];if("function"==typeof t){var l=t.call(globalThis.document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===s.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var a=globalThis.document.querySelectorAll("video"),u=0;u<a.length;u++){var d=a[u];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}c()?i():o()})}return function(){if(!t){t=!0;var n=!1;if(l)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),c=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))},d=0;d<i.length;d++)c(d);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))}))}catch(e){}var m=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],f=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(d=0;d<m.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[d],w,!1);for(d=0;d<f.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(f[d],g,!1);if(e.iOS===s.os)if(u(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){u()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function b(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 w(){b("fullscreenchange")}function g(){b("fullscreenerror")}}(),{get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==s.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=globalThis.document[n.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[n.element]}()},get element(){return c()},get isFullscreen(){return d()},request:m,exit:f,toggle:function(e,n){return d()?f():m(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),W={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};module.exports=W;
@@ -1 +1 @@
1
- var e,n,r,o;!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={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/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]],s=[[/\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 u(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 c(e){return void 0===e?"":e.replace(/_/g,".")}function d(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 m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(S=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(S[1].substring(0,2),10)>=26&&(t.osVersion=S[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(j=require("react-native").Platform).OS;var S=f(T=""+j.Version);switch(g){case"android":t.os=e.Android,t.osVersion=function(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?"4.4W":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}(S,T);break;case"ios":t.os=e.iOS,t.osVersion=T;break;case"windows":t.os=e.Windows,t.osVersion=d(S,T);break;case"macos":t.os=e.MacOS,t.osVersion=T}}catch(e){}if(t.isNodeJS)try{var T,j=(g=require("os")).platform();S=f(T=g.release());switch(j){case"win32":t.os=e.Windows,t.osVersion=d(S,T);break;case"darwin":t.os=e.MacOS,t.osVersion=function(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}(S,T);break;case"android":t.os=e.Android,t.osVersion=T;break;case"linux":/android/i.test(T)&&(t.os=e.Android,t.osVersion=T)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={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"}}};var x=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){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 u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(l,a){if(void 0===l&&(l=function(){if(t.isElectron){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===t.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),t.isElectron){var u=l;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:u.fullScreenable,autoHideMenuBar:u.autoHideMenuBar},u.fullScreenable=!0,u.autoHideMenuBar=!0),u.setFullScreen(!0),o=u,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var u=l[n.request];if("function"==typeof u)try{var c=u.call(l,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===t.os?d():i()})):void o()}catch(n){if(e.iOS!==t.os)return void i()}}function d(){if(e.iOS===t.os&&"VIDEO"===l.tagName.toUpperCase()){var n=l;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(o,i){if(null!==n){var l=globalThis.document[n.exit];if("function"==typeof l){var a=l.call(globalThis.document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===t.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var s=globalThis.document.querySelectorAll("video"),c=0;c<s.length;c++){var d=s[c];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}u()?i():o()}))}return function(){if(!l){l=!0;var n=!1;if(t.isElectron)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),u=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))},c=0;c<i.length;c++)u(c);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,b()})),n.on("leave-full-screen",(function(){a(),b()}))}))}catch(e){}var d=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(c=0;c<d.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[c],b,!1);for(c=0;c<m.length;c++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[c],w,!1);if(e.iOS===t.os)if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function f(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 b(){f("fullscreenchange")}function w(){f("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==t.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var l=globalThis.document[n.enabled];return"boolean"==typeof l?l:void 0!==globalThis.document[n.element]}()},get element(){return u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),y={installed:!1,name:"Fullscreen",module:x,Constants:{},Errors:{}};export{y as default};
1
+ var e,n,r,o;!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={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer: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""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/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,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/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]],d=[[/\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 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 f(e){return void 0===e?"":e.replace(/_/g,".")}function b(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 w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===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 l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(O=require("react-native").Platform).OS;var F=g(x=""+O.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(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?"4.4W":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}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,O=(p=require("os")).platform();F=g(x=p.release());switch(O){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(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}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.iOS}s.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var y={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"}}};var M=function(){var n=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return y.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=y[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:y.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,t=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function u(){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 c(){if(l){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),t=0;t<i.length;t++){var a=i[t];if(a.isFullScreen()||s.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var u=globalThis.document[n.element];return null!=u?u:null}function d(){return null!==c()}function m(t,a){if(void 0===t&&(t=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var c=t;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:c.fullScreenable,autoHideMenuBar:c.autoHideMenuBar},c.fullScreenable=!0,c.autoHideMenuBar=!0),c.setFullScreen(!0),o=c,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var l=t[n.request];if("function"==typeof l)try{var c=l.call(t,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===s.os?d():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function d(){if(e.iOS===s.os&&"VIDEO"===t.tagName.toUpperCase()){var n=t;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,u(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function f(){return new Promise(l?function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=c();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(o,i){if(null!==n){var t=globalThis.document[n.exit];if("function"==typeof t){var l=t.call(globalThis.document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===s.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var a=globalThis.document.querySelectorAll("video"),u=0;u<a.length;u++){var d=a[u];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}c()?i():o()})}return function(){if(!t){t=!0;var n=!1;if(l)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),c=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))},d=0;d<i.length;d++)c(d);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))}))}catch(e){}var m=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],f=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(d=0;d<m.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[d],w,!1);for(d=0;d<f.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(f[d],g,!1);if(e.iOS===s.os)if(u(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){u()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function b(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 w(){b("fullscreenchange")}function g(){b("fullscreenerror")}}(),{get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==s.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=globalThis.document[n.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[n.element]}()},get element(){return c()},get isFullscreen(){return d()},request:m,exit:f,toggle:function(e,n){return d()?f():m(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),W={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};export{W as default};
@@ -60,7 +60,10 @@ var Browsers;
60
60
  Browsers["IE"] = "IE";
61
61
  Browsers["SamsungInternet"] = "SamsungInternet";
62
62
  })(Browsers || (Browsers = {}));
63
- var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
63
+ var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
64
+ var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
65
+ var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
66
+ var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
64
67
  var Platform = {
65
68
  device: Devices.Unknown,
66
69
  os: OS.Unknown,
@@ -75,9 +78,6 @@ var Platform = {
75
78
  isDesktop: false,
76
79
  isStandalone: false,
77
80
  isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
78
- isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
79
- isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
80
- isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
81
81
  };
82
82
  var OS_RESOLVER_MAP = [
83
83
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
@@ -387,7 +387,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
387
387
  break;
388
388
  }
389
389
  }
390
- if (Platform.isReactNative) {
390
+ if (IS_REACT_NATIVE) {
391
391
  try {
392
392
  var reactNative = require('react-native');
393
393
  var platform = reactNative.Platform;
@@ -416,7 +416,7 @@ if (Platform.isReactNative) {
416
416
  catch (_) {
417
417
  }
418
418
  }
419
- if (Platform.isNodeJS) {
419
+ if (IS_NODE_JS) {
420
420
  try {
421
421
  var os = require('os');
422
422
  var platform = os.platform();
@@ -446,6 +446,19 @@ if (Platform.isNodeJS) {
446
446
  catch (_) {
447
447
  }
448
448
  }
449
+ document.addEventListener("deviceready", function () {
450
+ if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
451
+ switch (globalThis.device.platform) {
452
+ case 'Android':
453
+ Platform.os = OS.Android;
454
+ break;
455
+ case 'iOS':
456
+ Platform.os = OS.iOS;
457
+ break;
458
+ }
459
+ Platform.osVersion = globalThis.device.version;
460
+ }
461
+ }, false);
449
462
  if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
450
463
  navigator
451
464
  .userAgentData
@@ -506,7 +519,7 @@ var API_VARIANTS = {
506
519
  },
507
520
  };
508
521
  function detectApi() {
509
- if (Platform.isElectron)
522
+ if (IS_ELECTRON)
510
523
  return null;
511
524
  var element = globalThis.document.documentElement;
512
525
  if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
@@ -543,7 +556,7 @@ function createFullscreenUtils() {
543
556
  var lastElectronBrowserWindowOptions = null;
544
557
  var eventsBridged = false;
545
558
  function getDefaultTarget() {
546
- if (Platform.isElectron) {
559
+ if (IS_ELECTRON) {
547
560
  var electron = require('electron');
548
561
  var focusedWindow = electron.BrowserWindow.getFocusedWindow();
549
562
  if (focusedWindow !== null)
@@ -590,7 +603,7 @@ function createFullscreenUtils() {
590
603
  function emitError() {
591
604
  emit('fullscreenerror');
592
605
  }
593
- if (Platform.isElectron) {
606
+ if (IS_ELECTRON) {
594
607
  try {
595
608
  var electron = require('electron');
596
609
  var allWindows = electron.BrowserWindow.getAllWindows();
@@ -660,7 +673,7 @@ function createFullscreenUtils() {
660
673
  }
661
674
  }
662
675
  function getEnabled() {
663
- if (Platform.isElectron) {
676
+ if (IS_ELECTRON) {
664
677
  try {
665
678
  var electron = require('electron');
666
679
  return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
@@ -686,7 +699,7 @@ function createFullscreenUtils() {
686
699
  return typeof globalThis.document[api.element] !== 'undefined';
687
700
  }
688
701
  function getElement() {
689
- if (Platform.isElectron) {
702
+ if (IS_ELECTRON) {
690
703
  if (lastElectronBrowserWindow !== null)
691
704
  return lastElectronBrowserWindow;
692
705
  try {
@@ -718,7 +731,7 @@ function createFullscreenUtils() {
718
731
  }
719
732
  function request(target, options) {
720
733
  if (target === void 0) { target = getDefaultTarget(); }
721
- if (Platform.isElectron) {
734
+ if (IS_ELECTRON) {
722
735
  var browserWindow_1 = target;
723
736
  return new Promise(function (resolve, reject) {
724
737
  try {
@@ -790,7 +803,7 @@ function createFullscreenUtils() {
790
803
  });
791
804
  }
792
805
  function exit() {
793
- if (Platform.isElectron) {
806
+ if (IS_ELECTRON) {
794
807
  return new Promise(function (resolve, reject) {
795
808
  try {
796
809
  if (lastElectronBrowserWindow !== null) {
@@ -66,7 +66,10 @@
66
66
  Browsers["IE"] = "IE";
67
67
  Browsers["SamsungInternet"] = "SamsungInternet";
68
68
  })(Browsers || (Browsers = {}));
69
- var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
69
+ var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
70
+ var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
71
+ var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
72
+ var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
70
73
  var Platform = {
71
74
  device: Devices.Unknown,
72
75
  os: OS.Unknown,
@@ -81,9 +84,6 @@
81
84
  isDesktop: false,
82
85
  isStandalone: false,
83
86
  isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
84
- isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
85
- isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
86
- isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
87
87
  };
88
88
  var OS_RESOLVER_MAP = [
89
89
  [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
@@ -393,7 +393,7 @@
393
393
  break;
394
394
  }
395
395
  }
396
- if (Platform.isReactNative) {
396
+ if (IS_REACT_NATIVE) {
397
397
  try {
398
398
  var reactNative = require('react-native');
399
399
  var platform = reactNative.Platform;
@@ -422,7 +422,7 @@
422
422
  catch (_) {
423
423
  }
424
424
  }
425
- if (Platform.isNodeJS) {
425
+ if (IS_NODE_JS) {
426
426
  try {
427
427
  var os = require('os');
428
428
  var platform = os.platform();
@@ -452,6 +452,19 @@
452
452
  catch (_) {
453
453
  }
454
454
  }
455
+ document.addEventListener("deviceready", function () {
456
+ if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
457
+ switch (globalThis.device.platform) {
458
+ case 'Android':
459
+ Platform.os = OS.Android;
460
+ break;
461
+ case 'iOS':
462
+ Platform.os = OS.iOS;
463
+ break;
464
+ }
465
+ Platform.osVersion = globalThis.device.version;
466
+ }
467
+ }, false);
455
468
  if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
456
469
  navigator
457
470
  .userAgentData
@@ -512,7 +525,7 @@
512
525
  },
513
526
  };
514
527
  function detectApi() {
515
- if (Platform.isElectron)
528
+ if (IS_ELECTRON)
516
529
  return null;
517
530
  var element = globalThis.document.documentElement;
518
531
  if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
@@ -549,7 +562,7 @@
549
562
  var lastElectronBrowserWindowOptions = null;
550
563
  var eventsBridged = false;
551
564
  function getDefaultTarget() {
552
- if (Platform.isElectron) {
565
+ if (IS_ELECTRON) {
553
566
  var electron = require('electron');
554
567
  var focusedWindow = electron.BrowserWindow.getFocusedWindow();
555
568
  if (focusedWindow !== null)
@@ -596,7 +609,7 @@
596
609
  function emitError() {
597
610
  emit('fullscreenerror');
598
611
  }
599
- if (Platform.isElectron) {
612
+ if (IS_ELECTRON) {
600
613
  try {
601
614
  var electron = require('electron');
602
615
  var allWindows = electron.BrowserWindow.getAllWindows();
@@ -666,7 +679,7 @@
666
679
  }
667
680
  }
668
681
  function getEnabled() {
669
- if (Platform.isElectron) {
682
+ if (IS_ELECTRON) {
670
683
  try {
671
684
  var electron = require('electron');
672
685
  return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
@@ -692,7 +705,7 @@
692
705
  return typeof globalThis.document[api.element] !== 'undefined';
693
706
  }
694
707
  function getElement() {
695
- if (Platform.isElectron) {
708
+ if (IS_ELECTRON) {
696
709
  if (lastElectronBrowserWindow !== null)
697
710
  return lastElectronBrowserWindow;
698
711
  try {
@@ -724,7 +737,7 @@
724
737
  }
725
738
  function request(target, options) {
726
739
  if (target === void 0) { target = getDefaultTarget(); }
727
- if (Platform.isElectron) {
740
+ if (IS_ELECTRON) {
728
741
  var browserWindow_1 = target;
729
742
  return new Promise(function (resolve, reject) {
730
743
  try {
@@ -796,7 +809,7 @@
796
809
  });
797
810
  }
798
811
  function exit() {
799
- if (Platform.isElectron) {
812
+ if (IS_ELECTRON) {
800
813
  return new Promise(function (resolve, reject) {
801
814
  try {
802
815
  if (lastElectronBrowserWindow !== null) {