235 lines
13 KiB
TypeScript
235 lines
13 KiB
TypeScript
/* Metro module 7534; source: modules/premium/native/PremiumPlanWhatYouLoseActionSheet.tsx; dependencies: [31, 27, 1880, 33, 4501, 697, 5475, 4573, 3802, 6771, 7535, 44, 7540, 1244, 7541, 7542, 7543, 7544, 4080, 6275, 7046, 4578, 7294, 2] */
|
|
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import FastImage from '../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import PremiumPlanActionSheetHeader from './PremiumPlanActionSheetHeader.tsx'; /* Metro dependency 7046 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
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 BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as WhatYouLoseProfileTier1Module from '../../../design/components/Illustration/native/redesign/generated/WhatYouLoseProfileTier1.tsx'; /* Metro dependency 7535 */
|
|
|
|
function _fun60614(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:6, offset: 0x01708183, size: 511 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {body: {'paddingTop': 24, 'paddingHorizontal': 24}};
|
|
let MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object.title = {marginBottom: 8, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object.subtitle = {marginBottom: 16, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
const object4 = {'marginBottom': 16, 'borderRadius': null, 'display': 'flex', 'flexDirection': 'column',
|
|
'justifyContent': 'center', 'alignItems': 'center', 'backgroundColor': null, 'padding': 16};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object4.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object.item = object4;
|
|
object.itemLabel = {marginTop: 8};
|
|
object.footer = {paddingHorizontal: 16};
|
|
object.button = {marginBottom: 8};
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
object.keepText = {'textAlign': 'center', 'paddingVertical': 8, color: TEXT_SUBTLE};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object]);
|
|
object = {DOWNGRADE: 0};
|
|
object[0] = 'DOWNGRADE';
|
|
object.CANCEL = 1;
|
|
object[1] = 'CANCEL';
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/native/PremiumPlanWhatYouLoseActionSheet.tsx');
|
|
exports.default = _default_60616;
|
|
exports.WhatYouLoseMode = object;
|
|
function WhatYouLoseItem({imageSource, text}) { // fn#60615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:762, offset: 0x01708382, size: 157 bytes, params: 2, frame: 21
|
|
const styles = useStyles();
|
|
const value2 = ((Component) => <Component source={imageSource} />)(FastImage);
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={styles.item}>
|
|
{value2}
|
|
<Text variant="text-md/medium" style={styles.itemLabel}>
|
|
{text}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _default_60616({mode, onContinue, subscription}) { // fn#60616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:1021, offset: 0x0170841f, size: 1037 bytes, params: 2, frame: 34
|
|
var r16;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
var Qk34Ik;
|
|
var object3;
|
|
var jh5mUz;
|
|
var object4;
|
|
const styles = useStyles();
|
|
const premiumTypeFromSubscription = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeFromSubscription(subscription);
|
|
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
|
|
const value3 = (WhatYouLoseProfileTier1Module).useWhatYouLoseProfileTier1Source();
|
|
(Module00044)(premiumTypeFromSubscription != null, 'Expected premium type');
|
|
const value4 = analyticsLocations.useMemo(_fun60618, [premiumTypeFromSubscription, value3]);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const items3 = [
|
|
((Component) => <Component premiumType={premiumTypeFromSubscription} />)(PremiumPlanActionSheetHeader),
|
|
|
|
];
|
|
const Text = (TextModule).Text;
|
|
let CANCEL = env0_10.CANCEL;
|
|
const items2 = [
|
|
<Text variant="heading-xl/extrabold" style={styles.title}>
|
|
{mode === CANCEL ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PWq8TL) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7VcWW0'])}
|
|
</Text>,
|
|
];
|
|
CANCEL = env0_10.CANCEL;
|
|
if (mode === CANCEL) {
|
|
format = intl.format;
|
|
jh5mUz = (require(1244) /* metro dependency 1244: indexNative */).t.jh5mUz;
|
|
object4 = {};
|
|
object4.subscriptionName = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeDisplayName(premiumTypeFromSubscription,
|
|
|
|
true);
|
|
r16 = Reflect.apply(format, intl, [jh5mUz, object4]);
|
|
} else {
|
|
format = intl.format;
|
|
Qk34Ik = (require(1244) /* metro dependency 1244: indexNative */).t.Qk34Ik;
|
|
object3 = {};
|
|
object3.subscriptionName = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeDisplayName(premiumTypeFromSubscription,
|
|
|
|
true);
|
|
r16 = Reflect.apply(format, intl, [Qk34Ik, object3]);
|
|
}
|
|
items2[1] = (
|
|
<Text variant="text-md/medium" style={styles.subtitle}>
|
|
{r16}
|
|
</Text>
|
|
);
|
|
items2[2] = value4.map(_fun60619);
|
|
items3[1] = (
|
|
<View style={styles.body}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
items3[2] = (
|
|
<View style={styles.footer}>
|
|
<View style={styles.button}>
|
|
<Button
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3PatSz'])}
|
|
grow
|
|
onPress={function() {
|
|
var property = require(dependencyMap[22]).STEP_ANALYTICS_NAMES;
|
|
property = property[require(dependencyMap[22]).CancellationFlowSteps.WHAT_YOU_LOSE];
|
|
onContinue(property);
|
|
_default_60616OnClose();
|
|
}}
|
|
/>
|
|
</View>
|
|
<Text
|
|
variant="text-sm/medium"
|
|
style={styles.keepText}
|
|
onPress={onPress_60621}
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rzVN6j)}
|
|
</Text>
|
|
</View>
|
|
);
|
|
return (
|
|
<BottomSheet>
|
|
{items3}
|
|
</BottomSheet>
|
|
);
|
|
function _default_60616OnClose() { // fn#60617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:1930, owner: _default_60616.onClose, offset: 0x0170882c, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
}
|
|
|
|
function _fun60618() { // fn#60618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:1252, offset: 0x01708851, size: 733 bytes, params: 1, frame: 22
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
var format;
|
|
const t = (IndexNativeModule).t;
|
|
var property;
|
|
var items4;
|
|
var items2;
|
|
var items3;
|
|
const binding = env0_2;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
if (TIER_0 === binding) {
|
|
object = {};
|
|
object.imageSource = importDefault(7540) /* metro dependency 7540 */;
|
|
object.text = intl.format(t['0hUHi6'], {});
|
|
items3 = [object];
|
|
object = {imageSource: importDefault(7541) /* metro dependency 7541 */};
|
|
object.text = intl.format(t.wFWO6D, {});
|
|
items3[1] = object;
|
|
return items3;
|
|
}
|
|
const TIER_1 = PremiumTypes.TIER_1;
|
|
if (TIER_1 === binding) {
|
|
items2 = [{imageSource: ReactNativeModule.View, text: intl.format(t.xCaYwE, {})}];
|
|
object = {};
|
|
object.imageSource = importDefault(7542) /* metro dependency 7542 */;
|
|
object.text = intl.format(t.wK04T1, {});
|
|
items2[1] = object;
|
|
object = {imageSource: importDefault(7543) /* metro dependency 7543 */};
|
|
object.text = intl.format(t.K4Hv69, {});
|
|
items2[2] = object;
|
|
return items2;
|
|
}
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
if (TIER_2 === binding) {
|
|
object = {};
|
|
object.imageSource = importDefault(7544) /* metro dependency 7544 */;
|
|
format = intl.format;
|
|
property = t['gpqr+n'];
|
|
object.text = Reflect.apply(format, intl, [property, {}]);
|
|
items4 = [object];
|
|
object = {imageSource: importDefault(7543) /* metro dependency 7543 */};
|
|
object.text = intl.format(t.wRxEDW, {});
|
|
items4[1] = object;
|
|
object = {imageSource: importDefault(7542) /* metro dependency 7542 */};
|
|
format = intl.format;
|
|
property = t['4WZ7T2'];
|
|
object.text = Reflect.apply(format, intl, [property, {}]);
|
|
items4[2] = object;
|
|
return items4;
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function _fun60619(a0, a1) { // fn#60619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:2528, offset: 0x01708b2e, size: 37 bytes, params: 3, frame: 15
|
|
return <WhatYouLoseItem {...a0} key={a1} />;
|
|
}
|
|
|
|
function _default_60616OnPress_60621() { // fn#60621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:2926, owner: _default_60616.onPress, offset: 0x01708ba1, size: 121 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */;
|
|
const trackPremiumSubscriptionCancellationFlowStep = value.trackPremiumSubscriptionCancellationFlowStep;
|
|
const object = {};
|
|
object.subscription = subscription;
|
|
object.analyticsLocations = analyticsLocations;
|
|
const STEP_ANALYTICS_NAMES = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).STEP_ANALYTICS_NAMES;
|
|
const CancellationFlowSteps = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).CancellationFlowSteps;
|
|
const WHAT_YOU_LOSE = CancellationFlowSteps.WHAT_YOU_LOSE;
|
|
object.fromStep = STEP_ANALYTICS_NAMES[WHAT_YOU_LOSE];
|
|
object.toStep = null;
|
|
Reflect.apply(trackPremiumSubscriptionCancellationFlowStep, value, [object]);
|
|
_default_60616OnClose();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun60614, 7534, [31, 27, 1880, 33, 4501, 697, 5475, 4573, 3802, 6771, 7535, 44, 7540, 1244, 7541, 7542,
|
|
7543, 7544, 4080, 6275, 7046, 4578, 7294,
|
|
2]) /* metro module 7534, dependencies: [31, 27, 1880, 33, 4501, 697, 5475, 4573, 3802, 6771, 7535, 44, 7540, 1244, 7541, 7542, 7543, 7544, 4080, 6275, 7046, 4578, 7294, 2] */;
|