native-fn 1.0.82 → 1.0.83
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 +8 -1
- package/dist/native.cjs +4 -10
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +4 -10
- package/dist/native.umd.js +4 -10
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +102 -255
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +102 -255
- package/dist/plugin/app/index.umd.js +102 -255
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/app/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/app/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/app/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/app/src/utils/request.d.ts +1 -0
- package/dist/plugin/appearance/index.cjs +55 -208
- package/dist/plugin/appearance/index.d.ts +1 -7
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +55 -208
- package/dist/plugin/appearance/index.umd.js +55 -208
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/appearance/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/appearance/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/appearance/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/appearance/src/utils/request.d.ts +1 -0
- package/dist/plugin/clipboard/index.cjs +61 -214
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +61 -214
- package/dist/plugin/clipboard/index.umd.js +61 -214
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/clipboard/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/clipboard/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/clipboard/src/utils/request.d.ts +1 -0
- package/dist/plugin/dimension/index.cjs +935 -1
- package/dist/plugin/dimension/index.d.ts +9 -0
- package/dist/plugin/dimension/index.min.cjs +1 -1
- package/dist/plugin/dimension/index.min.mjs +1 -1
- package/dist/plugin/dimension/index.mjs +935 -1
- package/dist/plugin/dimension/index.umd.js +935 -1
- package/dist/plugin/dimension/index.umd.min.js +1 -1
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/dimension/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/dimension/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/dimension/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/request.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +54 -207
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +54 -207
- package/dist/plugin/fullscreen/index.umd.js +54 -207
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/fullscreen/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/fullscreen/src/utils/request.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +50 -203
- package/dist/plugin/platform/index.d.ts +4 -20
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +50 -203
- package/dist/plugin/platform/index.umd.js +50 -203
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/platform/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/platform/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/platform/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/platform/src/utils/request.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +51 -204
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +51 -204
- package/dist/plugin/theme/index.umd.js +51 -204
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/plugin/theme/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/plugin/theme/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/plugin/theme/src/types/listener-entry.d.ts +6 -0
- package/dist/plugin/theme/src/utils/request.d.ts +1 -0
- package/dist/src/plugin/appearance/constants/index.d.ts +2 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +0 -6
- package/dist/src/plugin/dimension/constants/index.d.ts +3 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +9 -6
- package/dist/src/plugin/dimension/types/dimensions.d.ts +11 -0
- package/dist/src/plugin/dimension/types/index.d.ts +2 -2
- package/dist/src/plugin/platform/constants/index.d.ts +1 -0
- package/dist/src/plugin/platform/cores/index.d.ts +0 -10
- package/dist/src/plugin/platform/types/platform.d.ts +3 -19
- package/dist/src/types/listener-entry.d.ts +6 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/package.json +1 -1
|
@@ -74,6 +74,14 @@
|
|
|
74
74
|
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
75
75
|
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
76
76
|
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
77
|
+
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
78
|
+
'Google Chrome': 'Chrome',
|
|
79
|
+
'Microsoft Edge': 'Edge',
|
|
80
|
+
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
81
|
+
'Android WebView': 'Chrome WebView',
|
|
82
|
+
'HeadlessChrome': 'Chrome Headless',
|
|
83
|
+
'OperaMobile': 'Opera Mobi',
|
|
84
|
+
};
|
|
77
85
|
|
|
78
86
|
var readyState = 'loading';
|
|
79
87
|
var readyCallback = [];
|
|
@@ -87,15 +95,9 @@
|
|
|
87
95
|
get readyState() {
|
|
88
96
|
return readyState;
|
|
89
97
|
},
|
|
90
|
-
get network() {
|
|
91
|
-
return getNetwork();
|
|
92
|
-
},
|
|
93
98
|
get locale() {
|
|
94
99
|
return getLocale();
|
|
95
100
|
},
|
|
96
|
-
get dimension() {
|
|
97
|
-
return getDimension();
|
|
98
|
-
},
|
|
99
101
|
get device() {
|
|
100
102
|
if (this.os.name === OS.iOS || this.os.name === OS.Android)
|
|
101
103
|
return Devices.Mobile;
|
|
@@ -110,7 +112,7 @@
|
|
|
110
112
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
111
113
|
},
|
|
112
114
|
get isNode() {
|
|
113
|
-
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined;
|
|
115
|
+
return typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.node !== 'undefined';
|
|
114
116
|
},
|
|
115
117
|
get isStandalone() {
|
|
116
118
|
if (this.os.name === OS.iOS)
|
|
@@ -132,6 +134,33 @@
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
};
|
|
137
|
+
function resolveWindowsVersion(string) {
|
|
138
|
+
if (typeof string === 'undefined')
|
|
139
|
+
return '';
|
|
140
|
+
var mapped = {
|
|
141
|
+
'4.90': 'ME',
|
|
142
|
+
'NT3.51': 'NT 3.11',
|
|
143
|
+
'NT4.0': 'NT 4.0',
|
|
144
|
+
'NT 5.0': '2000',
|
|
145
|
+
'NT 5.1': 'XP',
|
|
146
|
+
'NT 5.2': 'XP',
|
|
147
|
+
'NT 6.0': 'Vista',
|
|
148
|
+
'NT 6.1': '7',
|
|
149
|
+
'NT 6.2': '8',
|
|
150
|
+
'NT 6.3': '8.1',
|
|
151
|
+
'NT 6.4': '10',
|
|
152
|
+
'NT 10.0': '10',
|
|
153
|
+
'ARM': 'RT'
|
|
154
|
+
}[string];
|
|
155
|
+
if (typeof mapped !== 'undefined')
|
|
156
|
+
return mapped;
|
|
157
|
+
return string;
|
|
158
|
+
}
|
|
159
|
+
function resolveUnderscoreVersion(string) {
|
|
160
|
+
if (typeof string === 'undefined')
|
|
161
|
+
return '';
|
|
162
|
+
return string.replace(/_/g, '.');
|
|
163
|
+
}
|
|
135
164
|
var OS_RESOLVER_MAP = [
|
|
136
165
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
137
166
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -190,14 +219,6 @@
|
|
|
190
219
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
191
220
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
192
221
|
];
|
|
193
|
-
var HIGH_ENTROPY_BRAND_NAME_MAP = {
|
|
194
|
-
'Google Chrome': 'Chrome',
|
|
195
|
-
'Microsoft Edge': 'Edge',
|
|
196
|
-
'Microsoft Edge WebView2': 'Edge WebView2',
|
|
197
|
-
'Android WebView': 'Chrome WebView',
|
|
198
|
-
'HeadlessChrome': 'Chrome Headless',
|
|
199
|
-
'OperaMobile': 'Opera Mobi',
|
|
200
|
-
};
|
|
201
222
|
function incrementPendingTasks() {
|
|
202
223
|
pendingTasks++;
|
|
203
224
|
}
|
|
@@ -218,33 +239,6 @@
|
|
|
218
239
|
readyCallback.length = 0;
|
|
219
240
|
}
|
|
220
241
|
}
|
|
221
|
-
function resolveWindowsVersion(string) {
|
|
222
|
-
if (string === undefined)
|
|
223
|
-
return '';
|
|
224
|
-
var mapped = {
|
|
225
|
-
'4.90': 'ME',
|
|
226
|
-
'NT3.51': 'NT 3.11',
|
|
227
|
-
'NT4.0': 'NT 4.0',
|
|
228
|
-
'NT 5.0': '2000',
|
|
229
|
-
'NT 5.1': 'XP',
|
|
230
|
-
'NT 5.2': 'XP',
|
|
231
|
-
'NT 6.0': 'Vista',
|
|
232
|
-
'NT 6.1': '7',
|
|
233
|
-
'NT 6.2': '8',
|
|
234
|
-
'NT 6.3': '8.1',
|
|
235
|
-
'NT 6.4': '10',
|
|
236
|
-
'NT 10.0': '10',
|
|
237
|
-
'ARM': 'RT'
|
|
238
|
-
}[string];
|
|
239
|
-
if (mapped !== undefined)
|
|
240
|
-
return mapped;
|
|
241
|
-
return string;
|
|
242
|
-
}
|
|
243
|
-
function resolveUnderscoreVersion(string) {
|
|
244
|
-
if (string === undefined)
|
|
245
|
-
return '';
|
|
246
|
-
return string.replace(/_/g, '.');
|
|
247
|
-
}
|
|
248
242
|
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
249
243
|
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
250
244
|
return '11';
|
|
@@ -381,12 +375,12 @@
|
|
|
381
375
|
return resolver(string);
|
|
382
376
|
if (typeof resolver === 'string')
|
|
383
377
|
return resolver;
|
|
384
|
-
if (string === undefined)
|
|
378
|
+
if (typeof string === 'undefined')
|
|
385
379
|
return '';
|
|
386
380
|
return string;
|
|
387
381
|
}
|
|
388
382
|
function normalizeBrand(entry) {
|
|
389
|
-
if (entry === null || entry === undefined)
|
|
383
|
+
if (entry === null || typeof entry === 'undefined')
|
|
390
384
|
return { brand: '', version: '' };
|
|
391
385
|
if (typeof entry === 'string')
|
|
392
386
|
return { brand: entry, version: '' };
|
|
@@ -440,102 +434,13 @@
|
|
|
440
434
|
return '';
|
|
441
435
|
}
|
|
442
436
|
}
|
|
443
|
-
function getNetwork() {
|
|
444
|
-
var network = {
|
|
445
|
-
isOnline: null,
|
|
446
|
-
effectiveType: null,
|
|
447
|
-
type: null,
|
|
448
|
-
downlink: null,
|
|
449
|
-
rtt: null,
|
|
450
|
-
saveData: null,
|
|
451
|
-
};
|
|
452
|
-
if (typeof globalThis.navigator !== 'undefined') {
|
|
453
|
-
if (typeof globalThis.navigator.onLine !== 'undefined')
|
|
454
|
-
network.isOnline = globalThis.navigator.onLine;
|
|
455
|
-
var connection = globalThis.navigator.connection || globalThis.navigator.mozConnection || globalThis.navigator.webkitConnection;
|
|
456
|
-
if (typeof connection !== 'undefined') {
|
|
457
|
-
if (typeof connection.effectiveType !== 'undefined')
|
|
458
|
-
network.effectiveType = connection.effectiveType;
|
|
459
|
-
if (typeof connection.type !== 'undefined')
|
|
460
|
-
network.type = connection.type;
|
|
461
|
-
if (typeof connection.downlink !== 'undefined')
|
|
462
|
-
network.downlink = connection.downlink;
|
|
463
|
-
if (typeof connection.rtt !== 'undefined')
|
|
464
|
-
network.rtt = connection.rtt;
|
|
465
|
-
if (typeof connection.saveData !== 'undefined')
|
|
466
|
-
network.saveData = connection.saveData;
|
|
467
|
-
return network;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
if (Platform.isNode) {
|
|
471
|
-
try {
|
|
472
|
-
var os = require('os');
|
|
473
|
-
var networkInterfaces = os.networkInterfaces();
|
|
474
|
-
var networkInterfaceNames = Object.keys(networkInterfaces);
|
|
475
|
-
for (var i = 0; i < networkInterfaceNames.length; i++) {
|
|
476
|
-
var name_1 = networkInterfaceNames[i];
|
|
477
|
-
var networkInterface = networkInterfaces[name_1];
|
|
478
|
-
for (var j = 0; j < networkInterface.length; j++) {
|
|
479
|
-
var address = networkInterface[j];
|
|
480
|
-
if (!address.internal && address.family === 'IPv4')
|
|
481
|
-
network.isOnline = true;
|
|
482
|
-
}
|
|
483
|
-
if (network.isOnline)
|
|
484
|
-
break;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
catch (_) {
|
|
488
|
-
}
|
|
489
|
-
try {
|
|
490
|
-
var childProcess = require('child_process');
|
|
491
|
-
if (Platform.os.name === OS.Windows) {
|
|
492
|
-
try {
|
|
493
|
-
var output = childProcess.execSync('netsh wlan show interfaces', { encoding: 'utf8', timeout: 5000 });
|
|
494
|
-
if (output.includes('State') && output.includes('connected'))
|
|
495
|
-
network.type = 'wifi';
|
|
496
|
-
}
|
|
497
|
-
catch (_) {
|
|
498
|
-
}
|
|
499
|
-
if (network.type === null) {
|
|
500
|
-
try {
|
|
501
|
-
var output = childProcess.execSync('ipconfig', { encoding: 'utf8', timeout: 5000 });
|
|
502
|
-
if (output.includes('Ethernet adapter'))
|
|
503
|
-
network.type = 'ethernet';
|
|
504
|
-
}
|
|
505
|
-
catch (_) {
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
if (network.type === null)
|
|
509
|
-
network.type = 'other';
|
|
510
|
-
}
|
|
511
|
-
else if (Platform.os.name === OS.MacOS) {
|
|
512
|
-
try {
|
|
513
|
-
var output = childProcess.execSync('networksetup -listallhardwareports', { encoding: 'utf8', timeout: 5000 });
|
|
514
|
-
var activeInterface = childProcess.execSync('route -n get default | grep interface', { encoding: 'utf8', timeout: 5000 });
|
|
515
|
-
if (activeInterface.includes('en0') && output.includes('Wi-Fi'))
|
|
516
|
-
network.type = 'wifi';
|
|
517
|
-
else if (activeInterface.includes('en') || output.includes('Ethernet'))
|
|
518
|
-
network.type = 'ethernet';
|
|
519
|
-
else
|
|
520
|
-
network.type = 'other';
|
|
521
|
-
}
|
|
522
|
-
catch (_) {
|
|
523
|
-
network.type = 'other';
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
catch (_) {
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
return network;
|
|
531
|
-
}
|
|
532
437
|
function normalizeLocale(locale) {
|
|
533
|
-
if (locale === null || locale === undefined)
|
|
438
|
+
if (locale === null || typeof locale === 'undefined')
|
|
534
439
|
return locale;
|
|
535
440
|
if (locale.length === 0)
|
|
536
441
|
return null;
|
|
537
442
|
locale = locale.replace(/_/g, '-');
|
|
538
|
-
if (locale === 'C' || locale === 'posix'
|
|
443
|
+
if (locale === 'C' || locale.toLowerCase() === 'posix')
|
|
539
444
|
return 'en-US';
|
|
540
445
|
if (locale.indexOf('.') !== -1)
|
|
541
446
|
return normalizeLocale(locale.split('.')[0]);
|
|
@@ -553,9 +458,9 @@
|
|
|
553
458
|
}
|
|
554
459
|
function getLocale() {
|
|
555
460
|
var locale = {
|
|
556
|
-
language:
|
|
461
|
+
language: null,
|
|
557
462
|
languages: [],
|
|
558
|
-
timezone:
|
|
463
|
+
timezone: null,
|
|
559
464
|
timezoneOffset: 0,
|
|
560
465
|
};
|
|
561
466
|
function addLanguages(language) {
|
|
@@ -565,7 +470,7 @@
|
|
|
565
470
|
function addLanguage(language) {
|
|
566
471
|
language = normalizeLocale(language);
|
|
567
472
|
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
568
|
-
if (locale.language
|
|
473
|
+
if (locale.language === null)
|
|
569
474
|
locale.language = language;
|
|
570
475
|
locale.languages.push(language);
|
|
571
476
|
}
|
|
@@ -623,6 +528,11 @@
|
|
|
623
528
|
}
|
|
624
529
|
catch (_) {
|
|
625
530
|
}
|
|
531
|
+
try {
|
|
532
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
533
|
+
}
|
|
534
|
+
catch (_) {
|
|
535
|
+
}
|
|
626
536
|
}
|
|
627
537
|
if (typeof globalThis.navigator !== 'undefined') {
|
|
628
538
|
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
@@ -636,13 +546,6 @@
|
|
|
636
546
|
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
637
547
|
addLanguage(globalThis.navigator.systemLanguage);
|
|
638
548
|
}
|
|
639
|
-
try {
|
|
640
|
-
if (typeof Intl !== 'undefined') {
|
|
641
|
-
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
catch (_) {
|
|
645
|
-
}
|
|
646
549
|
try {
|
|
647
550
|
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
648
551
|
}
|
|
@@ -650,63 +553,8 @@
|
|
|
650
553
|
}
|
|
651
554
|
return locale;
|
|
652
555
|
}
|
|
653
|
-
function getDimension() {
|
|
654
|
-
var dimension = {
|
|
655
|
-
innerWidth: -1,
|
|
656
|
-
innerHeight: -1,
|
|
657
|
-
outerWidth: -1,
|
|
658
|
-
outerHeight: -1,
|
|
659
|
-
scale: 1,
|
|
660
|
-
};
|
|
661
|
-
if (typeof globalThis.innerWidth !== 'undefined') {
|
|
662
|
-
dimension.innerWidth = globalThis.innerWidth;
|
|
663
|
-
dimension.innerHeight = globalThis.innerHeight;
|
|
664
|
-
dimension.outerWidth = globalThis.outerWidth;
|
|
665
|
-
dimension.outerHeight = globalThis.outerHeight;
|
|
666
|
-
dimension.scale = globalThis.devicePixelRatio || 1;
|
|
667
|
-
return dimension;
|
|
668
|
-
}
|
|
669
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
670
|
-
try {
|
|
671
|
-
var reactNative = require('react-native');
|
|
672
|
-
var dimensions = reactNative.Dimensions;
|
|
673
|
-
var pixelRatio = reactNative.PixelRatio;
|
|
674
|
-
var screenDimensions = dimensions.get('screen');
|
|
675
|
-
var windowDimensions = dimensions.get('window');
|
|
676
|
-
dimension.innerWidth = screenDimensions.width;
|
|
677
|
-
dimension.innerHeight = screenDimensions.height;
|
|
678
|
-
dimension.outerWidth = windowDimensions.width;
|
|
679
|
-
dimension.outerHeight = windowDimensions.height;
|
|
680
|
-
dimension.scale = pixelRatio.get();
|
|
681
|
-
return dimension;
|
|
682
|
-
}
|
|
683
|
-
catch (_) {
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
687
|
-
try {
|
|
688
|
-
var electron = require('electron');
|
|
689
|
-
var screen_1 = electron.screen;
|
|
690
|
-
var browserWindow = electron.BrowserWindow;
|
|
691
|
-
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
692
|
-
if (focusedWindow !== undefined) {
|
|
693
|
-
var contentSize = focusedWindow.getContentSize();
|
|
694
|
-
var size = focusedWindow.getSize();
|
|
695
|
-
dimension.innerWidth = contentSize[0];
|
|
696
|
-
dimension.innerHeight = contentSize[1];
|
|
697
|
-
dimension.outerWidth = size[0];
|
|
698
|
-
dimension.outerHeight = size[1];
|
|
699
|
-
dimension.scale = screen_1.getDisplayMatching(focusedWindow.getBounds()).scaleFactor;
|
|
700
|
-
}
|
|
701
|
-
return dimension;
|
|
702
|
-
}
|
|
703
|
-
catch (_) {
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return dimension;
|
|
707
|
-
}
|
|
708
556
|
function init() {
|
|
709
|
-
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT)))
|
|
557
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && typeof globalThis.process.versions.electron !== 'undefined') || (/ electron\//i.test(USER_AGENT)))
|
|
710
558
|
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
711
559
|
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative')
|
|
712
560
|
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
@@ -902,8 +750,7 @@
|
|
|
902
750
|
finally {
|
|
903
751
|
decrementPendingTasks();
|
|
904
752
|
}
|
|
905
|
-
})
|
|
906
|
-
.catch(decrementPendingTasks);
|
|
753
|
+
});
|
|
907
754
|
}
|
|
908
755
|
checkReady();
|
|
909
756
|
}
|
|
@@ -996,7 +843,7 @@
|
|
|
996
843
|
var electron = require('electron');
|
|
997
844
|
var browserWindow = electron.BrowserWindow;
|
|
998
845
|
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
999
|
-
if (focusedWindow === undefined)
|
|
846
|
+
if (typeof focusedWindow === 'undefined')
|
|
1000
847
|
throw new Error();
|
|
1001
848
|
return focusedWindow;
|
|
1002
849
|
}
|
|
@@ -1161,7 +1008,7 @@
|
|
|
1161
1008
|
return null;
|
|
1162
1009
|
}
|
|
1163
1010
|
var currentElement = globalThis.document[api.element];
|
|
1164
|
-
if (currentElement !== null && currentElement !== undefined)
|
|
1011
|
+
if (currentElement !== null && typeof currentElement !== 'undefined')
|
|
1165
1012
|
return currentElement;
|
|
1166
1013
|
return null;
|
|
1167
1014
|
}
|
|
@@ -1198,7 +1045,7 @@
|
|
|
1198
1045
|
if (typeof method === 'function') {
|
|
1199
1046
|
try {
|
|
1200
1047
|
var result = method.call(target, options);
|
|
1201
|
-
if (result !== undefined && typeof result.then === 'function') {
|
|
1048
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
1202
1049
|
result
|
|
1203
1050
|
.then(function () {
|
|
1204
1051
|
resolve();
|
|
@@ -1266,7 +1113,7 @@
|
|
|
1266
1113
|
var method = globalThis.document[api.exit];
|
|
1267
1114
|
if (typeof method === 'function') {
|
|
1268
1115
|
var result = method.call(globalThis.document);
|
|
1269
|
-
if (result !== undefined && typeof result.then === 'function') {
|
|
1116
|
+
if (typeof result !== 'undefined' && typeof result.then === 'function') {
|
|
1270
1117
|
result
|
|
1271
1118
|
.then(function () {
|
|
1272
1119
|
resolve();
|
|
@@ -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,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",a="loading",l=[],s=0,u={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:o.Unknown,version:""},crossPlatformFramework:i.Unknown,userAgent:t,get readyState(){return a},get network(){return function(){var n={isOnline:null,effectiveType:null,type:null,downlink:null,rtt:null,saveData:null};if(void 0!==globalThis.navigator){void 0!==globalThis.navigator.onLine&&(n.isOnline=globalThis.navigator.onLine);var r=globalThis.navigator.connection||globalThis.navigator.mozConnection||globalThis.navigator.webkitConnection;if(void 0!==r)return void 0!==r.effectiveType&&(n.effectiveType=r.effectiveType),void 0!==r.type&&(n.type=r.type),void 0!==r.downlink&&(n.downlink=r.downlink),void 0!==r.rtt&&(n.rtt=r.rtt),void 0!==r.saveData&&(n.saveData=r.saveData),n}if(u.isNode){try{for(var o=require("os").networkInterfaces(),i=Object.keys(o),t=0;t<i.length;t++){for(var a=o[i[t]],l=0;l<a.length;l++){var s=a[l];s.internal||"IPv4"!==s.family||(n.isOnline=!0)}if(n.isOnline)break}}catch(e){}try{var c=require("child_process");if(u.os.name===e.Windows){try{(d=c.execSync("netsh wlan show interfaces",{encoding:"utf8",timeout:5e3})).includes("State")&&d.includes("connected")&&(n.type="wifi")}catch(e){}if(null===n.type)try{(d=c.execSync("ipconfig",{encoding:"utf8",timeout:5e3})).includes("Ethernet adapter")&&(n.type="ethernet")}catch(e){}null===n.type&&(n.type="other")}else if(u.os.name===e.MacOS)try{var d=c.execSync("networksetup -listallhardwareports",{encoding:"utf8",timeout:5e3}),m=c.execSync("route -n get default | grep interface",{encoding:"utf8",timeout:5e3});m.includes("en0")&&d.includes("Wi-Fi")?n.type="wifi":m.includes("en")||d.includes("Ethernet")?n.type="ethernet":n.type="other"}catch(e){n.type="other"}}catch(e){}}return n}()},get locale(){return function(){var e={language:"",languages:[],timezone:"",timezoneOffset:0};function n(e){for(var n=0;n<e.length;n++)r(e[n])}function r(n){"string"==typeof(n=S(n))&&-1===e.languages.indexOf(n)&&(0===e.language.length&&(e.language=n),e.languages.push(n))}if(u.crossPlatformFramework===i.ReactNative)try{var o=require("react-native").NativeModules;if(void 0!==o.SettingsManager){var t=o.SettingsManager;if(void 0!==t)if(void 0!==(l="function"==typeof t.getConstants?t.getConstants():t)&&void 0!==l.settings){var a=l.settings;"string"==typeof a.AppleLocale&&r(a.AppleLocale),Array.isArray(a.AppleLanguages)&&a.AppleLanguages.length>0&&n(a.AppleLanguages)}}if(void 0!==o.I18nManager){var l,s=o.I18nManager;if(void 0!==s)void 0!==(l="function"==typeof s.getConstants?s.getConstants():s)&&void 0!==l.localeIdentifier&&r(l.localeIdentifier)}}catch(e){}if(u.crossPlatformFramework===i.Electron)try{var c=require("electron").app;void 0!==c.getLocale&&r(c.getLocale()),void 0!==c.getSystemLocale&&r(c.getSystemLocale()),void 0!==c.getPreferredSystemLanguages&&n(c.getPreferredSystemLanguages())}catch(e){}if("undefined"!=typeof Intl)try{r(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&n(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&r(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&r(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&r(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&r(globalThis.navigator.systemLanguage));try{"undefined"!=typeof Intl&&(e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone)}catch(e){}try{e.timezoneOffset=(new Date).getTimezoneOffset()}catch(e){}return e}()},get dimension(){return function(){var e={innerWidth:-1,innerHeight:-1,outerWidth:-1,outerHeight:-1,scale:1};if(void 0!==globalThis.innerWidth)return e.innerWidth=globalThis.innerWidth,e.innerHeight=globalThis.innerHeight,e.outerWidth=globalThis.outerWidth,e.outerHeight=globalThis.outerHeight,e.scale=globalThis.devicePixelRatio||1,e;if(u.crossPlatformFramework===i.ReactNative)try{var n=require("react-native"),r=n.Dimensions,o=n.PixelRatio,t=r.get("screen"),a=r.get("window");return e.innerWidth=t.width,e.innerHeight=t.height,e.outerWidth=a.width,e.outerHeight=a.height,e.scale=o.get(),e}catch(e){}if(u.crossPlatformFramework===i.Electron)try{var l=require("electron"),s=l.screen,c=l.BrowserWindow,d=c.getFocusedWindow()||c.getAllWindows()[0];if(void 0!==d){var m=d.getContentSize(),g=d.getSize();e.innerWidth=m[0],e.innerHeight=m[1],e.outerWidth=g[0],e.outerHeight=g[1],e.scale=s.getDisplayMatching(d.getBounds()).scaleFactor}return e}catch(e){}return e}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?n.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?n.Desktop:n.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches},onready:function(e){if("complete"===this.readyState)try{e(this)}catch(e){}else l.push(e)}},c=[[/windows nt (6\.[23]); arm/i,e.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,h],[/windows ce\/?([\d.]*)/i,e.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,b],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,b],[/cfnetwork\/.+darwin/i,e.iOS,b],[/mac os x ?([\w. ]*)/i,e.MacOS,b],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,b],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],d=[[/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]],m=[[/\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]],g={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"};function f(){s--,v()}function v(){if(0===s&&"loading"===a){a="complete";for(var e=0;e<l.length;e++)try{l[e](u)}catch(e){}l.length=0}}function h(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 b(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function p(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}function T(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}function k(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function y(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}function E(){if(u.crossPlatformFramework=i.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":u.os={name:e.Android,version:globalThis.device.version};break;case"iOS":u.os={name:e.iOS,version:globalThis.device.version}}f()}function S(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e||"POSIX"===e)return"en-US";if(-1!==e.indexOf("."))return S(e.split(".")[0]);if(-1!==e.indexOf("@"))return S(e.split("@")[0]);var n=e.split("-");return 0===n.length?null:(n[0]=n[0].toLowerCase(),n.length>1&&2===n[1].length&&(n[1]=n[1].toUpperCase()),n.length>2&&4===n[1].length&&(n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase()),n.join("-"))}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(u.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(u.crossPlatformFramework=i.ReactNative);for(var r=0;r<c.length;r++){var a=(S=c[r])[0],l=S[1],h=S[2];if(null!==(F=u.userAgent.match(a))){u.os={name:l,version:k(F[1],h)};break}}for(u.os.name===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var a=void 0,l=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(l=t<o.length?parseInt(o[t],10):0))return 1;if(a<l)return-1}return 0}(u.os.version,"18.6")&&null!==(O=/\) Version\/([\d.]+)/.exec(u.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(u.os.version=O[1]),r=0;r<d.length;r++){a=(S=d[r])[0];var b=S[1];h=S[2];if(null!==(F=u.userAgent.match(a))){u.engine={name:b,version:k(F[1],h)};break}}for(r=0;r<m.length;r++){a=(S=m[r])[0];var S,F,j=S[1];h=S[2];if(null!==(F=u.userAgent.match(a))){u.browser={name:j,version:k(F[1],h)};break}}if(u.crossPlatformFramework===i.ReactNative)try{l=(W=require("react-native").Platform).OS;var O=y(x=""+W.Version);switch(l){case"android":u.os={name:e.Android,version:T(O,x)};break;case"ios":u.os={name:e.iOS,version:x};break;case"windows":u.os={name:e.Windows,version:w(O,x)};break;case"macos":u.os={name:e.MacOS,version:x}}}catch(e){}if(u.isNode)try{var x,W=(l=require("os")).platform();O=y(x=l.release());switch(W){case"win32":u.os={name:e.Windows,version:w(O,x)};break;case"darwin":u.os={name:e.MacOS,version:p(O,x)};break;case"android":u.os={name:e.Android,version:x};break;case"linux":/android/i.test(x)&&(u.os={name:e.Android,version:x})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?E():globalThis.document.addEventListener("deviceready",E,!1)),void 0!==globalThis.navigator&&void 0!==globalThis.navigator.userAgentData&&void 0!==globalThis.navigator.userAgentData.getHighEntropyValues&&(s++,globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){try{for(var i=r.fullVersionList||r.brands||[],t=r.platformVersion,a=r.platform,l=u.browser.name,s=null,c=0;c<i.length;c++){var d=null==(h=i[c])?{brand:"",version:""}:"string"==typeof h?{brand:h,version:""}:{brand:h.brand,version:h.version},m=d.version,v=d.brand;/not.a.brand/i.test(v)||((null===s||/Chrom/.test(s)&&"Chromium"!==v||"Edge"===s&&/WebView2/.test(v))&&(v=g[v]||v,null!==(s=l)&&!/Chrom/.test(s)&&/Chrom/.test(v)||("Chrome"===(l=v)||"Chrome WebView"===l||"Chrome Headless"===l?u.browser.name=o.Chrome:"Edge"===l||"Edge WebView2"===l?u.browser.name=o.Edge:"Opera Mobi"===l&&(u.browser.name=o.Opera),u.browser.version=m),s=v),"Chromium"===v&&(u.engine.version=m))}"string"==typeof t&&(u.os.name===e.Windows?u.os.version=parseInt(t.split(".")[0],10)>=13?"11":"10":u.os.version=t),"string"==typeof a&&(/android/i.test(a)?u.os.name=e.Android:/ios|iphone|ipad/i.test(a)?u.os.name=e.iOS:/windows|win32/i.test(a)?u.os.name=e.Windows:/macos|macintel/i.test(a)&&(u.os.name=e.MacOS)),!0===r.mobile&&(u.device=n.Mobile)}catch(e){}finally{f()}var h})).catch(f)),v()}();var F={get enabled(){return function(){if(u.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===M){if(u.os.name!==e.iOS)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[M.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[M.element]}()},get element(){return P()},get isFullscreen(){return q()},request:N,exit:I,toggle:function(e,n){return q()?I():N(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},j=null,O=null,x=null,W=!1,M=function(){if(u.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return C.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],t=C[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var a={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:C.webkit.events};return"webkitRequestFullScreen"in e&&(a.request="webkitRequestFullScreen"),a}return null}(),C={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 A(){null!==x&&(null!==O&&(O.fullScreenable=x.fullScreenable,O.autoHideMenuBar=x.autoHideMenuBar),x=null),O=null}function L(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function P(){if(u.crossPlatformFramework===i.Electron){if(null!==O)return O;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||u.os.name===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===M)return j&&j.webkitDisplayingFullscreen?j:null;var t=globalThis.document[M.element];return null!=t?t:null}function q(){return null!==P()}function N(n,r){if(void 0===n&&(n=function(){if(u.crossPlatformFramework===i.Electron){var n=require("electron").BrowserWindow,r=n.getFocusedWindow()||n.getAllWindows()[0];if(void 0===r)throw new Error;return r}if(u.os.name===e.iOS){var o=globalThis.document.querySelector("video");if(null===o)throw new Error;return o}return globalThis.document.documentElement}()),u.crossPlatformFramework===i.Electron){var o=n;return new Promise((function(e,n){try{return null===O&&(x={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),O=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==M){var t=n[M.request];if("function"==typeof t)try{var a=t.call(n,r);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){u.os.name===e.iOS?l():i()})):void o()}catch(n){if(u.os.name!==e.iOS)return void i()}}function l(){if(u.os.name===e.iOS&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return j=r,L(),r.webkitEnterFullscreen(),void o()}i()}l()}))}function I(){return u.crossPlatformFramework===i.Electron?new Promise((function(e,n){try{if(null!==O)O.setFullScreen(!1),A();else{var r=P();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(n,r){if(null!==M){var o=globalThis.document[M.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(u.os.name===e.iOS&&null!==j){if("function"==typeof j.webkitExitFullscreen&&!0===j.webkitDisplayingFullscreen)return j.webkitExitFullscreen(),j=null,void n();for(var t=globalThis.document.querySelectorAll("video"),a=0;a<t.length;a++){var l=t[a];if("function"==typeof l.webkitExitFullscreen&&!0===l.webkitDisplayingFullscreen)return l.webkitExitFullscreen(),void n()}}P()?r():n()}))}return function(){if(!W){W=!0;var n=!1;if(u.crossPlatformFramework===i.Electron)try{for(var r=require("electron").BrowserWindow,o=r.getAllWindows(),t=function(e){var n=o[e];n.on("enter-full-screen",(function(){O=n,d()})),n.on("leave-full-screen",(function(){A(),d()}))},a=0;a<o.length;a++)t(a);"function"==typeof r.on&&r.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){O=n,d()})),n.on("leave-full-screen",(function(){A(),d()}))}))}catch(e){}var l=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(a=0;a<l.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(l[a],d,!1);for(a=0;a<s.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[a],m,!1);if(u.os.name===e.iOS)if(L(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){L()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function c(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 d(){c("fullscreenchange")}function m(){c("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:F,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,i;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(n||(n={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(r||(r={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(o||(o={})),function(e){e.Unknown="Unknown",e.ReactNative="ReactNative",e.Electron="Electron",e.Cordova="Cordova"}(i||(i={}));var t=void 0!==globalThis.navigator&&"string"==typeof globalThis.navigator.userAgent?globalThis.navigator.userAgent:"",a={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"},l="loading",s=[],u=0,c={os:{name:e.Unknown,version:""},engine:{name:r.Unknown,version:""},browser:{name:o.Unknown,version:""},crossPlatformFramework:i.Unknown,userAgent:t,get readyState(){return l},get locale(){return function(){var e={language:null,languages:[],timezone:null,timezoneOffset:0};function n(e){for(var n=0;n<e.length;n++)r(e[n])}function r(n){"string"==typeof(n=F(n))&&-1===e.languages.indexOf(n)&&(null===e.language&&(e.language=n),e.languages.push(n))}if(c.crossPlatformFramework===i.ReactNative)try{var o=require("react-native").NativeModules;if(void 0!==o.SettingsManager){var t=o.SettingsManager;if(void 0!==t)if(void 0!==(l="function"==typeof t.getConstants?t.getConstants():t)&&void 0!==l.settings){var a=l.settings;"string"==typeof a.AppleLocale&&r(a.AppleLocale),Array.isArray(a.AppleLanguages)&&a.AppleLanguages.length>0&&n(a.AppleLanguages)}}if(void 0!==o.I18nManager){var l,s=o.I18nManager;if(void 0!==s)void 0!==(l="function"==typeof s.getConstants?s.getConstants():s)&&void 0!==l.localeIdentifier&&r(l.localeIdentifier)}}catch(e){}if(c.crossPlatformFramework===i.Electron)try{var u=require("electron").app;void 0!==u.getLocale&&r(u.getLocale()),void 0!==u.getSystemLocale&&r(u.getSystemLocale()),void 0!==u.getPreferredSystemLanguages&&n(u.getPreferredSystemLanguages())}catch(e){}if("undefined"!=typeof Intl){try{r(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}try{e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&n(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&r(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&r(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&r(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&r(globalThis.navigator.systemLanguage));try{e.timezoneOffset=(new Date).getTimezoneOffset()}catch(e){}return e}()},get device(){return this.os.name===e.iOS||this.os.name===e.Android?n.Mobile:this.os.name===e.Windows||this.os.name===e.MacOS?n.Desktop:n.Unknown},get renderer(){return function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var n=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===n)return"";if(n instanceof WebGLRenderingContext||"getParameter"in n&&"function"==typeof n.getParameter){var r=n.getExtension("WEBGL_debug_renderer_info");return null===r?n.getParameter(n.RENDERER):n.getParameter(r.UNMASKED_RENDERER_WEBGL)}return""}()},get isWebview(){return/; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent)},get isNode(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get isStandalone(){return this.os.name===e.iOS?"standalone"in globalThis.navigator&&!!globalThis.navigator.standalone:"matchMedia"in globalThis&&globalThis.matchMedia("(display-mode: standalone)").matches},onready:function(e){if("complete"===this.readyState)try{e(this)}catch(e){}else s.push(e)}};function m(e){if(void 0===e)return"";var n={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==n?n:e}function d(e){return void 0===e?"":e.replace(/_/g,".")}var f=[[/windows nt (6\.[23]); arm/i,e.Windows,m],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,m],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,m],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,m],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,m],[/windows ce\/?([\d.]*)/i,e.Windows,m],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,d],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,d],[/cfnetwork\/.+darwin/i,e.iOS,d],[/mac os x ?([\w. ]*)/i,e.MacOS,d],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,d],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],g=[[/windows.+ edge\/([\w.]+)/i,r.EdgeHTML],[/arkweb\/([\w.]+)/i,r.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,r.Blink],[/presto\/([\w.]+)/i,r.Presto],[/webkit\/([\w.]+)/i,r.WebKit],[/trident\/([\w.]+)/i,r.Trident],[/netfront\/([\w.]+)/i,r.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,r.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,r.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,r.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,o.Chrome],[/webview.+edge\/([\w.]+)/i,o.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,o.Edge],[/opera mini\/([-\w.]+)/i,o.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,o.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,o.Opera],[/opios[\/ ]+([\w.]+)/i,o.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,o.Opera],[/\bopr\/([\w.]+)/i,o.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,o.IE],[/(?:ms|\()ie ([\w.]+)/i,o.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,o.IE],[/\bfocus\/([\w.]+)/i,o.Firefox],[/\bopt\/([\w.]+)/i,o.Opera],[/coast\/([\w.]+)/i,o.Opera],[/fxios\/([\w.-]+)/i,o.Firefox],[/samsungbrowser\/([\w.]+)/i,o.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,o.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,o.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,o.Chrome],[/chrome\/([\w.]+) mobile/i,o.Chrome],[/chrome\/v?([\w.]+)/i,o.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,o.Safari],[/version\/([\w.,]+) .*safari/i,o.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,o.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,o.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,o.Firefox],[/firefox\/([\w.]+)/i,o.Firefox]];function b(){u--,w()}function w(){if(0===u&&"loading"===l){l="complete";for(var e=0;e<s.length;e++)try{s[e](c)}catch(e){}s.length=0}}function h(e,n){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":n}function p(e,n){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:n}function T(e,n){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major||19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":n}function k(e,n){return"function"==typeof n?n(e):"string"==typeof n?n:void 0===e?"":e}function E(e){var n=e.split(".");return{major:parseInt(n[0]||"0"),minor:parseInt(n[1]||"0"),build:parseInt(n[2]||"0")}}function S(){if(c.crossPlatformFramework=i.Cordova,void 0!==globalThis.device)switch(globalThis.device.platform){case"Android":c.os={name:e.Android,version:globalThis.device.version};break;case"iOS":c.os={name:e.iOS,version:globalThis.device.version}}b()}function F(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e.toLowerCase())return"en-US";if(-1!==e.indexOf("."))return F(e.split(".")[0]);if(-1!==e.indexOf("@"))return F(e.split("@")[0]);var n=e.split("-");return 0===n.length?null:(n[0]=n[0].toLowerCase(),n.length>1&&2===n[1].length&&(n[1]=n[1].toUpperCase()),n.length>2&&4===n[1].length&&(n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase()),n.join("-"))}!function(){(void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(t))&&(c.crossPlatformFramework=i.Electron),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product&&(c.crossPlatformFramework=i.ReactNative);for(var r=0;r<f.length;r++){var l=(F=f[r])[0],s=F[1],m=F[2];if(null!==(j=c.userAgent.match(l))){c.os={name:s,version:k(j[1],m)};break}}for(c.os.name===e.iOS&&0===function(e,n){for(var r=e.split("."),o=n.split("."),i=Math.max(r.length,o.length),t=0;t<i;t++){var a=void 0,l=void 0;if((a=t<r.length?parseInt(r[t],10):0)>(l=t<o.length?parseInt(o[t],10):0))return 1;if(a<l)return-1}return 0}(c.os.version,"18.6")&&null!==(O=/\) Version\/([\d.]+)/.exec(c.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(c.os.version=O[1]),r=0;r<g.length;r++){l=(F=g[r])[0];var d=F[1];m=F[2];if(null!==(j=c.userAgent.match(l))){c.engine={name:d,version:k(j[1],m)};break}}for(r=0;r<v.length;r++){l=(F=v[r])[0];var F,j,y=F[1];m=F[2];if(null!==(j=c.userAgent.match(l))){c.browser={name:y,version:k(j[1],m)};break}}if(c.crossPlatformFramework===i.ReactNative)try{s=(M=require("react-native").Platform).OS;var O=E(x=""+M.Version);switch(s){case"android":c.os={name:e.Android,version:T(O,x)};break;case"ios":c.os={name:e.iOS,version:x};break;case"windows":c.os={name:e.Windows,version:h(O,x)};break;case"macos":c.os={name:e.MacOS,version:x}}}catch(e){}if(c.isNode)try{var x,M=(s=require("os")).platform();O=E(x=s.release());switch(M){case"win32":c.os={name:e.Windows,version:h(O,x)};break;case"darwin":c.os={name:e.MacOS,version:p(O,x)};break;case"android":c.os={name:e.Android,version:x};break;case"linux":/android/i.test(x)&&(c.os={name:e.Android,version:x})}}catch(e){}void 0!==globalThis.document&&(void 0!==globalThis.device?S():globalThis.document.addEventListener("deviceready",S,!1)),void 0!==globalThis.navigator&&void 0!==globalThis.navigator.userAgentData&&void 0!==globalThis.navigator.userAgentData.getHighEntropyValues&&(u++,globalThis.navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(r){try{for(var i=r.fullVersionList||r.brands||[],t=r.platformVersion,l=r.platform,s=c.browser.name,u=null,m=0;m<i.length;m++){var d=null==(v=i[m])?{brand:"",version:""}:"string"==typeof v?{brand:v,version:""}:{brand:v.brand,version:v.version},f=d.version,g=d.brand;/not.a.brand/i.test(g)||((null===u||/Chrom/.test(u)&&"Chromium"!==g||"Edge"===u&&/WebView2/.test(g))&&(g=a[g]||g,null!==(u=s)&&!/Chrom/.test(u)&&/Chrom/.test(g)||("Chrome"===(s=g)||"Chrome WebView"===s||"Chrome Headless"===s?c.browser.name=o.Chrome:"Edge"===s||"Edge WebView2"===s?c.browser.name=o.Edge:"Opera Mobi"===s&&(c.browser.name=o.Opera),c.browser.version=f),u=g),"Chromium"===g&&(c.engine.version=f))}"string"==typeof t&&(c.os.name===e.Windows?c.os.version=parseInt(t.split(".")[0],10)>=13?"11":"10":c.os.version=t),"string"==typeof l&&(/android/i.test(l)?c.os.name=e.Android:/ios|iphone|ipad/i.test(l)?c.os.name=e.iOS:/windows|win32/i.test(l)?c.os.name=e.Windows:/macos|macintel/i.test(l)&&(c.os.name=e.MacOS)),!0===r.mobile&&(c.device=n.Mobile)}catch(e){}finally{b()}var v}))),w()}();var j={get enabled(){return function(){if(c.crossPlatformFramework===i.Electron)try{return"function"==typeof require("electron").BrowserWindow.prototype.setFullScreen}catch(e){return!1}if(null===C){if(c.os.name!==e.iOS)return!1;for(var n=globalThis.document.querySelectorAll("video"),r=0;r<n.length;r++){var o=n[r];if(o.webkitSupportsFullscreen||"webkitEnterFullscreen"in o)return!0}return!1}var t=globalThis.document[C.enabled];return"boolean"==typeof t?t:void 0!==globalThis.document[C.element]}()},get element(){return P()},get isFullscreen(){return N()},request:q,exit:I,toggle:function(e,n){return N()?I():q(e,n)},onchange:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenchange"),function(){for(var e=0;e<n.length;e++)n[e]()}},onerror:function(e){var n=[];return function(r){function o(n){e(n)}if(void 0===globalThis.document)return;globalThis.document.addEventListener(r,o,!1),n.push((function(){globalThis.document.removeEventListener(r,o,!1)}))}("fullscreenerror"),function(){for(var e=0;e<n.length;e++)n[e]()}}},y=null,O=null,x=null,M=!1,C=function(){if(c.crossPlatformFramework===i.Electron)return null;var e=globalThis.document.documentElement;if("fullscreenEnabled"in globalThis.document||"exitFullscreen"in globalThis.document)return A.standard;for(var n=["webkit","moz","ms"],r=0;r<n.length;r++){var o=n[r],t=A[o];if(t.enabled in globalThis.document||t.element in globalThis.document||t.exit in globalThis.document)return"webkit"===o&&"webkitRequestFullScreen"in e&&(t.request="webkitRequestFullScreen"),t}if("webkitCurrentFullScreenElement"in globalThis.document){var a={enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:A.webkit.events};return"webkitRequestFullScreen"in e&&(a.request="webkitRequestFullScreen"),a}return null}(),A={standard:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}};function L(){null!==x&&(null!==O&&(O.fullScreenable=x.fullScreenable,O.autoHideMenuBar=x.autoHideMenuBar),x=null),O=null}function W(){void 0!==globalThis.document&&globalThis.document.querySelectorAll("video").forEach((function(e){function n(){globalThis.document.dispatchEvent(new Event("fullscreenchange"))}e.__fsBridged__||!("webkitEnterFullscreen"in e)&&!("onwebkitbeginfullscreen"in e)||(e.addEventListener("webkitbeginfullscreen",n,!1),e.addEventListener("webkitendfullscreen",n,!1),e.__fsBridged__=!0)}))}function P(){if(c.crossPlatformFramework===i.Electron){if(null!==O)return O;try{for(var n=require("electron").BrowserWindow.getAllWindows(),r=0;r<n.length;r++){var o=n[r];if(o.isFullScreen()||c.os.name===e.MacOS&&"function"==typeof o.isSimpleFullScreen&&o.isSimpleFullScreen())return o}return null}catch(e){return null}}if(null===C)return y&&y.webkitDisplayingFullscreen?y:null;var t=globalThis.document[C.element];return null!=t?t:null}function N(){return null!==P()}function q(n,r){if(void 0===n&&(n=function(){if(c.crossPlatformFramework===i.Electron){var n=require("electron").BrowserWindow,r=n.getFocusedWindow()||n.getAllWindows()[0];if(void 0===r)throw new Error;return r}if(c.os.name===e.iOS){var o=globalThis.document.querySelector("video");if(null===o)throw new Error;return o}return globalThis.document.documentElement}()),c.crossPlatformFramework===i.Electron){var o=n;return new Promise((function(e,n){try{return null===O&&(x={fullScreenable:o.fullScreenable,autoHideMenuBar:o.autoHideMenuBar},o.fullScreenable=!0,o.autoHideMenuBar=!0),o.setFullScreen(!0),O=o,void e()}catch(e){n()}}))}return new Promise((function(o,i){if(null!==C){var t=n[C.request];if("function"==typeof t)try{var a=t.call(n,r);return void 0!==a&&"function"==typeof a.then?void a.then((function(){o()})).catch((function(){c.os.name===e.iOS?l():i()})):void o()}catch(n){if(c.os.name!==e.iOS)return void i()}}function l(){if(c.os.name===e.iOS&&"VIDEO"===n.tagName.toUpperCase()){var r=n;if(r.webkitSupportsFullscreen&&"function"==typeof r.webkitEnterFullscreen)return y=r,W(),r.webkitEnterFullscreen(),void o()}i()}l()}))}function I(){return c.crossPlatformFramework===i.Electron?new Promise((function(e,n){try{if(null!==O)O.setFullScreen(!1),L();else{var r=P();null!==r&&r.setFullScreen(!1)}e()}catch(e){n()}})):new Promise((function(n,r){if(null!==C){var o=globalThis.document[C.exit];if("function"==typeof o){var i=o.call(globalThis.document);return void 0!==i&&"function"==typeof i.then?void i.then((function(){n()})).catch((function(){r()})):void n()}}if(c.os.name===e.iOS&&null!==y){if("function"==typeof y.webkitExitFullscreen&&!0===y.webkitDisplayingFullscreen)return y.webkitExitFullscreen(),y=null,void n();for(var t=globalThis.document.querySelectorAll("video"),a=0;a<t.length;a++){var l=t[a];if("function"==typeof l.webkitExitFullscreen&&!0===l.webkitDisplayingFullscreen)return l.webkitExitFullscreen(),void n()}}P()?r():n()}))}return function(){if(!M){M=!0;var n=!1;if(c.crossPlatformFramework===i.Electron)try{for(var r=require("electron").BrowserWindow,o=r.getAllWindows(),t=function(e){var n=o[e];n.on("enter-full-screen",(function(){O=n,m()})),n.on("leave-full-screen",(function(){L(),m()}))},a=0;a<o.length;a++)t(a);"function"==typeof r.on&&r.on("browser-window-created",(function(e,n){n.on("enter-full-screen",(function(){O=n,m()})),n.on("leave-full-screen",(function(){L(),m()}))}))}catch(e){}var l=["webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=["webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"];for(a=0;a<l.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(l[a],m,!1);for(a=0;a<s.length;a++)void 0!==globalThis.document&&globalThis.document.addEventListener(s[a],d,!1);if(c.os.name===e.iOS)if(W(),void 0!==globalThis.MutationObserver)new MutationObserver((function(){W()})).observe(globalThis.document.documentElement,{childList:!0,subtree:!0})}function u(e){n||(n=!0,void 0!==globalThis.document&&globalThis.document.dispatchEvent(new Event(e,{bubbles:!0,cancelable:!1})),Promise.resolve().then((function(){n=!1})))}function m(){u("fullscreenchange")}function d(){u("fullscreenerror")}}(),{installed:!1,name:"Fullscreen",module:j,Constants:{},Errors:{}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ListenerEntry } from "
|
|
1
|
+
import { ListenerEntry } from "../../../types/listener-entry";
|
|
2
2
|
export declare enum Appearances {
|
|
3
3
|
Unknown = "unknown",
|
|
4
4
|
Light = "light",
|
|
@@ -8,4 +8,4 @@ export declare const MEDIA_QUERY_LIST: MediaQueryList;
|
|
|
8
8
|
export declare const SUPPORT_PREFERS_COLOR_SCHEME: boolean;
|
|
9
9
|
export declare const CONTEXT: CanvasRenderingContext2D | null;
|
|
10
10
|
export declare const SVG_PIXEL_DATA_URL: string;
|
|
11
|
-
export declare const ENTRIES: ListenerEntry[];
|
|
11
|
+
export declare const ENTRIES: ListenerEntry<Appearances>[];
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Appearances } from "../constants";
|
|
2
|
-
export declare interface ListenerEntry {
|
|
3
|
-
fn: (appearance: Appearances) => any;
|
|
4
|
-
capture: boolean;
|
|
5
|
-
once: boolean;
|
|
6
|
-
signal?: AbortSignal;
|
|
7
|
-
}
|
|
8
2
|
export declare interface AppearanceInstance {
|
|
9
3
|
get value(): Appearances;
|
|
10
4
|
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export declare interface ListenerEntry {
|
|
2
|
-
fn: () => any;
|
|
3
|
-
capture: boolean;
|
|
4
|
-
once: boolean;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
}
|
|
7
1
|
export declare interface DimensionInstance {
|
|
2
|
+
get value(): Dimension;
|
|
3
|
+
onchange: any;
|
|
4
|
+
}
|
|
5
|
+
export declare interface Dimension {
|
|
6
|
+
outerWidth: number;
|
|
7
|
+
outerHeight: number;
|
|
8
|
+
innerWidth: number;
|
|
9
|
+
innerHeight: number;
|
|
10
|
+
scale: number;
|
|
8
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DimensionInstance } from "./
|
|
1
|
+
import { DimensionInstance } from "./dimensions";
|
|
2
2
|
import Dimension from "../cores";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./dimensions";
|
|
4
4
|
declare module 'native-fn' {
|
|
5
5
|
interface NativePlugins {
|
|
6
6
|
Dimension: DimensionInstance;
|
|
@@ -10,18 +10,8 @@ declare global {
|
|
|
10
10
|
browserLanguage?: string;
|
|
11
11
|
systemLanguage?: string;
|
|
12
12
|
userLanguage?: string;
|
|
13
|
-
connection?: NavigatorConnection;
|
|
14
|
-
mozConnection?: NavigatorConnection;
|
|
15
|
-
webkitConnection?: NavigatorConnection;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
interface NavigatorConnection {
|
|
19
|
-
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
|
|
20
|
-
type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
|
|
21
|
-
downlink?: number;
|
|
22
|
-
rtt?: number;
|
|
23
|
-
saveData?: boolean;
|
|
24
|
-
}
|
|
25
15
|
interface CordovaDevice {
|
|
26
16
|
platform: string;
|
|
27
17
|
version: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
|
|
2
|
+
export declare type VersionResolver = undefined | string | ((string: string | undefined) => string);
|
|
2
3
|
export declare interface PlatformInstance {
|
|
3
4
|
os: NameVersionPair<OS>;
|
|
4
5
|
engine: NameVersionPair<Engines>;
|
|
5
6
|
browser: NameVersionPair<Browsers>;
|
|
6
7
|
device: Devices;
|
|
7
8
|
crossPlatformFramework: CrossPlatformFramework;
|
|
8
|
-
network: Network;
|
|
9
9
|
locale: Locale;
|
|
10
|
-
dimension: Dimension;
|
|
11
10
|
renderer: string;
|
|
12
11
|
userAgent: string;
|
|
13
12
|
readyState: 'loading' | 'complete';
|
|
@@ -20,24 +19,9 @@ export declare interface NameVersionPair<T> {
|
|
|
20
19
|
name: T;
|
|
21
20
|
version: string;
|
|
22
21
|
}
|
|
23
|
-
export declare interface Network {
|
|
24
|
-
isOnline: boolean | null;
|
|
25
|
-
effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
|
|
26
|
-
type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
|
|
27
|
-
downlink: number | null;
|
|
28
|
-
rtt: number | null;
|
|
29
|
-
saveData: boolean | null;
|
|
30
|
-
}
|
|
31
|
-
export declare interface Dimension {
|
|
32
|
-
outerWidth: number;
|
|
33
|
-
outerHeight: number;
|
|
34
|
-
innerWidth: number;
|
|
35
|
-
innerHeight: number;
|
|
36
|
-
scale: number;
|
|
37
|
-
}
|
|
38
22
|
export declare interface Locale {
|
|
39
|
-
language: string;
|
|
23
|
+
language: string | null;
|
|
40
24
|
languages: string[];
|
|
41
|
-
timezone: string;
|
|
25
|
+
timezone: string | null;
|
|
42
26
|
timezoneOffset: number;
|
|
43
27
|
}
|