77 lines
4.2 KiB
TypeScript
77 lines
4.2 KiB
TypeScript
/* Metro module 9946; source: modules/media_viewer/native/useMediaViewerClosePosition.tsx; dependencies: [57, 31, 661, 9941, 8994, 4017, 2] */
|
|
function _fun77846(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:6, offset: 0x01e0e119, size: 202 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(661) /* metro dependency 661: Constants */).NOOP;
|
|
object = {code: 'function useMediaViewerClosePositionTsx1(){const{index}=this.__closure;return index.get();}'};
|
|
object = {code: 'function useMediaViewerClosePositionTsx2(index){const{runOnJS,setClosePosition}=this.__closure;runOnJS(setClosePosition)(index);}'};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerClosePosition.tsx');
|
|
exports.default = useMediaViewerClosePosition;
|
|
}
|
|
|
|
function computeClosePosition(a0, a1, a2) { // fn#77847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:131, offset: 0x01e0e1e3, size: 73 bytes, params: 4, frame: 16
|
|
var r0;
|
|
var value;
|
|
if (a2 != null) {
|
|
value = importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */;
|
|
value = value(a0, a1, a2);
|
|
r0 = value;
|
|
} else {
|
|
r0 = {height: a1};
|
|
}
|
|
return (a1 + r0.height) / 2;
|
|
}
|
|
|
|
function useMediaViewerClosePosition({index, sources, onClose = NOOP, windowHeight, windowWidth}) { // fn#77848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:477, offset: 0x01e0e22c, size: 371 bytes, params: 2, frame: 24
|
|
var object2;
|
|
const env0_3 = windowWidth;
|
|
const value2 = (importDefault(8994) /* metro dependency 8994: useStableCallback */)(onClose);
|
|
const binding = value2;
|
|
const [property, env0_5] = env0_3(binding.useState(function() {
|
|
return computeClosePosition(windowWidth, windowHeight, sources[index.get()]);
|
|
}), 2);
|
|
const value5 = binding.useCallback(_fun77850, [value2, sources, windowHeight, windowWidth]);
|
|
const env0_6 = value5;
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
|
|
const closure = function() {
|
|
return index.get();
|
|
};
|
|
closure.__closure = {index: index};
|
|
closure.__workletHash = 5031282724746;
|
|
closure.__initData = env0_6;
|
|
const closure2 = useMediaViewerClosePositionF;
|
|
object2 = {};
|
|
object2.runOnJS = reanimatedRexportModule.runOnJS;
|
|
object2.setClosePosition = value5;
|
|
closure2.__closure = object2;
|
|
closure2.__workletHash = 2709880768438;
|
|
closure2.__initData = env0_7;
|
|
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
|
|
binding.useEffect(_fun77853, [value5, index]);
|
|
return property;
|
|
}
|
|
|
|
function _fun77850(a0) { // fn#77850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:694, offset: 0x01e0e3d1, size: 65 bytes, params: 2, frame: 16
|
|
const property = sources[a0];
|
|
if (property == null) {
|
|
env0_4();
|
|
}
|
|
env0_5(computeClosePosition(windowWidth, windowHeight, property));
|
|
}
|
|
|
|
function useMediaViewerClosePositionF(a0) { // fn#77852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:890, owner: useMediaViewerClosePosition.f, offset: 0x01e0e412, size: 52 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
value = value.runOnJS(env0_6);
|
|
value(a0);
|
|
}
|
|
|
|
function _fun77853() { // fn#77853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:1043, offset: 0x01e0e446, size: 29 bytes, params: 1, frame: 11
|
|
env0_6(index.get());
|
|
}
|
|
|