74 lines
4.0 KiB
TypeScript
74 lines
4.0 KiB
TypeScript
/* Metro module 10024; source: modules/wishlists/CollectiblesWishlistUtils.tsx; dependencies: [10025, 1904, 1244, 5134, 7630, 2] */
|
|
function _fun78295(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10210:6, offset: 0x01e24948, size: 156 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = (require(10025) /* metro dependency 10025: CollectiblesWishlistItemRecord */).isCollectiblesWishlistItemRecord;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/CollectiblesWishlistUtils.tsx');
|
|
exports.getProductNameAndTypeFromSku = getProductNameAndTypeFromSku;
|
|
exports.getProductNameAndTypeFromItem = function(a0) {
|
|
var isCollectiblesWishlistItemRecordBinding = isCollectiblesWishlistItemRecord;
|
|
var value2 = undefined;
|
|
return formatProductNameAndType(a0.skuName,
|
|
isCollectiblesWishlistItemRecordBinding(a0) ? a0.collectiblesItem == null ? value2 : a0.collectiblesItem.type : value2);
|
|
};
|
|
exports.isWishlistableCollectiblesProduct = isWishlistableCollectiblesProduct;
|
|
}
|
|
|
|
function formatProductNameAndType(a0, a1) { // fn#78296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10210:139, offset: 0x01e249e4, size: 313 bytes, params: 3, frame: 17
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const CollectiblesItemType = (require(1904) /* metro dependency 1904: CollectiblesItemType */).CollectiblesItemType;
|
|
const AVATAR_DECORATION = CollectiblesItemType.AVATAR_DECORATION;
|
|
if (AVATAR_DECORATION === a1) {
|
|
return intl.formatToPlainString(t.lvBzLi, {product: a0});
|
|
}
|
|
const PROFILE_EFFECT = CollectiblesItemType.PROFILE_EFFECT;
|
|
if (PROFILE_EFFECT === a1) {
|
|
return intl.formatToPlainString(t.eR7moP, {product: a0});
|
|
}
|
|
const NAMEPLATE = CollectiblesItemType.NAMEPLATE;
|
|
if (NAMEPLATE === a1) {
|
|
return intl.formatToPlainString(t.YFOwHj, {product: a0});
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function getProductNameAndTypeFromSku({name, tenantMetadata}) { // fn#78297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10210:673, offset: 0x01e24b1d, size: 62 bytes, params: 2, frame: 16
|
|
return formatProductNameAndType(name,
|
|
tenantMetadata == null || tenantMetadata.collectibles == null ? undefined : tenantMetadata.collectibles.type);
|
|
}
|
|
|
|
function isWishlistableCollectiblesProduct(a0) { // fn#78299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10210:1047, offset: 0x01e24b9c, size: 179 bytes, params: 2, frame: 16
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
const CollectiblesItemType = (require(1904) /* metro dependency 1904: CollectiblesItemType */).CollectiblesItemType;
|
|
var value3;
|
|
var value4;
|
|
var value;
|
|
const isPremiumCollectiblesProduct2 = (require(5134) /* metro dependency 5134: CollectiblesUtils */).isPremiumCollectiblesProduct(a0);
|
|
if (isPremiumCollectiblesProduct2) {
|
|
r0 = !isPremiumCollectiblesProduct2;
|
|
} else {
|
|
value3 = a0.type !== CollectiblesItemType.EXTERNAL_SKU;
|
|
if (value3) {
|
|
value4 = a0.type === CollectiblesItemType.PROFILE_FRAME;
|
|
if (value4) {
|
|
value = require(7630) /* metro dependency 7630: CollectiblesProfileFrameGiftingExperiment */;
|
|
value = !value.getIsProfileFrameGiftingEnabled('isWishlistableCollectiblesProduct');
|
|
r2 = value;
|
|
} else {
|
|
r2 = value4;
|
|
}
|
|
value = !r2;
|
|
r1 = value;
|
|
} else {
|
|
r1 = value3;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|