Files
discord-decomp/sources/utils/AnalyticsUtils.tsx
T
2026-07-28 01:06:53 +03:00

508 lines
26 KiB
TypeScript

/* Metro module 683; source: utils/AnalyticsUtils.tsx; dependencies: [29, 31, 684, 691, 661, 12845, 4238, 1873, 682, 480, 12843, 1216, 694, 5256, 1244, 12, 491, 2, 12846] */
import ObjectWithoutProperties from '../by-id/module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
import DeveloperOptionsStore from '../stores/DeveloperOptionsStore.tsx'; /* Metro dependency 691 */
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as AnalyticsUtilsModule from '../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as Module00491Module from '../by-id/module-00491.js'; /* Metro dependency 491 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as ImpressionStoreModule from '../modules/app_analytics/ImpressionStore.tsx'; /* Metro dependency 684 */
import * as ApplicationConstantsModule from '../modules/applications/ApplicationConstants.tsx'; /* Metro dependency 4238 */
import * as CommonSentryInitUtilsModule from '../modules/errors/CommonSentryInitUtils.tsx'; /* Metro dependency 12843 */
import * as AccessibilityConstantsModule from '../modules/a11y/AccessibilityConstants.tsx'; /* Metro dependency 12845 */
function _fun8281(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#8281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6, offset: 0x00d3dfba, size: 2592 bytes, params: 8, frame: 36
var r9;
var value6;
var generateLaunchSignature;
var value7;
const env0_0 = require;
const closure = function(a0) {
return typeof a0 === 'string' ? {location: a0} : {location: a0.page, location_page: a0.page,
location_section: a0.section, location_object: a0.object, location_object_type: a0.objectType};
};
const expandSource = function(a0) {
return typeof a0 === 'string' ? {source: a0} : {source_page: a0.page, source_section: a0.section,
source_object: a0.object, source_object_type: a0.objectType, source_promotion_id: a0.promotionId};
};
const addBreadcrumb2 = addBreadcrumb;
const expandEventProperties2 = expandEventProperties;
const debugLogEvent2 = debugLogEvent;
const env0_4 = ['location'];
const env0_5 = ['source'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const AnalyticEvents = ConstantsModule.AnalyticEvents;
value = value.createContext({location: {}});
let env0_14 = {};
const env0_16 = global.performance.now();
if ((require(1873) /* metro dependency 1873: shimNative */).isLibdiscoreInitialized()) {
value6 = require(1873) /* metro dependency 1873: shimNative */;
generateLaunchSignature = value6.generateLaunchSignature;
value7 = require(682) /* metro dependency 682: GlobalUtils */;
r9 = Reflect.apply(generateLaunchSignature, value6, [value7.getGlobalObject()]);
} else {
r9 = null;
}
AnalyticsUtilsModule.extendSuperProperties({launch_signature: r9});
const env0_18 = [];
object = {};
const APP_OPENED = AnalyticEvents.APP_OPENED;
object[APP_OPENED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const APP_BACKGROUND = AnalyticEvents.APP_BACKGROUND;
object[APP_BACKGROUND] = {throttlePeriod: 120000, throttleKeys: function() {
return [];
}};
const ACK_MESSAGES = AnalyticEvents.ACK_MESSAGES;
object[ACK_MESSAGES] = _fun8290;
const GUILD_VIEWED = AnalyticEvents.GUILD_VIEWED;
object[GUILD_VIEWED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.is_pending];
}};
const FRIENDS_LIST_VIEWED = AnalyticEvents.FRIENDS_LIST_VIEWED;
object[FRIENDS_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({tab_opened}) {
return [tab_opened];
}};
const NOW_PLAYING_CARD_HOVERED = AnalyticEvents.NOW_PLAYING_CARD_HOVERED;
object[NOW_PLAYING_CARD_HOVERED] = {throttlePeriod: 900000, throttleKeys: function({tab_opened}) {
return [tab_opened];
}};
const START_SPEAKING = AnalyticEvents.START_SPEAKING;
object[START_SPEAKING] = {throttlePeriod: 900000, throttleKeys: function({server}) {
return [server];
}};
const START_LISTENING = AnalyticEvents.START_LISTENING;
object[START_LISTENING] = {throttlePeriod: 900000, throttleKeys: function({server}) {
return [server];
}};
const ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
object[ACTIVITY_UPDATED] = {'throttlePeriod': 60000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function({application_id}) {
return [application_id];
}};
const CHANNEL_OPENED = AnalyticEvents.CHANNEL_OPENED;
object[CHANNEL_OPENED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return a0.channel_static_route != null ? [a0.guild_id, a0.channel_static_route,
a0.channel_view] : [a0.channel_id,
a0.channel_view];
}};
const TEXT_IN_VOICE_OPENED = AnalyticEvents.TEXT_IN_VOICE_OPENED;
object[TEXT_IN_VOICE_OPENED] = {throttlePeriod: 86400000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const NOTIFICATION_VIEWED = AnalyticEvents.NOTIFICATION_VIEWED;
object[NOTIFICATION_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({notif_type}) {
return [notif_type];
}};
const MEMBER_LIST_VIEWED = AnalyticEvents.MEMBER_LIST_VIEWED;
object[MEMBER_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const DM_LIST_VIEWED = AnalyticEvents.DM_LIST_VIEWED;
object[DM_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const NAV_DRAWER_OPENED = AnalyticEvents.NAV_DRAWER_OPENED;
object[NAV_DRAWER_OPENED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const KEYBOARD_SHORTCUT_USED = AnalyticEvents.KEYBOARD_SHORTCUT_USED;
object[KEYBOARD_SHORTCUT_USED] = {throttlePeriod: 120000, throttleKeys: function(a0) {
var r2;
var items = [a0.shortcut_name, a0.location_object];
r2 = a0.source_class_list ?? [];
arraySpread(items, r2, 2, r2);
return items;
}};
const QUICKSWITCHER_OPENED = AnalyticEvents.QUICKSWITCHER_OPENED;
object[QUICKSWITCHER_OPENED] = {throttlePeriod: 10000, throttleKeys: function() {
return [];
}};
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
object[CHAT_INPUT_COMPONENT_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({type}) {
return [type];
}};
const ROLE_PAGE_VIEWED = AnalyticEvents.ROLE_PAGE_VIEWED;
object[ROLE_PAGE_VIEWED] = {throttlePeriod: 120000, throttleKeys: function(a0) {
return [a0.role_id, a0.tab_opened];
}};
const VIDEO_INPUT_INITIALIZED = AnalyticEvents.VIDEO_INPUT_INITIALIZED;
object[VIDEO_INPUT_INITIALIZED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const AUDIO_INPUT_INITIALIZED = AnalyticEvents.AUDIO_INPUT_INITIALIZED;
object[AUDIO_INPUT_INITIALIZED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const HUB_ONBOARDING_CAROUSEL_SCROLLED = AnalyticEvents.HUB_ONBOARDING_CAROUSEL_SCROLLED;
object[HUB_ONBOARDING_CAROUSEL_SCROLLED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const HUB_STUDENT_PROMPT_CLICKED = AnalyticEvents.HUB_STUDENT_PROMPT_CLICKED;
object[HUB_STUDENT_PROMPT_CLICKED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const RPC_SERVER_ERROR_CAUGHT = AnalyticEvents.RPC_SERVER_ERROR_CAUGHT;
object[RPC_SERVER_ERROR_CAUGHT] = {throttlePeriod: 86400000, throttleKeys: function() {
return [];
}};
const RPC_COMMAND_SENT = AnalyticEvents.RPC_COMMAND_SENT;
object[RPC_COMMAND_SENT] = {'throttlePeriod': 86400000, 'throttleKeys': null, 'throttlePercent': 0.001,
throttleKeys: function(a0) {
return [a0.application_id, a0.command];
}};
const RPC_SUBSCRIPTION_REQUESTED = AnalyticEvents.RPC_SUBSCRIPTION_REQUESTED;
object[RPC_SUBSCRIPTION_REQUESTED] = {'throttlePeriod': 86400000, 'throttleKeys': null, 'throttlePercent': 0.001,
throttleKeys: function(a0) {
return [a0.application_id, a0.event];
}};
const ACTIVITY_HANDSHAKE = AnalyticEvents.ACTIVITY_HANDSHAKE;
object[ACTIVITY_HANDSHAKE] = {throttlePeriod: 86400000, throttleKeys: function({application_id}) {
return [application_id];
}};
const CHANNEL_BANNER_VIEWED = AnalyticEvents.CHANNEL_BANNER_VIEWED;
object[CHANNEL_BANNER_VIEWED] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.banner_type, a0.channel_id];
}};
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const GUILD_HANGOUT_WINDOW = ImpressionNames.GUILD_HANGOUT_WINDOW;
object[GUILD_HANGOUT_WINDOW] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.channel_id, a0.banner_hash];
}};
const GUILD_HANGOUT_WINDOW_ENTRY_POINT = ImpressionNames.GUILD_HANGOUT_WINDOW_ENTRY_POINT;
object[GUILD_HANGOUT_WINDOW_ENTRY_POINT] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.channel_id, a0.media_session_id];
}};
const PREMIUM_UPSELL_VIEWED = AnalyticEvents.PREMIUM_UPSELL_VIEWED;
object[PREMIUM_UPSELL_VIEWED] = {throttlePeriod: 60000, throttleKeys: function({type}) {
return [type];
}};
const FORUM_CHANNEL_SEARCHED = AnalyticEvents.FORUM_CHANNEL_SEARCHED;
object[FORUM_CHANNEL_SEARCHED] = {throttlePeriod: 60000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const FORUM_CHANNEL_SCROLLED = AnalyticEvents.FORUM_CHANNEL_SCROLLED;
object[FORUM_CHANNEL_SCROLLED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED = AnalyticEvents.VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED;
object[VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED] = {throttlePeriod: 60000, throttleKeys: function({user_id}) {
return [user_id];
}};
const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED;
object[MEDIA_VIEWER_SESSION_COMPLETED] = {throttlePeriod: 60000, throttleKeys: function() {
return [];
}};
const SUMMARIES_UNREAD_BAR_VIEWED = AnalyticEvents.SUMMARIES_UNREAD_BAR_VIEWED;
object[SUMMARIES_UNREAD_BAR_VIEWED] = {throttlePeriod: 300000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const ACTIVITY_CARDS_VIEWED = AnalyticEvents.ACTIVITY_CARDS_VIEWED;
object[ACTIVITY_CARDS_VIEWED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.context, a0.guild_id];
}};
const GUILD_TOOLTIP_SHOWN = AnalyticEvents.GUILD_TOOLTIP_SHOWN;
object[GUILD_TOOLTIP_SHOWN] = {throttlePeriod: 900000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const ACK_COMMUNITY_MESSAGES = AnalyticEvents.ACK_COMMUNITY_MESSAGES;
object[ACK_COMMUNITY_MESSAGES] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const REDESIGN_NAV_BAR_CLICKED = AnalyticEvents.REDESIGN_NAV_BAR_CLICKED;
object[REDESIGN_NAV_BAR_CLICKED] = {throttlePeriod: 900000, throttleKeys: function({tab}) {
return [tab];
}};
const CHANNEL_LIST_END_REACHED = AnalyticEvents.CHANNEL_LIST_END_REACHED;
object[CHANNEL_LIST_END_REACHED] = {throttlePeriod: 900000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED = AnalyticEvents.EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED;
object[EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED] = {throttlePeriod: 60000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const LIVE_ACTIVITY_SETTINGS_UPDATED = AnalyticEvents.LIVE_ACTIVITY_SETTINGS_UPDATED;
object[LIVE_ACTIVITY_SETTINGS_UPDATED] = {throttlePeriod: 3600000, throttleKeys: function() {
return [];
}};
const MEDIA_INPUT_VOLUME_CHANGED = AnalyticEvents.MEDIA_INPUT_VOLUME_CHANGED;
object[MEDIA_INPUT_VOLUME_CHANGED] = {throttlePeriod: 300000, throttleKeys: function({location_stack}) {
return [location_stack];
}};
const MEDIA_OUTPUT_VOLUME_CHANGED = AnalyticEvents.MEDIA_OUTPUT_VOLUME_CHANGED;
object[MEDIA_OUTPUT_VOLUME_CHANGED] = {throttlePeriod: 300000, throttleKeys: function({location_stack}) {
return [location_stack];
}};
const APP_DMS_QUICK_LAUNCHER_IMPRESSION = AnalyticEvents.APP_DMS_QUICK_LAUNCHER_IMPRESSION;
object[APP_DMS_QUICK_LAUNCHER_IMPRESSION] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const USER_VOICE_ACTIVITY_VIEWED = AnalyticEvents.USER_VOICE_ACTIVITY_VIEWED;
object[USER_VOICE_ACTIVITY_VIEWED] = {'throttlePeriod': 300000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function(a0) {
return [a0.activity_user_id, a0.surface];
}};
const PARTY_VOICE_ACTIVITY_VIEWED = AnalyticEvents.PARTY_VOICE_ACTIVITY_VIEWED;
object[PARTY_VOICE_ACTIVITY_VIEWED] = {'throttlePeriod': 300000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function({voice_channel_id}) {
return [voice_channel_id];
}};
const MEMBER_LIST_SWIPE_PEEK = AnalyticEvents.MEMBER_LIST_SWIPE_PEEK;
object[MEMBER_LIST_SWIPE_PEEK] = {throttlePeriod: 1000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const REDACTABLE_MESSAGE_LOADED = AnalyticEvents.REDACTABLE_MESSAGE_LOADED;
object[REDACTABLE_MESSAGE_LOADED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.channel_id, a0.message_id];
}};
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
object[OPEN_MODAL] = _fun8339;
const MODERATOR_QUEUE_ACTION = AnalyticEvents.MODERATOR_QUEUE_ACTION;
object[MODERATOR_QUEUE_ACTION] = {throttlePeriod: 10000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const NOTIFICATION_PERMISSION_STATUS = AnalyticEvents.NOTIFICATION_PERMISSION_STATUS;
object[NOTIFICATION_PERMISSION_STATUS] = {throttlePeriod: 43200000, throttleKeys: function(a0) {
return [a0.os_enabled, a0.notification_authorization_status, a0.foreground_app_enabled,
a0.background_app_enabled];
}};
const SEARCH_BAR_VIEWED = AnalyticEvents.SEARCH_BAR_VIEWED;
object[SEARCH_BAR_VIEWED] = {throttlePeriod: 3600000, throttleKeys: function({search_type}) {
return [search_type];
}};
const AD_IDENTIFIER_FETCHED = AnalyticEvents.AD_IDENTIFIER_FETCHED;
object[AD_IDENTIFIER_FETCHED] = {throttlePeriod: 86400000, throttleKeys: function() {
return [];
}};
const ACTIVITY_PANEL_SDK_LINK_VIEWED = AnalyticEvents.ACTIVITY_PANEL_SDK_LINK_VIEWED;
object[ACTIVITY_PANEL_SDK_LINK_VIEWED] = {throttlePeriod: 86400000, throttleKeys: function({application_id}) {
return [application_id];
}};
const LIBDISCORE_SLOW_TIMERS = AnalyticEvents.LIBDISCORE_SLOW_TIMERS;
object[LIBDISCORE_SLOW_TIMERS] = {throttlePeriod: 3600000, throttleKeys: function() {
return [];
}};
const VIDEO_STREAM_ZOOM_CHANGED = AnalyticEvents.VIDEO_STREAM_ZOOM_CHANGED;
object[VIDEO_STREAM_ZOOM_CHANGED] = {throttlePeriod: 1000, throttleKeys: function() {
return [];
}};
const CACHE_STATS_RECORDED = AnalyticEvents.CACHE_STATS_RECORDED;
object[CACHE_STATS_RECORDED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const getAccessibilityFeatures = function() {
return AccessibilityFeatureFlags.NONE;
};
const analyticsUtilsModule2 = AnalyticsUtilsModule;
const env0_20 = analyticsUtilsModule2.trackMaker({addBreadcrumb: addBreadcrumb2, analyticEventConfigs: object,
dispatcher: Dispatcher, TRACK_ACTION_NAME: 'TRACK'});
const env0_22 = {};
const value11 = analyticsUtilsModule2;
const env0_23 = value11.trackMaker({addBreadcrumb: addBreadcrumb2, analyticEventConfigs: object,
dispatcher: Dispatcher, TRACK_ACTION_NAME: 'TRACK'});
const object4 = {};
copyDataProperties(object4, AnalyticsUtilsModule, undefined);
const getCampaignParams = analyticsUtilsModule2.getCampaignParams;
object4['getCampaignParams'] = getCampaignParams;
object4['setSystemAccessibilityFeatures'] = function(a0) {
env0_19 = a0;
};
object4['expandEventProperties'] = expandEventProperties2;
object4['track'] = track_8351;
(FileImportTrackerModule).fileFinishedImporting('utils/AnalyticsUtils.tsx');
exports.default = object4;
exports.AnalyticsContext = value;
exports.launchSignature = r9;
exports.addExtraAnalyticsDecorator = addExtraAnalyticsDecorator;
exports.AnalyticEventConfigs = object;
exports.expandLocation = closure;
exports.setUTMContext = function(a0) {
env0_14 = a0;
return a0;
};
exports.expandEventProperties = expandEventProperties2;
exports.debugLogEvent = debugLogEvent2;
exports.startRecordingAnalyticsEvents = function() {
env0_21 = true;
};
exports.stopRecordingAnalyticsEvents = function() {
env0_21 = false;
};
exports.getAnalyticsEventsRecording = getAnalyticsEventsRecording;
exports.clearAnalyticsEventsRecording = clearAnalyticsEventsRecording;
exports.isGameApplicationType = isGameApplicationType;
exports.trackNetworkAction = trackNetworkAction;
exports.getNewAnalyticsLoadId = getNewAnalyticsLoadId;
exports.AnalyticsSchema = importAll(12846) /* metro dependency 12846: AnalyticsSchema */;
function addBreadcrumb(a0) { // fn#8284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6093, offset: 0x00d3ea81, size: 94 bytes, params: 2, frame: 14
const IGNORE_ANALYTICS_BREADCRUMB_EVENTS = (CommonSentryInitUtilsModule).IGNORE_ANALYTICS_BREADCRUMB_EVENTS;
if (!IGNORE_ANALYTICS_BREADCRUMB_EVENTS.includes(a0)) {
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({category: 'analytics',
message: a0});
}
}
function expandEventProperties(a0) { // fn#8285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6358, offset: 0x00d3eadf, size: 528 bytes, params: 2, frame: 22
var r8;
var r0;
var object;
var value2;
var value3;
const r7 = a0 ?? ({});
let location = r7.location;
if (location == null) {
r8 = r7;
} else {
location = r7.location;
value2 = ObjectWithoutProperties(r7, env0_4);
object = {};
copyDataProperties(object, value2, undefined);
copyDataProperties(object, expandLocation(location), undefined);
r8 = object;
}
let source = r8.source;
if (source == null) {
r0 = r8;
} else {
source = r8.source;
value3 = ObjectWithoutProperties(r8, env0_5);
object = {};
copyDataProperties(object, value3, undefined);
copyDataProperties(object, expandSource(source), undefined);
r0 = object;
}
r0.client_performance_cpu = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCurrentCPUUsagePercent();
r0.client_performance_memory = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCurrentMemoryUsageKB();
r0.cpu_core_count = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCPUCoreCount();
r0.accessibility_features = getAccessibilityFeatures();
r0.rendered_locale = (require(1244) /* metro dependency 1244: indexNative */).intl.currentLocale;
const Math = global.Math;
r0.uptime_app = Math.floor((global.performance.now() - env0_16) / env0_15);
const processUptime = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getProcessUptime();
if (processUptime != null) {
r0.uptime_process_renderer = global.Math.floor(processUptime);
}
const binding = env0_14;
const utmSource = binding.utmSource;
const utmMedium = binding.utmMedium;
const utmCampaign = binding.utmCampaign;
const utmContent = binding.utmContent;
r0.utm_source = r0.utm_source ?? utmSource;
r0.utm_medium = r0.utm_medium ?? utmMedium;
r0.utm_campaign = r0.utm_campaign ?? utmCampaign;
r0.utm_content = r0.utm_content ?? utmContent;
r0.launch_signature = env0_17;
env0_18.forEach(_fun8286);
return r0;
function _fun8286(a0) { // fn#8286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:7248, offset: 0x00c44018, size: 19 bytes, params: 2, frame: 11
return a0(env0_0);
}
}
function debugLogEvent(a0, a1) { // fn#8287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:7260, offset: 0x00d3ecef, size: 82 bytes, params: 3, frame: 16
let value = a2;
const r1 = value !== undefined ? value : false;
DeveloperOptionsStore.isLoggingAnalyticsEvents;
value = importAll(12) /* metro dependency 12: LogAggregator */;
const report = value.report;
if (r1) {
Reflect.apply(report, value, ['Analytics', a0, a1]);
} else {
Reflect.apply(report, value, ['Analytics', a0]);
}
}
function _fun8290({location_object_type}) { // fn#8290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:748, offset: 0x00d3ed41, size: 58 bytes, params: 2, frame: 3
const ACK_MANUAL = AnalyticsObjectTypes.ACK_MANUAL;
return location_object_type === ACK_MANUAL ? undefined : {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id, a0.location_section];
}};
}
function _fun8339({type}) { // fn#8339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:4910, offset: 0x00d3f02c, size: 57 bytes, params: 2, frame: 3
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
return type !== MEDIA_VIEWER ? undefined : {throttlePeriod: 60000, throttleKeys: function({type}) {
return [type];
}};
}
function track_8351(a0, a1) { // fn#8351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:7739, offset: 0x00d3f0c6, size: 223 bytes, params: 3, frame: 20
var isArray2;
var binding;
let value = a2;
const r6 = value !== undefined ? value : {};
const String = global.String;
value = String(a0);
if (env0_21) {
if (a1 != null) {
isArray2 = global.Array.isArray(env0_22[a0]);
binding = env0_22;
if (isArray2) {
binding[a0].push(a1);
} else {
binding[a0] = [a1];
}
}
}
if (r6.throttlePercent != null) {
var Math = global.Math;
if (Math.random() > r6.throttlePercent) {
return global.Promise.resolve();
}
}
const value4 = expandEventProperties(a1);
debugLogEvent(value, value4, r6.logEventProperties);
return env0_20(a0, value4, {flush: r6.flush, fingerprint: r6.fingerprint});
}
function addExtraAnalyticsDecorator(a0) { // fn#8352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8245, offset: 0x00d3f1a5, size: 24 bytes, params: 2, frame: 11
env0_18.push(a0);
}
function getAnalyticsEventsRecording() { // fn#8356, offset: 0x00d3f1e3, size: 9 bytes, params: 1, frame: 1
return env0_22;
}
function clearAnalyticsEventsRecording() { // fn#8357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8749, offset: 0x00d3f1ec, size: 46 bytes, params: 1, frame: 11
const Object = global.Object;
Object.keys(env0_22).forEach(_fun8358);
function _fun8358(a0) { // fn#8358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8814, offset: 0x00d3f21a, size: 18 bytes, params: 2, frame: 2
delete env1_22[a0];
}
}
function isGameApplicationType(a0) { // fn#8359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8858, offset: 0x00d3f22c, size: 39 bytes, params: 2, frame: 4
const GAME = ApplicationTypes.GAME;
return a0 === GAME || a0 === ApplicationTypes.DEPRECATED_GAME;
}
function trackNetworkAction(a0, a1) { // fn#8360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8955, offset: 0x00d3f253, size: 96 bytes, params: 3, frame: 17
const expandEventPropertiesBinding = expandEventProperties;
let object = {};
object.location = getLocation();
copyDataProperties(object, a1, undefined);
const value2 = expandEventPropertiesBinding(object);
const setDebugTrackedDataBinding = setDebugTrackedData;
object = {type: 'action'};
copyDataProperties(object, a1, 'action');
setDebugTrackedDataBinding(a0, object);
debugLogEvent(a0, value2);
env0_23(a0, value2);
}
function getNewAnalyticsLoadId() { // fn#8361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:9114, offset: 0x00d3f2b3, size: 37 bytes, params: 1, frame: 11
return (Module00491Module).v4();
}
}
global.__d(_fun8281, 683, [29, 31, 684, 691, 661, 12845, 4238, 1873, 682, 480, 12843, 1216, 694, 5256, 1244, 12,
491, 2,
12846]) /* metro module 683, dependencies: [29, 31, 684, 691, 661, 12845, 4238, 1873, 682, 480, 12843, 1216, 694, 5256, 1244, 12, 491, 2, 12846] */;