This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,93 +1,153 @@
/* Metro module 11750; source: modules/polls/native/EditPollCreationImageAltTextModal.tsx; dependencies: [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467, 8127, 7972, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import KeyboardAwareView from '../../keyboard/native/KeyboardAwareView.tsx'; /* Metro dependency 5467 */
import Module08160 from '../../../by-id/module-08160.js'; /* Metro dependency 8160 */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
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 TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as EditPollCreationImageAltTextModalActionCreatorsModule from './EditPollCreationImageAltTextModalActionCreators.tsx'; /* Metro dependency 11749 */
function _fun90052(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:6, offset: 0x020286fc, size: 473 bytes, params: 8, frame: 23
var object2;
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 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_5 = value.TouchableOpacity;
const env0_6 = value.View;
const env0_7 = (require(7217) /* metro dependency 7217: PollsConstants */).MAX_POLL_ANSWER_LENGTH;
value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object2.header = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 18,
object.container = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object.header = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 18,
'paddingTop': 10};
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
object2.separator = {borderBottomWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
object2.contentContainer = {'flex': 1, 'justifyContent': 'center'};
const object3 = {'borderRadius': null, 'justifyContent': 'center', 'alignItems': 'center', 'alignSelf': 'center',
object.separator = {borderBottomWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
object.contentContainer = {'flex': 1, 'justifyContent': 'center'};
const object4 = {'borderRadius': null, 'justifyContent': 'center', 'alignItems': 'center', 'alignSelf': 'center',
'overflow': 'hidden', 'aspectRatio': 1};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.imageContainer = object3;
object2.formContainer = {paddingHorizontal: 16};
const object5 = {};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.imageContainer = object4;
object.formContainer = {paddingHorizontal: 16};
const object6 = {};
const REDESIGN_CHAT_INPUT_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_CHAT_INPUT_BACKGROUND;
object5.backgroundColor = REDESIGN_CHAT_INPUT_BACKGROUND;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.textInput = object5;
const env0_10 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModal.tsx');
object6.backgroundColor = REDESIGN_CHAT_INPUT_BACKGROUND;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.textInput = object6;
const env0_10 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModal.tsx');
exports.default = EditPollCreationImageAltTextModal;
}
function EditPollCreationImageAltTextModal({channelId, answer, onSave, imageSize}) { // fn#90053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:844, offset: 0x020288d5, size: 1096 bytes, params: 2, frame: 40
const styles = useStyles();
const {renderImage,
upload} = (UseRenderPollAnswerImage)(channelId,
answer.localCreationAnswerId, answer.image, imageSize, imageSize);
const useState = ReactModule.useState;
const value6 = Module00057(Reflect.apply(useState, ReactModule, [upload?.description ?? '']), 2);
const property = value6[0];
const property2 = value6[1];
const value7 = ReactModule.useCallback(_fun90054, [onSave, property]);
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const closeEditPollCreationImageAltTextModal = (EditPollCreationImageAltTextModalActionCreatorsModule).closeEditPollCreationImageAltTextModal;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const Icon = (NativeModule).Icon;
const items3 = [
<TouchableOpacity
onPress={closeEditPollCreationImageAltTextModal}
activeOpacity={0.5}
accessibilityRole="button"
accessibilityLabel={Reflect.apply(string, intl, [cpT0Cq])}
>
<Icon source={Module08160} />
</TouchableOpacity>,
];
const Text = (TextModule).Text;
string = intl.string;
const Cq44Rg = (require(1244) /* metro dependency 1244: indexNative */).t.Cq44Rg;
items3[1] = (
<Text variant="redesign/heading-18/bold" color="mobile-text-heading-primary">
{Reflect.apply(string, intl, [Cq44Rg])}
</Text>
);
items3[2] = (
<TouchableOpacity onPress={value7} activeOpacity={0.5}>
<Text variant="text-md/medium" color="text-brand">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+'])}
</Text>
</TouchableOpacity>
);
const items2 = [
<View style={styles.header}>
{items3}
</View>,
];
items2[1] = <View style={styles.separator} />;
const view = (
<View style={styles.imageContainer}>
{renderImage}
</View>
);
const Spacer = (NativeModule).Spacer;
const items4 = [
<Spacer size={27} />,
];
items4[1] = ((Component) => <Component>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}</Component>)(importDefault(8127) /* metro dependency 8127: FormHeader */);
const FormInput = (NativeModule2).FormInput;
const ClearButtonVisibility = (NativeModule).ClearButtonVisibility;
const WITH_CONTENT = ClearButtonVisibility.WITH_CONTENT;
items4[2] = (
<FormInput
showTopContainer={false}
showBorder={false}
multiline={false}
value={property}
onChange={property2}
clearButtonVisibility={WITH_CONTENT}
style={styles.textInput}
textContentType="none"
maxLength={MAX_POLL_ANSWER_LENGTH}
autoFocus
autoCorrect
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}
/>
);
items4[3] = <Spacer size={27} />;
items2[2] = (
<KeyboardAwareView style={styles.contentContainer}>
{view}
<View style={styles.formContainer}>
{items4}
</View>
</KeyboardAwareView>
);
return (
<SafeAreaPaddingView top style={styles.container}>
{items2}
</SafeAreaPaddingView>
);
function _fun90054() { // fn#90054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:1118, offset: 0x02028d1d, size: 65 bytes, params: 1, frame: 11
if (env0_1 != null) {
onSave(env0_1);
}
const value = environment.__proto__;
(EditPollCreationImageAltTextModalActionCreatorsModule).closeEditPollCreationImageAltTextModal();
}
function EditPollCreationImageAltTextModal({channelId, answer, onSave, imageSize}) { // fn#90053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:844, offset: 0x020288d5, size: 1096 bytes, params: 2, frame: 40
const styles = useStyles();
const {renderImage,
upload} = (importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */)(channelId,
answer.localCreationAnswerId, answer.image, imageSize, imageSize);
const binding = env0_4;
const useState = binding.useState;
const value6 = env0_3(Reflect.apply(useState, binding, [upload?.description ?? '']), 2);
const property = value6[0];
const property2 = value6[1];
const value7 = env0_4.useCallback(_fun90054, [onSave, property]);
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const closeEditPollCreationImageAltTextModal = (require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).closeEditPollCreationImageAltTextModal;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const items3 = [<TouchableOpacity onPress={closeEditPollCreationImageAltTextModal} activeOpacity={0.5} accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
intl, [cpT0Cq])}><Icon source={importDefault(8160) /* metro dependency 8160 */} /></TouchableOpacity>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Cq44Rg = (require(1244) /* metro dependency 1244: indexNative */).t.Cq44Rg;
items3[1] = <Text variant="redesign/heading-18/bold" color="mobile-text-heading-primary">{Reflect.apply(string,
intl, [Cq44Rg])}</Text>;
items3[2] = <TouchableOpacity onPress={value7} activeOpacity={0.5}><Text variant="text-md/medium" color="text-brand">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+'])}</Text></TouchableOpacity>;
const items2 = [<View style={styles.header}>{items3}</View>];
items2[1] = <View style={styles.separator} />;
const KeyboardAwareView = importDefault(5467) /* metro dependency 5467: KeyboardAwareView */;
const view = <View style={styles.imageContainer}>{renderImage}</View>;
const Spacer = (require(1305) /* metro dependency 1305: native */).Spacer;
const items4 = [<Spacer size={27} />];
items4[1] = ((Component) => <Component>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])}</Component>)(importDefault(8127) /* metro dependency 8127: FormHeader */);
const FormInput = (require(7972) /* metro dependency 7972: native */).FormInput;
const ClearButtonVisibility = (require(1305) /* metro dependency 1305: native */).ClearButtonVisibility;
const WITH_CONTENT = ClearButtonVisibility.WITH_CONTENT;
items4[2] = <FormInput showTopContainer={false} showBorder={false} multiline={false} value={property} onChange={property2} clearButtonVisibility={WITH_CONTENT} style={styles.textInput} textContentType="none" maxLength={MAX_POLL_ANSWER_LENGTH} autoFocus autoCorrect accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/2Gnoa'])} />;
items4[3] = <Spacer size={27} />;
items2[2] = <KeyboardAwareView style={styles.contentContainer}>{view}<View style={styles.formContainer}>{items4}</View></KeyboardAwareView>;
return (
<SafeAreaPaddingView top style={styles.container}>
{items2}
</SafeAreaPaddingView>
);
}
function _fun90054() { // fn#90054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11936:1118, offset: 0x02028d1d, size: 65 bytes, params: 1, frame: 11
if (env0_1 != null) {
onSave(env0_1);
}
const value = environment.__proto__;
(require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).closeEditPollCreationImageAltTextModal();
}
global.__d(_fun90052, 11750, [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467,
8127, 7972,
2]) /* metro module 11750, dependencies: [57, 31, 27, 7217, 33, 4501, 697, 11747, 11749, 6618, 1244, 1305, 8160, 4573, 5467, 8127, 7972, 2] */;
@@ -1,22 +1,26 @@
/* Metro module 11749; source: modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx; dependencies: [5080, 11750, 1962, 2] */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun90049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:6, offset: 0x0202860b, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/EditPollCreationImageAltTextModalActionCreators.tsx');
exports.openEditPollCreationImageAltTextModal = openEditPollCreationImageAltTextModal;
exports.closeEditPollCreationImageAltTextModal = closeEditPollCreationImageAltTextModal;
function openEditPollCreationImageAltTextModal(a0) { // fn#90050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:286, offset: 0x0202867f, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'edit-poll-creation-image-alt-text-modal']);
}
function closeEditPollCreationImageAltTextModal() { // fn#90051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:376, offset: 0x020286d1, size: 43 bytes, params: 1, frame: 12
(ModalActionCreators).popWithKey('edit-poll-creation-image-alt-text-modal');
}
}
function openEditPollCreationImageAltTextModal(a0) { // fn#90050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:286, offset: 0x0202867f, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'edit-poll-creation-image-alt-text-modal']);
}
function closeEditPollCreationImageAltTextModal() { // fn#90051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11935:376, offset: 0x020286d1, size: 43 bytes, params: 1, frame: 12
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('edit-poll-creation-image-alt-text-modal');
}
global.__d(_fun90049, 11749, [5080, 11750, 1962, 2]) /* metro module 11749, dependencies: [5080, 11750, 1962, 2] */;
@@ -1,80 +1,127 @@
/* Metro module 11748; source: modules/polls/native/ImageInputActionSheet.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as ActionSheetRowNativeModule from '../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as EditPollCreationImageAltTextModalActionCreatorsModule from './EditPollCreationImageAltTextModalActionCreators.tsx'; /* Metro dependency 11749 */
function _fun90043(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:6, offset: 0x020280a8, size: 283 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const env0_5 = (require(7217) /* metro dependency 7217: PollsConstants */).POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY;
let value = require(33) /* metro dependency 33 */;
let value = JsxRuntimeModule;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {marginRight: 12};
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const object2 = {marginRight: 12};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const env0_8 = Reflect.apply(createStyles, value, [{emojiContainer: {'flexDirection': 'row', 'alignItems': 'center',
'marginHorizontal': 24}, emojiIcon: object}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/ImageInputActionSheet.tsx');
'marginHorizontal': 24}, emojiIcon: object2}]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/ImageInputActionSheet.tsx');
exports.default = ImageInputAnswerActionSheet;
}
function ImageInputAnswerActionSheet({channelId, index, answer, onSaveAltText, onRemoveAnswerImage, openExpressionPicker}) { // fn#90044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:452, offset: 0x020281c3, size: 884 bytes, params: 2, frame: 35
var r5;
var items3;
var Text;
const styles = useStyles();
const defaultImport = UseRenderPollAnswerImage;
const localCreationAnswerId = answer.localCreationAnswerId;
let image = answer.image;
const {renderImage, upload} = defaultImport(channelId, localCreationAnswerId, image, 40, 40);
const r12 = upload != null || answer.image?.emoji != null;
const env0_6 = onSaveAltText.useCallback(function() {
require(dependencyMap[7]).dismissKeyboard();
importDefault(dependencyMap[8]).hideActionSheet(POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY);
}, []);
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
if (r12) {
var viewBindingProps = {style: styles.emojiContainer};
items3 = [
<View style={styles.emojiIcon}>
{renderImage}
</View>,
];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
image = answer.image;
items3[1] = (
<Text variant="text-md/bold" color="mobile-text-heading-primary">
{':' + (image == null || image.emoji == null ? undefined : image.emoji.name) + ':'}
</Text>
);
r5 = (
<View {...viewBindingProps}>
{items3}
</View>
);
} else {
r5 = r12;
}
const items2 = [r5];
const Spacer = (NativeModule).Spacer;
items2[1] = <Spacer size={21} />;
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
const Group = ActionSheetRow.Group;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
items2[2] = (
<Group hasIcons={false}>
<ActionSheetRow
label={r12 ? Reflect.apply(string, intl, [t.CZeRhU]) : Reflect.apply(string, intl, [t.dzcU1Q])}
onPress={onPress_90046}
/>
{
upload != null
? (
<ActionSheetRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w7x2t4)}
onPress={onPress_90047}
/>
)
: null
}
{
r12
? (
<ActionSheetRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.IhMxgu)}
onPress={onPress_90048}
/>
)
: null
}
</Group>
);
return (
<ActionSheet startExpanded>
{items2}
</ActionSheet>
);
function ImageInputAnswerActionSheetOnPress() { // fn#90046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1296, owner: ImageInputAnswerActionSheet.onPress, offset: 0x0202857b, size: 23 bytes, params: 1, frame: 10
env0_6();
openExpressionPicker();
}
function ImageInputAnswerActionSheetOnPress_90047() { // fn#90047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1401, owner: ImageInputAnswerActionSheet.onPress, offset: 0x02028592, size: 93 bytes, params: 1, frame: 14
env0_6();
(EditPollCreationImageAltTextModalActionCreatorsModule).openEditPollCreationImageAltTextModal({channelId: channelId,
answer: answer, index: index, onSave: onSaveAltText, imageSize: 40});
}
function ImageInputAnswerActionSheetOnPress_90048() { // fn#90048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1602, owner: ImageInputAnswerActionSheet.onPress, offset: 0x020285ef, size: 28 bytes, params: 1, frame: 12
onRemoveAnswerImage(index);
env0_6();
}
function ImageInputAnswerActionSheet({channelId, index, answer, onSaveAltText, onRemoveAnswerImage, openExpressionPicker}) { // fn#90044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:452, offset: 0x020281c3, size: 884 bytes, params: 2, frame: 35
var r5;
var items3;
var Text;
const styles = useStyles();
const defaultImport = importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */;
const localCreationAnswerId = answer.localCreationAnswerId;
let image = answer.image;
const {renderImage, upload} = defaultImport(channelId, localCreationAnswerId, image, 40, 40);
const r12 = upload != null || answer.image?.emoji != null;
const env0_6 = onSaveAltText.useCallback(function() {
require(dependencyMap[7]).dismissKeyboard();
importDefault(dependencyMap[8]).hideActionSheet(POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY);
}, []);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
if (r12) {
var viewBindingProps = {style: styles.emojiContainer};
items3 = [<View style={styles.emojiIcon}>{renderImage}</View>];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
image = answer.image;
items3[1] = <Text variant="text-md/bold" color="mobile-text-heading-primary">{':' + (image == null || image.emoji == null ? undefined : image.emoji.name) + ':'}</Text>;
r5 = <View {...viewBindingProps}>{items3}</View>;
} else {
r5 = r12;
}
const items2 = [r5];
const Spacer = (require(1305) /* metro dependency 1305: native */).Spacer;
items2[1] = <Spacer size={21} />;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
items2[2] = <Group hasIcons={false}><ActionSheetRow label={r12 ? Reflect.apply(string, intl,
[t.CZeRhU]) : Reflect.apply(string, intl,
[t.dzcU1Q])} onPress={onPress_90046} />{upload != null ? <ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.w7x2t4)} onPress={onPress_90047} /> : null}{r12 ? <ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.IhMxgu)} onPress={onPress_90048} /> : null}</Group>;
return (
<ActionSheet startExpanded>
{items2}
</ActionSheet>
);
}
function ImageInputAnswerActionSheetOnPress() { // fn#90046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1296, owner: ImageInputAnswerActionSheet.onPress, offset: 0x0202857b, size: 23 bytes, params: 1, frame: 10
env0_6();
openExpressionPicker();
}
function ImageInputAnswerActionSheetOnPress_90047() { // fn#90047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1401, owner: ImageInputAnswerActionSheet.onPress, offset: 0x02028592, size: 93 bytes, params: 1, frame: 14
env0_6();
(require(11749) /* metro dependency 11749: EditPollCreationImageAltTextModalActionCreators */).openEditPollCreationImageAltTextModal({channelId: channelId,
answer: answer, index: index, onSave: onSaveAltText, imageSize: 40});
}
function ImageInputAnswerActionSheetOnPress_90048() { // fn#90048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11934:1602, owner: ImageInputAnswerActionSheet.onPress, offset: 0x020285ef, size: 28 bytes, params: 1, frame: 12
onRemoveAnswerImage(index);
env0_6();
}
global.__d(_fun90043, 11748, [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749,
2]) /* metro module 11748, dependencies: [31, 27, 7217, 33, 4501, 697, 11747, 4015, 4080, 6805, 4573, 1305, 6807, 1244, 11749, 2] */;
+230 -186
View File
@@ -1,215 +1,259 @@
/* Metro module 11746; source: modules/polls/native/PollAnswerInput.tsx; dependencies: [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529, 7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751, 2] */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import Module07951 from '../../../by-id/module-07951.js'; /* Metro dependency 7951 */
import UseRenderPollAnswerImage from './useRenderPollAnswerImage.tsx'; /* Metro dependency 11747 */
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as NativeModule from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
function _fun90028(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:6, offset: 0x020271e5, size: 576 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
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 */;
let value = ReactNativeModule;
const env0_4 = value.Keyboard;
const env0_5 = value.TouchableOpacity;
const env0_6 = value.View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_8 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
value = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_9 = value.MAX_POLL_ANSWER_LENGTH;
const env0_10 = value.POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY;
const env0_11 = (require(1881) /* metro dependency 1881: EmojiConstants */).EmojiIntention;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
const env0_14 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {defaultContainer: {'flexDirection': 'row', 'alignItems': 'center'}};
const object4 = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null, 'borderRadius': null,
object = {defaultContainer: {'flexDirection': 'row', 'alignItems': 'center'}};
const object2 = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null, 'borderRadius': null,
'flex': 1, 'overflow': 'hidden'};
const INPUT_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BACKGROUND_DEFAULT;
object4.backgroundColor = INPUT_BACKGROUND_DEFAULT;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.defaultImageAndTextContainer = object4;
object3.cannotRemove = {marginRight: 30};
object3.defaultImageContainer = {'width': 60, 'height': 48, 'justifyContent': 'center', 'alignItems': 'center'};
object3.pollAnswerTextInput = {'flex': 1, 'paddingStart': 0};
object2.backgroundColor = INPUT_BACKGROUND_DEFAULT;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.defaultImageAndTextContainer = object2;
object.cannotRemove = {marginRight: 30};
object.defaultImageContainer = {'width': 60, 'height': 48, 'justifyContent': 'center', 'alignItems': 'center'};
object.pollAnswerTextInput = {'flex': 1, 'paddingStart': 0};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object3.defaultRemoveButtonContainer = {'paddingLeft': 6, 'height': 48, 'justifyContent': 'center',
object.defaultRemoveButtonContainer = {'paddingLeft': 6, 'height': 48, 'justifyContent': 'center',
color: TEXT_MUTED};
object3.uploadContainer = {alignItems: 'flex-start'};
object.uploadContainer = {alignItems: 'flex-start'};
const BORDER_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_FEEDBACK_CRITICAL;
object3.errorInput = {borderColor: BORDER_FEEDBACK_CRITICAL, borderWidth: 2};
const env0_15 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollAnswerInput.tsx');
object.errorInput = {borderColor: BORDER_FEEDBACK_CRITICAL, borderWidth: 2};
const env0_15 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollAnswerInput.tsx');
exports.default = PollAnswerInput;
}
function ImageInput({channelId, localCreationAnswerId, image, iconSrc, openExpressionPicker, emojiSize, containerStyle, imageSize, answerIndex, openImageInputActionSheet}) { // fn#90029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:998, offset: 0x02027425, size: 450 bytes, params: 2, frame: 30
emojiSize = emojiSize === undefined ? 24 : emojiSize;
const styles = useStyles();
const {renderImage, upload,
setUploadSize} = (importDefault(11747) /* metro dependency 11747: useRenderPollAnswerImage */)(channelId,
localCreationAnswerId, image, imageSize, emojiSize);
const env0_3 = setUploadSize;
const value5 = env0_3.useMemo(_fun90030, [image, upload, answerIndex]);
const value6 = env0_3.useCallback(function(a0) {
setUploadSize(a0.nativeEvent.layout.width);
}, [setUploadSize]);
let r4 = upload != null || image?.emoji != null;
const r15 = r4 ? openImageInputActionSheet : openExpressionPicker;
const r14 = r4 ? undefined : openImageInputActionSheet;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const r6 = imageSize == null ? value6 : undefined;
const items2 = [containerStyle];
items2[1] = upload != null && styles.uploadContainer;
if (r4) {
r4 = <View>{renderImage}</View>;
} else {
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
r4 = <Icon source={iconSrc} />;
}
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={value5}
onPress={r15}
onLongPress={r14}
onLayout={r6}
style={items2}
>
{r4}
</PressableOpacity>
);
}
function PollAnswerInput({answer, index, inputRef, channelId, onAnswerTextChange, onAnswerEmojiSelect, canRemoveAnswer, onRemoveAnswer, onRemoveAnswerImage, onSubmitEditing, error}) { // fn#90032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2039, offset: 0x02027750, size: 1002 bytes, params: 2, frame: 37
var r10;
var object;
var defaultRemoveButtonContainer;
var Icon;
var value;
const styles = useStyles();
const image = answer.image;
let localCreationAnswerId = answer.localCreationAnswerId;
const closure = function() {
var value3 = ChannelStore.getChannel(channelId);
if (value3 != null) {
Keyboard.dismiss();
require(dependencyMap[14]).openEmojiPickerActionSheet({channel: value3, onPressEmoji: _fun90034,
pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
function ImageInput({channelId, localCreationAnswerId, image, iconSrc, openExpressionPicker, emojiSize, containerStyle, imageSize, answerIndex, openImageInputActionSheet}) { // fn#90029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:998, offset: 0x02027425, size: 450 bytes, params: 2, frame: 30
emojiSize = emojiSize === undefined ? 24 : emojiSize;
const styles = useStyles();
const {renderImage, upload,
setUploadSize} = (UseRenderPollAnswerImage)(channelId,
localCreationAnswerId, image, imageSize, emojiSize);
const setUploadSize2 = setUploadSize;
const value5 = setUploadSize2.useMemo(_fun90030, [image, upload, answerIndex]);
const value6 = setUploadSize2.useCallback(function(a0) {
setUploadSize(a0.nativeEvent.layout.width);
}, [setUploadSize]);
let r4 = upload != null || image?.emoji != null;
const r15 = r4 ? openImageInputActionSheet : openExpressionPicker;
const r14 = r4 ? undefined : openImageInputActionSheet;
const PressableOpacity = (PressablesModule).PressableOpacity;
const r6 = imageSize == null ? value6 : undefined;
const items2 = [containerStyle];
items2[1] = upload != null && styles.uploadContainer;
if (r4) {
r4 = (
<View>
{renderImage}
</View>
);
} else {
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
r4 = <Icon source={iconSrc} />;
}
};
const handleSaveAltText = function(a0) {
var defaultImport = importDefault(dependencyMap[15]);
var channelIdBinding = channelId;
var localCreationAnswerId = answer.localCreationAnswerId;
var Poll = DraftType.Poll;
defaultImport.update(channelIdBinding, localCreationAnswerId, Poll, {description: a0});
};
let r5 = error != null && error.length > 0;
const jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
const items3 = [styles.defaultContainer];
items3[1] = !canRemoveAnswer && styles.cannotRemove;
const items2 = [styles.defaultImageAndTextContainer];
items2[1] = r5 && styles.errorInput;
const imageInput = <ImageInput channelId={channelId} localCreationAnswerId={localCreationAnswerId} image={image} openExpressionPicker={closure} openImageInputActionSheet={openImageInputActionSheet} iconSrc={importDefault(7951) /* metro dependency 7951 */} containerStyle={styles.defaultImageContainer} imageSize={48} answerIndex={index} />;
const FormInput = (require(7972) /* metro dependency 7972: native */).FormInput;
const formInputProps = {'ref': null, 'textAlignVertical': 'center', 'showTopContainer': false, 'showBorder': false,
ref: inputRef};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const NNHVlv = (require(1244) /* metro dependency 1244: indexNative */).t.NNHVlv;
formInputProps.placeholder = Reflect.apply(string, intl, [NNHVlv]);
formInputProps.onChange = function(a0) {
return onAnswerTextChange({text: a0, index: index, localCreationAnswerId: localCreationAnswerId});
};
formInputProps.onSubmitEditing = onSubmitEditing;
formInputProps.blurOnSubmit = false;
formInputProps.style = styles.pollAnswerTextInput;
formInputProps.textContentType = 'none';
formInputProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['3+V8G9'],
{answerNumber: index + 1});
formInputProps.accessibilityHint = r5 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
formInputProps.maxLength = MAX_POLL_ANSWER_LENGTH;
formInputProps.returnKeyType = 'next';
formInputProps.required = true;
formInputProps.autoCorrect = true;
formInputProps['aria-invalid'] = error;
const view = <View style={items2}>{imageInput}<FormInput {...formInputProps} /></View>;
if (canRemoveAnswer) {
object = {onPress: function() {
return onRemoveAnswer(index);
}, accessibilityRole: 'button'};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
object.style = defaultRemoveButtonContainer;
object.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['22fjEc'],
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={value5}
onPress={r15}
onLongPress={r14}
onLayout={r6}
style={items2}
>
{r4}
</PressableOpacity>
);
function _fun90030() { // fn#90030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:1273, offset: 0x020275e7, size: 361 bytes, params: 1, frame: 19
var r8;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
var object;
var value5;
var vcC7Qn;
var value6;
if (image?.emoji != null) {
value6 = environment.__proto__;
return intl.formatToPlainString(t.vcC7Qn, {imageName: image.emoji.name, answerNumber: answerIndex + 1});
}
if (upload != null) {
r8 = upload.item.filename ?? '';
value5 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
vcC7Qn = t.vcC7Qn;
object = {};
object.imageName = (require(7149) /* metro dependency 7149: PollsUtils */).filterOutUUID(r8);
object.answerNumber = answerIndex + 1;
return Reflect.apply(formatToPlainString, intl, [vcC7Qn, object]);
}
return intl.formatToPlainString(t.ieNrxk, {answerNumber: answerIndex + 1});
}
}
function PollAnswerInput({answer, index, inputRef, channelId, onAnswerTextChange, onAnswerEmojiSelect, canRemoveAnswer, onRemoveAnswer, onRemoveAnswerImage, onSubmitEditing, error}) { // fn#90032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2039, offset: 0x02027750, size: 1002 bytes, params: 2, frame: 37
var r10;
var object2;
var defaultRemoveButtonContainer;
var Icon;
var value;
const styles = useStyles();
const image = answer.image;
let localCreationAnswerId = answer.localCreationAnswerId;
const closure = function() {
var value3 = ChannelStore.getChannel(channelId);
if (value3 != null) {
Keyboard.dismiss();
require(dependencyMap[14]).openEmojiPickerActionSheet({channel: value3, onPressEmoji: _fun90034,
pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
};
const handleSaveAltText = function(a0) {
var defaultImport = importDefault(dependencyMap[15]);
var channelIdBinding = channelId;
var localCreationAnswerId = answer.localCreationAnswerId;
var Poll = DraftType.Poll;
defaultImport.update(channelIdBinding, localCreationAnswerId, Poll, {description: a0});
};
let r5 = error != null && error.length > 0;
const jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
const items3 = [styles.defaultContainer];
items3[1] = !canRemoveAnswer && styles.cannotRemove;
const items2 = [styles.defaultImageAndTextContainer];
items2[1] = r5 && styles.errorInput;
const imageInput = (
<ImageInput
channelId={channelId}
localCreationAnswerId={localCreationAnswerId}
image={image}
openExpressionPicker={closure}
openImageInputActionSheet={openImageInputActionSheet}
iconSrc={Module07951}
containerStyle={styles.defaultImageContainer}
imageSize={48}
answerIndex={index}
/>
);
const FormInput = (NativeModule).FormInput;
const formInputProps = {'ref': null, 'textAlignVertical': 'center', 'showTopContainer': false, 'showBorder': false,
ref: inputRef};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const NNHVlv = (require(1244) /* metro dependency 1244: indexNative */).t.NNHVlv;
formInputProps.placeholder = Reflect.apply(string, intl, [NNHVlv]);
formInputProps.onChange = function(a0) {
return onAnswerTextChange({text: a0, index: index, localCreationAnswerId: localCreationAnswerId});
};
formInputProps.onSubmitEditing = onSubmitEditing;
formInputProps.blurOnSubmit = false;
formInputProps.style = styles.pollAnswerTextInput;
formInputProps.textContentType = 'none';
formInputProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['3+V8G9'],
{answerNumber: index + 1});
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.MEDIUM,
source: importDefault(4072) /* metro dependency 4072 */};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
iconProps.color = defaultRemoveButtonContainer.color;
r10 = <TouchableOpacity {...object}><Icon {...iconProps} /></TouchableOpacity>;
} else {
r10 = canRemoveAnswer;
formInputProps.accessibilityHint = r5 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
formInputProps.maxLength = MAX_POLL_ANSWER_LENGTH;
formInputProps.returnKeyType = 'next';
formInputProps.required = true;
formInputProps.autoCorrect = true;
formInputProps['aria-invalid'] = error;
const view = (
<View style={items2}>
{imageInput}
<FormInput {...formInputProps} />
</View>
);
if (canRemoveAnswer) {
object2 = {onPress: function() {
return onRemoveAnswer(index);
}, accessibilityRole: 'button'};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
object2.style = defaultRemoveButtonContainer;
object2.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['22fjEc'],
{answerNumber: index + 1});
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.MEDIUM,
source: importDefault(4072) /* metro dependency 4072 */};
defaultRemoveButtonContainer = styles.defaultRemoveButtonContainer;
iconProps.color = defaultRemoveButtonContainer.color;
r10 = (
<TouchableOpacity {...object2}>
<Icon {...iconProps} />
</TouchableOpacity>
);
} else {
r10 = canRemoveAnswer;
}
const view2 = (
<View style={items3}>
{view}
{r10}
</View>
);
if (r5) {
value = importDefault(11751) /* metro dependency 11751: PollCreationInputError */;
value = ((Component) => <Component message={error} />)(value);
r5 = value;
}
return (
<>
{view2}
{r5}
</>
);
function openExpressionPicker() { // fn#90033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2300, owner: PollAnswerInput.openExpressionPicker, offset: 0x02027b3a, size: 128 bytes, params: 1, frame: 13
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
Keyboard.dismiss();
(require(8529) /* metro dependency 8529: openEmojiPickerActionSheet */).openEmojiPickerActionSheet({channel: channel,
onPressEmoji: function(a0) {
onAnswerEmojiSelect(a0, index);
}, pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
function openExpressionPickerOnPressEmoji(a0) { // fn#90034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2409, owner: PollAnswerInput.openExpressionPicker.onPressEmoji, offset: 0x02027bba, size: 24 bytes, params: 2, frame: 13
onAnswerEmojiSelect(a0, index);
}
}
function openImageInputActionSheet() { // fn#90036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2869, owner: PollAnswerInput.openImageInputActionSheet, offset: 0x02027c21, size: 135 bytes, params: 1, frame: 18
const defaultImport = importDefault(dependencyMap[16]);
defaultImport.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths),
POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY, {channelId: channelId, index: index, answer: answer,
onSaveAltText: handleSaveAltText, onRemoveAnswerImage: onRemoveAnswerImage,
openExpressionPicker: openExpressionPicker});
}
}
const view2 = <View style={items3}>{view}{r10}</View>;
if (r5) {
value = importDefault(11751) /* metro dependency 11751: PollCreationInputError */;
value = ((Component) => <Component message={error} />)(value);
r5 = value;
}
return (
<>
{view2}
{r5}
</>
);
}
function _fun90030() { // fn#90030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:1273, offset: 0x020275e7, size: 361 bytes, params: 1, frame: 19
var r8;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var object2;
var value5;
var vcC7Qn;
var value6;
if (image?.emoji != null) {
value6 = environment.__proto__;
return intl.formatToPlainString(t.vcC7Qn, {imageName: image.emoji.name, answerNumber: answerIndex + 1});
}
if (upload != null) {
r8 = upload.item.filename ?? '';
value5 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
vcC7Qn = t.vcC7Qn;
object2 = {};
object2.imageName = (require(7149) /* metro dependency 7149: PollsUtils */).filterOutUUID(r8);
object2.answerNumber = answerIndex + 1;
return Reflect.apply(formatToPlainString, intl, [vcC7Qn, object2]);
}
return intl.formatToPlainString(t.ieNrxk, {answerNumber: answerIndex + 1});
}
function PollAnswerInputOpenExpressionPicker() { // fn#90033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2300, owner: PollAnswerInput.openExpressionPicker, offset: 0x02027b3a, size: 128 bytes, params: 1, frame: 13
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
Keyboard.dismiss();
(require(8529) /* metro dependency 8529: openEmojiPickerActionSheet */).openEmojiPickerActionSheet({channel: channel,
onPressEmoji: function(a0) {
onAnswerEmojiSelect(a0, index);
}, pickerIntention: EmojiIntention.POLLS, startExpanded: false, autoFocus: false});
}
}
function openImageInputActionSheet() { // fn#90036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11932:2869, owner: PollAnswerInput.openImageInputActionSheet, offset: 0x02027c21, size: 135 bytes, params: 1, frame: 18
const defaultImport = importDefault(dependencyMap[16]);
defaultImport.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths),
POLL_CREATION_IMAGE_INPUT_ACTION_SHEET_KEY, {channelId: channelId, index: index, answer: answer,
onSaveAltText: handleSaveAltText, onRemoveAnswerImage: onRemoveAnswerImage,
openExpressionPicker: openExpressionPicker_90033});
}
global.__d(_fun90028, 11746, [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529,
7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751,
2]) /* metro module 11746, dependencies: [31, 27, 1379, 4645, 7217, 1881, 33, 4501, 697, 11747, 1244, 7149, 5278, 1305, 8529, 7879, 4080, 11748, 1962, 7951, 7972, 4072, 11751, 2] */;
+40 -30
View File
@@ -1,46 +1,56 @@
/* Metro module 15065; source: modules/polls/native/PollBadge.tsx; dependencies: [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244, 2] */
import Module15066 from '../../../by-id/module-15066.js'; /* Metro dependency 15066 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun113993(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:6, offset: 0x0240fcd5, size: 312 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
ReactModule;
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {'borderRadius': null, 'paddingHorizontal': 8, 'backgroundColor': null, 'color': null,
const object2 = {'borderRadius': null, 'paddingHorizontal': 8, 'backgroundColor': null, 'color': null,
'flexDirection': 'row', 'alignItems': 'center'};
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object.backgroundColor = BACKGROUND_SURFACE_HIGH;
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object.color = TEXT_MUTED;
const env0_6 = Reflect.apply(createStyles, value, [{container: object, text: {'marginLeft': 4,
object2.color = TEXT_MUTED;
const env0_6 = Reflect.apply(createStyles, value, [{container: object2, text: {'marginLeft': 4,
'textTransform': 'uppercase'}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollBadge.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollBadge.tsx');
exports.default = PollBadge;
function PollBadge({style}) { // fn#113994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:488, offset: 0x0240fe0d, size: 253 bytes, params: 2, frame: 22
const styles = useStyles();
const items2 = [styles.container, style];
const Icon = (NativeModule).Icon;
const IconSizes = (NativeModule).IconSizes;
const EXTRA_SMALL_10 = IconSizes.EXTRA_SMALL_10;
const icon = <Icon size={EXTRA_SMALL_10} source={Module15066} />;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const RgIi2B = (IndexNativeModule).t.RgIi2B;
return (
<View style={items2}>
{icon}
<Text style={styles.text} variant="text-xs/semibold">
{Reflect.apply(string, intl, [RgIi2B])}
</Text>
</View>
);
}
}
function PollBadge({style}) { // fn#113994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15262:488, offset: 0x0240fe0d, size: 253 bytes, params: 2, frame: 22
const styles = useStyles();
const items2 = [styles.container, style];
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const IconSizes = (require(1305) /* metro dependency 1305: native */).IconSizes;
const EXTRA_SMALL_10 = IconSizes.EXTRA_SMALL_10;
const icon = <Icon size={EXTRA_SMALL_10} source={importDefault(15066) /* metro dependency 15066 */} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const RgIi2B = (require(1244) /* metro dependency 1244: indexNative */).t.RgIi2B;
return (
<View style={items2}>
{icon}
<Text style={styles.text} variant="text-xs/semibold">
{Reflect.apply(string, intl, [RgIi2B])}
</Text>
</View>
);
}
global.__d(_fun113993, 15065, [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244,
2]) /* metro module 15065, dependencies: [31, 27, 33, 4501, 697, 1305, 15066, 4573, 1244, 2] */;
+422 -337
View File
@@ -1,358 +1,443 @@
/* Metro module 11734; source: modules/polls/native/PollCreation.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080, 11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277, 5313, 11744, 7972, 11746, 8950, 2] */
import Module05313 from '../../../by-id/module-05313.js'; /* Metro dependency 5313 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import UseTrackImpression from '../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import UsePollDurationOptions from '../usePollDurationOptions.tsx'; /* Metro dependency 11735 */
import PollAnswerInput from './PollAnswerInput.tsx'; /* Metro dependency 11746 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as AnalyticsUtilsModule from '../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as AccessibilityAnnouncerAndroidModule from '../../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/AccessibilityAnnouncer.android.tsx'; /* Metro dependency 3869 */
import * as AlertModalNativeModule from '../../../design/components/AlertModal/native/AlertModal.native.tsx'; /* Metro dependency 4500 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as UseNavigatorBackPressHandlerNativeModule from '../../../design/components/Navigator/native/useNavigatorBackPressHandler.native.tsx'; /* Metro dependency 5286 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as PollsUtilsModule from '../PollsUtils.tsx'; /* Metro dependency 7149 */
import * as PollsConstantsModule from '../PollsConstants.tsx'; /* Metro dependency 7217 */
import * as NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
import * as TextInputNativeModule from '../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */
import * as TableCheckboxRowNativeModule from '../../../design/components/TableRow/native/TableCheckboxRow.native.tsx'; /* Metro dependency 8950 */
import * as PollsIconModule from '../../../design/components/Icon/native/redesign/generated/PollsIcon.tsx'; /* Metro dependency 11098 */
import * as PollCreationModalActionCreatorsModule from './PollCreationModalActionCreators.tsx'; /* Metro dependency 11733 */
import * as UseTrackPollEventsModule from '../useTrackPollEvents.tsx'; /* Metro dependency 11742 */
function _fun89916(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6, offset: 0x02023666, size: 668 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.TouchableOpacity;
const env0_5 = value2.View;
const env0_6 = value2.ScrollView;
const pollsConstantsModule = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_7 = pollsConstantsModule.MAX_POLL_QUESTION_LENGTH;
const env0_8 = pollsConstantsModule.POLL_CREATION_DURATION_ACTION_SHEET_KEY;
const value4 = require(33) /* metro dependency 33 */;
const env0_9 = value4.jsx;
const env0_10 = value4.Fragment;
const env0_11 = value4.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
object2.viewPadding = {paddingHorizontal: 18};
object2.scrollContainer = {'paddingVertical': 20, 'gap': 16};
const createStyles = CreateStylesModule.createStyles;
object = {};
object.viewPadding = {paddingHorizontal: 18};
object.scrollContainer = {'paddingVertical': 20, 'gap': 16};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.safeAreaContainer = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object.safeAreaContainer = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
const value6 = 10;
object2.header = {'flexDirection': 'row', 'paddingHorizontal': 18, 'paddingVertical': 10};
object2.actionButton = {'flex': 0, 'justifyContent': 'flex-start', 'minWidth': 48, 'paddingHorizontal': 0,
object.header = {'flexDirection': 'row', 'paddingHorizontal': 18, 'paddingVertical': 10};
object.actionButton = {'flex': 0, 'justifyContent': 'flex-start', 'minWidth': 48, 'paddingHorizontal': 0,
'marginHorizontal': 0};
object2.postButton = {justifyContent: 'flex-end'};
object2.title = {'textAlign': 'center', 'flexGrow': 1};
object2.label = {fontSize: 14};
object2.answerInputsContainer = {'marginVertical': 20, 'rowGap': 16};
const object3 = {'paddingVertical': null, 'paddingLeft': 14, 'marginRight': 30, 'display': 'flex',
object.postButton = {justifyContent: 'flex-end'};
object.title = {'textAlign': 'center', 'flexGrow': 1};
object.label = {fontSize: 14};
object.answerInputsContainer = {'marginVertical': 20, 'rowGap': 16};
const object4 = {'paddingVertical': null, 'paddingLeft': 14, 'marginRight': 30, 'display': 'flex',
'flexDirection': 'row', 'gap': 16, 'alignItems': 'center', 'justifyContent': 'flex-start'};
object3.paddingVertical = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value6 : 8;
object4.paddingVertical = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value6 : 8;
const MESSAGE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_BACKGROUND_HOVER;
object3.backgroundColor = MESSAGE_BACKGROUND_HOVER;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.addAnswerButtonDefault = object3;
object4.backgroundColor = MESSAGE_BACKGROUND_HOVER;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.addAnswerButtonDefault = object4;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.addAnswerIcon = {color: TEXT_MUTED};
object.addAnswerIcon = {color: TEXT_MUTED};
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
object2.pollConfigSection = {borderTopWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object2]);
const env0_13 = value.forwardRef(_fun89921);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreation.tsx');
object.pollConfigSection = {borderTopWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_13 = ReactModule.forwardRef(_fun89921);
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreation.tsx');
exports.default = PollCreation;
}
function UnsavedChangesAlertModal({onConfirm}) { // fn#89917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1199, offset: 0x02023902, size: 370 bytes, params: 2, frame: 29
const AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const HMrgcp = (require(1244) /* metro dependency 1244: indexNative */).t.HMrgcp;
object2.title = Reflect.apply(string, intl, [HMrgcp]);
object2.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Wxa/j8']);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const AlertActionButton = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton;
string = intl.string;
const TzJA4g = (require(1244) /* metro dependency 1244: indexNative */).t.TzJA4g;
object2.actions = <><AlertActionButton text={Reflect.apply(string, intl,
[TzJA4g])} onPress={onConfirm} key="confirm" /><AlertActionButton variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2BR5R2'])} key="back" /></>;
return <AlertModal {...object2} />;
}
function AddAnswerButton({onPress}) { // fn#89918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2194, offset: 0x02023a74, size: 319 bytes, params: 2, frame: 22
const styles = useStyles();
const addAnswerButtonDefault = styles.addAnswerButtonDefault;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
let object2 = {};
object2.source = importDefault(10376) /* metro dependency 10376 */;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const LARGE = Sizes.LARGE;
object2.size = LARGE;
object2.color = styles.addAnswerIcon.color;
const icon = <Icon {...object2} />;
object2 = {onPress: onPress, style: addAnswerButtonDefault, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
object2.accessibilityLabel = Reflect.apply(string, intl, [B2Uvme]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
return (
<TouchableOpacity {...object2}>
{icon}
<Text variant="text-md/medium" color="text-muted">
{Reflect.apply(string, intl, [B2Uvme])}
</Text>
</TouchableOpacity>
);
}
function PollDurationSelectionRow({selectedDuration, onChange}) { // fn#89919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2604, offset: 0x02023bb3, size: 342 bytes, params: 2, frame: 24
const property = (importDefault(11735) /* metro dependency 11735: usePollDurationOptions */)()[selectedDuration];
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object2.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb]);
object2.accessibilityLabel = '' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb) + ' ' + property;
string = intl.string;
const A4PJ1o = (require(1244) /* metro dependency 1244: indexNative */).t.A4PJ1o;
object2.accessibilityHint = Reflect.apply(string, intl, [A4PJ1o]);
object2.onPress = function() {
require(dependencyMap[18]).dismissKeyboard();
importDefault(dependencyMap[14]).openLazy(require(dependencyMap[16])(dependencyMap[15], dependencyMap.paths),
POLL_CREATION_DURATION_ACTION_SHEET_KEY, {selectedDuration: selectedDuration, onChange: onChange});
};
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
object2.trailing = <Text variant="text-md/normal" color="text-muted">{property}</Text>;
object2.arrow = true;
return <TableRow {...object2} />;
}
function _fun89921({onChange, onSubmitEditing, error}, a1) { // fn#89921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1616, offset: 0x02023d84, size: 410 bytes, params: 3, frame: 25
const r9 = error != null && error.length > 0;
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
const object2 = {ref: a1, textAlignVertical: 'center'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.label = Reflect.apply(string, intl, [WBiKnI]);
string = intl.string;
WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.accessibilityLabel = Reflect.apply(string, intl, [WBiKnI]);
object2.accessibilityHint = r9 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
object2.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/uQqJW']);
object2.onChange = onChange;
object2.isClearable = true;
object2.status = r9 ? 'error' : 'default';
object2.errorMessage = error;
object2.maxLength = MAX_POLL_QUESTION_LENGTH;
object2.returnKeyType = 'next';
object2.blurOnSubmit = false;
object2.onSubmitEditing = onSubmitEditing;
object2.textContentType = 'none';
object2.autoFocus = true;
object2.autoCorrect = true;
return <TextInput {...object2} />;
}
function PollCreation({channel, onCancel}) { // fn#89922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3104, offset: 0x02023f1e, size: 1620 bytes, params: 2, frame: 44
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
const object2 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object2.type = VIEW;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const POLL_EDITOR_VIEWED = ImpressionNames.POLL_EDITOR_VIEWED;
object2.name = POLL_EDITOR_VIEWED;
defaultImport(object2);
const binding = env0_3;
binding.useEffect(function() {
return _fun89924;
}, [onCancel]);
const styles = useStyles();
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
const env0_2 = binding.useRef(false);
const value5 = (importDefault(11737) /* metro dependency 11737: useCreatePollFormData */)(channel,
binding.useCallback(_fun89925, []), binding.useCallback(function({indexToRemove}) {
var AccessibilityAnnouncer = require(dependencyMap[25]).AccessibilityAnnouncer;
var intl = require(dependencyMap[8]).intl;
var BByGU4 = require(dependencyMap[8]).t.BByGU4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(BByGU4, {number: indexToRemove + 1}));
}, []));
const answers = value5.answers;
const env0_4 = value5.question;
const allowMultiSelect = value5.allowMultiSelect;
const env0_6 = value5.setAllowMultiSelect;
const canAddMoreAnswers = value5.canAddMoreAnswers;
const env0_7 = value5.canRemoveMoreAnswers;
const handleQuestionChange = value5.handleQuestionChange;
const env0_8 = value5.handleAnswerTextChange;
const env0_9 = value5.handleEmojiSelect;
const handleAddAnswer = value5.handleAddAnswer;
const env0_11 = value5.handleRemoveAnswer;
const env0_12 = value5.handleRemoveAnswerImage;
const handleSubmitPoll = value5.handleSubmitPoll;
const fieldErrors = value5.fieldErrors;
const env0_13 = fieldErrors;
const duration = value5.duration;
const setDuration = value5.setDuration;
const createPollError = value5.createPollError;
const submitting = value5.submitting;
const shouldFocusOnInvalidField = value5.shouldFocusOnInvalidField;
const setShouldFocusOnInvalidField = value5.setShouldFocusOnInvalidField;
const useTrackPollEventsModule = require(11742) /* metro dependency 11742: useTrackPollEvents */;
const useTrackPollCreationEvents = useTrackPollEventsModule.useTrackPollCreationEvents;
const env0_16 = Reflect.apply(useTrackPollCreationEvents, useTrackPollEventsModule, [answers,
allowMultiSelect]).trackPollCreationCancelled;
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(_fun89928);
const value6 = (importDefault(11743) /* metro dependency 11743: useFocusHelper */)({onAddAnswer: function() {
handleAddAnswer();
}});
binding.useEffect(_fun89930, [fieldErrors, value6, setShouldFocusOnInvalidField, shouldFocusOnInvalidField]);
const items3 = [styles.safeAreaContainer];
items3[1] = {paddingTop: insets.top, paddingBottom: insets.bottom};
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [<HeaderActionButton accessibilityLabel={Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']])} onPress={onPress_89931} source={importDefault(5313) /* metro dependency 5313 */} style={styles.actionButton} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Flr51u = (require(1244) /* metro dependency 1244: indexNative */).t.Flr51u;
items2[1] = <Text accessibilityRole="header" variant="redesign/heading-18/bold" color="mobile-text-heading-primary" style={styles.title}>{Reflect.apply(string,
intl, [Flr51u])}</Text>;
string = intl.string;
const JOj8Zk = (require(1244) /* metro dependency 1244: indexNative */).t.JOj8Zk;
items2[2] = <HeaderActionButton text={Reflect.apply(string, intl, [JOj8Zk])} style={[styles.actionButton,
styles.postButton]} disabled={submitting} onPress={handleSubmitPoll} />;
const items4 = [<View style={styles.header}>{items2}</View>];
const items5 = [createPollError != null && ((Component) => <Component>{createPollError?.getAnyErrorMessage()}</Component>)(importDefault(11744) /* metro dependency 11744: ErrorBlock */)];
items5[1] = ((Component) => <Component ref={value6.refWithKey('question')} onChange={handleQuestionChange} onSubmitEditing={value6.focusNext} error={fieldErrors?.question} />)(env0_13);
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
const items6 = [<FormLabel text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oMBfeS)} color="text-subtle" style={styles.label} />];
items6[1] = answers.map(_fun89932);
items6[2] = canAddMoreAnswers && <AddAnswerButton onPress={handleAddAnswer} />;
items5[2] = <View style={styles.answerInputsContainer}>{items6}</View>;
items4[1] = <ScrollView style={styles.viewPadding} contentContainerStyle={styles.scrollContainer} keyboardShouldPersistTaps="handled">{items5}</ScrollView>;
const pollDurationSelectionRow = <PollDurationSelectionRow selectedDuration={duration} onChange={setDuration} />;
const TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
items4[2] = <View style={styles.pollConfigSection}>{pollDurationSelectionRow}<TableCheckboxRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Ux+iQU'])} checked={allowMultiSelect} onPress={function() {
return setAllowMultiSelect(!allowMultiSelect);
}} /></View>;
return (
<View style={items3}>
function UnsavedChangesAlertModal({onConfirm}) { // fn#89917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1199, offset: 0x02023902, size: 370 bytes, params: 2, frame: 29
const AlertModal = (AlertModalNativeModule).AlertModal;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const HMrgcp = (require(1244) /* metro dependency 1244: indexNative */).t.HMrgcp;
object.title = Reflect.apply(string, intl, [HMrgcp]);
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Wxa/j8']);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const AlertActionButton = (AlertModalNativeModule).AlertActionButton;
string = intl.string;
const TzJA4g = (require(1244) /* metro dependency 1244: indexNative */).t.TzJA4g;
object.actions = (
<>
{items4}
<AlertActionButton
text={Reflect.apply(string, intl, [TzJA4g])}
onPress={onConfirm}
key="confirm"
/>
<AlertActionButton
variant="secondary"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2BR5R2'])}
key="back"
/>
</>
</View>
);
}
function _fun89923() { // fn#89923, offset: 0x02024572, size: 11 bytes, params: 1, frame: 1
return _fun89924;
}
function _fun89925() { // fn#89925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3387, offset: 0x020245a7, size: 166 bytes, params: 1, frame: 17
env0_2.current = true;
let value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object2 = {key: 'POLL_CREATED_SUCCESS'};
const PollsIcon = (require(11098) /* metro dependency 11098: PollsIcon */).PollsIcon;
object2.IconComponent = PollsIcon;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const OPsckI = (require(1244) /* metro dependency 1244: indexNative */).t.OPsckI;
object2.content = Reflect.apply(string, intl, [OPsckI]);
Reflect.apply(open, value, [object2]);
}
function handleCancelClose() { // fn#89927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4249, owner: PollCreation.handleCancelClose, offset: 0x020246c2, size: 124 bytes, params: 1, frame: 16
trackPollCreationCancelled();
const value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
const AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
const announce = AccessibilityAnnouncer.announce;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
}
function _fun89928() { // fn#89928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4413, offset: 0x0202473e, size: 214 bytes, params: 1, frame: 18
var r0;
var moduleValue2;
var openAlert;
var AccessibilityAnnouncer;
var announce;
var intl;
let value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
trackPollCreationCancelled();
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
announce = AccessibilityAnnouncer.announce;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
r0 = false;
} else {
moduleValue2 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue2.openAlert;
value = <UnsavedChangesAlertModal onConfirm={handleCancelClose} />;
Reflect.apply(openAlert, moduleValue2, ['poll-creation-unsaved-changes', value]);
value = true;
r0 = value;
);
return <AlertModal {...object} />;
}
return r0;
}
function _fun89930() { // fn#89930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4720, offset: 0x02024814, size: 186 bytes, params: 1, frame: 20
var value3;
var intl;
const Object = global.Object;
const value2 = Object.keys(fieldErrors);
if (value2.length > 0) {
value3 = environment.__proto__;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.w8e4qF,
{numOfErrors: value2.length}));
if (shouldFocusOnInvalidField) {
env0_18.focus(value2[0]);
setShouldFocusOnInvalidField(false);
function AddAnswerButton({onPress}) { // fn#89918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2194, offset: 0x02023a74, size: 319 bytes, params: 2, frame: 22
const styles = useStyles();
const addAnswerButtonDefault = styles.addAnswerButtonDefault;
const Icon = (NativeModule).Icon;
let object = {};
object.source = importDefault(10376) /* metro dependency 10376 */;
const Icon2 = (NativeModule).Icon;
const Sizes = Icon2.Sizes;
const LARGE = Sizes.LARGE;
object.size = LARGE;
object.color = styles.addAnswerIcon.color;
const icon = <Icon {...object} />;
object = {onPress: onPress, style: addAnswerButtonDefault, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
object.accessibilityLabel = Reflect.apply(string, intl, [B2Uvme]);
const Text = (TextModule).Text;
string = intl.string;
B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
return (
<TouchableOpacity {...object}>
{icon}
<Text variant="text-md/medium" color="text-muted">
{Reflect.apply(string, intl, [B2Uvme])}
</Text>
</TouchableOpacity>
);
}
function PollDurationSelectionRow({selectedDuration, onChange}) { // fn#89919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2604, offset: 0x02023bb3, size: 342 bytes, params: 2, frame: 24
const property = (UsePollDurationOptions)()[selectedDuration];
const TableRow = (TableRowNativeModule).TableRow;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb]);
object.accessibilityLabel = '' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb) + ' ' + property;
string = intl.string;
const A4PJ1o = (require(1244) /* metro dependency 1244: indexNative */).t.A4PJ1o;
object.accessibilityHint = Reflect.apply(string, intl, [A4PJ1o]);
object.onPress = function() {
require(dependencyMap[18]).dismissKeyboard();
importDefault(dependencyMap[14]).openLazy(require(dependencyMap[16])(dependencyMap[15], dependencyMap.paths),
POLL_CREATION_DURATION_ACTION_SHEET_KEY, {selectedDuration: selectedDuration, onChange: onChange});
};
const Text = (TextModule).Text;
object.trailing = (
<Text variant="text-md/normal" color="text-muted">
{property}
</Text>
);
object.arrow = true;
return <TableRow {...object} />;
}
function _fun89921({onChange, onSubmitEditing, error}, a1) { // fn#89921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1616, offset: 0x02023d84, size: 410 bytes, params: 3, frame: 25
const r9 = error != null && error.length > 0;
const TextInput = (TextInputNativeModule).TextInput;
const object = {ref: a1, textAlignVertical: 'center'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object.label = Reflect.apply(string, intl, [WBiKnI]);
string = intl.string;
WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object.accessibilityLabel = Reflect.apply(string, intl, [WBiKnI]);
object.accessibilityHint = r9 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
object.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/uQqJW']);
object.onChange = onChange;
object.isClearable = true;
object.status = r9 ? 'error' : 'default';
object.errorMessage = error;
object.maxLength = MAX_POLL_QUESTION_LENGTH;
object.returnKeyType = 'next';
object.blurOnSubmit = false;
object.onSubmitEditing = onSubmitEditing;
object.textContentType = 'none';
object.autoFocus = true;
object.autoCorrect = true;
return <TextInput {...object} />;
}
function PollCreation({channel, onCancel}) { // fn#89922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3104, offset: 0x02023f1e, size: 1620 bytes, params: 2, frame: 44
const defaultImport = UseTrackImpression;
const object = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object.type = VIEW;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const POLL_EDITOR_VIEWED = ImpressionNames.POLL_EDITOR_VIEWED;
object.name = POLL_EDITOR_VIEWED;
defaultImport(object);
const binding = env0_3;
binding.useEffect(function() {
return _fun89924;
}, [onCancel]);
const styles = useStyles();
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({includeKeyboardHeight: true}).insets;
const env0_2 = binding.useRef(false);
const value5 = (importDefault(11737) /* metro dependency 11737: useCreatePollFormData */)(channel,
binding.useCallback(_fun89925, []), binding.useCallback(function({indexToRemove}) {
var AccessibilityAnnouncer = require(dependencyMap[25]).AccessibilityAnnouncer;
var intl = require(dependencyMap[8]).intl;
var BByGU4 = require(dependencyMap[8]).t.BByGU4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(BByGU4, {number: indexToRemove + 1}));
}, []));
const answers = value5.answers;
const env0_4 = value5.question;
const allowMultiSelect = value5.allowMultiSelect;
const env0_6 = value5.setAllowMultiSelect;
const canAddMoreAnswers = value5.canAddMoreAnswers;
const env0_7 = value5.canRemoveMoreAnswers;
const handleQuestionChange = value5.handleQuestionChange;
const env0_8 = value5.handleAnswerTextChange;
const env0_9 = value5.handleEmojiSelect;
const handleAddAnswer = value5.handleAddAnswer;
const env0_11 = value5.handleRemoveAnswer;
const env0_12 = value5.handleRemoveAnswerImage;
const handleSubmitPoll = value5.handleSubmitPoll;
const fieldErrors = value5.fieldErrors;
const fieldErrors2 = fieldErrors;
const duration = value5.duration;
const setDuration = value5.setDuration;
const createPollError = value5.createPollError;
const submitting = value5.submitting;
const shouldFocusOnInvalidField = value5.shouldFocusOnInvalidField;
const setShouldFocusOnInvalidField = value5.setShouldFocusOnInvalidField;
const useTrackPollCreationEvents = UseTrackPollEventsModule.useTrackPollCreationEvents;
const env0_16 = Reflect.apply(useTrackPollCreationEvents, UseTrackPollEventsModule, [answers,
allowMultiSelect]).trackPollCreationCancelled;
(UseNavigatorBackPressHandlerNativeModule).useNavigatorBackPressHandler(_fun89928);
const value6 = (importDefault(11743) /* metro dependency 11743: useFocusHelper */)({onAddAnswer: function() {
handleAddAnswer();
}});
binding.useEffect(_fun89930, [fieldErrors, value6, setShouldFocusOnInvalidField, shouldFocusOnInvalidField]);
const items3 = [styles.safeAreaContainer];
items3[1] = {paddingTop: insets.top, paddingBottom: insets.bottom};
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [
<HeaderActionButton
accessibilityLabel={Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']])}
onPress={onPress_89931}
source={Module05313}
style={styles.actionButton}
/>,
];
const Text = (TextModule).Text;
string = intl.string;
const Flr51u = (require(1244) /* metro dependency 1244: indexNative */).t.Flr51u;
items2[1] = (
<Text
accessibilityRole="header"
variant="redesign/heading-18/bold"
color="mobile-text-heading-primary"
style={styles.title}
>
{Reflect.apply(string, intl, [Flr51u])}
</Text>
);
string = intl.string;
const JOj8Zk = (require(1244) /* metro dependency 1244: indexNative */).t.JOj8Zk;
items2[2] = (
<HeaderActionButton
text={Reflect.apply(string, intl, [JOj8Zk])}
style={[styles.actionButton, styles.postButton]}
disabled={submitting}
onPress={handleSubmitPoll}
/>
);
const items4 = [
<View style={styles.header}>
{items2}
</View>,
];
const items5 = [
createPollError != null && ((Component) => <Component>{createPollError?.getAnyErrorMessage()}</Component>)(importDefault(11744) /* metro dependency 11744: ErrorBlock */),
];
items5[1] = ((Component) => <Component ref={value6.refWithKey('question')} onChange={handleQuestionChange} onSubmitEditing={value6.focusNext} error={fieldErrors?.question} />)(fieldErrors2);
const FormLabel = (NativeModule2).FormLabel;
const items6 = [
<FormLabel
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oMBfeS)}
color="text-subtle"
style={styles.label}
/>,
];
items6[1] = answers.map(_fun89932);
items6[2] = canAddMoreAnswers && <AddAnswerButton onPress={handleAddAnswer} />;
items5[2] = (
<View style={styles.answerInputsContainer}>
{items6}
</View>
);
items4[1] = (
<ScrollView
style={styles.viewPadding}
contentContainerStyle={styles.scrollContainer}
keyboardShouldPersistTaps="handled"
>
{items5}
</ScrollView>
);
const pollDurationSelectionRow = <PollDurationSelectionRow selectedDuration={duration} onChange={setDuration} />;
const TableCheckboxRow = (TableCheckboxRowNativeModule).TableCheckboxRow;
items4[2] = (
<View style={styles.pollConfigSection}>
{pollDurationSelectionRow}
<TableCheckboxRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Ux+iQU'])}
checked={allowMultiSelect}
onPress={function() {
return setAllowMultiSelect(!allowMultiSelect);
}}
/>
</View>
);
return (
<View style={items3}>
<>
{items4}
</>
</View>
);
function _fun89923() { // fn#89923, offset: 0x02024572, size: 11 bytes, params: 1, frame: 1
return _fun89924;
function _fun89924() { // fn#89924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3263, offset: 0x0202457d, size: 42 bytes, params: 1, frame: 11
if (!(env1_2.current || onCancel == null)) {
onCancel();
}
}
}
function _fun89925() { // fn#89925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3387, offset: 0x020245a7, size: 166 bytes, params: 1, frame: 17
env0_2.current = true;
let value = environment.__proto__;
(PollCreationModalActionCreatorsModule).closeCreatePollModal();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object = {key: 'POLL_CREATED_SUCCESS'};
const PollsIcon = (PollsIconModule).PollsIcon;
object.IconComponent = PollsIcon;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const OPsckI = (IndexNativeModule).t.OPsckI;
object.content = Reflect.apply(string, intl, [OPsckI]);
Reflect.apply(open, value, [object]);
}
function handleCancelClose() { // fn#89927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4249, owner: PollCreation.handleCancelClose, offset: 0x020246c2, size: 124 bytes, params: 1, frame: 16
trackPollCreationCancelled();
const value = environment.__proto__;
(PollCreationModalActionCreatorsModule).closeCreatePollModal();
const AccessibilityAnnouncer = (AccessibilityAnnouncerAndroidModule).AccessibilityAnnouncer;
const announce = AccessibilityAnnouncer.announce;
const intl = (IndexNativeModule).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((IndexNativeModule).t['+G3oRq'])]);
}
function _fun89928() { // fn#89928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4413, offset: 0x0202473e, size: 214 bytes, params: 1, frame: 18
var r0;
var moduleValue2;
var openAlert;
var AccessibilityAnnouncer;
var announce;
var intl;
let value = environment.__proto__;
if (PollsUtilsModule.isPollCreationEmpty(question, answers)) {
trackPollCreationCancelled();
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
announce = AccessibilityAnnouncer.announce;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
r0 = false;
} else {
moduleValue2 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue2.openAlert;
value = <UnsavedChangesAlertModal onConfirm={handleCancelClose} />;
Reflect.apply(openAlert, moduleValue2, ['poll-creation-unsaved-changes', value]);
value = true;
r0 = value;
}
return r0;
}
function _fun89930() { // fn#89930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4720, offset: 0x02024814, size: 186 bytes, params: 1, frame: 20
var value3;
var intl;
const Object = global.Object;
const value2 = Object.keys(fieldErrors);
if (value2.length > 0) {
value3 = environment.__proto__;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.w8e4qF,
{numOfErrors: value2.length}));
if (shouldFocusOnInvalidField) {
env0_18.focus(value2[0]);
setShouldFocusOnInvalidField(false);
}
}
}
function PollCreationOnPress() { // fn#89931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:5162, owner: PollCreation.onPress, offset: 0x020248ce, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
if (PollsUtilsModule.isPollCreationEmpty(question, answers)) {
handleCancelClose();
} else {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('poll-creation-unsaved-changes',
<UnsavedChangesAlertModal onConfirm={handleCancelClose} />);
}
}
function _fun89932(a0, a1) { // fn#89932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6126, offset: 0x0202494c, size: 232 bytes, params: 3, frame: 22
let value = environment.__proto__;
value = undefined;
const binding = env0_18;
return (
<PollAnswerInput
inputRef={binding.refWithKey('answer-' + a0.localCreationAnswerId)}
answer={a0}
index={a1}
channelId={channel.id}
onSubmitEditing={binding.focusNext}
onAnswerTextChange={handleAnswerTextChange}
onAnswerEmojiSelect={handleEmojiSelect}
onRemoveAnswer={handleRemoveAnswer}
onRemoveAnswerImage={handleRemoveAnswerImage}
canRemoveAnswer={canRemoveMoreAnswers}
error={fieldErrors == null ? value : fieldErrors['answer-' + a0.localCreationAnswerId]}
key={a0.localCreationAnswerId}
/>
);
}
}
}
function PollCreationOnPress() { // fn#89931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:5162, owner: PollCreation.onPress, offset: 0x020248ce, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
handleCancelClose();
} else {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('poll-creation-unsaved-changes',
<UnsavedChangesAlertModal onConfirm={handleCancelClose} />);
}
}
function _fun89932(a0, a1) { // fn#89932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6126, offset: 0x0202494c, size: 232 bytes, params: 3, frame: 22
let value = environment.__proto__;
value = undefined;
const PollAnswerInput = importDefault(11746) /* metro dependency 11746: PollAnswerInput */;
const binding = env0_18;
return (
<PollAnswerInput
inputRef={binding.refWithKey('answer-' + a0.localCreationAnswerId)}
answer={a0}
index={a1}
channelId={channel.id}
onSubmitEditing={binding.focusNext}
onAnswerTextChange={handleAnswerTextChange}
onAnswerEmojiSelect={handleEmojiSelect}
onRemoveAnswer={handleRemoveAnswer}
onRemoveAnswerImage={handleRemoveAnswerImage}
canRemoveAnswer={canRemoveMoreAnswers}
error={fieldErrors == null ? value : fieldErrors['answer-' + a0.localCreationAnswerId]}
key={a0.localCreationAnswerId}
/>
);
}
function _fun89924() { // fn#89924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3263, offset: 0x0202457d, size: 42 bytes, params: 1, frame: 11
if (!(env1_2.current || onCancel == null)) {
onCancel();
}
}
global.__d(_fun89916, 11734, [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080,
11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277,
5313, 11744, 7972, 11746, 8950,
2]) /* metro module 11734, dependencies: [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080, 11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277, 5313, 11744, 7972, 11746, 8950, 2] */;
@@ -1,45 +1,59 @@
/* Metro module 11751; source: modules/polls/native/PollCreationInputError.tsx; dependencies: [31, 27, 33, 4501, 697, 3869, 1305, 4573, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun90055(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:6, offset: 0x02028d5e, size: 259 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
const TEXT_FEEDBACK_CRITICAL = (Native).colors.TEXT_FEEDBACK_CRITICAL;
const env0_6 = Reflect.apply(createStyles, value, [{container: {'flexDirection': 'row', 'alignItems': 'center',
'marginTop': -10}, icon: {'alignSelf': 'center', 'marginRight': 5, color: TEXT_FEEDBACK_CRITICAL}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreationInputError.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreationInputError.tsx');
exports.default = PollCreationInputError;
}
function PollCreationInputError({message}) { // fn#90056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:330, offset: 0x02028e61, size: 200 bytes, params: 2, frame: 20
const styles = useStyles();
ReactModule.useEffect(_fun90057, [message]);
const WarningCircle = (NativeModule).WarningCircle;
const warningCircle = (
<WarningCircle
width={16}
height={16}
style={styles.icon}
/>
);
const Text = (TextModule).Text;
return (
<View style={styles.container}>
{warningCircle}
<Text variant="text-xs/medium" color="text-feedback-critical">
{message}
</Text>
</View>
);
function _fun90057() { // fn#90057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:405, offset: 0x02028f29, size: 81 bytes, params: 1, frame: 12
var value4;
var AccessibilityAnnouncer;
if (message != null && message !== '') {
value4 = environment.__proto__;
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(message);
}
}
function PollCreationInputError({message}) { // fn#90056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:330, offset: 0x02028e61, size: 200 bytes, params: 2, frame: 20
const styles = useStyles();
env0_2.useEffect(_fun90057, [message]);
const WarningCircle = (require(1305) /* metro dependency 1305: native */).WarningCircle;
const warningCircle = <WarningCircle width={16} height={16} style={styles.icon} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.container}>
{warningCircle}
<Text variant="text-xs/medium" color="text-feedback-critical">
{message}
</Text>
</View>
);
}
function _fun90057() { // fn#90057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11937:405, offset: 0x02028f29, size: 81 bytes, params: 1, frame: 12
var value4;
var AccessibilityAnnouncer;
if (message != null && message !== '') {
value4 = environment.__proto__;
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(message);
}
}
global.__d(_fun90055, 11751, [31, 27, 33, 4501, 697, 3869, 1305, 4573,
2]) /* metro module 11751, dependencies: [31, 27, 33, 4501, 697, 3869, 1305, 4573, 2] */;
@@ -1,22 +1,26 @@
/* Metro module 11733; source: modules/polls/native/PollCreationModalActionCreators.tsx; dependencies: [5080, 11734, 1962, 2] */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun89913(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:6, offset: 0x02023575, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreationModalActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollCreationModalActionCreators.tsx');
exports.openCreatePollModal = openCreatePollModal;
exports.closeCreatePollModal = closeCreatePollModal;
function openCreatePollModal(a0) { // fn#89914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:230, offset: 0x020235e9, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'create-poll-modal']);
}
function closeCreatePollModal() { // fn#89915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:302, offset: 0x0202363b, size: 43 bytes, params: 1, frame: 12
(ModalActionCreators).popWithKey('create-poll-modal');
}
}
function openCreatePollModal(a0) { // fn#89914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:230, offset: 0x020235e9, size: 82 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'create-poll-modal']);
}
function closeCreatePollModal() { // fn#89915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11919:302, offset: 0x0202363b, size: 43 bytes, params: 1, frame: 12
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('create-poll-modal');
}
global.__d(_fun89913, 11733, [5080, 11734, 1962, 2]) /* metro module 11733, dependencies: [5080, 11734, 1962, 2] */;
@@ -1,92 +1,101 @@
/* Metro module 11736; source: modules/polls/native/PollDurationActionSheet.tsx; dependencies: [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805, 2] */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import UsePollDurationOptions from '../usePollDurationOptions.tsx'; /* Metro dependency 11735 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as AccessibilityAnnouncerAndroidModule from '../../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/AccessibilityAnnouncer.android.tsx'; /* Metro dependency 3869 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as TableRadioRowNativeModule from '../../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */
import * as TableRadioGroupNativeModule from '../../../design/components/TableRow/native/TableRadioGroup.native.tsx'; /* Metro dependency 7988 */
function _fun89936(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:6, offset: 0x02024c9b, size: 153 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollDurationActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/PollDurationActionSheet.tsx');
exports.default = PollDurationActionSheet;
}
function PollDurationRadioGroup({selectedDuration, onChange}) { // fn#89937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:120, offset: 0x02024d34, size: 234 bytes, params: 2, frame: 22
var object2;
const value2 = (importDefault(11735) /* metro dependency 11735: usePollDurationOptions */)();
const value3 = env0_3.useCallback(_fun89938, [value2, onChange]);
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0ZStp9']);
object2.hasIcons = false;
object2.onChange = value3;
object2.defaultValue = selectedDuration;
const Object = global.Object;
return (
<TableRadioGroup {...object2}>
{Object.entries(value2).map(_fun89939)}
</TableRadioGroup>
);
}
function PollDurationActionSheet({selectedDuration, onChange}) { // fn#89940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:619, offset: 0x02024efb, size: 90 bytes, params: 2, frame: 18
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
return (
<ActionSheet>
<PollDurationRadioGroup selectedDuration={selectedDuration} onChange={onChange} />
</ActionSheet>
);
}
function _fun89938(a0) { // fn#89938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:218, offset: 0x02024e1e, size: 93 bytes, params: 2, frame: 15
onChange(a0);
const AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(env0_1[a0]);
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
function _fun89939(a0) { // fn#89939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:459, offset: 0x02024e7b, size: 128 bytes, params: 2, frame: 18
var r0;
var r1;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r5 = value;
} else {
r0 = item3;
r1 = value3;
r5 = item;
function PollDurationRadioGroup({selectedDuration, onChange}) { // fn#89937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:120, offset: 0x02024d34, size: 234 bytes, params: 2, frame: 22
const value2 = (UsePollDurationOptions)();
const value3 = ReactModule.useCallback(_fun89938, [value2, onChange]);
const TableRadioGroup = (TableRadioGroupNativeModule).TableRadioGroup;
object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0ZStp9']);
object.hasIcons = false;
object.onChange = value3;
object.defaultValue = selectedDuration;
const Object = global.Object;
return (
<TableRadioGroup {...object}>
{Object.entries(value2).map(_fun89939)}
</TableRadioGroup>
);
function _fun89938(a0) { // fn#89938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:218, offset: 0x02024e1e, size: 93 bytes, params: 2, frame: 15
onChange(a0);
const AccessibilityAnnouncer = (AccessibilityAnnouncerAndroidModule).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(env0_1[a0]);
(ActionSheetActionCreators).hideActionSheet();
}
function _fun89939(a0) { // fn#89939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:459, offset: 0x02024e7b, size: 128 bytes, params: 2, frame: 18
var r0;
var r1;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r5 = value;
} else {
r0 = item3;
r1 = value3;
r5 = item;
}
}
if (!r1) {
r0.return();
}
const TableRadioRow = (TableRadioRowNativeModule).TableRadioRow;
return (
<TableRadioRow
value={global.parseInt(r3)}
label={r5}
key={r3}
/>
);
}
}
if (!r1) {
r0.return();
function PollDurationActionSheet({selectedDuration, onChange}) { // fn#89940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11922:619, offset: 0x02024efb, size: 90 bytes, params: 2, frame: 18
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
return (
<ActionSheet>
<PollDurationRadioGroup selectedDuration={selectedDuration} onChange={onChange} />
</ActionSheet>
);
}
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
return (
<TableRadioRow
value={global.parseInt(r3)}
label={r5}
key={r3}
/>
);
}
global.__d(_fun89936, 11736, [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805,
2]) /* metro module 11736, dependencies: [31, 33, 11735, 3869, 4080, 7988, 1244, 7987, 6805, 2] */;
File diff suppressed because it is too large. Load diff
+167 -161
View File
@@ -1,179 +1,185 @@
/* Metro module 11743; source: modules/polls/native/useFocusHelper.tsx; dependencies: [7, 6, 31, 44, 6518, 2] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import UseInitialValue from '../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
function _fun90009(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:6, offset: 0x020269b2, size: 184 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = value(FocusHelperState);
const env0_5 = CreateClass(FocusHelperState);
const env0_6 = _fun90011();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/useFocusHelper.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/useFocusHelper.tsx');
exports.default = useFocusHelper;
}
function FocusHelperState() { // fn#90010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:131, offset: 0x02026a6a, size: 42 bytes, params: 1, frame: 13
ClassCallCheck(this, FocusHelperState);
this.refsByKey = {};
this.keyOrder = [];
}
function FocusHelperState() { // fn#90010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:131, offset: 0x02026a6a, size: 42 bytes, params: 1, frame: 13
env0_3(this, FocusHelperState);
this.refsByKey = {};
this.keyOrder = [];
}
function _fun90011() { // fn#90011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:224, offset: 0x02026a94, size: 113 bytes, params: 1, frame: 15
return env0_2(FocusHelperImpl, [{key: 'restartState', value: value_90015}, {key: 'commitState', value: function() {
var pendingState = this.pendingState;
if (pendingState != null) {
this.validState = pendingState;
}
this.pendingState = undefined;
}}, {key: 'refWithKey', value: value_90017}]);
function FocusHelperImpl() { // fn#90012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:245, offset: 0x02026b05, size: 89 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
env1_3(this, FocusHelperImpl);
this.validState = new env1_5();
this.focusNext = focusNext;
this.focus = focus_90014;
function focusNext() { // fn#90013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:333, owner: FocusHelperImpl.focusNext, offset: 0x02026b5e, size: 249 bytes, params: 1, frame: 25
var r11;
var r5;
var r6;
var r3;
var r4;
var propertyName;
var propertyName2;
var property;
var current;
var isFocused2;
var value3;
var onAddAnswer;
var value;
const {refsByKey, keyOrder} = env0_0.validState;
const value2 = undefined;
const properties = Object.keys(refsByKey);
const properties2 = 0;
const properties3 = properties.length;
if (properties === value2) {
r6 = value2;
} else {
r11 = properties2;
while (true) {
propertyName = properties[r11];
propertyName2 = r11 + 1;
if (propertyName === value2) {
r6 = value2;
break;
}
property = refsByKey[propertyName];
if (property == null) {
r5 = value2;
continue;
}
current = property.current;
if (current == null) {
r5 = value2;
continue;
}
isFocused2 = current.isFocused();
r5 = isFocused2;
if (r5 !== true) {
r11 = propertyName2;
continue;
}
r6 = propertyName;
break;
}
}
if (r6 != null) {
value3 = keyOrder.indexOf(r6);
if (value3 === -1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else if (value3 >= keyOrder.length - 1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else {
property = refsByKey[env0_0.validState.keyOrder[value3 + 1]];
value = property == null;
if (value) {
r3 = value;
r4 = property;
} else {
current = property.current;
r3 = current == null;
r4 = current;
}
if (!r3) {
r4.focus();
}
}
}
return value2;
}
function FocusHelperImplFocus(a0) { // fn#90014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:684, owner: FocusHelperImpl.focus, offset: 0x02026c57, size: 67 bytes, params: 2, frame: 12
var r0;
var r1;
var current;
const property = env0_0.validState.refsByKey[a0];
const value = property == null;
if (value) {
r0 = value;
r1 = property;
} else {
current = property.current;
r0 = current == null;
r1 = current;
}
if (!r0) {
r1.focus();
}
}
function _fun90011() { // fn#90011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:224, offset: 0x02026a94, size: 113 bytes, params: 1, frame: 15
return env0_2(FocusHelperImpl, [{key: 'restartState', value: value_90015}, {key: 'commitState', value: function() {
var pendingState = this.pendingState;
if (pendingState != null) {
this.validState = pendingState;
}
this.pendingState = undefined;
}}, {key: 'refWithKey', value: value_90017}]);
}
function useFocusHelper() { // fn#90018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1263, offset: 0x02026d52, size: 101 bytes, params: 1, frame: 14
const value = a0;
const env0_0 = (value !== undefined ? value : {}).onAddAnswer;
const value2 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun90019);
value2.restartState();
env0_4.useEffect(_fun90020);
return value2;
}
function FocusHelperImpl() { // fn#90012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:245, offset: 0x02026b05, size: 89 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
env1_3(this, FocusHelperImpl);
this.validState = new env1_5();
this.focusNext = focusNext;
this.focus = focus_90014;
}
function value_90015() { // fn#90015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:795, offset: 0x02026c9a, size: 40 bytes, params: 1, frame: 9
const value = environment.__proto__;
this.pendingState = new env1_5();
}
function value_90017(a0) { // fn#90017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:972, offset: 0x02026ce1, size: 113 bytes, params: 2, frame: 17
const pendingState = this.pendingState;
let value = environment.__proto__;
(importDefault(44) /* metro dependency 44 */)(pendingState != null, 'Called refWithKey without a valid state');
pendingState.keyOrder.push(a0);
const property = pendingState.refsByKey[a0];
if (property != null) {
return property;
}
value = env1_4.createRef();
pendingState.refsByKey[a0] = value;
return value;
}
function _fun90019() { // fn#90019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1322, offset: 0x02026db7, size: 29 bytes, params: 1, frame: 9
let value = environment.__proto__;
const binding = env1_6;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding();
return binding2 instanceof Object ? binding2 : value;
}
function _fun90020() { // fn#90020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1371, offset: 0x02026dd4, size: 37 bytes, params: 1, frame: 10
env0_1.onAddAnswer = onAddAnswer;
env0_1.commitState();
}
function focusNext() { // fn#90013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:333, owner: FocusHelperImpl.focusNext, offset: 0x02026b5e, size: 249 bytes, params: 1, frame: 25
var r11;
var r5;
var r6;
var r3;
var r4;
var propertyName;
var propertyName2;
var property;
var current;
var isFocused2;
var value3;
var onAddAnswer;
var value;
const {refsByKey, keyOrder} = env0_0.validState;
const value2 = undefined;
const properties = Object.keys(refsByKey);
const properties2 = 0;
const properties3 = properties.length;
if (properties === value2) {
r6 = value2;
} else {
r11 = properties2;
while (true) {
propertyName = properties[r11];
propertyName2 = r11 + 1;
if (propertyName === value2) {
r6 = value2;
break;
}
property = refsByKey[propertyName];
if (property == null) {
r5 = value2;
continue;
}
current = property.current;
if (current == null) {
r5 = value2;
continue;
}
isFocused2 = current.isFocused();
r5 = isFocused2;
if (r5 !== true) {
r11 = propertyName2;
continue;
}
r6 = propertyName;
break;
function value_90015() { // fn#90015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:795, offset: 0x02026c9a, size: 40 bytes, params: 1, frame: 9
const value = environment.__proto__;
this.pendingState = new env1_5();
}
}
if (r6 != null) {
value3 = keyOrder.indexOf(r6);
if (value3 === -1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else if (value3 >= keyOrder.length - 1) {
onAddAnswer = env0_0.onAddAnswer;
if (onAddAnswer != null) {
onAddAnswer.call(env0_0);
}
} else {
property = refsByKey[env0_0.validState.keyOrder[value3 + 1]];
value = property == null;
if (value) {
r3 = value;
r4 = property;
} else {
current = property.current;
r3 = current == null;
r4 = current;
}
if (!r3) {
r4.focus();
function value_90017(a0) { // fn#90017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:972, offset: 0x02026ce1, size: 113 bytes, params: 2, frame: 17
const pendingState = this.pendingState;
let value = environment.__proto__;
(Module00044)(pendingState != null, 'Called refWithKey without a valid state');
pendingState.keyOrder.push(a0);
const property = pendingState.refsByKey[a0];
if (property != null) {
return property;
}
value = env1_4.createRef();
pendingState.refsByKey[a0] = value;
return value;
}
}
return value2;
}
function FocusHelperImplFocus(a0) { // fn#90014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:684, owner: FocusHelperImpl.focus, offset: 0x02026c57, size: 67 bytes, params: 2, frame: 12
var r0;
var r1;
var current;
const property = env0_0.validState.refsByKey[a0];
const value = property == null;
if (value) {
r0 = value;
r1 = property;
} else {
current = property.current;
r0 = current == null;
r1 = current;
}
if (!r0) {
r1.focus();
function useFocusHelper() { // fn#90018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1263, offset: 0x02026d52, size: 101 bytes, params: 1, frame: 14
const value = a0;
const env0_0 = (value !== undefined ? value : {}).onAddAnswer;
const value2 = (UseInitialValue)(_fun90019);
value2.restartState();
ReactModule.useEffect(_fun90020);
return value2;
function _fun90019() { // fn#90019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1322, offset: 0x02026db7, size: 29 bytes, params: 1, frame: 9
let value = environment.__proto__;
const binding = env1_6;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding();
return binding2 instanceof Object ? binding2 : value;
}
function _fun90020() { // fn#90020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11929:1371, offset: 0x02026dd4, size: 37 bytes, params: 1, frame: 10
env0_1.onAddAnswer = onAddAnswer;
env0_1.commitState();
}
}
}
global.__d(_fun90009, 11743, [7, 6, 31, 44, 6518,
2]) /* metro module 11743, dependencies: [7, 6, 31, 44, 6518, 2] */;
@@ -1,91 +1,98 @@
/* Metro module 11747; source: modules/polls/native/useRenderPollAnswerImage.tsx; dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as PollTypesModule from '../PollTypes.tsx'; /* Metro dependency 11741 */
function _fun90039(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:6, offset: 0x02027ce6, size: 240 bytes, params: 8, frame: 19
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 */).ActivityIndicator;
const env0_6 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const env0_8 = (require(1881) /* metro dependency 1881: EmojiConstants */).EMOJI_URL_BASE_SIZE;
const env0_9 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/useRenderPollAnswerImage.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/polls/native/useRenderPollAnswerImage.tsx');
exports.default = useRenderPollAnswerImage;
}
function useRenderPollAnswerImage(a0, a1, a2, a3, a4) { // fn#90040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:312, offset: 0x02027dd6, size: 279 bytes, params: 6, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
const value2 = undefined;
const upload = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore],
_fun90041);
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(), 2);
const status = a2 == null || a2.mediaAttachmentState == null ? value2 : a2.mediaAttachmentState.status;
const PollMediaUploadAttachmentStatus = (require(11741) /* metro dependency 11741: PollTypes */).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
const value5 = status === PREPARING;
binding = env0_4;
const useMemo = binding.useMemo;
return {renderImage: Reflect.apply(useMemo, binding, [_fun90042, [a2, a4, a3, upload, value5, property]]),
upload: upload, setUploadSize: property2};
}
function _fun90041() { // fn#90041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:397, offset: 0x02027eed, size: 43 bytes, params: 1, frame: 15
const getUpload = UploadAttachmentStore.getUpload;
const binding = env0_0;
const Poll = DraftType.Poll;
return Reflect.apply(getUpload, UploadAttachmentStore, [binding, require, Poll]);
}
function _fun90042() { // fn#90042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:609, offset: 0x02027f18, size: 400 bytes, params: 1, frame: 22
var r7;
var r6;
var value3;
var Emoji;
var object2;
var binding;
var item;
var value;
if (result) {
value = environment.__proto__;
return <ActivityIndicator />;
}
if (upload != null) {
item = upload.item;
r6 = importAll ?? env0_6;
value = environment.__proto__;
value = importDefault(5475) /* metro dependency 5475: FastImage */;
return ((Component) => <Component style={{width: r6, height: r6}} source={{uri: item.uri}} />)(value);
}
const value2 = undefined;
let emoji = importDefault == null ? value2 : importDefault.emoji;
if (emoji != null) {
emoji = importDefault.emoji;
value3 = environment.__proto__;
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
object2 = {};
function useRenderPollAnswerImage(a0, a1, a2, a3, a4) { // fn#90040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:312, offset: 0x02027dd6, size: 279 bytes, params: 6, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
const value2 = undefined;
const upload = (FluxModule).useStateFromStores([UploadAttachmentStore],
_fun90041);
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(), 2);
const status = a2 == null || a2.mediaAttachmentState == null ? value2 : a2.mediaAttachmentState.status;
const PollMediaUploadAttachmentStatus = (PollTypesModule).PollMediaUploadAttachmentStatus;
const PREPARING = PollMediaUploadAttachmentStatus.PREPARING;
const value5 = status === PREPARING;
binding = env0_4;
object2.fastImageStyle = {width: binding, height: binding};
object2.textEmojiStyle = {fontSize: binding};
r7 = emoji.type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
value = '';
r6 = r7 ?? value;
object2.name = r6;
if (emoji.id != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emoji.id, animated: emoji.animated, size: EMOJI_URL_BASE_SIZE});
r6 = value;
} else {
r6 = value2;
const useMemo = binding.useMemo;
return {renderImage: Reflect.apply(useMemo, binding, [_fun90042, [a2, a4, a3, upload, value5, property]]),
upload: upload, setUploadSize: property2};
function _fun90041() { // fn#90041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:397, offset: 0x02027eed, size: 43 bytes, params: 1, frame: 15
const uploadAttachmentStoreBinding = UploadAttachmentStore;
const getUpload = uploadAttachmentStoreBinding.getUpload;
const binding = env0_0;
const Poll = DraftType.Poll;
return Reflect.apply(getUpload, uploadAttachmentStoreBinding, [binding, require, Poll]);
}
object2.src = r6;
return <Emoji {...object2} />;
function _fun90042() { // fn#90042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11933:609, offset: 0x02027f18, size: 400 bytes, params: 1, frame: 22
var r7;
var r6;
var value3;
var Emoji;
var object;
var binding;
var item;
var value;
if (result) {
value = environment.__proto__;
return <ActivityIndicator />;
}
if (upload != null) {
item = upload.item;
r6 = importAll ?? DraftStoreModule.DraftType;
value = environment.__proto__;
value = importDefault(5475) /* metro dependency 5475: FastImage */;
return ((Component) => <Component style={{width: r6, height: r6}} source={{uri: item.uri}} />)(value);
}
const value2 = undefined;
let emoji = importDefault == null ? value2 : importDefault.emoji;
if (emoji != null) {
emoji = importDefault.emoji;
value3 = environment.__proto__;
Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
object = {};
binding = env0_4;
object.fastImageStyle = {width: binding, height: binding};
object.textEmojiStyle = {fontSize: binding};
r7 = emoji.type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.UNICODE ? emoji.surrogates : emoji.name;
value = '';
r6 = r7 ?? value;
object.name = r6;
if (emoji.id != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emoji.id, animated: emoji.animated, size: EMOJI_URL_BASE_SIZE});
r6 = value;
} else {
r6 = value2;
}
object.src = r6;
return <Emoji {...object} />;
}
return value2;
}
}
return value2;
}
global.__d(_fun90039, 11747, [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423,
2]) /* metro module 11747, dependencies: [57, 31, 27, 4645, 4644, 1881, 33, 566, 11741, 5475, 6739, 3800, 1423, 2] */;