410 lines
20 KiB
TypeScript
410 lines
20 KiB
TypeScript
/* Metro module 6768; source: modules/guild_onboarding/native/GuildOnboardingConnectionPrompt.tsx; dependencies: [31, 27, 6616, 5109, 5040, 1867, 6603, 5106, 6600, 661, 33, 4501, 5314, 697, 1484, 1585, 566, 5105, 683, 4863, 6602, 6618, 4573, 1244, 6769, 6789, 4578, 2] */
|
|
function _fun53304(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:6, offset: 0x01344d2a, size: 788 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_53307 = 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 Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.View;
|
|
const env0_5 = value.ScrollView;
|
|
const memberVerificationFormStore = importDefault(6616) /* metro dependency 6616: MemberVerificationFormStore */;
|
|
const authorizedAppsStore = importDefault(5109) /* metro dependency 5109: AuthorizedAppsStore */;
|
|
const connectedAccountsStore = importDefault(5040) /* metro dependency 5040: ConnectedAccountsStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const guildOnboardingPromptsStore = importDefault(6603) /* metro dependency 6603: GuildOnboardingPromptsStore */;
|
|
const env0_11 = (require(5106) /* metro dependency 5106: GuildOnboardingPromptsConstants */).OnboardingConnectionType;
|
|
const env0_12 = (require(6600) /* metro dependency 6600: GuildOnboardingConstants */).GuildOnboardingModalStates;
|
|
const env0_13 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value.jsx;
|
|
const env0_15 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.flex = {flex: 1};
|
|
const object5 = {'display': 'flex', 'flex': 1, 'flexGrow': 1};
|
|
const NAV_BAR_HEIGHT = (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT;
|
|
object5.marginTop = NAV_BAR_HEIGHT;
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.marginBottom = PX_16;
|
|
let BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object5.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object2.container = object5;
|
|
const object6 = {'display': 'flex', 'flexGrow': 1};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.paddingHorizontal = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.paddingTop = PX_16;
|
|
BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object6.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object2.scrollContainer = object6;
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.header = {marginBottom: PX_24};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.title = {marginBottom: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.description = {marginTop: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.connectionsList = {marginTop: PX_8};
|
|
const object7 = {'display': 'flex', 'flexDirection': 'column', 'justifyContent': 'flex-end', 'alignItems': 'center',
|
|
'bottom': 0, 'paddingBottom': null, 'position': 'absolute', 'width': '100%'};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object7.paddingBottom = PX_8;
|
|
BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object7.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object2.footer = object7;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.footerContent = {width: '100%', paddingHorizontal: PX_16};
|
|
const env0_16 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_onboarding/native/GuildOnboardingConnectionPrompt.tsx');
|
|
exports.default = GuildOnboardingConnectionPrompt;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_53305(a0, a1) { // fn#53305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:325, offset: 0x0134503e, 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 _fun53306;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_53307(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_53307(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_53307(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun53306;
|
|
}
|
|
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 GuildOnboardingConnectionPrompt({guildId, onComplete, isLastStep}) { // fn#53308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:2199, offset: 0x013451b0, size: 1348 bytes, params: 2, frame: 39
|
|
var r16;
|
|
var object3;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items4;
|
|
var items6;
|
|
var object9;
|
|
var Button;
|
|
var value;
|
|
const styles = useStyles();
|
|
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const env0_3 = value2;
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const value3 = 64 + bottom;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
const value4 = value3 + PX_8;
|
|
const binding = env0_3;
|
|
const env0_4 = binding.useRef(false);
|
|
const connections = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getConnections(guildId);
|
|
});
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getOnboardingPromptsForOnboarding(guildId);
|
|
});
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const rulesPrompt = (require(566) /* metro dependency 566: flux */).useStateFromStores([MemberVerificationFormStore],
|
|
function() {
|
|
return MemberVerificationFormStore.getRulesPrompt(guildId);
|
|
});
|
|
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.isLoading();
|
|
});
|
|
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthorizedAppsStore,
|
|
ConnectedAccountsStore], _fun53314, [connections]);
|
|
binding.useEffect(_fun53315, [guildId, value6, connections]);
|
|
const value8 = binding.useCallback(_fun53316, [value5.length, guild, rulesPrompt, value2, onComplete, connections,
|
|
value7, isLastStep, guildId]);
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const safeAreaPaddingViewProps = {top: true, style: [styles.flex, styles.container]};
|
|
if (value6) {
|
|
safeAreaPaddingViewProps.children = <View style={[styles.flex, {'justifyContent': 'center',
|
|
'alignItems': 'center'}]}><Text variant="text-md/normal" color="text-muted">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZTNur7)}</Text></View>;
|
|
} else {
|
|
var viewBindingProps = {style: styles.flex};
|
|
var scrollViewProps = {contentContainerStyle: [styles.scrollContainer, {paddingBottom: value4}]};
|
|
var viewBindingProps2 = {style: styles.header};
|
|
string = intl.string;
|
|
items4 = [<Text style={styles.title} accessibilityRole="header" variant="heading-xl/semibold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
|
|
intl, [t.eDVMrA])}</Text>];
|
|
string = intl.string;
|
|
items4[1] = <Text style={styles.description} variant="text-md/normal" color="text-muted">{Reflect.apply(string,
|
|
intl, [t.BozOXu])}</Text>;
|
|
items6 = [<ScrollView {...scrollViewProps}><View {...viewBindingProps2}>{items4}</View><View style={styles.connectionsList}>{connections.map(_fun53317)}</View></ScrollView>];
|
|
var viewProps = {style: [styles.footer, styles.footerContent, {paddingBottom: bottom}]};
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
var buttonProps = {variant: value7 || isLastStep ? 'primary' : 'secondary', size: 'md'};
|
|
string = intl.string;
|
|
if (isLastStep) {
|
|
value = Reflect.apply(string, intl, [t['8SuVoE']]);
|
|
value = '' + value + ' 🎉';
|
|
r16 = value;
|
|
} else {
|
|
r16 = value7 ? Reflect.apply(string, intl, [t.PDTjLN]) : Reflect.apply(string, intl, [t['5Wxrcd']]);
|
|
}
|
|
buttonProps.text = r16;
|
|
buttonProps.onPress = value8;
|
|
buttonProps.grow = true;
|
|
items6[1] = <View {...viewProps}><Button {...buttonProps} /></View>;
|
|
safeAreaPaddingViewProps.children = <View {...viewBindingProps}>{items6}</View>;
|
|
}
|
|
return <SafeAreaPaddingView {...safeAreaPaddingViewProps} />;
|
|
}
|
|
|
|
function _fun53314() { // fn#53314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:2739, offset: 0x01345773, size: 208 bytes, params: 1, frame: 20
|
|
var r2;
|
|
var value5;
|
|
var connection_type;
|
|
var APPLICATION;
|
|
var PROVIDER_CONNECTED_ACCOUNT;
|
|
var provider_id;
|
|
var getAccount;
|
|
var value6;
|
|
var revoked;
|
|
var getNewestTokenForApplication;
|
|
var application_id;
|
|
var value7;
|
|
const value3 = _createForOfIteratorHelperLoose_53305(connections);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
reducibleLoop1: while (true) {
|
|
value5 = r2.value;
|
|
connection_type = value5.connection_type;
|
|
APPLICATION = OnboardingConnectionType.APPLICATION;
|
|
if (connection_type === APPLICATION) {
|
|
getNewestTokenForApplication = AuthorizedAppsStore.getNewestTokenForApplication;
|
|
application_id = value5.application_id;
|
|
reducibleJoin8: while (true) {
|
|
if (Reflect.apply(getNewestTokenForApplication, AuthorizedAppsStore, [application_id]) != null) {
|
|
return true;
|
|
}
|
|
break reducibleJoin8;
|
|
}
|
|
} else {
|
|
connection_type = value5.connection_type;
|
|
PROVIDER_CONNECTED_ACCOUNT = OnboardingConnectionType.PROVIDER_CONNECTED_ACCOUNT;
|
|
reducibleJoin8: while (true) {
|
|
if (connection_type !== PROVIDER_CONNECTED_ACCOUNT) {
|
|
break reducibleJoin8;
|
|
}
|
|
provider_id = value5.provider_id;
|
|
if (provider_id == null) {
|
|
break reducibleJoin8;
|
|
}
|
|
getAccount = ConnectedAccountsStore.getAccount;
|
|
provider_id = value5.provider_id;
|
|
value6 = Reflect.apply(getAccount, ConnectedAccountsStore, [null, provider_id]);
|
|
if (value6 == null) {
|
|
break reducibleJoin8;
|
|
}
|
|
revoked = value6.revoked;
|
|
if (!revoked) {
|
|
return true;
|
|
}
|
|
break reducibleJoin8;
|
|
}
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r2 = value7;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function _fun53315() { // fn#53315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:3106, offset: 0x01345843, size: 301 bytes, params: 1, frame: 22
|
|
var connectionsBinding;
|
|
var value2;
|
|
var moduleValue;
|
|
var getProviderConnectionState;
|
|
var value3;
|
|
var applicationConnectionState;
|
|
var defaultImport;
|
|
var track;
|
|
var GUILD_ONBOARDING_STEP_VIEWED;
|
|
var object2;
|
|
var moduleValue3;
|
|
var connected;
|
|
var notConnected;
|
|
if (!env0_9) {
|
|
if (connections.length !== 0) {
|
|
if (!env0_4.current) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(5105) /* metro dependency 5105: GuildOnboardingUtils */;
|
|
getProviderConnectionState = moduleValue.getProviderConnectionState;
|
|
connectionsBinding = connections;
|
|
value3 = Reflect.apply(getProviderConnectionState, moduleValue, [connectionsBinding]);
|
|
applicationConnectionState = (require(5105) /* metro dependency 5105: GuildOnboardingUtils */).getApplicationConnectionState(connectionsBinding);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
GUILD_ONBOARDING_STEP_VIEWED = AnalyticEvents.GUILD_ONBOARDING_STEP_VIEWED;
|
|
object2 = {};
|
|
moduleValue3 = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
copyDataProperties(object2, moduleValue3.collectGuildAnalyticsMetadata(guildId), moduleValue3);
|
|
object2['step'] = (require(6602) /* metro dependency 6602: GuildOnboardingPromptsActionCreators */).CONNECTIONS_STEP;
|
|
object2['required'] = false;
|
|
connected = value3.connected;
|
|
object2['provider_connections_connected'] = connected;
|
|
notConnected = value3.notConnected;
|
|
object2['provider_connections_not_connected'] = notConnected;
|
|
connected = applicationConnectionState.connected;
|
|
object2['application_connections_connected'] = connected;
|
|
notConnected = applicationConnectionState.notConnected;
|
|
object2['application_connections_not_connected'] = notConnected;
|
|
Reflect.apply(track, defaultImport, [GUILD_ONBOARDING_STEP_VIEWED, object2]);
|
|
env0_4.current = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun53316() { // fn#53316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:3612, offset: 0x01345970, size: 420 bytes, params: 1, frame: 24
|
|
var moduleValue4;
|
|
var binding;
|
|
const guildOnboardingUtilsModule = require(5105) /* metro dependency 5105: GuildOnboardingUtils */;
|
|
const getProviderConnectionState = guildOnboardingUtilsModule.getProviderConnectionState;
|
|
const connectionsBinding = connections;
|
|
const value3 = Reflect.apply(getProviderConnectionState, guildOnboardingUtilsModule, [connectionsBinding]);
|
|
const applicationConnectionState = guildOnboardingUtilsModule.getApplicationConnectionState(connectionsBinding);
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const GUILD_ONBOARDING_STEP_COMPLETED = AnalyticEvents.GUILD_ONBOARDING_STEP_COMPLETED;
|
|
const object2 = {};
|
|
const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
copyDataProperties(object2, appAnalyticsUtilsModule.collectGuildAnalyticsMetadata(guildId), appAnalyticsUtilsModule);
|
|
const CONNECTIONS_STEP = (require(6602) /* metro dependency 6602: GuildOnboardingPromptsActionCreators */).CONNECTIONS_STEP;
|
|
object2['step'] = CONNECTIONS_STEP;
|
|
object2['skipped'] = !env0_10;
|
|
object2['back'] = false;
|
|
object2['options_selected'] = 0;
|
|
object2['in_onboarding'] = true;
|
|
object2['is_final_step'] = isLastStep;
|
|
object2['provider_connections_connected'] = value3.connected;
|
|
object2['provider_connections_not_connected'] = value3.notConnected;
|
|
object2['application_connections_connected'] = applicationConnectionState.connected;
|
|
object2['application_connections_not_connected'] = applicationConnectionState.notConnected;
|
|
Reflect.apply(track, defaultImport, [GUILD_ONBOARDING_STEP_COMPLETED, object2]);
|
|
if (env0_6.length > 0) {
|
|
binding = env0_3;
|
|
binding.push(GuildOnboardingModalStates.PROMPT, {currentPrompt: 0});
|
|
} else {
|
|
moduleValue4 = guildOnboardingUtilsModule;
|
|
if (moduleValue4.showRulesInOnboarding(guild, rulesPrompt)) {
|
|
binding = env0_3;
|
|
binding.push(GuildOnboardingModalStates.RULES);
|
|
} else {
|
|
onComplete();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun53317(a0, a1) { // fn#53317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6946:5050, offset: 0x01345b14, size: 84 bytes, params: 3, frame: 17
|
|
let value = environment.__proto__;
|
|
value = importDefault(6769) /* metro dependency 6769: ConnectionCard */;
|
|
const guildIdBinding = guildId;
|
|
const GUILD_ONBOARDING = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).GUILD_ONBOARDING;
|
|
return ((Component) => <Component connection={a0} guildId={guildIdBinding} location={GUILD_ONBOARDING} key={a1} />)(value);
|
|
}
|
|
|