Files
discord-decomp/sources/modules/video_backgrounds/VideoBackgroundStore.tsx
T
2026-07-27 16:20:00 +03:00

153 lines
7.7 KiB
TypeScript

/* Metro module 8905; source: modules/video_backgrounds/VideoBackgroundStore.tsx; dependencies: [6, 7, 15, 17, 18, 1348, 4259, 1934, 1878, 8906, 4406, 566, 694, 2] */
function _fun69452(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:6, offset: 0x01c7415a, size: 469 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let env0_14 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun69458(Store);
value.displayName = 'VideoBackgroundStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{VIDEO_FILTER_ASSETS_FETCH_SUCCESS: function({assets}) {
assets.forEach(_fun69467);
env0_14 = {};
}, VIDEO_FILTER_ASSET_UPLOAD_SUCCESS: VIDEO_FILTER_ASSET_UPLOAD_SUCCESS,
VIDEO_FILTER_ASSET_DELETE_SUCCESS: VIDEO_FILTER_ASSET_DELETE_SUCCESS,
VIDEO_SAVE_LAST_USED_BACKGROUND_OPTION: function({backgroundOption}) {
if (hasVideoBackgroundLive(backgroundOption)) {
env0_13 = true;
}
}, MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS: function({settings}) {
if (require(dependencyMap[10]).FilterSettingsKey.CAMERA_BACKGROUND_LIVE in settings) {
env0_11 = true;
env0_15 = false;
}
if (require(dependencyMap[10]).FilterSettingsKey.CAMERA_BACKGROUND_PREVIEW in settings) {
env0_16 = false;
}
}, MEDIA_ENGINE_VIDEO_FILTER_ERROR: MEDIA_ENGINE_VIDEO_FILTER_ERROR, LOGOUT: function() {
env0_11 = false;
env0_13 = false;
env0_12 = null;
env0_14 = {};
env0_15 = false;
env0_16 = false;
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/video_backgrounds/VideoBackgroundStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_69453() { // fn#69453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:188, offset: 0x01c7432f, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_69453_isNativeReflectConstruct = function() {
return !!result;
})();
}
function hasVideoBackgroundLive(a0) { // fn#69456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:417, offset: 0x01c74391, size: 145 bytes, params: 2, frame: 18
var r2;
var moduleValue;
var getVideoBackgroundOptionFromProto;
var voiceAndVideo;
let value = a0;
const currentUser = UserStore.getCurrentUser();
if (currentUser == null) {
return false;
}
if (value != null) {
r2 = value;
} else {
value = undefined;
moduleValue = require(8906) /* metro dependency 8906: VideoBackgroundUtils */;
getVideoBackgroundOptionFromProto = moduleValue.getVideoBackgroundOptionFromProto;
voiceAndVideo = UserSettingsProtoStore.settings.voiceAndVideo;
value = Reflect.apply(getVideoBackgroundOptionFromProto, moduleValue,
[voiceAndVideo == null ? value : voiceAndVideo.videoBackgroundFilterDesktop, currentUser.id]);
r2 = value;
}
const getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
return Reflect.apply(getVoiceChannelId, SelectedChannelStore,
[]) != null && MediaEngineStore.isVideoEnabled() && r2 != null;
}
function handleSyncedStoresUpdate() { // fn#69457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:700, offset: 0x01c74422, size: 78 bytes, params: 1, frame: 11
const binding = env0_12;
const getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
if (binding === Reflect.apply(getVoiceChannelId, SelectedChannelStore, [])) {
}
if (hasVideoBackgroundLive()) {
}
env0_12 = SelectedChannelStore.getVoiceChannelId();
}
function _fun69458(a0) { // fn#69458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:843, offset: 0x01c74470, size: 207 bytes, params: 2, frame: 16
const closure = VideoBackgroundStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(MediaEngineStore, SelectedChannelStore, UserSettingsProtoStore, UserStore);
this.syncWith([SelectedChannelStore, MediaEngineStore], handleSyncedStoresUpdate);
}}, {key: 'videoFilterAssets', get: get_69461}, {key: 'hasBeenApplied', get: get_69462},
{key: 'hasUsedBackgroundInCall', get: get_69463}, {key: 'videoBackgroundUnavailable', get: get_69464},
{key: 'videoBackgroundPreviewUnavailable', get: get_69465}]);
}
function VIDEO_FILTER_ASSETS_FETCH_SUCCESS({assets}) { // fn#69466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:1649, offset: 0x01c7458a, size: 45 bytes, params: 2, frame: 12
const object = {};
assets.forEach(_fun69467);
}
function VIDEO_FILTER_ASSET_UPLOAD_SUCCESS({videoFilterAsset}) { // fn#69468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:1779, offset: 0x01c745cc, size: 43 bytes, params: 2, frame: 13
const object2 = {};
copyDataProperties(object2, env0_14, videoFilterAsset);
object2[videoFilterAsset.id] = videoFilterAsset;
}
function VIDEO_FILTER_ASSET_DELETE_SUCCESS({videoFilterAsset}) { // fn#69469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:1883, offset: 0x01c745f7, size: 42 bytes, params: 2, frame: 13
const object2 = {};
copyDataProperties(object2, env0_14, undefined);
delete object2[videoFilterAsset.id];
}
function MEDIA_ENGINE_VIDEO_FILTER_ERROR({target}) { // fn#69472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:2363, offset: 0x01c746b0, size: 41 bytes, params: 2, frame: 2
if (target === 'live') {
}
}
function _fun69467(a0) { // fn#69467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9090:1725, offset: 0x01c745b7, size: 21 bytes, params: 2, frame: 3
env0_0[a0.id] = a0;
return a0;
}