152 lines
8.7 KiB
TypeScript
152 lines
8.7 KiB
TypeScript
/* Metro module 15653; source: modules/age_gate/native/AgeGateManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 1379, 1934, 3969, 1229, 661, 5072, 5080, 15654, 1962, 676, 4860, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import SelectedGuildStore from '../../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
|
|
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as AgeGateConstantsModule from '../AgeGateConstants.tsx'; /* Metro dependency 1229 */
|
|
import * as AgeGateUtilsModule from '../AgeGateUtils.tsx'; /* Metro dependency 5072 */
|
|
|
|
function _fun119985(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:6, offset: 0x0251d347, size: 358 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = AgeGateConstantsModule;
|
|
const env0_12 = value.EXISTING_USER_AGE_GATE_MODAL_KEY;
|
|
const env0_13 = value.AgeGateSource;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_14 = value.ChannelTypes;
|
|
const env0_15 = value.GuildNSFWContentLevel;
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun119989(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/age_gate/native/AgeGateManager.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_119986() { // fn#119986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:307, offset: 0x0251d4ad, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_119986_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun119989(a0) { // fn#119989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:510, offset: 0x0251d50f, size: 176 bytes, params: 2, frame: 16
|
|
const AgeGateManager2 = AgeGateManager;
|
|
Inherits(AgeGateManager2, a0);
|
|
return CreateClass(AgeGateManager2, [{key: 'handlePostConnectionOpen', value: value_119991}, {key: 'handleChannelSelect',
|
|
value: value_119992}, {key: 'handleAgeGateModalOpen', value: value_119993}, {key: 'handleAgeGateModalClose',
|
|
value: function() {
|
|
importDefault(dependencyMap[12]).popWithKey(EXISTING_USER_AGE_GATE_MODAL_KEY);
|
|
}}, {key: 'handleGuildUpdate', value: value_119997}]);
|
|
function AgeGateManager(a0) { // fn#119990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:522, offset: 0x0251d5bf, size: 197 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_4;
|
|
binding(this, AgeGateManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_7(AgeGateManager);
|
|
binding = env1_6;
|
|
if (_isNativeReflectConstruct_119986()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_7(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {POST_CONNECTION_OPEN: value.handlePostConnectionOpen, CHANNEL_SELECT: value.handleChannelSelect,
|
|
AGE_GATE_MODAL_OPEN: value.handleAgeGateModalOpen, AGE_GATE_MODAL_CLOSE: value.handleAgeGateModalClose,
|
|
GUILD_UPDATE: value.handleGuildUpdate};
|
|
return value;
|
|
}
|
|
|
|
function value_119991() { // fn#119991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:1057, offset: 0x0251d684, size: 67 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
(AgeGateUtilsModule).maybeShowAgeGate(SelectedGuildStore.getGuildId(),
|
|
SelectedChannelStore.getChannelId());
|
|
}
|
|
|
|
function value_119992({guildId, channelId}) { // fn#119992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:1174, offset: 0x0251d6c7, size: 108 bytes, params: 2, frame: 16
|
|
const value = environment.__proto__;
|
|
if (guildId != null && ChannelStore.getChannel(channelId)?.type !== ChannelTypes.GUILD_VOICE) {
|
|
(require(5072) /* metro dependency 5072: AgeGateUtils */).maybeShowAgeGate(guildId, channelId);
|
|
}
|
|
}
|
|
|
|
function value_119993({source}) { // fn#119993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:1349, offset: 0x0251d733, size: 80 bytes, params: 2, frame: 17
|
|
const defaultImport = ModalActionCreators;
|
|
defaultImport.pushLazy(env1_3(_fun119995), {source: source}, EXISTING_USER_AGE_GATE_MODAL_KEY);
|
|
function* _fun119995() { // fn#119995, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:1391, offset: 0x0251d78e, size: 143 bytes, params: 1, frame: 17
|
|
var object;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
const binding = env3_0;
|
|
const binding2 = env3_2;
|
|
const value3 = binding(binding2[14]);
|
|
let property = binding2[13];
|
|
yield value3(property, binding2.paths);
|
|
const value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
property = value4.default;
|
|
const AUTH = env3_13.AUTH;
|
|
if (AgeGateManager === AUTH) {
|
|
object = {};
|
|
object.animation = env3_0(env3_2[15]).ModalAnimation.SLIDE_IN_OUT;
|
|
property.modalConfig = object;
|
|
}
|
|
return property;
|
|
}
|
|
|
|
}
|
|
|
|
function value_119997({guild}) { // fn#119997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15861:1658, offset: 0x0251d847, size: 112 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
if (guildId != null && guild.id === guildId && guild.owner_configured_content_level === GuildNSFWContentLevel.AGE_RESTRICTED) {
|
|
value = require(5072) /* metro dependency 5072: AgeGateUtils */;
|
|
value.maybeShowAgeGate(guild.id, null);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun119985, 15653, [5, 6, 7, 15, 17, 18, 1379, 1934, 3969, 1229, 661, 5072, 5080, 15654, 1962, 676, 4860,
|
|
2]) /* metro module 15653, dependencies: [5, 6, 7, 15, 17, 18, 1379, 1934, 3969, 1229, 661, 5072, 5080, 15654, 1962, 676, 4860, 2] */;
|