99 lines
6.6 KiB
TypeScript
99 lines
6.6 KiB
TypeScript
/* Metro module 13317; source: modules/user_settings/account/MFAUtils.tsx; dependencies: [1867, 3784, 1878, 661, 1244, 632, 8980, 2] */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
|
|
function _fun101456(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:6, offset: 0x02215726, size: 277 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_settings/account/MFAUtils.tsx');
|
|
exports.getSMSBackupDisabledMessage = getSMSBackupDisabledMessage;
|
|
exports.useIsMFAEnabled = function() {
|
|
return require(dependencyMap[5]).useStateFromStores([UserStore], _fun101459);
|
|
};
|
|
exports.MFAAvailability = {AVAILABLE: 'available', UNAVAILABLE_NO_CRYPTO: 'unavailable_no_crypto',
|
|
UNAVAILABLE_UNVERIFIED: 'unavailable_unverified'};
|
|
exports.useMFAAvailability = useMFAAvailability;
|
|
exports.use2FARemoveDisableReason = use2FARemoveDisableReason;
|
|
function getSMSBackupDisabledMessage(a0) { // fn#101457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:444, offset: 0x0221583b, size: 327 bytes, params: 2, frame: 18
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
let value = a1;
|
|
const r2 = value !== undefined ? value : false;
|
|
value = null;
|
|
return value == a0 ? value : a0.hasAnyStaffLevel() ? r2 ? intl.string(t.YJGvuD) : intl.string(t['3iKih7']) : a0.hasFlag(UserFlags.PARTNER) ? r2 ? intl.string(t['9UucjT']) : intl.string(t.Sq6Q1u) : value == a0.email ? r2 ? intl.string(t['9VWpT9']) : intl.string(t.LfCBZG) : value;
|
|
}
|
|
|
|
function useIsMFAEnabled() { // fn#101458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:832, offset: 0x02215982, size: 59 bytes, params: 1, frame: 13
|
|
return (UseStateFromStoresModule).useStateFromStores([UserStore], _fun101459);
|
|
function _fun101459() { // fn#101459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:898, offset: 0x022159bd, size: 33 bytes, params: 1, frame: 10
|
|
let value = environment.__proto__;
|
|
value = UserStore.getCurrentUser();
|
|
return value != null && value.mfaEnabled;
|
|
}
|
|
|
|
}
|
|
|
|
function useMFAAvailability() { // fn#101460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:1002, offset: 0x022159de, size: 123 bytes, params: 1, frame: 17
|
|
const useStateFromStores = UseStateFromStoresModule.useStateFromStores;
|
|
return (require(8980) /* metro dependency 8980: MFAUtils */).hasCrypto ? Reflect.apply(useStateFromStores,
|
|
UseStateFromStoresModule, [[UserStore],
|
|
_fun101461]) === false ? env0_8.UNAVAILABLE_UNVERIFIED : env0_8.AVAILABLE : env0_8.UNAVAILABLE_NO_CRYPTO;
|
|
function _fun101461() { // fn#101461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:1070, offset: 0x02215a59, size: 35 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.verified;
|
|
}
|
|
|
|
}
|
|
|
|
function use2FARemoveDisableReason() { // fn#101462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:1260, offset: 0x02215a7c, size: 88 bytes, params: 1, frame: 15
|
|
const value = a0;
|
|
const env0_0 = value !== undefined ? value : false;
|
|
return (UseStateFromStoresModule).useStateFromStores([GuildStore,
|
|
PermissionStore, UserStore], _fun101463);
|
|
function _fun101463() { // fn#101463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:1344, offset: 0x02215ad4, size: 253 bytes, params: 1, frame: 17
|
|
var environment;
|
|
var r0;
|
|
var guildsArray;
|
|
var binding;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
const value = environment.__proto__;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value3 = null;
|
|
if (value3 == currentUser) {
|
|
guildsArray = GuildStore.getGuildsArray();
|
|
r0 = guildsArray.some(_fun101464) ? env0_0 ? intl.string(t.OYTCUh) : intl.string(t.HC8uSZ) : value3;
|
|
} else if (currentUser.hasAnyStaffLevel()) {
|
|
binding = env0_0;
|
|
string = intl.string;
|
|
r0 = binding ? Reflect.apply(string, intl, [t.hxf9fX]) : Reflect.apply(string, intl, [t['3iKih7']]);
|
|
} else {
|
|
guildsArray = GuildStore.getGuildsArray();
|
|
r0 = guildsArray.some(_fun101464) ? env0_0 ? intl.string(t.OYTCUh) : intl.string(t.HC8uSZ) : value3;
|
|
}
|
|
return r0;
|
|
function _fun101464(a0) { // fn#101464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13507:1519, offset: 0x02215bd1, size: 63 bytes, params: 2, frame: 14
|
|
const features = a0.features;
|
|
const has = features.has;
|
|
const value = environment.__proto__.__proto__;
|
|
const ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE = GuildFeatures.ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE;
|
|
return Reflect.apply(has, features,
|
|
[ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE]) && PermissionStore.can(Permissions.ADMINISTRATOR, a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun101456, 13317, [1867, 3784, 1878, 661, 1244, 632, 8980,
|
|
2]) /* metro module 13317, dependencies: [1867, 3784, 1878, 661, 1244, 632, 8980, 2] */;
|