89 lines
4.4 KiB
TypeScript
89 lines
4.4 KiB
TypeScript
/* Metro module 8475; source: modules/collectibles/profile_effects/utils.tsx; dependencies: [57, 31, 22, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00022Module from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun67294(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:6, offset: 0x01c1d290, size: 157 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/profile_effects/utils.tsx');
|
|
exports.sortEffectLayers = function(a0) {
|
|
return a0.sort(_fun67299);
|
|
};
|
|
exports.usePotentiallyRandomizedProfileEffect = usePotentiallyRandomizedProfileEffect;
|
|
function randomizeProfileEffect(a0) { // fn#67295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:143, offset: 0x01c1d32d, size: 172 bytes, params: 2, frame: 19
|
|
if (a0 == null) {
|
|
return a0;
|
|
}
|
|
let value = Module00022Module;
|
|
value = value.cloneDeep(a0);
|
|
let value3 = value.effects.reduce(function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var value = a0;
|
|
r0 = a1.randomizedSources?.length;
|
|
var value3 = 0;
|
|
var r4 = r0 ?? value3;
|
|
if (r4 > value3) {
|
|
if (value3 === value) {
|
|
r1 = r4;
|
|
} else {
|
|
value = global.Math.min(value, r4);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}, 0) - 1;
|
|
const Math = global.Math;
|
|
const floor = Math.floor;
|
|
const Math2 = global.Math;
|
|
const env0_0 = Reflect.apply(floor, Math, [Math2.random() * (value3 - 0 + 1) + 0]);
|
|
value.effects = value.effects.map(_fun67297);
|
|
return value;
|
|
function _fun67297(a0) { // fn#67297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:423, offset: 0x01c1d429, size: 69 bytes, params: 2, frame: 4
|
|
if (a0.randomizedSources != null && a0.randomizedSources.length > 0) {
|
|
a0.src = a0.randomizedSources[env0_0].src;
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
function sortEffectLayers(a0) { // fn#67298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:627, offset: 0x01c1d46e, size: 25 bytes, params: 2, frame: 11
|
|
return a0.sort(function(a0, a1) {
|
|
var zIndex = a0.zIndex;
|
|
var value = 0;
|
|
return (zIndex ?? value) - (a1.zIndex ?? value);
|
|
});
|
|
}
|
|
|
|
function usePotentiallyRandomizedProfileEffect(a0) { // fn#67300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:754, offset: 0x01c1d4b9, size: 134 bytes, params: 2, frame: 21
|
|
let useState = ReactModule.useState;
|
|
const value2 = Reflect.apply(useState, ReactModule, [a0]);
|
|
const value3 = Module00057(value2, 2);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
useState = ReactModule.useState;
|
|
const value4 = Module00057(Reflect.apply(useState, ReactModule, [randomizeProfileEffect(a0)]), 2);
|
|
const property3 = value4[0];
|
|
const property4 = value4[1];
|
|
if (!Module00022Module.isEqual(property, a0)) {
|
|
property2(a0);
|
|
property4(randomizeProfileEffect(a0));
|
|
}
|
|
return property3;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun67299({zIndex}, {zIndex}) { // fn#67299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8660:638, offset: 0x01c1d487, size: 50 bytes, params: 3, frame: 5
|
|
return (zIndex ?? 0) - (zIndex ?? 0);
|
|
}
|
|
|
|
global.__d(_fun67294, 8475, [57, 31, 22, 2]) /* metro module 8475, dependencies: [57, 31, 22, 2] */;
|