decord/source/modules/feedback/native/FeedbackActionSheet.tsx

201 lines
7.1 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10871
// Function ID: 10872
2026-07-20 16:05:17 +00:00
// Name: closeActionSheet
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 10850, 21, 4668, 712, 4346, 6738, 12, 10853, 4766, 5265, 10872, 2008, 1629, 6988, 6987, 7214, 6990, 4739, 10854, 6317, 6322, 8597, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 10871 (closeActionSheet)
import ThemesDefault from "Themes" /* 712 */;
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4346 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { FeedbackRating } from "FeedbackRating" /* 10850 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function closeActionSheet() {
2026-08-24 06:08:38 +00:00
ACTION_SHEET_HEIGHT_HALFDefault.hideActionSheet();
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { container: null, ratingsHeader: null, reasonsList: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { padding: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
createCacheKey[1] = { textAlign: "center" };
2026-08-24 06:08:38 +00:00
createCacheKey[2] = { marginBottom: ThemesDefault.space.PX_16 };
let closure_9 = createCacheKey.createStyles(createCacheKey);
let obj1 = { marginBottom: ThemesDefault.space.PX_16 };
const result = require("set").fileFinishedImporting("modules/feedback/native/FeedbackActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function FeedbackActionSheet(feedbackReasons) {
({ hideDontShowAgainCheckbox, ratingsBodyLabel, reasons } = feedbackReasons);
feedbackReasons = feedbackReasons.feedbackReasons;
const otherKey = feedbackReasons.otherKey;
2026-08-24 06:08:38 +00:00
({ trackOpen: closure_3, trackReport: closure_4, getFreeformDescription: View } = feedbackReasons);
2026-07-29 08:29:29 +00:00
let ref;
2026-08-24 06:08:38 +00:00
closure_7 = undefined;
2026-07-29 08:29:29 +00:00
c8 = undefined;
let first;
2026-08-24 06:08:38 +00:00
closure_10 = undefined;
2026-07-29 08:29:29 +00:00
c11 = undefined;
c12 = undefined;
c13 = undefined;
c14 = undefined;
let first1;
2026-08-24 06:08:38 +00:00
closure_16 = undefined;
closure_17 = undefined;
2026-07-20 16:05:17 +00:00
({ headerLabel, showHeaderCloseButton, ratingOptions, ratingTextLabels, reasonsHeaderLabel } = feedbackReasons);
2026-07-29 08:29:29 +00:00
let tmp = first();
ref = React.useRef(null);
const tmp5 = feedbackReasons(otherKey[8])(reasons);
2026-08-24 06:08:38 +00:00
closure_7 = tmp5;
2026-07-23 10:11:24 +00:00
let obj = feedbackReasons(otherKey[9]);
2026-07-29 08:29:29 +00:00
[arr, c8] = callback(React.useState(obj.shuffle(reasons)), 2);
const items = [reasons, tmp5, otherKey];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
if (!obj.isEqual(closure_7, reasons)) {
_undefined(reasons(otherKey[10]).shuffleProblems(reasons, otherKey));
2026-07-20 16:05:17 +00:00
const obj2 = reasons(otherKey[10]);
}
}, items);
const tmp8 = callback(React.useState(null), 2);
2026-07-29 08:29:29 +00:00
first = tmp8[0];
closure_10 = tmp8[1];
const tmp6 = callback(React.useState(obj.shuffle(reasons)), 2);
[c11, c12] = callback(React.useState(null), 2);
const tmp10 = callback(React.useState(null), 2);
[c13, c14] = callback(React.useState(false), 2);
const tmp12 = callback(React.useState(false), 2);
first1 = tmp12[0];
closure_16 = tmp12[1];
2026-07-23 10:11:24 +00:00
feedbackReasons(otherKey[11])(() => {
2026-07-20 16:05:17 +00:00
callback();
});
2026-08-24 06:08:38 +00:00
obj1 = reasons(otherKey[11]);
2026-07-20 16:05:17 +00:00
const unmountEffect = obj1.useUnmountEffect(() => {
2026-07-29 08:29:29 +00:00
if (c13) {
let obj = { result: null, trackReport: null, descriptionLabel: null };
obj = { rating: null, reason: null, dontShowAgain: null };
obj[0] = first;
obj[1] = c11;
obj[2] = first1;
obj[0] = obj;
obj[1] = callback2;
let tmp14;
2026-07-20 16:05:17 +00:00
const obj2 = feedbackReasons(otherKey[12]);
2026-07-29 08:29:29 +00:00
if (callback3 != null) {
tmp14 = callback3(c11);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp14;
2026-07-20 16:05:17 +00:00
obj2.pushLazy(reasons(otherKey[14])(otherKey[13], otherKey.paths), obj);
const tmp9 = reasons(otherKey[14])(otherKey[13], otherKey.paths);
} else {
2026-07-29 08:29:29 +00:00
obj = { rating: null, reason: null, dontShowAgain: null };
obj[0] = first;
obj[1] = c11;
obj[2] = first1;
2026-07-20 16:05:17 +00:00
callback2(obj);
}
});
const items1 = [feedbackReasons];
2026-07-23 10:11:24 +00:00
callback = React.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
callback5(arg0);
2026-07-20 16:05:17 +00:00
if (arg0 === ref.GOOD) {
2026-08-24 06:08:38 +00:00
_undefined2(null);
_undefined3(false);
2026-07-29 08:29:29 +00:00
feedbackReasons(otherKey[7]).hideActionSheet();
const obj = feedbackReasons(otherKey[7]);
2026-07-20 16:05:17 +00:00
} else {
const current = ref.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.expandActionSheet();
}
}
}, []);
2026-07-29 08:29:29 +00:00
closure_17 = React.useCallback((value) => {
2026-08-24 06:08:38 +00:00
_undefined2(value);
2026-07-29 08:29:29 +00:00
let hasItem;
if (feedbackReasons != null) {
2026-07-20 16:05:17 +00:00
hasItem = feedbackReasons.includes(value.value);
}
if (hasItem) {
2026-08-24 06:08:38 +00:00
_undefined3(true);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
feedbackReasons(otherKey[7]).hideActionSheet();
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-29 08:29:29 +00:00
let tmp18 = null !== first;
if (tmp18) {
tmp18 = first !== ref.GOOD;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const bottom = tmp3(tmp4[15])().bottom;
2026-07-20 16:05:17 +00:00
let num = 48;
if (hideDontShowAgainCheckbox) {
num = 0;
}
const sum = 232 + num + bottom;
2026-07-29 08:29:29 +00:00
obj = { scrollable: true, ref, startHeight: sum, maxHeight: null, header: null, children: null };
let tmp22;
if (null == first) {
tmp22 = sum;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp22;
obj = { title: headerLabel, trailing: null };
let tmp21Result = null;
2026-07-20 16:05:17 +00:00
if (showHeaderCloseButton) {
2026-07-29 08:29:29 +00:00
obj1 = { onPress: null };
obj1[0] = closure_10;
tmp21Result = tmp21(tmp15(tmp4[18]).ActionSheetCloseButton, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp21Result;
2026-08-24 06:08:38 +00:00
obj[4] = closure_7(reasons(otherKey[17]).BottomSheetTitleHeader, obj);
2026-07-29 08:29:29 +00:00
let obj2 = { contentContainerStyle: items2, children: null };
2026-07-23 10:11:24 +00:00
items2 = [tmp.container, { paddingBottom: tmp.container.padding + bottom }];
2026-07-29 08:29:29 +00:00
tmp21Result = null;
2026-07-20 16:05:17 +00:00
if (null != ratingsBodyLabel) {
2026-07-29 08:29:29 +00:00
const obj3 = { style: null, variant: "text-md/medium", color: "text-default", children: null };
obj3[0] = tmp.ratingsHeader;
obj3[3] = ratingsBodyLabel;
tmp21Result = tmp21(tmp15(tmp4[20]).Text, obj3);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const items3 = [tmp21Result, closure_7(feedbackReasons(otherKey[21]), { ratingOptions, textLabels: ratingTextLabels, selectedRating: first, onChangeRating: callback }), , ];
2026-07-29 08:29:29 +00:00
let tmp21Result1 = null;
if (tmp18) {
const obj4 = { style: null, children: null };
obj4[0] = tmp.reasonsList;
const obj5 = { title: null, hasIcons: false, children: null };
obj5[0] = reasonsHeaderLabel;
obj5[2] = arr.map((label) => {
2026-08-24 06:08:38 +00:00
closure_0 = label;
2026-07-29 08:29:29 +00:00
let tmp;
if (null != label.label) {
const obj = { label: null, labelLineClamp: 2, onPress: null };
obj[0] = label.label;
obj[2] = function onPress() {
2026-08-24 06:08:38 +00:00
return closure_1_17(closure_0);
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
tmp = callback4(reasons(otherKey[23]).TableRow, obj, arg1);
2026-07-29 08:29:29 +00:00
}
return tmp;
});
obj4[1] = tmp21(tmp15(tmp4[22]).TableRowGroup, obj5);
tmp21Result1 = tmp21(View, obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[2] = tmp21Result1;
let tmp21Result2 = null;
2026-07-20 16:05:17 +00:00
if (!hideDontShowAgainCheckbox) {
2026-07-29 08:29:29 +00:00
const obj6 = { start: true, end: true, checked: null, label: null, onPress: null };
obj6[2] = first1;
const intl = tmp15(tmp4[25]).intl;
obj6[3] = intl.string(tmp15(tmp4[25]).t["5E9SB9"]);
obj6[4] = function onPress() {
2026-08-24 06:08:38 +00:00
return callback6(!first1);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
tmp21Result2 = tmp21(tmp15(tmp4[24]).TableCheckboxRow, obj6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items3[3] = tmp21Result2;
obj2[1] = items3;
obj[5] = c8(reasons(otherKey[19]).BottomSheetScrollView, obj2);
2026-08-24 06:08:38 +00:00
return closure_7(reasons(otherKey[16]).BottomSheet, obj);
2026-07-20 16:05:17 +00:00
};