261 lines
9.9 KiB
TypeScript
261 lines
9.9 KiB
TypeScript
/* Metro module 15366; source: modules/activities/panel/native/useActivityWebViewLockManager.tsx; dependencies: [57, 31, 4017, 4508, 2] */
|
|
function _fun117455(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:6, offset: 0x024b38a0, size: 168 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_117458 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/panel/native/useActivityWebViewLockManager.tsx');
|
|
exports.default = useActivityWebViewLockManager;
|
|
exports.useLockedWebView = useLockedWebView;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_117456(a0, a1) { // fn#117456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:121, offset: 0x024b3948, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun117457;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_117458(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_117458(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_117458(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun117457;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function useActivityWebViewLockManager() { // fn#117459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1142, offset: 0x024b3abc, size: 34 bytes, params: 1, frame: 11
|
|
return env0_3.useState(function() {
|
|
var env0_3 = _fun117461;
|
|
var env0_4 = _fun117462;
|
|
var env0_1 = new global.Set();
|
|
var env0_2 = new global.Map();
|
|
return _fun117464;
|
|
})[0];
|
|
}
|
|
|
|
function useLockedWebView({transitionState, context}) { // fn#117470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1938, offset: 0x024b3d5b, size: 139 bytes, params: 2, frame: 17
|
|
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
|
|
const binding = env0_3;
|
|
const useContext = binding.useContext;
|
|
const useActivityWebViewLock = Reflect.apply(useContext, binding, [context]).useActivityWebViewLock;
|
|
const value = useActivityWebViewLock();
|
|
binding.useEffect(_fun117471, [value2, transitionState, value]);
|
|
return {shown: value2, renderWebView: value};
|
|
}
|
|
|
|
function _fun117460() { // fn#117460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1202, offset: 0x024b3ade, size: 95 bytes, params: 1, frame: 11
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
return _fun117464;
|
|
}
|
|
|
|
function _fun117471() { // fn#117471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:2096, offset: 0x024b3de6, size: 91 bytes, params: 1, frame: 13
|
|
const transitionStateBinding = transitionState;
|
|
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
|
|
const YEETED = TransitionStates.YEETED;
|
|
if (transitionStateBinding === YEETED) {
|
|
env0_1.set(false);
|
|
} else if (env0_2) {
|
|
env0_1.set(true);
|
|
} else {
|
|
env0_1.set(false);
|
|
}
|
|
}
|
|
|
|
function getCanRender(a0) { // fn#117461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1233, offset: 0x024b3b3d, size: 68 bytes, params: 2, frame: 11
|
|
var r0;
|
|
var value;
|
|
const value2 = env0_1.size === 0;
|
|
if (value2) {
|
|
r0 = value2;
|
|
} else {
|
|
value = env0_1.values();
|
|
value = value.next();
|
|
value = value?.value === a0;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function queueRenderUpdate() { // fn#117462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1332, offset: 0x024b3b81, size: 57 bytes, params: 1, frame: 12
|
|
if (env0_0 == null) {
|
|
env0_0 = global.Promise.resolve().then(_fun117463);
|
|
}
|
|
}
|
|
|
|
function _fun117464() { // fn#117464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1615, offset: 0x024b3c48, size: 132 bytes, params: 1, frame: 17
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
const binding = env2_3;
|
|
const value2 = binding.useId();
|
|
value = env2_2(binding.useState(_fun117465), 2);
|
|
const property = value[0];
|
|
const property2 = value[1];
|
|
binding.useInsertionEffect(_fun117466, [value2]);
|
|
binding.useLayoutEffect(function() {
|
|
queueRenderUpdate();
|
|
return _fun117469;
|
|
}, [value2, property2]);
|
|
return property;
|
|
}
|
|
|
|
function _fun117463() { // fn#117463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1397, offset: 0x024b3bba, size: 142 bytes, params: 1, frame: 24
|
|
var r3;
|
|
var value5;
|
|
var value6;
|
|
var property;
|
|
var property2;
|
|
var canRender;
|
|
var callback;
|
|
var canRender2;
|
|
var binding;
|
|
var value8;
|
|
const value3 = _createForOfIteratorHelperLoose_117456(env1_2);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r3 = value4;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
value6 = env3_2(value5, 2);
|
|
property = value6[0];
|
|
property2 = value6[1];
|
|
canRender = property2.canRender;
|
|
callback = property2.callback;
|
|
canRender2 = getCanRender(property);
|
|
if (canRender2 !== canRender) {
|
|
binding = env1_2;
|
|
binding.set(property, {canRender: canRender2, callback: callback});
|
|
callback(canRender2);
|
|
}
|
|
value8 = value3();
|
|
done = value8.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun117466() { // fn#117466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1730, offset: 0x024b3ccc, size: 77 bytes, params: 1, frame: 15
|
|
let binding = env1_1;
|
|
const add = binding.add;
|
|
const binding2 = env0_0;
|
|
Reflect.apply(add, binding, [binding2]);
|
|
binding = env1_2;
|
|
const set = binding.set;
|
|
const object2 = {callback: env0_1};
|
|
object2.canRender = getCanRender(binding2);
|
|
Reflect.apply(set, binding, [binding2, object2]);
|
|
return _fun117467;
|
|
}
|
|
|
|
function _fun117468() { // fn#117468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1848, offset: 0x024b3d43, size: 24 bytes, params: 1, frame: 9
|
|
queueRenderUpdate();
|
|
return function() {
|
|
queueRenderUpdate();
|
|
};
|
|
}
|
|
|
|
function _fun117467() { // fn#117467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15563:1792, offset: 0x024b3d19, size: 42 bytes, params: 1, frame: 12
|
|
const binding = env2_1;
|
|
const binding2 = env1_0;
|
|
binding.delete(binding2);
|
|
env2_2.delete(binding2);
|
|
}
|
|
|