377 lines
17 KiB
TypeScript
377 lines
17 KiB
TypeScript
/* Metro module 7129; source: modules/clips/ClipAnalyticsUtils.tsx; dependencies: [4399, 4492, 4395, 4265, 4284, 4654, 4285, 7130, 2] */
|
|
import ClipsStore from './ClipsStore.tsx'; /* Metro dependency 4265 */
|
|
import StreamRTCConnectionStore from '../../stores/StreamRTCConnectionStore.tsx'; /* Metro dependency 4395 */
|
|
import ApplicationStreamingSettingsStore from '../../stores/ApplicationStreamingSettingsStore.tsx'; /* Metro dependency 4399 */
|
|
import ApplicationStreamingStore from '../../stores/ApplicationStreamingStore.tsx'; /* Metro dependency 4492 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ClipsTypesModule from './ClipsTypes.tsx'; /* Metro dependency 4284 */
|
|
|
|
function _fun56991(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:6, offset: 0x013d7e5e, size: 253 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_56994 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const getClipType2 = getClipType;
|
|
const closure2 = function(a0) {
|
|
var object = {};
|
|
object.clip_type = getClipType(a0);
|
|
object.num_clip_participants = a0.users.length;
|
|
object.clip_session_id = a0.gameSessionId;
|
|
object.is_candidate = a0.isCandidate;
|
|
return object;
|
|
};
|
|
const getClipContextProperties2 = getClipContextProperties;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/clips/ClipAnalyticsUtils.tsx');
|
|
exports.getClipType = getClipType2;
|
|
exports.getClipBaseProperties = closure2;
|
|
exports.getClipContextProperties = getClipContextProperties2;
|
|
exports.getClipSignalTypes = getClipSignalTypes;
|
|
exports.getPreSaveClipAnalytics = getPreSaveClipAnalytics;
|
|
exports.getPostSaveClipAnalytics = getPostSaveClipAnalytics;
|
|
function _createForOfIteratorHelperLoose_56992(a0, a1) { // fn#56992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:140, offset: 0x013d7f5b, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun56993;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_56994(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_56994(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_56994(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun56993;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun56993() { // fn#56993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:711, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function getClipType({decision}) { // fn#56995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:1050, offset: 0x013d80cd, size: 211 bytes, params: 2, frame: 14
|
|
const type = decision == null || decision.signal == null ? undefined : decision.signal.type;
|
|
const ClipSignalTypes = (ClipsTypesModule).ClipSignalTypes;
|
|
const MANUAL = ClipSignalTypes.MANUAL;
|
|
if (MANUAL === type) {
|
|
return 'manual';
|
|
}
|
|
const DISTRIBUTED = ClipSignalTypes.DISTRIBUTED;
|
|
if (DISTRIBUTED === type) {
|
|
return 'distributed';
|
|
}
|
|
const LAUGHTER = ClipSignalTypes.LAUGHTER;
|
|
if (LAUGHTER === type) {
|
|
return 'auto_ml';
|
|
}
|
|
const GAME_EVENT = ClipSignalTypes.GAME_EVENT;
|
|
if (GAME_EVENT === type) {
|
|
return 'auto_ml';
|
|
}
|
|
return 'unknown';
|
|
}
|
|
|
|
function getClipContextProperties(a0) { // fn#56997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:1541, offset: 0x013d81e8, size: 85 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
const value2 = undefined;
|
|
object.clip_runtime = (require(4654) /* metro dependency 4654: ClipsV3RuntimeExperiment */).getClipsRuntime(a0);
|
|
const currentClipsSession = ClipsStore.getCurrentClipsSession();
|
|
object.current_clip_session_id = currentClipsSession == null ? value2 : currentClipsSession.id;
|
|
return object;
|
|
}
|
|
|
|
function getClipSignalTypes({timeline}) { // fn#56998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:1926, offset: 0x013d823d, size: 314 bytes, params: 2, frame: 23
|
|
var r2;
|
|
var value4;
|
|
var signal;
|
|
var type;
|
|
const ClipSignalTypes = (ClipsTypesModule).ClipSignalTypes;
|
|
var MANUAL;
|
|
var DISTRIBUTED;
|
|
var LAUGHTER;
|
|
var GAME_EVENT;
|
|
var push;
|
|
var eventType;
|
|
var value5;
|
|
const items2 = [];
|
|
const value2 = _createForOfIteratorHelperLoose_56992(timeline);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r2 = value3;
|
|
while (true) {
|
|
value4 = r2.value;
|
|
signal = value4.signal;
|
|
type = signal.type;
|
|
MANUAL = ClipSignalTypes.MANUAL;
|
|
if (MANUAL !== type) {
|
|
DISTRIBUTED = ClipSignalTypes.DISTRIBUTED;
|
|
if (DISTRIBUTED === type) {
|
|
items2.push('distributed');
|
|
break;
|
|
}
|
|
LAUGHTER = ClipSignalTypes.LAUGHTER;
|
|
if (LAUGHTER === type) {
|
|
items2.push('laughter');
|
|
break;
|
|
}
|
|
GAME_EVENT = ClipSignalTypes.GAME_EVENT;
|
|
if (GAME_EVENT !== type) {
|
|
break;
|
|
}
|
|
push = items2.push;
|
|
signal = value4.signal;
|
|
eventType = signal.eventType;
|
|
Reflect.apply(push, items2, ['game_event:' + eventType]);
|
|
break;
|
|
}
|
|
items2.push('manual');
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value5;
|
|
continue;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function getPreSaveClipAnalytics(a0) { // fn#56999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:2386, offset: 0x013d8377, size: 298 bytes, params: 2, frame: 19
|
|
var r9;
|
|
var r2;
|
|
var streamRTCConnectionStoreBinding;
|
|
var getRTCConnection;
|
|
var moduleValue;
|
|
const currentUserActiveStream = ApplicationStreamingStore.getCurrentUserActiveStream();
|
|
const value3 = null;
|
|
if (value3 != currentUserActiveStream) {
|
|
streamRTCConnectionStoreBinding = StreamRTCConnectionStore;
|
|
getRTCConnection = streamRTCConnectionStoreBinding.getRTCConnection;
|
|
moduleValue = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
r2 = Reflect.apply(getRTCConnection, streamRTCConnectionStoreBinding,
|
|
[moduleValue.encodeStreamKey(currentUserActiveStream)]);
|
|
r9 = require;
|
|
} else {
|
|
r2 = value3;
|
|
}
|
|
const object = {};
|
|
const getClipBasePropertiesBinding = getClipBaseProperties;
|
|
const value5 = undefined;
|
|
copyDataProperties(object, getClipBasePropertiesBinding(a0), r9);
|
|
copyDataProperties(object, getClipContextProperties('getPreSaveClipAnalytics'), r9);
|
|
object['rtc_connection_id'] = value3 == r2 ? value5 : r2.getRTCConnectionId();
|
|
object['media_session_id'] = value3 == r2 ? value5 : r2.getMediaSessionId();
|
|
object['parent_media_session_id'] = value3 == r2 ? value5 : r2.parentMediaSessionId;
|
|
object['guild_id'] = a0.guildId;
|
|
object['channel_id'] = a0.channelId;
|
|
object['application_id'] = a0.applicationId;
|
|
object['application_name'] = a0.applicationName;
|
|
object['clip_uuid'] = a0.id;
|
|
object['clip_event_timeline_size'] = a0.timeline.length;
|
|
return object;
|
|
}
|
|
|
|
function getPostSaveClipAnalytics(a0, a1) { // fn#57000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7307:2980, offset: 0x013d84a1, size: 1513 bytes, params: 3, frame: 26
|
|
var r16;
|
|
var r12;
|
|
var propertyName;
|
|
var framesEncodedByEncoder2;
|
|
var property;
|
|
var moduleValue;
|
|
var encoder;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
for (propertyName in a1.framesEncodedByEncoder) {
|
|
framesEncodedByEncoder2 = a1.framesEncodedByEncoder;
|
|
property = framesEncodedByEncoder2[propertyName];
|
|
moduleValue = require(7130) /* metro dependency 7130: VideoQualityStats */;
|
|
encoder = moduleValue.parseEncoder(propertyName);
|
|
value3 = map.get(encoder);
|
|
value4 = value3 != null;
|
|
value5 = 0;
|
|
if (value4) {
|
|
r12 = value3;
|
|
continue;
|
|
}
|
|
r12 = value5;
|
|
continue;
|
|
map.set(encoder, r12 + property);
|
|
r16 = value4;
|
|
}
|
|
const object = {};
|
|
copyDataProperties(object, a0, r16);
|
|
let get = map.get;
|
|
const Encoders = (require(7130) /* metro dependency 7130: VideoQualityStats */).Encoders;
|
|
const NVIDIA_CUDA = Encoders.NVIDIA_CUDA;
|
|
const value6 = Reflect.apply(get, map, [NVIDIA_CUDA]);
|
|
const value7 = 0;
|
|
let r6 = value6 ?? value7;
|
|
object['frames_encoded_nvidia_cuda'] = r6;
|
|
get = map.get;
|
|
const NVIDIA_DIRECT_3D = Encoders.NVIDIA_DIRECT_3D;
|
|
object['frames_encoded_nvidia_direct3d'] = Reflect.apply(get, map, [NVIDIA_DIRECT_3D]) ?? value7;
|
|
get = map.get;
|
|
const OPENH264 = Encoders.OPENH264;
|
|
object['frames_encoded_openh264'] = Reflect.apply(get, map, [OPENH264]) ?? value7;
|
|
get = map.get;
|
|
const VIDEOTOOLBOX = Encoders.VIDEOTOOLBOX;
|
|
object['frames_encoded_videotoolbox'] = Reflect.apply(get, map, [VIDEOTOOLBOX]) ?? value7;
|
|
get = map.get;
|
|
const AMD_DIRECT_3D = Encoders.AMD_DIRECT_3D;
|
|
object['frames_encoded_amd_direct3d'] = Reflect.apply(get, map, [AMD_DIRECT_3D]) ?? value7;
|
|
get = map.get;
|
|
const AMD_VAAPI = Encoders.AMD_VAAPI;
|
|
object['frames_encoded_amd_vaapi'] = Reflect.apply(get, map, [AMD_VAAPI]) ?? value7;
|
|
get = map.get;
|
|
const INTEL = Encoders.INTEL;
|
|
object['frames_encoded_intel'] = Reflect.apply(get, map, [INTEL]) ?? value7;
|
|
get = map.get;
|
|
const INTEL_DIRECT_3D = Encoders.INTEL_DIRECT_3D;
|
|
object['frames_encoded_intel_direct3d'] = Reflect.apply(get, map, [INTEL_DIRECT_3D]) ?? value7;
|
|
get = map.get;
|
|
let WMF_DIRECT_3D_INTEL = Encoders.WMF_DIRECT_3D_INTEL;
|
|
object['frames_encoded_wmf_direct3d_intel'] = Reflect.apply(get, map, [WMF_DIRECT_3D_INTEL]) ?? value7;
|
|
get = map.get;
|
|
let WMF_DIRECT_3D_NVIDIA = Encoders.WMF_DIRECT_3D_NVIDIA;
|
|
object['frames_encoded_wmf_direct3d_nvidia'] = Reflect.apply(get, map, [WMF_DIRECT_3D_NVIDIA]) ?? value7;
|
|
get = map.get;
|
|
let WMF_DIRECT_3D_AMD = Encoders.WMF_DIRECT_3D_AMD;
|
|
object['frames_encoded_wmf_direct3d_amd'] = Reflect.apply(get, map, [WMF_DIRECT_3D_AMD]) ?? value7;
|
|
get = map.get;
|
|
const WMF_DIRECT_3D = Encoders.WMF_DIRECT_3D;
|
|
r6 = Reflect.apply(get, map, [WMF_DIRECT_3D]) ?? value7;
|
|
get = map.get;
|
|
WMF_DIRECT_3D_INTEL = Encoders.WMF_DIRECT_3D_INTEL;
|
|
const value20 = r6 + (Reflect.apply(get, map, [WMF_DIRECT_3D_INTEL]) ?? value7);
|
|
get = map.get;
|
|
WMF_DIRECT_3D_NVIDIA = Encoders.WMF_DIRECT_3D_NVIDIA;
|
|
const value22 = value20 + (Reflect.apply(get, map, [WMF_DIRECT_3D_NVIDIA]) ?? value7);
|
|
get = map.get;
|
|
WMF_DIRECT_3D_AMD = Encoders.WMF_DIRECT_3D_AMD;
|
|
object['frames_encoded_wmf_direct3d'] = value22 + (Reflect.apply(get, map, [WMF_DIRECT_3D_AMD]) ?? value7);
|
|
get = map.get;
|
|
const UNCATEGORIZED = Encoders.UNCATEGORIZED;
|
|
object['frames_encoded_uncategorized'] = Reflect.apply(get, map, [UNCATEGORIZED]) ?? value7;
|
|
get = map.get;
|
|
const UNKNOWN = Encoders.UNKNOWN;
|
|
map = Reflect.apply(get, map, [UNKNOWN]);
|
|
object['frames_encoded_unknown'] = map ?? value7;
|
|
object['frames_submitted'] = a1.framesSubmitted;
|
|
object['frames_submitted_during_clip'] = a1.framesSubmittedDuringClip;
|
|
object['frames_encoded'] = a1.framesEncoded;
|
|
object['frames_encoded_during_clip'] = a1.framesEncodedDuringClip;
|
|
object['frames_dropped'] = a1.framesDropped;
|
|
object['frames_dropped_during_clip'] = a1.framesDroppedDuringClip;
|
|
const clipsStoreBinding = ClipsStore;
|
|
const getSettings = clipsStoreBinding.getSettings;
|
|
object['clip_duration_setting'] = Reflect.apply(getSettings, clipsStoreBinding, []).clipsLength;
|
|
object['clip_duration'] = a1.clipDuration;
|
|
object['clip_resolution_width'] = a1.clipResolutionWidth;
|
|
object['clip_resolution_height'] = a1.clipResolutionHeight;
|
|
object['min_fps'] = a1.minFps;
|
|
object['max_fps'] = a1.maxFps;
|
|
object['submitted_fps'] = a1.submittedFps;
|
|
const applicationStreamingSettingsStoreBinding = ApplicationStreamingSettingsStore;
|
|
const getState = applicationStreamingSettingsStoreBinding.getState;
|
|
object['target_fps'] = Reflect.apply(getState, applicationStreamingSettingsStoreBinding, []).fps;
|
|
object['audio_track_count'] = a1.audioTrackCount;
|
|
object['saved_at'] = a1.savedAt;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun56991, 7129, [4399, 4492, 4395, 4265, 4284, 4654, 4285, 7130,
|
|
2]) /* metro module 7129, dependencies: [4399, 4492, 4395, 4265, 4284, 4654, 4285, 7130, 2] */;
|