This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,150 @@
// Metro module 8686 (f8687).
import ContentInventoryOutboxStore from "../../content_inventory/ContentInventoryOutboxStore";
import RunningGameStore_native from "../../game_detection/RunningGameStore.native";
import UserProfileStore from "../../user_profile/UserProfileStore";
import GuildStore from "../../../stores/GuildStore";
import PresenceStore from "../../../stores/PresenceStore";
import SocialLayerStorefrontStore from "../SocialLayerStorefrontStore";
import { useStateFromStoresArray, useStateFromStores } from "../../../_bundle/Module589";
import { isGamingLikeEntry } from "../../content_inventory/ContentInventoryTypes";
import { useSlayerStorefrontDevApplicationIdOverride } from "./useSlayerStorefrontDevApplicationIdOverride";
function $mk81154($env) {
return () => {
let r23;
const r0 = [];
let r2 = $env[0][Symbol.iterator]();
const next = r2.next;
const r3 = $env.$parent;
while (true) {
const r10 = r2 === void 0 ? void 0 : (r23 = next.call(r2)).done ? r2 = void 0 : r23.value;
if (r2 === void 0) {
return r0;
}
try {
for (const item of r3[6].getActivities(r10)) {
if (item.application_id != null) {
const applicationIdFromDetectableId = r3[7].getApplicationIdFromDetectableId(item.application_id);
if (applicationIdFromDetectableId != null) {
r0.push(applicationIdFromDetectableId);
}
}
}
} catch (r47) {
if (r2 !== void 0 && typeof r2.return === "function") {
try {
r2.return();
} catch {}
}
throw r47;
}
}
};
}
let $mk81155 = function() {
return () => {
const r0 = [];
for (const item of RunningGameStore_native.getRunningGames()) {
if (item.id != null && RunningGameStore_native.isDetectionEnabled(item)) {
const applicationIdFromDetectableId = SocialLayerStorefrontStore.getApplicationIdFromDetectableId(item.id);
if (applicationIdFromDetectableId != null) {
r0.push(applicationIdFromDetectableId);
}
}
}
return r0;
};
};
let env5661 = {};
export function useUsersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds({ userIds }) {
return useStateFromStoresArray([ContentInventoryOutboxStore, SocialLayerStorefrontStore], () => {
const r0 = [];
for (const userId of userIds) {
let r32 = ContentInventoryOutboxStore.getUserOutbox(userId)?.entries;
if (r32 == null) {
r32 = [];
}
for (const item of r32) {
if (item != null && isGamingLikeEntry(item)) {
const applicationIdFromDetectableId = SocialLayerStorefrontStore.getApplicationIdFromDetectableId(item.extra.application_id);
if (applicationIdFromDetectableId != null) {
r0.push(applicationIdFromDetectableId);
}
}
}
}
return r0;
}, [userIds]);
}
export function useAreUsersInSocialLayerStorefrontMutualGuildsApplicationIds(a0) {
return useStateFromStoresArray([UserProfileStore, SocialLayerStorefrontStore], () => {
const r0 = [];
for (const item of a0) {
const mutualGuilds = UserProfileStore.getMutualGuilds(item);
if (mutualGuilds != null) {
for (const item2 of mutualGuilds) {
if (SocialLayerStorefrontStore.getStorefrontGuildIds().has(item2.guild.id)) {
const applicationIdFromGuildId = SocialLayerStorefrontStore.getApplicationIdFromGuildId(item2.guild.id);
if (applicationIdFromGuildId != null) {
r0.push(applicationIdFromGuildId);
}
}
}
}
}
return r0;
}, [a0]);
}
export function useUsersPlayingStorefrontEnabledGamesApplicationIds(a0) {
let env16724;
const r4 = env16724 = {
$parent: env5661
};
const userIds2 = a0.userIds;
env16724[0] = userIds2;
const stateFromStoresArray = useStateFromStoresArray([PresenceStore, SocialLayerStorefrontStore], $mk81154(r4), [userIds2]);
const slayerStorefrontDevApplicationIdOverride = useSlayerStorefrontDevApplicationIdOverride();
return slayerStorefrontDevApplicationIdOverride != null ? [...stateFromStoresArray, slayerStorefrontDevApplicationIdOverride] : stateFromStoresArray;
}
export function useAreUsersPlayingStorefrontEnabledGames({ userIds: userIds2 }) {
let env16727;
const r4 = env16727 = {
$parent: env5661
};
env16727[0] = userIds2;
const stateFromStoresArray = useStateFromStoresArray([PresenceStore, SocialLayerStorefrontStore], $mk81154(r4), [userIds2]);
const slayerStorefrontDevApplicationIdOverride = useSlayerStorefrontDevApplicationIdOverride();
return (slayerStorefrontDevApplicationIdOverride != null ? [...stateFromStoresArray, slayerStorefrontDevApplicationIdOverride] : stateFromStoresArray).length > 0;
}
export function useCurrentUserPlayedSocialLayerStorefrontGamesApplicationIds() {
return useStateFromStoresArray([RunningGameStore_native, SocialLayerStorefrontStore], () => {
const r0 = [];
for (const item of RunningGameStore_native.getGamesSeen(false, false)) {
if (item.id != null) {
const applicationIdFromDetectableId = SocialLayerStorefrontStore.getApplicationIdFromDetectableId(item.id);
if (applicationIdFromDetectableId != null) {
r0.push(applicationIdFromDetectableId);
}
}
}
return r0;
});
}
export function useCurrentUserPlayingSocialLayerStorefrontGamesApplicationIds() {
return useStateFromStoresArray([RunningGameStore_native, SocialLayerStorefrontStore], $mk81155(), []);
}
export function useIsCurrentUserPlayingSocialLayerStorefrontGames() {
return useStateFromStoresArray([RunningGameStore_native, SocialLayerStorefrontStore], $mk81155(), []).length > 0;
}
export function useIsCurrentUserInSocialLayerStorefrontGuildsApplicationIds() {
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuildIds());
return useStateFromStoresArray([SocialLayerStorefrontStore], () => {
const r0 = [];
for (const stateFromStore of stateFromStores) {
const applicationIdFromGuildId = SocialLayerStorefrontStore.getApplicationIdFromGuildId(stateFromStore);
if (applicationIdFromGuildId != null) {
r0.push(applicationIdFromGuildId);
}
}
return r0;
}, [stateFromStores]);
}
@@ -0,0 +1,55 @@
// Metro module 8685 (f8686).
import { useMemo } from "react";
import SocialLayerStorefrontStore from "../SocialLayerStorefrontStore";
import useDisplayProfile from "../../user_profile/hooks/useDisplayProfile";
import { useUsersPlayingStorefrontEnabledGamesApplicationIds, useUsersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds, useAreUsersInSocialLayerStorefrontMutualGuildsApplicationIds } from "./SocialLayerStorefrontEligibilityHooks";
import { useStateFromStoresArray } from "../../../_bundle/Module589";
import { BaseGameWidget } from "../../user_profile/UserProfileGameWidgetTypes";
import { ApplicationWidget } from "../../user_profile/UserProfileApplicationWidgetTypes";
import { uniq } from "../../../_bundle/Module12";
export default function useDisplayProfileSocialLayerStorefrontApplicationIds({ userId }) {
let usersPlayingStorefrontEnabledGamesApplicationIds, usersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds, areUsersInSocialLayerStorefrontMutualGuildsApplicationIds, stateFromStoresArray;
usersPlayingStorefrontEnabledGamesApplicationIds = void 0;
usersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds = void 0;
areUsersInSocialLayerStorefrontMutualGuildsApplicationIds = void 0;
stateFromStoresArray = void 0;
const displayProfile = useDisplayProfile(userId);
let c16723_0 = displayProfile;
const memo = useMemo(() => c16723_0?.userId != null ? [c16723_0.userId] : [], [displayProfile]);
usersPlayingStorefrontEnabledGamesApplicationIds = useUsersPlayingStorefrontEnabledGamesApplicationIds({
userIds: memo
});
usersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds = useUsersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds({
userIds: memo
});
areUsersInSocialLayerStorefrontMutualGuildsApplicationIds = useAreUsersInSocialLayerStorefrontMutualGuildsApplicationIds(memo);
stateFromStoresArray = useStateFromStoresArray([SocialLayerStorefrontStore], () => {
if (c16723_0?.widgets == null) {
return [];
}
const set = new Set();
let c26271_0 = set;
let r10 = c16723_0?.widgets;
if (r10 == null) {
r10 = [];
}
for (const item of r10) {
const r40 = item instanceof BaseGameWidget;
if (r40) {
item.games.forEach((game) => {
const applicationIdFromDetectableId = SocialLayerStorefrontStore.getApplicationIdFromDetectableId(game.applicationId);
if (applicationIdFromDetectableId != null) {
c26271_0.add(applicationIdFromDetectableId);
}
});
} else if (item instanceof ApplicationWidget) {
const applicationIdFromDetectableId = SocialLayerStorefrontStore.getApplicationIdFromDetectableId(item.applicationId);
if (applicationIdFromDetectableId != null) {
set.add(applicationIdFromDetectableId);
}
}
}
return Array.from(set).sort();
}, [displayProfile]);
return useMemo(() => c16723_0?.application != null ? [] : uniq([...usersPlayingStorefrontEnabledGamesApplicationIds, ...usersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds, ...areUsersInSocialLayerStorefrontMutualGuildsApplicationIds, ...stateFromStoresArray]), [displayProfile?.application, usersPlayingStorefrontEnabledGamesApplicationIds, usersPlayedSocialLayerStorefrontGamesInOutboxApplicationIds, areUsersInSocialLayerStorefrontMutualGuildsApplicationIds, stateFromStoresArray]);
};
@@ -0,0 +1,9 @@
// Metro module 8688 (f8689).
import { useSlayerStorefrontDevOverrideStore } from "./useSlayerStorefrontDevOverrideStore";
export function useSlayerStorefrontDevApplicationIdOverride() {
let r5 = useSlayerStorefrontDevOverrideStore((a0) => a0.overrideApplicationId);
if (r5 == null) {
r5 = void 0;
}
return r5;
}
@@ -0,0 +1,25 @@
// Metro module 8689 (f8690).
import { create } from "../../../_bundle/Module644";
const r15 = create()((c16730_0) => ({
overrideApplicationId: null,
setOverrideApplicationId: (a0) => c16730_0({
overrideApplicationId: a0
}),
showSelfActivity: false,
setShowSelfActivity: (a0) => c16730_0({
showSelfActivity: a0
}),
recommendationApplicationIds: null,
setRecommendationApplicationIds: (a0) => c16730_0({
recommendationApplicationIds: a0 != null ? a0.split(",") : null
}),
overrideNitroEligibilityForSocialLayerStorefront: false,
setOverrideNitroEligibilityForSocialLayerStorefront: (a0) => c16730_0({
overrideNitroEligibilityForSocialLayerStorefront: a0
}),
isNitroEligibleForSocialLayerStorefront: false,
setIsNitroEligibleForSocialLayerStorefront: (a0) => c16730_0({
isNitroEligibleForSocialLayerStorefront: a0
})
}));
export { r15 as useSlayerStorefrontDevOverrideStore };