decord/source/modules/group_dm/native/GroupDMAvatar.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

135 lines
5.3 KiB
TypeScript

// Module ID: 11002
// Function ID: 11003
// Name: GroupDMAvatar
// Dependencies: [19, 17, 1371, 21, 1178, 4606, 8905, 504, 1369, 2]
// Exports: default
// Module 11002 (GroupDMAvatar)
import GlobalUtils from "GlobalUtils" /* 1369 */;
import ClipView from "ClipView" /* 8905 */;
import noop from "module_19" /* 19 */;
import UserStore from "UserStore" /* 1371 */;
require = fn;
class FacepileGroupDMAvatar {
constructor(arg0) {
({ size, animate, users, sources, pileSizeOverride } = global);
closure_0 = undefined;
closure_1 = undefined;
({ style, status, accessible, accessibilityLabel } = global);
tmp = closure_8();
tmp2 = closure_0;
tmp3 = closure_1;
tmp4 = closure_0(closure_1[4]).AVATAR_SIZE_MAP[size];
closure_0 = tmp4;
obj = closure_2;
items = [];
items[0] = tmp4;
memo = closure_2.useMemo(() => {
const size = { width: height, height };
return size;
}, items);
if (pileSizeOverride == null) {
tmp6 = closure_7;
pileSizeOverride = closure_7[size];
}
tmp7 = tmp2(tmp3[4]).AVATAR_SIZE_MAP[pileSizeOverride];
closure_1 = tmp7;
items1 = [, ];
items1[0] = tmp4;
items1[1] = tmp7;
obj1 = { style: null, accessible, accessibilityLabel, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: null };
items2 = [, ];
items2[0] = memo;
items2[1] = style;
obj1.style = items2;
tmp11 = jsx;
memo1 = obj.useMemo(() => {
const result = closure_1 / 2;
const sum = result + 3;
const result1 = 2 * sum;
const sqrtResult = Math.sqrt(2 * Math.pow(sum, 2));
const diff = closure_0 - result - closure_1;
const sqrtResult1 = Math.sqrt(2 * Math.pow(diff, 2));
const sum1 = -sqrtResult - (sum - sqrtResult) - sqrtResult1 + (sqrtResult1 - diff);
obj = { nativeCutouts: null };
const point = { shape: ClipView.CutoutShape.Circle, x: closure_1 - result1 - sum1, y: closure_1 - result1 - sum1, size: result1 };
const items = [point];
obj.nativeCutouts = items;
return obj;
}, items1);
tmp9 = jsxs;
tmp10 = View;
obj9 = { style: tmp.firstFace, size: pileSizeOverride, guildId: "r", cutout: 0, animate: "absolute" };
obj9.cutout = memo1;
obj9.animate = animate;
if (null == users) {
obj10 = { source: null };
obj10.source = sources[0];
obj11 = obj10;
} else {
obj11 = { user: null };
obj11.user = users[0];
}
merged = Object.assign(obj11);
items3 = [, ];
items3[0] = tmp11(tmp2(tmp3[4]).Avatar, obj9);
obj12 = { status, statusSizeOverride: tmp2(tmp3[4]).StatusSizes.REFRESH_MEDIUM_10, autoStatusCutout: true, style: tmp.secondFace, size: pileSizeOverride, guildId: "Array", animate: "Gift Recipient ID" };
obj12.animate = animate;
if (null == users) {
obj13 = { source: null };
obj13.source = sources[1];
obj14 = obj13;
} else {
obj14 = { user: null };
obj14.user = users[1];
}
merged1 = Object.assign(obj14);
items3[1] = tmp11(tmp2(tmp3[4]).Avatar, obj12);
obj1.children = items3;
return tmp9(tmp10, obj1);
}
}
const View = fn(17).View;
const jsxProd = fn(21);
({ jsx: hasOwnProperty, jsxs: metroRequire } = jsxProd);
let obj = {};
obj[fn(1178).AvatarSizes.LARGE_48] = fn(1178).AvatarSizes.SMALL;
obj[fn(1178).AvatarSizes.XLARGE] = fn(1178).AvatarSizes.NORMAL;
obj[fn(1178).AvatarSizes.XXLARGE] = fn(1178).AvatarSizes.LARGE;
obj[fn(1178).AvatarSizes.PROFILE] = fn(1178).AvatarSizes.XXLARGE;
obj[fn(1178).AvatarSizes.REFRESH_MEDIUM_32] = fn(1178).AvatarSizes.XSMALL_20;
obj[fn(1178).AvatarSizes.XSMALL] = fn(1178).AvatarSizes.SIZE_16;
obj[fn(1178).AvatarSizes.SIZE_16] = fn(1178).AvatarSizes.XXSMALL_10;
obj[fn(1178).AvatarSizes.NORMAL] = fn(1178).AvatarSizes.XSMALL;
const createStyles = fn(4606);
const React6 = createStyles.createStyles({ firstFace: { position: "absolute", top: 0, left: 0 }, secondFace: { position: "absolute", bottom: 0, right: 0 } });
let size = fn(2);
let result = size.fileFinishedImporting("modules/group_dm/native/GroupDMAvatar.tsx");
export default function GroupDMAvatar(pileSizeOverride) {
({ style, channel } = pileSizeOverride);
({ size, animate, status, accessible, accessibilityLabel } = pileSizeOverride);
const items = [UserStore];
const stateFromStoresArray = channel(504).useStateFromStoresArray(items, () => {
const recipients = channel.recipients;
const mapped = recipients.map((item) => user.getUser(item));
return mapped.filter(GlobalUtils.isNotNullish);
});
if (null == channel.icon) {
if (0 !== channel.recipients.length) {
if (0 !== stateFromStoresArray.length) {
if (1 === stateFromStoresArray.length) {
const obj2 = { autoStatusCutout: true, status, style, size, user: stateFromStoresArray[0], guildId: "a", animate, accessible, accessibilityLabel };
let tmp5 = closure_5(tmp(1178).Avatar, obj2);
} else {
const obj3 = { status, style, size, animate, users: stateFromStoresArray, pileSizeOverride: pileSizeOverride.pileSizeOverride, accessible, accessibilityLabel };
tmp5 = closure_5(FacepileGroupDMAvatar, obj3);
}
}
return tmp5;
}
}
tmp5 = closure_5(tmp(1178).Avatar, { autoStatusCutout: true, status, style, size, channel, animate, accessible, accessibilityLabel });
};
export { FacepileGroupDMAvatar };