/* Metro module 11575; source: modules/app_launcher/native/AppLauncherKeyboard.tsx; dependencies: [31, 27, 661, 1376, 11576, 33, 4501, 697, 8775, 8774, 11577, 4559, 11578, 4017, 11587, 4508, 6277, 11588, 477, 4863, 1581, 1482, 1583, 4570, 11620, 8048, 11622, 2] */
function _fun88634(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:6, offset: 0x01feca61, size: 579 bytes, params: 8, frame: 24
var object5;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const env0_5 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const env0_6 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
const env0_7 = (require(11576) /* metro dependency 11576: PortalKeyboardConstants */).KEYBOARD_ANIMATION_CONFIG;
const value2 = require(33) /* metro dependency 33 */;
const env0_8 = value2.jsx;
const env0_9 = value2.Fragment;
const env0_10 = value2.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object5 = {};
const object6 = {};
object6.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object6.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object5.onboardingRoundingView = object6;
const object7 = {'borderWidth': 2, 'borderBottomWidth': 0, 'borderColor': null, 'borderBottomColor': 'transparent'};
let BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object7.borderColor = BACKGROUND_BRAND;
object7.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object7.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object5.onboardingHeader = object7;
const object8 = {borderWidth: 2};
BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object8.borderColor = BACKGROUND_BRAND;
object8.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object8.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object5.onboardingNavigatorContent = object8;
const env0_11 = Reflect.apply(createStyles, createStylesModule, [object5]);
object5 = {code: 'function AppLauncherKeyboardTsx1(){const{bottomSheetIndex}=this.__closure;return bottomSheetIndex.get();}'};
object5 = {code: 'function AppLauncherKeyboardTsx2(i,prev){const{runOnJS,handleOnboardingParamChange,showOnboarding}=this.__closure;if(i===prev)return;runOnJS(handleOnboardingParamChange)(i,showOnboarding);}'};
value = value.memo(AppLauncherKeyboard);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/native/AppLauncherKeyboard.tsx');
exports.default = value;
exports.setAppLauncherA11yFocusReturnRef = function(a0) {
env0_12 = a0;
};
}
function AppLauncherKeyboard({context, chatInputRef, onClose, transitionState, entrypoint}) { // fn#88635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:1101, offset: 0x01fecca4, size: 1139 bytes, params: 2, frame: 41
const env0_3 = transitionState;
const value2 = (require(8775) /* metro dependency 8775: useDefaultAppLauncherWidth */).useDefaultAppLauncherWidth(entrypoint);
const binding = env0_3;
let useRef = binding.useRef;
const AppLauncherKeyboardCloseReason = (require(8774) /* metro dependency 8774: AppLauncherContext */).AppLauncherKeyboardCloseReason;
const DISMISSED = AppLauncherKeyboardCloseReason.DISMISSED;
const value3 = Reflect.apply(useRef, binding, [DISMISSED]);
const value4 = binding.useRef(undefined);
const styles = useStyles();
const {maximum, minimum} = (importDefault(11577) /* metro dependency 11577: useKeyboardActionSheetHeight */)();
useRef = binding.useRef;
const Date = global.Date;
const env0_7 = Reflect.apply(useRef, binding, [Date.now()]);
const env0_8 = binding.useRef(false);
const value6 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled();
const visibleContent = (importDefault(11578) /* metro dependency 11578: useAppLauncherOnboardingContent */)({channelId: context.channel.id}).visibleContent;
const value7 = visibleContent != null;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const value9 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value10 = binding.useRef(null);
const env0_13 = value10;
const value11 = binding.useCallback(_fun88636, [value10]);
let closure = _fun88637;
const value12 = binding.useCallback(closure, []);
const env0_14 = value12;
binding.useEffect(_fun88638, [value7, value8, value12]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
closure = AppLauncherKeyboardO;
closure.__closure = {bottomSheetIndex: value8};
closure.__workletHash = 15587451723262;
closure.__initData = env0_13;
const closure2 = AppLauncherKeyboard_;
closure2.__closure = {runOnJS: reanimatedRexportModule.runOnJS, handleOnboardingParamChange: value12,
showOnboarding: value7};
closure2.__workletHash = 14003176039781;
closure2.__initData = env0_14;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
binding.useLayoutEffect(function() {
if (transitionState === require(dependencyMap[15]).TransitionStates.YEETED) {
importDefault(dependencyMap[14])(ContentDismissActionType.USER_DISMISS);
}
}, [transitionState]);
const value13 = binding.useCallback(_fun88642, [visibleContent, context, minimum, value7]);
const value14 = binding.useCallback(_fun88643, [value4]);
const value15 = binding.useCallback(_fun88644, [chatInputRef, value6, value3, onClose]);
const PortalKeyboardBottomSheet = importDefault(11620) /* metro dependency 11620: PortalKeyboardBottomSheet */;
const defaultImport2Props = {ref: value10, animationConfigs: KEYBOARD_ANIMATION_CONFIG, animatedIndex: value8,
animatedPosition: value9, chatInputRef: chatInputRef,
forceMaxHeight: value6 || (require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest(),
enablePanDownToClose: (require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest(),
onAnimate: value14, onClose: value15, transitionState: transitionState, backdropComponent: value13,
disableHeaderRoundingAnimation: value7 || entrypoint === (require(8048) /* metro dependency 8048: AppLauncherTypes */).AppLauncherEntrypoint.VOICE,
roundingViewStyle: value7 && styles.onboardingRoundingView, headerStyle: value7 && styles.onboardingHeader,
isAppsKeyboard: true};
const AppLauncherEntrypoint = (require(8048) /* metro dependency 8048: AppLauncherTypes */).AppLauncherEntrypoint;
const VOICE = AppLauncherEntrypoint.VOICE;
defaultImport2Props.rendersHandle = entrypoint !== VOICE;
defaultImport2Props.width = value2;
return (
{((Component) => )(importDefault(11622) /* metro dependency 11622: AppLauncherNavigator */)}
);
}
function _fun88636() { // fn#88636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:1603, offset: 0x01fed117, size: 51 bytes, params: 1, frame: 13
var r1;
var r2;
var current;
const value2 = env0_13 == null;
const value3 = undefined;
if (value2) {
r1 = value2;
r2 = value3;
} else {
current = env0_13.current;
r1 = current == null;
r2 = current;
}
if (!r1) {
r2.expandActionSheet();
}
return value3;
}
function _fun88637(a0, a1) { // fn#88637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:1690, offset: 0x01fed14a, size: 63 bytes, params: 3, frame: 12
let value = a1;
if (value && a0 === 1) {
value = environment.__proto__;
(importDefault(11587) /* metro dependency 11587: completeAppLauncherOnboarding */)(ContentDismissActionType.TAKE_ACTION);
}
}
function _fun88638() { // fn#88638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:1752, offset: 0x01fed189, size: 34 bytes, params: 1, frame: 13
env0_14(env0_12.get(), result);
}
function AppLauncherKeyboard_(a0, a1) { // fn#88640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:1910, owner: AppLauncherKeyboard._, offset: 0x01fed1ab, size: 66 bytes, params: 3, frame: 15
var value;
if (a0 !== a1) {
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_14);
value(a0, result);
}
}
function _fun88642(a0) { // fn#88642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:2207, offset: 0x01fed242, size: 199 bytes, params: 2, frame: 22
var r5;
var AppLauncherOnboardingLayer;
let value = environment.__proto__;
const jsxRuntimeEnv1_9Binding = jsxRuntimeEnv1_9;
const BottomSheetBackdrop = (require(6277) /* metro dependency 6277 */).BottomSheetBackdrop;
const bottomSheetBackdrop = ;
const resultBinding = result;
if (resultBinding) {
AppLauncherOnboardingLayer = importDefault(11588) /* metro dependency 11588: AppLauncherOnboardingLayer */;
var defaultImportProps = {context: context, visibleContent: visibleContent};
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
defaultImportProps.bottomOffset = value ? 0 : minimum;
value = ;
r5 = value;
} else {
r5 = resultBinding;
}
return (
<>
{bottomSheetBackdrop}
{r5}
>
);
}
function _fun88643(a0, a1, a2) { // fn#88643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:2404, offset: 0x01fed309, size: 316 bytes, params: 4, frame: 15
var r5;
var value;
const ANIMATION_SOURCE = (require(6277) /* metro dependency 6277 */).ANIMATION_SOURCE;
const AppLauncherBottomSheetExpandReason = (require(8774) /* metro dependency 8774: AppLauncherContext */).AppLauncherBottomSheetExpandReason;
var moduleValue;
if (a0 !== 1) {
if (a1 === 1) {
value = environment.__proto__;
r5 = a2 === ANIMATION_SOURCE.KEYBOARD ? AppLauncherBottomSheetExpandReason.KEYBOARD : a2 === ANIMATION_SOURCE.GESTURE ? AppLauncherBottomSheetExpandReason.GESTURE : a2 !== ANIMATION_SOURCE.USER ? AppLauncherBottomSheetExpandReason.OTHER : env0_5.current;
moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
moduleValue.trackWithMetadata(AnalyticEvents.APP_LAUNCHER_EXPANDED, {reason: r5});
env0_5.current = undefined;
}
}
}
function _fun88644() { // fn#88644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11761:2816, offset: 0x01fed445, size: 379 bytes, params: 1, frame: 18
var value2;
var moduleValue;
var trackWithMetadata;
var APP_LAUNCHER_CLOSED;
var object2;
var value3;
var setKeyboardType;
var binding;
var value;
let current = env0_8.current;
if (!current) {
value2 = environment.__proto__;
moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
trackWithMetadata = moduleValue.trackWithMetadata;
APP_LAUNCHER_CLOSED = AnalyticEvents.APP_LAUNCHER_CLOSED;
object2 = {};
value3 = global.Date.now();
current = env0_7.current;
object2.time_spent = value3 - current;
current = env0_4.current;
object2.reason = current;
Reflect.apply(trackWithMetadata, moduleValue, [APP_LAUNCHER_CLOSED, object2]);
}
env0_8.current = true;
const value5 = undefined;
const defaultImport = importDefault(11587) /* metro dependency 11587: completeAppLauncherOnboarding */;
const USER_DISMISS = ContentDismissActionType.USER_DISMISS;
defaultImport(USER_DISMISS);
if (onClose != null) {
onClose();
}
const metaQuestUtilsAndroidModule = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
if (metaQuestUtilsAndroidModule.isMetaQuest()) {
current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
if (env0_9) {
value = require(1482) /* metro dependency 1482: KeyboardUIStoreNative */;
setKeyboardType = value.setKeyboardType;
object2 = {};
object2.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM;
Reflect.apply(setKeyboardType, value, [object2]);
binding = env1_12;
if ((binding == null ? value5 : binding.current) != null) {
value = require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */;
value.setAccessibilityFocus({ref: env1_12});
}
}
return value5;
}