Files
discord-decomp/sources/modules/feedback/native/FeedbackManager.tsx
T
2026-07-27 16:20:00 +03:00

247 lines
14 KiB
TypeScript

/* Metro module 15697; source: modules/feedback/native/FeedbackManager.tsx; dependencies: [7, 6, 15, 17, 18, 4234, 1379, 4294, 4395, 9906, 4285, 15698, 1962, 5459, 4080, 3774, 15702, 15705, 15707, 15711, 2] */
function _fun120476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:6, offset: 0x0252c12f, size: 316 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const streamRTCConnectionStore = importDefault(4395) /* metro dependency 4395: StreamRTCConnectionStore */;
const env0_12 = (require(9906) /* metro dependency 9906: Constants */).FeedbackType;
let value = importDefault(15711) /* metro dependency 15711: FeedbackManager */;
value = _fun120480(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/feedback/native/FeedbackManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_120477() { // fn#120477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:211, offset: 0x0252c26b, 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_120477_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun120480(a0) { // fn#120480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:414, offset: 0x0252c2cd, size: 42 bytes, params: 2, frame: 14
const closure = FeedbackManager_120481;
env0_7(closure, a0);
return env0_3(closure);
}
function FeedbackManager_120481(a0) { // fn#120481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:426, offset: 0x0252c2f7, size: 244 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_4;
binding(this, FeedbackManager_120481);
const items = [];
arraySpread(items, value, 0, items);
value = env1_6(FeedbackManager_120481);
binding = env1_5;
if (_isNativeReflectConstruct_120477()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items);
r0 = value;
}
value = binding(this, r0);
value.actions = {VOICE_CHANNEL_SHOW_FEEDBACK: VOICE_CHANNEL_SHOW_FEEDBACK, STREAM_CLOSE: STREAM_CLOSE_120483,
EMBEDDED_ACTIVITY_CLOSE: EMBEDDED_ACTIVITY_CLOSE_120484,
IN_APP_REPORTS_SHOW_FEEDBACK: IN_APP_REPORTS_SHOW_FEEDBACK};
value.handleShowStreamFeedback = handleShowStreamFeedback;
value.handleShowActivityFeedback = handleShowActivityFeedback;
value.handleShowVoiceFeedback = function({analyticsData}) {
var binding = analyticsData;
var VOICE = FeedbackType.VOICE;
binding.possiblyShowFeedbackModal(VOICE, _fun120493);
};
value.handleInAppReportsFeedback = function({reportId, reportType}) {
var binding = reportId;
var IN_APP_REPORTS = FeedbackType.IN_APP_REPORTS;
binding.possiblyShowFeedbackModal(IN_APP_REPORTS, _fun120496);
};
return value;
}
function VOICE_CHANNEL_SHOW_FEEDBACK(a0) { // fn#120482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:696, owner: FeedbackManager_120481.VOICE_CHANNEL_SHOW_FEEDBACK, offset: 0x0252c3eb, size: 23 bytes, params: 2, frame: 11
return env0_0.handleShowVoiceFeedback(a0);
}
function FeedbackManager_120481STREAM_CLOSE(a0) { // fn#120483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:741, owner: FeedbackManager_120481.STREAM_CLOSE, offset: 0x0252c402, size: 23 bytes, params: 2, frame: 11
return env0_0.handleShowStreamFeedback(a0);
}
function FeedbackManager_120481EMBEDDED_ACTIVITY_CLOSE(a0) { // fn#120484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:798, owner: FeedbackManager_120481.EMBEDDED_ACTIVITY_CLOSE, offset: 0x0252c419, size: 23 bytes, params: 2, frame: 11
return env0_0.handleShowActivityFeedback(a0);
}
function IN_APP_REPORTS_SHOW_FEEDBACK(a0) { // fn#120485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:862, owner: FeedbackManager_120481.IN_APP_REPORTS_SHOW_FEEDBACK, offset: 0x0252c430, size: 23 bytes, params: 2, frame: 11
return env0_0.handleInAppReportsFeedback(a0);
}
function handleShowStreamFeedback(a0) { // fn#120486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:925, owner: FeedbackManager_120481.handleShowStreamFeedback, offset: 0x0252c447, size: 67 bytes, params: 2, frame: 13
var environment;
var value;
var streamKey;
var possiblyShowFeedbackModal;
if (a0.canShowFeedback) {
streamKey = a0.streamKey;
possiblyShowFeedbackModal = streamKey.possiblyShowFeedbackModal;
value = environment.__proto__.__proto__;
Reflect.apply(possiblyShowFeedbackModal, streamKey, [FeedbackType.STREAM, _fun120487]);
}
}
function handleShowActivityFeedback({applicationId, location, showFeedback}) { // fn#120489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1466, owner: FeedbackManager_120481.handleShowActivityFeedback, offset: 0x0252c601, size: 155 bytes, params: 2, frame: 17
var binding;
const env0_0 = applicationId;
const application = ApplicationStore.getApplication(applicationId);
const env0_3 = ChannelStore.getChannel((require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(location));
if (application != null && showFeedback) {
binding = env0_0;
binding.possiblyShowFeedbackModal(FeedbackType.ACTIVITY, _fun120490);
}
}
function handleShowVoiceFeedback({analyticsData}) { // fn#120492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1977, owner: FeedbackManager_120481.handleShowVoiceFeedback, offset: 0x0252c78e, size: 58 bytes, params: 2, frame: 13
const binding = analyticsData;
const possiblyShowFeedbackModal = binding.possiblyShowFeedbackModal;
const VOICE = FeedbackType.VOICE;
Reflect.apply(possiblyShowFeedbackModal, binding, [VOICE, _fun120493]);
}
function handleInAppReportsFeedback({reportId, reportType}) { // fn#120495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:2213, owner: FeedbackManager_120481.handleInAppReportsFeedback, offset: 0x0252c873, size: 68 bytes, params: 2, frame: 13
const binding = reportId;
const possiblyShowFeedbackModal = binding.possiblyShowFeedbackModal;
const IN_APP_REPORTS = FeedbackType.IN_APP_REPORTS;
Reflect.apply(possiblyShowFeedbackModal, binding, [IN_APP_REPORTS, _fun120496]);
}
function _fun120487() { // fn#120487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1002, offset: 0x0252c48a, size: 277 bytes, params: 1, frame: 17
var environment;
var r4;
var object2;
var getMediaSessionId;
let value = environment.__proto__.__proto__.__proto__;
const moduleValue = require(dependencyMap[10]);
const channel = ChannelStore.getChannel(moduleValue.decodeStreamKey(streamKey).channelId);
if (channel == null) {
r4 = StreamRTCConnectionStore.getVideoStats(streamKey) ?? ({});
object2 = {};
getMediaSessionId = StreamRTCConnectionStore.getMediaSessionId;
streamKeyBinding = streamKey;
object2.media_session_id = Reflect.apply(getMediaSessionId, StreamRTCConnectionStore, [streamKeyBinding]);
object2.rtc_connection_id = StreamRTCConnectionStore.getRtcConnectionId(streamKeyBinding);
object2.stream_region = StreamRTCConnectionStore.getRegion(streamKeyBinding);
object2.max_viewers = StreamRTCConnectionStore.getMaxViewers(streamKeyBinding);
copyDataProperties(object2, r4, StreamRTCConnectionStore);
value = require(dependencyMap[12]);
var env0_2 = value(dependencyMap[11], dependencyMap.paths);
value = require(dependencyMap[13]);
value.runAfterInteractions(_fun120488);
} else if (!channel.isGuildStageVoice()) {
r4 = StreamRTCConnectionStore.getVideoStats(streamKey) ?? ({});
object2 = {};
getMediaSessionId = StreamRTCConnectionStore.getMediaSessionId;
streamKeyBinding = streamKey;
object2.media_session_id = Reflect.apply(getMediaSessionId, StreamRTCConnectionStore, [streamKeyBinding]);
object2.rtc_connection_id = StreamRTCConnectionStore.getRtcConnectionId(streamKeyBinding);
object2.stream_region = StreamRTCConnectionStore.getRegion(streamKeyBinding);
object2.max_viewers = StreamRTCConnectionStore.getMaxViewers(streamKeyBinding);
copyDataProperties(object2, r4, StreamRTCConnectionStore);
value = require(dependencyMap[12]);
var env0_2 = value(dependencyMap[11], dependencyMap.paths);
value = require(dependencyMap[13]);
value.runAfterInteractions(_fun120488);
}
}
function _fun120490() { // fn#120490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1661, offset: 0x0252c69c, size: 121 bytes, params: 1, frame: 17
var environment;
const value = environment.__proto__.__proto__.__proto__;
const env0_0 = require(dependencyMap[12])(dependencyMap[16], dependencyMap.paths);
const object2 = {};
object2.media_session_id = RTCConnectionStore.getMediaSessionId();
object2.rtc_connection_id = RTCConnectionStore.getRTCConnectionId();
require(dependencyMap[13]).runAfterInteractions(_fun120491);
}
function _fun120493() { // fn#120493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:2036, offset: 0x0252c7c8, size: 81 bytes, params: 1, frame: 16
var environment;
const value = environment.__proto__.__proto__.__proto__;
const env0_0 = require(dependencyMap[12])(dependencyMap[17], dependencyMap.paths);
require(dependencyMap[13]).runAfterInteractions(_fun120494);
}
function _fun120496() { // fn#120496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:2289, offset: 0x0252c8b7, size: 81 bytes, params: 1, frame: 16
var environment;
const value = environment.__proto__.__proto__.__proto__;
const env0_0 = require(dependencyMap[12])(dependencyMap[18], dependencyMap.paths);
require(dependencyMap[13]).runAfterInteractions(_fun120497);
}
function _fun120488() { // fn#120488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1355, offset: 0x0252c59f, size: 98 bytes, params: 1, frame: 18
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.openLazy(env0_2, 'StreamFeedback' + streamKey, {stream: env0_0, analyticsData: env0_1});
}
function _fun120491() { // fn#120491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:1811, offset: 0x0252c715, size: 121 bytes, params: 1, frame: 21
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
const openLazy = value.openLazy;
const binding = env0_0;
const locationBinding = location;
Reflect.apply(openLazy, value, [binding, 'ActivityFeedback' + locationBinding.id + applicationId,
{analyticsData: env0_1, activityApplication: env1_2, channel: env1_3,
embeddedActivityLocation: locationBinding}]);
}
function _fun120494() { // fn#120494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:2102, offset: 0x0252c819, size: 90 bytes, params: 1, frame: 18
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
const openLazy = value.openLazy;
const binding = env0_0;
const analyticsDataBinding = analyticsData;
Reflect.apply(openLazy, value, [binding, 'VoiceFeedback' + analyticsDataBinding.channel_id,
{analyticsData: analyticsDataBinding}]);
}
function _fun120497() { // fn#120497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15905:2355, offset: 0x0252c908, size: 120 bytes, params: 1, frame: 19
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.openLazy(env0_0, 'ReportingFeedback' + reportType + (reportId ?? ''), {reportId: reportId,
reportType: reportType});
}