Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,485 @@
|
||||
/* Metro module 7232; source: modules/share/formatResults.tsx; dependencies: [5, 7233, 1379, 3784, 1878, 7244, 661, 4603, 7234, 7242, 1244, 1360, 22, 2] */
|
||||
function _fun57929(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:6, offset: 0x016ba109, size: 367 bytes, params: 8, frame: 20
|
||||
let env0_0 = require;
|
||||
const _arrayLikeToArray_57932 = function(a0, a1) {
|
||||
var r0;
|
||||
var r1;
|
||||
var r2;
|
||||
var value3;
|
||||
var length;
|
||||
var value5;
|
||||
var value = undefined;
|
||||
var value2 = value == null;
|
||||
reducibleJoin2: while (true) {
|
||||
if (value2) {
|
||||
r0 = value2;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
value3 = value > a0.length;
|
||||
r0 = value3;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
reducibleJoin4: while (true) {
|
||||
if (r0) {
|
||||
length = a0.length;
|
||||
r1 = length;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
r1 = value;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
value = (0, global.Array)(r1);
|
||||
var value4 = 0;
|
||||
if (value4 < r1) {
|
||||
r2 = value4;
|
||||
reducibleLoop5: while (true) {
|
||||
value[r2] = a0[r2];
|
||||
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
||||
if (value5 < r1) {
|
||||
r2 = value5;
|
||||
continue reducibleLoop5;
|
||||
}
|
||||
break reducibleLoop5;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
const closure = getChannelIdFromDestinationId;
|
||||
const filterResults = function(a0, a1) {
|
||||
var value = a2;
|
||||
var env0_0 = a1;
|
||||
var env0_1 = value !== undefined ? value : canShareToChannel;
|
||||
return a0.filter(_fun57942);
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const quickSwitcherStore = importDefault(7233) /* metro dependency 7233: QuickSwitcherStore */;
|
||||
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
||||
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
||||
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
||||
const env0_8 = (require(7244) /* metro dependency 7244: ShareConstants */).isAllowedType;
|
||||
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
||||
const env0_9 = constantsModule.Permissions;
|
||||
const env0_10 = constantsModule.ChannelTypes;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/share/formatResults.tsx');
|
||||
exports.default = formatResults;
|
||||
exports.getDestinationIdFromChannelId = function(a0) {
|
||||
var value2 = ChannelStore.getChannel(a0);
|
||||
return value2?.type === ChannelTypes.DM ? {type: 'user', id: value2.recipients[0]} : {type: 'channel', id: a0};
|
||||
};
|
||||
exports.destinationKey = function({type, id}) {
|
||||
return '' + type + '-' + id;
|
||||
};
|
||||
exports.getChannelIdFromDestinationId = closure;
|
||||
exports.getOrResolveChannelIdFromDestinationId = function() {
|
||||
return _getOrResolveChannelIdFromDestinationId.apply(this, arguments);
|
||||
};
|
||||
exports.formatResultsWithHeaders = formatResultsWithHeaders;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_57930(a0, a1) { // fn#57930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:227, offset: 0x016ba278, size: 370 bytes, params: 3, frame: 20
|
||||
var r6;
|
||||
var r9;
|
||||
var r5;
|
||||
var value3;
|
||||
var regexp;
|
||||
const env0_0 = a0;
|
||||
const Symbol = global.Symbol;
|
||||
let value = typeof Symbol !== 'undefined';
|
||||
let r1 = value && a0[global.Symbol.iterator];
|
||||
r1 = !r1 ? a0['@@iterator'] : r1;
|
||||
if (r1) {
|
||||
value = r1.call(a0);
|
||||
return value.next.bind(value);
|
||||
}
|
||||
const Array = global.Array;
|
||||
if (Array.isArray(a0)) {
|
||||
if (r1) {
|
||||
}
|
||||
return _fun57931;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_57932(a0, value);
|
||||
r5 = value;
|
||||
} else {
|
||||
value3 = ({}).toString.call(a0).slice(8, -1);
|
||||
r6 = value3 === 'Object' && a0.constructor;
|
||||
r9 = r6 ? a0.constructor.name : value3;
|
||||
if (r9 === 'Map') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Set') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Arguments') {
|
||||
value = _arrayLikeToArray_57932(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_57932(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun57931;
|
||||
}
|
||||
const TypeError = global.TypeError;
|
||||
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
||||
}
|
||||
|
||||
function getChannelIdFromDestinationId(a0) { // fn#57933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:1137, offset: 0x016ba3ea, size: 62 bytes, params: 2, frame: 12
|
||||
if (a0.type === 'channel') {
|
||||
return a0.id;
|
||||
}
|
||||
return ChannelStore.getDMFromUserId(a0.id) ?? undefined;
|
||||
}
|
||||
|
||||
function _getOrResolveChannelIdFromDestinationId() { // fn#57934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:1267, offset: 0x016ba428, size: 48 bytes, params: 1, frame: 14
|
||||
return env0_3(_fun57936).apply(this, arguments);
|
||||
}
|
||||
|
||||
function createAutocompleterResultForDestination(a0) { // fn#57937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:1560, offset: 0x016ba4d4, size: 142 bytes, params: 2, frame: 14
|
||||
var r0;
|
||||
var value2;
|
||||
var value3;
|
||||
var object2;
|
||||
if (a0.type === 'user') {
|
||||
value2 = UserStore.getUser(a0.id);
|
||||
value3 = null;
|
||||
if (value3 != value2) {
|
||||
object2 = {};
|
||||
object2.type = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes.USER;
|
||||
object2.record = value2;
|
||||
object2.score = 0;
|
||||
r0 = object2;
|
||||
} else {
|
||||
r0 = value3;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
return (importDefault(7242) /* metro dependency 7242: createAutocompleterResultForChannelId */)(a0.id);
|
||||
}
|
||||
|
||||
function canShareToChannel(a0, a1) { // fn#57938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:1760, offset: 0x016ba562, size: 270 bytes, params: 3, frame: 19
|
||||
var r4;
|
||||
var r0;
|
||||
var r1;
|
||||
let value = a1;
|
||||
const type = a0.type;
|
||||
const AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
|
||||
const USER = AutocompleterResultTypes.USER;
|
||||
if (type === USER) {
|
||||
if (value) {
|
||||
r1 = value;
|
||||
} else {
|
||||
value = ChannelStore.getDMChannelFromUserId(a0.record.id);
|
||||
value = value != null;
|
||||
r1 = value;
|
||||
}
|
||||
r0 = r1;
|
||||
} else {
|
||||
value = a0.type === AutocompleterResultTypes.GROUP_DM;
|
||||
if (value) {
|
||||
r0 = value;
|
||||
} else {
|
||||
r4 = a0.record.type !== ChannelTypes.GUILD_FORUM && a0.record.type !== ChannelTypes.GUILD_MEDIA;
|
||||
r4 = r4 && (PermissionStore.can(Permissions.VIEW_CHANNEL,
|
||||
a0.record) && PermissionStore.can(Permissions.SEND_MESSAGES, a0.record));
|
||||
r0 = r4;
|
||||
}
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function mergeAndDedupeResultsWithHeaders(a0, a1) { // fn#57939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:2077, offset: 0x016ba670, size: 299 bytes, params: 3, frame: 24
|
||||
var r1;
|
||||
var r3;
|
||||
var r4;
|
||||
var r12;
|
||||
var r13;
|
||||
var value2;
|
||||
var value3;
|
||||
var value4;
|
||||
var done;
|
||||
var value5;
|
||||
var add;
|
||||
var value6;
|
||||
var value11;
|
||||
var type;
|
||||
var AutocompleterResultTypes;
|
||||
var HEADER;
|
||||
var record;
|
||||
var id;
|
||||
var has;
|
||||
var push;
|
||||
var value12;
|
||||
const Set = global.Set;
|
||||
const set = new Set();
|
||||
reducibleJoin3: while (true) {
|
||||
if (a1 == null) {
|
||||
break reducibleJoin3;
|
||||
}
|
||||
value2 = environment;
|
||||
value3 = _createForOfIteratorHelperLoose_57930(a1);
|
||||
value4 = value3();
|
||||
done = value4.done;
|
||||
if (done) {
|
||||
break reducibleJoin3;
|
||||
}
|
||||
r1 = value4;
|
||||
reducibleLoop2: while (true) {
|
||||
value5 = r1.value;
|
||||
add = set.add;
|
||||
Reflect.apply(add, set, [value5]);
|
||||
value6 = value3();
|
||||
done = value6.done;
|
||||
if (done) {
|
||||
break reducibleJoin3;
|
||||
}
|
||||
r1 = value6;
|
||||
continue reducibleLoop2;
|
||||
}
|
||||
}
|
||||
const items2 = [];
|
||||
const _createForOfIteratorHelperLoose_57930Binding = _createForOfIteratorHelperLoose_57930;
|
||||
const value8 = undefined;
|
||||
const value9 = _createForOfIteratorHelperLoose_57930Binding(a0);
|
||||
const value10 = value9();
|
||||
done = value10.done;
|
||||
if (!done) {
|
||||
r3 = value10;
|
||||
r4 = value8;
|
||||
reducibleLoop4: while (true) {
|
||||
value11 = r3.value;
|
||||
reducibleJoin10: while (true) {
|
||||
if (value11 == null) {
|
||||
r13 = r4;
|
||||
break reducibleJoin10;
|
||||
}
|
||||
type = value11.type;
|
||||
AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
|
||||
HEADER = AutocompleterResultTypes.HEADER;
|
||||
if (type === HEADER) {
|
||||
r13 = value11;
|
||||
break reducibleJoin10;
|
||||
}
|
||||
record = value11.record;
|
||||
id = record.id;
|
||||
has = set.has;
|
||||
if (Reflect.apply(has, set, [id])) {
|
||||
r13 = r4;
|
||||
break reducibleJoin10;
|
||||
}
|
||||
add = set.add;
|
||||
Reflect.apply(add, set, [id]);
|
||||
reducibleJoin9: while (true) {
|
||||
if (r4 == null) {
|
||||
r12 = r4;
|
||||
break reducibleJoin9;
|
||||
}
|
||||
push = items2.push;
|
||||
Reflect.apply(push, items2, [r4]);
|
||||
r12 = value8;
|
||||
break reducibleJoin9;
|
||||
}
|
||||
push = items2.push;
|
||||
Reflect.apply(push, items2, [value11]);
|
||||
r13 = r12;
|
||||
break reducibleJoin10;
|
||||
}
|
||||
value12 = value9();
|
||||
done = value12.done;
|
||||
if (done) {
|
||||
break reducibleLoop4;
|
||||
}
|
||||
r3 = value12;
|
||||
r4 = r13;
|
||||
continue reducibleLoop4;
|
||||
}
|
||||
}
|
||||
return items2;
|
||||
}
|
||||
|
||||
function getLastChannelResult(a0) { // fn#57940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:2482, offset: 0x016ba79b, size: 156 bytes, params: 2, frame: 19
|
||||
const value = null;
|
||||
if (value == a0) {
|
||||
return value;
|
||||
}
|
||||
const value3 = (importDefault(7242) /* metro dependency 7242: createAutocompleterResultForChannelId */)(a0);
|
||||
return value == value3 ? value : isAllowedType(value3) && (value3.type === (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes.USER || PermissionStore.can(Permissions.VIEW_CHANNEL,
|
||||
value3.record)) ? value3 : value;
|
||||
}
|
||||
|
||||
function filterResults(a0, a1) { // fn#57941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:2720, offset: 0x016ba837, size: 49 bytes, params: 3, frame: 12
|
||||
const value = a2;
|
||||
const env0_0 = a1;
|
||||
const env0_1 = value !== undefined ? value : canShareToChannel;
|
||||
return a0.filter(_fun57942);
|
||||
}
|
||||
|
||||
function formatResults({results, hasQuery, queryMode, frequentChannels, targetDestination, selectedDestinations, pinnedDestinations, originDestination, channelFilter, includeMissingDMs}) { // fn#57943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:2964, offset: 0x016ba8e3, size: 416 bytes, params: 2, frame: 29
|
||||
var r0;
|
||||
if (hasQuery) {
|
||||
return mergeAndDedupeResultsWithHeaders(filterResults(results, includeMissingDMs, channelFilter));
|
||||
}
|
||||
let value = null;
|
||||
const r7 = value == pinnedDestinations ? [] : pinnedDestinations.length > 0 ? pinnedDestinations.map(function(a0) {
|
||||
return createAutocompleterResultForDestination(a0);
|
||||
}) : [];
|
||||
const channelHistory = QuickSwitcherStore.getChannelHistory();
|
||||
const r13 = channelHistory.length > 0 ? channelHistory.map(_fun57945) : [];
|
||||
const r12 = frequentChannels.length > 0 ? frequentChannels.map(_fun57946) : [];
|
||||
const filterResultsBinding = filterResults;
|
||||
const items2 = [];
|
||||
const value7 = arraySpread(items2, r7, 0, targetDestination);
|
||||
items2[value7] = value != targetDestination ? createAutocompleterResultForDestination(targetDestination) : value;
|
||||
arraySpread(items2, r12, arraySpread(items2, r13, value7 + 1, targetDestination), targetDestination);
|
||||
const value9 = filterResultsBinding(items2, includeMissingDMs, channelFilter);
|
||||
const r6 = value == originDestination || value != (value == selectedDestinations ? undefined : selectedDestinations.find(_fun57947)) ? [] : [originDestination.id];
|
||||
if (value != queryMode) {
|
||||
r0 = mergeAndDedupeResultsWithHeaders(value9.filter(function({type}) {
|
||||
return type === queryMode;
|
||||
}), r6);
|
||||
} else {
|
||||
value = mergeAndDedupeResultsWithHeaders(value9, r6);
|
||||
value = value.slice(0, 15);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function formatResultsWithHeaders({results, selectedResult, hasNonEmptyQuery, queryMode, selectedChannelId, frequentChannels}) { // fn#57952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:4242, offset: 0x016bab8b, size: 447 bytes, params: 2, frame: 28
|
||||
var r0;
|
||||
var items2;
|
||||
var moduleValue2;
|
||||
const r4 = selectedResult != null ? [selectedResult.record.id] : [];
|
||||
const autocompleterModule = require(7234) /* metro dependency 7234: autocompleter */;
|
||||
const createHeaderResult = autocompleterModule.createHeaderResult;
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
const string = intl.string;
|
||||
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
||||
const headerResult = Reflect.apply(createHeaderResult, autocompleterModule, [Reflect.apply(string, intl,
|
||||
[t.qm9dSj])]);
|
||||
if (hasNonEmptyQuery) {
|
||||
items2 = [headerResult];
|
||||
arraySpread(items2, mergeAndDedupeResultsWithHeaders(results.filter(isAllowedType), r4), 1, require);
|
||||
return items2;
|
||||
}
|
||||
const value2 = frequentChannels.map(_fun57953);
|
||||
const value3 = value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
||||
const value4 = value3.filter(isAllowedType);
|
||||
const mergeAndDedupeResultsWithHeadersBinding = mergeAndDedupeResultsWithHeaders;
|
||||
if (queryMode != null) {
|
||||
items2 = [headerResult];
|
||||
arraySpread(items2, value4.filter(function({type}) {
|
||||
return type === queryMode;
|
||||
}), 1, require);
|
||||
r0 = items2;
|
||||
} else {
|
||||
moduleValue2 = autocompleterModule;
|
||||
items2 = [moduleValue2.createHeaderResult(intl.string(t['80lOZ1']))];
|
||||
items2[1] = getLastChannelResult(selectedChannelId);
|
||||
items2[2] = headerResult;
|
||||
arraySpread(items2, value4, 3, require);
|
||||
r0 = items2;
|
||||
}
|
||||
return mergeAndDedupeResultsWithHeadersBinding(r0, r4);
|
||||
}
|
||||
|
||||
function* _fun57936(a0) { // fn#57936, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:1368, offset: 0x016ba461, size: 115 bytes, params: 2, frame: 15
|
||||
var binding;
|
||||
var binding2;
|
||||
var property;
|
||||
var getOrEnsurePrivateChannel;
|
||||
var id;
|
||||
var value4;
|
||||
var error;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
value = environment.__proto__.__proto__;
|
||||
const value3 = env2_13(a0);
|
||||
if (value3 != null) {
|
||||
return value3;
|
||||
}
|
||||
if (a0.type !== 'user') {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
binding = env2_1;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
binding2 = env2_2;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
property = binding2[7];
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
value = binding(property);
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
getOrEnsurePrivateChannel = value.getOrEnsurePrivateChannel;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
id = a0.id;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
value = Reflect.apply(getOrEnsurePrivateChannel, value, [id]);
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
yield value;
|
||||
try {
|
||||
value = undefined;
|
||||
value4 = false;
|
||||
} catch (error) {
|
||||
return undefined;
|
||||
}
|
||||
return value4 ? value : value;
|
||||
}
|
||||
|
||||
function _fun57942(a0) { // fn#57942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:2785, offset: 0x016ba868, size: 123 bytes, params: 2, frame: 17
|
||||
const value = environment.__proto__;
|
||||
return (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(a0) && (a0.type === (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes.HEADER || isAllowedType(a0) && env0_1(a0,
|
||||
require));
|
||||
}
|
||||
|
||||
function _fun57945(a0) { // fn#57945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:3357, offset: 0x016baa83, size: 35 bytes, params: 2, frame: 11
|
||||
const value = environment.__proto__;
|
||||
return (importDefault(7242) /* metro dependency 7242: createAutocompleterResultForChannelId */)(a0);
|
||||
}
|
||||
|
||||
function _fun57946({id}) { // fn#57946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:3397, offset: 0x016baaa6, size: 40 bytes, params: 2, frame: 11
|
||||
const value = environment.__proto__;
|
||||
return (importDefault(7242) /* metro dependency 7242: createAutocompleterResultForChannelId */)(id);
|
||||
}
|
||||
|
||||
function _fun57947(a0) { // fn#57947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7410:3546, offset: 0x016baace, size: 49 bytes, params: 2, frame: 13
|
||||
let value = environment.__proto__;
|
||||
value = require(22) /* metro dependency 22 */;
|
||||
return value.isEqual(a0, originDestination);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user