265 lines
13 KiB
React
265 lines
13 KiB
React
/* Metro module 4553; source: unknown; dependencies: [29, 57, 31, 27, 33, 4547, 4554, 4521, 4513, 4523] */
|
|
function _fun38730(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:6, offset: 0x010c8719, size: 271 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const env0_3 = ['onWillAppear', 'onDidAppear', 'onWillDisappear', 'onDidDisappear', 'isFocused', 'freezeContents',
|
|
'icon', 'selectedIcon', 'standardAppearance', 'scrollEdgeAppearance', 'scrollEdgeEffects',
|
|
'experimental_userInterfaceStyle', 'style'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(29) /* metro dependency 29 */;
|
|
const env0_5 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_6 = importDefault(31) /* metro dependency 31 */;
|
|
const value = require(27) /* metro dependency 27 */;
|
|
const env0_7 = value.Image;
|
|
value.Platform;
|
|
const StyleSheet = value.StyleSheet;
|
|
const env0_8 = value.findNodeHandle;
|
|
const env0_9 = value.processColor;
|
|
const env0_10 = (require(33) /* metro dependency 33 */).jsx;
|
|
const env0_11 = StyleSheet.create({fillParent: {'position': 'absolute', 'flex': 1, 'width': '100%',
|
|
'height': '100%'}});
|
|
exports.default = TabsScreen;
|
|
}
|
|
|
|
function mapAppearanceToNativeProp(a0) { // fn#38731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:453, offset: 0x010c8828, size: 133 bytes, params: 2, frame: 22
|
|
var stacked;
|
|
var inline;
|
|
var compactInline;
|
|
var tabBarBackgroundColor;
|
|
var tabBarShadowColor;
|
|
var Object;
|
|
var assign;
|
|
var object2;
|
|
var mapItemAppearanceToNativePropBinding;
|
|
if (a0) {
|
|
stacked = a0.stacked;
|
|
inline = a0.inline;
|
|
compactInline = a0.compactInline;
|
|
tabBarBackgroundColor = a0.tabBarBackgroundColor;
|
|
tabBarShadowColor = a0.tabBarShadowColor;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
mapItemAppearanceToNativePropBinding = mapItemAppearanceToNativeProp;
|
|
object2.stacked = mapItemAppearanceToNativePropBinding(stacked);
|
|
object2.inline = mapItemAppearanceToNativePropBinding(inline);
|
|
object2.compactInline = mapItemAppearanceToNativePropBinding(compactInline);
|
|
object2.tabBarBackgroundColor = processColor(tabBarBackgroundColor);
|
|
object2.tabBarShadowColor = processColor(tabBarShadowColor);
|
|
return Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
}
|
|
}
|
|
|
|
function mapItemAppearanceToNativeProp(a0) { // fn#38732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:798, offset: 0x010c88ad, size: 107 bytes, params: 2, frame: 20
|
|
var normal;
|
|
var selected;
|
|
var focused;
|
|
var disabled;
|
|
var Object;
|
|
var assign;
|
|
var object2;
|
|
var mapItemStateAppearanceToNativePropBinding;
|
|
if (a0) {
|
|
normal = a0.normal;
|
|
selected = a0.selected;
|
|
focused = a0.focused;
|
|
disabled = a0.disabled;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
mapItemStateAppearanceToNativePropBinding = mapItemStateAppearanceToNativeProp;
|
|
object2.normal = mapItemStateAppearanceToNativePropBinding(normal);
|
|
object2.selected = mapItemStateAppearanceToNativePropBinding(selected);
|
|
object2.focused = mapItemStateAppearanceToNativePropBinding(focused);
|
|
object2.disabled = mapItemStateAppearanceToNativePropBinding(disabled);
|
|
return Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
}
|
|
}
|
|
|
|
function mapItemStateAppearanceToNativeProp(a0) { // fn#38733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:1114, offset: 0x010c8918, size: 129 bytes, params: 2, frame: 22
|
|
var tabBarItemTitleFontColor;
|
|
var tabBarItemIconColor;
|
|
var tabBarItemBadgeBackgroundColor;
|
|
var tabBarItemTitleFontWeight;
|
|
var Object;
|
|
var assign;
|
|
var object2;
|
|
var processColorBinding;
|
|
var value2;
|
|
if (a0) {
|
|
tabBarItemTitleFontColor = a0.tabBarItemTitleFontColor;
|
|
tabBarItemIconColor = a0.tabBarItemIconColor;
|
|
tabBarItemBadgeBackgroundColor = a0.tabBarItemBadgeBackgroundColor;
|
|
tabBarItemTitleFontWeight = a0.tabBarItemTitleFontWeight;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
processColorBinding = processColor;
|
|
value2 = undefined;
|
|
object2.tabBarItemTitleFontColor = processColorBinding(tabBarItemTitleFontColor);
|
|
object2.tabBarItemIconColor = processColor(tabBarItemIconColor);
|
|
object2.tabBarItemBadgeBackgroundColor = processColor(tabBarItemBadgeBackgroundColor);
|
|
object2.tabBarItemTitleFontWeight = value2 === tabBarItemTitleFontWeight ? value2 : global.String(tabBarItemTitleFontWeight);
|
|
return Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
}
|
|
}
|
|
|
|
function TabsScreen(a0) { // fn#38734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:1470, offset: 0x010c8999, size: 886 bytes, params: 2, frame: 47
|
|
var object6;
|
|
var r13;
|
|
var controlledBottomTabs;
|
|
var value11;
|
|
let binding = env0_6;
|
|
const value2 = binding.useRef(null);
|
|
const value3 = -1;
|
|
const value4 = binding.useRef(value3);
|
|
binding.useEffect(_fun38735, []);
|
|
const value5 = false;
|
|
const value6 = binding.useState(value5);
|
|
const value7 = undefined;
|
|
const value8 = env0_5(value6, 2);
|
|
const property = value8[0];
|
|
const env0_2 = value8[1];
|
|
const onWillAppear = a0.onWillAppear;
|
|
const env0_3 = onWillAppear;
|
|
const onDidAppear = a0.onDidAppear;
|
|
const env0_4 = onDidAppear;
|
|
const onWillDisappear = a0.onWillDisappear;
|
|
const onDidDisappear = a0.onDidDisappear;
|
|
var env0_6 = onDidDisappear;
|
|
const isFocused = a0.isFocused;
|
|
const r4 = value7 !== isFocused && isFocused;
|
|
const freezeContents = a0.freezeContents;
|
|
const icon = a0.icon;
|
|
a0.selectedIcon;
|
|
const standardAppearance = a0.standardAppearance;
|
|
const scrollEdgeAppearance = a0.scrollEdgeAppearance;
|
|
const scrollEdgeEffects = a0.scrollEdgeEffects;
|
|
const experimental_userInterfaceStyle = a0.experimental_userInterfaceStyle;
|
|
const style = a0.style;
|
|
const value10 = env0_4(a0, env0_3);
|
|
const moduleValue = require(4513) /* metro dependency 4513 */;
|
|
if (moduleValue.freezeEnabled()) {
|
|
if (value7 !== freezeContents) {
|
|
r13 = freezeContents;
|
|
} else {
|
|
controlledBottomTabs = (require(4523) /* metro dependency 4523 */).featureFlags.experiment.controlledBottomTabs;
|
|
value11 = !property;
|
|
r13 = controlledBottomTabs ? property ? value11 : !r4 : value11;
|
|
}
|
|
} else {
|
|
r13 = value5;
|
|
}
|
|
binding = env0_6;
|
|
const value13 = binding.useCallback(_fun38736, [onWillAppear]);
|
|
const value14 = binding.useCallback(_fun38737, [onDidAppear]);
|
|
const value15 = binding.useCallback(_fun38738, [onWillDisappear]);
|
|
const value16 = binding.useCallback(_fun38739, [onDidDisappear]);
|
|
const moduleValue2 = require(4547) /* metro dependency 4547 */;
|
|
moduleValue2.bottomTabsDebugLog('TabsScreen [' + (value4.current ?? value3) + '] render; tabKey: ' + value10.tabKey + ' shouldFreeze: ' + r13 + ', isFocused: ' + r4 + ' nativeViewIsVisible: ' + property);
|
|
const iconsToNativeProps = parseIconsToNativeProps(icon);
|
|
const defaultImport = importDefault(4554) /* metro dependency 4554 */;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
object6 = {collapsable: value5};
|
|
object6.style = [style, env0_11.fillParent];
|
|
object6.onWillAppear = value13;
|
|
object6.onDidAppear = value14;
|
|
object6.onWillDisappear = value15;
|
|
object6.onDidDisappear = value16;
|
|
object6.isFocused = r4;
|
|
const object4 = {};
|
|
const mapAppearanceToNativePropBinding = mapAppearanceToNativeProp;
|
|
object4.standardAppearance = mapAppearanceToNativePropBinding(standardAppearance);
|
|
object4.scrollEdgeAppearance = mapAppearanceToNativePropBinding(scrollEdgeAppearance);
|
|
object4.ref = value2;
|
|
object4.bottomScrollEdgeEffect = scrollEdgeEffects == null ? value7 : scrollEdgeEffects.bottom;
|
|
object4.leftScrollEdgeEffect = scrollEdgeEffects == null ? value7 : scrollEdgeEffects.left;
|
|
object4.rightScrollEdgeEffect = scrollEdgeEffects == null ? value7 : scrollEdgeEffects.right;
|
|
object4.topScrollEdgeEffect = scrollEdgeEffects == null ? value7 : scrollEdgeEffects.top;
|
|
object4.isTitleUndefined = value10.title === null || value7 === value10.title;
|
|
object4.userInterfaceStyle = experimental_userInterfaceStyle;
|
|
const object5 = {};
|
|
const Freeze = (require(4521) /* metro dependency 4521 */).Freeze;
|
|
object5.children = <Freeze freeze={r13} placeholder={value10.placeholder}>{value10.children}</Freeze>;
|
|
return ((Component) => <Component {...Reflect.apply(assign, Object, [object6, iconsToNativeProps, object4, value10,
|
|
object5])} />)(defaultImport);
|
|
}
|
|
|
|
function _fun38735() { // fn#38735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:1544, offset: 0x010c8d0f, size: 89 bytes, params: 1, frame: 13
|
|
var binding;
|
|
var value2;
|
|
if (env0_0.current != null) {
|
|
binding = env0_1;
|
|
value2 = environment.__proto__;
|
|
binding.current = findNodeHandle(env0_0.current) ?? -1;
|
|
} else {
|
|
env0_1.current = -1;
|
|
}
|
|
}
|
|
|
|
function _fun38736(a0) { // fn#38736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:2150, offset: 0x010c8d68, size: 114 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(4547) /* metro dependency 4547 */;
|
|
value.bottomTabsDebugLog('TabsScreen [' + env0_1.current + '] onWillAppear received');
|
|
env0_2(true);
|
|
if (onWillAppear != null) {
|
|
onWillAppear(a0);
|
|
}
|
|
}
|
|
|
|
function _fun38737(a0) { // fn#38737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:2284, offset: 0x010c8dda, size: 103 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(4547) /* metro dependency 4547 */;
|
|
value.bottomTabsDebugLog('TabsScreen [' + env0_1.current + '] onDidAppear received');
|
|
if (onDidAppear != null) {
|
|
onDidAppear(a0);
|
|
}
|
|
}
|
|
|
|
function _fun38738(a0) { // fn#38738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:2411, offset: 0x010c8e41, size: 103 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(4547) /* metro dependency 4547 */;
|
|
value.bottomTabsDebugLog('TabsScreen [' + env0_1.current + '] onWillDisappear received');
|
|
if (onWillDisappear != null) {
|
|
onWillDisappear(a0);
|
|
}
|
|
}
|
|
|
|
function _fun38739(a0) { // fn#38739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:2542, offset: 0x010c8ea8, size: 114 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(4547) /* metro dependency 4547 */;
|
|
value.bottomTabsDebugLog('TabsScreen [' + env0_1.current + '] onDidDisappear received');
|
|
env0_2(false);
|
|
if (onDidDisappear != null) {
|
|
onDidDisappear(a0);
|
|
}
|
|
}
|
|
|
|
function parseIconsToNativeProps(a0, a1) { // fn#38740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4731:2828, owner: TabsScreen.parseIconsToNativeProps, offset: 0x010c8f1a, size: 221 bytes, params: 3, frame: 15
|
|
var type;
|
|
var value2;
|
|
var assetSource;
|
|
const value = undefined;
|
|
const r0 = (a0 == null ? value : a0.android) || (a0 == null ? value : a0.shared);
|
|
if (r0) {
|
|
type = r0.type;
|
|
if (type === 'imageSource') {
|
|
value2 = environment.__proto__;
|
|
assetSource = Image.resolveAssetSource(r0.imageSource);
|
|
if (!assetSource) {
|
|
global.console.error('[RNScreens] failed to resolve an asset for bottom tab icon');
|
|
}
|
|
return global.Object.assign({}, {imageIconResource: assetSource || value});
|
|
}
|
|
type = r0.type;
|
|
if (type === 'drawableResource') {
|
|
return global.Object.assign({}, {drawableIconResourceName: r0.name});
|
|
}
|
|
throw new global.Error('[RNScreens] Incorrect icon format for Android. You must provide `imageSource` or `drawableResource`.');
|
|
}
|
|
const Object = global.Object;
|
|
return Object.assign({}, {});
|
|
}
|
|
|