513 lines
22 KiB
TypeScript
513 lines
22 KiB
TypeScript
/* Metro module 15380; source: modules/activities/panel/native/ActivityInviteSheet.tsx; dependencies: [57, 31, 27, 9208, 9163, 661, 4118, 482, 33, 4501, 697, 9161, 6771, 6789, 4080, 8743, 9153, 11328, 566, 9164, 6275, 6758, 1244, 1305, 9165, 6984, 15381, 2] */
|
|
function _fun117571(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:6, offset: 0x024b87cf, size: 653 bytes, params: 8, frame: 23
|
|
var object4;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(9208) /* metro dependency 9208: InstantInviteSendStateStore */;
|
|
const env0_6 = value.setSendState;
|
|
const env0_7 = value.useInstantInviteSendStates;
|
|
const inviteSuggestionsStore = importDefault(9163) /* metro dependency 9163: InviteSuggestionsStore */;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).ActivityActionTypes;
|
|
value = require(4118) /* metro dependency 4118: Constants */;
|
|
const env0_10 = value.InviteSendStates;
|
|
const env0_11 = value.InviteTargetTypes;
|
|
const env0_12 = (require(482) /* metro dependency 482: Constants */).NOOP_NULL;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_13 = value.jsx;
|
|
const env0_14 = value.Fragment;
|
|
const env0_15 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object4 = {};
|
|
const object6 = {'height': 16, 'width': '80%', 'margin': 16, 'marginBottom': 8};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
let BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object6.backgroundColor = BACKGROUND_MOD_MUTED;
|
|
object4.placeholderHeader = object6;
|
|
const object7 = {'height': 16, 'width': '40%', 'margin': 16};
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object7.backgroundColor = BACKGROUND_MOD_MUTED;
|
|
object4.placeholderLabel = object7;
|
|
object4.emptyState = {backgroundColor: 'transparent'};
|
|
const object8 = {borderTopWidth: 1};
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object8.borderColor = BORDER_SUBTLE;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.marginTop = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.paddingVertical = PX_8;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object8.paddingHorizontal = PX_12;
|
|
object8.flexDirection = 'column';
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object8.gap = PX_12;
|
|
object4.searchAndShareContainer = object8;
|
|
const env0_16 = Reflect.apply(createStyles, value, [object4]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/panel/native/ActivityInviteSheet.tsx');
|
|
exports.default = ActivityInviteSheet;
|
|
}
|
|
|
|
function Loading_117572() { // fn#117572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:947, offset: 0x024b8a5c, size: 167 bytes, params: 1, frame: 22
|
|
var push;
|
|
var jsxRuntimeEnv0_13Binding;
|
|
var UserPlaceholderRow;
|
|
var value3;
|
|
const styles = useStyles();
|
|
const items2 = [];
|
|
let r2 = 0;
|
|
reducibleLoop1: while (true) {
|
|
push = items2.push;
|
|
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
|
|
UserPlaceholderRow = importDefault(9161) /* metro dependency 9161: UserPlaceholderRow */;
|
|
Reflect.apply(push, items2, [<UserPlaceholderRow row={r2} key={r2} />]);
|
|
value3 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value3 < 10) {
|
|
r2 = value3;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
return (
|
|
<>
|
|
<View style={styles.placeholderHeader} />
|
|
<View style={styles.placeholderLabel} />
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function ActivityInviteSheet({activity}) { // fn#117573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:1221, offset: 0x024b8b03, size: 1021 bytes, params: 2, frame: 39
|
|
var jsxRuntimeEnv0_14Binding;
|
|
var SearchField;
|
|
var items2;
|
|
const EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
|
|
var value;
|
|
const styles = useStyles();
|
|
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const ACTIVITY_INVITE_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).ACTIVITY_INVITE_SHEET;
|
|
const analyticsLocations = defaultImport(ACTIVITY_INVITE_SHEET).analyticsLocations;
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value2 = Reflect.apply(useState, binding, [null]);
|
|
const binding2 = env0_3;
|
|
const value3 = binding2(value2, 2);
|
|
const property = value3[0];
|
|
const env0_2 = value3[1];
|
|
const value5 = binding.useCallback(_fun117575, [activity, useInstantInviteSendStates(function(a0) {
|
|
return a0;
|
|
})]);
|
|
const value6 = binding.useCallback(_fun117576, [analyticsLocations]);
|
|
const value7 = binding.useCallback(_fun117577, [activity]);
|
|
const inviteSuggestionRows = (require(566) /* metro dependency 566: flux */).useStateFromStores([InviteSuggestionsStore],
|
|
function() {
|
|
return InviteSuggestionsStore.getInviteSuggestionRows();
|
|
});
|
|
useState = binding.useState;
|
|
const value8 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value8[0];
|
|
var env0_4 = value8[1];
|
|
binding.useEffect(_fun117582, []);
|
|
let r7 = inviteSuggestionRows.length === 0 && property2;
|
|
let r14 = inviteSuggestionRows.length === 0 && !property2;
|
|
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const object = {'showGradient': null, 'scrollable': true, 'startExpanded': true};
|
|
let r10 = property != null || !r7;
|
|
r10 = !r10 ? !r14 : r10;
|
|
object.showGradient = r10;
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.header = <BottomSheetTitleHeader title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['OzOM/q'])} />;
|
|
if (property != null) {
|
|
r7 = <EmptyState style={styles.emptyState} Illustration={(require(9165) /* metro dependency 9165: AppCrash */).AppCrash} title={property} />;
|
|
} else if (r7) {
|
|
r7 = <Loading_117572 />;
|
|
} else {
|
|
jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
|
|
var viewBindingProps = {style: styles.searchAndShareContainer};
|
|
SearchField = (require(6984) /* metro dependency 6984: SearchFieldNative */).SearchField;
|
|
items2 = [<View><View {...viewBindingProps}><SearchField size="md" isRound onChange={(require(9164) /* metro dependency 9164: InviteSuggestionsActionCreators */).searchInviteSuggestions} placeholder={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iI1gMg)} /></View></View>];
|
|
if (r14) {
|
|
r14 = <EmptyState style={styles.emptyState} title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ojoWgX)} />;
|
|
} else {
|
|
value = importDefault(15381) /* metro dependency 15381: ActivityInviteSheetList */;
|
|
value = ((Component) => <Component data={inviteSuggestionRows} error={property} getSendState={value5} onInviteSent={value7} onPressAvatar={value6} />)(value);
|
|
r14 = value;
|
|
}
|
|
items2[1] = r14;
|
|
value = <>{items2}</>;
|
|
r7 = value;
|
|
}
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
<BottomSheet {...object}>
|
|
{r7}
|
|
</BottomSheet>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
}
|
|
|
|
function _fun117575({item}) { // fn#117575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:1409, offset: 0x024b8f00, size: 77 bytes, params: 2, frame: 7
|
|
const id = activity.party?.id;
|
|
return id != null ? env0_3[id]?.[item.id] : null;
|
|
}
|
|
|
|
function _fun117576(a0) { // fn#117576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:1538, offset: 0x024b8f4d, size: 75 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
(importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */)({userId: a0,
|
|
sourceAnalyticsLocations: analyticsLocations});
|
|
}
|
|
|
|
function _fun117577(a0) { // fn#117577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:1643, offset: 0x024b8f98, size: 550 bytes, params: 2, frame: 23
|
|
var environment;
|
|
var id;
|
|
var value;
|
|
var closure;
|
|
var value2;
|
|
var activityBinding;
|
|
var party;
|
|
var value3;
|
|
var setSendStateBinding;
|
|
var item;
|
|
var id2;
|
|
var SENDING;
|
|
var type;
|
|
const RowTypes = require(dependencyMap[16]).RowTypes;
|
|
var CHANNEL;
|
|
var DM;
|
|
var FRIEND;
|
|
var property;
|
|
var defaultImport;
|
|
var sendActivityInviteUser;
|
|
var object2;
|
|
var JOIN;
|
|
var defaultImport2;
|
|
var ACTIVITY_INVITE_SHEET;
|
|
var value4;
|
|
var then;
|
|
var value5;
|
|
var error;
|
|
var binding;
|
|
var String;
|
|
var defaultImport3;
|
|
var sendActivityInvite;
|
|
var defaultImport4;
|
|
var value6;
|
|
var value7;
|
|
reduciblePort60: while (true) {
|
|
exceptionLanding33: while (true) {
|
|
exceptionLanding59: while (true) {
|
|
var env0_0 = a0;
|
|
value = undefined;
|
|
closure = markInviteSent;
|
|
value2 = environment;
|
|
if (activity == null) {
|
|
break reduciblePort60;
|
|
}
|
|
party = activity.party;
|
|
reducibleJoin3: while (true) {
|
|
if (party == null) {
|
|
id = value;
|
|
break reducibleJoin3;
|
|
}
|
|
id = party.id;
|
|
break reducibleJoin3;
|
|
}
|
|
var env0_1 = id;
|
|
if (id == null) {
|
|
break reduciblePort60;
|
|
}
|
|
value3 = environment.__proto__;
|
|
setSendStateBinding = setSendState;
|
|
item = a0.item;
|
|
id2 = item.id;
|
|
SENDING = InviteSendStates.SENDING;
|
|
setSendStateBinding(id, id2, SENDING);
|
|
type = a0.type;
|
|
CHANNEL = RowTypes.CHANNEL;
|
|
if (type === CHANNEL) {
|
|
id = a0.item.id;
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
property = dependencyMap[17];
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
defaultImport3 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
sendActivityInvite = defaultImport3.sendActivityInvite;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
object2.channelId = id;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
JOIN = ActivityActionTypes.JOIN;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
object2.type = JOIN;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
activityBinding = activity;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
object2.activity = activityBinding;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
property = dependencyMap[13];
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
defaultImport4 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
ACTIVITY_INVITE_SHEET = defaultImport4.ACTIVITY_INVITE_SHEET;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
object2.location = ACTIVITY_INVITE_SHEET;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
value6 = Reflect.apply(sendActivityInvite, defaultImport3, [object2]);
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
then = value6.then;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
value7 = Reflect.apply(then, value6, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
property = value7.catch;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
closure = _fun117579;
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
try {
|
|
Reflect.apply(property, value7, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding59;
|
|
}
|
|
break reduciblePort60;
|
|
}
|
|
type = a0.type;
|
|
DM = RowTypes.DM;
|
|
if (type !== DM) {
|
|
type = a0.type;
|
|
FRIEND = RowTypes.FRIEND;
|
|
if (type !== FRIEND) {
|
|
break reduciblePort60;
|
|
}
|
|
}
|
|
item = a0.item;
|
|
id = item.id;
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
property = dependencyMap[17];
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
defaultImport = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
sendActivityInviteUser = defaultImport.sendActivityInviteUser;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
object2.userId = id;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
JOIN = ActivityActionTypes.JOIN;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
object2.type = JOIN;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
activityBinding = activity;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
object2.activity = activityBinding;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
property = dependencyMap[13];
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
defaultImport2 = importDefault(property);
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
ACTIVITY_INVITE_SHEET = defaultImport2.ACTIVITY_INVITE_SHEET;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
object2.location = ACTIVITY_INVITE_SHEET;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
value4 = Reflect.apply(sendActivityInviteUser, defaultImport, [object2]);
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
then = value4.then;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(then, value4, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
property = value5.catch;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
closure = _fun117580;
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
try {
|
|
Reflect.apply(property, value5, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding33;
|
|
}
|
|
break reduciblePort60;
|
|
}
|
|
binding = env0_2;
|
|
String = global.String;
|
|
binding(String(error));
|
|
break reduciblePort60;
|
|
}
|
|
binding = env0_2;
|
|
String = global.String;
|
|
binding(String(error));
|
|
break reduciblePort60;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function _fun117582() { // fn#117582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:2435, offset: 0x024b924e, size: 137 bytes, params: 1, frame: 15
|
|
var environment;
|
|
env0_4(true);
|
|
const value = environment.__proto__;
|
|
const inviteSuggestionsActionCreatorsModule = require(9164) /* metro dependency 9164: InviteSuggestionsActionCreators */;
|
|
const loadInviteSuggestions = inviteSuggestionsActionCreatorsModule.loadInviteSuggestions;
|
|
const Set = global.Set;
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set();
|
|
const EMBEDDED_APPLICATION = InviteTargetTypes.EMBEDDED_APPLICATION;
|
|
Reflect.apply(loadInviteSuggestions, inviteSuggestionsActionCreatorsModule,
|
|
[{omitUserIds: set instanceof Object ? set : value2,
|
|
inviteTargetType: EMBEDDED_APPLICATION}]).catch(NOOP_NULL).finally(_fun117583);
|
|
}
|
|
|
|
function markInviteSent() { // fn#117578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:2248, offset: 0x024b91be, size: 61 bytes, params: 1, frame: 15
|
|
var value2;
|
|
if (id != null) {
|
|
value2 = environment.__proto__.__proto__;
|
|
setSendState(id, env0_0.item.id, InviteSendStates.SENT);
|
|
}
|
|
}
|
|
|
|
function _fun117579(a0) { // fn#117579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:1932, offset: 0x024b91fb, size: 32 bytes, params: 2, frame: 12
|
|
const binding = env1_2;
|
|
const String = global.String;
|
|
binding(String(a0));
|
|
}
|
|
|
|
function _fun117580(a0) { // fn#117580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15577:2206, offset: 0x024b921b, size: 32 bytes, params: 2, frame: 12
|
|
const binding = env1_2;
|
|
const String = global.String;
|
|
return binding(String(a0));
|
|
}
|
|
|