74 lines
4.0 KiB
TypeScript
74 lines
4.0 KiB
TypeScript
/* Metro module 14636; source: modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx; dependencies: [31, 8259, 1244, 2256, 2] */
|
|
function _fun110618(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:6, offset: 0x0237fc9a, size: 143 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(8259) /* metro dependency 8259: GuildPowerupsConstants */).PowerupActiveStatusType;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx');
|
|
exports.useCalculatePowerupCardStatus = useCalculatePowerupCardStatus;
|
|
}
|
|
|
|
function useCalculatePowerupCardStatus(a0, a1, a2) { // fn#110619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:270, offset: 0x0237fd29, size: 66 bytes, params: 4, frame: 16
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
return env0_3.useMemo(_fun110620, [a1, a2, a0]);
|
|
}
|
|
|
|
function _fun110620() { // fn#110620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:334, offset: 0x0237fd6b, size: 431 bytes, params: 1, frame: 23
|
|
var r0;
|
|
var type;
|
|
var value3;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
var WRRYUT;
|
|
var sourcePowerup;
|
|
const intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const sourceEntitlement = require.sourceEntitlement;
|
|
const value2 = undefined;
|
|
if ((sourceEntitlement == null ? value2 : sourceEntitlement.ends_at) != null) {
|
|
r0 = {type: 'expiring', expiringAt: require.sourceEntitlement.ends_at};
|
|
} else if (importDefault) {
|
|
if (env0_0.storeRemovalDate != null) {
|
|
r0 = {type: 'removing', removingAt: env0_0.storeRemovalDate};
|
|
} else {
|
|
type = require.type;
|
|
value3 = environment.__proto__;
|
|
if (type === PowerupActiveStatusType.LEVEL_ACTIVATED) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
WRRYUT = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).WRRYUT;
|
|
sourcePowerup = require.sourcePowerup;
|
|
r0 = {type: 'active', statusText: Reflect.apply(formatToPlainString, intl, [WRRYUT,
|
|
{perkName: (sourcePowerup == null ? value2 : sourcePowerup.title) ?? intl2.string(t.BfF6ED)}])};
|
|
} else if (require.type === PowerupActiveStatusType.INACTIVE) {
|
|
r0 = value2;
|
|
} else {
|
|
object2 = {type: 'active'};
|
|
object2.statusText = intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).FFLkmx);
|
|
r0 = object2;
|
|
}
|
|
}
|
|
} else {
|
|
type = require.type;
|
|
value3 = environment.__proto__;
|
|
if (type === PowerupActiveStatusType.LEVEL_ACTIVATED) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
WRRYUT = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).WRRYUT;
|
|
sourcePowerup = require.sourcePowerup;
|
|
r0 = {type: 'active', statusText: Reflect.apply(formatToPlainString, intl, [WRRYUT,
|
|
{perkName: (sourcePowerup == null ? value2 : sourcePowerup.title) ?? intl2.string(t.BfF6ED)}])};
|
|
} else if (require.type === PowerupActiveStatusType.INACTIVE) {
|
|
r0 = value2;
|
|
} else {
|
|
object2 = {type: 'active'};
|
|
object2.statusText = intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).FFLkmx);
|
|
r0 = object2;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|