239 lines
14 KiB
TypeScript
239 lines
14 KiB
TypeScript
/* Metro module 8744; source: modules/user_profile/native/UserProfileSpeedBumpActionSheet.tsx; dependencies: [57, 31, 27, 1379, 1945, 1878, 8516, 661, 33, 4501, 697, 8745, 1244, 6231, 6238, 1305, 4002, 4048, 566, 8490, 6771, 6789, 8514, 8746, 683, 8061, 8743, 6275, 6277, 8747, 8748, 4573, 4617, 4578, 5278, 3829, 2] */
|
|
function _fun68465(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:6, offset: 0x01c4f741, size: 716 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_9 = (require(8516) /* metro dependency 8516: Constants */).UserProfileAnalyticsTypes;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_10 = constantsModule.AnalyticEvents;
|
|
const env0_11 = constantsModule.EMPTY_STRING_SNOWFLAKE_ID;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value3.jsx;
|
|
const env0_13 = value3.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.button = {paddingHorizontal: PX_16, paddingBottom: 56};
|
|
const object5 = {};
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object5.marginBottom = PX_24;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.paddingHorizontal = PX_16;
|
|
object2.tableContainer = object5;
|
|
const object6 = {};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object6.marginBottom = PX_24;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.marginHorizontal = PX_16;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object6.gap = PX_8;
|
|
object2.header = object6;
|
|
object2.bodyText = {textAlign: 'center'};
|
|
object2.headerText = {textAlign: 'center'};
|
|
object2.avatar = {alignSelf: 'center'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.avatarContainer = {'position': 'relative', 'alignSelf': 'center', marginTop: PX_16};
|
|
const object7 = {'position': 'absolute', 'bottom': -8, 'right': -8};
|
|
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7.padding = PX_4;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object7.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object2.avatarIconContainer = object7;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.suppress = {alignSelf: 'center', marginTop: PX_16};
|
|
const env0_14 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
value = value.memo(UserProfileSpeedBumpActionSheet);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfileSpeedBumpActionSheet.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function InformationTable({speedBumpType}) { // fn#68466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:987, offset: 0x01c4fa0d, size: 320 bytes, params: 2, frame: 22
|
|
let object2 = {};
|
|
object2.icon = importDefault(8745) /* metro dependency 8745 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kcuWva);
|
|
const items2 = [object2];
|
|
object2 = {icon: importDefault(8745) /* metro dependency 8745 */};
|
|
object2.text = speedBumpType === 'block' ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.QxrDY1) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.W6fjkS);
|
|
items2[1] = object2;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
return (
|
|
<TableRowGroup hasIcons>
|
|
{items2.map(_fun68467)}
|
|
</TableRowGroup>
|
|
);
|
|
}
|
|
|
|
function UserProfileSpeedBumpActionSheet({userId, channelId, messageId, roleId, sessionId, onClose, location, openedAt, sourceAnalyticsLocations = [], speedBumpType}) { // fn#68468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:1445, offset: 0x01c4fbf0, size: 1972 bytes, params: 2, frame: 48
|
|
const styles = useStyles();
|
|
const sharedModule = require(4002) /* metro dependency 4002: shared */;
|
|
const isThemeLight2 = sharedModule.isThemeLight((importDefault(4048) /* metro dependency 4048: useTheme */)());
|
|
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getUser(userId);
|
|
});
|
|
const env0_4 = user;
|
|
const guild_id = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(channelId);
|
|
}, [channelId])?.guild_id;
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun68471);
|
|
const value6 = (importDefault(8490) /* metro dependency 8490: useDisplayProfile */)(user?.id ?? EMPTY_STRING_SNOWFLAKE_ID,
|
|
guild_id);
|
|
const IGNORED_USER_SHEET = UserProfileAnalyticsTypes.IGNORED_USER_SHEET;
|
|
const binding = env0_4;
|
|
const [property, env0_9] = location(binding.useState(false), 2);
|
|
const defaultImport2 = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const items = [];
|
|
const value9 = arraySpread(items, sourceAnalyticsLocations, 0, channelId);
|
|
const IGNORED_PROFILE_ACTION_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).IGNORED_PROFILE_ACTION_SHEET;
|
|
items[value9] = IGNORED_PROFILE_ACTION_SHEET;
|
|
value9 + 1;
|
|
const analyticsLocations = defaultImport2(items).analyticsLocations;
|
|
const value10 = (require(8514) /* metro dependency 8514: UserProfileAnalyticsContext */).useCreateUserProfileAnalyticsContext({layout: 'ACTION_SHEET',
|
|
sourceSessionId: sessionId, userId: userId, channelId: channelId, messageId: messageId, roleId: roleId});
|
|
binding.useEffect(_fun68472,
|
|
[(importDefault(8746) /* metro dependency 8746: useUserProfileAnalyticsProperties */)({userId: userId,
|
|
user: user, channelId: channelId, guildId: guild_id, displayProfile: value6, guildMember: value5,
|
|
type: IGNORED_USER_SHEET}), value6, guild_id, property, value5]);
|
|
binding.useEffect(function() {
|
|
return _fun68474;
|
|
}, [onClose]);
|
|
binding.useEffect(_fun68475, [user, userId]);
|
|
if (user == null) {
|
|
return null;
|
|
}
|
|
const closure = onPress_68476;
|
|
const value12 = speedBumpType === 'block';
|
|
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
|
|
const UserProfileAnalyticsProvider = (require(8514) /* metro dependency 8514: UserProfileAnalyticsContext */).UserProfileAnalyticsProvider;
|
|
const fetchStartedAt = value6?.fetchStartedAt;
|
|
const fetchEndedAt = value6?.fetchEndedAt;
|
|
const isLoaded = value6?.isLoaded;
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const BottomSheetView = (require(6277) /* metro dependency 6277 */).BottomSheetView;
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const XLARGE = AvatarSizes.XLARGE;
|
|
const avatar = <Avatar user={user} guildId={guild_id} animate={false} size={XLARGE} style={styles.avatar} />;
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const object2 = {};
|
|
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const Sizes = Icon2.Sizes;
|
|
const MEDIUM = Sizes.MEDIUM;
|
|
object2.size = MEDIUM;
|
|
if (value12) {
|
|
object2.source = importDefault(8747) /* metro dependency 8747 */;
|
|
} else {
|
|
object2.source = importDefault(8748) /* metro dependency 8748 */;
|
|
}
|
|
const items3 = [<View style={styles.avatarContainer}>{avatar}<View style={styles.avatarIconContainer}><Icon {...object2} /></View></View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
items3[1] = <Text style={styles.headerText} variant="heading-xl/bold" color="mobile-text-heading-primary" accessibilityRole="header">{Reflect.apply(string,
|
|
intl, [t.b33pLD])}</Text>;
|
|
const format = intl.format;
|
|
const r29 = value12 ? t['8F+WNz'] : t['/cZp5s'];
|
|
const object3 = {};
|
|
object3.username = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getName(guild_id, channelId,
|
|
user);
|
|
items3[2] = <Text style={styles.bodyText} variant="text-md/medium" color="mobile-text-heading-primary">{Reflect.apply(format,
|
|
intl, [r29, object3])}</Text>;
|
|
const items4 = [<View style={styles.header}>{items3}</View>];
|
|
items4[1] = <View style={styles.tableContainer}><InformationTable speedBumpType={speedBumpType} /></View>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items4[2] = <View style={styles.button}><Button variant={isThemeLight2 ? 'tertiary' : 'secondary'} size="lg" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['UJKH/l'])} onPress={closure} />{speedBumpType !== 'ignore' ? null : ((PressableOpacity) => <PressableOpacity style={styles.suppress} accessibilityRole="button" onPress={function() {
|
|
var IgnoreProfileSpeedbumpDisabled = require(dependencyMap[35]).IgnoreProfileSpeedbumpDisabled;
|
|
IgnoreProfileSpeedbumpDisabled.updateSetting(true);
|
|
onPress_68476();
|
|
}}><Text variant="text-sm/normal" color="text-link">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.QbcRCJ)}</Text></PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)}</View>;
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<UserProfileAnalyticsProvider
|
|
value={value10}
|
|
openedAt={openedAt}
|
|
fetchStartedAt={fetchStartedAt}
|
|
fetchEndedAt={fetchEndedAt}
|
|
isLoaded={isLoaded}
|
|
>
|
|
<BottomSheet startExpanded>
|
|
<BottomSheetView>
|
|
{items4}
|
|
</BottomSheetView>
|
|
</BottomSheet>
|
|
</UserProfileAnalyticsProvider>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
}
|
|
|
|
function _fun68467(a0, a1) { // fn#68467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:1283, offset: 0x01c4fb4d, size: 163 bytes, params: 3, frame: 22
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const tableRowProps = {start: a1 === 0, end: env0_0.length === a1};
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const Sizes = Icon2.Sizes;
|
|
const MEDIUM = Sizes.MEDIUM;
|
|
tableRowProps.icon = <Icon size={MEDIUM} source={a0.icon} />;
|
|
tableRowProps.label = a0.text;
|
|
return <TableRow {...tableRowProps} key={a1} />;
|
|
}
|
|
|
|
function _fun68471() { // fn#68471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:1847, offset: 0x01c503d9, size: 45 bytes, params: 1, frame: 14
|
|
const guild_idBinding = guild_id;
|
|
const value2 = null;
|
|
return value2 != guild_idBinding ? GuildMemberStore.getMember(guild_id, userId) : value2;
|
|
}
|
|
|
|
function _fun68472() { // fn#68472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:2309, offset: 0x01c50406, size: 131 bytes, params: 1, frame: 15
|
|
var value6;
|
|
var defaultImport;
|
|
if (!(env0_8 || env0_7 == null)) {
|
|
if (guild_id == null || env0_6?.fullProfileLoadedTimestamp != null) {
|
|
value6 = environment.__proto__;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.OPEN_POPOUT, env0_12);
|
|
env0_9(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun68473() { // fn#68473, offset: 0x01c50489, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
};
|
|
}
|
|
|
|
function _fun68475() { // fn#68475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:2500, offset: 0x01c504af, size: 57 bytes, params: 1, frame: 12
|
|
var value2;
|
|
var moduleValue;
|
|
if (user == null) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(8061) /* metro dependency 8061: UserActionCreators */;
|
|
moduleValue.getUser(userId);
|
|
}
|
|
}
|
|
|
|
function UserProfileSpeedBumpActionSheetOnPress() { // fn#68476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8929:2596, owner: UserProfileSpeedBumpActionSheet.onPress, offset: 0x01c504e8, size: 72 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
value = importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */;
|
|
const object2 = {};
|
|
object2.sourceAnalyticsLocations = analyticsLocations;
|
|
object2.ignoreBlockedSpeedBump = true;
|
|
const locationBinding = location;
|
|
object2.location = locationBinding;
|
|
copyDataProperties(object2, env0_11, locationBinding);
|
|
value(object2);
|
|
}
|
|
|