decord/source/modules/user_profile/native/UserProfileApplicationWidgetCard.tsx

250 lines
9.6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 12556
// Function ID: 12557
2026-07-23 10:11:24 +00:00
// Name: UserProfileApplicationWidgetCard
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 1996, 1218, 21, 4380, 712, 12557, 12558, 12648, 12649, 12650, 12651, 589, 12559, 1367, 5840, 6033, 9420, 9431, 12652, 5837, 12642, 9049, 5881, 7230, 11580, 4376, 1236, 2]
2026-07-23 10:11:24 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 12556 (UserProfileApplicationWidgetCard)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "_getSystemLocale" /* 1996 */;
2026-08-24 06:08:38 +00:00
import closure_8 from "fetchFingerprint" /* 1218 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ Image: c4, Pressable: c5, View: closure_6 } = get_ActivityIndicator);
({ jsx: c9, jsxs: c10 } = jsxProd);
createCacheKey = { appIcon: null, header: null, divider: null, stillSyncing: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { width: 16, height: 16, borderRadius: ThemesDefault.radii.xs, overflow: "hidden" };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { flexDirection: "row", alignItems: "center", gap: ThemesDefault.space.PX_4 };
let obj1 = { flexDirection: "row", alignItems: "center", gap: ThemesDefault.space.PX_4 };
createCacheKey[2] = { borderBottomWidth: 1, borderBottomColor: ThemesDefault.colors.BORDER_SUBTLE, marginBottom: ThemesDefault.space.PX_24 };
let obj2 = { borderBottomWidth: 1, borderBottomColor: ThemesDefault.colors.BORDER_SUBTLE, marginBottom: ThemesDefault.space.PX_24 };
createCacheKey[3] = { flexDirection: "row", alignItems: "center", gap: ThemesDefault.space.PX_4 };
let closure_11 = createCacheKey.createStyles(createCacheKey);
let obj3 = { flexDirection: "row", alignItems: "center", gap: ThemesDefault.space.PX_4 };
let result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileApplicationWidgetCard.tsx");
2026-07-23 10:11:24 +00:00
export default function UserProfileApplicationWidgetCard(userId) {
userId = userId.userId;
({ widget, cardStyle, isFirstWidget } = userId);
if (isFirstWidget === undefined) {
isFirstWidget = false;
}
let stateFromStores;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-08-13 07:00:46 +00:00
let token;
2026-08-24 06:08:38 +00:00
let tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = userId(589);
2026-08-24 06:08:38 +00:00
const items = [closure_7];
2026-07-29 08:29:29 +00:00
stateFromStores = obj.useStateFromStores(items, () => locale.locale);
2026-07-23 10:11:24 +00:00
const items1 = [stateFromStores];
2026-08-25 06:04:03 +00:00
const memo = token.useMemo(() => userId(12559).createCompactNumberFormat(stateFromStores), items1);
2026-08-24 06:08:38 +00:00
obj1 = userId(589);
const items2 = [closure_8];
const stateFromStores1 = obj1.useStateFromStores(items2, () => closure_1_8.getId() === userId);
2026-08-11 06:20:06 +00:00
const tmp8 = stateFromStores(1367)("UserProfileCard");
2026-08-25 06:04:03 +00:00
let obj2 = userId(5840);
2026-07-23 10:11:24 +00:00
const getOrFetchApplication = obj2.useGetOrFetchApplication(widget.applicationId);
let iconURL;
2026-07-29 08:29:29 +00:00
if (getOrFetchApplication != null) {
2026-07-23 10:11:24 +00:00
iconURL = getOrFetchApplication.getIconURL(16);
}
2026-08-25 06:04:03 +00:00
let tmp2Result = tmp2(6033);
2026-07-23 10:11:24 +00:00
let canonicalGameId;
2026-07-29 08:29:29 +00:00
if (getOrFetchApplication != null) {
2026-07-23 10:11:24 +00:00
canonicalGameId = getOrFetchApplication.getCanonicalGameId();
}
2026-07-29 08:29:29 +00:00
const data = tmp2Result.useGame(canonicalGameId).data;
2026-07-23 10:11:24 +00:00
let id;
2026-08-25 06:04:03 +00:00
let tmp7Result = tmp7(9420);
2026-07-29 08:29:29 +00:00
if (data != null) {
2026-07-23 10:11:24 +00:00
id = data.id;
}
2026-08-25 06:04:03 +00:00
obj = { location: "UserProfileApplicationWidgetCard", applicationId: id, source: tmp2(9431).GameProfileSources.UserProfileApplicationWidget, sourceUserId: userId, trackEntryPointImpression: true, stackingBehavior: "stack" };
2026-07-29 08:29:29 +00:00
const tmp7ResultResult = tmp7Result(obj);
dependencyMap = tmp7ResultResult;
2026-08-25 06:04:03 +00:00
({ surfaceConfigs, resolutionContext, isLoading, hasIdentity } = stateFromStores(12652)(userId, widget.applicationId));
const tmp15 = stateFromStores(5837)(getOrFetchApplication);
2026-08-13 07:00:46 +00:00
token = tmp15.token;
({ fetched, canStartAuthorization } = tmp15);
2026-08-25 06:04:03 +00:00
const tmp16 = surfaceConfigs[userId(undefined, 12642).ApplicationWidgetConfigSurface.WIDGET_TOP];
const tmp17 = surfaceConfigs[userId(undefined, 12642).ApplicationWidgetConfigSurface.WIDGET_BOTTOM];
2026-08-13 07:00:46 +00:00
let tmp18 = null;
2026-07-23 10:11:24 +00:00
if (null != iconURL) {
2026-07-29 08:29:29 +00:00
obj = { source: null, style: null };
obj1 = { uri: null };
obj1[0] = iconURL;
obj[0] = obj1;
obj[1] = tmp.appIcon;
2026-08-13 07:00:46 +00:00
tmp18 = callback(closure_4, obj);
2026-07-23 10:11:24 +00:00
}
if (stateFromStores1) {
if (!isLoading) {
if (!hasIdentity) {
2026-08-13 07:00:46 +00:00
let tmp21 = null != token;
if (tmp21) {
const _Array = Array;
2026-08-25 06:04:03 +00:00
let someResult = Array.from(tmp2(9049).OAuth2ScopesSets.APPLICATION_IDENTITIES_SCOPES).some((arg0) => {
2026-08-13 07:00:46 +00:00
const scopes = token.scopes;
return scopes.includes(arg0);
});
if (!someResult) {
let scopes = token.scopes;
2026-08-25 06:04:03 +00:00
someResult = scopes.includes(tmp2(9049).OAuth2Scopes.SDK_SOCIAL_LAYER);
2026-08-13 07:00:46 +00:00
}
if (!someResult) {
const scopes2 = token.scopes;
2026-08-25 06:04:03 +00:00
someResult = scopes2.includes(tmp2(9049).OAuth2Scopes.SDK_SOCIAL_LAYER_PRESENCE);
2026-08-13 07:00:46 +00:00
}
tmp21 = someResult;
2026-08-25 06:04:03 +00:00
const arr = Array.from(tmp2(9049).OAuth2ScopesSets.APPLICATION_IDENTITIES_SCOPES);
2026-08-13 07:00:46 +00:00
}
if (fetched) {
if (canStartAuthorization) {
let tmp24 = null;
}
return tmp24;
}
2026-07-29 08:29:29 +00:00
obj2 = { style: null, title: null, titleLeadingIcon: null, children: null };
obj2[0] = cardStyle;
2026-08-25 06:04:03 +00:00
tmp7Result = tmp7(5881);
tmp2Result = tmp2(7230);
2026-07-29 08:29:29 +00:00
obj2[1] = tmp2Result.getWidgetTitle(widget);
2026-08-13 07:00:46 +00:00
obj2[2] = tmp18;
2026-07-29 08:29:29 +00:00
const obj3 = { style: null, children: null };
obj3[0] = tmp.stillSyncing;
const obj4 = { size: "xs", color: null };
obj4[1] = tmp7(712).colors.TEXT_MUTED;
2026-08-25 06:04:03 +00:00
const items3 = [callback(tmp2(11580).HourglassIcon, obj4), ];
2026-07-29 08:29:29 +00:00
const obj5 = { variant: "text-sm/medium", color: "text-muted", children: null };
const intl = tmp2(1236).intl;
obj5[2] = intl.string(tmp2(1236).t.z5K4Uv);
2026-08-25 06:04:03 +00:00
items3[1] = callback(tmp2(4376).Text, obj5);
2026-07-29 08:29:29 +00:00
obj3[1] = items3;
obj2[3] = callback2(closure_6, obj3);
2026-08-13 07:00:46 +00:00
tmp24 = callback(tmp7Result, obj2);
2026-07-23 10:11:24 +00:00
}
}
}
2026-08-25 06:04:03 +00:00
const tmp14 = stateFromStores(12652)(userId, widget.applicationId);
const result = userId(12559).bindResolveFieldValue(resolutionContext);
2026-07-23 10:11:24 +00:00
const obj6 = {
style: tmp.header,
onPress() {
let tmp;
2026-08-24 06:08:38 +00:00
if (dependencyMap != null) {
tmp = dependencyMap();
2026-07-23 10:11:24 +00:00
}
return tmp;
},
2026-07-29 08:29:29 +00:00
disabled: null == tmp7ResultResult,
accessibilityRole: "button",
accessibilityLabel: null,
children: null
2026-07-23 10:11:24 +00:00
};
2026-08-25 06:04:03 +00:00
const tmp2Result1 = userId(12559);
2026-08-13 07:00:46 +00:00
const tmp31 = closure_5;
2026-08-25 06:04:03 +00:00
obj6[4] = userId(7230).getWidgetTitle(widget);
2026-08-13 07:00:46 +00:00
const items4 = [tmp18, ];
2026-07-29 08:29:29 +00:00
let str = "text-sm/semibold";
if (tmp8) {
str = "text-sm/medium";
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
const obj7 = { variant: str, color: null, lineClamp: 1, children: null };
let str2 = "text-default";
if (tmp8) {
str2 = "text-strong";
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
obj7[1] = str2;
2026-08-25 06:04:03 +00:00
const tmp2Result2 = userId(7230);
obj7[3] = userId(7230).getWidgetTitle(widget);
items4[1] = callback(userId(4376).Text, obj7);
2026-07-29 08:29:29 +00:00
obj6[5] = items4;
2026-08-13 07:00:46 +00:00
let tmp30Result = tmp30(tmp31, obj6);
if (tmp16 != null) {
let layout = tmp16.layout;
2026-07-23 10:11:24 +00:00
}
2026-08-13 07:00:46 +00:00
let tmp32Result = null;
if (null != tmp16) {
2026-08-25 06:04:03 +00:00
if (tmp2(12557).ApplicationWidgetLayoutName.WIDGET_TOP_HERO === layout) {
2026-07-29 08:29:29 +00:00
const obj8 = { header: null, topConfig: null, resolveFieldValue: null, numberFormat: null };
2026-08-13 07:00:46 +00:00
obj8[0] = tmp30Result;
obj8[1] = tmp16;
2026-07-29 08:29:29 +00:00
obj8[2] = result;
obj8[3] = memo;
2026-08-25 06:04:03 +00:00
tmp32Result = tmp32(tmp7(12558), obj8);
2026-07-23 10:11:24 +00:00
} else {
2026-08-13 07:00:46 +00:00
tmp32Result = null;
2026-08-25 06:04:03 +00:00
if (tmp2(12557).ApplicationWidgetLayoutName.WIDGET_TOP_CONTAINED === layout) {
2026-07-29 08:29:29 +00:00
const obj9 = { header: null, topConfig: null, resolveFieldValue: null, numberFormat: null };
2026-08-13 07:00:46 +00:00
obj9[0] = tmp30Result;
obj9[1] = tmp16;
2026-07-29 08:29:29 +00:00
obj9[2] = result;
obj9[3] = memo;
2026-08-25 06:04:03 +00:00
tmp32Result = tmp32(tmp7(12648), obj9);
2026-07-23 10:11:24 +00:00
}
}
}
2026-08-13 07:00:46 +00:00
if (tmp17 != null) {
const layout2 = tmp17.layout;
2026-07-23 10:11:24 +00:00
}
2026-08-13 07:00:46 +00:00
tmp32Result = null;
if (null != tmp17) {
2026-08-25 06:04:03 +00:00
if (tmp2(12557).ApplicationWidgetLayoutName.WIDGET_BOTTOM_STATS === layout2) {
2026-07-29 08:29:29 +00:00
const obj10 = { bottomConfig: null, resolveFieldValue: null, numberFormat: null };
2026-08-13 07:00:46 +00:00
obj10[0] = tmp17;
2026-07-29 08:29:29 +00:00
obj10[1] = result;
obj10[2] = memo;
2026-08-25 06:04:03 +00:00
tmp32Result = tmp32(tmp7(12649), obj10);
} else if (tmp2(12557).ApplicationWidgetLayoutName.WIDGET_BOTTOM_PROGRESS === layout2) {
2026-07-29 08:29:29 +00:00
const obj11 = { bottomConfig: null, resolveFieldValue: null };
2026-08-13 07:00:46 +00:00
obj11[0] = tmp17;
2026-07-29 08:29:29 +00:00
obj11[1] = result;
2026-08-25 06:04:03 +00:00
tmp32Result = tmp32(tmp7(12650), obj11);
2026-07-23 10:11:24 +00:00
} else {
2026-08-13 07:00:46 +00:00
tmp32Result = null;
2026-08-25 06:04:03 +00:00
if (tmp2(12557).ApplicationWidgetLayoutName.WIDGET_BOTTOM_COLLECTION === layout2) {
2026-07-29 08:29:29 +00:00
const obj12 = { bottomConfig: null, resolveFieldValue: null };
2026-08-13 07:00:46 +00:00
obj12[0] = tmp17;
2026-07-29 08:29:29 +00:00
obj12[1] = result;
2026-08-25 06:04:03 +00:00
tmp32Result = tmp32(tmp7(12651), obj12);
2026-07-23 10:11:24 +00:00
}
}
}
2026-08-13 07:00:46 +00:00
tmp30Result = null;
if (null != tmp32Result) {
tmp30Result = null;
if (null != tmp32Result) {
2026-07-24 07:16:23 +00:00
const items5 = [cardStyle, ];
if (isFirstWidget) {
2026-07-29 08:29:29 +00:00
layout = undefined;
2026-08-13 07:00:46 +00:00
if (tmp16 != null) {
layout = tmp16.layout;
2026-07-24 07:16:23 +00:00
}
2026-08-25 06:04:03 +00:00
isFirstWidget = layout === tmp2(12557).ApplicationWidgetLayoutName.WIDGET_TOP_HERO;
2026-07-24 07:16:23 +00:00
}
if (isFirstWidget) {
2026-07-29 08:29:29 +00:00
const obj13 = { marginTop: null };
2026-08-25 06:04:03 +00:00
obj13[0] = tmp2(12558).HERO_IMAGE_UNCLIPPED_TOP_BLEED;
2026-07-29 08:29:29 +00:00
isFirstWidget = obj13;
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
const obj14 = { style: null, children: null };
2026-07-24 07:16:23 +00:00
items5[1] = isFirstWidget;
2026-07-29 08:29:29 +00:00
obj14[0] = items5;
2026-08-13 07:00:46 +00:00
const items6 = [tmp32Result, , ];
2026-07-29 08:29:29 +00:00
const obj15 = { style: null };
obj15[0] = tmp.divider;
2026-08-13 07:00:46 +00:00
items6[1] = tmp32(closure_6, obj15);
items6[2] = tmp32Result;
2026-07-29 08:29:29 +00:00
obj14[1] = items6;
2026-08-25 06:04:03 +00:00
tmp30Result = tmp30(tmp7(5881), obj14);
const tmp7Result1 = tmp7(5881);
2026-07-23 10:11:24 +00:00
}
}
2026-08-13 07:00:46 +00:00
return tmp30Result;
2026-07-23 10:11:24 +00:00
};