Files
discord-decomp/sources/modules/coded_links/MessageCodedLinkManager.tsx
T
2026-07-28 01:06:53 +03:00

224 lines
12 KiB
TypeScript

/* Metro module 15759; source: modules/coded_links/MessageCodedLinkManager.tsx; dependencies: [7, 6, 15, 17, 18, 5, 7069, 4097, 4096, 4101, 15760, 694, 9439, 6932, 11612, 15767, 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 FindCodedLinks from './findCodedLinks.tsx'; /* Metro dependency 4096 */
import InviteStore from '../../stores/InviteStore.tsx'; /* Metro dependency 4097 */
import AutomaticLifecycleManager from '../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
import GuildTemplateStore from '../guild_templates/GuildTemplateStore.tsx'; /* Metro dependency 7069 */
import SetupLoadFromMessageManagerHandlers from '../messages/setupLoadFromMessageManagerHandlers.tsx'; /* Metro dependency 15767 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as CodedLinkModule from './CodedLink.tsx'; /* Metro dependency 4101 */
function _fun121023(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:6, offset: 0x0253cf26, size: 289 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = AutomaticLifecycleManager;
value = _fun121034(value);
value = new value();
(FileImportTrackerModule).fileFinishedImporting('modules/coded_links/MessageCodedLinkManager.tsx');
exports.default = value;
function _isNativeReflectConstruct_121024() { // fn#121024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:178, offset: 0x0253d047, 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_121024_isNativeReflectConstruct = function() {
return !!result;
})();
}
function resolveMessageCodedLinks({content}) { // fn#121027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:371, offset: 0x0253d0a9, size: 82 bytes, params: 2, frame: 13
let value = FindCodedLinks;
value = value(content);
if (value != null && value.length !== 0) {
value.forEach(_fun121028);
}
function _fun121028({type, code}) { // fn#121028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:467, offset: 0x0253d0fb, size: 876 bytes, params: 2, frame: 16
var environment;
var moduleValue;
var moduleValue2;
const value = environment.__proto__;
const CodedLinkType = (CodedLinkModule).CodedLinkType;
const INVITE = CodedLinkType.INVITE;
if (INVITE === type) {
moduleValue2 = require(15760) /* metro dependency 15760: codedLinkQueue */;
moduleValue2.queueMessageLinkFetch(env1_8(_fun121030));
return undefined;
}
const TEMPLATE = CodedLinkType.TEMPLATE;
if (TEMPLATE === type) {
moduleValue = require(15760) /* metro dependency 15760: codedLinkQueue */;
moduleValue.queueMessageLinkFetch(env1_8(_fun121033));
return undefined;
}
const BUILD_OVERRIDE = CodedLinkType.BUILD_OVERRIDE;
if (BUILD_OVERRIDE === type) {
return undefined;
}
const MANUAL_BUILD_OVERRIDE = CodedLinkType.MANUAL_BUILD_OVERRIDE;
if (MANUAL_BUILD_OVERRIDE === type) {
return undefined;
}
const EVENT = CodedLinkType.EVENT;
if (EVENT === type) {
return undefined;
}
const CHANNEL_LINK = CodedLinkType.CHANNEL_LINK;
if (CHANNEL_LINK === type) {
return undefined;
}
const ACTIVITY_BOOKMARK = CodedLinkType.ACTIVITY_BOOKMARK;
if (ACTIVITY_BOOKMARK === type) {
return undefined;
}
const EMBEDDED_ACTIVITY_INVITE = CodedLinkType.EMBEDDED_ACTIVITY_INVITE;
if (EMBEDDED_ACTIVITY_INVITE === type) {
return undefined;
}
const GUILD_PRODUCT = CodedLinkType.GUILD_PRODUCT;
if (GUILD_PRODUCT === type) {
return undefined;
}
const SERVER_SHOP = CodedLinkType.SERVER_SHOP;
if (SERVER_SHOP === type) {
return undefined;
}
const SOCIAL_LAYER_STOREFRONT = CodedLinkType.SOCIAL_LAYER_STOREFRONT;
if (SOCIAL_LAYER_STOREFRONT === type) {
return undefined;
}
const SOCIAL_LAYER_STOREFRONT_APP = CodedLinkType.SOCIAL_LAYER_STOREFRONT_APP;
if (SOCIAL_LAYER_STOREFRONT_APP === type) {
return undefined;
}
const QUESTS_EMBED = CodedLinkType.QUESTS_EMBED;
if (QUESTS_EMBED === type) {
return undefined;
}
const APP_DIRECTORY_STOREFRONT = CodedLinkType.APP_DIRECTORY_STOREFRONT;
if (APP_DIRECTORY_STOREFRONT === type) {
return undefined;
}
const APP_DIRECTORY_STOREFRONT_SKU = CodedLinkType.APP_DIRECTORY_STOREFRONT_SKU;
if (APP_DIRECTORY_STOREFRONT_SKU === type) {
return undefined;
}
const APP_OAUTH2_LINK = CodedLinkType.APP_OAUTH2_LINK;
if (APP_OAUTH2_LINK === type) {
return undefined;
}
const COLLECTIBLES_SHOP = CodedLinkType.COLLECTIBLES_SHOP;
if (COLLECTIBLES_SHOP === type) {
return undefined;
}
const EXPERIMENT = CodedLinkType.EXPERIMENT;
if (EXPERIMENT === type) {
return undefined;
}
const APP_DIRECTORY_PROFILE = CodedLinkType.APP_DIRECTORY_PROFILE;
if (APP_DIRECTORY_PROFILE === type) {
(require(11612) /* metro dependency 11612: ApplicationDirectoryActionCreators */).getEmbedApplication(code);
return undefined;
}
const Error = global.Error;
throw Error('Unknown coded link type: ' + type);
function* _fun121030() { // fn#121030, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:565, offset: 0x0253d472, size: 148 bytes, params: 1, frame: 17
var environment;
if (true) {
value = environment.__proto__.__proto__.__proto__;
var binding = env3_10;
if (binding.getInvite(env1_0) == null) {
binding = env3_1;
var binding2 = env3_2;
value = binding(binding2[11]);
var dispatch = value.dispatch;
var binding3 = env1_0;
Reflect.apply(dispatch, value, [{type: 'INVITE_RESOLVE', code: binding3}]);
value = binding(binding2[12])(binding3);
yield value.then(_fun121031);
value = undefined;
if (false) {
return value;
}
}
}
function _fun121031({invite, code, banned}) { // fn#121031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:674, offset: 0x0253d506, size: 142 bytes, params: 2, frame: 15
var value;
if (invite != null) {
value = environment.__proto__.__proto__.__proto__.__proto__;
value = env4_1(env4_2[11]);
value.dispatch({type: 'INVITE_RESOLVE_SUCCESS', invite: invite, code: code});
} else {
value = environment.__proto__.__proto__.__proto__.__proto__;
value = env4_1(env4_2[11]);
value.dispatch({type: 'INVITE_RESOLVE_FAILURE', code: code, banned: banned});
}
}
}
function* _fun121033() { // fn#121033, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:931, offset: 0x0253d59f, size: 96 bytes, params: 1, frame: 14
if (true) {
value = environment.__proto__.__proto__.__proto__;
if (env3_9.getGuildTemplate(env1_0) == null) {
value = env3_1(env3_2[13]);
yield value.resolveGuildTemplate(env1_0);
value = undefined;
if (false) {
return value;
}
}
}
}
}
}
function _fun121034(a0) { // fn#121034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:1904, offset: 0x0253d5ff, size: 42 bytes, params: 2, frame: 14
const MessageCodedLinkManager2 = MessageCodedLinkManager;
Inherits(MessageCodedLinkManager2, a0);
return CreateClass(MessageCodedLinkManager2);
function MessageCodedLinkManager() { // fn#121035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15967:1916, offset: 0x0253d629, size: 138 bytes, params: 1, frame: 20
env1_4(this, MessageCodedLinkManager);
const value3 = env1_6(MessageCodedLinkManager);
const value6 = env1_5(this, _isNativeReflectConstruct_121024() ? global.Reflect.construct(value3, [],
env1_6(this).constructor) : value3.apply(this, undefined));
(SetupLoadFromMessageManagerHandlers)(value6,
resolveMessageCodedLinks);
return value6;
}
}
}
global.__d(_fun121023, 15759, [7, 6, 15, 17, 18, 5, 7069, 4097, 4096, 4101, 15760, 694, 9439, 6932, 11612, 15767,
4860,
2]) /* metro module 15759, dependencies: [7, 6, 15, 17, 18, 5, 7069, 4097, 4096, 4101, 15760, 694, 9439, 6932, 11612, 15767, 4860, 2] */;