decord/source/modules/media_viewer/MediaViewerAnalyticsManager.tsx

122 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9033
// Function ID: 9034
2026-07-20 16:05:17 +00:00
// Name: IncrementableMediaViewerActions
2026-08-11 06:20:06 +00:00
// Dependencies: [1391, 676, 644, 698, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 9033 (IncrementableMediaViewerActions)
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import ME from "ME" /* 676 */;
import keys from "keys" /* 644 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: c3, AnalyticsSections: c4 } = ME);
2026-07-20 16:05:17 +00:00
let obj = { VIEWER_SWIPE: "number_viewer_swipes", THUMBNAIL_SWIPE: "number_thumbnail_swipes", SELECTED_ITEM_CHANGE: "number_selected_item_changes", ZOOM_IN_BUTTON_PRESSED: "number_zoom_in_button_pressed", ZOOM_IN_IMAGE_PRESSED: "number_zoom_in_image_pressed", ZOOM_OUT_BUTTON_PRESSED: "number_zoom_out_button_pressed", ZOOM_OUT_IMAGE_PRESSED: "number_zoom_out_image_pressed", FORWARD_PRESSED: "number_forward_button_pressed", SAVE_MEDIA_PRESSED: "number_save_media_button_pressed", OPEN_LINK_PRESSED: "number_open_link_button_pressed", MORE_BUTTON_PRESSED: "number_more_button_pressed", COPY_IMAGE_PRESSED: "number_copy_image_more_menu_pressed", COPY_LINK_PRESSED: "number_copy_link_more_menu_pressed", CONTEXT_MENU_OPENED: "number_context_menu_opened" };
2026-08-24 06:08:38 +00:00
obj = { guildId: "disabled", channelId: "isArray", channelType: "isArray", numMediaItems: "Array", hasMediaOptions: "call", source: "<string:1895895544>", incrementableActions: "e" };
2026-07-20 16:05:17 +00:00
const values = Object.values(obj);
2026-07-29 08:29:29 +00:00
obj[6] = Object.fromEntries(values.map((arg0) => {
2026-07-20 16:05:17 +00:00
const items = [arg0, 0];
return items;
}));
2026-07-23 10:11:24 +00:00
let closure_6 = keys.create(() => obj);
2026-07-20 16:05:17 +00:00
obj = {
markSessionStarted(channelId) {
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId.channelId);
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { type: constants2.MEDIA_VIEWER, source: channelId.source, channel_id: channelId.channelId, channel_type: null, guild_id: null };
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type = channel.type;
}
2026-07-29 08:29:29 +00:00
obj[3] = type;
2026-07-20 16:05:17 +00:00
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id = channel.guild_id;
}
2026-07-29 08:29:29 +00:00
obj[4] = guild_id;
2026-07-20 16:05:17 +00:00
obj.track(constants.OPEN_MODAL, obj);
obj = {};
const merged = Object.assign(obj);
const merged1 = Object.assign(channelId);
2026-07-29 08:29:29 +00:00
obj.channelId = channelId.channelId;
2026-07-20 16:05:17 +00:00
let type1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type1 = channel.type;
}
2026-07-29 08:29:29 +00:00
obj.channelType = type1;
2026-07-20 16:05:17 +00:00
let guild_id1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id1 = channel.guild_id;
}
2026-07-29 08:29:29 +00:00
obj.guildId = guild_id1;
2026-07-20 16:05:17 +00:00
store.setState(obj);
},
markSessionCompleted() {
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { source: state.source, guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType, number_media_items: state.numMediaItems, has_media_options: state.hasMediaOptions };
const merged = Object.assign(state.incrementableActions);
obj.track(constants.MEDIA_VIEWER_SESSION_COMPLETED, obj);
obj = {};
const merged1 = Object.assign(obj);
store.setState(obj);
},
markActionPerformed(SELECTED_ITEM_CHANGE) {
2026-08-24 06:08:38 +00:00
closure_0 = SELECTED_ITEM_CHANGE;
2026-07-20 16:05:17 +00:00
store.setState((incrementableActions) => {
2026-08-24 06:08:38 +00:00
obj = { incrementableActions: null };
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(incrementableActions.incrementableActions);
2026-07-23 10:11:24 +00:00
obj[closure_0] = incrementableActions.incrementableActions[closure_0] + 1;
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-07-20 16:05:17 +00:00
return obj;
});
},
trackMediaViewerImageSaved(arg0) {
({ url, success } = arg0);
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { url, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_IMAGE_SAVED, obj);
},
trackMediaViewerImageCopied(arg0) {
({ url, success } = arg0);
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { url, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_IMAGE_COPIED, obj);
},
trackMediaViewerLinkCopied(arg0) {
({ href, success } = arg0);
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { href, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_LINK_COPIED, obj);
},
trackMediaViewerLinkOpened(href) {
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { href: href.href, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_LINK_OPENED, obj);
},
trackMediaViewerDownloadButtonTapped() {
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType };
obj.track(constants.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, obj);
},
trackMediaViewerShareButtonTapped() {
const state = store.getState();
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
obj = { guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType };
obj.track(constants.MEDIA_VIEWER_SHARE_BUTTON_TAPPED, obj);
},
trackMessageEmbedsActionCompleted(arg0) {
({ platform, action, error } = arg0);
2026-08-24 06:08:38 +00:00
expandEventPropertiesDefault.track(constants.MESSAGE_EMBEDS_ACTION_COMPLETED, { platform, error, action });
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/media_viewer/MediaViewerAnalyticsManager.tsx");
2026-07-20 16:05:17 +00:00
export const IncrementableMediaViewerActions = obj;
export const MediaViewerAnalytics = obj;