/* Metro module 11057; source: modules/stickers/native/StickerPackDetailActionSheet.tsx; dependencies: [57, 31, 11028, 661, 6276, 33, 4501, 1478, 1585, 22, 683, 6275, 11058, 11062, 6515, 6277, 11063, 5278, 10970, 2] */
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import StickerPackHeader from './StickerPackHeader.tsx'; /* Metro dependency 11058 */
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as ActionSheetConstantsModule from '../../action_sheet/native/ActionSheetConstants.tsx'; /* Metro dependency 6276 */
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import * as ActionSheetHeaderBarNativeModule from '../../../design/components/Sheet/native/ActionSheetHeaderBar.native.tsx'; /* Metro dependency 6515 */
import * as StickerPickerConstantsModule from './StickerPickerConstants.tsx'; /* Metro dependency 11028 */
import * as StickerPackInformationPopoutModule from './StickerPackInformationPopout.tsx'; /* Metro dependency 11062 */
function _fun84670(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:6, offset: 0x01f525e8, size: 370 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const env0_12 = (CreateStylesModule).createStyles({focusedStickerPreviewContainer: {'position': 'absolute',
'left': 0, 'top': 0, 'height': '100%', 'width': '100%', 'alignItems': 'center', 'justifyContent': 'center',
'backgroundColor': 'rgba(0, 0, 0, 0.85)'}, header: {'marginHorizontal': 16, 'marginVertical': 8,
'backgroundColor': 'transparent', height: undefined}, stickers: {'paddingHorizontal': 16, 'marginBottom': 16},
popoutContainer: {'position': 'absolute', 'bottom': 50}});
value = value.memo(StickerPackDetailActionSheet);
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/native/StickerPackDetailActionSheet.tsx');
exports.default = value;
function StickerPackDetailActionSheet({stickerPack, analyticsPopoutType, onClose}) { // fn#84671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:659, offset: 0x01f5275a, size: 882 bytes, params: 2, frame: 35
var r5;
var value;
const styles = useStyles();
const width = (UseWindowDimensionsNative)().width;
const binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [null]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
var env0_3 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value5[0];
const env0_5 = value5[1];
const env0_6 = binding.useRef(null);
const bottom = (UseSafeAreaInsetsNative)().bottom;
const Math = global.Math;
const floor = Math.floor;
const Math2 = global.Math;
const value7 = Reflect.apply(floor, Math, [Math2.min(ACTION_SHEET_MAX_WIDTH, width) / (STICKER_SIZE + MIN_MARGIN)]);
let defaultImport = Module00022;
const value8 = defaultImport.chunk(stickerPack.stickers, value7);
const env0_8 = binding.useRef(onClose);
const onClose_846732 = onClose_84673;
binding.useEffect(_fun84675, [onClose]);
binding.useEffect(function() {
return _fun84677;
}, []);
binding.useEffect(function() {
var defaultImport = importDefault(dependencyMap[10]);
var OPEN_POPOUT = AnalyticEvents.OPEN_POPOUT;
defaultImport.track(OPEN_POPOUT, {type: analyticsPopoutType, sticker_pack_id: stickerPack.id});
}, [analyticsPopoutType, stickerPack.id]);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const object2 = {'scrollable': true, 'startExpanded': true, 'handleDisabled': true};
const stickerPackHeader = (
);
const ActionSheetHeaderBar = (ActionSheetHeaderBarNativeModule).ActionSheetHeaderBar;
object2.header = (
<>
{stickerPackHeader}
>
);
const BottomSheetScrollView = (Module06277Module).BottomSheetScrollView;
const bottomSheet = (
{value8.map(_fun84679)}
);
const r7 = property != null && ((PressableOpacity) => {((Component) => )(importDefault(10970) /* metro dependency 10970: Sticker */)})((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity);
if (property2) {
value = importDefault(11062) /* metro dependency 11062: StickerPackInformationPopout */;
value = ((Component) => )(value);
r5 = value;
} else {
r5 = property2;
}
return (
<>
{bottomSheet}
{r7}
{r5}
>
);
function StickerPackDetailActionSheetOnPressSticker(a0) { // fn#84672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:988, owner: StickerPackDetailActionSheet.onPressSticker, offset: 0x01b85a95, size: 19 bytes, params: 2, frame: 11
env0_3(a0);
}
function StickerPackDetailActionSheetOnClose() { // fn#84673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:1026, owner: StickerPackDetailActionSheet.onClose, offset: 0x01f52acc, size: 104 bytes, params: 1, frame: 14
if (env0_6.current != null) {
global.clearTimeout(env0_6.current);
}
const binding = env0_4;
env0_5(!binding);
if (!binding) {
env0_6.current = global.setTimeout(_fun84674, 4000);
}
function _fun84674() { // fn#84674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:1112, offset: 0x01e1b41a, size: 18 bytes, params: 1, frame: 11
return env1_5(false);
}
}
function _fun84675() { // fn#84675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:1150, offset: 0x01f52b34, size: 21 bytes, params: 1, frame: 2
env0_8.current = onClose;
}
function _fun84676() { // fn#84676, offset: 0x01f52b49, size: 11 bytes, params: 1, frame: 1
return _fun84677;
function _fun84677() { // fn#84677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:1191, offset: 0x01f52b54, size: 38 bytes, params: 1, frame: 10
const value = environment.__proto__;
return env1_8.current?.();
}
}
function _fun84679(a0, a1) { // fn#84679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:1781, offset: 0x01f52bc5, size: 84 bytes, params: 3, frame: 17
let value = environment.__proto__;
value = importDefault(11063) /* metro dependency 11063: StickerPickerListRow */;
return ((Component) => )(value);
}
function StickerPackDetailActionSheetOnPress() { // fn#84680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11243:2002, owner: StickerPackDetailActionSheet.onPress, offset: 0x01f52c19, size: 18 bytes, params: 1, frame: 11
return env0_3(null);
}
}
}
global.__d(_fun84670, 11057, [57, 31, 11028, 661, 6276, 33, 4501, 1478, 1585, 22, 683, 6275, 11058, 11062, 6515,
6277, 11063, 5278, 10970,
2]) /* metro module 11057, dependencies: [57, 31, 11028, 661, 6276, 33, 4501, 1478, 1585, 22, 683, 6275, 11058, 11062, 6515, 6277, 11063, 5278, 10970, 2] */;