native-fn 1.0.60 → 1.0.62
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/index.d.ts +198 -0
- package/dist/native.cjs +32 -7
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +32 -7
- package/dist/native.umd.js +32 -7
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +134 -89
- package/dist/plugin/app/index.d.ts +59 -7
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +134 -89
- package/dist/plugin/app/index.umd.js +134 -89
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/constants/platform.d.ts +10 -0
- package/dist/plugin/app/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/app/src/types/native.d.ts +8 -0
- package/dist/plugin/app/src/types/platform.d.ts +0 -3
- package/dist/plugin/camera/index.cjs +19 -6
- package/dist/plugin/camera/index.d.ts +150 -0
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +19 -6
- package/dist/plugin/camera/index.umd.js +19 -6
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/constants/platform.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/camera/src/types/native.d.ts +8 -0
- package/dist/plugin/camera/src/types/platform.d.ts +0 -3
- package/dist/plugin/clipboard/index.cjs +225 -212
- package/dist/plugin/clipboard/index.d.ts +135 -0
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +225 -212
- package/dist/plugin/clipboard/index.umd.js +225 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/constants/platform.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/clipboard/src/types/native.d.ts +8 -0
- package/dist/plugin/clipboard/src/types/platform.d.ts +0 -3
- package/dist/plugin/fullscreen/index.cjs +62 -28
- package/dist/plugin/fullscreen/index.d.ts +132 -3
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +62 -28
- package/dist/plugin/fullscreen/index.umd.js +62 -28
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/constants/platform.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/fullscreen/src/types/native.d.ts +8 -0
- package/dist/plugin/fullscreen/src/types/platform.d.ts +0 -3
- package/dist/plugin/theme/index.cjs +24 -11
- package/dist/plugin/theme/index.d.ts +150 -0
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +24 -11
- package/dist/plugin/theme/index.umd.js +24 -11
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/constants/platform.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/plugin/theme/src/types/native.d.ts +8 -0
- package/dist/plugin/theme/src/types/platform.d.ts +0 -3
- package/dist/src/constants/platform.d.ts +10 -0
- package/dist/src/plugin/app/utils/try-open-url.d.ts +15 -0
- package/dist/src/plugin/fullscreen/types/fullscreen-electron.d.ts +10 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +4 -3
- package/dist/src/types/native.d.ts +8 -0
- package/dist/src/types/platform.d.ts +0 -3
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface Electron {
|
|
2
|
+
BrowserWindow: BrowserWindow;
|
|
3
|
+
}
|
|
4
|
+
export declare type BrowserWindow = import('electron').BrowserWindow;
|
|
5
|
+
export declare type IsElectron = typeof process extends {
|
|
6
|
+
versions: {
|
|
7
|
+
electron: string;
|
|
8
|
+
};
|
|
9
|
+
} ? true : false;
|
|
10
|
+
export declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { FullscreenTarget } from "./fullscreen-electron";
|
|
1
2
|
export declare interface FullscreenInstance {
|
|
2
3
|
enabled: boolean;
|
|
3
|
-
element:
|
|
4
|
+
element: FullscreenTarget | null;
|
|
4
5
|
isFullscreen: boolean;
|
|
5
|
-
request(target
|
|
6
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
6
7
|
exit(): Promise<void>;
|
|
7
|
-
toggle(target
|
|
8
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
8
9
|
onChange(handler: (event: Event) => void): () => void;
|
|
9
10
|
onError(handler: (event: Event) => void): () => void;
|
|
10
11
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
|
|
2
|
+
import { PlatformInstance } from "./platform";
|
|
3
|
+
import { AppInstance } from "../plugin/app";
|
|
4
|
+
import { FullscreenInstance } from "../plugin/fullscreen";
|
|
5
|
+
import { ClipboardInstance } from "../plugin/clipboard";
|
|
2
6
|
export interface NativePlugins {
|
|
7
|
+
App: AppInstance | void;
|
|
8
|
+
Clipboard: ClipboardInstance | void;
|
|
9
|
+
Fullscreen: FullscreenInstance | void;
|
|
10
|
+
Platform: PlatformInstance | void;
|
|
3
11
|
}
|
|
4
12
|
export interface NativeConstants extends Record<string, any> {
|
|
5
13
|
}
|
|
@@ -62,7 +62,10 @@ var Browsers;
|
|
|
62
62
|
Browsers["IE"] = "IE";
|
|
63
63
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
64
64
|
})(Browsers || (Browsers = {}));
|
|
65
|
-
var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
|
|
65
|
+
var userAgent = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
66
|
+
var IS_NODE_JS = typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
67
|
+
var IS_ELECTRON = (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent));
|
|
68
|
+
var IS_REACT_NATIVE = typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative';
|
|
66
69
|
var Platform = {
|
|
67
70
|
device: Devices.Unknown,
|
|
68
71
|
os: OS.Unknown,
|
|
@@ -77,9 +80,6 @@ var Platform = {
|
|
|
77
80
|
isDesktop: false,
|
|
78
81
|
isStandalone: false,
|
|
79
82
|
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
|
|
80
|
-
isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
81
|
-
isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
|
|
82
|
-
isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
|
|
83
83
|
};
|
|
84
84
|
var OS_RESOLVER_MAP = [
|
|
85
85
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -389,7 +389,7 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
389
389
|
break;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
if (
|
|
392
|
+
if (IS_REACT_NATIVE) {
|
|
393
393
|
try {
|
|
394
394
|
var reactNative = require('react-native');
|
|
395
395
|
var platform = reactNative.Platform;
|
|
@@ -418,7 +418,7 @@ if (Platform.isReactNative) {
|
|
|
418
418
|
catch (_) {
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
if (
|
|
421
|
+
if (IS_NODE_JS) {
|
|
422
422
|
try {
|
|
423
423
|
var os = require('os');
|
|
424
424
|
var platform = os.platform();
|
|
@@ -448,6 +448,19 @@ if (Platform.isNodeJS) {
|
|
|
448
448
|
catch (_) {
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
+
document.addEventListener("deviceready", function () {
|
|
452
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
453
|
+
switch (globalThis.device.platform) {
|
|
454
|
+
case 'Android':
|
|
455
|
+
Platform.os = OS.Android;
|
|
456
|
+
break;
|
|
457
|
+
case 'iOS':
|
|
458
|
+
Platform.os = OS.iOS;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
Platform.osVersion = globalThis.device.version;
|
|
462
|
+
}
|
|
463
|
+
}, false);
|
|
451
464
|
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
452
465
|
navigator
|
|
453
466
|
.userAgentData
|
|
@@ -508,7 +521,7 @@ var API_VARIANTS = {
|
|
|
508
521
|
},
|
|
509
522
|
};
|
|
510
523
|
function detectApi() {
|
|
511
|
-
if (
|
|
524
|
+
if (IS_ELECTRON)
|
|
512
525
|
return null;
|
|
513
526
|
var element = globalThis.document.documentElement;
|
|
514
527
|
if ('fullscreenEnabled' in globalThis.document || 'exitFullscreen' in globalThis.document) {
|
|
@@ -538,15 +551,31 @@ function detectApi() {
|
|
|
538
551
|
}
|
|
539
552
|
return null;
|
|
540
553
|
}
|
|
541
|
-
function isIOS() {
|
|
542
|
-
return OS.iOS === Platform.os;
|
|
543
|
-
}
|
|
544
554
|
function createFullscreenUtils() {
|
|
545
555
|
var api = detectApi();
|
|
546
556
|
var lastIOSVideo = null;
|
|
547
557
|
var lastElectronBrowserWindow = null;
|
|
548
558
|
var lastElectronBrowserWindowOptions = null;
|
|
549
559
|
var eventsBridged = false;
|
|
560
|
+
function getDefaultTarget() {
|
|
561
|
+
if (IS_ELECTRON) {
|
|
562
|
+
var electron = require('electron');
|
|
563
|
+
var focusedWindow = electron.BrowserWindow.getFocusedWindow();
|
|
564
|
+
if (focusedWindow !== null)
|
|
565
|
+
return focusedWindow;
|
|
566
|
+
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
567
|
+
if (allWindows.length === 0)
|
|
568
|
+
throw new Error();
|
|
569
|
+
return allWindows[0];
|
|
570
|
+
}
|
|
571
|
+
if (OS.iOS === Platform.os) {
|
|
572
|
+
var video = globalThis.document.querySelector('video');
|
|
573
|
+
if (video === null)
|
|
574
|
+
throw new Error();
|
|
575
|
+
return video;
|
|
576
|
+
}
|
|
577
|
+
return globalThis.document.documentElement;
|
|
578
|
+
}
|
|
550
579
|
function restoreElectronBrowserWindowOptions() {
|
|
551
580
|
if (lastElectronBrowserWindowOptions !== null) {
|
|
552
581
|
lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
|
|
@@ -573,7 +602,10 @@ function createFullscreenUtils() {
|
|
|
573
602
|
function emitChange() {
|
|
574
603
|
emit('fullscreenchange');
|
|
575
604
|
}
|
|
576
|
-
|
|
605
|
+
function emitError() {
|
|
606
|
+
emit('fullscreenerror');
|
|
607
|
+
}
|
|
608
|
+
if (IS_ELECTRON) {
|
|
577
609
|
try {
|
|
578
610
|
var electron = require('electron');
|
|
579
611
|
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
@@ -615,9 +647,9 @@ function createFullscreenUtils() {
|
|
|
615
647
|
}
|
|
616
648
|
for (var i = 0; i < errorEvents.length; i++) {
|
|
617
649
|
if (typeof globalThis.document !== 'undefined')
|
|
618
|
-
globalThis.document.addEventListener(errorEvents[i],
|
|
650
|
+
globalThis.document.addEventListener(errorEvents[i], emitError, false);
|
|
619
651
|
}
|
|
620
|
-
if (
|
|
652
|
+
if (OS.iOS === Platform.os) {
|
|
621
653
|
bridgeIOSVideoEvents();
|
|
622
654
|
if (typeof globalThis.MutationObserver !== 'undefined') {
|
|
623
655
|
var observer = new MutationObserver(function () {
|
|
@@ -643,7 +675,7 @@ function createFullscreenUtils() {
|
|
|
643
675
|
}
|
|
644
676
|
}
|
|
645
677
|
function getEnabled() {
|
|
646
|
-
if (
|
|
678
|
+
if (IS_ELECTRON) {
|
|
647
679
|
try {
|
|
648
680
|
var electron = require('electron');
|
|
649
681
|
return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
|
|
@@ -653,7 +685,7 @@ function createFullscreenUtils() {
|
|
|
653
685
|
}
|
|
654
686
|
}
|
|
655
687
|
if (api === null) {
|
|
656
|
-
if (
|
|
688
|
+
if (OS.iOS !== Platform.os)
|
|
657
689
|
return false;
|
|
658
690
|
var videos = globalThis.document.querySelectorAll('video');
|
|
659
691
|
for (var i = 0; i < videos.length; i++) {
|
|
@@ -669,7 +701,7 @@ function createFullscreenUtils() {
|
|
|
669
701
|
return typeof globalThis.document[api.element] !== 'undefined';
|
|
670
702
|
}
|
|
671
703
|
function getElement() {
|
|
672
|
-
if (
|
|
704
|
+
if (IS_ELECTRON) {
|
|
673
705
|
if (lastElectronBrowserWindow !== null)
|
|
674
706
|
return lastElectronBrowserWindow;
|
|
675
707
|
try {
|
|
@@ -700,19 +732,21 @@ function createFullscreenUtils() {
|
|
|
700
732
|
return getElement() !== null;
|
|
701
733
|
}
|
|
702
734
|
function request(target, options) {
|
|
703
|
-
if (
|
|
735
|
+
if (target === void 0) { target = getDefaultTarget(); }
|
|
736
|
+
if (IS_ELECTRON) {
|
|
737
|
+
var browserWindow_1 = target;
|
|
704
738
|
return new Promise(function (resolve, reject) {
|
|
705
739
|
try {
|
|
706
740
|
if (lastElectronBrowserWindow === null) {
|
|
707
741
|
lastElectronBrowserWindowOptions = {
|
|
708
|
-
fullScreenable:
|
|
709
|
-
autoHideMenuBar:
|
|
742
|
+
fullScreenable: browserWindow_1.fullScreenable,
|
|
743
|
+
autoHideMenuBar: browserWindow_1.autoHideMenuBar,
|
|
710
744
|
};
|
|
711
|
-
|
|
712
|
-
|
|
745
|
+
browserWindow_1.fullScreenable = true;
|
|
746
|
+
browserWindow_1.autoHideMenuBar = true;
|
|
713
747
|
}
|
|
714
|
-
|
|
715
|
-
lastElectronBrowserWindow =
|
|
748
|
+
browserWindow_1.setFullScreen(true);
|
|
749
|
+
lastElectronBrowserWindow = browserWindow_1;
|
|
716
750
|
resolve();
|
|
717
751
|
return;
|
|
718
752
|
}
|
|
@@ -733,7 +767,7 @@ function createFullscreenUtils() {
|
|
|
733
767
|
resolve();
|
|
734
768
|
})
|
|
735
769
|
.catch(function () {
|
|
736
|
-
if (
|
|
770
|
+
if (OS.iOS !== Platform.os) {
|
|
737
771
|
reject();
|
|
738
772
|
return;
|
|
739
773
|
}
|
|
@@ -747,7 +781,7 @@ function createFullscreenUtils() {
|
|
|
747
781
|
}
|
|
748
782
|
}
|
|
749
783
|
catch (error) {
|
|
750
|
-
if (
|
|
784
|
+
if (OS.iOS !== Platform.os) {
|
|
751
785
|
reject();
|
|
752
786
|
return;
|
|
753
787
|
}
|
|
@@ -755,7 +789,7 @@ function createFullscreenUtils() {
|
|
|
755
789
|
}
|
|
756
790
|
}
|
|
757
791
|
function fallbackToIOSVideo() {
|
|
758
|
-
if (
|
|
792
|
+
if (OS.iOS === Platform.os && target.tagName.toUpperCase() === 'VIDEO') {
|
|
759
793
|
var video = target;
|
|
760
794
|
if (video.webkitSupportsFullscreen && typeof video.webkitEnterFullscreen === 'function') {
|
|
761
795
|
lastIOSVideo = video;
|
|
@@ -771,7 +805,7 @@ function createFullscreenUtils() {
|
|
|
771
805
|
});
|
|
772
806
|
}
|
|
773
807
|
function exit() {
|
|
774
|
-
if (
|
|
808
|
+
if (IS_ELECTRON) {
|
|
775
809
|
return new Promise(function (resolve, reject) {
|
|
776
810
|
try {
|
|
777
811
|
if (lastElectronBrowserWindow !== null) {
|
|
@@ -811,7 +845,7 @@ function createFullscreenUtils() {
|
|
|
811
845
|
}
|
|
812
846
|
}
|
|
813
847
|
}
|
|
814
|
-
if (
|
|
848
|
+
if (OS.iOS === Platform.os && lastIOSVideo !== null) {
|
|
815
849
|
if (typeof lastIOSVideo.webkitExitFullscreen === 'function' && lastIOSVideo.webkitDisplayingFullscreen === true) {
|
|
816
850
|
lastIOSVideo.webkitExitFullscreen();
|
|
817
851
|
lastIOSVideo = null;
|
|
@@ -1,3 +1,124 @@
|
|
|
1
|
+
import * as electron from 'electron';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
var cordova: string | undefined;
|
|
5
|
+
var device: CordovaDevice | undefined;
|
|
6
|
+
interface Navigator {
|
|
7
|
+
userAgent?: string;
|
|
8
|
+
userAgentData?: UserAgentData;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
interface CordovaDevice {
|
|
12
|
+
platform: string;
|
|
13
|
+
version: string;
|
|
14
|
+
}
|
|
15
|
+
interface ModernUserAgentDataBrand {
|
|
16
|
+
brand: string;
|
|
17
|
+
version: string;
|
|
18
|
+
}
|
|
19
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
20
|
+
interface UserAgentDataValues {
|
|
21
|
+
brands?: UserAgentDataBrand[];
|
|
22
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
23
|
+
platformVersion?: string | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
interface UserAgentData {
|
|
26
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
27
|
+
}
|
|
28
|
+
declare enum OS {
|
|
29
|
+
Unknown = "Unknown",
|
|
30
|
+
Android = "Android",
|
|
31
|
+
iOS = "iOS",
|
|
32
|
+
Windows = "Windows",
|
|
33
|
+
MacOS = "MacOS"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare enum AppOpenState {
|
|
37
|
+
Scheme = 0,
|
|
38
|
+
Universal = 1,
|
|
39
|
+
Intent = 2,
|
|
40
|
+
Fallback = 3,
|
|
41
|
+
Store = 4
|
|
42
|
+
}
|
|
43
|
+
declare enum MessengerType {
|
|
44
|
+
Telephone = "telephone",
|
|
45
|
+
Message = "message",
|
|
46
|
+
Mail = "mail"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare interface AppInfo {
|
|
50
|
+
scheme?: URLCandidate;
|
|
51
|
+
fallback?: URLCandidateOrFallback;
|
|
52
|
+
timeout?: number;
|
|
53
|
+
allowWebStore?: boolean;
|
|
54
|
+
}
|
|
55
|
+
declare interface AndroidAppInfo extends AppInfo {
|
|
56
|
+
packageName?: string;
|
|
57
|
+
intent?: URLCandidate;
|
|
58
|
+
}
|
|
59
|
+
declare interface IOSAppInfo extends MacOSAppInfo {
|
|
60
|
+
universal?: URLCandidate;
|
|
61
|
+
}
|
|
62
|
+
declare interface WindowsAppInfo extends AppInfo {
|
|
63
|
+
productId?: string;
|
|
64
|
+
}
|
|
65
|
+
declare interface MacOSAppInfo extends AppInfo {
|
|
66
|
+
bundleId?: string;
|
|
67
|
+
trackId?: string;
|
|
68
|
+
}
|
|
69
|
+
declare interface AppOpenOptions {
|
|
70
|
+
[OS.Android]?: AndroidAppInfo;
|
|
71
|
+
[OS.iOS]?: IOSAppInfo;
|
|
72
|
+
[OS.Windows]?: WindowsAppInfo;
|
|
73
|
+
[OS.MacOS]?: MacOSAppInfo;
|
|
74
|
+
}
|
|
75
|
+
declare type URLCandidate = URL | string;
|
|
76
|
+
declare type URLCandidateOrFallback = URLCandidate | (() => any);
|
|
77
|
+
declare type Stringifiable = string | number | boolean | HTMLElement | null | undefined;
|
|
78
|
+
declare type StringifiableSequence = Stringifiable[] | NodeList | NodeListOf<Node> | HTMLCollectionBase;
|
|
79
|
+
declare type MessengerOpenOptions = {
|
|
80
|
+
to?: Stringifiable | StringifiableSequence;
|
|
81
|
+
cc?: Stringifiable | StringifiableSequence;
|
|
82
|
+
bcc?: Stringifiable | StringifiableSequence;
|
|
83
|
+
subject?: Stringifiable;
|
|
84
|
+
body?: Stringifiable;
|
|
85
|
+
} | HTMLFormElement | FormData;
|
|
86
|
+
declare type Messenger = Record<MessengerType, (options: MessengerOpenOptions) => Promise<void>>;
|
|
87
|
+
declare interface AppInstance {
|
|
88
|
+
open(options: AppOpenOptions): Promise<AppOpenState>;
|
|
89
|
+
messenger: Messenger;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare const URLOpenError: ErrorConstructor;
|
|
93
|
+
|
|
94
|
+
declare module 'native-fn' {
|
|
95
|
+
interface NativePlugins {
|
|
96
|
+
App: AppInstance;
|
|
97
|
+
}
|
|
98
|
+
interface NativeConstants {
|
|
99
|
+
AppOpenState: typeof AppOpenState;
|
|
100
|
+
Messengers: typeof MessengerType;
|
|
101
|
+
}
|
|
102
|
+
interface NativeErrors {
|
|
103
|
+
URLOpenError: typeof URLOpenError;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare interface ClipboardInstance {
|
|
108
|
+
copy(item: any): Promise<boolean>;
|
|
109
|
+
paste(): Promise<string>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare module 'native-fn' {
|
|
113
|
+
interface NativePlugins {
|
|
114
|
+
Clipboard: ClipboardInstance;
|
|
115
|
+
}
|
|
116
|
+
interface NativeConstants {
|
|
117
|
+
}
|
|
118
|
+
interface NativeErrors {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
1
122
|
declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
|
|
2
123
|
installed: boolean;
|
|
3
124
|
name: Key;
|
|
@@ -6,13 +127,21 @@ declare interface NativePlugin<Key extends string, Module, Constants extends Rec
|
|
|
6
127
|
Errors: Errors;
|
|
7
128
|
}
|
|
8
129
|
|
|
130
|
+
declare type BrowserWindow = electron.BrowserWindow;
|
|
131
|
+
declare type IsElectron = typeof process extends {
|
|
132
|
+
versions: {
|
|
133
|
+
electron: string;
|
|
134
|
+
};
|
|
135
|
+
} ? true : false;
|
|
136
|
+
declare type FullscreenTarget = IsElectron extends true ? BrowserWindow : Element;
|
|
137
|
+
|
|
9
138
|
declare interface FullscreenInstance {
|
|
10
139
|
enabled: boolean;
|
|
11
|
-
element:
|
|
140
|
+
element: FullscreenTarget | null;
|
|
12
141
|
isFullscreen: boolean;
|
|
13
|
-
request(target
|
|
142
|
+
request(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
14
143
|
exit(): Promise<void>;
|
|
15
|
-
toggle(target
|
|
144
|
+
toggle(target?: FullscreenTarget, options?: FullscreenOptions): Promise<void>;
|
|
16
145
|
onChange(handler: (event: Event) => void): () => void;
|
|
17
146
|
onError(handler: (event: Event) => void): () => void;
|
|
18
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(t.osVersion=T[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var T=f(j=""+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}(T,j);break;case"ios":t.os=e.iOS,t.osVersion=j;break;case"windows":t.os=e.Windows,t.osVersion=d(T,j);break;case"macos":t.os=e.MacOS,t.osVersion=j}}catch(e){}if(t.isNodeJS)try{var j,S=(g=require("os")).platform();T=f(j=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(T,j);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}(T,j);break;case"android":t.os=e.Android,t.osVersion=j;break;case"linux":/android/i.test(j)&&(t.os=e.Android,t.osVersion=j)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};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 F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(e,l){return t.isElectron?new Promise((function(n,r){try{return null===o&&(i={fullScreenable:e.fullScreenable,autoHideMenuBar:e.autoHideMenuBar},e.fullScreenable=!0,e.autoHideMenuBar=!0),e.setFullScreen(!0),o=e,void n()}catch(e){r()}})):new Promise((function(o,i){if(null!==n){var t=e[n.request];if("function"==typeof t)try{var a=t.call(e,l);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){x()?u():i()})):void o()}catch(e){if(!x())return void i()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}u()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(e,o){if(null!==n){var i=globalThis.document[n.exit];if("function"==typeof i){var t=i.call(globalThis.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 l=globalThis.document.querySelectorAll("video"),a=0;a<l.length;a++){var s=l[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void e()}}u()?o():e()}))}return function(){if(!l){l=!0;var e=!1;if(t.isElectron)try{for(var n=require("electron"),r=n.BrowserWindow.getAllWindows(),i=function(e){var n=r[e];n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))},u=0;u<r.length;u++)i(u);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))}))}catch(e){}var c=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],d=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(u=0;u<c.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(c[u],m,!1);for(u=0;u<d.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[u],m,!1);if(x())if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function m(){var n;n="fullscreenchange",e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}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 u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),M={installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}};module.exports=M;
|
|
1
|
+
"use strict";var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function m(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function f(e){return void 0===e?"":e.replace(/_/g,".")}function b(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(O=require("react-native").Platform).OS;var F=g(x=""+O.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,O=(p=require("os")).platform();F=g(x=p.release());switch(O){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.iOS}s.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var y={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var M=function(){var n=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return y.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=y[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:y.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,t=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function u(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function c(){if(l){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),t=0;t<i.length;t++){var a=i[t];if(a.isFullScreen()||s.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var u=globalThis.document[n.element];return null!=u?u:null}function d(){return null!==c()}function m(t,a){if(void 0===t&&(t=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var c=t;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:c.fullScreenable,autoHideMenuBar:c.autoHideMenuBar},c.fullScreenable=!0,c.autoHideMenuBar=!0),c.setFullScreen(!0),o=c,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var l=t[n.request];if("function"==typeof l)try{var c=l.call(t,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===s.os?d():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function d(){if(e.iOS===s.os&&"VIDEO"===t.tagName.toUpperCase()){var n=t;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,u(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function f(){return new Promise(l?function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=c();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(o,i){if(null!==n){var t=globalThis.document[n.exit];if("function"==typeof t){var l=t.call(globalThis.document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===s.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var a=globalThis.document.querySelectorAll("video"),u=0;u<a.length;u++){var d=a[u];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}c()?i():o()})}return function(){if(!t){t=!0;var n=!1;if(l)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),c=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))},d=0;d<i.length;d++)c(d);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))}))}catch(e){}var m=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],f=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(d=0;d<m.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[d],w,!1);for(d=0;d<f.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(f[d],g,!1);if(e.iOS===s.os)if(u(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){u()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function b(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function w(){b("fullscreenchange")}function g(){b("fullscreenerror")}}(),{get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==s.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=globalThis.document[n.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[n.element]}()},get element(){return c()},get isFullscreen(){return d()},request:m,exit:f,toggle:function(e,n){return d()?f():m(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),W={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};module.exports=W;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",t={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},l=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],a=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function u(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function m(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function f(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var b=0;b<l.length;b++){var w=(p=l[b])[0],g=p[1],v=p[2];if(null!==(k=t.userAgent.match(w))){t.os=g,t.osVersion=m(k[1],v);break}}t.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(t.osVersion,"18.6")&&(null!==(T=/\) Version\/([\d.]+)/.exec(t.userAgent))&&parseInt(T[1].substring(0,2),10)>=26&&(t.osVersion=T[1]));for(b=0;b<a.length;b++){w=(p=a[b])[0];var h=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.engine=h,t.engineVersion=m(k[1],v);break}}for(b=0;b<s.length;b++){w=(p=s[b])[0];var p,k,E=p[1];v=p[2];if(null!==(k=t.userAgent.match(w))){t.browser=E,t.browserVersion=m(k[1],v);break}}if(t.isReactNative)try{g=(S=require("react-native").Platform).OS;var T=f(j=""+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}(T,j);break;case"ios":t.os=e.iOS,t.osVersion=j;break;case"windows":t.os=e.Windows,t.osVersion=d(T,j);break;case"macos":t.os=e.MacOS,t.osVersion=j}}catch(e){}if(t.isNodeJS)try{var j,S=(g=require("os")).platform();T=f(j=g.release());switch(S){case"win32":t.os=e.Windows,t.osVersion=d(T,j);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}(T,j);break;case"android":t.os=e.Android,t.osVersion=j;break;case"linux":/android/i.test(j)&&(t.os=e.Android,t.osVersion=j)}}catch(e){}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,l=0;l<o.length;l++){var a=null==(r=o[l])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,u=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(t.engineVersion=u)}"string"==typeof i&&(t.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?t.osVersion="11":t.osVersion=i)})),t.device=t.os===e.iOS||t.os===e.Android?n.Mobile:t.os===e.Windows||t.os===e.MacOS?n.Desktop:n.Unknown,t.isMobile=t.device===n.Mobile,t.isDesktop=t.device===n.Desktop,t.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(t.os);var F={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};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 F.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=F[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:F.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,l=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function s(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function u(){if(t.isElectron){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),l=0;l<i.length;l++){var a=i[l];if(a.isFullScreen()||t.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var s=globalThis.document[n.element];return null!=s?s:null}function c(){return null!==u()}function d(e,l){return t.isElectron?new Promise((function(n,r){try{return null===o&&(i={fullScreenable:e.fullScreenable,autoHideMenuBar:e.autoHideMenuBar},e.fullScreenable=!0,e.autoHideMenuBar=!0),e.setFullScreen(!0),o=e,void n()}catch(e){r()}})):new Promise((function(o,i){if(null!==n){var t=e[n.request];if("function"==typeof t)try{var a=t.call(e,l);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){x()?u():i()})):void o()}catch(e){if(!x())return void i()}}function u(){if(x()&&"VIDEO"===e.tagName.toUpperCase()){var n=e;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,s(),n.webkitEnterFullscreen(),void o()}i()}u()}))}function m(){return t.isElectron?new Promise((function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=u();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(e,o){if(null!==n){var i=globalThis.document[n.exit];if("function"==typeof i){var t=i.call(globalThis.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 l=globalThis.document.querySelectorAll("video"),a=0;a<l.length;a++){var s=l[a];if("function"==typeof s.webkitExitFullscreen&&!0===s.webkitDisplayingFullscreen)return s.webkitExitFullscreen(),void e()}}u()?o():e()}))}return function(){if(!l){l=!0;var e=!1;if(t.isElectron)try{for(var n=require("electron"),r=n.BrowserWindow.getAllWindows(),i=function(e){var n=r[e];n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))},u=0;u<r.length;u++)i(u);"function"==typeof n.BrowserWindow.on&&n.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,m()})),n.on("leave-full-screen",(function(){a(),m()}))}))}catch(e){}var c=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],d=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(u=0;u<c.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(c[u],m,!1);for(u=0;u<d.length;u++)void 0!==globalThis.document&&globalThis.document.addEventListener(d[u],m,!1);if(x())if(s(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){s()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function m(){var n;n="fullscreenchange",e||(e=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(n,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){e=!1})))}}(),{get enabled(){return function(){if(t.isElectron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}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 u()},get isFullscreen(){return c()},request:d,exit:m,toggle:function(e,n){return c()?m():d(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),M={installed:!1,name:"Fullscreen",module:y,Constants:{},Errors:{}};export{M as default};
|
|
1
|
+
var e,n,r,o;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={}));var i=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",t=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,l=void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(i),a=void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product,s={device:n.Unknown,os:e.Unknown,osVersion:"",engine:r.Unknown,engineVersion:"",browser:o.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:i,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(i)},u=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,f],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,f],[/cfnetwork\/.+darwin/i,e.iOS,f],[/mac os x ?([\w. ]*)/i,e.MacOS,f],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,f],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],c=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],d=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function m(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function f(e){return void 0===e?"":e.replace(/_/g,".")}function b(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function w(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function g(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}for(var v=0;v<u.length;v++){var h=(E=u[v])[0],p=E[1],k=E[2];if(null!==(S=s.userAgent.match(h))){s.os=p,s.osVersion=w(S[1],k);break}}s.os===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var l=void 0,a=void 0;if((l=t<r.length?parseInt(r[t],10):0)>(a=t<o.length?parseInt(o[t],10):0))return 1;if(l<a)return-1}return 0}(s.osVersion,"18.6")&&(null!==(F=/\) Version\/([\d.]+)/.exec(s.userAgent))&&parseInt(F[1].substring(0,2),10)>=26&&(s.osVersion=F[1]));for(v=0;v<c.length;v++){h=(E=c[v])[0];var T=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.engine=T,s.engineVersion=w(S[1],k);break}}for(v=0;v<d.length;v++){h=(E=d[v])[0];var E,S,j=E[1];k=E[2];if(null!==(S=s.userAgent.match(h))){s.browser=j,s.browserVersion=w(S[1],k);break}}if(a)try{p=(O=require("react-native").Platform).OS;var F=g(x=""+O.Version);switch(p){case"android":s.os=e.Android,s.osVersion=function(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}(F,x);break;case"ios":s.os=e.iOS,s.osVersion=x;break;case"windows":s.os=e.Windows,s.osVersion=b(F,x);break;case"macos":s.os=e.MacOS,s.osVersion=x}}catch(e){}if(t)try{var x,O=(p=require("os")).platform();F=g(x=p.release());switch(O){case"win32":s.os=e.Windows,s.osVersion=b(F,x);break;case"darwin":s.os=e.MacOS,s.osVersion=function(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}(F,x);break;case"android":s.os=e.Android,s.osVersion=x;break;case"linux":/android/i.test(x)&&(s.os=e.Android,s.osVersion=x)}}catch(e){}document.addEventListener("deviceready",(function(){if(s.os===e.Unknown&&void 0!==globalThis.device){switch(globalThis.device.platform){case"Android":s.os=e.Android;break;case"iOS":s.os=e.iOS}s.osVersion=globalThis.device.version}}),!1),void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(n){for(var r,o=n.fullVersionList||n.brands||[],i=n.platformVersion,t=0;t<o.length;t++){var l=null==(r=o[t])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},a=l.brand,u=l.version;/not.a.brand/i.test(a)||"Chromium"===a&&(s.engineVersion=u)}"string"==typeof i&&(s.os===e.Windows&&parseInt(i.replace(/[^\d.]/g,"").split(".")[0],10)>=13?s.osVersion="11":s.osVersion=i)})),s.device=s.os===e.iOS||s.os===e.Android?n.Mobile:s.os===e.Windows||s.os===e.MacOS?n.Desktop:n.Unknown,s.isMobile=s.device===n.Mobile,s.isDesktop=s.device===n.Desktop,s.isStandalone=function(n){return"matchMedia"in globalThis&&(n===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(s.os);var y={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};var M=function(){var n=function(){if(l)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return y.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r];if((i=y[o]).enabled in globalThis.document||i.element in globalThis.document||i.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}if("webkitCurrentFullScreenElement"in globalThis.document){var i={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:y.webkit.events};return"webkitRequestFullScreen"in e&&(i.request="webkitRequestFullScreen"),i}return null}(),r=null,o=null,i=null,t=!1;function a(){null!==i&&(o.fullScreenable=i.fullScreenable,o.autoHideMenuBar=i.autoHideMenuBar,i=null),o=null}function u(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function c(){if(l){if(null!==o)return o;try{for(var i=require("electron").BrowserWindow.getAllWindows(),t=0;t<i.length;t++){var a=i[t];if(a.isFullScreen()||s.os===e.MacOS&&"function"==typeof a.isSimpleFullScreen&&a.isSimpleFullScreen())return a}return null}catch(e){return null}}if(null===n)return r&&r.webkitDisplayingFullscreen?r:null;var u=globalThis.document[n.element];return null!=u?u:null}function d(){return null!==c()}function m(t,a){if(void 0===t&&(t=function(){if(l){var n=require("electron"),r=n.BrowserWindow.getFocusedWindow();if(null!==r)return r;var o=n.BrowserWindow.getAllWindows();if(0===o.length)throw new Error;return o[0]}if(e.iOS===s.os){var i=globalThis.document.querySelector("video");if(null===i)throw new Error;return i}return globalThis.document.documentElement}()),l){var c=t;return new Promise((function(e,n){try{return null===o&&(i={fullScreenable:c.fullScreenable,autoHideMenuBar:c.autoHideMenuBar},c.fullScreenable=!0,c.autoHideMenuBar=!0),c.setFullScreen(!0),o=c,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==n){var l=t[n.request];if("function"==typeof l)try{var c=l.call(t,a);return void 0!==c&&"function"==typeof c.then?void c.then((function(){o()})).catch((function(){e.iOS===s.os?d():i()})):void o()}catch(n){if(e.iOS!==s.os)return void i()}}function d(){if(e.iOS===s.os&&"VIDEO"===t.tagName.toUpperCase()){var n=t;if(n.webkitSupportsFullscreen&&"function"==typeof n.webkitEnterFullscreen)return r=n,u(),n.webkitEnterFullscreen(),void o()}i()}d()}))}function f(){return new Promise(l?function(e,n){try{if(null!==o)o.setFullScreen(!1),a();else{var r=c();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}}:function(o,i){if(null!==n){var t=globalThis.document[n.exit];if("function"==typeof t){var l=t.call(globalThis.document);return void 0!==l&&"function"==typeof l.then?void l.then((function(){o()})).catch((function(){i()})):void o()}}if(e.iOS===s.os&&null!==r){if("function"==typeof r.webkitExitFullscreen&&!0===r.webkitDisplayingFullscreen)return r.webkitExitFullscreen(),r=null,void o();for(var a=globalThis.document.querySelectorAll("video"),u=0;u<a.length;u++){var d=a[u];if("function"==typeof d.webkitExitFullscreen&&!0===d.webkitDisplayingFullscreen)return d.webkitExitFullscreen(),void o()}}c()?i():o()})}return function(){if(!t){t=!0;var n=!1;if(l)try{for(var r=require("electron"),i=r.BrowserWindow.getAllWindows(),c=function(e){var n=i[e];n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))},d=0;d<i.length;d++)c(d);"function"==typeof r.BrowserWindow.on&&r.BrowserWindow.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){o=n,w()})),n.on("leave-full-screen",(function(){a(),w()}))}))}catch(e){}var m=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],f=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(d=0;d<m.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(m[d],w,!1);for(d=0;d<f.length;d++)void 0!==globalThis.document&&globalThis.document.addEventListener(f[d],g,!1);if(e.iOS===s.os)if(u(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){u()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function b(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function w(){b("fullscreenchange")}function g(){b("fullscreenerror")}}(),{get enabled(){return function(){if(l)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===n){if(e.iOS!==s.os)return!1;for(var r=globalThis.document.querySelectorAll("video"),o=0;o<r.length;o++){var i=r[o];if(i.webkitSupportsFullscreen||"webkitEnterFullscreen"in i)return!0}return!1}var t=globalThis.document[n.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[n.element]}()},get element(){return c()},get isFullscreen(){return d()},request:m,exit:f,toggle:function(e,n){return d()?f():m(e,n)},onChange:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenchange"),function(){n.forEach((function(e){e()}))}},onError:function(e){var n=[];return function(r){function o(n){e(n)}void 0!==globalThis.document&&(globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)})))}("fullscreenerror"),function(){n.forEach((function(e){e()}))}}}}(),W={installed:!1,name:"Fullscreen",module:M,Constants:{},Errors:{}};export{W as default};
|