Files
2026-07-28 01:06:53 +03:00

354 lines
18 KiB
TypeScript

/* Metro module 11425; source: modules/create_guild/native/AcceptGuildTemplate.tsx; dependencies: [31, 27, 1383, 1939, 661, 6934, 33, 4501, 697, 6597, 5461, 44, 1585, 1942, 4573, 1244, 9664, 8967, 4578, 7331, 1305, 22, 9062, 11426, 11427, 11428, 673, 2] */
import defaultImport2 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
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 TextStyles from '../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */
import FreeFormInputGroup from '../../../design/void/Form/native/FreeFormInputGroup.tsx'; /* Metro dependency 8967 */
import RolePill from '../../../components_native/common/RolePill.tsx'; /* Metro dependency 11428 */
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ChannelRecordModule from '../../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as GuildRoleRecordModule from '../../../records/GuildRoleRecord.tsx'; /* Metro dependency 1939 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as ActivityIndicatorNativeModule from '../../../design/components/ActivityIndicator/native/ActivityIndicator.native.tsx'; /* Metro dependency 5461 */
import * as GuildTemplatesConstantsModule from '../../guild_templates/GuildTemplatesConstants.tsx'; /* Metro dependency 6934 */
function _fun87468(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:6, offset: 0x01fbf3af, size: 950 bytes, params: 8, frame: 31
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = ReactNativeModule;
const env0_4 = value.View;
const env0_5 = value.ScrollView;
value = require(661) /* metro dependency 661: Constants */;
const env0_8 = value.MarketingURLs;
const Fonts = value.Fonts;
const env0_9 = value.ChannelTypes;
value = require(33) /* metro dependency 33 */;
const env0_11 = value.jsx;
const env0_12 = value.jsxs;
const env0_13 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object.wrapper = {backgroundColor: BACKGROUND_BASE_LOWER, padding: 16};
const object3 = {textAlign: 'center'};
let DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
let MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
copyDataProperties(object3, TextStyles(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 24), undefined);
object.header = object3;
object.description = {'textAlign': 'center', 'marginTop': 8, 'marginBottom': 32};
object.iconUploader = {'alignSelf': 'center', 'marginBottom': 12};
object.createButtonWrapper = {marginTop: 8};
object.resolvingContainer = {'alignItems': 'center', 'flex': 1, 'justifyContent': 'center'};
object.divider = {marginTop: 8};
const object6 = {};
DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
copyDataProperties(object6, TextStyles(DISPLAY_EXTRABOLD, MOBILE_TEXT_HEADING_PRIMARY, 16), undefined);
object6['marginTop'] = 24;
object.sectionHeader = object6;
const object7 = {};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object7.backgroundColor = BACKGROUND_SURFACE_HIGH;
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object7.marginTop = 8;
object7.padding = 8;
object.rolesChannelsWrapper = object7;
object.channelsWrapper = {'flexDirection': 'column', 'paddingVertical': 0};
object.rolesWrapper = {'flexDirection': 'row', 'flexWrap': 'wrap'};
object.channelRow = {'alignItems': 'center', 'flexDirection': 'row', 'height': 40};
object.channelIcon = {'marginLeft': 12, 'marginRight': 8, 'height': 20, 'width': 20};
object.channelCategoryIcon = {'marginLeft': 0, 'marginRight': 2, 'height': 12, 'width': 12};
const CHANNELS_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CHANNELS_DEFAULT;
object.channelName = {'color': null, 'fontSize': 16, 'flex': 1, color: CHANNELS_DEFAULT};
const object9 = {};
DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD;
copyDataProperties(object9, TextStyles(DISPLAY_EXTRABOLD, undefined, 12, {uppercase: true}), 12);
object.channelCategoryName = object9;
object.sectionTip = {marginTop: 8};
const GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
object.protip = {color: GREEN_360, fontFamily: PRIMARY_BOLD, textTransform: 'uppercase'};
const env0_14 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/create_guild/native/AcceptGuildTemplate.tsx');
exports.default = AcceptGuildTemplate;
function GuildTemplateResolving() { // fn#87469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1583, offset: 0x01fbf765, size: 83 bytes, params: 1, frame: 17
const styles = useStyles();
const ActivityIndicator = (ActivityIndicatorNativeModule).ActivityIndicator;
return (
<View style={styles.resolvingContainer}>
<ActivityIndicator />
</View>
);
}
function GuildTemplateResolved({guildTemplate, createServer, name, setName, icon, chooseIcon, errors}) { // fn#87470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1710, offset: 0x01fbf7b8, size: 1660 bytes, params: 2, frame: 35
var r5;
var jsxRuntimeEnv0_13Binding;
var items5;
const styles = useStyles();
(defaultImport2)(guildTemplate != null, 'guild template cannot be null');
let state = guildTemplate.state;
const RESOLVING = GuildTemplateStates.RESOLVING;
defaultImport2(state !== RESOLVING, 'guild must be resolved');
const bottom = (UseSafeAreaInsetsNative)().bottom;
const value5 = guildTemplate.serializedSourceGuild.roles.map(_fun87471).filter(function(a0) {
return !isEveryoneRole(a0);
});
const items3 = [styles.wrapper];
items3[1] = {marginBottom: bottom};
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const QzUORX = t.QzUORX;
const items2 = [
<Text
style={styles.header}
variant="heading-xl/extrabold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [QzUORX])}
</Text>,
];
items2[1] = (
<Text
style={styles.description}
variant="text-lg/medium"
color="text-default"
>
{guildTemplate.name}
</Text>
);
items2[2] = ((Component) => <Component iconBackgroundColor={styles.wrapper.backgroundColor} style={styles.iconUploader} onPress={chooseIcon} icon={icon} />)(importDefault(9664) /* metro dependency 9664: GuildIconUploader */);
const freeFormInputGroupProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dBih7e),
error: errors?.name};
const format = intl.format;
const property = (require(1244) /* metro dependency 1244: indexNative */).t['2bprXx'];
const GUIDELINES = MarketingURLs.GUIDELINES;
freeFormInputGroupProps.hint = Reflect.apply(format, intl, [property, {guidelinesURL: GUIDELINES}]);
freeFormInputGroupProps.value = name;
freeFormInputGroupProps.onChangeText = setName;
freeFormInputGroupProps.autoFocus = true;
freeFormInputGroupProps.autoCorrect = false;
freeFormInputGroupProps.returnKeyType = 'done';
items2[3] = <FreeFormInputGroup {...freeFormInputGroupProps} />;
const Button = (ButtonNativeModule).Button;
const buttonProps = {size: 'md',
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['O0p/lS']), onPress: createServer};
state = guildTemplate.state;
let ACCEPTING = GuildTemplateStates.ACCEPTING;
buttonProps.loading = state === ACCEPTING;
state = guildTemplate.state;
ACCEPTING = GuildTemplateStates.ACCEPTING;
buttonProps.disabled = state === ACCEPTING;
buttonProps.grow = true;
items2[4] = (
<View style={styles.createButtonWrapper}>
<Button {...buttonProps} />
</View>
);
items2[5] = ((Component) => <Component style={styles.divider} outer />)(importDefault(7331) /* metro dependency 7331: FormDivider */);
string = intl.string;
const OGiMXJ = (require(1244) /* metro dependency 1244: indexNative */).t.OGiMXJ;
items2[6] = (
<Text
style={styles.sectionHeader}
variant="heading-md/extrabold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [OGiMXJ])}
</Text>
);
string = intl.string;
const Ztwyoz = (require(1244) /* metro dependency 1244: indexNative */).t.Ztwyoz;
items2[7] = (
<Text variant="text-xs/medium" color="text-default">
{Reflect.apply(string, intl, [Ztwyoz])}
</Text>
);
items2[8] = <Channels_87473 channels={guildTemplate.serializedSourceGuild.channels} />;
const LegacyText = (NativeModule).LegacyText;
const items4 = [
<LegacyText style={styles.protip}>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8tvIiN'])}
{': '}
</LegacyText>,
];
items4[1] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.de7DpI);
items2[9] = (
<Text
style={styles.sectionTip}
variant="text-xs/medium"
color="interactive-text-default"
>
{items4}
</Text>
);
if (value5.length > 0) {
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
string = intl.string;
items5 = [
<Text
style={styles.sectionHeader}
variant="heading-md/extrabold"
color="mobile-text-heading-primary"
>
{Reflect.apply(string, intl, [t.mQ0H1p])}
</Text>,
];
string = intl.string;
items5[1] = (
<Text variant="text-xs/medium" color="text-default">
{Reflect.apply(string, intl, [t.jOPEYC])}
</Text>
);
items5[2] = <Roles roles={value5} />;
r5 = (
<>
{items5}
</>
);
} else {
r5 = null;
}
items2[10] = r5;
return (
<ScrollView contentContainerStyle={items3} keyboardShouldPersistTaps="handled">
{items2}
</ScrollView>
);
function _fun87471(a0) { // fn#87471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:1999, offset: 0x01fbfe34, size: 60 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = importAll(1942) /* metro dependency 1942: GuildRoleRecordUtils */;
return value.fromServer(guildTemplate.serializedSourceGuild.id, a0);
}
}
function Channels_87473({channels}) { // fn#87473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:3909, offset: 0x01fbfe86, size: 147 bytes, params: 2, frame: 17
const styles = useStyles();
return (
<View style={[styles.rolesChannelsWrapper, styles.channelsWrapper]}>
{(importDefault(22) /* metro dependency 22 */)(channels).sortBy(function(a0) {
var r0;
var value;
if (a0.parent_id == null) {
value = global.Number(a0.id);
value = 10000 * value;
r0 = value;
} else {
value = global.Number(a0.parent_id);
value = 10000 * value;
value += a0.id;
r0 = value;
}
return r0;
}).map(_fun87475).value()}
</View>
);
function _fun87475(a0) { // fn#87475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4047, offset: 0x01fbff72, size: 325 bytes, params: 2, frame: 26
const type = a0.type;
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
const value2 = type === GUILD_CATEGORY;
const stylesBinding = styles;
const channelRow = stylesBinding.channelRow;
const Icon = (NativeModule).Icon;
const items2 = [stylesBinding.channelIcon];
const value4 = null;
items2[1] = value2 ? styles.channelCategoryIcon : value4;
const PRIMARY_400 = (Native).unsafe_rawColors.PRIMARY_400;
const Icon2 = (NativeModule).Icon;
const Sizes = Icon2.Sizes;
const CUSTOM = Sizes.CUSTOM;
const icon = (
<Icon
style={items2}
color={PRIMARY_400}
size={CUSTOM}
source={getChannelIcon_87476(a0)}
/>
);
const LegacyText = (NativeModule).LegacyText;
return (
<View style={channelRow} key={a0.id}>
{icon}
<LegacyText numberOfLines={1} style={[styles.channelName, value2 ? styles.channelCategoryName : value4]}>
{a0.name}
</LegacyText>
</View>
);
}
}
function getChannelIcon_87476({type}) { // fn#87476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4495, offset: 0x01fc00b7, size: 105 bytes, params: 2, frame: 14
return isGuildVocalChannelType(type) ? importDefault(9062) /* metro dependency 9062 */ : type === ChannelTypes.GUILD_CATEGORY ? importDefault(11426) /* metro dependency 11426 */ : importDefault(11427) /* metro dependency 11427 */;
}
function Roles({roles}) { // fn#87477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4589, offset: 0x01fc0120, size: 110 bytes, params: 2, frame: 17
const styles = useStyles();
return (
<View style={[styles.rolesChannelsWrapper, styles.rolesWrapper]}>
{roles.slice().reverse().map(_fun87478)}
</View>
);
function _fun87478(a0) { // fn#87478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4652, offset: 0x01fc018e, size: 113 bytes, params: 2, frame: 19
var r5;
let value = environment.__proto__;
const value2 = undefined;
if (a0.color === 0) {
r5 = value2;
} else {
value = require(673) /* metro dependency 673: ColorUtils */;
value = value.int2hex(a0.color);
r5 = value;
}
return (
<RolePill
disableInteraction
role={a0}
color={r5}
key={a0.id}
/>
);
}
}
function AcceptGuildTemplate(a0) { // fn#87479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11611:4923, offset: 0x01fc01ff, size: 172 bytes, params: 2, frame: 15
const guildTemplate = a0.guildTemplate;
if (guildTemplate != null) {
var state = guildTemplate.state;
var RESOLVED = GuildTemplateStates.RESOLVED;
if (RESOLVED === state) {
return <GuildTemplateResolved {...a0} />;
}
var ACCEPTING = GuildTemplateStates.ACCEPTING;
if (ACCEPTING === state) {
return <GuildTemplateResolved {...a0} />;
}
var ACCEPTED = GuildTemplateStates.ACCEPTED;
if (ACCEPTED === state) {
return <GuildTemplateResolved {...a0} />;
}
var RESOLVING = GuildTemplateStates.RESOLVING;
if (RESOLVING === state) {
return <GuildTemplateResolving {...a0} />;
}
}
return <GuildTemplateResolving {...a0} />;
}
}
global.__d(_fun87468, 11425, [31, 27, 1383, 1939, 661, 6934, 33, 4501, 697, 6597, 5461, 44, 1585, 1942, 4573, 1244,
9664, 8967, 4578, 7331, 1305, 22, 9062, 11426, 11427, 11428, 673,
2]) /* metro module 11425, dependencies: [31, 27, 1383, 1939, 661, 6934, 33, 4501, 697, 6597, 5461, 44, 1585, 1942, 4573, 1244, 9664, 8967, 4578, 7331, 1305, 22, 9062, 11426, 11427, 11428, 673, 2] */;