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

219 lines
13 KiB
TypeScript

/* Metro module 12281; source: components_native/premium/OutboundPromotionCard.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 6235, 6275, 6758, 1244, 4573, 6622, 4048, 7286, 12282, 4496, 12283, 1962, 7289, 4578, 6766, 4080, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseTheme from '../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
import AlertActionCreators from '../../actions/native/AlertActionCreators.tsx'; /* Metro dependency 4496 */
import MarkupUtils from '../../modules/markup/MarkupUtils.tsx'; /* Metro dependency 6622 */
import UseOutboundPromotionRedemptionEndDate from '../../modules/premium/hooks/useOutboundPromotionRedemptionEndDate.tsx'; /* Metro dependency 12282 */
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 ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as LegacyTokensModule from '../../design/migrations/native/LegacyTokens.tsx'; /* Metro dependency 6235 */
import * as BottomSheetNativeModule from '../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as BottomSheetTitleHeaderNativeModule from '../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
import * as TextWithIOSLinkWorkaroundModule from '../../modules/a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as PromotionUtilsModule from '../../modules/premium/promotions/PromotionUtils.tsx'; /* Metro dependency 7286 */
function _fun93833(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:6, offset: 0x020c603e, size: 529 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.View;
const env0_6 = value.Image;
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = (ConstantsModule).USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object2 = {'flex': 1, 'flexDirection': 'column', 'paddingHorizontal': null, 'paddingVertical': 12,
'backgroundColor': null, 'marginTop': 8};
object2.paddingHorizontal = USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.backgroundColor = BACKGROUND_BASE_LOW;
object.card = object2;
object.mainContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center',
'justifyContent': 'space-between'};
object.textContainer = {'flexDirection': 'row', 'flexShrink': 1, 'alignItems': 'center'};
const object3 = {'width': 32, 'height': 32, 'marginRight': 8, 'borderRadius': null, 'alignItems': 'center',
'justifyContent': 'center'};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
const DARK_BLACK_500_LIGHT_PRIMARY_100 = (LegacyTokensModule).DARK_BLACK_500_LIGHT_PRIMARY_100;
object3.backgroundColor = DARK_BLACK_500_LIGHT_PRIMARY_100;
object.imageContainer = object3;
object.image = {'width': 28, 'height': 28, 'resizeMode': 'contain'};
object.title = {lineHeight: 20};
object.subText = {lineHeight: 18};
object.claimButton = {paddingHorizontal: 12};
object.moreDetails = {marginLeft: 40};
object.termsAndConditionsText = {'paddingHorizontal': 16, 'paddingTop': 16};
object.buttonContainer = {'flexGrow': 1, 'flexDirection': 'row', 'marginLeft': 4, 'justifyContent': 'flex-end'};
const env0_9 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('components_native/premium/OutboundPromotionCard.tsx');
exports.default = OutboundPromotionCard;
function TermsAndConditionsActionSheet({termsAndConditions}) { // fn#93834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1039, offset: 0x020c624f, size: 246 bytes, params: 2, frame: 25
const styles = useStyles();
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const object = {};
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const PdKWVT = (IndexNativeModule).t.PdKWVT;
object.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [PdKWVT])} />;
const Text = (TextModule).Text;
return (
<BottomSheet {...object}>
<Text style={styles.termsAndConditionsText} variant="text-sm/medium">
{(MarkupUtils).parse(termsAndConditions, false,
{allowLinks: true})}
</Text>
</BottomSheet>
);
}
function OutboundPromotionCard({outboundPromotion, code}) { // fn#93835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1369, offset: 0x020c6345, size: 927 bytes, params: 2, frame: 32
var env0_3Binding = undefined;
const styles = useStyles();
const promotionImageURL = (PromotionUtilsModule).getPromotionImageURL(outboundPromotion.id,
(UseTheme)());
const value4 = code != null;
const value5 = (UseOutboundPromotionRedemptionEndDate)(outboundPromotion,
value4);
const intl = (IndexNativeModule).intl;
const formatToPlainString = intl.formatToPlainString;
const t = (IndexNativeModule).t;
const r21 = value4 ? Reflect.apply(formatToPlainString, intl, [t.VaD05h,
{endDate: value5}]) : Reflect.apply(formatToPlainString, intl, [t['/XWgfG'], {endDate: value5}]);
const string = intl.string;
const r20 = value4 ? Reflect.apply(string, intl, [t['2cHUti']]) : Reflect.apply(string, intl, [t.O13yhz]);
var [property, env0_3] = env0_3Binding(ReactModule.useState(false), 2);
ReactModule.useLayoutEffect(_fun93836, [property, code, outboundPromotion]);
const items2 = [
<View style={styles.imageContainer}>
<Image style={styles.image} source={{uri: promotionImageURL}} />
</View>,
];
const Text = (TextModule).Text;
items2[1] = (
<View style={styles.textContainer}>
<View>
<Text
style={styles.title}
accessibilityRole="header"
variant="text-md/semibold"
color="mobile-text-heading-primary"
>
{outboundPromotion.outboundTitle}
</Text>
<Text
style={styles.subText}
variant="text-sm/medium"
color="text-default"
>
{r21}
</Text>
</View>
</View>
);
const Button = (ButtonNativeModule).Button;
items2[2] = (
<View style={styles.buttonContainer}>
<View style={styles.claimButton}>
<Button
size="sm"
shrink
text={r20}
onPress={onPress_93841}
/>
</View>
</View>
);
const view = (
<View style={styles.mainContainer}>
{items2}
</View>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
return (
<View style={styles.card}>
{view}
<View>
<TextWithIOSLinkWorkaround style={styles.moreDetails} variant="text-sm/medium">
{intl.format((IndexNativeModule).t.sCm3Zb,
{onClick: onClick_93842})}
</TextWithIOSLinkWorkaround>
</View>
</View>
);
function _fun93836() { // fn#93836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1809, offset: 0x020c66e4, size: 66 bytes, params: 1, frame: 12
var environment;
var value;
if (env0_2) {
value = environment.__proto__;
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
value.openLazy({importer: importer_93837});
}
function importer_93837() { // fn#93837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1845, offset: 0x020c6726, size: 64 bytes, params: 1, frame: 13
var environment;
let value = environment.__proto__.__proto__;
value = require(dependencyMap[18]);
value = value(dependencyMap[17], dependencyMap.paths);
return value.then(function({default: env0_0}) {
return _fun93839;
});
function _fun93838({default: env0_0}) { // fn#93838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1879, offset: 0x020c6766, size: 23 bytes, params: 2, frame: 2
return _fun93839;
function _fun93839(a0) { // fn#93839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1894, offset: 0x020c677d, size: 120 bytes, params: 2, frame: 16
const binding = env0_0;
const bindingProps = {...a0};
bindingProps['onCancel'] = onCancel_93840;
bindingProps['onClaim'] = (importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).addClaimedOutboundPromotionCode;
bindingProps['code'] = code;
bindingProps['outboundPromotion'] = outboundPromotion;
return ((Component) => <Component {...bindingProps} />)(binding);
function onCancel_93840() { // fn#93840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:1916, offset: 0x020c67f5, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
(AlertActionCreators).close();
value = environment.__proto__.__proto__.__proto__.__proto__;
env4_3(false);
}
}
}
}
}
function OutboundPromotionCardOnPress() { // fn#93841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:2600, owner: OutboundPromotionCard.onPress, offset: 0x020c6828, size: 18 bytes, params: 1, frame: 11
return env0_3(true);
}
function OutboundPromotionCardOnClick() { // fn#93842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12467:2773, owner: OutboundPromotionCard.onClick, offset: 0x020c683a, size: 117 bytes, params: 1, frame: 17
var environment;
let value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
const openLazy = value.openLazy;
const outboundPromotionBinding = outboundPromotion;
Reflect.apply(openLazy, value, [function() {
var Promise = global.Promise;
return Promise.resolve(TermsAndConditionsActionSheet);
}, 'OutboundPromotionTermsAndConditions-' + outboundPromotionBinding.id,
{termsAndConditions: outboundPromotionBinding.outboundTermsAndConditions}]);
}
}
}
global.__d(_fun93833, 12281, [57, 31, 27, 661, 33, 4501, 697, 6235, 6275, 6758, 1244, 4573, 6622, 4048, 7286, 12282,
4496, 12283, 1962, 7289, 4578, 6766, 4080,
2]) /* metro module 12281, dependencies: [57, 31, 27, 661, 33, 4501, 697, 6235, 6275, 6758, 1244, 4573, 6622, 4048, 7286, 12282, 4496, 12283, 1962, 7289, 4578, 6766, 4080, 2] */;