native-fn 1.0.53 → 1.0.56
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.
- package/dist/native.cjs +1 -1
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/native.umd.js +1 -1
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +5 -9
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +5 -9
- package/dist/plugin/app/index.umd.js +5 -9
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -1
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -1
- package/dist/plugin/clipboard/index.cjs +519 -2
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +519 -2
- package/dist/plugin/clipboard/index.umd.js +519 -2
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -1
- package/dist/plugin/fullscreen/index.cjs +50 -22
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +50 -22
- package/dist/plugin/fullscreen/index.umd.js +50 -22
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -1
- package/dist/plugin/theme/index.cjs +32 -9
- package/dist/plugin/theme/index.d.ts +2 -1
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +32 -9
- package/dist/plugin/theme/index.umd.js +32 -9
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -1
- package/dist/src/plugin/theme/types/theme.d.ts +2 -1
- package/package.json +1 -1
|
@@ -508,6 +508,8 @@ var API_VARIANTS = {
|
|
|
508
508
|
},
|
|
509
509
|
};
|
|
510
510
|
function detectApi() {
|
|
511
|
+
if (Platform.isElectron)
|
|
512
|
+
return null;
|
|
511
513
|
var element = globalThis.document.documentElement;
|
|
512
514
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
513
515
|
return API_VARIANTS.standard;
|
|
@@ -552,7 +554,8 @@ function createFullscreenUtils() {
|
|
|
552
554
|
if (dispatching)
|
|
553
555
|
return;
|
|
554
556
|
dispatching = true;
|
|
555
|
-
globalThis.document
|
|
557
|
+
if (typeof globalThis.document !== 'undefined')
|
|
558
|
+
globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
|
|
556
559
|
Promise.resolve().then(function () {
|
|
557
560
|
dispatching = false;
|
|
558
561
|
});
|
|
@@ -566,37 +569,45 @@ function createFullscreenUtils() {
|
|
|
566
569
|
var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
|
|
567
570
|
var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
|
|
568
571
|
changeEvents.forEach(function (eventType) {
|
|
569
|
-
globalThis.document
|
|
572
|
+
if (typeof globalThis.document !== 'undefined')
|
|
573
|
+
globalThis.document.addEventListener(eventType, emitChange, false);
|
|
570
574
|
});
|
|
571
575
|
errorEvents.forEach(function (eventType) {
|
|
572
|
-
globalThis.document
|
|
576
|
+
if (typeof globalThis.document !== 'undefined')
|
|
577
|
+
globalThis.document.addEventListener(eventType, emitError, false);
|
|
573
578
|
});
|
|
574
579
|
if (isIOS()) {
|
|
575
580
|
bridgeIOSVideoEvents();
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
581
|
+
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
582
|
+
var observer = new MutationObserver(function () {
|
|
583
|
+
bridgeIOSVideoEvents();
|
|
584
|
+
});
|
|
585
|
+
observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
|
|
586
|
+
}
|
|
580
587
|
}
|
|
581
588
|
}
|
|
582
589
|
function bridgeIOSVideoEvents() {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
590
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
591
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
592
|
+
videos.forEach(function (video) {
|
|
593
|
+
if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
|
|
594
|
+
return;
|
|
595
|
+
function emitChange() {
|
|
596
|
+
globalThis.document.dispatchEvent(new Event('fullscreenchange'));
|
|
597
|
+
}
|
|
598
|
+
video.addEventListener('webkitbeginfullscreen', emitChange, false);
|
|
599
|
+
video.addEventListener('webkitendfullscreen', emitChange, false);
|
|
600
|
+
video.__fsBridged__ = true;
|
|
601
|
+
});
|
|
602
|
+
}
|
|
594
603
|
}
|
|
595
604
|
function getEnabled() {
|
|
605
|
+
if (Platform.isElectron)
|
|
606
|
+
return true;
|
|
596
607
|
if (api === null) {
|
|
597
608
|
if (!isIOS())
|
|
598
609
|
return false;
|
|
599
|
-
var videos = document.querySelectorAll('video');
|
|
610
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
600
611
|
for (var i = 0; i < videos.length; i++) {
|
|
601
612
|
var video = videos[i];
|
|
602
613
|
if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
|
|
@@ -604,18 +615,35 @@ function createFullscreenUtils() {
|
|
|
604
615
|
}
|
|
605
616
|
return false;
|
|
606
617
|
}
|
|
607
|
-
var enabledValue = document[api.enabled];
|
|
618
|
+
var enabledValue = globalThis.document[api.enabled];
|
|
608
619
|
if (typeof enabledValue === 'boolean')
|
|
609
620
|
return enabledValue;
|
|
610
|
-
return typeof document[api.element] !== 'undefined';
|
|
621
|
+
return typeof globalThis.document[api.element] !== 'undefined';
|
|
611
622
|
}
|
|
612
623
|
function getElement() {
|
|
624
|
+
if (Platform.isElectron) {
|
|
625
|
+
try {
|
|
626
|
+
var electron = require('electron');
|
|
627
|
+
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
628
|
+
var all = electron.BrowserWindow.getAllWindows();
|
|
629
|
+
for (var i = 0; i < all.length; i++) {
|
|
630
|
+
var cur = all[i];
|
|
631
|
+
console.log(cur.isFullscreen() || (Platform.os === OS.MacOS && typeof cur.isSimpleFullScreen === 'function' && cur.isSimpleFullScreen()));
|
|
632
|
+
}
|
|
633
|
+
if (focusedWindow !== null && (focusedWindow.isFullscreen() || (Platform.os === OS.MacOS && typeof focusedWindow.isSimpleFullScreen === 'function' && focusedWindow.isSimpleFullScreen())))
|
|
634
|
+
return focusedWindow;
|
|
635
|
+
return null;
|
|
636
|
+
}
|
|
637
|
+
catch (_) {
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
613
641
|
if (api === null) {
|
|
614
642
|
if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
|
|
615
643
|
return lastIOSVideo;
|
|
616
644
|
return null;
|
|
617
645
|
}
|
|
618
|
-
var currentElement = document[api.element];
|
|
646
|
+
var currentElement = globalThis.document[api.element];
|
|
619
647
|
if (currentElement !== null && currentElement !== undefined)
|
|
620
648
|
return currentElement;
|
|
621
649
|
return 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},a=[[/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]],s=[[/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]],l=[[/\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 m(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 d(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<a.length;b++){var w=(p=a[b])[0],v=p[1],g=p[2];if(null!==(k=t.userAgent.match(w))){t.os=v,t.osVersion=d(k[1],g);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 a=void 0,s=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(s=t<o.length?parseInt(o[t],10):0))return 1;if(a<s)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[1]));for(b=0;b<s.length;b++){w=(p=s[b])[0];var h=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=d(k[1],g);break}}for(b=0;b<l.length;b++){w=(p=l[b])[0];var p,k,E=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=d(k[1],g);break}}if(t.isReactNative)try{v=(S=require("react-native").Platform).OS;var j=f(F=""+S.Version);switch(v){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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=m(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,S=(v=require("os")).platform();j=f(F=v.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=m(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,a=0;a<o.length;a++){var s=null==(r=o[a])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=s.brand,u=s.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 T={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 x(){return e.iOS===t.os}var M=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return T.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=T[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:T.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),n=null,r=!1;function o(){document.querySelectorAll("video").forEach((function(e){function n(){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 i(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function t(){return null!==i()}function a(r,i){return new Promise((function(t,a){if(null!==e){var s=r[e.request];if("function"==typeof s)try{var l=s.call(r,i);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():a()})):void t()}catch(e){if(!x())return void a()}}function u(){if(x()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,o(),e.webkitEnterFullscreen(),void t()}a()}u()}))}function s(){return new Promise((function(r,o){if(null!==e){var t=document[e.exit];if("function"==typeof t){var a=t.call(document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){r()})).catch((function(){o()})):void r()}}if(x()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var s=document.querySelectorAll("video"),l=0;l<s.length;l++){var u=s[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void r()}}i()?o():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,i,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),x())o(),new MutationObserver((function(){o()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function i(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!x())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=document[e.enabled];return"boolean"==typeof i?i:void 0!==document[e.element]}()},get element(){return i()},get isFullscreen(){return t()},request:a,exit:s,toggle:function(e,n){return t()?s():a(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),V={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};module.exports=V;
|
|
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},a=[[/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]],s=[[/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]],l=[[/\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 m(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 d(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<a.length;b++){var w=(p=a[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=d(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 a=void 0,s=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(s=t<o.length?parseInt(o[t],10):0))return 1;if(a<s)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[1]));for(b=0;b<s.length;b++){w=(p=s[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=d(k[1],v);break}}for(b=0;b<l.length;b++){w=(p=l[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=d(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var j=f(F=""+S.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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=m(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,S=(g=require("os")).platform();j=f(F=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=m(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,a=0;a<o.length;a++){var s=null==(r=o[a])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=s.brand,u=s.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 T={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 x(){return e.iOS===t.os}var M=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return T.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=T[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:T.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=!1;function i(){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 a(){if(t.isElectron)try{for(var o=require("electron"),i=o.BrowserWindow.getFocusedWindow(),a=o.BrowserWindow.getAllWindows(),s=0;s<a.length;s++){var l=a[s];console.log(l.isFullscreen()||t.os===e.MacOS&&"function"==typeof l.isSimpleFullScreen&&l.isSimpleFullScreen())}return null!==i&&(i.isFullscreen()||t.os===e.MacOS&&"function"==typeof i.isSimpleFullScreen&&i.isSimpleFullScreen())?i: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 s(){return null!==a()}function l(e,o){return new Promise((function(t,a){if(null!==n){var s=e[n.request];if("function"==typeof s)try{var l=s.call(e,o);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():a()})):void t()}catch(e){if(!x())return void a()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,i(),n.webkitEnterFullscreen(),void t()}a()}u()}))}function u(){return new Promise((function(e,o){if(null!==n){var i=document[n.exit];if("function"==typeof i){var t=i.call(document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var s=document.querySelectorAll("video"),l=0;l<s.length;l++){var u=s[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void e()}}a()?o():e()}))}return function(){if(!o){o=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,r,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,t,!1)})),x())if(i(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function r(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)return!0;if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return a()},get isFullscreen(){return s()},request:l,exit:u,toggle:function(e,n){return s()?u():l(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),O={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};module.exports=O;
|
|
@@ -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},a=[[/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]],s=[[/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]],l=[[/\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 m(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 d(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<a.length;b++){var w=(p=a[b])[0],v=p[1],g=p[2];if(null!==(k=t.userAgent.match(w))){t.os=v,t.osVersion=d(k[1],g);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 a=void 0,s=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(s=t<o.length?parseInt(o[t],10):0))return 1;if(a<s)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[1]));for(b=0;b<s.length;b++){w=(p=s[b])[0];var h=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=d(k[1],g);break}}for(b=0;b<l.length;b++){w=(p=l[b])[0];var p,k,E=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=d(k[1],g);break}}if(t.isReactNative)try{v=(S=require("react-native").Platform).OS;var j=f(F=""+S.Version);switch(v){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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=m(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,S=(v=require("os")).platform();j=f(F=v.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=m(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,a=0;a<o.length;a++){var s=null==(r=o[a])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=s.brand,u=s.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 T={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 x(){return e.iOS===t.os}var M=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return T.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=T[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:T.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),n=null,r=!1;function o(){document.querySelectorAll("video").forEach((function(e){function n(){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 i(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function t(){return null!==i()}function a(r,i){return new Promise((function(t,a){if(null!==e){var s=r[e.request];if("function"==typeof s)try{var l=s.call(r,i);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():a()})):void t()}catch(e){if(!x())return void a()}}function u(){if(x()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,o(),e.webkitEnterFullscreen(),void t()}a()}u()}))}function s(){return new Promise((function(r,o){if(null!==e){var t=document[e.exit];if("function"==typeof t){var a=t.call(document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){r()})).catch((function(){o()})):void r()}}if(x()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var s=document.querySelectorAll("video"),l=0;l<s.length;l++){var u=s[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void r()}}i()?o():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,i,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),x())o(),new MutationObserver((function(){o()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function i(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!x())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=document[e.enabled];return"boolean"==typeof i?i:void 0!==document[e.element]}()},get element(){return i()},get isFullscreen(){return t()},request:a,exit:s,toggle:function(e,n){return t()?s():a(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),V={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};export{V 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="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},a=[[/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]],s=[[/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]],l=[[/\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<a.length;b++){var w=(p=a[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 a=void 0,s=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(s=t<o.length?parseInt(o[t],10):0))return 1;if(a<s)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[1]));for(b=0;b<s.length;b++){w=(p=s[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<l.length;b++){w=(p=l[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=(S=require("react-native").Platform).OS;var j=f(F=""+S.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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=d(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,S=(g=require("os")).platform();j=f(F=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,a=0;a<o.length;a++){var s=null==(r=o[a])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=s.brand,u=s.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 T={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 x(){return e.iOS===t.os}var M=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return T.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=T[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:T.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=!1;function i(){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 a(){if(t.isElectron)try{for(var o=require("electron"),i=o.BrowserWindow.getFocusedWindow(),a=o.BrowserWindow.getAllWindows(),s=0;s<a.length;s++){var l=a[s];console.log(l.isFullscreen()||t.os===e.MacOS&&"function"==typeof l.isSimpleFullScreen&&l.isSimpleFullScreen())}return null!==i&&(i.isFullscreen()||t.os===e.MacOS&&"function"==typeof i.isSimpleFullScreen&&i.isSimpleFullScreen())?i: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 s(){return null!==a()}function l(e,o){return new Promise((function(t,a){if(null!==n){var s=e[n.request];if("function"==typeof s)try{var l=s.call(e,o);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():a()})):void t()}catch(e){if(!x())return void a()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,i(),n.webkitEnterFullscreen(),void t()}a()}u()}))}function u(){return new Promise((function(e,o){if(null!==n){var i=document[n.exit];if("function"==typeof i){var t=i.call(document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var s=document.querySelectorAll("video"),l=0;l<s.length;l++){var u=s[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void e()}}a()?o():e()}))}return function(){if(!o){o=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,r,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,t,!1)})),x())if(i(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function r(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)return!0;if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return a()},get isFullscreen(){return s()},request:l,exit:u,toggle:function(e,n){return s()?u():l(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),O={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};export{O as default};
|
|
@@ -506,6 +506,8 @@ var API_VARIANTS = {
|
|
|
506
506
|
},
|
|
507
507
|
};
|
|
508
508
|
function detectApi() {
|
|
509
|
+
if (Platform.isElectron)
|
|
510
|
+
return null;
|
|
509
511
|
var element = globalThis.document.documentElement;
|
|
510
512
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
511
513
|
return API_VARIANTS.standard;
|
|
@@ -550,7 +552,8 @@ function createFullscreenUtils() {
|
|
|
550
552
|
if (dispatching)
|
|
551
553
|
return;
|
|
552
554
|
dispatching = true;
|
|
553
|
-
globalThis.document
|
|
555
|
+
if (typeof globalThis.document !== 'undefined')
|
|
556
|
+
globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
|
|
554
557
|
Promise.resolve().then(function () {
|
|
555
558
|
dispatching = false;
|
|
556
559
|
});
|
|
@@ -564,37 +567,45 @@ function createFullscreenUtils() {
|
|
|
564
567
|
var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
|
|
565
568
|
var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
|
|
566
569
|
changeEvents.forEach(function (eventType) {
|
|
567
|
-
globalThis.document
|
|
570
|
+
if (typeof globalThis.document !== 'undefined')
|
|
571
|
+
globalThis.document.addEventListener(eventType, emitChange, false);
|
|
568
572
|
});
|
|
569
573
|
errorEvents.forEach(function (eventType) {
|
|
570
|
-
globalThis.document
|
|
574
|
+
if (typeof globalThis.document !== 'undefined')
|
|
575
|
+
globalThis.document.addEventListener(eventType, emitError, false);
|
|
571
576
|
});
|
|
572
577
|
if (isIOS()) {
|
|
573
578
|
bridgeIOSVideoEvents();
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
579
|
+
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
580
|
+
var observer = new MutationObserver(function () {
|
|
581
|
+
bridgeIOSVideoEvents();
|
|
582
|
+
});
|
|
583
|
+
observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
|
|
584
|
+
}
|
|
578
585
|
}
|
|
579
586
|
}
|
|
580
587
|
function bridgeIOSVideoEvents() {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
588
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
589
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
590
|
+
videos.forEach(function (video) {
|
|
591
|
+
if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
|
|
592
|
+
return;
|
|
593
|
+
function emitChange() {
|
|
594
|
+
globalThis.document.dispatchEvent(new Event('fullscreenchange'));
|
|
595
|
+
}
|
|
596
|
+
video.addEventListener('webkitbeginfullscreen', emitChange, false);
|
|
597
|
+
video.addEventListener('webkitendfullscreen', emitChange, false);
|
|
598
|
+
video.__fsBridged__ = true;
|
|
599
|
+
});
|
|
600
|
+
}
|
|
592
601
|
}
|
|
593
602
|
function getEnabled() {
|
|
603
|
+
if (Platform.isElectron)
|
|
604
|
+
return true;
|
|
594
605
|
if (api === null) {
|
|
595
606
|
if (!isIOS())
|
|
596
607
|
return false;
|
|
597
|
-
var videos = document.querySelectorAll('video');
|
|
608
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
598
609
|
for (var i = 0; i < videos.length; i++) {
|
|
599
610
|
var video = videos[i];
|
|
600
611
|
if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
|
|
@@ -602,18 +613,35 @@ function createFullscreenUtils() {
|
|
|
602
613
|
}
|
|
603
614
|
return false;
|
|
604
615
|
}
|
|
605
|
-
var enabledValue = document[api.enabled];
|
|
616
|
+
var enabledValue = globalThis.document[api.enabled];
|
|
606
617
|
if (typeof enabledValue === 'boolean')
|
|
607
618
|
return enabledValue;
|
|
608
|
-
return typeof document[api.element] !== 'undefined';
|
|
619
|
+
return typeof globalThis.document[api.element] !== 'undefined';
|
|
609
620
|
}
|
|
610
621
|
function getElement() {
|
|
622
|
+
if (Platform.isElectron) {
|
|
623
|
+
try {
|
|
624
|
+
var electron = require('electron');
|
|
625
|
+
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
626
|
+
var all = electron.BrowserWindow.getAllWindows();
|
|
627
|
+
for (var i = 0; i < all.length; i++) {
|
|
628
|
+
var cur = all[i];
|
|
629
|
+
console.log(cur.isFullscreen() || (Platform.os === OS.MacOS && typeof cur.isSimpleFullScreen === 'function' && cur.isSimpleFullScreen()));
|
|
630
|
+
}
|
|
631
|
+
if (focusedWindow !== null && (focusedWindow.isFullscreen() || (Platform.os === OS.MacOS && typeof focusedWindow.isSimpleFullScreen === 'function' && focusedWindow.isSimpleFullScreen())))
|
|
632
|
+
return focusedWindow;
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
catch (_) {
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
611
639
|
if (api === null) {
|
|
612
640
|
if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
|
|
613
641
|
return lastIOSVideo;
|
|
614
642
|
return null;
|
|
615
643
|
}
|
|
616
|
-
var currentElement = document[api.element];
|
|
644
|
+
var currentElement = globalThis.document[api.element];
|
|
617
645
|
if (currentElement !== null && currentElement !== undefined)
|
|
618
646
|
return currentElement;
|
|
619
647
|
return null;
|
|
@@ -512,6 +512,8 @@
|
|
|
512
512
|
},
|
|
513
513
|
};
|
|
514
514
|
function detectApi() {
|
|
515
|
+
if (Platform.isElectron)
|
|
516
|
+
return null;
|
|
515
517
|
var element = globalThis.document.documentElement;
|
|
516
518
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
517
519
|
return API_VARIANTS.standard;
|
|
@@ -556,7 +558,8 @@
|
|
|
556
558
|
if (dispatching)
|
|
557
559
|
return;
|
|
558
560
|
dispatching = true;
|
|
559
|
-
globalThis.document
|
|
561
|
+
if (typeof globalThis.document !== 'undefined')
|
|
562
|
+
globalThis.document.dispatchEvent(new Event(type, { bubbles: true, cancelable: false }));
|
|
560
563
|
Promise.resolve().then(function () {
|
|
561
564
|
dispatching = false;
|
|
562
565
|
});
|
|
@@ -570,37 +573,45 @@
|
|
|
570
573
|
var changeEvents = ['webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'];
|
|
571
574
|
var errorEvents = ['webkitfullscreenerror', 'mozfullscreenerror', 'MSFullscreenError'];
|
|
572
575
|
changeEvents.forEach(function (eventType) {
|
|
573
|
-
globalThis.document
|
|
576
|
+
if (typeof globalThis.document !== 'undefined')
|
|
577
|
+
globalThis.document.addEventListener(eventType, emitChange, false);
|
|
574
578
|
});
|
|
575
579
|
errorEvents.forEach(function (eventType) {
|
|
576
|
-
globalThis.document
|
|
580
|
+
if (typeof globalThis.document !== 'undefined')
|
|
581
|
+
globalThis.document.addEventListener(eventType, emitError, false);
|
|
577
582
|
});
|
|
578
583
|
if (isIOS()) {
|
|
579
584
|
bridgeIOSVideoEvents();
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
585
|
+
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
586
|
+
var observer = new MutationObserver(function () {
|
|
587
|
+
bridgeIOSVideoEvents();
|
|
588
|
+
});
|
|
589
|
+
observer.observe(globalThis.document.documentElement, { childList: true, subtree: true });
|
|
590
|
+
}
|
|
584
591
|
}
|
|
585
592
|
}
|
|
586
593
|
function bridgeIOSVideoEvents() {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
594
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
595
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
596
|
+
videos.forEach(function (video) {
|
|
597
|
+
if (video.__fsBridged__ || !('webkitEnterFullscreen' in video || 'onwebkitbeginfullscreen' in video))
|
|
598
|
+
return;
|
|
599
|
+
function emitChange() {
|
|
600
|
+
globalThis.document.dispatchEvent(new Event('fullscreenchange'));
|
|
601
|
+
}
|
|
602
|
+
video.addEventListener('webkitbeginfullscreen', emitChange, false);
|
|
603
|
+
video.addEventListener('webkitendfullscreen', emitChange, false);
|
|
604
|
+
video.__fsBridged__ = true;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
598
607
|
}
|
|
599
608
|
function getEnabled() {
|
|
609
|
+
if (Platform.isElectron)
|
|
610
|
+
return true;
|
|
600
611
|
if (api === null) {
|
|
601
612
|
if (!isIOS())
|
|
602
613
|
return false;
|
|
603
|
-
var videos = document.querySelectorAll('video');
|
|
614
|
+
var videos = globalThis.document.querySelectorAll('video');
|
|
604
615
|
for (var i = 0; i < videos.length; i++) {
|
|
605
616
|
var video = videos[i];
|
|
606
617
|
if (video.webkitSupportsFullscreen || 'webkitEnterFullscreen' in video)
|
|
@@ -608,18 +619,35 @@
|
|
|
608
619
|
}
|
|
609
620
|
return false;
|
|
610
621
|
}
|
|
611
|
-
var enabledValue = document[api.enabled];
|
|
622
|
+
var enabledValue = globalThis.document[api.enabled];
|
|
612
623
|
if (typeof enabledValue === 'boolean')
|
|
613
624
|
return enabledValue;
|
|
614
|
-
return typeof document[api.element] !== 'undefined';
|
|
625
|
+
return typeof globalThis.document[api.element] !== 'undefined';
|
|
615
626
|
}
|
|
616
627
|
function getElement() {
|
|
628
|
+
if (Platform.isElectron) {
|
|
629
|
+
try {
|
|
630
|
+
var electron = require('electron');
|
|
631
|
+
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
632
|
+
var all = electron.BrowserWindow.getAllWindows();
|
|
633
|
+
for (var i = 0; i < all.length; i++) {
|
|
634
|
+
var cur = all[i];
|
|
635
|
+
console.log(cur.isFullscreen() || (Platform.os === OS.MacOS && typeof cur.isSimpleFullScreen === 'function' && cur.isSimpleFullScreen()));
|
|
636
|
+
}
|
|
637
|
+
if (focusedWindow !== null && (focusedWindow.isFullscreen() || (Platform.os === OS.MacOS && typeof focusedWindow.isSimpleFullScreen === 'function' && focusedWindow.isSimpleFullScreen())))
|
|
638
|
+
return focusedWindow;
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
catch (_) {
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
617
645
|
if (api === null) {
|
|
618
646
|
if (lastIOSVideo && lastIOSVideo.webkitDisplayingFullscreen)
|
|
619
647
|
return lastIOSVideo;
|
|
620
648
|
return null;
|
|
621
649
|
}
|
|
622
|
-
var currentElement = document[api.element];
|
|
650
|
+
var currentElement = globalThis.document[api.element];
|
|
623
651
|
if (currentElement !== null && currentElement !== undefined)
|
|
624
652
|
return currentElement;
|
|
625
653
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"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},a=[[/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]],s=[[/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]],l=[[/\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<a.length;b++){var w=(p=a[b])[0],v=p[1],g=p[2];if(null!==(k=t.userAgent.match(w))){t.os=v,t.osVersion=m(k[1],g);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 a=void 0,s=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(s=t<o.length?parseInt(o[t],10):0))return 1;if(a<s)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[1]));for(b=0;b<s.length;b++){w=(p=s[b])[0];var h=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],g);break}}for(b=0;b<l.length;b++){w=(p=l[b])[0];var p,k,E=p[1];g=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],g);break}}if(t.isReactNative)try{v=(S=require("react-native").Platform).OS;var j=f(F=""+S.Version);switch(v){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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=d(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,S=(v=require("os")).platform();j=f(F=v.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,a=0;a<o.length;a++){var s=null==(r=o[a])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=s.brand,u=s.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 T={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 x(){return e.iOS===t.os}var y=function(){var e=function(){var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return T.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=T[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:T.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),n=null,r=!1;function o(){document.querySelectorAll("video").forEach((function(e){function n(){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 i(){if(null===e)return n&&n.webkitDisplayingFullscreen?n:null;var r=document[e.element];return null!=r?r:null}function t(){return null!==i()}function a(r,i){return new Promise((function(t,a){if(null!==e){var s=r[e.request];if("function"==typeof s)try{var l=s.call(r,i);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():a()})):void t()}catch(e){if(!x())return void a()}}function u(){if(x()&&"VIDEO"===r.tagName.toUpperCase()){var e=r;if(e.webkitSupportsFullscreen&&"function"==typeof e.webkitEnterFullscreen)return n=e,o(),e.webkitEnterFullscreen(),void t()}a()}u()}))}function s(){return new Promise((function(r,o){if(null!==e){var t=document[e.exit];if("function"==typeof t){var a=t.call(document);return void 0!==a&&"function"==typeof a.then?void a.then((function(){r()})).catch((function(){o()})):void r()}}if(x()&&null!==n){if("function"==typeof n.webkitExitFullscreen&&!0===n.webkitDisplayingFullscreen)return n.webkitExitFullscreen(),n=null,void r();for(var s=document.querySelectorAll("video"),l=0;l<s.length;l++){var u=s[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void r()}}i()?o():r()}))}return function(){if(!r){r=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){globalThis.document.addEventListener(e,i,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){globalThis.document.addEventListener(e,t,!1)})),x())o(),new MutationObserver((function(){o()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function i(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(null===e){if(!x())return!1;for(var n=document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=document[e.enabled];return"boolean"==typeof i?i:void 0!==document[e.element]}()},get element(){return i()},get isFullscreen(){return t()},request:a,exit:s,toggle:function(e,n){return t()?s():a(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}}}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).Fullscreen=n()}(this,(function(){"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},s=[[/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]],l=[[/\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<s.length;b++){var w=(p=s[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 s=void 0,a=void 0;if((s=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(s<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(j=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(j[1].substring(0,2),10)>=26&&(t.osVersion=j[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<l.length;b++){w=(p=l[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=(T=require("react-native").Platform).OS;var j=f(F=""+T.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}(j,F);break;case"ios":t.os=e.iOS,t.osVersion=F;break;case"windows":t.os=e.Windows,t.osVersion=d(j,F);break;case"macos":t.os=e.MacOS,t.osVersion=F}}catch(e){}if(t.isNodeJS)try{var F,T=(g=require("os")).platform();j=f(F=g.release());switch(T){case"win32":t.os=e.Windows,t.osVersion=d(j,F);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}(j,F);break;case"android":t.os=e.Android,t.osVersion=F;break;case"linux":/android/i.test(F)&&(t.os=e.Android,t.osVersion=F)}}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,s=0;s<o.length;s++){var a=null==(r=o[s])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},l=a.brand,u=a.version;/not.a.brand/i.test(l)||"Chromium"===l&&(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 S={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 x(){return e.iOS===t.os}var y=function(){var n=function(){if(t.isElectron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return S.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=S[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:S.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=!1;function i(){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 s(){if(t.isElectron)try{for(var o=require("electron"),i=o.BrowserWindow.getFocusedWindow(),s=o.BrowserWindow.getAllWindows(),a=0;a<s.length;a++){var l=s[a];console.log(l.isFullscreen()||t.os===e.MacOS&&"function"==typeof l.isSimpleFullScreen&&l.isSimpleFullScreen())}return null!==i&&(i.isFullscreen()||t.os===e.MacOS&&"function"==typeof i.isSimpleFullScreen&&i.isSimpleFullScreen())?i: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 a(){return null!==s()}function l(e,o){return new Promise((function(t,s){if(null!==n){var a=e[n.request];if("function"==typeof a)try{var l=a.call(e,o);return void 0!==l&&"function"==typeof l.then?void l.then((function(){t()})).catch((function(){x()?u():s()})):void t()}catch(e){if(!x())return void s()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,i(),n.webkitEnterFullscreen(),void t()}s()}u()}))}function u(){return new Promise((function(e,o){if(null!==n){var i=document[n.exit];if("function"==typeof i){var t=i.call(document);return void 0!==t&&"function"==typeof t.then?void t.then((function(){e()})).catch((function(){o()})):void e()}}if(x()&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void e();for(var a=document.querySelectorAll("video"),l=0;l<a.length;l++){var u=a[l];if("function"==typeof u.webkitExitFullscreen&&!0===u.webkitDisplayingFullscreen)return u.webkitExitFullscreen(),void e()}}s()?o():e()}))}return function(){if(!o){o=!0;var e=!1;if(["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,r,!1)})),["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"].forEach((function(e){void 0!==globalThis.document&&globalThis.document.addEventListener(e,t,!1)})),x())if(i(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){i()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function n(n){e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}function r(){n("fullscreenchange")}function t(){n("fullscreenerror")}}(),{get enabled(){return function(){if(t.isElectron)return!0;if(null===n){if(!x())return!1;for(var e=globalThis.document.querySelectorAll("video"),r=0;r<e.length;r++){var o=e[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var i=globalThis.document[n.enabled];return"boolean"==typeof i?i:void 0!==globalThis.document[n.element]}()},get element(){return s()},get isFullscreen(){return a()},request:l,exit:u,toggle:function(e,n){return a()?u():l(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}document.addEventListener(r,o,!1),n.push((function(){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)}document.addEventListener(r,o,!1),n.push((function(){document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}();return{installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}}}));
|