// Module ID: 8709 // Function ID: 8710 // Name: useShouldOpenGameProfileModal // Dependencies: [19, 1916, 1074, 1242, 1384, 8710, 5126, 8711, 38, 2] // Exports: default, gameIdIsAcceptable, gameIsAcceptable, trackEntryPoint // Module 8709 (useShouldOpenGameProfileModal) import _modDef38 from "module_38" /* 38 */; import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */; import FlagUtilsAll from "FlagUtils" /* 1384 */; import utils from "utils" /* 5126 */; import GameFlags from "GameFlags" /* 8710 */; import noop from "module_19" /* 19 */; import GameStore from "GameStore" /* 1916 */; const require = globalThis.__r; require = fn; const AnalyticEvents = fn(1074).AnalyticEvents; const RejectionReason = { NoMatch: "no match", NSFW: "nsfw", Disabled: "profile disabled", Obscured: "obscured" }; const size = fn(2); const result = size.fileFinishedImporting("modules/game_profile/hooks/useShouldOpenGameProfileModal.tsx"); export default function useShouldOpenGameProfileModal(applicationId) { let str = applicationId.applicationId; if (str === undefined) { str = ""; } const source = applicationId.source; ({ trackEntryPointImpression, gameId } = applicationId); if (trackEntryPointImpression === undefined) { trackEntryPointImpression = true; } let gameRecord; let isLoading; importAll = isLoading.useRef(false); const gameId2 = trackEntryPointImpression(gameRecord[7])({ applicationId: str, gameId }); gameRecord = gameId2.gameRecord; isLoading = gameId2.isLoading; let shouldOpenGameProfile = null != gameRecord; if (shouldOpenGameProfile) { shouldOpenGameProfile = !require("FlagUtils").hasFlag(gameRecord.gameFlags, source(tmp[5]).GameFlags.GAME_PROFILE_DISABLED); const obj2 = require("FlagUtils"); } let items = [gameRecord, shouldOpenGameProfile, isLoading, source, trackEntryPointImpression]; const effect = isLoading.useEffect(() => { let current = ref.current; if (!current) { current = !trackEntryPointImpression; } if (!current) { current = isLoading; } if (!current) { current = null == gameRecord; } if (!current) { let track = importDefault; let GAME_PROFILE_ENTRY_POINT_AVAILABLE = dependencyMap; _modDef38(null != source, "Cannot track a Game Profile Entry Point Impressions without a source."); let flag = shouldOpenGameProfile; if (null == gameRecord) { const items = [obj.NoMatch]; let tmp11 = items; } else { const items1 = []; if (obj3.hasFlag(tmp8.gameFlags, GameFlags.GameFlags.GAME_PROFILE_DISABLED)) { items1.push(obj.Disabled); } obj3 = FlagUtilsAll; tmp11 = items1; if (tmp19Result.isAgeRestrictedContentClassification(tmp8.contentClassification)) { items1.push(obj.NSFW); tmp11 = items1; } tmp19Result = utils; } track = track(1242).track; GAME_PROFILE_ENTRY_POINT_AVAILABLE = AnalyticEvents.GAME_PROFILE_ENTRY_POINT_AVAILABLE; obj = { game_profile_available: flag, application_id: gameRecord.id, rejection_reason: tmp11, source }; track(GAME_PROFILE_ENTRY_POINT_AVAILABLE, obj); flag = true; ref.current = true; const trackResult = track(1242); } }, items); return { shouldOpenGameProfile, gameId: gameId2.gameId }; }; export { RejectionReason }; export const trackEntryPoint = function trackEntryPoint(game_profile_available, id, items, CallTile) { if (items === undefined) { items = []; } AnalyticsUtilsDefault.track(AnalyticEvents.GAME_PROFILE_ENTRY_POINT_AVAILABLE, { game_profile_available, application_id: id, rejection_reason: items, source: CallTile }); }; export const gameIsAcceptable = function gameIsAcceptable(gameFlags) { if (null == gameFlags) { const items = [obj.NoMatch]; let arr = items; } else { const items1 = []; if (obj2.hasFlag(gameFlags.gameFlags, GameFlags.GameFlags.GAME_PROFILE_DISABLED)) { items1.push(obj.Disabled); } obj2 = FlagUtilsAll; arr = items1; if (tmp8Result.isAgeRestrictedContentClassification(gameFlags.contentClassification)) { items1.push(obj.NSFW); arr = items1; } tmp8Result = utils; } return 0 === arr.length; }; export const gameIdIsAcceptable = function gameIdIsAcceptable(gameId) { const game = GameStore.getGame(gameId); if (null == game) { const items = [obj.NoMatch]; let arr = items; } else { const items1 = []; if (obj2.hasFlag(game.gameFlags, GameFlags.GameFlags.GAME_PROFILE_DISABLED)) { items1.push(obj.Disabled); } obj2 = FlagUtilsAll; arr = items1; if (tmp9Result.isAgeRestrictedContentClassification(game.contentClassification)) { items1.push(obj.NSFW); arr = items1; } tmp9Result = utils; } return 0 === arr.length; };