105 lines
5.9 KiB
TypeScript
105 lines
5.9 KiB
TypeScript
/* Metro module 9571; source: modules/content_inventory/matchUtils.tsx; dependencies: [661, 8847, 6868, 9572, 9574, 8846, 8375, 2] */
|
|
function _fun74889(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:6, offset: 0x01d9d22e, size: 257 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const closure = isSpotifyEntry;
|
|
const closure2 = isCrunchyrollEntry;
|
|
const closure3 = function({extra}, a1) {
|
|
var r1;
|
|
var r0;
|
|
var value = extra != null;
|
|
if (value) {
|
|
r1 = 'application_id' in a1 && a1.application_id === extra.application_id;
|
|
r1 = !r1 ? 'game_name' in extra ? a1.name === extra.game_name : 'activity_name' in extra && a1.name === extra.activity_name : r1;
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const closure4 = isMatchingListeningActivity;
|
|
const closure5 = isMatchingWatchActivity;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = (require(661) /* metro dependency 661: Constants */).ActivityTypes;
|
|
const env0_4 = (require(8847) /* metro dependency 8847: CrunchyrollConnectionConstants */).CRUNCHYROLL_CLIENT_ID;
|
|
const env0_5 = (require(6868) /* metro dependency 6868: SpotifyConstants */).isSpotifyParty;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/content_inventory/matchUtils.tsx');
|
|
exports.isSpotifyEntry = closure;
|
|
exports.isCrunchyrollEntry = closure2;
|
|
exports.isMatchingApplicationActivity = closure3;
|
|
exports.isMatchingListeningActivity = closure4;
|
|
exports.isMatchingWatchActivity = closure5;
|
|
exports.findMatchingEntry = findMatchingEntry;
|
|
}
|
|
|
|
function isSpotifyEntry(a0) { // fn#74890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:177, offset: 0x01d9d32f, size: 223 bytes, params: 2, frame: 16
|
|
var r0;
|
|
var isTopArtistEntry2;
|
|
const ContentInventoryListenedMediaProvider = (require(9574) /* metro dependency 9574: ContentInventoryListenedMediaProvider */).ContentInventoryListenedMediaProvider;
|
|
var property;
|
|
const value2 = undefined;
|
|
const contentInventoryTypesModule = require(9572) /* metro dependency 9572: ContentInventoryTypes */;
|
|
if (contentInventoryTypesModule.isListenedSessionEntry(a0)) {
|
|
property = a0.extra.entries[0];
|
|
r0 = (property == null || property.media == null ? value2 : property.media.provider) === ContentInventoryListenedMediaProvider.SPOTIFY;
|
|
} else {
|
|
isTopArtistEntry2 = contentInventoryTypesModule.isTopArtistEntry(a0);
|
|
r0 = isTopArtistEntry2 ? a0.extra.media.provider === ContentInventoryListenedMediaProvider.SPOTIFY : !!isTopArtistEntry2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isCrunchyrollEntry(a0) { // fn#74891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:485, offset: 0x01d9d40e, size: 70 bytes, params: 2, frame: 13
|
|
const isWatchedMediaEntry2 = (require(9572) /* metro dependency 9572: ContentInventoryTypes */).isWatchedMediaEntry(a0);
|
|
return isWatchedMediaEntry2 ? a0.extra.application_id === CRUNCHYROLL_CLIENT_ID : !!isWatchedMediaEntry2;
|
|
}
|
|
|
|
function isMatchingListeningActivity(a0, a1) { // fn#74893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:803, offset: 0x01d9d4c5, size: 62 bytes, params: 3, frame: 14
|
|
const isSpotifyEntryBinding = isSpotifyEntry;
|
|
const value2 = undefined;
|
|
const isSpotifyEntry2 = isSpotifyEntryBinding(a0);
|
|
return isSpotifyEntry2 ? isSpotifyParty(a1.party == null ? value2 : a1.party.id) : !!isSpotifyEntry2;
|
|
}
|
|
|
|
function isMatchingWatchActivity(a0, a1) { // fn#74894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:911, offset: 0x01d9d503, size: 84 bytes, params: 3, frame: 14
|
|
const value2 = (importDefault(8846) /* metro dependency 8846: isCrunchyrollActivity */)(a1);
|
|
return !(value2 ? !isCrunchyrollEntry(a0) : !value2) && a0.extra.media_title === a1.details;
|
|
}
|
|
|
|
function findMatchingEntry(a0, a1) { // fn#74895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:1363, offset: 0x01d9d557, size: 283 bytes, params: 3, frame: 18
|
|
var r0;
|
|
const env0_0 = a1;
|
|
var value;
|
|
const value2 = undefined;
|
|
const value3 = a0.filter((require(8375) /* metro dependency 8375: utils */).isEntryActive);
|
|
const type = a1.type;
|
|
const PLAYING = ActivityTypes.PLAYING;
|
|
if (type === PLAYING) {
|
|
value = value3.filter((require(9572) /* metro dependency 9572: ContentInventoryTypes */).isGamingLikeEntry);
|
|
value = value.find(function(a0) {
|
|
return isMatchingApplicationActivity(a0, require);
|
|
});
|
|
r0 = value;
|
|
} else if (a1.type === ActivityTypes.LISTENING) {
|
|
value = value3.filter((require(9572) /* metro dependency 9572: ContentInventoryTypes */).isListenedSessionEntry);
|
|
value = value.find(_fun74897);
|
|
r0 = value;
|
|
} else if (a1.type !== ActivityTypes.WATCHING) {
|
|
r0 = value2;
|
|
} else {
|
|
value = a0.filter((require(9572) /* metro dependency 9572: ContentInventoryTypes */).isWatchedMediaEntry);
|
|
value = value.find(_fun74898);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun74897(a0) { // fn#74897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:1609, offset: 0x01d9d672, size: 27 bytes, params: 2, frame: 13
|
|
return isMatchingListeningActivity(a0, require);
|
|
}
|
|
|
|
function _fun74898(a0) { // fn#74898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9757:1711, offset: 0x01d9d68d, size: 27 bytes, params: 2, frame: 13
|
|
return isMatchingWatchActivity(a0, require);
|
|
}
|
|
|