150 lines
7.8 KiB
React
150 lines
7.8 KiB
React
/* Metro module 1589; source: unknown; dependencies: [57, 29, 31, 27, 33, 1590] */
|
|
import ObjectWithoutProperties from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
|
|
import Module00057 from './module-00057.js'; /* Metro dependency 57 */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as NativeSafeAreaProviderModule from './module-01590-NativeSafeAreaProvider.js'; /* Metro dependency 1590 */
|
|
|
|
function _fun17613(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:6, offset: 0x00e713f0, size: 366 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const useSafeAreaInsets_176142 = useSafeAreaInsets_17614;
|
|
const env0_2 = ['children', 'initialMetrics', 'initialSafeAreaInsets', 'style'];
|
|
const env0_3 = ['onChange', 'style', 'children'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const StyleSheet = ReactNativeModule.StyleSheet;
|
|
const context = value.createContext(null);
|
|
value = value.createContext(null);
|
|
const env0_11 = StyleSheet.create({fill: {flex: 1}});
|
|
const Consumer = context.Consumer;
|
|
exports.SafeAreaInsetsContext = context;
|
|
exports.SafeAreaFrameContext = value;
|
|
exports.SafeAreaProvider = SafeAreaProvider;
|
|
exports.SafeAreaListener = SafeAreaListener;
|
|
exports.useSafeAreaInsets = useSafeAreaInsets_176142;
|
|
exports.useSafeAreaFrame = useSafeAreaFrame;
|
|
exports.withSafeAreaInsets = withSafeAreaInsets;
|
|
exports.useSafeArea = function() {
|
|
return useSafeAreaInsets_17614();
|
|
};
|
|
exports.SafeAreaConsumer = Consumer;
|
|
exports.SafeAreaContext = context;
|
|
function useSafeAreaInsets_17614() { // fn#17614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:475, offset: 0x00e7155e, size: 64 bytes, params: 1, frame: 12
|
|
const value2 = env0_6.useContext(env0_9);
|
|
if (value2 == null) {
|
|
throw new global.Error(env0_12);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function SafeAreaProvider(a0) { // fn#17615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:659, offset: 0x00e7159e, size: 480 bytes, params: 2, frame: 28
|
|
var object;
|
|
var get;
|
|
const children = a0.children;
|
|
const initialMetrics = a0.initialMetrics;
|
|
const initialSafeAreaInsets = a0.initialSafeAreaInsets;
|
|
const style = a0.style;
|
|
let binding = ObjectWithoutProperties;
|
|
const value2 = undefined;
|
|
const value3 = binding(a0, env0_2);
|
|
const value4 = env0_6.useContext(env0_9);
|
|
const value5 = env0_6.useContext(env0_10);
|
|
binding = env0_6;
|
|
let useState = binding.useState;
|
|
const value6 = null;
|
|
const insets = value6 == initialMetrics ? value2 : initialMetrics.insets;
|
|
const r2 = value6 == insets ? initialSafeAreaInsets : insets;
|
|
const r6 = value6 == r2 ? value4 : r2;
|
|
const value8 = Module00057(Reflect.apply(useState, binding, [value6 != r6 ? r6 : value6]), 2);
|
|
const property = value8[0];
|
|
const env0_0 = value8[1];
|
|
binding = env0_6;
|
|
useState = binding.useState;
|
|
const frame = value6 == initialMetrics ? value2 : initialMetrics.frame;
|
|
let r1 = value6 == frame ? value5 : frame;
|
|
if (value6 == r1) {
|
|
object = {'x': 0, 'y': 0};
|
|
get = Dimensions.get;
|
|
object.width = Reflect.apply(get, Dimensions, ['window']).width;
|
|
get = Dimensions.get;
|
|
object.height = Reflect.apply(get, Dimensions, ['window']).height;
|
|
r1 = object;
|
|
}
|
|
const value10 = Module00057(Reflect.apply(useState, binding, [r1]), 2);
|
|
const property2 = value10[0];
|
|
const env0_1 = value10[1];
|
|
const value11 = env0_6.useCallback(_fun17616, []);
|
|
const NativeSafeAreaProvider = (NativeSafeAreaProviderModule).NativeSafeAreaProvider;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
object = {style: [env0_11.fill, style], onInsetsChange: value11};
|
|
const object2 = {};
|
|
object2.children = (
|
|
value6 != property
|
|
? (
|
|
<env0_10.Provider value={property2}>
|
|
<env0_9.Provider value={property}>
|
|
{children}
|
|
</env0_9.Provider>
|
|
</env0_10.Provider>
|
|
)
|
|
: value6
|
|
);
|
|
return <NativeSafeAreaProvider {...Reflect.apply(assign, Object, [object, value3, object2])} />;
|
|
function _fun17616({nativeEvent}) { // fn#17616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:1181, offset: 0x00e7177e, size: 66 bytes, params: 2, frame: 13
|
|
const frame = nativeEvent.frame;
|
|
nativeEvent.insets(function(a0) {
|
|
var value = a0;
|
|
return frame ? frame.height !== value.height || frame.width !== value.width || frame.x !== value.x ? frame : frame.y === value.y ? value : frame : value;
|
|
});
|
|
frame(function(a0) {
|
|
var value = a0;
|
|
return value ? insets.bottom !== value.bottom || insets.left !== value.left || insets.right !== value.right ? insets : insets.top === value.top ? value : insets : insets;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function SafeAreaListener(a0) { // fn#17619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:1643, offset: 0x00e7187b, size: 146 bytes, params: 2, frame: 22
|
|
const env0_0 = a0.onChange;
|
|
const style = a0.style;
|
|
const children = a0.children;
|
|
const value2 = ObjectWithoutProperties(a0, env0_3);
|
|
const NativeSafeAreaProvider = (NativeSafeAreaProviderModule).NativeSafeAreaProvider;
|
|
const Object = global.Object;
|
|
return (
|
|
<NativeSafeAreaProvider
|
|
{...Object.assign({}, value2, {style: [env0_11.fill, style], onInsetsChange: function(a0) {
|
|
onChange({insets: a0.nativeEvent.insets, frame: a0.nativeEvent.frame});
|
|
}, children: children})}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function useSafeAreaFrame() { // fn#17621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:1974, offset: 0x00e71944, size: 64 bytes, params: 1, frame: 12
|
|
const value2 = env0_6.useContext(env0_10);
|
|
if (value2 == null) {
|
|
throw new global.Error(env0_12);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function withSafeAreaInsets(a0) { // fn#17622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:2086, offset: 0x00e71984, size: 34 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return env0_6.forwardRef(_fun17623);
|
|
function _fun17623(a0, a1) { // fn#17623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1716:2138, offset: 0x00e719a6, size: 71 bytes, params: 3, frame: 18
|
|
const value2 = useSafeAreaInsets_17614();
|
|
const binding = env0_0;
|
|
const Object = global.Object;
|
|
return ((Component) => <Component {...Object.assign({}, a0, {insets: value2, ref: a1})} />)(binding);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun17613, 1589, [57, 29, 31, 27, 33,
|
|
1590]) /* metro module 1589, dependencies: [57, 29, 31, 27, 33, 1590] */;
|