Files
2026-07-28 01:06:53 +03:00

623 lines
32 KiB
TypeScript

/* Metro module 5193; source: modules/user_profile/WidgetUtils.tsx; dependencies: [57, 1878, 5189, 5194, 5195, 5192, 1244, 5191, 5196, 5197, 5198, 4269, 5203, 5205, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import UserProfileStore from './UserProfileStore.tsx'; /* Metro dependency 5189 */
import WidgetStore from './WidgetStore.tsx'; /* Metro dependency 5194 */
import WidgetActionCreators from './WidgetActionCreators.tsx'; /* Metro dependency 5196 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UserProfileGameWidgetTypesModule from './UserProfileGameWidgetTypes.tsx'; /* Metro dependency 5191 */
import * as GameWidgetLimitsModule from '../../external/discord_common/js/shared/shared-constants/GameWidgetLimits.tsx'; /* Metro dependency 5192 */
import * as UserProfileWidgetConstantsModule from './UserProfileWidgetConstants.tsx'; /* Metro dependency 5195 */
import * as WidgetGameTagModule from '../../external/discord_common/js/shared/shared-constants/WidgetGameTag.tsx'; /* Metro dependency 5197 */
import * as UseGameModule from '../games/hooks/useGame.tsx'; /* Metro dependency 5198 */
function _fun45786(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:6, offset: 0x0119841f, size: 545 bytes, params: 8, frame: 27
let env0_0 = require;
const closure = function(a0) {
return WIDGETS_SUPPORTING_COMMENT.includes(a0);
};
const closure2 = function(a0) {
return WIDGETS_SUPPORTING_TAGS.includes(a0);
};
const closure3 = function(a0) {
return a0 in require(dependencyMap[5]).GAME_WIDGET_LIMITS_BY_TYPE ? require(dependencyMap[5]).GAME_WIDGET_LIMITS_BY_TYPE[a0] : 0;
};
const getSavedWidgets2 = getSavedWidgets;
const replaceWidgetInList2 = replaceWidgetInList;
const updatePendingGameTags2 = updatePendingGameTags;
const normalizeNullishValue = function(a0) {
var value = a0;
var value2 = null;
return value2 == value || value === '' || global.Array.isArray(value) && value.length === 0 ? value2 : value;
};
const closure7 = function(a0) {
return a0?.themes != null && a0.themes.includes(require(dependencyMap[11]).GameTheme.EROTIC);
};
const isAgeRestrictedGame2 = isAgeRestrictedGame;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/WidgetUtils.tsx');
exports.getWidgetTitle = function(a0) {
return WIDGET_TITLES_BY_TYPE[a0.type](a0);
};
exports.getGameWidgetSubtitle = getGameWidgetSubtitle;
exports.widgetSupportsComment = closure;
exports.widgetSupportsTags = closure2;
exports.widgetMaxGames = closure3;
exports.getRandomElement = function(a0) {
var Math = global.Math;
var Math2 = global.Math;
return a0[Math.floor(Math2.random() * a0.length)];
};
exports.getRandomElements = function(a0, a1) {
var items = [];
arraySpread(items, a0, 0, 0);
return items.sort(_fun45806).slice(0, a1);
};
exports.getSavedWidgets = getSavedWidgets2;
exports.replaceWidgetInList = replaceWidgetInList2;
exports.addWidgetToPending = addWidgetToPending;
exports.removeWidgetFromPending = removeWidgetFromPending;
exports.updatePendingGameTags = updatePendingGameTags2;
exports.removeTagFromGame = removeTagFromGame;
exports.updatePendingGameComment = updatePendingGameComment;
exports.addPendingGameToWidget = addPendingGameToWidget;
exports.reorderWidgets = reorderWidgets;
exports.reorderGamesInWidget = reorderGamesInWidget;
exports.removePendingGameFromWidget = removePendingGameFromWidget;
exports.isGameLimitReached = isGameLimitReached;
exports.areWidgetGamesEqual = function(a0, a1, a2) {
var env0_0 = a1;
var env0_1 = a2;
return a0.length === a1.length && a0.every(_fun45825);
};
exports.isNSFWGame = closure7;
exports.isAgeRestrictedGame = isAgeRestrictedGame2;
exports.isGameAllowedInGameWidgets = isGameAllowedInGameWidgets;
function getSavedWidgets() { // fn#45790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:458, offset: 0x011986b4, size: 72 bytes, params: 1, frame: 13
const currentUser = UserStore.getCurrentUser();
const value3 = null;
const r2 = value3 != currentUser ? UserProfileStore.getUserProfile(currentUser.id) : value3;
const widgets = value3 == r2 ? undefined : r2.widgets;
return value3 != widgets ? widgets : [];
}
function getCurrentWidgets() { // fn#45791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:597, offset: 0x011986fc, size: 65 bytes, params: 1, frame: 10
const widgetStoreBinding = WidgetStore;
return widgetStoreBinding.hasPendingChanges() ? WidgetStore.getPendingWidgets() ?? [] : getSavedWidgets();
}
function findGameWidget(a0) { // fn#45792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:716, offset: 0x0119873d, size: 88 bytes, params: 2, frame: 15
const env0_0 = a0;
const currentWidgets = getCurrentWidgets();
let value = currentWidgets.filter((UserProfileGameWidgetTypesModule).isGameWidget);
value = value.find(_fun45793);
const value3 = null;
return value3 != value ? value : value3;
function _fun45793({type}) { // fn#45793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:820, offset: 0x0108b18c, size: 21 bytes, params: 2, frame: 2
return type === env0_0;
}
}
function replaceWidgetInList(a0) { // fn#45794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:844, offset: 0x01198795, size: 93 bytes, params: 2, frame: 15
var items2;
const env0_0 = a0;
const currentWidgets = getCurrentWidgets();
const index = currentWidgets.findIndex(_fun45795);
if (index === -1) {
arraySpread([a0], currentWidgets, 1, undefined);
} else {
items2 = [];
arraySpread(items2, currentWidgets, 0, undefined);
items2[index] = a0;
}
return items2;
function _fun45795(a0) { // fn#45795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:917, offset: 0x011987f2, size: 36 bytes, params: 2, frame: 10
let getUniqueKey = a0.getUniqueKey;
const value = Reflect.apply(getUniqueKey, a0, []);
const binding = env0_0;
getUniqueKey = binding.getUniqueKey;
return value === Reflect.apply(getUniqueKey, binding, []);
}
}
function updatePendingGameTags(a0, a1, a2) { // fn#45796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:1012, offset: 0x01198816, size: 282 bytes, params: 4, frame: 18
var gameWidget;
var games;
var value2;
var object;
var value3;
var replaceWidgetInListBinding;
var BaseGameWidget;
var value4;
var baseGameWidget;
const env0_0 = a1;
const Object = global.Object;
const values = Object.values;
const WidgetGameTag = (WidgetGameTagModule).WidgetGameTag;
if (!(a2.length > Reflect.apply(values, Object, [WidgetGameTag]).length)) {
gameWidget = findGameWidget(a0);
if (gameWidget != null) {
games = gameWidget.games;
value2 = games.find(function({applicationId}) {
return applicationId === require;
});
if (value2 != null) {
object = {};
copyDataProperties(object, value2, games);
object['tags'] = a2;
value3 = gameWidget.games.map(_fun45798);
replaceWidgetInListBinding = replaceWidgetInList;
BaseGameWidget = (require(5191) /* metro dependency 5191: UserProfileGameWidgetTypes */).BaseGameWidget;
object = {};
copyDataProperties(object, gameWidget, games);
object['games'] = value3;
value4 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value4));
}
}
}
function _fun45798(a0) { // fn#45798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:1246, offset: 0x01198945, size: 25 bytes, params: 2, frame: 4
const value = a0;
return value.applicationId !== require ? value : env0_1;
}
}
function isAgeRestrictedGame(a0) { // fn#45801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:1579, offset: 0x011989ef, size: 121 bytes, params: 2, frame: 17
var r0;
var contentClassificationToAgeRestriction;
var object;
let value = a0.content_classification != null;
if (value) {
value = require(5203) /* metro dependency 5203: ContentClassificationToAgeRestriction */;
contentClassificationToAgeRestriction = value.contentClassificationToAgeRestriction;
object = {};
object.type = (require(5203) /* metro dependency 5203: ContentClassificationToAgeRestriction */).ContentClassificationVariant.MINIMAL;
object.data = a0.content_classification;
value = Reflect.apply(contentClassificationToAgeRestriction, value, [object]);
value = value === (require(5205) /* metro dependency 5205: AgeRestrictionStatus */).AgeRestrictionStatus.ADULT;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function getGameWidgetSubtitle(a0, {isCurrentUser}) { // fn#45803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:1947, offset: 0x01198a82, size: 238 bytes, params: 3, frame: 19
const GAME_WIDGET_LIMITS_BY_TYPE = (GameWidgetLimitsModule).GAME_WIDGET_LIMITS_BY_TYPE;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
if (isCurrentUser) {
if (a0.games.length > 0) {
return GAME_WIDGET_LIMITS_BY_TYPE[a0.type] === 1 ? intl.string(t.wiXdEa) : intl.format(t['zR1+0/'],
{numGames: GAME_WIDGET_LIMITS_BY_TYPE[a0.type]});
}
}
}
function getRandomElements(a0, a1) { // fn#45805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2450, offset: 0x01198ba5, size: 52 bytes, params: 3, frame: 14
const items2 = [];
arraySpread(items2, a0, 0, 0);
return items2.sort(function() {
var Math = global.Math;
return 0.5 - Math.random();
}).slice(0, a1);
}
function addWidgetToPending(a0) { // fn#45807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2633, offset: 0x01198bfb, size: 98 bytes, params: 2, frame: 16
var setPendingWidgets;
var items2;
const env0_0 = a0;
var value;
const currentWidgets = getCurrentWidgets();
if (currentWidgets.find(_fun45808) == null) {
value = importDefault(5196) /* metro dependency 5196: WidgetActionCreators */;
setPendingWidgets = value.setPendingWidgets;
items2 = [a0];
arraySpread(items2, currentWidgets, 1, currentWidgets);
Reflect.apply(setPendingWidgets, value, [items2]);
}
function _fun45808(a0) { // fn#45808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2704, offset: 0x011987f2, size: 36 bytes, params: 2, frame: 10
let getUniqueKey = a0.getUniqueKey;
const value = Reflect.apply(getUniqueKey, a0, []);
const binding = env0_0;
getUniqueKey = binding.getUniqueKey;
return value === Reflect.apply(getUniqueKey, binding, []);
}
}
function removeWidgetFromPending(a0) { // fn#45809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2810, offset: 0x01198c5d, size: 70 bytes, params: 2, frame: 13
const env0_0 = a0;
(WidgetActionCreators).setPendingWidgets(getCurrentWidgets().filter(_fun45810));
function _fun45810(a0) { // fn#45810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2880, offset: 0x01198ca3, size: 36 bytes, params: 2, frame: 10
let getUniqueKey = a0.getUniqueKey;
const value = Reflect.apply(getUniqueKey, a0, []);
const binding = env0_0;
getUniqueKey = binding.getUniqueKey;
return value !== Reflect.apply(getUniqueKey, binding, []);
}
}
function removeTagFromGame(a0, a1, a2) { // fn#45811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:3018, offset: 0x01198cc7, size: 144 bytes, params: 4, frame: 19
var value2;
var value3;
const env0_0 = a1;
const env0_1 = a2;
const gameWidget = findGameWidget(a0);
if (gameWidget != null) {
value2 = gameWidget.games.find(function({applicationId}) {
return applicationId === require;
});
if (value2 != null) {
if (value2.tags != null) {
if (value2.tags.length !== 0) {
value3 = value2.tags.filter(_fun45813);
updatePendingGameTags(gameWidget.type, a1, value3.length > 0 ? value3 : []);
}
}
}
}
function _fun45813(a0) { // fn#45813, offset: 0x01198d57, size: 16 bytes, params: 2, frame: 2
return a0 !== importDefault;
}
}
function updatePendingGameComment(a0, a1, a2) { // fn#45814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:3288, offset: 0x01198d67, size: 234 bytes, params: 4, frame: 18
var games;
var value2;
var object;
var value3;
var replaceWidgetInListBinding;
var BaseGameWidget;
var value4;
var baseGameWidget;
const env0_0 = a1;
const gameWidget = findGameWidget(a0);
if (gameWidget != null) {
games = gameWidget.games;
value2 = games.find(function({applicationId}) {
return applicationId === require;
});
if (value2 != null) {
if (a2 !== value2.comment) {
object = {};
copyDataProperties(object, value2, games);
object['comment'] = a2;
value3 = gameWidget.games.map(_fun45816);
replaceWidgetInListBinding = replaceWidgetInList;
BaseGameWidget = (require(5191) /* metro dependency 5191: UserProfileGameWidgetTypes */).BaseGameWidget;
object = {};
copyDataProperties(object, gameWidget, games);
object['games'] = value3;
value4 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value4));
}
}
}
function _fun45816(a0) { // fn#45816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:3475, offset: 0x01198945, size: 25 bytes, params: 2, frame: 4
const value = a0;
return value.applicationId !== require ? value : env0_1;
}
}
function addPendingGameToWidget({widgetType, game, ignoreMaxGames}) { // fn#45817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:3629, offset: 0x01198e51, size: 399 bytes, params: 2, frame: 22
var r11;
var r12;
var r6;
var r7;
var games;
var object;
var applicationId;
var items2;
var value7;
var replaceWidgetInListBinding;
const BaseGameWidget = (UserProfileGameWidgetTypesModule).BaseGameWidget;
var value8;
var baseGameWidget;
const useGame = (UseGameModule).useGame;
var fetchMany;
ignoreMaxGames = !(ignoreMaxGames === undefined) && ignoreMaxGames;
const gameWidget = findGameWidget(widgetType);
if (gameWidget == null) {
object = {};
applicationId = game.applicationId;
object.applicationId = applicationId;
object.comment = game.comment;
object.tags = game.tags;
if (gameWidget != null) {
items2 = [object];
r6 = gameWidget.games ?? [];
value7 = 1;
arraySpread(items2, r6, value7, r11);
r7 = items2;
r12 = value7;
} else {
r7 = [object];
}
replaceWidgetInListBinding = replaceWidgetInList;
object = {};
copyDataProperties(object, gameWidget ?? ({type: widgetType}), r12);
object['games'] = r7;
value8 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value8));
fetchMany = useGame.fetchMany;
applicationId = game.applicationId;
Reflect.apply(fetchMany, useGame, [[applicationId]]);
} else {
games = gameWidget.games;
var length = games?.length;
var value5 = length != null;
var r4 = value5 ? length : 0;
if (ignoreMaxGames) {
r6 = gameWidget.games ?? [];
if (r6.some(function({applicationId}) {
return applicationId === game.applicationId;
})) {
return undefined;
}
r11 = value5;
object = {};
applicationId = game.applicationId;
object.applicationId = applicationId;
object.comment = game.comment;
object.tags = game.tags;
if (gameWidget != null) {
items2 = [object];
r6 = gameWidget.games ?? [];
value7 = 1;
arraySpread(items2, r6, value7, r11);
r7 = items2;
r12 = value7;
} else {
r7 = [object];
}
replaceWidgetInListBinding = replaceWidgetInList;
object = {};
copyDataProperties(object, gameWidget ?? ({type: widgetType}), r12);
object['games'] = r7;
value8 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value8));
fetchMany = useGame.fetchMany;
applicationId = game.applicationId;
Reflect.apply(fetchMany, useGame, [[applicationId]]);
return undefined;
}
if (r4 >= widgetMaxGames(widgetType)) {
return undefined;
}
games = gameWidget.games;
r6 = games ?? [];
if (r6.some(function({applicationId}) {
return applicationId === game.applicationId;
})) {
return undefined;
}
r11 = value5;
object = {};
object.applicationId = game.applicationId;
object.comment = game.comment;
object.tags = game.tags;
if (gameWidget != null) {
items2 = [object];
r6 = gameWidget.games ?? [];
value7 = 1;
arraySpread(items2, r6, value7, r11);
r7 = items2;
r12 = value7;
} else {
r7 = [object];
}
replaceWidgetInListBinding = replaceWidgetInList;
object = {};
copyDataProperties(object, gameWidget ?? ({type: widgetType}), r12);
object['games'] = r7;
value8 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value8));
useGame.fetchMany([game.applicationId]);
}
}
function reorderWidgets(a0, a1) { // fn#45819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:4217, offset: 0x01198ffa, size: 147 bytes, params: 3, frame: 18
var currentWidgets;
var items2;
if (a0 !== a1) {
currentWidgets = getCurrentWidgets();
if (!(a0 < 0)) {
if (!(a0 >= currentWidgets.length)) {
if (!(a1 < 0)) {
if (!(a1 >= currentWidgets.length)) {
items2 = [];
arraySpread(items2, currentWidgets, 0, undefined);
items2.splice(a1, 0, Module00057(items2.splice(a0, 1), 1)[0]);
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(items2);
}
}
}
}
}
}
function reorderGamesInWidget(a0, a1, a2) { // fn#45820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:4437, offset: 0x0119908d, size: 261 bytes, params: 4, frame: 19
var games;
var items2;
var replaceWidgetInListBinding;
var BaseGameWidget;
var object;
var value3;
var baseGameWidget;
const gameWidget = findGameWidget(a0);
if (gameWidget != null) {
games = gameWidget.games;
if (games != null) {
if (a1 !== a2) {
games = gameWidget.games;
items2 = [];
arraySpread(items2, games, 0, undefined);
if (!(a1 < 0)) {
if (!(a1 >= items2.length)) {
if (!(a2 < 0)) {
if (!(a2 >= items2.length)) {
items2.splice(a2, 0, Module00057(items2.splice(a1, 1), 1)[0]);
replaceWidgetInListBinding = replaceWidgetInList;
BaseGameWidget = (require(5191) /* metro dependency 5191: UserProfileGameWidgetTypes */).BaseGameWidget;
object = {};
copyDataProperties(object, gameWidget, 0);
object['games'] = items2;
value3 = Object.create(BaseGameWidget.prototype,
{constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value3));
}
}
}
}
}
}
}
}
function removePendingGameFromWidget(a0, a1) { // fn#45821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:4775, offset: 0x01199192, size: 180 bytes, params: 3, frame: 17
var object;
var value2;
var replaceWidgetInListBinding;
var BaseGameWidget;
var value3;
var baseGameWidget;
const env0_0 = a1;
const gameWidget = findGameWidget(a0);
if (gameWidget != null) {
value2 = (gameWidget.games ?? []).filter(function({applicationId}) {
return applicationId !== require;
});
replaceWidgetInListBinding = replaceWidgetInList;
BaseGameWidget = (require(5191) /* metro dependency 5191: UserProfileGameWidgetTypes */).BaseGameWidget;
object = {};
copyDataProperties(object, gameWidget, value2);
object['games'] = value2;
value3 = Object.create(BaseGameWidget.prototype, {constructor: {value: BaseGameWidget}});
baseGameWidget = new BaseGameWidget();
(importDefault(5196) /* metro dependency 5196: WidgetActionCreators */).setPendingWidgets(replaceWidgetInListBinding(baseGameWidget instanceof Object ? baseGameWidget : value3));
}
}
function isGameLimitReached({type, games}) { // fn#45823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5039, offset: 0x0119925b, size: 39 bytes, params: 2, frame: 12
return games.length >= widgetMaxGames(type);
}
function areWidgetGamesEqual(a0, a1, a2) { // fn#45824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5147, offset: 0x01199282, size: 54 bytes, params: 4, frame: 12
const env0_0 = a1;
const env0_1 = a2;
return a0.length === a1.length && a0.every(function(a0, a1) {
return _fun45826(a0, require[a1], importDefault);
});
function _fun45825(a0, a1) { // fn#45825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5220, offset: 0x011992b8, size: 39 bytes, params: 3, frame: 15
return areGamesEqual(a0, require[a1], importDefault);
function areGamesEqual(a0, a1, a2) { // fn#45826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5227, offset: 0x011992df, size: 196 bytes, params: 4, frame: 17
var environment;
var normalizeNullishValueBinding;
var comment;
var value2;
var tags;
var value3;
if (a0.applicationId !== a1.applicationId) {
return false;
}
let value = environment.__proto__.__proto__;
if (widgetSupportsComment(a2)) {
normalizeNullishValueBinding = normalizeNullishValue;
comment = a0.comment;
value2 = normalizeNullishValueBinding(comment);
comment = a1.comment;
if (value2 !== normalizeNullishValueBinding(comment)) {
return false;
}
if (widgetSupportsTags(a2)) {
normalizeNullishValueBinding = normalizeNullishValue;
tags = a0.tags;
value = normalizeNullishValueBinding(tags);
tags = a1.tags;
value3 = normalizeNullishValueBinding(tags);
if (value === null !== (value3 === null)) {
return false;
}
if (value === null) {
return true;
}
if (value3 === null) {
return true;
}
if (value.length !== value3.length) {
return false;
}
if (value.every(_fun45827)) {
return true;
}
return false;
}
} else if (widgetSupportsTags(a2)) {
normalizeNullishValueBinding = normalizeNullishValue;
tags = a0.tags;
value = normalizeNullishValueBinding(tags);
tags = a1.tags;
value3 = normalizeNullishValueBinding(tags);
if (value === null !== (value3 === null)) {
return false;
}
if (value === null) {
return true;
}
if (value3 === null) {
return true;
}
if (value.length !== value3.length) {
return false;
}
if (value.every(_fun45827)) {
return true;
}
return false;
}
return true;
function _fun45827(a0, a1) { // fn#45827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5604, offset: 0x00cf4020, size: 23 bytes, params: 3, frame: 2
return a0 === env0_0[a1];
}
}
}
}
function isGameAllowedInGameWidgets(a0) { // fn#45828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:5750, offset: 0x011993a3, size: 84 bytes, params: 2, frame: 14
var GAME_WIDGET_BANNED_APPLICATION_IDS;
let r0 = !isNSFWGame(a0) && !isAgeRestrictedGame(a0);
if (r0) {
GAME_WIDGET_BANNED_APPLICATION_IDS = (require(5192) /* metro dependency 5192: GameWidgetLimits */).GAME_WIDGET_BANNED_APPLICATION_IDS;
r0 = !GAME_WIDGET_BANNED_APPLICATION_IDS.has(a0.id);
}
return r0;
}
}
function _fun45806() { // fn#45806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5371:2501, offset: 0x01198bd9, size: 34 bytes, params: 1, frame: 9
const Math = global.Math;
return 0.5 - Math.random();
}
global.__d(_fun45786, 5193, [57, 1878, 5189, 5194, 5195, 5192, 1244, 5191, 5196, 5197, 5198, 4269, 5203, 5205,
2]) /* metro module 5193, dependencies: [57, 1878, 5189, 5194, 5195, 5192, 1244, 5191, 5196, 5197, 5198, 4269, 5203, 5205, 2] */;