videomail-client 15.1.0 → 15.2.0

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.
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ exports.ids = [
3
+ 236
4
+ ];
5
+ exports.modules = {
6
+ 5303 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
7
+ var _capacitor_core__rspack_import_0 = __webpack_require__(6546);
8
+ class DeviceWeb extends _capacitor_core__rspack_import_0.E_ {
9
+ async getId() {
10
+ return {
11
+ identifier: this.getUid()
12
+ };
13
+ }
14
+ async getInfo() {
15
+ if ("u" < typeof navigator || !navigator.userAgent) throw this.unavailable('Device API not available in this browser');
16
+ const ua = navigator.userAgent;
17
+ const uaFields = this.parseUa(ua);
18
+ return {
19
+ model: uaFields.model,
20
+ platform: 'web',
21
+ operatingSystem: uaFields.operatingSystem,
22
+ osVersion: uaFields.osVersion,
23
+ manufacturer: navigator.vendor,
24
+ isVirtual: false,
25
+ webViewVersion: uaFields.browserVersion
26
+ };
27
+ }
28
+ async getBatteryInfo() {
29
+ if ("u" < typeof navigator || !navigator.getBattery) throw this.unavailable('Device API not available in this browser');
30
+ let battery = {};
31
+ try {
32
+ battery = await navigator.getBattery();
33
+ } catch (e) {}
34
+ return {
35
+ batteryLevel: battery.level,
36
+ isCharging: battery.charging
37
+ };
38
+ }
39
+ async getLanguageCode() {
40
+ return {
41
+ value: navigator.language.split('-')[0].toLowerCase()
42
+ };
43
+ }
44
+ async getLanguageTag() {
45
+ return {
46
+ value: navigator.language
47
+ };
48
+ }
49
+ parseUa(ua) {
50
+ const uaFields = {};
51
+ const start = ua.indexOf('(') + 1;
52
+ let end = ua.indexOf(') AppleWebKit');
53
+ if (-1 !== ua.indexOf(') Gecko')) end = ua.indexOf(') Gecko');
54
+ const fields = ua.substring(start, end);
55
+ if (-1 !== ua.indexOf('Android')) {
56
+ const tmpFields = fields.replace('; wv', '').split('; ').pop();
57
+ if (tmpFields) uaFields.model = tmpFields.split(' Build')[0];
58
+ uaFields.osVersion = fields.split('; ')[1];
59
+ } else {
60
+ uaFields.model = fields.split('; ')[0];
61
+ if ("u" > typeof navigator && navigator.oscpu) uaFields.osVersion = navigator.oscpu;
62
+ else if (-1 !== ua.indexOf('Windows')) uaFields.osVersion = fields;
63
+ else {
64
+ const tmpFields = fields.split('; ').pop();
65
+ if (tmpFields) {
66
+ const lastParts = tmpFields.replace(' like Mac OS X', '').split(' ');
67
+ uaFields.osVersion = lastParts[lastParts.length - 1].replace(/_/g, '.');
68
+ }
69
+ }
70
+ }
71
+ if (/android/i.test(ua)) uaFields.operatingSystem = 'android';
72
+ else if (/iPad|iPhone|iPod/.test(ua) && !window.MSStream) uaFields.operatingSystem = 'ios';
73
+ else if (/Win/.test(ua)) uaFields.operatingSystem = 'windows';
74
+ else if (/Mac/i.test(ua)) uaFields.operatingSystem = 'mac';
75
+ else uaFields.operatingSystem = 'unknown';
76
+ const isSafari = !!window.ApplePaySession;
77
+ const isChrome = !!window.chrome;
78
+ const isFirefox = /Firefox/.test(ua);
79
+ const isEdge = /Edg/.test(ua);
80
+ const isFirefoxIOS = /FxiOS/.test(ua);
81
+ const isChromeIOS = /CriOS/.test(ua);
82
+ const isEdgeIOS = /EdgiOS/.test(ua);
83
+ if (isSafari || isChrome && !isEdge || isFirefoxIOS || isChromeIOS || isEdgeIOS) {
84
+ let searchWord;
85
+ searchWord = isFirefoxIOS ? 'FxiOS' : isChromeIOS ? 'CriOS' : isEdgeIOS ? 'EdgiOS' : isSafari ? 'Version' : 'Chrome';
86
+ const words = ua.split(' ');
87
+ for (const word of words)if (word.includes(searchWord)) {
88
+ const version = word.split('/')[1];
89
+ uaFields.browserVersion = version;
90
+ }
91
+ } else if (isFirefox || isEdge) {
92
+ const reverseUA = ua.split('').reverse().join('');
93
+ const reverseVersion = reverseUA.split('/')[0];
94
+ const version = reverseVersion.split('').reverse().join('');
95
+ uaFields.browserVersion = version;
96
+ }
97
+ return uaFields;
98
+ }
99
+ getUid() {
100
+ if ("u" > typeof window && window.localStorage) {
101
+ let uid = window.localStorage.getItem('_capuid');
102
+ if (uid) return uid;
103
+ uid = this.uuid4();
104
+ window.localStorage.setItem('_capuid', uid);
105
+ return uid;
106
+ }
107
+ return this.uuid4();
108
+ }
109
+ uuid4() {
110
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
111
+ const r = 16 * Math.random() | 0, v = 'x' === c ? r : 0x3 & r | 0x8;
112
+ return v.toString(16);
113
+ });
114
+ }
115
+ }
116
+ __webpack_require__.d(__webpack_exports__, {
117
+ DeviceWeb: ()=>DeviceWeb
118
+ });
119
+ }
120
+ };