356 lines
20 KiB
TypeScript
356 lines
20 KiB
TypeScript
/* Metro module 12745; source: design/void/Avatar/native/Avatar.tsx; dependencies: [31, 27, 661, 1306, 33, 4501, 697, 10252, 12734, 12735, 7599, 8396, 12746, 7598, 12736, 4580, 10695, 10696, 2] */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as StatusConstantsModule from '../../Status/native/StatusConstants.tsx'; /* Metro dependency 1306 */
|
|
import * as CreateStylesModule from '../../../components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as ClipViewModule from '../../../components/Icon/native/ClipView.tsx'; /* Metro dependency 7599 */
|
|
import * as AvatarDecorationUtilsModule from '../../../../modules/collectibles/avatar_decorations/native/AvatarDecorationUtils.tsx'; /* Metro dependency 8396 */
|
|
import * as CutoutableAvatarImageModule from '../../CutoutableAvatarImage/native/CutoutableAvatarImage.tsx'; /* Metro dependency 10252 */
|
|
|
|
function _fun97486(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:6, offset: 0x0218357c, size: 321 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getStatusSize_974872 = getStatusSize_97487;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const env0_10 = (CreateStylesModule).createStyles(_fun97489);
|
|
value = value.memo(_fun97490);
|
|
(FileImportTrackerModule).fileFinishedImporting('design/void/Avatar/native/Avatar.tsx');
|
|
exports.default = value;
|
|
const AvatarSizes = (CutoutableAvatarImageModule).AvatarSizes;
|
|
exports.AvatarSizes = AvatarSizes;
|
|
exports.getStatusSize = getStatusSize_974872;
|
|
function getStatusSize_97487(a0) { // fn#97487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:795, offset: 0x021836bd, size: 555 bytes, params: 2, frame: 14
|
|
const AvatarSizes = (CutoutableAvatarImageModule).AvatarSizes;
|
|
const XXSMALL = AvatarSizes.XXSMALL;
|
|
if (XXSMALL === a0) {
|
|
return StatusSizes.SMALL;
|
|
}
|
|
const XSMALL = AvatarSizes.XSMALL;
|
|
if (XSMALL === a0) {
|
|
return StatusSizes.SMALL;
|
|
}
|
|
const XSMALL_20 = AvatarSizes.XSMALL_20;
|
|
if (XSMALL_20 === a0) {
|
|
return StatusSizes.SMALL;
|
|
}
|
|
const SMALL = AvatarSizes.SMALL;
|
|
if (SMALL === a0) {
|
|
return StatusSizes.SMALL;
|
|
}
|
|
const REFRESH_MEDIUM_32 = AvatarSizes.REFRESH_MEDIUM_32;
|
|
if (REFRESH_MEDIUM_32 === a0) {
|
|
return StatusSizes.REFRESH_MEDIUM_10;
|
|
}
|
|
const NORMAL = AvatarSizes.NORMAL;
|
|
if (NORMAL === a0) {
|
|
return StatusSizes.MEDIUM;
|
|
}
|
|
const TABS_22 = AvatarSizes.TABS_22;
|
|
if (TABS_22 === a0) {
|
|
return StatusSizes.MEDIUM;
|
|
}
|
|
const LARGE = AvatarSizes.LARGE;
|
|
if (LARGE === a0) {
|
|
return StatusSizes.MEDIUM;
|
|
}
|
|
const LARGE_48 = AvatarSizes.LARGE_48;
|
|
if (LARGE_48 === a0) {
|
|
return StatusSizes.MEDIUM;
|
|
}
|
|
const XLARGE = AvatarSizes.XLARGE;
|
|
if (XLARGE === a0) {
|
|
return StatusSizes.LARGE;
|
|
}
|
|
const XLARGE_72 = AvatarSizes.XLARGE_72;
|
|
if (XLARGE_72 === a0) {
|
|
return StatusSizes.LARGE;
|
|
}
|
|
const XXLARGE = AvatarSizes.XXLARGE;
|
|
if (XXLARGE === a0) {
|
|
return StatusSizes.LARGE;
|
|
}
|
|
const PROFILE = AvatarSizes.PROFILE;
|
|
if (PROFILE === a0) {
|
|
return StatusSizes.LARGE;
|
|
}
|
|
const YOUBAR_60 = AvatarSizes.YOUBAR_60;
|
|
if (YOUBAR_60 === a0) {
|
|
return StatusSizes.LARGE;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function getAvatarDecorationMargin(a0) { // fn#97488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:1397, offset: 0x021838e8, size: 79 bytes, params: 2, frame: 14
|
|
let value = AvatarDecorationUtilsModule;
|
|
value = value.getDecorationSizeForAvatarSize(a0);
|
|
const styles = (CutoutableAvatarImageModule).styles;
|
|
return (value - styles[a0].width) / 2;
|
|
}
|
|
|
|
function _fun97489(a0) { // fn#97489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:239, offset: 0x02183937, size: 232 bytes, params: 2, frame: 18
|
|
const object = {status: {'position': 'absolute', 'right': -3, 'bottom': -3}};
|
|
const STATUS_SPEAKING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_SPEAKING;
|
|
object.speaking = {'position': 'absolute', 'right': -2, 'bottom': -2, 'backgroundColor': 'transparent',
|
|
'borderWidth': 4, borderColor: STATUS_SPEAKING};
|
|
object.stageSpeaking = {'position': 'absolute', 'right': -2, 'bottom': -2};
|
|
const object3 = {'width': 24, 'height': 24, 'justifyContent': 'center', 'alignItems': 'center',
|
|
'backgroundColor': null, 'borderRadius': null, 'right': 0, 'bottom': 0};
|
|
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
|
|
object3.backgroundColor = RED_400;
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object.voiceStatus = object3;
|
|
const object4 = {position: 'absolute'};
|
|
const getAvatarDecorationMarginBinding = getAvatarDecorationMargin;
|
|
object4.top = -getAvatarDecorationMarginBinding(a0);
|
|
object4.left = -getAvatarDecorationMarginBinding(a0);
|
|
object.decoration = object4;
|
|
object.container = {position: 'relative'};
|
|
return object;
|
|
}
|
|
|
|
function _fun97490({channel, streaming, isMobileOnline, isVROnline, status, size = require(dependencyMap[7]).AvatarSizes.NORMAL, animate, speaking, avatarDecoration, mute, deaf, statusStyle, avatarStyle, style, cutout, autoStatusCutout, isStageCall, source, user, guildId, disablePlaceholder, needsOffscreenAlphaCompositing, accessible, accessibilityLabel, typing, statusSizeOverride}) { // fn#97490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:1526, offset: 0x02183a1f, size: 1543 bytes, params: 2, frame: 47
|
|
var r23;
|
|
var r7;
|
|
var r16;
|
|
var value14;
|
|
var object2;
|
|
streaming = !(streaming === undefined) && streaming;
|
|
isMobileOnline = !(isMobileOnline === undefined) && isMobileOnline;
|
|
isVROnline = !(isVROnline === undefined) && isVROnline;
|
|
const size2 = size;
|
|
animate = !(animate === undefined) && animate;
|
|
speaking = !(speaking === undefined) && speaking;
|
|
isStageCall = !(isStageCall === undefined) && isStageCall;
|
|
needsOffscreenAlphaCompositing = !(needsOffscreenAlphaCompositing === undefined) && needsOffscreenAlphaCompositing;
|
|
typing = !(typing === undefined) && typing;
|
|
const styles = useStyles(size);
|
|
const {cutout, decorationCutout} = size2.useMemo(_fun97491, [cutoutBinding, autoStatusCutout, isMobileOnline,
|
|
isVROnline, size, status, typing, statusSizeOverride, styles]);
|
|
const items2 = [(require(10252) /* metro dependency 10252: CutoutableAvatarImage */).styles[size]];
|
|
items2[1] = styles.container;
|
|
items2[2] = style;
|
|
if (speaking) {
|
|
value14 = (require(10252) /* metro dependency 10252: CutoutableAvatarImage */).AVATAR_SIZE_MAP[size] + 4;
|
|
r23 = (
|
|
isStageCall
|
|
? ((Component) => <Component style={[styles.stageSpeaking, {width: value14, height: value14,
|
|
borderRadius: value14 / 2}]} />)(importDefault(12746) /* metro dependency 12746: SpeakerPulse */)
|
|
: (
|
|
<View style={[styles.speaking, {width: value14, height: value14, borderRadius: value14 / 2}]} />
|
|
)
|
|
);
|
|
} else {
|
|
r23 = null;
|
|
}
|
|
const items4 = [r23];
|
|
items4[1] = (
|
|
source != null || user != null
|
|
? (
|
|
source != null
|
|
? ((Component) => <Component source={source} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: (
|
|
user != null
|
|
? ((Component) => <Component user={user} guildId={guildId} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: (
|
|
channel != null
|
|
? ((Component) => <Component channel={channel} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: undefined
|
|
)
|
|
)
|
|
)
|
|
: (
|
|
channel == null
|
|
? null
|
|
: (
|
|
source != null
|
|
? ((Component) => <Component source={source} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: (
|
|
user != null
|
|
? ((Component) => <Component user={user} guildId={guildId} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: (
|
|
channel != null
|
|
? ((Component) => <Component channel={channel} size={size} animate={animate} disablePlaceholder={disablePlaceholder} style={avatarStyle} cutout={cutoutBinding} />)(importDefault(10252) /* metro dependency 10252: CutoutableAvatarImage */)
|
|
: undefined
|
|
)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
items4[2] = (
|
|
avatarDecoration == null
|
|
? null
|
|
: ((Component) => <Component size={(require(8396) /* metro dependency 8396: AvatarDecorationUtils */).getDecorationSizeForAvatarSize(size)} avatarDecoration={avatarDecoration} decorationStyle={styles.decoration} animate={animate} cutout={decorationCutout} key={avatarDecoration.asset} />)(importDefault(7598) /* metro dependency 7598: CutoutableAvatarDecoration */)
|
|
);
|
|
if (status == null) {
|
|
r7 = null;
|
|
} else if (status === StatusTypes.UNKNOWN) {
|
|
r7 = null;
|
|
} else {
|
|
size = statusSizeOverride ?? getStatusSize_97487(size);
|
|
if (size != null) {
|
|
object2 = {size: size, isMobileOnline: isMobileOnline, isVROnline: isVROnline, status: status,
|
|
streaming: streaming};
|
|
status = styles.status;
|
|
object2.style = [status, statusStyle];
|
|
r16 = object2;
|
|
} else {
|
|
r16 = null;
|
|
}
|
|
if (r16 == null) {
|
|
r7 = null;
|
|
} else if (typing && user != null) {
|
|
const StatusWithTyping = (require(12736) /* metro dependency 12736: Status */).StatusWithTyping;
|
|
r7 = (
|
|
<StatusWithTyping
|
|
{...r16}
|
|
{...{['typing']: typing}}
|
|
{...{['userId']: user.id}}
|
|
/>
|
|
);
|
|
} else {
|
|
r7 = ((Component) => <Component {...r16} />)(importDefault(12736) /* metro dependency 12736: Status */);
|
|
}
|
|
}
|
|
items4[3] = r7;
|
|
items4[4] = (
|
|
deaf
|
|
? (
|
|
<View style={[styles.status, styles.voiceStatus]}>
|
|
{((Component) => <Component size={(importDefault(4580) /* metro dependency 4580: Icon */).Sizes.REFRESH_SMALL_16} source={importDefault(10695) /* metro dependency 10695 */} color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE} />)(importDefault(4580) /* metro dependency 4580: Icon */)}
|
|
</View>
|
|
)
|
|
: (
|
|
mute
|
|
? (
|
|
<View style={[styles.status, styles.voiceStatus]}>
|
|
{((Component) => <Component size={(importDefault(4580) /* metro dependency 4580: Icon */).Sizes.REFRESH_SMALL_16} source={importDefault(10696) /* metro dependency 10696 */} color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE} />)(importDefault(4580) /* metro dependency 4580: Icon */)}
|
|
</View>
|
|
)
|
|
: undefined
|
|
)
|
|
);
|
|
return (
|
|
<View
|
|
style={items2}
|
|
needsOffscreenAlphaCompositing={needsOffscreenAlphaCompositing}
|
|
accessible={accessible}
|
|
accessibilityLabel={accessibilityLabel}
|
|
>
|
|
{items4}
|
|
</View>
|
|
);
|
|
function _fun97491() { // fn#97491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12935:1959, offset: 0x02184026, size: 947 bytes, params: 1, frame: 29
|
|
var r6;
|
|
var r0;
|
|
var r4;
|
|
var object;
|
|
var padding;
|
|
var avatarSize;
|
|
var userStatus;
|
|
var isMobileOnline2;
|
|
var isVROnline2;
|
|
var typing2;
|
|
var statusSizeOverride2;
|
|
var value3;
|
|
var value4;
|
|
var property;
|
|
var value7;
|
|
var value8;
|
|
var value10;
|
|
const CutoutShape = (ClipViewModule).CutoutShape;
|
|
var mobileStatusContainerRect;
|
|
var width;
|
|
var height;
|
|
var vRStatusContainerRect;
|
|
var statusTypingDimensions;
|
|
var value16;
|
|
var value17;
|
|
var object4;
|
|
var value18;
|
|
var moduleValue4;
|
|
if (autoStatusCutout != null) {
|
|
object = {avatarSize: env0_3};
|
|
object.userStatus = status;
|
|
object.isMobileOnline = isMobileOnline;
|
|
object.isVROnline = isVROnline;
|
|
object.padding = autoStatusCutout === true ? STATUS_PADDING : autoStatusCutout.padding;
|
|
object.typing = typing;
|
|
object.statusSizeOverride = statusSizeOverride;
|
|
avatarSize = object.avatarSize;
|
|
userStatus = object.userStatus;
|
|
isMobileOnline2 = object.isMobileOnline;
|
|
isVROnline2 = object.isVROnline;
|
|
padding = object.padding;
|
|
typing2 = object.typing;
|
|
statusSizeOverride2 = object.statusSizeOverride;
|
|
value3 = undefined;
|
|
if (userStatus != null) {
|
|
value4 = environment.__proto__;
|
|
if (userStatus === StatusTypes.UNKNOWN) {
|
|
r0 = value3;
|
|
} else {
|
|
property = (require(10252) /* metro dependency 10252: CutoutableAvatarImage */).AVATAR_SIZE_MAP[avatarSize];
|
|
r6 = statusSizeOverride2 ?? getStatusSize_97487(avatarSize) ?? 0;
|
|
value7 = r6 / 4;
|
|
if (typing2) {
|
|
statusTypingDimensions = (require(12734) /* metro dependency 12734: StatusUtils */).getStatusTypingDimensions(r6);
|
|
width = statusTypingDimensions.width;
|
|
height = statusTypingDimensions.height;
|
|
value16 = (importDefault(12735) /* metro dependency 12735: getStatusContainerStyle */)(r6,
|
|
isMobileOnline2 != null && isMobileOnline2, isVROnline2 != null && isVROnline2);
|
|
value17 = height + 2 * STATUS_PADDING;
|
|
object4 = {};
|
|
object4.shape = CutoutShape.RoundedRect;
|
|
value18 = property - width - STATUS_PADDING;
|
|
moduleValue4 = require(12734) /* metro dependency 12734: StatusUtils */;
|
|
object4.x = value18 + moduleValue4.getAnimatedTypingTranslateX(value16.width);
|
|
object4.y = property - height - STATUS_PADDING;
|
|
object4.width = width + 2 * STATUS_PADDING;
|
|
object4.height = value17;
|
|
object4.cornerRadius = value17 / 2;
|
|
r0 = {nativeCutouts: [object4]};
|
|
} else if (isVROnline2) {
|
|
vRStatusContainerRect = (require(12734) /* metro dependency 12734: StatusUtils */).getVRStatusContainerRect(r6);
|
|
width = vRStatusContainerRect.width;
|
|
height = vRStatusContainerRect.height;
|
|
r0 = {nativeCutouts: [{shape: CutoutShape.RoundedRect, x: property - width + value7,
|
|
y: property - height + value7,
|
|
width: width, height: height, cornerRadius: vRStatusContainerRect.cornerRadius}]};
|
|
} else if (isMobileOnline2) {
|
|
mobileStatusContainerRect = (require(12734) /* metro dependency 12734: StatusUtils */).getMobileStatusContainerRect(r6);
|
|
width = mobileStatusContainerRect.width;
|
|
height = mobileStatusContainerRect.height;
|
|
r0 = {nativeCutouts: [{shape: CutoutShape.RoundedRect, x: property - width + value7,
|
|
y: property - height + value7,
|
|
width: width, height: height, cornerRadius: mobileStatusContainerRect.cornerRadius}]};
|
|
} else {
|
|
value8 = r6 / 2 + padding;
|
|
value10 = property - value8 - 2 * value7;
|
|
r0 = {nativeCutouts: [{shape: CutoutShape.Circle, x: value10, y: value10, size: 2 * value8}]};
|
|
}
|
|
}
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
r4 = r0;
|
|
} else {
|
|
r4 = cutout;
|
|
}
|
|
object = {cutout: r4};
|
|
object.decorationCutout = (require(8396) /* metro dependency 8396: AvatarDecorationUtils */).getDecorationCutoutForAvatarCutout(r4,
|
|
-styles.decoration.top);
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun97486, 12745, [31, 27, 661, 1306, 33, 4501, 697, 10252, 12734, 12735, 7599, 8396, 12746, 7598, 12736,
|
|
4580, 10695, 10696,
|
|
2]) /* metro module 12745, dependencies: [31, 27, 661, 1306, 33, 4501, 697, 10252, 12734, 12735, 7599, 8396, 12746, 7598, 12736, 4580, 10695, 10696, 2] */;
|