487 lines
28 KiB
TypeScript
487 lines
28 KiB
TypeScript
/* Metro module 5072; source: modules/age_gate/AgeGateUtils.tsx; dependencies: [1422, 1379, 5073, 1867, 1878, 1229, 661, 1244, 21, 4813, 3835, 4861, 566, 5074, 1948, 5075, 5087, 2] */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildNSFWAgreeStore from '../../stores/GuildNSFWAgreeStore.tsx'; /* Metro dependency 5073 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as AgeGateConstantsModule from './AgeGateConstants.tsx'; /* Metro dependency 1229 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as GuildRecordModule from '../../records/GuildRecord.tsx'; /* Metro dependency 1422 */
|
|
import * as RegionalFeatureConfigUtilsModule from '../regional_feature_config/RegionalFeatureConfigUtils.tsx'; /* Metro dependency 3835 */
|
|
import * as AgeVerificationUtilsModule from '../age_assurance/AgeVerificationUtils.tsx'; /* Metro dependency 4813 */
|
|
import * as AgeGatedFeatureModule from '../../external/discord_common/js/shared/shared-constants/AgeGatedFeature.tsx'; /* Metro dependency 4861 */
|
|
import * as AgeVerificationAnalyticsUtilsModule from '../age_assurance/AgeVerificationAnalyticsUtils.tsx'; /* Metro dependency 5074 */
|
|
import * as SpoilerChannelUtilsModule from '../spoiler_channels/SpoilerChannelUtils.tsx'; /* Metro dependency 5087 */
|
|
|
|
function _fun43969(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#43969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6, offset: 0x01163fe5, size: 647 bytes, params: 8, frame: 27
|
|
const env0_0 = require;
|
|
const shouldAgeVerifyForAgeGate2 = shouldAgeVerifyForAgeGate;
|
|
const useShouldAgeVerifyForAgeGate2 = useShouldAgeVerifyForAgeGate;
|
|
const isChannelContentGated2 = isChannelContentGated;
|
|
const useIsChannelContentGated2 = useIsChannelContentGated;
|
|
const isCurrentUserMissingDateOfBirth2 = isCurrentUserMissingDateOfBirth;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const AgeGateSource = (AgeGateConstantsModule).AgeGateSource;
|
|
const GuildNSFWContentLevel = ConstantsModule.GuildNSFWContentLevel;
|
|
const Date = global.Date;
|
|
const date = new Date('06/16/2020');
|
|
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
|
|
items2 = [AGE_RESTRICTED];
|
|
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
|
|
items2[1] = EXPLICIT;
|
|
const Set = global.Set;
|
|
const NSFW_SERVER = AgeGateSource.NSFW_SERVER;
|
|
const NSFW_SERVER_INVITE = AgeGateSource.NSFW_SERVER_INVITE;
|
|
const NSFW_SERVER_INVITE_EMBED = AgeGateSource.NSFW_SERVER_INVITE_EMBED;
|
|
const set = new Set([NSFW_SERVER, NSFW_SERVER_INVITE, NSFW_SERVER_INVITE_EMBED]);
|
|
const shouldShowAgeGateForCurrentUser2 = shouldShowAgeGateForCurrentUser;
|
|
const shouldShowAgeGateForGuildContentLevel2 = shouldShowAgeGateForGuildContentLevel;
|
|
const shouldShowAgeGateForChannelId2 = shouldShowAgeGateForChannelId;
|
|
const shouldShowAgeGateForVoiceChannel2 = shouldShowAgeGateForVoiceChannel;
|
|
const isChannelOrGuildNSFW2 = isChannelOrGuildNSFW;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/age_gate/AgeGateUtils.tsx');
|
|
exports.SERVER_AGE_GATE_SOURCES = set;
|
|
exports.userNeedsAgeGate = userNeedsAgeGate;
|
|
exports.guildNeedsAgeGate = guildNeedsAgeGate;
|
|
exports.shouldAgeVerifyForAgeGate = shouldAgeVerifyForAgeGate2;
|
|
exports.useShouldAgeVerifyForAgeGate = useShouldAgeVerifyForAgeGate2;
|
|
exports.useAgeGateVerifyContentForGuild = useAgeGateVerifyContentForGuild;
|
|
exports.useAgeGateVerifyContent = useAgeGateVerifyContent;
|
|
exports.shouldShowAgeGateForCurrentUser = shouldShowAgeGateForCurrentUser2;
|
|
exports.shouldShowAgeGateForGuildContentLevel = shouldShowAgeGateForGuildContentLevel2;
|
|
exports.shouldShowAgeGateForChannelId = shouldShowAgeGateForChannelId2;
|
|
exports.shouldShowAgeGateForVoiceChannel = shouldShowAgeGateForVoiceChannel2;
|
|
exports.maybeOpenAgeGateForVoiceChannel = maybeOpenAgeGateForVoiceChannel;
|
|
exports.maybeShowAgeGate = maybeShowAgeGate;
|
|
exports.isChannelOrGuildNSFW = isChannelOrGuildNSFW2;
|
|
exports.isChannelAgeVerificationGated = isChannelAgeVerificationGated;
|
|
exports.userCannotSeeNSFWContent = userCannotSeeNSFWContent;
|
|
exports.isChannelContentGated = isChannelContentGated2;
|
|
exports.useIsChannelContentGated = useIsChannelContentGated2;
|
|
exports.useShouldHideChannelContent = useShouldHideChannelContent;
|
|
exports.isCurrentUserMissingDateOfBirth = isCurrentUserMissingDateOfBirth2;
|
|
exports.shouldAgeVerifyForSettingsToggles = shouldAgeVerifyForSettingsToggles;
|
|
exports.useShouldAgeVerifyForSettingsToggles = useShouldAgeVerifyForSettingsToggles;
|
|
function shouldAgeVerifyForAgeGate() { // fn#43970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:375, offset: 0x0116426c, size: 90 bytes, params: 1, frame: 15
|
|
let value = AgeVerificationUtilsModule;
|
|
value = value.shouldShowTiggerPawtect();
|
|
const isFeatureAgeGated = RegionalFeatureConfigUtilsModule.isFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const AGE_GATED_SPACES = AgeGatedFeature.AGE_GATED_SPACES;
|
|
return Reflect.apply(isFeatureAgeGated, RegionalFeatureConfigUtilsModule, [AGE_GATED_SPACES]) && value;
|
|
}
|
|
|
|
function useShouldAgeVerifyForAgeGate() { // fn#43971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:532, offset: 0x011642c6, size: 90 bytes, params: 1, frame: 14
|
|
var value;
|
|
const useIsFeatureAgeGated = (RegionalFeatureConfigUtilsModule).useIsFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const AGE_GATED_SPACES = AgeGatedFeature.AGE_GATED_SPACES;
|
|
value = Reflect.apply(useIsFeatureAgeGated, value, [AGE_GATED_SPACES]);
|
|
return value && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).useShouldShowTiggerPawtect();
|
|
}
|
|
|
|
function isChannelContentGated(a0) { // fn#43972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1286, offset: 0x01164320, size: 240 bytes, params: 2, frame: 19
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
const guildNSFWAgreeStoreBinding = GuildNSFWAgreeStore;
|
|
const value2 = guildNSFWAgreeStoreBinding.didAgree(a0.guild_id);
|
|
const nsfwAllowed = UserStore.getCurrentUser()?.nsfwAllowed;
|
|
const isFeatureAgeGated = RegionalFeatureConfigUtilsModule.isFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const AGE_GATED_SPACES = AgeGatedFeature.AGE_GATED_SPACES;
|
|
const isFeatureAgeGated2 = Reflect.apply(isFeatureAgeGated, RegionalFeatureConfigUtilsModule, [AGE_GATED_SPACES]);
|
|
const shouldShowTiggerPawtect2 = (AgeVerificationUtilsModule).shouldShowTiggerPawtect();
|
|
let r2 = value2 && !(nsfwAllowed === false);
|
|
r2 = r2 ? shouldShowTiggerPawtect2 && isFeatureAgeGated2 : !r2;
|
|
if (a0.isNSFW()) {
|
|
if (r2) {
|
|
return true;
|
|
}
|
|
}
|
|
const guild = GuildStore.getGuild(a0.guild_id);
|
|
return guild != null && (isGuildNSFW(guild) && r2);
|
|
}
|
|
|
|
function useIsChannelContentGated(a0) { // fn#43973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1644, offset: 0x01164410, size: 296 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var r7;
|
|
var r1;
|
|
var isNSFW2;
|
|
var value12;
|
|
const env0_0 = a0;
|
|
var value;
|
|
const value2 = (AgeVerificationUtilsModule).useShouldShowTiggerPawtect();
|
|
const value3 = (FluxModule).useStateFromStores([GuildNSFWAgreeStore], _fun43974);
|
|
const value4 = (FluxModule).useStateFromStores([UserStore], _fun43975);
|
|
const useIsFeatureAgeGated = RegionalFeatureConfigUtilsModule.useIsFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const AGE_GATED_SPACES = AgeGatedFeature.AGE_GATED_SPACES;
|
|
const value5 = Reflect.apply(useIsFeatureAgeGated, RegionalFeatureConfigUtilsModule, [AGE_GATED_SPACES]);
|
|
const guild = (FluxModule).useStateFromStores([GuildStore], _fun43976);
|
|
let r2 = value3 && !value4;
|
|
const r4 = r2 ? value5 && value2 : !r2;
|
|
const value8 = a0 != null;
|
|
if (value8) {
|
|
isNSFW2 = a0.isNSFW();
|
|
r7 = isNSFW2 ? !r4 : !isNSFW2;
|
|
if (r7) {
|
|
value12 = guild != null;
|
|
if (value12) {
|
|
value = isGuildNSFW(guild);
|
|
value = !(value ? !r4 : !value);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value12;
|
|
}
|
|
r1 = r2;
|
|
} else {
|
|
r1 = !r7;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value8;
|
|
}
|
|
return r0;
|
|
function _fun43974() { // fn#43974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1759, offset: 0x01164538, size: 47 bytes, params: 1, frame: 13
|
|
const guildNSFWAgreeStoreBinding = GuildNSFWAgreeStore;
|
|
return guildNSFWAgreeStoreBinding.didAgree(env0_0?.guild_id);
|
|
}
|
|
|
|
function _fun43975() { // fn#43975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1838, offset: 0x01164567, size: 41 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.nsfwAllowed === false;
|
|
}
|
|
|
|
function _fun43976() { // fn#43976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2025, offset: 0x01164590, size: 47 bytes, params: 1, frame: 13
|
|
return GuildStore.getGuild(env0_0?.guild_id);
|
|
}
|
|
|
|
}
|
|
|
|
function isCurrentUserMissingDateOfBirth() { // fn#43977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2146, offset: 0x011645bf, size: 37 bytes, params: 1, frame: 11
|
|
const currentUser = UserStore.getCurrentUser();
|
|
return currentUser != null && currentUser.nsfwAllowed == null;
|
|
}
|
|
|
|
function shouldShowAgeGateForCurrentUser() { // fn#43978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:738, offset: 0x011645e4, size: 56 bytes, params: 1, frame: 10
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
return currentUser.nsfwAllowed !== true || shouldAgeVerifyForAgeGate();
|
|
}
|
|
|
|
function shouldShowAgeGateForGuildContentLevel(a0) { // fn#43979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:889, offset: 0x0116461c, size: 62 bytes, params: 2, frame: 14
|
|
var guild;
|
|
if (shouldShowAgeGateForCurrentUser()) {
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
guild = GuildStore.getGuild(a0);
|
|
return guild != null && isGuildNSFW(guild);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function shouldShowAgeGateForChannelId(a0) { // fn#43980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1021, offset: 0x0116465a, size: 59 bytes, params: 2, frame: 14
|
|
const shouldShowAgeGateForCurrentUser2 = shouldShowAgeGateForCurrentUser();
|
|
return !(shouldShowAgeGateForCurrentUser2 ? a0 == null : !shouldShowAgeGateForCurrentUser2) && isChannelContentGated(ChannelStore.getChannel(a0));
|
|
}
|
|
|
|
function shouldShowAgeGateForVoiceChannel(a0) { // fn#43981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1144, offset: 0x01164695, size: 30 bytes, params: 2, frame: 12
|
|
return shouldAgeVerifyForAgeGate() && shouldShowAgeGateForChannelId(a0);
|
|
}
|
|
|
|
function isChannelOrGuildNSFW(a0) { // fn#43982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:1234, offset: 0x011646b3, size: 64 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
var isGuildNSFWBinding;
|
|
var guildStoreBinding;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = a0.isNSFW();
|
|
if (value) {
|
|
r1 = value;
|
|
} else {
|
|
isGuildNSFWBinding = isGuildNSFW;
|
|
guildStoreBinding = GuildStore;
|
|
value = guildStoreBinding.getGuild(a0.guild_id);
|
|
value = isGuildNSFWBinding(value);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function userNeedsAgeGate() { // fn#43983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2365, offset: 0x011646f3, size: 96 bytes, params: 1, frame: 15
|
|
var r0;
|
|
var defaultImport;
|
|
var value4;
|
|
var binding;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value3 = currentUser != null;
|
|
if (value3) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value4 = defaultImport.extractTimestamp(currentUser.id);
|
|
binding = env0_10;
|
|
r0 = value4 > binding.getTime();
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
r0 = r0 && currentUser.nsfwAllowed == null;
|
|
return r0;
|
|
}
|
|
|
|
function guildNeedsAgeGate({nsfwLevel}) { // fn#43984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2519, offset: 0x01164753, size: 28 bytes, params: 2, frame: 11
|
|
return env0_11.includes(nsfwLevel);
|
|
}
|
|
|
|
function useAgeGateVerifyContentForGuild(a0) { // fn#43985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2729, offset: 0x0116476f, size: 927 bytes, params: 2, frame: 25
|
|
var r9;
|
|
const NsfwSpaceWarningModalType = (AgeVerificationAnalyticsUtilsModule).NsfwSpaceWarningModalType;
|
|
var format;
|
|
var defaultImport;
|
|
const value2 = (AgeVerificationUtilsModule).useIsAgeVerified();
|
|
const isGuildNSFW2 = isGuildNSFW(a0);
|
|
const value3 = (FluxModule).useStateFromStores([UserStore], _fun43986);
|
|
const value4 = useShouldAgeVerifyForAgeGate();
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const value5 = Reflect.apply(string, intl, [isGuildNSFW2 ? t.xi46lg : t.ZmwvDc]);
|
|
object = {};
|
|
if (value4) {
|
|
object.title = value5;
|
|
if (value2) {
|
|
format = intl.format;
|
|
object.description = isGuildNSFW2 ? Reflect.apply(format, intl, [t['8tk6bB'], {}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.XQZvwn, {}]);
|
|
object.agreement = intl.string(t.Zt4Mf4);
|
|
object.modalType = NsfwSpaceWarningModalType.NSFW_CHANNEL_AGE_VERIFY;
|
|
} else {
|
|
string = intl.string;
|
|
object.description = isGuildNSFW2 ? Reflect.apply(string, intl, [t.V6Gmu9]) : Reflect.apply(string, intl,
|
|
[t['5rygLk']]);
|
|
object.agreement = intl.string(t.FDSSia);
|
|
object.modalType = NsfwSpaceWarningModalType.NSFW_CHANNEL_AGE_VERIFY;
|
|
}
|
|
} else if (value3) {
|
|
object.title = intl.string(isGuildNSFW2 ? t['H0SG/g'] : t.NEabBa);
|
|
format = intl.format;
|
|
r9 = isGuildNSFW2 ? t['6++3cX'] : t['2kHZes'];
|
|
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
object.description = Reflect.apply(format, intl, [r9,
|
|
{helpURL: defaultImport.getArticleURL(HelpdeskArticles.NSFW_AGE_GATING)}]);
|
|
object.agreement = null;
|
|
object.modalType = NsfwSpaceWarningModalType.NSFW_CHANNEL_UNDERAGE;
|
|
} else {
|
|
object.title = value5;
|
|
object.description = intl.string(isGuildNSFW2 ? t.ZtuRts : t.E4Cd5I);
|
|
object.agreement = intl.string(t.wVq7uo);
|
|
object.modalType = NsfwSpaceWarningModalType.NSFW_CHANNEL_VERIFIED;
|
|
}
|
|
return object;
|
|
function _fun43986() { // fn#43986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:2848, offset: 0x01164567, size: 41 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.nsfwAllowed === false;
|
|
}
|
|
|
|
}
|
|
|
|
function useAgeGateVerifyContent(a0) { // fn#43987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:3974, offset: 0x01164b0e, size: 1286 bytes, params: 2, frame: 22
|
|
var r7;
|
|
var r1;
|
|
var r4;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var format;
|
|
var property;
|
|
var defaultImport;
|
|
var object3;
|
|
const value2 = (AgeVerificationUtilsModule).useIsAgeVerified();
|
|
const value3 = useShouldAgeVerifyForAgeGate();
|
|
const NSFW_SERVER = AgeGateSource.NSFW_SERVER;
|
|
let r6 = a0 === NSFW_SERVER || a0 === AgeGateSource.NSFW_SERVER_INVITE;
|
|
r6 = !r6 ? a0 === AgeGateSource.NSFW_SERVER_INVITE_EMBED : r6;
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [UserStore];
|
|
const value7 = Reflect.apply(useStateFromStores, FluxModule, [object, _fun43988]);
|
|
const JOIN_LARGE_GUILD_UNDERAGE = AgeGateSource.JOIN_LARGE_GUILD_UNDERAGE;
|
|
if (a0 === JOIN_LARGE_GUILD_UNDERAGE) {
|
|
r4 = a0 === AgeGateSource.JOIN_LARGE_GUILD_UNDERAGE ? t['u/xsK9'] : t.MjQbfi;
|
|
object = {};
|
|
string = intl.string;
|
|
object.description = value2 ? Reflect.apply(string, intl, [t.SAoMVJ]) : Reflect.apply(string, intl, [t.SxY4IW]);
|
|
string = intl.string;
|
|
object.agreement = value2 ? Reflect.apply(string, intl, [t.Zt4Mf4]) : Reflect.apply(string, intl, [t.FDSSia]);
|
|
object3 = {};
|
|
object3.verifyTitle = intl.string(r4);
|
|
object3.verifyGateDescription = object.description;
|
|
object3.verifyAgreementButtonText = object.agreement;
|
|
return object3;
|
|
}
|
|
const ACCESS_LARGE_GUILD_UNDERAGE = AgeGateSource.ACCESS_LARGE_GUILD_UNDERAGE;
|
|
if (a0 === ACCESS_LARGE_GUILD_UNDERAGE) {
|
|
r4 = a0 === AgeGateSource.JOIN_LARGE_GUILD_UNDERAGE ? t['u/xsK9'] : t.MjQbfi;
|
|
object = {};
|
|
string = intl.string;
|
|
object.description = value2 ? Reflect.apply(string, intl, [t.SAoMVJ]) : Reflect.apply(string, intl, [t.SxY4IW]);
|
|
string = intl.string;
|
|
object.agreement = value2 ? Reflect.apply(string, intl, [t.Zt4Mf4]) : Reflect.apply(string, intl, [t.FDSSia]);
|
|
object3 = {};
|
|
object3.verifyTitle = intl.string(r4);
|
|
object3.verifyGateDescription = object.description;
|
|
object3.verifyAgreementButtonText = object.agreement;
|
|
return object3;
|
|
}
|
|
if (value2) {
|
|
object = {};
|
|
object.verifyAgreementButtonText = intl.string(t.Zt4Mf4);
|
|
format = intl.format;
|
|
object.verifyGateDescription = r6 ? Reflect.apply(format, intl, [t['8tk6bB'], {}]) : Reflect.apply(format, intl,
|
|
[t.XQZvwn, {}]);
|
|
string = intl.string;
|
|
r6 = r6 ? Reflect.apply(string, intl, [t.xi46lg]) : Reflect.apply(string, intl, [t.ZmwvDc]);
|
|
object.verifyTitle = r6;
|
|
r1 = object;
|
|
} else if (a0 === AgeGateSource.LARGE_GUILD) {
|
|
object = {};
|
|
object.verifyTitle = intl.string(t['7ymzsL']);
|
|
object.verifyGateDescription = intl.string(t.SxY4IW);
|
|
object.verifyAgreementButtonText = intl.string(t.FDSSia);
|
|
r1 = object;
|
|
} else if (value7) {
|
|
if (r6) {
|
|
if (value3) {
|
|
object = {};
|
|
object.verifyAgreementButtonText = intl.string(t.FDSSia);
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.V6Gmu9]) : Reflect.apply(string, intl, [t['5rygLk']]);
|
|
object.verifyGateDescription = r7;
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.xi46lg]) : Reflect.apply(string, intl, [t.ZmwvDc]);
|
|
object.verifyTitle = r7;
|
|
r1 = object;
|
|
} else {
|
|
object = {};
|
|
object.verifyTitle = intl.string(t['H0SG/g']);
|
|
format = intl.format;
|
|
property = t['6++3cX'];
|
|
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
object.verifyGateDescription = Reflect.apply(format, intl, [property,
|
|
{helpURL: defaultImport.getArticleURL(HelpdeskArticles.AGE_GATE)}]);
|
|
object.verifyAgreementButtonText = null;
|
|
r1 = object;
|
|
}
|
|
} else {
|
|
object = {};
|
|
object.verifyAgreementButtonText = intl.string(t.FDSSia);
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.V6Gmu9]) : Reflect.apply(string, intl, [t['5rygLk']]);
|
|
object.verifyGateDescription = r7;
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.xi46lg]) : Reflect.apply(string, intl, [t.ZmwvDc]);
|
|
object.verifyTitle = r7;
|
|
r1 = object;
|
|
}
|
|
} else {
|
|
object = {};
|
|
object.verifyAgreementButtonText = intl.string(t.FDSSia);
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.V6Gmu9]) : Reflect.apply(string, intl, [t['5rygLk']]);
|
|
object.verifyGateDescription = r7;
|
|
string = intl.string;
|
|
r7 = r6 ? Reflect.apply(string, intl, [t.xi46lg]) : Reflect.apply(string, intl, [t.ZmwvDc]);
|
|
object.verifyTitle = r7;
|
|
r1 = object;
|
|
}
|
|
return r1;
|
|
function _fun43988() { // fn#43988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:4189, offset: 0x01164567, size: 41 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.nsfwAllowed === false;
|
|
}
|
|
|
|
}
|
|
|
|
function maybeOpenAgeGateForVoiceChannel(a0) { // fn#43989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6004, offset: 0x01165014, size: 71 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var moduleValue;
|
|
const shouldShowAgeGateForVoiceChannel2 = shouldShowAgeGateForVoiceChannel(a0);
|
|
if (shouldShowAgeGateForVoiceChannel2) {
|
|
moduleValue = require(5075) /* metro dependency 5075: AgeGateModalActionCreators */;
|
|
moduleValue.openAgeGateModal(AgeGateSource.NSFW_VOICE_CHANNEL);
|
|
r0 = true;
|
|
} else {
|
|
r0 = !!shouldShowAgeGateForVoiceChannel2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function maybeShowAgeGate(a0, a1, a2) { // fn#43990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6118, offset: 0x0116505b, size: 167 bytes, params: 4, frame: 15
|
|
var r3;
|
|
var moduleValue;
|
|
let value = a2;
|
|
if (shouldShowAgeGateForGuildContentLevel(a0)) {
|
|
r3 = value == null ? AgeGateSource.NSFW_SERVER : env0_12.has(value) ? value : AgeGateSource.NSFW_SERVER;
|
|
value = require(5075) /* metro dependency 5075: AgeGateModalActionCreators */;
|
|
value.openAgeGateModal(r3);
|
|
} else if (isCurrentUserMissingDateOfBirth() && shouldShowAgeGateForChannelId(a1)) {
|
|
moduleValue = require(5075) /* metro dependency 5075: AgeGateModalActionCreators */;
|
|
moduleValue.openAgeGateModal(value ?? AgeGateSource.NSFW_CHANNEL);
|
|
}
|
|
}
|
|
|
|
function isChannelAgeVerificationGated(a0) { // fn#43991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6468, offset: 0x01165102, size: 65 bytes, params: 2, frame: 13
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
return isChannelOrGuildNSFW(a0) && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).shouldShowTiggerPawtect();
|
|
}
|
|
|
|
function userCannotSeeNSFWContent(a0) { // fn#43992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6594, offset: 0x01165143, size: 69 bytes, params: 2, frame: 14
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
return isChannelOrGuildNSFW(a0) && !(UserStore.getCurrentUser()?.nsfwAllowed === true);
|
|
}
|
|
|
|
function useShouldHideChannelContent(a0) { // fn#43993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:6851, offset: 0x01165188, size: 56 bytes, params: 2, frame: 14
|
|
const value2 = useIsChannelContentGated(a0);
|
|
let value = SpoilerChannelUtilsModule;
|
|
value = value.useIsChannelSpoilerGated(a0);
|
|
return value2 || value;
|
|
}
|
|
|
|
function shouldAgeVerifyForSettingsToggles() { // fn#43994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:7079, offset: 0x011651c0, size: 90 bytes, params: 1, frame: 14
|
|
var value;
|
|
const isFeatureAgeGated = (RegionalFeatureConfigUtilsModule).isFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const COMMANDS_TOGGLE = AgeGatedFeature.COMMANDS_TOGGLE;
|
|
value = Reflect.apply(isFeatureAgeGated, value, [COMMANDS_TOGGLE]);
|
|
return value && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).shouldShowTiggerPawtect();
|
|
}
|
|
|
|
function useShouldAgeVerifyForSettingsToggles() { // fn#43995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5250:7287, offset: 0x0116521a, size: 90 bytes, params: 1, frame: 14
|
|
var value;
|
|
const useIsFeatureAgeGated = (RegionalFeatureConfigUtilsModule).useIsFeatureAgeGated;
|
|
const AgeGatedFeature = (AgeGatedFeatureModule).AgeGatedFeature;
|
|
const COMMANDS_TOGGLE = AgeGatedFeature.COMMANDS_TOGGLE;
|
|
value = Reflect.apply(useIsFeatureAgeGated, value, [COMMANDS_TOGGLE]);
|
|
return value && (require(4813) /* metro dependency 4813: AgeVerificationUtils */).useShouldShowTiggerPawtect();
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun43969, 5072, [1422, 1379, 5073, 1867, 1878, 1229, 661, 1244, 21, 4813, 3835, 4861, 566, 5074, 1948,
|
|
5075, 5087,
|
|
2]) /* metro module 5072, dependencies: [1422, 1379, 5073, 1867, 1878, 1229, 661, 1244, 21, 4813, 3835, 4861, 566, 5074, 1948, 5075, 5087, 2] */;
|