212 lines
13 KiB
TypeScript
212 lines
13 KiB
TypeScript
/* Metro module 7639; source: modules/checkout/native/gifting/UnifiedGiftModalDetailsScreen.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 1484, 7638, 6771, 6518, 491, 683, 7640, 7641, 4573, 1244, 7678, 7679, 7680, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AnalyticsUtils from '../../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import UseInitialValue from '../../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
|
|
import UseAnalyticsLocations from '../../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as Module00491Module from '../../../../by-id/module-00491.js'; /* Metro dependency 491 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as UnifiedGiftModalTypesModule from './UnifiedGiftModalTypes.tsx'; /* Metro dependency 7638 */
|
|
import * as UseGiftStylesModule from '../../../premium/gifting/hooks/useGiftStyles.tsx'; /* Metro dependency 7640 */
|
|
import * as PremiumGiftBackgroundSelectModule from '../../../premium/native/gifting/PremiumGiftBackgroundSelect.tsx'; /* Metro dependency 7641 */
|
|
import * as PremiumGiftCustomMessageModule from '../../../premium/native/gifting/PremiumGiftCustomMessage.tsx'; /* Metro dependency 7680 */
|
|
|
|
function _fun61166(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:6, offset: 0x0171c792, size: 421 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object.container = {'flex': 1, 'paddingTop': null, 'alignItems': 'stretch', paddingTop: PX_12};
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object.scrollView = {paddingBottom: PX_24};
|
|
const object4 = {};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object4.marginTop = PX_24;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.marginBottom = PX_8;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.paddingHorizontal = PX_16;
|
|
object4.textTransform = 'capitalize';
|
|
object.sectionHeader = object4;
|
|
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
value = value.memo(_fun61167);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/checkout/native/gifting/UnifiedGiftModalDetailsScreen.tsx');
|
|
exports.default = value;
|
|
function _fun61167({skuId, applicationId, recipientUser, setRecipientUser, lockedRecipient, validateRecipient, renderProductDetails, renderPurchaseSection}) { // fn#61167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:499, offset: 0x0171c937, size: 1086 bytes, params: 2, frame: 43
|
|
const validateRecipient2 = validateRecipient;
|
|
const styles = useStyles();
|
|
const value2 = (UseNavigationNativeModule).useNavigation();
|
|
const binding = value2;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [true]);
|
|
const binding2 = validateRecipient2;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const env0_5 = value4[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value5[0];
|
|
const env0_6 = value5[1];
|
|
const value6 = binding.useCallback(_fun61168, [value2]);
|
|
const value8 = binding.useMemo(_fun61170,
|
|
[(UseAnalyticsLocations)().analyticsLocations, skuId,
|
|
applicationId, (UseInitialValue)(_fun61169)]);
|
|
binding.useEffect(_fun61171, [recipientUser, skuId, validateRecipient]);
|
|
binding.useEffect(_fun61174, [value8]);
|
|
const value9 = (UseGiftStylesModule).useGiftStyles();
|
|
useState = binding.useState;
|
|
const value10 = binding2(Reflect.apply(useState, binding, [value9[0]]), 2);
|
|
const property3 = value10[0];
|
|
const property4 = value10[1];
|
|
const value11 = binding.useRef(null);
|
|
useState = binding.useState;
|
|
const value12 = binding2(Reflect.apply(useState, binding, [0]), 2);
|
|
const property5 = value12[0];
|
|
const property6 = value12[1];
|
|
useState = binding.useState;
|
|
const value13 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
|
|
const property7 = value13[0];
|
|
const property8 = value13[1];
|
|
const value14 = binding.useCallback(function() {
|
|
global.setTimeout(_fun61176, 100);
|
|
}, [property5]);
|
|
const value15 = binding.useMemo(_fun61177, [property3, recipientUser, property7]);
|
|
const GiftBackgroundSelect = (PremiumGiftBackgroundSelectModule).GiftBackgroundSelect;
|
|
const items3 = [
|
|
<GiftBackgroundSelect
|
|
giftStyle={property3}
|
|
setGiftStyle={property4}
|
|
withConsistentHeight={false}
|
|
/>,
|
|
];
|
|
const Text = (TextModule).Text;
|
|
let sectionHeader = styles.sectionHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
items3[1] = (
|
|
<Text variant="text-sm/semibold" style={sectionHeader}>
|
|
{Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.xFn72s])}
|
|
</Text>
|
|
);
|
|
items3[2] = (
|
|
lockedRecipient && recipientUser != null
|
|
? ((Component) => <Component user={recipientUser} />)(importDefault(7678) /* metro dependency 7678: LockedRecipientField */)
|
|
: ((Component) => <Component selectedUser={recipientUser} onPress={value6} setSelectedUser={setRecipientUser} />)(importDefault(7679) /* metro dependency 7679: SelectedUserField */)
|
|
);
|
|
sectionHeader = styles.sectionHeader;
|
|
string = intl.string;
|
|
const PpoJzt = (require(1244) /* metro dependency 1244: indexNative */).t.PpoJzt;
|
|
items3[3] = (
|
|
<Text variant="text-sm/semibold" style={sectionHeader}>
|
|
{Reflect.apply(string, intl, [PpoJzt])}
|
|
</Text>
|
|
);
|
|
items3[4] = renderProductDetails({recipientUser: recipientUser, isValidRecipient: property});
|
|
const GiftCustomMessage = (PremiumGiftCustomMessageModule).GiftCustomMessage;
|
|
items3[5] = (
|
|
<GiftCustomMessage
|
|
onFocusMessage={value14}
|
|
setMessagePosition={property6}
|
|
customGiftMessage={property7}
|
|
setCustomGiftMessage={property8}
|
|
/>
|
|
);
|
|
const items2 = [
|
|
<ScrollView
|
|
ref={value11}
|
|
contentContainerStyle={styles.scrollView}
|
|
showsVerticalScrollIndicator={false}
|
|
>
|
|
{items3}
|
|
</ScrollView>,
|
|
];
|
|
let r9 = recipientUser == null || property2;
|
|
r9 = !r9 ? !property : r9;
|
|
items2[1] = renderPurchaseSection({isPurchaseDisabled: r9, giftOptions: value15, baseAnalyticsFields: value8});
|
|
return (
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun61168() { // fn#61168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:788, offset: 0x0171cd75, size: 57 bytes, params: 1, frame: 13
|
|
const binding = env0_4;
|
|
const navigate = binding.navigate;
|
|
const UnifiedGiftModalScreens = (UnifiedGiftModalTypesModule).UnifiedGiftModalScreens;
|
|
const RECIPENT_SELECT = UnifiedGiftModalScreens.RECIPENT_SELECT;
|
|
Reflect.apply(navigate, binding, [RECIPENT_SELECT]);
|
|
}
|
|
|
|
function _fun61169() { // fn#61169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:903, offset: 0x0171cdae, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (Module00491Module).v4();
|
|
}
|
|
|
|
function _fun61170() { // fn#61170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:936, offset: 0x0171cdd3, size: 56 bytes, params: 1, frame: 3
|
|
return {'is_gift': true, 'location_stack': null, 'payment_type': 'sku', location_stack: analyticsLocations,
|
|
sku_id: skuId, application_id: applicationId, load_id: JsxRuntimeModule.jsx};
|
|
}
|
|
|
|
function _fun61171() { // fn#61171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1052, offset: 0x0171ce0b, size: 88 bytes, params: 1, frame: 14
|
|
var value;
|
|
env0_5(true);
|
|
if (recipientUser != null) {
|
|
env0_6(true);
|
|
value = validateRecipient(recipientUser.id);
|
|
value = value.then(_fun61172);
|
|
value.finally(_fun61173);
|
|
}
|
|
function _fun61172(a0) { // fn#61172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1093, offset: 0x00e76efe, size: 19 bytes, params: 2, frame: 11
|
|
env1_5(a0);
|
|
}
|
|
|
|
function _fun61173() { // fn#61173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1114, offset: 0x0171ce63, size: 18 bytes, params: 1, frame: 11
|
|
env1_6(false);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun61174() { // fn#61174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1153, offset: 0x0171ce75, size: 108 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
const defaultImport = AnalyticsUtils;
|
|
let track = defaultImport.track;
|
|
const PAYMENT_FLOW_STARTED = AnalyticEvents.PAYMENT_FLOW_STARTED;
|
|
Reflect.apply(track, defaultImport, [PAYMENT_FLOW_STARTED, JsxRuntimeModule.jsxs]);
|
|
value = defaultImport;
|
|
track = value.track;
|
|
const PAYMENT_FLOW_LOADED = AnalyticEvents.PAYMENT_FLOW_LOADED;
|
|
const object = {};
|
|
copyDataProperties(object, JsxRuntimeModule.jsxs, defaultImport);
|
|
object['initial_step'] = 'gift_customization';
|
|
Reflect.apply(track, value, [PAYMENT_FLOW_LOADED, object]);
|
|
}
|
|
|
|
function _fun61175() { // fn#61175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1475, offset: 0x0171cee1, size: 28 bytes, params: 1, frame: 13
|
|
global.setTimeout(_fun61176, 100);
|
|
function _fun61176() { // fn#61176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1492, offset: 0x0171cefd, size: 53 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return env1_11.current?.scrollTo({y: env1_12, animated: true});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun61177() { // fn#61177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7817:1594, offset: 0x0171cf32, size: 54 bytes, params: 1, frame: 4
|
|
return {gift_style: env0_10, recipient_id: recipientUser?.id, custom_message: env0_13};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun61166, 7639, [57, 31, 27, 661, 33, 4501, 697, 1484, 7638, 6771, 6518, 491, 683, 7640, 7641, 4573,
|
|
1244, 7678, 7679, 7680,
|
|
2]) /* metro module 7639, dependencies: [57, 31, 27, 661, 33, 4501, 697, 1484, 7638, 6771, 6518, 491, 683, 7640, 7641, 4573, 1244, 7678, 7679, 7680, 2] */;
|