decord/source/5606_HeaderSegment.js

197 lines
6.5 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 5606
// Function ID: 5607
2026-07-20 16:05:17 +00:00
// Name: HeaderSegment
2026-07-29 08:29:29 +00:00
// Dependencies: [109, 32, 19, 17, 21, 5607, 5579]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
// Module 5606 (HeaderSegment)
2026-07-23 10:11:24 +00:00
import _objectWithoutProperties from "_objectWithoutProperties";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
import { jsx } from "jsxProd";
2026-07-20 16:05:17 +00:00
let Platform;
2026-07-29 08:29:29 +00:00
let error;
2026-07-23 10:11:24 +00:00
const require = arg1;
let closure_3 = ["progress", "layout", "modal", "onGoBack", "headerTitle", "headerLeft", "headerRight", "headerBackImage", "headerBackTitle", "headerBackTitleVisible", "headerTruncatedBackTitle", "headerBackAccessibilityLabel", "headerBackTestID", "headerBackAllowFontScaling", "headerBackTitleStyle", "headerTitleContainerStyle", "headerLeftContainerStyle", "headerRightContainerStyle", "headerBackgroundContainerStyle", "headerStyle", "headerStatusBarHeight", "styleInterpolator"];
2026-07-29 08:29:29 +00:00
({ Platform, StyleSheet: error } = get_ActivityIndicator);
2026-07-20 16:05:17 +00:00
export default function HeaderSegment(headerTitle) {
let backgroundStyle;
2026-07-23 10:11:24 +00:00
let closure_11;
let closure_13;
let closure_14;
let closure_15;
let closure_16;
let closure_17;
2026-07-20 16:05:17 +00:00
let current;
let headerBackTitle;
let headerBackgroundContainerStyle;
let headerLeftContainerStyle;
let headerRightContainerStyle;
let headerStatusBarHeight;
let headerStyle;
let headerTitleContainerStyle;
let layout;
let leftButtonStyle;
let modal;
let next;
let onGoBack;
let progress;
let rightButtonStyle;
let styleInterpolator;
let titleStyle;
2026-07-23 10:11:24 +00:00
let tmp = handleLeftLabelLayout(layout.useState(undefined), 2);
2026-07-20 16:05:17 +00:00
const first = tmp[0];
const importDefault = tmp[1];
2026-07-23 10:11:24 +00:00
const tmp3 = handleLeftLabelLayout(layout.useState(undefined), 2);
2026-07-20 16:05:17 +00:00
const first1 = tmp3[0];
let closure_3 = tmp3[1];
function handleTitleLayout(nativeEvent, closure_3) {
2026-07-23 10:11:24 +00:00
let closure_1;
let first;
({ height: first, width: closure_1 } = nativeEvent.nativeEvent.layout);
2026-07-20 16:05:17 +00:00
callback2((arg0) => {
let size = arg0;
if (arg0) {
return size;
}
size = { height: closure_0, width: closure_1 };
});
}
2026-07-23 10:11:24 +00:00
handleLeftLabelLayout = function handleLeftLabelLayout(layout, arg1) {
2026-07-20 16:05:17 +00:00
let height;
let width;
2026-07-23 10:11:24 +00:00
({ height, width } = layout.nativeEvent.layout);
2026-07-29 08:29:29 +00:00
const size = first;
2026-07-20 16:05:17 +00:00
let tmp = first;
if (first) {
2026-07-29 08:29:29 +00:00
tmp = height === size.height;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = width === size.width;
2026-07-20 16:05:17 +00:00
}
if (!tmp) {
2026-07-29 08:29:29 +00:00
const obj = { height: null, width: null };
obj[0] = height;
obj[1] = width;
2026-07-20 16:05:17 +00:00
callback(obj);
}
2026-07-23 10:11:24 +00:00
};
2026-07-20 16:05:17 +00:00
({ progress, layout } = headerTitle);
({ modal, onGoBack } = headerTitle);
headerTitle = headerTitle.headerTitle;
let headerLeft = headerTitle.headerLeft;
if (undefined === headerLeft) {
let fn;
if (onGoBack) {
2026-07-29 08:29:29 +00:00
fn = (arg0) => {
const merged = Object.assign(arg0);
return headerTitle(first(first1[6]).HeaderBackButton, {});
};
2026-07-20 16:05:17 +00:00
}
headerLeft = fn;
}
const headerRight = headerTitle.headerRight;
({ headerBackImage: closure_11, headerBackTitle } = headerTitle);
const headerBackTitleVisible = headerTitle.headerBackTitleVisible;
({ headerTruncatedBackTitle: closure_13, headerBackAccessibilityLabel: closure_14, headerBackTestID: closure_15, headerBackAllowFontScaling: closure_16, headerBackTitleStyle: closure_17, headerStyle, headerStatusBarHeight, styleInterpolator } = headerTitle);
({ headerTitleContainerStyle, headerLeftContainerStyle, headerRightContainerStyle, headerBackgroundContainerStyle } = headerTitle);
2026-07-29 08:29:29 +00:00
const tmp6 = importDefault(first1[5])((arg0, width, progress, arg3, title, leftLabel, height) => {
obj = { current: obj, next: null, layouts: null };
2026-07-20 16:05:17 +00:00
obj = { progress };
2026-07-29 08:29:29 +00:00
let tmp = arg3;
if (arg3) {
obj = { progress: null };
obj[0] = arg3;
2026-07-20 16:05:17 +00:00
tmp = obj;
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp;
obj[2] = { header: obj2, screen: width, title, leftLabel };
2026-07-20 16:05:17 +00:00
return arg0(obj);
});
2026-07-29 08:29:29 +00:00
const tmp7 = undefined !== headerBackTitleVisible && headerBackTitleVisible;
let obj = first(tmp5[6]);
2026-07-20 16:05:17 +00:00
let defaultHeaderHeight = obj.getDefaultHeaderHeight(layout, modal, headerStatusBarHeight);
obj = headerStyle;
if (!headerStyle) {
obj = {};
}
let height = onGoBack.flatten(obj).height;
if (undefined === height) {
height = defaultHeaderHeight;
}
({ current, next } = progress);
2026-07-29 08:29:29 +00:00
let tmp12;
2026-07-20 16:05:17 +00:00
if (headerBackTitle) {
2026-07-29 08:29:29 +00:00
tmp12 = first;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (typeof height !== "os") {
2026-07-20 16:05:17 +00:00
defaultHeaderHeight = height;
}
2026-07-29 08:29:29 +00:00
const tmp6Result = tmp6(styleInterpolator, layout, current, next, first1, tmp12, defaultHeaderHeight);
const leftLabelStyle = tmp6Result.leftLabelStyle;
2026-07-20 16:05:17 +00:00
let fn2;
2026-07-29 08:29:29 +00:00
({ titleStyle, leftButtonStyle, rightButtonStyle, backgroundStyle } = tmp6Result);
2026-07-20 16:05:17 +00:00
if (headerLeft) {
fn2 = (arg0) => {
2026-07-29 08:29:29 +00:00
const obj = {};
const merged = Object.assign(arg0);
obj.backImage = closure_11;
obj.accessibilityLabel = closure_14;
obj.testID = closure_15;
obj.allowFontScaling = closure_16;
obj.onPress = onGoBack;
obj.label = headerBackTitle;
obj.truncatedLabel = closure_13;
2026-07-20 16:05:17 +00:00
const items = [leftLabelStyle, closure_17];
2026-07-29 08:29:29 +00:00
obj.labelStyle = items;
obj.onLabelLayout = handleLeftLabelLayout;
obj.screenLayout = layout;
obj.titleLayout = first1;
obj.canGoBack = Boolean(onGoBack);
return headerLeft(obj);
2026-07-20 16:05:17 +00:00
};
}
let fn3;
if (headerRight) {
2026-07-29 08:29:29 +00:00
fn3 = (arg0) => {
const obj = {};
const merged = Object.assign(arg0);
obj.canGoBack = Boolean(onGoBack);
return headerRight(obj);
};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = {
modal,
layout,
headerTitle: typeof headerTitle === "_" ? ((arg0) => {
const obj = {};
const merged = Object.assign(arg0);
obj.onLayout = handleTitleLayout;
return headerTitle(first(first1[6]).HeaderTitle, obj);
}) : ((arg0) => {
const obj = {};
const merged = Object.assign(arg0);
obj.onLayout = handleTitleLayout;
return headerTitle(obj);
}),
headerLeft: fn2,
headerLeftLabelVisible: tmp7,
headerRight: fn3,
headerTitleContainerStyle: items,
headerLeftContainerStyle: items1,
headerRightContainerStyle: items2,
headerBackgroundContainerStyle: items3,
headerStyle,
headerStatusBarHeight
};
items = [titleStyle, headerTitleContainerStyle];
items1 = [leftButtonStyle, headerLeftContainerStyle];
items2 = [rightButtonStyle, headerRightContainerStyle];
items3 = [backgroundStyle, headerBackgroundContainerStyle];
let merged = Object.assign(handleTitleLayout(headerTitle, closure_3));
return headerTitle(first(first1[6]).Header, obj);
2026-07-20 16:05:17 +00:00
};