// Module ID: 9218 // Function ID: 9219 // Name: CollectiblesPreview // Dependencies: [19, 17, 5310, 676, 21, 4668, 9219, 712, 9242, 9243, 1949, 9255, 9245, 9262, 9264, 9265, 4100, 4107, 1370, 2] // Exports: default // Module 9218 (CollectiblesPreview) import ThemesDefault from "Themes" /* 712 */; import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1370 */; import CollectiblesItemType from "CollectiblesItemType" /* 1949 */; import map from "map" /* 4100 */; import ManaContext from "ManaContext" /* 4107 */; import SourceIcon from "SourceIcon" /* 9219 */; import firstAvatarDecoration from "firstAvatarDecoration" /* 9242 */; import BundleStaticPreviewContentDefault from "BundleStaticPreviewContent" /* 9243 */; import ProfileEffectSampleDefault from "ProfileEffectSample" /* 9245 */; import AvatarDecorationSampleV2Default from "AvatarDecorationSampleV2" /* 9255 */; import filterLayerDefault from "filterLayer" /* 9262 */; import NameplateCardPreviewDefault from "NameplateCardPreview" /* 9264 */; import SlayerStorefrontItemCardDefault from "SlayerStorefrontItemCard" /* 9265 */; import closure_3 from "noop" /* 19 */; import { View } from "get ActivityIndicator" /* 17 */; import { transformSKUToCollectiblesItem as closure_5 } from "createCollectiblesItemsFromServerResponse" /* 5310 */; import { SKUProductLines } from "ME" /* 676 */; import { jsx } from "jsxProd" /* 21 */; import createCacheKey from "createCacheKey" /* 4668 */; require = arg1; class CollectiblesPreview { constructor(arg0) { ({ collectiblesItemData, size } = global); if (size === undefined) { tmp = closure_0; tmp2 = closure_2; size = require("SourceIcon").DEFAULT_ITEM_SIZE; } size2 = size; if (typeof size === "number") { obj = { width: null, height: null }; obj[0] = size; obj[1] = size; size2 = obj; } tmp3 = closure_8(size2.width, size2.height); if ("bundle" === collectiblesItemData.type) { tmp18 = closure_0; tmp19 = closure_2; tmp20 = new.target; tmp21 = new.target; itemsSortingHat = new require("firstAvatarDecoration").ItemsSortingHat(collectiblesItemData.items); tmp23 = itemsSortingHat; tmp24 = jsx; tmp25 = View; obj1 = { style: null, children: null }; obj1[0] = tmp3.container; obj2 = { style: null, children: null }; items = [, ]; ({ scaler: arr2[0], bundleContainer: arr2[1] } = tmp3); obj2[0] = items; tmp26 = closure_1; obj3 = { deco: null, pfx: null, nameplate: null, size: "small", previewAssets: null, disableStaticBackground: true, targetSize: null }; ({ firstAvatarDecoration: obj15[0], firstProfileEffect: obj15[1], firstNameplate: obj15[2] } = itemsSortingHat); obj3[4] = collectiblesItemData.previewAssets; tmp27 = closure_9; obj3[6] = closure_9; obj2[1] = jsx(require("BundleStaticPreviewContent"), obj3); obj1[1] = jsx(View, obj2); return jsx(View, obj1); } else { type = collectiblesItemData.item.type; tmp28 = closure_0; tmp29 = closure_2; if (require("CollectiblesItemType").CollectiblesItemType.AVATAR_DECORATION === type) { tmp15 = jsx; tmp16 = View; obj4 = { style: null, children: null }; obj4[0] = tmp3.container; obj5 = { style: null, children: null }; obj5[0] = tmp3.scaler; tmp17 = closure_1; obj6 = { item: null, size: 100 }; obj6[0] = collectiblesItemData.item; obj5[1] = jsx(require("AvatarDecorationSampleV2"), obj6); obj4[1] = jsx(View, obj5); return jsx(View, obj4); } else if (require("CollectiblesItemType").CollectiblesItemType.PROFILE_EFFECT === type) { tmp12 = jsx; tmp13 = View; obj7 = { style: null, children: null }; obj7[0] = tmp3.container; obj8 = { style: null, children: null }; obj8[0] = tmp3.scaler; tmp14 = closure_1; obj9 = { item: null, hideBackground: true }; obj9[0] = collectiblesItemData.item; obj8[1] = jsx(require("ProfileEffectSample"), obj9); obj7[1] = jsx(View, obj8); return jsx(View, obj7); } else if (require("CollectiblesItemType").CollectiblesItemType.PROFILE_FRAME === type) { tmp8 = jsx; tmp9 = View; obj10 = { style: null, children: null }; obj10[0] = tmp3.container; obj11 = { style: null, children: null }; items1 = [, ]; ({ scaler: arr[0], profileFrameContainer: arr[1] } = tmp3); obj11[0] = items1; tmp10 = closure_1; obj12 = { profileFrame: null, previewWidth: null, previewHeight: null }; obj12[0] = collectiblesItemData.item; tmp11 = require("filterLayer"); obj12[1] = require("SourceIcon").DEFAULT_ITEM_SIZE - require("Themes").space.PX_48; obj12[2] = require("SourceIcon").DEFAULT_ITEM_SIZE; obj11[1] = jsx(tmp11, obj12); obj10[1] = jsx(View, obj11); return jsx(View, obj10); } else if (require("CollectiblesItemType").CollectiblesItemType.NAMEPLATE === type) { tmp5 = jsx; tmp6 = View; obj = { style: null, children: null }; obj[0] = tmp3.container; obj13 = { style: null, children: null }; obj13[0] = tmp3.scaler; tmp7 = closure_1; obj14 = { item: null }; obj14[0] = collectiblesItemData.item; obj13[1] = jsx(require("NameplateCardPreview"), obj14); obj[1] = jsx(View, obj13); return jsx(View, obj); } else { tmp4 = null; return null; } } } } function CollectiblesSKUPreview(sku) { sku = sku.sku; let DEFAULT_ITEM_SIZE = sku.size; if (DEFAULT_ITEM_SIZE === undefined) { DEFAULT_ITEM_SIZE = sku(9219).DEFAULT_ITEM_SIZE; } const items = [sku]; const memo = React.useMemo(() => closure_1_5(sku), items); let tmp4 = null; if (null != memo) { const obj = { collectiblesItemData: null, size: null }; obj[0] = memo; obj[1] = DEFAULT_ITEM_SIZE; tmp4 = ; } return tmp4; } class SocialLayerStorefrontSKUPreview { constructor(arg0) { DEFAULT_ITEM_SIZE = global.size; if (DEFAULT_ITEM_SIZE === undefined) { tmp = closure_0; tmp2 = closure_2; DEFAULT_ITEM_SIZE = require("SourceIcon").DEFAULT_ITEM_SIZE; } size = DEFAULT_ITEM_SIZE; if (typeof DEFAULT_ITEM_SIZE === "number") { obj = { width: null, height: null }; obj[0] = DEFAULT_ITEM_SIZE; obj[1] = DEFAULT_ITEM_SIZE; size = obj; } tmp3 = closure_8(size.width, size.height); obj = { sku: global.sku, containerStyle: tmp3.socialLayerStorefrontContainer }; return jsx(require("SlayerStorefrontItemCard"), obj); } } class PremiumSKUPreview { constructor(arg0) { DEFAULT_ITEM_SIZE = global.size; if (DEFAULT_ITEM_SIZE === undefined) { tmp = closure_0; tmp2 = closure_2; DEFAULT_ITEM_SIZE = require("SourceIcon").DEFAULT_ITEM_SIZE; } size = DEFAULT_ITEM_SIZE; if (typeof DEFAULT_ITEM_SIZE === "number") { obj = { width: null, height: null }; obj[0] = DEFAULT_ITEM_SIZE; obj[1] = DEFAULT_ITEM_SIZE; size = obj; } tmp3 = closure_8(size.width, size.height); obj = require("map"); obj1 = { style: tmp3.premiumRiveContainer, children: null }; token = obj.useToken(require("Themes").colors.TEXT_DEFAULT); obj1[1] = jsx(require("ManaContext").ThemeAwareNitroWishlistingWumpusRive, { dataBinding: { logoColor: token } }); return jsx(View, obj1); } } let closure_8 = createCacheKey.createStyles((width, height) => { let obj = { container: { width: "100%", height: "100%", display: "flex", justifyContent: "center", alignItems: "center" }, scaler: null, bundleContainer: null, socialLayerStorefrontContainer: null, profileFrameContainer: null, premiumRiveContainer: null }; obj = { width: SourceIcon.DEFAULT_ITEM_SIZE, height: SourceIcon.DEFAULT_ITEM_SIZE, justifyContent: "center", alignItems: "center", transform: null }; obj = { scaleX: width / SourceIcon.DEFAULT_ITEM_SIZE }; const items = [obj, { scaleY: height / SourceIcon.DEFAULT_ITEM_SIZE }]; obj[4] = items; obj[1] = obj; obj[2] = { paddingTop: 20 }; obj[3] = { width, height }; obj1 = { scaleY: height / SourceIcon.DEFAULT_ITEM_SIZE }; obj[4] = { padding: ThemesDefault.space.PX_8 }; obj[5] = { width, height }; return obj; }); createCacheKey = { width: require("SourceIcon").DEFAULT_ITEM_SIZE, height: require("SourceIcon").DEFAULT_ITEM_SIZE }; const result = require("set").fileFinishedImporting("modules/skus/native/SKUPreview.tsx"); export default function SKUPreview(arg0) { ({ sku, size } = arg0); if (size === undefined) { size = SourceIcon.DEFAULT_ITEM_SIZE; } const productLine = sku.productLine; if (SKUProductLines.COLLECTIBLES === productLine) { let obj = { sku: null, size: null }; obj[0] = sku; obj[1] = size; return ; } else if (tmp3.SOCIAL_LAYER_GAME_ITEM === productLine) { obj = { sku: null, size: null }; obj[0] = sku; obj[1] = size; return ; } else if (tmp3.PREMIUM === productLine) { obj1 = { size: null }; obj1[0] = size; return ; } else { if (tmp3.APPLICATION !== productLine) { if (tmp3.BOOST !== productLine) { if (tmp3.GUILD_ROLE !== productLine) { if (tmp3.GUILD_PRODUCT !== productLine) { obj = isDiscordFrontendDevelopment; obj.assertNever(sku.productLine); } } } } return null; } }; export { CollectiblesPreview }; export { SocialLayerStorefrontSKUPreview }; export { PremiumSKUPreview };