787 lines
43 KiB
TypeScript
787 lines
43 KiB
TypeScript
/* Metro module 11351; source: modules/guild_onboarding/native/CustomizeCommunity.tsx; dependencies: [31, 27, 6540, 1867, 4605, 3969, 6603, 5106, 661, 1881, 4865, 33, 4501, 697, 6597, 3866, 4048, 566, 11352, 11353, 1305, 1244, 4573, 5105, 6734, 6769, 6789, 1585, 11354, 6602, 5097, 6606, 6739, 1423, 1360, 3860, 4017, 4504, 11355, 4080, 6744, 1962, 5278, 6759, 6735, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import SelectedGuildStore from '../../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import ReadStateStore from '../../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
|
|
import EmojiStore from '../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
|
|
import TextStyles from '../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
|
|
import GuildOnboardingPromptsStore from '../GuildOnboardingPromptsStore.tsx'; /* Metro dependency 6603 */
|
|
import GuildOnboardingActionCreators from '../GuildOnboardingActionCreators.tsx'; /* Metro dependency 6606 */
|
|
import UsePromptHelpText from '../usePromptHelpText.tsx'; /* Metro dependency 6734 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import UseSortedOnboardingPrompts from '../useSortedOnboardingPrompts.tsx'; /* Metro dependency 11354 */
|
|
import UseBatchUpdateSelectOption from '../useBatchUpdateSelectOption.tsx'; /* Metro dependency 11355 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as GlobalUtilsModule from '../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
|
|
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ReadStateConstantsModule from '../../read_states/ReadStateConstants.tsx'; /* Metro dependency 4865 */
|
|
import * as ReadStateActionCreatorsModule from '../../../actions/ReadStateActionCreators.tsx'; /* Metro dependency 5097 */
|
|
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
|
|
function _fun86922(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:6, offset: 0x01fa7b07, size: 1741 bytes, params: 8, frame: 32
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.View;
|
|
const env0_5 = value.Image;
|
|
const env0_6 = value.ScrollView;
|
|
value = require(5106) /* metro dependency 5106: GuildOnboardingPromptsConstants */;
|
|
const env0_12 = value.GuildOnboardingTab;
|
|
const env0_13 = value.OnboardingPromptType;
|
|
const Fonts = (ConstantsModule).Fonts;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_16 = value.jsx;
|
|
const env0_17 = value.jsxs;
|
|
const env0_18 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.container = {paddingHorizontal: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.sheetTitle = {marginTop: PX_16};
|
|
const object4 = {position: 'relative'};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object4.marginTop = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object4.padding = PX_12;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
object4.borderWidth = 2;
|
|
object4.borderStyle = 'solid';
|
|
object.promptContainer = object4;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.titleContainer = {'flexDirection': 'row', 'alignItems': 'center', marginBottom: PX_12};
|
|
const object6 = {};
|
|
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
|
|
let MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object6, TextStyles(PRIMARY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 16), undefined);
|
|
object.prompt = object6;
|
|
object.badge = {'position': 'absolute', 'top': -6, 'right': -6};
|
|
object.badgeText = {fontWeight: 'bold'};
|
|
const object8 = {};
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object8.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object8.padding = PX_8;
|
|
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
|
|
object8.paddingRight = PX_32;
|
|
object8.minHeight = 48;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object8.marginBottom = PX_12;
|
|
object8.display = 'flex';
|
|
object8.flexDirection = 'row';
|
|
object8.flexWrap = 'wrap';
|
|
object8.alignItems = 'center';
|
|
object8.position = 'relative';
|
|
object.dropdownContainer = object8;
|
|
const object9 = {};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object9.marginVertical = PX_12;
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object9.marginLeft = PX_4;
|
|
object.emptyDropdownText = object9;
|
|
const object10 = {};
|
|
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object10.backgroundColor = BACKGROUND_BASE_LOW;
|
|
object10.padding = 6;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object10.marginRight = PX_8;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object10.marginTop = PX_8;
|
|
object10.display = 'flex';
|
|
object10.flexDirection = 'row';
|
|
object10.alignItems = 'center';
|
|
object.dropdownPill = object10;
|
|
object.emojiContainer = {'display': 'flex', 'alignItems': 'center'};
|
|
const object11 = {position: 'absolute'};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object11.right = PX_4;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object11.top = PX_12;
|
|
object.dropdownIconContainer = object11;
|
|
object.dropdownIcon = {'height': 32, 'width': 32};
|
|
object.optionTextEmoji = {'fontSize': 18, 'lineHeight': 22, 'marginRight': 6};
|
|
object.optionImageEmoji = {'height': 22, 'width': 22, 'marginRight': 6};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.helpText = {marginTop: PX_4};
|
|
const object13 = {};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object13.marginTop = PX_24;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object13.marginBottom = PX_16;
|
|
object13.height = 1;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object13.backgroundColor = BORDER_SUBTLE;
|
|
object.sectionSeparator = object13;
|
|
object.emptyContainer = {'height': 400, 'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.emptyContainerImage = {'width': 120, 'height': 80, marginBottom: PX_16};
|
|
const object15 = {};
|
|
const DISPLAY_SEMIBOLD = Fonts.DISPLAY_SEMIBOLD;
|
|
MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
copyDataProperties(object15, TextStyles(DISPLAY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 18), undefined);
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object15['marginBottom'] = PX_4;
|
|
object.emptyContainerHeader = object15;
|
|
const object16 = {};
|
|
const DISPLAY_MEDIUM = Fonts.DISPLAY_MEDIUM;
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
copyDataProperties(object16, TextStyles(DISPLAY_MEDIUM, TEXT_SUBTLE, 14), undefined);
|
|
object.emptyContainerSubheader = object16;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.connectionsContainer = {marginTop: PX_12};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.connectionsPromptContainer = {marginTop: PX_12};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object.connectionsTitle = {marginBottom: PX_4};
|
|
const env0_19 = Reflect.apply(createStyles, value, [object]);
|
|
object = {code: 'function CustomizeCommunityTsx1(){const{isNew,brandColor,withSequence,withTiming,Easing,withDelay}=this.__closure;const rawBorderColor=isNew?brandColor+"FF":brandColor+"00";const borderColor=withSequence(withTiming(rawBorderColor,{duration:1,easing:Easing.in(Easing.ease)}),withDelay(500,withTiming(brandColor+"00",{duration:300,easing:Easing.out(Easing.ease)})));return{borderColor:borderColor};}'};
|
|
object = {code: 'function CustomizeCommunityTsx2(){const{isNew,brandColor,withSequence,withTiming,Easing,withDelay}=this.__closure;const rawBorderColor=isNew?brandColor+"FF":brandColor+"00";const borderColor=withSequence(withTiming(rawBorderColor,{duration:1,easing:Easing.in(Easing.ease)}),withDelay(500,withTiming(brandColor+"00",{duration:300,easing:Easing.out(Easing.ease)})));return{borderColor:borderColor};}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/native/CustomizeCommunity.tsx');
|
|
exports.default = CustomizeCommunity;
|
|
function EmptyCustomizeCommunity({setTab}) { // fn#86923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:2605, offset: 0x01fa81d4, size: 436 bytes, params: 2, frame: 27
|
|
const styles = useStyles();
|
|
const isThemeDark2 = require(dependencyMap[15]).isThemeDark(importDefault(dependencyMap[16])());
|
|
const env0_1 = require(dependencyMap[17]).useStateFromStores([SelectedGuildStore], function() {
|
|
return SelectedGuildStore.getGuildId();
|
|
});
|
|
const items2 = [
|
|
<Image
|
|
style={styles.emptyContainerImage}
|
|
source={importDefault(isThemeDark2 ? dependencyMap[18] : dependencyMap[19])}
|
|
/>,
|
|
];
|
|
const LegacyText = require(dependencyMap[20]).LegacyText;
|
|
const intl = require(dependencyMap[21]).intl;
|
|
items2[1] = (
|
|
<LegacyText style={styles.emptyContainerHeader}>
|
|
{intl.string(require(dependencyMap[21]).t.leKHQz)}
|
|
</LegacyText>
|
|
);
|
|
items2[2] = (
|
|
<LegacyText style={styles.emptyContainerSubheader}>
|
|
{intl.format(require(dependencyMap[21]).t['jH+ktB'], {onBrowseChannels: onBrowseChannels})}
|
|
</LegacyText>
|
|
);
|
|
return (
|
|
<View style={styles.emptyContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function onBrowseChannels() { // fn#86925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3082, owner: EmptyCustomizeCommunity.onBrowseChannels, offset: 0x01fa839b, size: 41 bytes, params: 1, frame: 11
|
|
var setTabBinding;
|
|
if (guildId != null) {
|
|
setTabBinding = setTab;
|
|
value = environment.__proto__;
|
|
setTabBinding(GuildOnboardingTab.BROWSE);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function PromptTitle({item}) { // fn#86926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3116, offset: 0x01fa83c4, size: 204 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const LegacyText = (NativeModule).LegacyText;
|
|
return (
|
|
<View style={styles.titleContainer}>
|
|
<LegacyText style={styles.prompt} accessibilityRole="header">
|
|
{item.title}
|
|
{
|
|
item.required
|
|
? ((Text) => <Text variant="text-md/bold" color="text-feedback-critical">{' '}{'*'}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
|
|
: null
|
|
}
|
|
</LegacyText>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function PromptHelpText({guildId, prompt, selectedOptionIds}) { // fn#86927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3397, offset: 0x01fa8490, size: 376 bytes, params: 2, frame: 21
|
|
const styles = useStyles();
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const r2 = prompt == null || prompt.options == null ? undefined : prompt.options.filter(function(a0) {
|
|
return selectedOptionIds.includes(a0.id);
|
|
});
|
|
let binding = ReactModule;
|
|
let useMemo = binding.useMemo;
|
|
const value5 = Reflect.apply(useMemo, binding, [_fun86930, [r2]]);
|
|
binding = ReactModule;
|
|
useMemo = binding.useMemo;
|
|
const {helpText,
|
|
helpTextAdditional} = (UsePromptHelpText)({guild: guild,
|
|
prompt: prompt, selectedRoleIds: value5, selectedChannelIds: Reflect.apply(useMemo, binding, [_fun86931, [r2]]),
|
|
itemHook: itemHook});
|
|
if (helpText !== '') {
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text
|
|
style={styles.helpText}
|
|
variant="text-xs/medium"
|
|
color="text-default"
|
|
>
|
|
{helpText}
|
|
{' '}
|
|
{helpTextAdditional}
|
|
</Text>
|
|
);
|
|
} else if (helpTextAdditional === '') {
|
|
return null;
|
|
} else {
|
|
const Text2 = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text2
|
|
style={styles.helpText}
|
|
variant="text-xs/medium"
|
|
color="text-default"
|
|
>
|
|
{helpText}
|
|
{' '}
|
|
{helpTextAdditional}
|
|
</Text2>
|
|
);
|
|
}
|
|
function _fun86930() { // fn#86930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3613, offset: 0x01fa8608, size: 85 bytes, params: 1, frame: 13
|
|
return env0_2 != null ? (require(5105) /* metro dependency 5105: GuildOnboardingUtils */).getSelectedRoleIds(env0_2) : new global.Set();
|
|
}
|
|
|
|
function _fun86931() { // fn#86931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3683, offset: 0x01fa865d, size: 85 bytes, params: 1, frame: 13
|
|
return env0_2 != null ? (require(5105) /* metro dependency 5105: GuildOnboardingUtils */).getSelectedChannelIds(env0_2) : new global.Set();
|
|
}
|
|
|
|
function itemHook(a0, a1) { // fn#86932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:3820, owner: PromptHelpText.itemHook, offset: 0x01fa86b2, size: 67 bytes, params: 3, frame: 15
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<Text
|
|
variant="text-xs/medium"
|
|
color="mobile-text-heading-primary"
|
|
key={a1}
|
|
>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function ConnectionsPrompt({guildId}) { // fn#86933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:4100, offset: 0x01fa86f5, size: 382 bytes, params: 2, frame: 28
|
|
var r0;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const connections = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getConnections(guildId);
|
|
});
|
|
if (connections.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
var viewBindingProps = {style: styles.connectionsPromptContainer};
|
|
string = intl.string;
|
|
items2 = [
|
|
<Text
|
|
style={styles.connectionsTitle}
|
|
variant="text-md/semibold"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{Reflect.apply(string, intl, [t.eDVMrA])}
|
|
</Text>,
|
|
];
|
|
string = intl.string;
|
|
items2[1] = (
|
|
<Text variant="text-xs/medium" color="text-muted">
|
|
{Reflect.apply(string, intl, [t.BozOXu])}
|
|
</Text>
|
|
);
|
|
items2[2] = (
|
|
<View style={styles.connectionsContainer}>
|
|
{connections.map(_fun86935)}
|
|
</View>
|
|
);
|
|
r0 = (
|
|
<View {...viewBindingProps}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
return r0;
|
|
function _fun86935(a0, a1) { // fn#86935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:4604, offset: 0x01fa888e, size: 84 bytes, params: 3, frame: 17
|
|
let value = environment.__proto__;
|
|
value = importDefault(6769) /* metro dependency 6769: ConnectionCard */;
|
|
const guildIdBinding = guildId;
|
|
const CHANNELS_AND_ROLES = (AnalyticsLocation).CHANNELS_AND_ROLES;
|
|
return ((Component) => <Component connection={a0} guildId={guildIdBinding} location={CHANNELS_AND_ROLES} key={a1} />)(value);
|
|
}
|
|
|
|
}
|
|
|
|
function DropdownOption_86936({option}) { // fn#86936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:4694, offset: 0x01fa88e2, size: 432 bytes, params: 2, frame: 29
|
|
var Emoji;
|
|
const styles = useStyles();
|
|
const value3 = (FluxModule).useStateFromStores([EmojiStore], _fun86937);
|
|
let r6 = option.emoji?.id != null || option.emoji?.name != null;
|
|
if (r6) {
|
|
var viewBinding2Props = {style: styles.emojiContainer};
|
|
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
|
|
r6 = (
|
|
<View {...viewBinding2Props}>
|
|
<Emoji
|
|
textEmojiStyle={styles.optionTextEmoji}
|
|
fastImageStyle={styles.optionImageEmoji}
|
|
src={value3 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: value3.id,
|
|
|
|
animated: value3.animated, size: EMOJI_URL_BASE_SIZE}) : undefined}
|
|
name={option.emoji?.name ?? ''}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={styles.dropdownPill}>
|
|
{r6}
|
|
<Text variant="text-md/semibold">
|
|
{option.title}
|
|
</Text>
|
|
</View>
|
|
);
|
|
function _fun86937() { // fn#86937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:4783, offset: 0x01fa8a92, size: 82 bytes, params: 1, frame: 14
|
|
const emoji = option.emoji;
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
return value2 != (value2 == emoji ? value3 : emoji.id) ? EmojiStore.getUsableCustomEmojiById(value2 == option.emoji ? value3 : option.emoji.id) : value2;
|
|
}
|
|
|
|
}
|
|
|
|
function DropdownPrompt_86938({guildId, prompt}) { // fn#86938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:5763, offset: 0x01fa8ae4, size: 998 bytes, params: 2, frame: 33
|
|
var r6;
|
|
var TextBadge;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const styles = useStyles();
|
|
let isNew = prompt.isNew;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getOnboardingResponsesForPrompt(guildId, prompt.id);
|
|
});
|
|
const env0_3 = value2;
|
|
const value3 = value2.map(function(a0) {
|
|
var env0_0 = a0;
|
|
return prompt.options.find(_fun86941);
|
|
});
|
|
const value4 = value3.filter((GlobalUtilsModule).isNotNullish);
|
|
const useToken = UseTokenModule.useToken;
|
|
const BACKGROUND_BRAND = (Native).colors.BACKGROUND_BRAND;
|
|
const value5 = Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BRAND]);
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const DropdownPrompt_86938C2 = DropdownPrompt_86938C;
|
|
object = {isNew: isNew, brandColor: value5};
|
|
object.withSequence = ReanimatedRexportModule.withSequence;
|
|
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
object.Easing = Easing;
|
|
object.withDelay = ReanimatedRexportModule.withDelay;
|
|
DropdownPrompt_86938C2.__closure = object;
|
|
DropdownPrompt_86938C2.__workletHash = 16609373875235;
|
|
DropdownPrompt_86938C2.__initData = env0_20;
|
|
const value6 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [DropdownPrompt_86938C2]);
|
|
const value7 = env0_3.useCallback(_fun86943, [guildId, prompt,
|
|
(UseBatchUpdateSelectOption)(guildId).handleSelectOption,
|
|
value2.length]);
|
|
const View2 = (ReanimatedRexport).View;
|
|
const items4 = [styles.promptContainer, value6];
|
|
isNew = prompt.isNew;
|
|
if (isNew) {
|
|
TextBadge = (require(1305) /* metro dependency 1305: native */).TextBadge;
|
|
r6 = (
|
|
<TextBadge
|
|
color={(require(1305) /* metro dependency 1305: native */).BadgeColors.BRAND}
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y2b7CA)}
|
|
style={styles.badge}
|
|
textStyle={styles.badgeText}
|
|
/>
|
|
);
|
|
} else {
|
|
r6 = isNew;
|
|
}
|
|
const items2 = [r6];
|
|
items2[1] = <PromptTitle item={prompt} />;
|
|
const PressableHighlight = (PressablesModule).PressableHighlight;
|
|
const items3 = [
|
|
value4.length === 0 && ((Text) => <Text style={styles.emptyDropdownText} variant="text-sm/normal" color="text-muted">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.GmSvdA)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text),
|
|
|
|
];
|
|
items3[1] = value4.map(_fun86945);
|
|
items3[2] = (
|
|
<View style={styles.dropdownIconContainer}>
|
|
<Image style={styles.dropdownIcon} source={importDefault(6759) /* metro dependency 6759 */} />
|
|
</View>
|
|
);
|
|
items2[2] = (
|
|
<PressableHighlight style={styles.dropdownContainer} onPress={value7}>
|
|
{items3}
|
|
</PressableHighlight>
|
|
);
|
|
items2[3] = (
|
|
<PromptHelpText
|
|
guildId={guildId}
|
|
prompt={prompt}
|
|
selectedOptionIds={value2}
|
|
/>
|
|
);
|
|
return (
|
|
<View2 style={items4}>
|
|
{items2}
|
|
</View2>
|
|
);
|
|
function _fun86940(a0) { // fn#86940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:5928, offset: 0x01fa8eef, size: 41 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return prompt.options.find(_fun86941);
|
|
function _fun86941({id}) { // fn#86941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:5947, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
|
|
return id === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function DropdownPrompt_86938C() { // fn#86942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:6079, owner: DropdownPrompt_86938.c, offset: 0x01fa8f18, size: 321 bytes, params: 1, frame: 27
|
|
const isNewBinding = isNew;
|
|
const binding = env0_4;
|
|
const r9 = isNewBinding ? '' + binding + 'FF' : '' + binding + '00';
|
|
const withSequence = ReanimatedRexportModule.withSequence;
|
|
let withTiming = TimingModule.withTiming;
|
|
const object2 = {duration: 1};
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
const Easing2 = ReanimatedRexportModule.Easing;
|
|
object2.easing = Easing.in(Easing2.ease);
|
|
const value5 = Reflect.apply(withTiming, TimingModule, [r9, object2]);
|
|
const withDelay = ReanimatedRexportModule.withDelay;
|
|
withTiming = TimingModule.withTiming;
|
|
let value = '' + env0_4 + '00';
|
|
const out = Easing.out;
|
|
const Easing3 = ReanimatedRexportModule.Easing;
|
|
value = Reflect.apply(withTiming, TimingModule, [value, {duration: 300, easing: Reflect.apply(out, Easing,
|
|
[Easing3.ease])}]);
|
|
return {borderColor: Reflect.apply(withSequence, ReanimatedRexportModule, [value5, Reflect.apply(withDelay,
|
|
ReanimatedRexportModule, [500, value])])};
|
|
}
|
|
|
|
function _fun86943() { // fn#86943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:6613, offset: 0x01fa9059, size: 144 bytes, params: 1, frame: 17
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[39]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[41]);
|
|
value = value(dependencyMap[40], dependencyMap.paths);
|
|
const promptBinding = prompt;
|
|
Reflect.apply(openLazy, defaultImport, [value, 'DropdownOptions', {guildId: guildId, promptId: promptBinding.id,
|
|
onSelect: onSelect_86944, canBeNew: !promptBinding.isNew, returnToCustomize: true}]);
|
|
function onSelect_86944(a0, a1) { // fn#86944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:6712, offset: 0x01fa90e9, size: 86 bytes, params: 3, frame: 15
|
|
var value6;
|
|
const value = a1;
|
|
if (!(!value && prompt.required && env1_3.length === 1)) {
|
|
value6 = environment.__proto__;
|
|
handleSelectOption(prompt, a0, value != null && value);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun86945(a0) { // fn#86945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:7299, offset: 0x01fa913f, size: 37 bytes, params: 2, frame: 15
|
|
return <DropdownOption_86936 option={a0} key={a0.id} />;
|
|
}
|
|
|
|
}
|
|
|
|
function MultipleChoicePrompt_86946({guildId, prompt}) { // fn#86946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:7906, offset: 0x01fa9164, size: 631 bytes, params: 2, frame: 28
|
|
var r7;
|
|
var TextBadge;
|
|
var intl;
|
|
const styles = useStyles();
|
|
let isNew = prompt.isNew;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getOnboardingResponsesForPrompt(guildId, prompt.id);
|
|
});
|
|
const env0_4 = (UseBatchUpdateSelectOption)(guildId).handleSelectOption;
|
|
const useToken = UseTokenModule.useToken;
|
|
const BACKGROUND_BRAND = (Native).colors.BACKGROUND_BRAND;
|
|
const value3 = Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BRAND]);
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const MultipleChoicePrompt_86946O2 = MultipleChoicePrompt_86946O;
|
|
object = {isNew: isNew, brandColor: value3};
|
|
object.withSequence = ReanimatedRexportModule.withSequence;
|
|
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
object.Easing = Easing;
|
|
object.withDelay = ReanimatedRexportModule.withDelay;
|
|
MultipleChoicePrompt_86946O2.__closure = object;
|
|
MultipleChoicePrompt_86946O2.__workletHash = 12802766002208;
|
|
MultipleChoicePrompt_86946O2.__initData = env0_21;
|
|
const value4 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [MultipleChoicePrompt_86946O2]);
|
|
const View = (ReanimatedRexport).View;
|
|
const items3 = [styles.promptContainer, value4];
|
|
isNew = prompt.isNew;
|
|
if (isNew) {
|
|
TextBadge = (require(1305) /* metro dependency 1305: native */).TextBadge;
|
|
var textBadgeProps = {color: (require(1305) /* metro dependency 1305: native */).BadgeColors.BRAND};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
textBadgeProps.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y2b7CA);
|
|
textBadgeProps.style = styles.badge;
|
|
textBadgeProps.textStyle = styles.badgeText;
|
|
r7 = <TextBadge {...textBadgeProps} />;
|
|
} else {
|
|
r7 = isNew;
|
|
}
|
|
const items2 = [r7];
|
|
items2[1] = <PromptTitle item={prompt} />;
|
|
const options = prompt.options;
|
|
items2[2] = options.map(_fun86949);
|
|
items2[3] = (
|
|
<PromptHelpText
|
|
guildId={guildId}
|
|
prompt={prompt}
|
|
selectedOptionIds={value2}
|
|
/>
|
|
);
|
|
return (
|
|
<View style={items3}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function MultipleChoicePrompt_86946O() { // fn#86948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:8187, owner: MultipleChoicePrompt_86946.o, offset: 0x01fa93db, size: 321 bytes, params: 1, frame: 27
|
|
const isNewBinding = isNew;
|
|
const binding = env0_5;
|
|
const r9 = isNewBinding ? '' + binding + 'FF' : '' + binding + '00';
|
|
const withSequence = ReanimatedRexportModule.withSequence;
|
|
let withTiming = TimingModule.withTiming;
|
|
const object2 = {duration: 1};
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
const Easing2 = ReanimatedRexportModule.Easing;
|
|
object2.easing = Easing.in(Easing2.ease);
|
|
const value5 = Reflect.apply(withTiming, TimingModule, [r9, object2]);
|
|
const withDelay = ReanimatedRexportModule.withDelay;
|
|
withTiming = TimingModule.withTiming;
|
|
let value = '' + env0_5 + '00';
|
|
const out = Easing.out;
|
|
const Easing3 = ReanimatedRexportModule.Easing;
|
|
value = Reflect.apply(withTiming, TimingModule, [value, {duration: 300, easing: Reflect.apply(out, Easing,
|
|
[Easing3.ease])}]);
|
|
return {borderColor: Reflect.apply(withSequence, ReanimatedRexportModule, [value5, Reflect.apply(withDelay,
|
|
ReanimatedRexportModule, [500, value])])};
|
|
}
|
|
|
|
function _fun86949(a0) { // fn#86949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:8919, offset: 0x01fa951c, size: 131 bytes, params: 2, frame: 20
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
value = importDefault(6735) /* metro dependency 6735: GuildOnboardingPromptOptionButton */;
|
|
return ((Component) => <Component guildId={guildId} option={a0} selected={ReactModule.includes(a0.id)} onSelect={onSelect_86950} suppressMemberCount canBeNew={!prompt.isNew} key={a0.id} />)(value);
|
|
function onSelect_86950(a0) { // fn#86950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:8988, offset: 0x01fa959f, size: 90 bytes, params: 2, frame: 16
|
|
var value7;
|
|
const value = a0;
|
|
if (!(!value && prompt.required && env1_3.length === 1)) {
|
|
value7 = environment.__proto__;
|
|
handleSelectOption(prompt, env0_0, value != null && value);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function CustomizeCommunity({guildId, setTab}) { // fn#86951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9266, offset: 0x01fa95f9, size: 1023 bytes, params: 2, frame: 36
|
|
var r7;
|
|
var scrollView;
|
|
var object2;
|
|
var jsxRuntimeEnv0_18Binding;
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items4;
|
|
var map;
|
|
var items2;
|
|
var value10;
|
|
var string;
|
|
var items3;
|
|
var object4;
|
|
const styles = useStyles();
|
|
const bottom = (UseSafeAreaInsetsNative)().bottom;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ReadStateStore], function() {
|
|
return ReadStateStore.hasUnread(guildId, ReadStateTypes.GUILD_ONBOARDING_QUESTION);
|
|
});
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun86953);
|
|
const {onboardingPromptsRaw, newOnboardingPrompts, onboardingPromptsWithNewAnswers, newAnswersCount,
|
|
onboardingPrompts} = (UseSortedOnboardingPrompts)(guildId);
|
|
ReactModule.useEffect(_fun86954, [guildId, value2, value3]);
|
|
ReactModule.useEffect(function() {
|
|
if (guildId != null) {
|
|
return _fun86956;
|
|
}
|
|
}, [guildId]);
|
|
const value5 = ReactModule.useCallback(_fun86957, [guildId]);
|
|
let length = onboardingPromptsRaw.length;
|
|
if (length === 0) {
|
|
var scrollViewBindingProps = {style: styles.container};
|
|
object4 = {};
|
|
object4.paddingBottom = bottom + (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
scrollViewBindingProps.contentContainerStyle = object4;
|
|
scrollView = (
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
<EmptyCustomizeCommunity setTab={setTab} />
|
|
</ScrollView>
|
|
);
|
|
} else {
|
|
var scrollViewBindingProps = {style: styles.container};
|
|
object2 = {};
|
|
object2.paddingBottom = bottom + (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
scrollViewBindingProps.contentContainerStyle = object2;
|
|
length = newOnboardingPrompts.length;
|
|
r7 = length > 0 || onboardingPromptsWithNewAnswers.length > 0;
|
|
if (r7) {
|
|
jsxRuntimeEnv0_18Binding = jsxRuntimeEnv0_18;
|
|
items4 = [
|
|
<Text
|
|
style={styles.sheetTitle}
|
|
variant="text-md/medium"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.iB5Gqe,
|
|
{count: newOnboardingPrompts.length + newAnswersCount})}
|
|
</Text>,
|
|
];
|
|
map = newOnboardingPrompts.map;
|
|
items4[1] = Reflect.apply(map, newOnboardingPrompts, [value5]);
|
|
map = onboardingPromptsWithNewAnswers.map;
|
|
items4[2] = Reflect.apply(map, onboardingPromptsWithNewAnswers, [value5]);
|
|
items4[3] = <View style={styles.sectionSeparator} />;
|
|
r7 = (
|
|
<>
|
|
{items4}
|
|
</>
|
|
);
|
|
}
|
|
items2 = [r7];
|
|
length = onboardingPrompts.length;
|
|
value10 = length > 0;
|
|
if (value10) {
|
|
jsxRuntimeEnv0_18Binding = jsxRuntimeEnv0_18;
|
|
string = intl.string;
|
|
items3 = [
|
|
<Text
|
|
style={styles.sheetTitle}
|
|
variant="text-md/medium"
|
|
color="mobile-text-heading-primary"
|
|
>
|
|
{Reflect.apply(string, intl, [t.BGkaer])}
|
|
</Text>,
|
|
];
|
|
string = intl.string;
|
|
items3[1] = (
|
|
<Text variant="text-xs/medium" color="text-muted">
|
|
{Reflect.apply(string, intl, [t.r6Vm8T])}
|
|
</Text>
|
|
);
|
|
items3[2] = onboardingPrompts.map(value5);
|
|
r7 = (
|
|
<>
|
|
{items3}
|
|
</>
|
|
);
|
|
} else {
|
|
r7 = value10;
|
|
}
|
|
items2[1] = r7;
|
|
items2[2] = <ConnectionsPrompt guildId={guildId} />;
|
|
scrollView = (
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
{items2}
|
|
</ScrollView>
|
|
);
|
|
}
|
|
return scrollView;
|
|
function _fun86953() { // fn#86953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9465, offset: 0x01fa9a1e, size: 44 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return GuildStore.getGuild(guildId)?.latestOnboardingQuestionId;
|
|
}
|
|
|
|
function _fun86954() { // fn#86954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9701, offset: 0x01fa9a4a, size: 95 bytes, params: 1, frame: 13
|
|
var value4;
|
|
var moduleValue;
|
|
if (guildId != null && (GuildOnboardingPromptsStore.shouldFetchPrompts(guildId) || env0_1)) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(6602) /* metro dependency 6602: GuildOnboardingPromptsActionCreators */;
|
|
moduleValue.fetchOnboardingPrompts(guildId);
|
|
}
|
|
}
|
|
|
|
function _fun86955() { // fn#86955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9804, offset: 0x01fa9aa9, size: 28 bytes, params: 1, frame: 2
|
|
if (guildId != null) {
|
|
return _fun86956;
|
|
}
|
|
function _fun86956() { // fn#86956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9826, offset: 0x01fa9ac5, size: 99 bytes, params: 1, frame: 19
|
|
const value = environment.__proto__.__proto__;
|
|
const ackGuildFeature = ReadStateActionCreatorsModule.ackGuildFeature;
|
|
const guildIdBinding = guildId;
|
|
const GUILD_ONBOARDING_QUESTION = ReadStateTypes.GUILD_ONBOARDING_QUESTION;
|
|
const guildOnboardingPromptsStoreBinding = GuildOnboardingPromptsStore;
|
|
Reflect.apply(ackGuildFeature, ReadStateActionCreatorsModule, [guildIdBinding, GUILD_ONBOARDING_QUESTION,
|
|
guildOnboardingPromptsStoreBinding.ackIdForGuild(guildIdBinding)]);
|
|
(GuildOnboardingActionCreators).updateOnboardingResponses(guildIdBinding);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun86957(a0) { // fn#86957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11537:9973, offset: 0x01fa9b28, size: 127 bytes, params: 2, frame: 17
|
|
const type = a0.type;
|
|
const MULTIPLE_CHOICE = OnboardingPromptType.MULTIPLE_CHOICE;
|
|
if (MULTIPLE_CHOICE === type) {
|
|
return (
|
|
<MultipleChoicePrompt_86946
|
|
guildId={guildId}
|
|
prompt={a0}
|
|
key={a0.id}
|
|
/>
|
|
);
|
|
}
|
|
const DROPDOWN = OnboardingPromptType.DROPDOWN;
|
|
if (DROPDOWN === type) {
|
|
return (
|
|
<DropdownPrompt_86938
|
|
guildId={guildId}
|
|
prompt={a0}
|
|
key={a0.id}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun86922, 11351, [31, 27, 6540, 1867, 4605, 3969, 6603, 5106, 661, 1881, 4865, 33, 4501, 697, 6597,
|
|
3866, 4048, 566, 11352, 11353, 1305, 1244, 4573, 5105, 6734, 6769, 6789, 1585, 11354, 6602, 5097, 6606, 6739,
|
|
1423, 1360, 3860, 4017, 4504, 11355, 4080, 6744, 1962, 5278, 6759, 6735,
|
|
2]) /* metro module 11351, dependencies: [31, 27, 6540, 1867, 4605, 3969, 6603, 5106, 661, 1881, 4865, 33, 4501, 697, 6597, 3866, 4048, 566, 11352, 11353, 1305, 1244, 4573, 5105, 6734, 6769, 6789, 1585, 11354, 6602, 5097, 6606, 6739, 1423, 1360, 3860, 4017, 4504, 11355, 4080, 6744, 1962, 5278, 6759, 6735, 2] */;
|