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

227 lines
13 KiB
TypeScript

/* Metro module 9927; source: modules/feedback/native/FeedbackActionSheet.tsx; dependencies: [57, 31, 27, 9906, 33, 4501, 697, 4080, 6266, 22, 9909, 4594, 5080, 9928, 1962, 1585, 6275, 6758, 6806, 6277, 4573, 9910, 6231, 6238, 8950, 1244, 2] */
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
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 UseMountEffectModule from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 9906 */
function _fun77713(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:6, offset: 0x01e080c2, size: 326 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = JsxRuntimeModule;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.container = {padding: PX_16};
object.ratingsHeader = {textAlign: 'center'};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.reasonsList = {marginBottom: PX_16};
const env0_9 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/feedback/native/FeedbackActionSheet.tsx');
exports.default = FeedbackActionSheet;
function closeActionSheet_77714() { // fn#77714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:335, offset: 0x01e08208, size: 37 bytes, params: 1, frame: 11
(ActionSheetActionCreators).hideActionSheet();
}
function FeedbackActionSheet({headerLabel, showHeaderCloseButton, hideDontShowAgainCheckbox, ratingOptions, ratingTextLabels, ratingsBodyLabel, reasonsHeaderLabel, reasons, feedbackReasons, otherKey, trackOpen, trackReport, getFreeformDescription}) { // fn#77715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:482, offset: 0x01e0822d, size: 1203 bytes, params: 2, frame: 37
var r8;
var TableCheckboxRow;
var intl;
const styles = useStyles();
const binding = trackReport;
const value4 = binding.useRef(null);
const value5 = (UsePrevious)(reasons);
let useState = binding.useState;
const defaultImport = Module00022;
const value6 = Reflect.apply(useState, binding, [defaultImport.shuffle(reasons)]);
const binding2 = trackOpen;
const value7 = binding2(value6, 2);
const property = value7[0];
const env0_8 = value7[1];
binding.useEffect(_fun77716, [reasons, value5, otherKey]);
useState = binding.useState;
const value9 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property2 = value9[0];
const env0_10 = value9[1];
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, [null]), 2);
const env0_11 = value10[0];
const env0_12 = value10[1];
useState = binding.useState;
const value11 = binding2(Reflect.apply(useState, binding, [false]), 2);
const env0_13 = value11[0];
const env0_14 = value11[1];
useState = binding.useState;
const value12 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value12[0];
const env0_16 = value12[1];
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
trackOpen();
});
(UseMountEffectModule).useUnmountEffect(_fun77718);
const value13 = binding.useCallback(_fun77719, []);
const env0_17 = binding.useCallback(_fun77720, [feedbackReasons]);
const r14 = property2 !== null && property2 !== FeedbackRating.GOOD;
const bottom = (UseSafeAreaInsetsNative)().bottom;
const value17 = 232 + (hideDontShowAgainCheckbox ? 0 : 48) + bottom;
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const bottomSheetProps = {scrollable: true, ref: value4, startHeight: value17,
maxHeight: property2 == null ? value17 : undefined};
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
bottomSheetProps.header = (
<BottomSheetTitleHeader
title={headerLabel}
trailing={showHeaderCloseButton
? ((ActionSheetCloseButton) => <ActionSheetCloseButton onPress={closeActionSheet_77714} />)((require(6806) /* metro dependency 6806: ActionSheetCloseButtonNative */).ActionSheetCloseButton)
: null}
/>
);
const BottomSheetScrollView = (Module06277Module).BottomSheetScrollView;
const items3 = [styles.container];
items3[1] = {paddingBottom: styles.container.padding + bottom};
const items2 = [
ratingsBodyLabel != null
? ((Text) => <Text style={styles.ratingsHeader} variant="text-md/medium" color="text-default">{ratingsBodyLabel}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
: null,
];
items2[1] = ((Component) => <Component ratingOptions={ratingOptions} textLabels={ratingTextLabels} selectedRating={property2} onChangeRating={value13} />)(importDefault(9910) /* metro dependency 9910: RatingSelector */);
items2[2] = (
r14
? (
<View style={styles.reasonsList}>
{((TableRowGroup) => <TableRowGroup title={reasonsHeaderLabel} hasIcons={false}>{property.map(function(a0,
a1) {
var env0_0 = a0;
return (
a0.label != null
? ((TableRow) => <TableRow label={a0.label} labelLineClamp={2} onPress={_fun77722} key={a1} />)(require(dependencyMap[23]).TableRow)
: undefined
);
})}</TableRowGroup>)((require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup)}
</View>
)
: null
);
if (hideDontShowAgainCheckbox) {
r8 = null;
} else {
TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
var tableCheckboxRowProps = {'start': true, 'end': true, checked: property3};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
tableCheckboxRowProps.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5E9SB9']);
tableCheckboxRowProps.onPress = onPress_77723;
r8 = <TableCheckboxRow {...tableCheckboxRowProps} />;
}
items2[3] = r8;
return (
<BottomSheet {...bottomSheetProps}>
<BottomSheetScrollView contentContainerStyle={items3}>
{items2}
</BottomSheetScrollView>
</BottomSheet>
);
function _fun77716() { // fn#77716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:856, offset: 0x01e086e0, size: 102 bytes, params: 1, frame: 16
let value = environment.__proto__;
const defaultImport = Module00022;
const isEqual = defaultImport.isEqual;
let binding = env0_7;
if (!Reflect.apply(isEqual, defaultImport, [binding, reasons])) {
binding = env0_8;
value = require(9909) /* metro dependency 9909: FeedbackUtils */;
binding(value.shuffleProblems(reasons, otherKey));
}
}
function _fun77718() { // fn#77718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:1146, offset: 0x01e08746, size: 220 bytes, params: 1, frame: 18
var object;
var value2;
var value3;
var defaultImport;
var pushLazy;
var value4;
if (env0_13) {
value2 = environment.__proto__;
value3 = undefined;
defaultImport = importDefault(dependencyMap[12]);
pushLazy = defaultImport.pushLazy;
value4 = require(dependencyMap[14])(dependencyMap[13], dependencyMap.paths);
object = {};
object.result = {rating: env0_9, reason: env0_11, dontShowAgain: env0_15};
object.trackReport = trackReport;
object.descriptionLabel = (getFreeformDescription == null ? value3 : getFreeformDescription(env0_11)) ?? value3;
Reflect.apply(pushLazy, defaultImport, [value4, object]);
} else {
trackReport({rating: env0_9, reason: env0_11, dontShowAgain: env0_15});
}
}
function _fun77719(a0) { // fn#77719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:1381, offset: 0x01e08822, size: 93 bytes, params: 2, frame: 13
var current;
env0_10(a0);
const GOOD = FeedbackRating.GOOD;
if (a0 === GOOD) {
env0_12(null);
env0_14(false);
closeActionSheet_77714();
} else {
current = ConstantsModule.FeedbackRating.current;
if (current != null) {
current.expandActionSheet();
}
}
}
function _fun77720(a0) { // fn#77720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:1510, offset: 0x01e0887f, size: 76 bytes, params: 2, frame: 14
env0_12(a0);
if (feedbackReasons != null && feedbackReasons.includes(a0.value)) {
env0_14(true);
}
closeActionSheet_77714();
}
function _fun77721(a0, a1) { // fn#77721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:2278, offset: 0x01e088cb, size: 102 bytes, params: 3, frame: 18
const env0_0 = a0;
if (a0.label != null) {
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
return (
<TableRow
label={a0.label}
labelLineClamp={2}
onPress={onPress_77722}
key={a1}
/>
);
} else {
return undefined;
}
function onPress_77722() { // fn#77722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:2359, offset: 0x01025b87, size: 23 bytes, params: 1, frame: 11
return env1_17(env0_0);
}
}
function FeedbackActionSheetOnPress() { // fn#77723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10113:2509, owner: FeedbackActionSheet.onPress, offset: 0x01e08931, size: 23 bytes, params: 1, frame: 11
return env0_16(!env0_15);
}
}
}
global.__d(_fun77713, 9927, [57, 31, 27, 9906, 33, 4501, 697, 4080, 6266, 22, 9909, 4594, 5080, 9928, 1962, 1585,
6275, 6758, 6806, 6277, 4573, 9910, 6231, 6238, 8950, 1244,
2]) /* metro module 9927, dependencies: [57, 31, 27, 9906, 33, 4501, 697, 4080, 6266, 22, 9909, 4594, 5080, 9928, 1962, 1585, 6275, 6758, 6806, 6277, 4573, 9910, 6231, 6238, 8950, 1244, 2] */;