decord/source/5666_StyleSheet.js

222 lines
9 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 5666
// Function ID: 5667
2026-07-20 16:05:17 +00:00
// Name: StyleSheet
2026-08-05 07:35:12 +00:00
// Dependencies: [109, 19, 17, 21, 1584, 5667, 5664, 5669, 5670]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 5666 (StyleSheet)
2026-07-23 10:11:24 +00:00
import _objectWithoutProperties from "_objectWithoutProperties";
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 jsxProd from "jsxProd";
2026-07-20 16:05:17 +00:00
let Platform;
let StyleSheet;
2026-07-29 08:29:29 +00:00
let c10;
let c9;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
let closure_3 = ["height", "minHeight", "maxHeight", "backgroundColor", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderEndWidth", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStartWidth", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth", "boxShadow", "elevation", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "opacity", "transform"];
({ Animated: closure_6, Platform, StyleSheet } = get_ActivityIndicator);
const View = get_ActivityIndicator.View;
2026-07-29 08:29:29 +00:00
({ jsx: c9, jsxs: c10 } = jsxProd);
2026-07-23 10:11:24 +00:00
const styles = StyleSheet.create({ content: { flex: 1, flexDirection: "row", alignItems: "stretch" }, title: { marginHorizontal: 16, justifyContent: "center" }, left: { justifyContent: "center", alignItems: "flex-start" }, right: { justifyContent: "center", alignItems: "flex-end" }, expand: { flexGrow: 1, flexBasis: 0 } });
2026-07-20 16:05:17 +00:00
export default function Header(children) {
let backgroundColor;
let borderBottomColor;
let borderBottomEndRadius;
let borderBottomLeftRadius;
let borderBottomRightRadius;
let borderBottomStartRadius;
let borderBottomWidth;
let borderColor;
let borderEndColor;
let borderEndWidth;
let borderLeftColor;
let borderLeftWidth;
let borderRadius;
let borderRightColor;
let borderRightWidth;
let borderStartColor;
let borderStartWidth;
let borderStyle;
let borderTopColor;
let borderTopEndRadius;
let borderTopLeftRadius;
let borderTopRightRadius;
let borderTopStartRadius;
let borderTopWidth;
let borderWidth;
let boxShadow;
let elevation;
let headerBackground;
let headerBackgroundContainerStyle;
let headerLeft;
let headerLeftContainerStyle;
let headerLeftLabelVisible;
let headerPressColor;
let headerPressOpacity;
let headerRight;
let headerRightContainerStyle;
let headerShadowVisible;
let headerStatusBarHeight;
let headerStyle;
let headerTintColor;
let headerTitle;
let headerTitleAlign;
let headerTitleAllowFontScaling;
let headerTitleContainerStyle;
let headerTitleStyle;
let headerTransparent;
let maxHeight;
let minHeight;
let opacity;
let shadowColor;
let shadowOffset;
let shadowOpacity;
let shadowRadius;
let transform;
2026-07-29 08:29:29 +00:00
let obj = require(1584);
2026-07-20 16:05:17 +00:00
const rect = obj.useSafeAreaInsets();
2026-07-29 08:29:29 +00:00
let obj1 = require(1584);
2026-07-20 16:05:17 +00:00
const safeAreaFrame = obj1.useSafeAreaFrame();
let layout = children.layout;
2026-08-05 07:35:12 +00:00
const context = React.useContext(importDefault(5667));
2026-07-20 16:05:17 +00:00
if (undefined === layout) {
layout = safeAreaFrame;
}
const modal = children.modal;
({ headerTitle, headerTitleAlign } = children);
let str = "left";
if (undefined !== headerTitleAlign) {
str = headerTitleAlign;
}
({ headerLeft, headerLeftLabelVisible, headerTintColor, headerBackground, headerRight, headerStyle, headerPressColor, headerPressOpacity, headerStatusBarHeight, headerTransparent, headerTitleAllowFontScaling, headerTitleStyle, headerLeftContainerStyle, headerRightContainerStyle, headerTitleContainerStyle, headerBackgroundContainerStyle, headerShadowVisible } = children);
if (undefined === headerStatusBarHeight) {
let num = 0;
if (!context) {
num = rect.top;
}
headerStatusBarHeight = num;
}
if (!headerStyle) {
headerStyle = {};
}
const flattenResult = StyleSheet.flatten(headerStyle);
let height = flattenResult.height;
if (undefined === height) {
2026-07-29 08:29:29 +00:00
height = tmp8;
2026-07-20 16:05:17 +00:00
}
({ opacity, transform } = flattenResult);
({ minHeight, maxHeight, backgroundColor, borderBottomColor, borderBottomEndRadius, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStartRadius, borderBottomWidth, borderColor, borderEndColor, borderEndWidth, borderLeftColor, borderLeftWidth, borderRadius, borderRightColor, borderRightWidth, borderStartColor, borderStartWidth, borderStyle, borderTopColor, borderTopEndRadius, borderTopLeftRadius, borderTopRightRadius, borderTopStartRadius, borderTopWidth, borderWidth, boxShadow, elevation, shadowColor, shadowOffset, shadowOpacity, shadowRadius } = flattenResult);
callback(flattenResult, closure_3);
obj = { backgroundColor, borderBottomColor, borderBottomEndRadius, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStartRadius, borderBottomWidth, borderColor, borderEndColor, borderEndWidth, borderLeftColor, borderLeftWidth, borderRadius, borderRightColor, borderRightWidth, borderStartColor, borderStartWidth, borderStyle, borderTopColor, borderTopEndRadius, borderTopLeftRadius, borderTopRightRadius, borderTopStartRadius, borderTopWidth, borderWidth, boxShadow, elevation, shadowColor, shadowOffset, shadowOpacity, shadowRadius, opacity, transform };
2026-07-29 08:29:29 +00:00
for (const key10093 in obj) {
let tmp25 = key10093;
if (undefined !== obj[key10093]) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
2026-07-23 10:11:24 +00:00
const items = [obj, false === headerShadowVisible && { elevation: 0, shadowOpacity: 0, borderBottomWidth: 0 }];
2026-07-20 16:05:17 +00:00
let headerLeftResult = null;
if (headerLeft) {
2026-07-29 08:29:29 +00:00
obj = { tintColor: null, pressColor: null, pressOpacity: null, labelVisible: null };
obj[0] = headerTintColor;
obj[1] = headerPressColor;
obj[2] = headerPressOpacity;
obj[3] = headerLeftLabelVisible;
2026-07-20 16:05:17 +00:00
headerLeftResult = headerLeft(obj);
}
let headerRightResult = null;
if (headerRight) {
2026-07-29 08:29:29 +00:00
obj1 = { tintColor: null, pressColor: null, pressOpacity: null };
obj1[0] = headerTintColor;
obj1[1] = headerPressColor;
obj1[2] = headerPressOpacity;
2026-07-20 16:05:17 +00:00
headerRightResult = headerRight(obj1);
}
2026-08-04 21:03:28 +00:00
if (typeof headerTitle !== "function") {
2026-07-29 08:29:29 +00:00
headerTitle = (arg0) => {
const merged = Object.assign(arg0);
return callback2(callback(table[7]), {});
};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj2 = { pointerEvents: "box-none", style: items1, children: null };
2026-07-23 10:11:24 +00:00
items1 = [StyleSheet.absoluteFill, { zIndex: 0 }, headerBackgroundContainerStyle];
2026-07-20 16:05:17 +00:00
if (headerBackground) {
2026-07-29 08:29:29 +00:00
const obj3 = { style: null };
obj3[0] = items;
let headerBackgroundResult = headerBackground(obj3);
2026-07-20 16:05:17 +00:00
} else {
headerBackgroundResult = null;
if (!headerTransparent) {
2026-07-29 08:29:29 +00:00
const obj4 = { style: null };
obj4[0] = items;
2026-08-05 07:35:12 +00:00
headerBackgroundResult = tmp15(importDefault(5670), obj4);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj2[2] = headerBackgroundResult;
const items2 = [closure_9(RN.View, obj2), ];
const obj5 = { pointerEvents: "box-none", style: items3, children: null };
items3 = [{ height, minHeight, maxHeight, opacity, transform }];
const items4 = [closure_9(View, { pointerEvents: "none", style: { height: headerStatusBarHeight } }), ];
const obj6 = { pointerEvents: "box-none", style: closure_11.content, children: null };
2026-07-20 16:05:17 +00:00
const items5 = [closure_11.left, , , ];
2026-07-29 08:29:29 +00:00
let expand = tmp22;
2026-07-20 16:05:17 +00:00
if ("center" === str) {
2026-07-29 08:29:29 +00:00
expand = tmp21.expand;
2026-07-20 16:05:17 +00:00
}
items5[1] = expand;
items5[2] = { marginStart: rect.left };
items5[3] = headerLeftContainerStyle;
2026-07-29 08:29:29 +00:00
const items6 = [closure_9(RN.View, { pointerEvents: "box-none", style: items5, children: headerLeftResult }), , ];
2026-07-20 16:05:17 +00:00
const items7 = [closure_11.title, , ];
const width = layout.width;
2026-07-29 08:29:29 +00:00
let num2 = 16;
2026-07-20 16:05:17 +00:00
if ("center" === str) {
if (headerLeftResult) {
2026-07-29 08:29:29 +00:00
let num5 = 32;
2026-07-20 16:05:17 +00:00
if (false !== headerLeftLabelVisible) {
2026-07-29 08:29:29 +00:00
num5 = 80;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
num2 = num5;
2026-07-20 16:05:17 +00:00
}
const _Math = Math;
2026-07-29 08:29:29 +00:00
let diff = width - 2 * (num2 + Math.max(rect.left, rect.right));
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let num3 = num2;
2026-07-20 16:05:17 +00:00
if (headerLeftResult) {
2026-07-29 08:29:29 +00:00
num3 = 72;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num4 = num2;
2026-07-20 16:05:17 +00:00
if (headerRightResult) {
2026-07-29 08:29:29 +00:00
num4 = 72;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
diff = width - (num3 + num4 + rect.left - rect.right);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj7 = { children: null };
const tmp20 = View;
const tmp5 = importDefault;
const tmp7 = undefined !== modal && modal;
2026-08-05 07:35:12 +00:00
tmp8 = importDefault(5664)(layout, undefined !== modal && modal, headerStatusBarHeight);
2026-07-29 08:29:29 +00:00
items7[1] = { maxWidth: diff };
2026-07-20 16:05:17 +00:00
items7[2] = headerTitleContainerStyle;
2026-07-29 08:29:29 +00:00
items6[1] = closure_9(RN.View, { pointerEvents: "box-none", style: items7, children: headerTitle({ children: children.title, allowFontScaling: headerTitleAllowFontScaling, tintColor: headerTintColor, style: headerTitleStyle }) });
const items8 = [, , , ];
2026-07-20 16:05:17 +00:00
({ right: arr9[0], expand: arr9[1] } = closure_11);
items8[2] = { marginEnd: rect.right };
items8[3] = headerRightContainerStyle;
2026-07-29 08:29:29 +00:00
items6[2] = closure_9(RN.View, { pointerEvents: "box-none", style: items8, children: headerRightResult });
obj6[2] = items6;
items4[1] = closure_10(tmp20, obj6);
obj5[2] = items4;
items2[1] = closure_10(RN.View, obj5);
obj7[0] = items2;
return closure_10(React.Fragment, obj7);
2026-07-20 16:05:17 +00:00
};