179 lines
12 KiB
TypeScript
179 lines
12 KiB
TypeScript
/* Metro module 9292; source: modules/rtc/native/SecureFramesUserVerificationBottomSheet.tsx; dependencies: [57, 31, 27, 4294, 1878, 9277, 661, 33, 4501, 697, 9281, 9293, 9256, 9283, 566, 9285, 8061, 4617, 9275, 9284, 9294, 9296, 4080, 3857, 4073, 1244, 6275, 6758, 6806, 4573, 9286, 4572, 4578, 2] */
|
|
function _fun72666(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:6, offset: 0x01d4d954, size: 453 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.ActivityIndicator;
|
|
const env0_6 = value.View;
|
|
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
value = require(9277) /* metro dependency 9277: SecureFramesConstants */;
|
|
const env0_9 = value.AnalyticsSecureFramesUserVerification;
|
|
const env0_10 = value.SECURE_FRAMES_PUBLIC_KEY_VERSION;
|
|
const env0_11 = value.USER_VERIFIED_TOAST_KEY;
|
|
const env0_12 = (require(661) /* metro dependency 661: Constants */).AnalyticsLocations;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_13 = value.jsx;
|
|
const env0_14 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
|
|
const env0_15 = Reflect.apply(createStyles, value, [{iconContainer: {'height': 80, 'width': 80, 'borderRadius': 40,
|
|
'alignItems': 'center', 'justifyContent': 'center', 'backgroundColor': null, 'marginBottom': 16,
|
|
backgroundColor: BACKGROUND_MOD_STRONG}, icon: {'height': 48, 'width': 48}, content: {'padding': 16,
|
|
'justifyContent': 'center', 'alignItems': 'center'}, subtitle: {'textAlign': 'center', 'marginTop': 8,
|
|
'marginBottom': 40}, buttons: {marginTop: 40}, helpMessage: {marginTop: 16}}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rtc/native/SecureFramesUserVerificationBottomSheet.tsx');
|
|
exports.default = SecureFramesUserVerificationBottomSheet;
|
|
}
|
|
|
|
function SecureFramesUserVerificationBottomSheet({userId, channelId, guildId, fingerprint}) { // fn#72667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:745, offset: 0x01d4db19, size: 1325 bytes, params: 2, frame: 35
|
|
var object2;
|
|
const styles = useStyles();
|
|
const env0_3 = styles;
|
|
const value2 = (require(9281) /* metro dependency 9281: useSecureFramesPairwiseFingerprint */).useSecureFramesPairwiseFingerprint({userId: userId});
|
|
const userKey = value2.userKey;
|
|
const env0_4 = userKey;
|
|
const fingerprint2 = value2.fingerprint;
|
|
const loading = value2.loading;
|
|
const value3 = (require(9293) /* metro dependency 9293: useIsSecureFramesUIEnabled */).useIsSecureFramesUIEnabled({channelId: channelId});
|
|
const value4 = (require(9256) /* metro dependency 9256: useIsSecureFramesVerified */).useIsUserSecureFramesVerified({userId: userId,
|
|
channelId: channelId});
|
|
const value5 = (require(9283) /* metro dependency 9283: useIsPersistentSecureFramesFingerprint */).useIsPersistentSecureFramesFingerprint({userId: userId});
|
|
const isOtherUserKeyPersistent = value5.isOtherUserKeyPersistent;
|
|
const loading2 = value5.loading;
|
|
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([RTCConnectionStore], function() {
|
|
return RTCConnectionStore.isConnected();
|
|
});
|
|
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([RTCConnectionStore], function() {
|
|
return RTCConnectionStore.isUserConnected(userId);
|
|
});
|
|
const value8 = (require(9285) /* metro dependency 9285: useIsSecureFramesKeyInconsistent */).useIsSecureFramesKeyInconsistent({userId: userId});
|
|
const binding = env0_4;
|
|
let useMemo = binding.useMemo;
|
|
const value9 = Reflect.apply(useMemo, binding, [_fun72670, [fingerprint, channelId, fingerprint2, value6, value8,
|
|
value7, value3, value4]]);
|
|
binding.useEffect(_fun72671, [userId]);
|
|
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getUser(userId);
|
|
});
|
|
const value10 = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).useName(guildId, channelId, user);
|
|
useMemo = binding.useMemo;
|
|
const value12 = env0_3(Reflect.apply(useMemo, binding, [_fun72673, [value9, value10]]), 2);
|
|
const property = value12[0];
|
|
const property2 = value12[1];
|
|
binding.useEffect(_fun72674, [channelId, value9, userId]);
|
|
const value13 = binding.useMemo(_fun72675, [value9, styles.icon]);
|
|
const value14 = binding.useCallback(_fun72676, []);
|
|
const value15 = binding.useCallback(_fun72677, [channelId, userKey, isOtherUserKeyPersistent, value10, userId]);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
object2 = {startExpanded: true};
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const ActionSheetCloseButton = (require(6806) /* metro dependency 6806: ActionSheetCloseButtonNative */).ActionSheetCloseButton;
|
|
object2.header = <BottomSheetTitleHeader title={null} leading={<ActionSheetCloseButton onPress={value14} />} />;
|
|
const items2 = [<View style={styles.iconContainer}>{loading2 || loading ? <ActivityIndicator /> : fingerprint2 != null ? value13 : <ActivityIndicator />}</View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <Text variant="heading-xl/bold" color="mobile-text-heading-primary">{property}</Text>;
|
|
items2[2] = <Text style={styles.subtitle} variant="text-md/medium" color="text-default">{property2}</Text>;
|
|
items2[3] = ((Component) => <Component style={styles.helpMessage} userId={userId} userKey={userKey} />)(importDefault(9286) /* metro dependency 9286: SecureFramesExistingVerificationsHelpMessage */);
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
items2[4] = <Stack spacing={12} style={styles.buttons}><Button variant="primary" onPress={value15} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0tvNAn'])} disabled={loading2 || value9 !== AnalyticsSecureFramesUserVerification.MATCH} /><Button variant="secondary" onPress={value14} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} /></Stack>;
|
|
return (
|
|
<BottomSheet {...object2}>
|
|
<View style={styles.content}>
|
|
{items2}
|
|
</View>
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function _fun72670() { // fn#72670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:1359, offset: 0x01d4e074, size: 177 bytes, params: 1, frame: 5
|
|
return channelId == null ? AnalyticsSecureFramesUserVerification.CURRENT_USER_DISCONNECTED : env0_9 ? env0_10 ? env0_6 ? env0_7 ? AnalyticsSecureFramesUserVerification.OTHER_USER_ALREADY_VERIFIED : env0_11 ? AnalyticsSecureFramesUserVerification.OTHER_USER_INCONSISTENT_KEYS : fingerprint !== fingerprint ? AnalyticsSecureFramesUserVerification.FINGERPRINT_MISMATCH : AnalyticsSecureFramesUserVerification.MATCH : AnalyticsSecureFramesUserVerification.UNABLE_TO_VERIFY : AnalyticsSecureFramesUserVerification.OTHER_USER_DISCONNECTED : AnalyticsSecureFramesUserVerification.CURRENT_USER_DISCONNECTED;
|
|
}
|
|
|
|
function _fun72671() { // fn#72671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:1586, offset: 0x01d4e125, size: 45 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(require(8061) /* metro dependency 8061: UserActionCreators */).getUser(userId);
|
|
}
|
|
|
|
function _fun72673() { // fn#72673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:1715, offset: 0x01d4e152, size: 50 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (require(9275) /* metro dependency 9275: SecureFramesUtils */).getUserVerifyStateText(env0_12, env0_13);
|
|
}
|
|
|
|
function _fun72674() { // fn#72674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:1800, offset: 0x01d4e184, size: 113 bytes, params: 1, frame: 15
|
|
const binding = env0_12;
|
|
const OTHER_USER_ALREADY_VERIFIED = AnalyticsSecureFramesUserVerification.OTHER_USER_ALREADY_VERIFIED;
|
|
if (OTHER_USER_ALREADY_VERIFIED !== binding) {
|
|
var MATCH = AnalyticsSecureFramesUserVerification.MATCH;
|
|
if (MATCH === binding) {
|
|
return undefined;
|
|
}
|
|
(require(9284) /* metro dependency 9284: SecureFramesTracking */).trackE2EEUserVerificationFailed({channelId: channelId,
|
|
|
|
userId: userId, reason: env0_12, keyVersion: SECURE_FRAMES_PUBLIC_KEY_VERSION});
|
|
}
|
|
}
|
|
|
|
function _fun72675() { // fn#72675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:1994, offset: 0x01d4e1f5, size: 210 bytes, params: 1, frame: 18
|
|
const CheckmarkLargeBoldIcon = (require(9294) /* metro dependency 9294: CheckmarkLargeBoldIcon */).CheckmarkLargeBoldIcon;
|
|
const binding = env0_12;
|
|
const OTHER_USER_ALREADY_VERIFIED = AnalyticsSecureFramesUserVerification.OTHER_USER_ALREADY_VERIFIED;
|
|
if (OTHER_USER_ALREADY_VERIFIED === binding) {
|
|
return (
|
|
<CheckmarkLargeBoldIcon
|
|
style={styles.icon}
|
|
color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE}
|
|
/>
|
|
);
|
|
}
|
|
const MATCH = AnalyticsSecureFramesUserVerification.MATCH;
|
|
if (MATCH === binding) {
|
|
return (
|
|
<CheckmarkLargeBoldIcon
|
|
style={styles.icon}
|
|
color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE}
|
|
/>
|
|
);
|
|
}
|
|
const XLargeBoldIcon = (require(9296) /* metro dependency 9296: XLargeBoldIcon */).XLargeBoldIcon;
|
|
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
|
|
return <XLargeBoldIcon style={styles.icon} color={TEXT_FEEDBACK_CRITICAL} />;
|
|
}
|
|
|
|
function _fun72676() { // fn#72676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:2291, offset: 0x01d4e2c7, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
}
|
|
|
|
function _fun72677() { // fn#72677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9478:2346, offset: 0x01d4e2ec, size: 253 bytes, params: 1, frame: 24
|
|
var value4;
|
|
var moduleValue;
|
|
var defaultImport2;
|
|
var open;
|
|
var object2;
|
|
var intl;
|
|
if (channelId != null && userKey != null) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
moduleValue.addVerification(userId, userKey, isOtherUserKeyPersistent, channelId, AnalyticsLocations.DEEP_LINK);
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
defaultImport2 = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
|
|
open = defaultImport2.open;
|
|
object2 = {};
|
|
object2.key = USER_VERIFIED_TOAST_KEY;
|
|
object2.iconColor = 'text-feedback-positive';
|
|
object2.IconComponent = (require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.content = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Gwu134,
|
|
{username: env0_13});
|
|
Reflect.apply(open, defaultImport2, [object2]);
|
|
}
|
|
}
|
|
|