Files
2026-07-28 01:06:53 +03:00

310 lines
17 KiB
TypeScript

/* Metro module 14261; source: modules/collectibles/native/tooling/CollectiblesTool.tsx; dependencies: [57, 31, 27, 5121, 5145, 33, 4501, 697, 10020, 632, 7675, 4573, 14262, 1305, 4579, 7589, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import CollectiblesCategoryStore from '../../CollectiblesCategoryStore.tsx'; /* Metro dependency 5121 */
import CollectiblesPurchaseStore from '../../CollectiblesPurchaseStore.tsx'; /* Metro dependency 5145 */
import UseFetchCollectiblesCategoriesAndPurchases from '../../hooks/useFetchCollectiblesCategoriesAndPurchases.tsx'; /* Metro dependency 7675 */
import CollectiblesShopCardV2 from '../CollectiblesShopCardV2.tsx'; /* Metro dependency 10020 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as UseStateFromStoresModule from '../../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ShopSkipCategoriesFilterModule from './ShopSkipCategoriesFilter.tsx'; /* Metro dependency 14262 */
function _fun107867(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#107867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:6, offset: 0x0230bdfe, size: 1195 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.ScrollView;
const env0_6 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
const object3 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.padding = PX_16;
let PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object3.paddingBottom = PX_32;
object.scrollContainer = object3;
const object4 = {};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.padding = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.marginBottom = PX_16;
object4.borderWidth = 1;
let BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object4.borderColor = BORDER_MUTED;
object.section = object4;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.sectionHeader = {'flexDirection': 'row', 'alignItems': 'center', marginBottom: PX_16};
let TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object.sectionTitle = {flex: 1, color: TEXT_DEFAULT};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.inputContainer = {marginBottom: PX_16};
const object8 = {};
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object8.backgroundColor = BACKGROUND_BASE_LOW;
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object8.borderWidth = 1;
BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object8.borderColor = BORDER_MUTED;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object8.padding = PX_4;
object.inputWrapper = object8;
const object9 = {};
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object9.marginBottom = PX_8;
TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object9.color = TEXT_DEFAULT;
object9.fontWeight = '600';
object.inputLabel = object9;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.statusText = {'marginTop': null, 'fontSize': 12, 'fontWeight': '500', marginTop: PX_8};
const TEXT_FEEDBACK_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE;
object.statusSuccess = {color: TEXT_FEEDBACK_POSITIVE};
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
object.statusError = {color: TEXT_FEEDBACK_CRITICAL};
let TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object.statusLoading = {color: TEXT_MUTED};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.previewContainer = {marginBottom: PX_16};
const object13 = {backgroundColor: '#23a55a'};
object13.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object13.paddingVertical = PX_12;
object13.alignItems = 'center';
object.previewButton = object13;
const object14 = {};
const BACKGROUND_MOD_NORMAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_NORMAL;
object14.backgroundColor = BACKGROUND_MOD_NORMAL;
object14.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object14.borderWidth = 2;
object14.borderStyle = 'dashed';
BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object14.borderColor = BORDER_MUTED;
PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object14.padding = PX_32;
object14.alignItems = 'center';
object14.justifyContent = 'center';
object14.minHeight = 120;
object.placeholder = object14;
TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object.placeholderText = {'color': null, 'textAlign': 'center', 'fontSize': 14, color: TEXT_MUTED};
const env0_11 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/native/tooling/CollectiblesTool.tsx');
exports.default = _default_107872;
function UnpurchasedCollectiblesShopCardV2(a0) { // fn#107868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:1841, offset: 0x0230c2a9, size: 119 bytes, params: 2, frame: 18
const [property, env0_0] = Module00057(ReactModule.useState(0), 2);
ReactModule.useLayoutEffect(_fun107869, []);
return ((Component) => <Component {...a0} key={property} />)(CollectiblesShopCardV2);
function _fun107869() { // fn#107869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:1914, offset: 0x0230c320, size: 68 bytes, params: 1, frame: 12
let collectiblesPurchaseStoreBinding = CollectiblesPurchaseStore;
const getPurchase = collectiblesPurchaseStoreBinding.getPurchase;
collectiblesPurchaseStoreBinding.getPurchase = function() {
};
collectiblesPurchaseStoreBinding.emitChange();
getPurchase(1);
return function() {
var collectiblesPurchaseStoreBinding = CollectiblesPurchaseStore;
collectiblesPurchaseStoreBinding.getPurchase = getPurchase;
collectiblesPurchaseStoreBinding.emitChange();
};
}
}
function _default_107872() { // fn#107872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:2060, offset: 0x0230c386, size: 1614 bytes, params: 1, frame: 39
const styles = useStyles();
const useStateFromStores = UseStateFromStoresModule.useStateFromStores;
const collectiblesCategoryStoreBinding = CollectiblesCategoryStore;
const categories = Reflect.apply(useStateFromStores, UseStateFromStoresModule, [[collectiblesCategoryStoreBinding],
function() {
return CollectiblesCategoryStore.categories;
}]);
const r5 = categories.size > 0 && UseStateFromStoresModule.useStateFromStores([CollectiblesPurchaseStore],
function() {
return CollectiblesPurchaseStore.purchases;
}).size > 0 && UseStateFromStoresModule.useStateFromStores([collectiblesCategoryStoreBinding], function() {
return CollectiblesCategoryStore.lastSuccessfulFetch;
}) != null;
const value5 = (UseFetchCollectiblesCategoriesAndPurchases)({'logPerf': false,
'stalePurchasesOK': true, noOp: r5});
let r14 = r5 || !value5.isFetching && (r5 ? categories : value5.categories).size > 0;
const binding = env0_4;
let useState = binding.useState;
const value8 = Reflect.apply(useState, binding, ['']);
const binding2 = env0_3;
const value9 = binding2(value8, 2);
const property = value9[0];
const property2 = value9[1];
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property3 = value10[0];
var env0_3 = value10[1];
useState = binding.useState;
const value11 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property4 = value11[0];
var env0_4 = value11[1];
binding.useEffect(_fun107876, [property, r14]);
let section = styles.section;
const Text = (TextModule).Text;
const view = (
<View style={styles.sectionHeader}>
<Text variant="heading-md/semibold" style={styles.sectionTitle}>
{'Shop Settings'}
</Text>
</View>
);
const ShopSkipCategoriesFilter = (ShopSkipCategoriesFilterModule).ShopSkipCategoriesFilter;
const items2 = [
<View style={section}>
{view}
<ShopSkipCategoriesFilter />
</View>,
];
section = styles.section;
const view2 = (
<View style={styles.sectionHeader}>
<Text variant="heading-md/semibold" style={styles.sectionTitle}>
{'Product Configuration'}
</Text>
</View>
);
const items4 = [
<Text variant="text-md/semibold" style={styles.inputLabel}>
{'Primary Product SKU ID'}
</Text>,
];
const TextInput = (NativeModule).TextInput;
const PX_12 = (Native).space.PX_12;
items4[1] = (
<View style={styles.inputWrapper}>
<TextInput
value={property}
onChangeText={property2}
placeholder="Enter product SKU ID (e.g., 1366494385482502184)"
returnKeyType="done"
style={{fontSize: 14, padding: PX_12}}
/>
</View>
);
items4[2] = !r14 && property.trim() !== '' && <Text variant="text-xs/normal" style={[styles.statusText,
styles.statusLoading]}>{'Loading products...'}</Text>;
r14 = r14 && property.trim() !== '' && property3 == null && <Text variant="text-xs/normal" style={[styles.statusText,
styles.statusError]}>{'Product not found'}</Text>;
items4[3] = r14;
items4[4] = property3 != null && <Text variant="text-xs/normal" style={[styles.statusText,
styles.statusSuccess]}>{'Found: '}{property3.name}</Text>;
items2[1] = (
<View style={section}>
{view2}
<View style={styles.inputContainer}>
{items4}
</View>
</View>
);
items2[2] = (
<View style={styles.section}>
<View style={styles.sectionHeader}>
<Text variant="heading-md/semibold" style={styles.sectionTitle}>
{'Product Preview'}
</Text>
</View>
{
property3 == null
? (
<View style={styles.placeholder}>
<Text variant="text-sm/normal" style={styles.placeholderText}>
{'Enter a valid product SKU ID above'}
{'\n'}
{'to see the product preview'}
</Text>
</View>
)
: (
property4 != null
? (
<View>
<View style={styles.previewContainer}>
<UnpurchasedCollectiblesShopCardV2 product={property3} />
</View>
{((BaseTextButton) => <BaseTextButton pillStyle={styles.previewButton} text="Show Collectibles Modal" onPress={onPress_107877} />)((require(4579) /* metro dependency 4579: BaseTextButtonNative */).BaseTextButton)}
</View>
)
: (
<View style={styles.placeholder}>
<Text variant="text-sm/normal" style={styles.placeholderText}>
{'Enter a valid product SKU ID above'}
{'\n'}
{'to see the product preview'}
</Text>
</View>
)
)
}
</View>
);
return (
<View style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollContainer} showsVerticalScrollIndicator={false}>
{items2}
</ScrollView>
</View>
);
function _fun107876() { // fn#107876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:2522, offset: 0x0230ca01, size: 151 bytes, params: 1, frame: 14
var value3;
var collectiblesCategoryStoreBinding;
var product;
var categoryForProduct;
if (env0_1.trim() !== '') {
if (env0_0) {
value3 = environment.__proto__;
collectiblesCategoryStoreBinding = CollectiblesCategoryStore;
product = collectiblesCategoryStoreBinding.getProduct(env0_1);
categoryForProduct = collectiblesCategoryStoreBinding.getCategoryForProduct(env0_1);
if (product == null) {
env0_3(null);
env0_4(null);
} else if (categoryForProduct != null) {
env0_3(product);
env0_4(categoryForProduct);
} else {
env0_3(null);
env0_4(null);
}
return undefined;
}
}
env0_3(null);
env0_4(null);
}
function _default_107872OnPress() { // fn#107877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14458:4304, owner: _default_107872.onPress, offset: 0x0230ca98, size: 71 bytes, params: 1, frame: 12
var value2;
var defaultImport;
if (env0_2 != null) {
value2 = environment.__proto__;
defaultImport = importDefault(7589) /* metro dependency 7589: ProductPurchaseSuccessActionCreators */;
defaultImport.open({product: env0_2, useCategoryImage: true});
}
}
}
}
global.__d(_fun107867, 14261, [57, 31, 27, 5121, 5145, 33, 4501, 697, 10020, 632, 7675, 4573, 14262, 1305, 4579,
7589,
2]) /* metro module 14261, dependencies: [57, 31, 27, 5121, 5145, 33, 4501, 697, 10020, 632, 7675, 4573, 14262, 1305, 4579, 7589, 2] */;