1 import { c, msgid } from 'ttag';
3 import { PLANS } from '@proton/payments';
4 import { WALLET_APP_NAME } from '@proton/shared/lib/constants';
6 import type { PlanCardFeature, PlanCardFeatureDefinition } from './interface';
8 export const FREE_WALLETS = 2;
9 export const FREE_WALLET_ACCOUNTS = 2;
10 export const FREE_WALLET_EMAIL = 1;
12 export const WALLET_PLUS_WALLETS = 10;
13 export const WALLET_PLUS_WALLET_ACCOUNTS = 10;
14 export const WALLET_PLUS_WALLET_EMAIL = 10;
16 export const UNLIMITED_WALLETS = 10;
17 export const UNLIMITED_WALLET_ACCOUNTS = 10;
18 export const UNLIMITED_WALLET_EMAIL = 15;
20 export const VISIONARY_WALLETS = 50;
21 export const VISIONARY_WALLET_ACCOUNTS = 50;
22 export const VISIONARY_WALLET_EMAIL = 90;
24 export const getWalletsText = (n: number) => {
25 return c('wallet_signup_2024: Info').ngettext(msgid`${n} wallet`, `${n} wallets`, n);
28 export const getWallets = (n: Parameters<typeof getWalletAccountsText>['0']): PlanCardFeatureDefinition => {
30 text: getWalletsText(n),
35 export const getWalletAccountsText = (n: number) => {
36 return c('wallet_signup_2024: Info').ngettext(msgid`${n} account per wallet`, `${n} accounts per wallet`, n);
39 export const getWalletAccounts = (n: Parameters<typeof getWalletsText>['0']): PlanCardFeatureDefinition => {
41 text: getWalletAccountsText(n),
46 export const getWalletEmailAddressesText = (n: number) => {
47 return c('wallet_signup_2024: Info').ngettext(msgid`${n} email address`, `${n} email addresses`, n);
50 export const getWalletEmailAddresses = (
51 n: Parameters<typeof getWalletEmailAddressesText>['0']
52 ): PlanCardFeatureDefinition => {
54 text: getWalletEmailAddressesText(n),
59 export const getBitcoinViaEmailText = () => {
60 return c('wallet_signup_2024: Info').t`Bitcoin via email`;
63 export const getBitcoinViaEmail = (): PlanCardFeatureDefinition => {
65 text: getBitcoinViaEmailText(),
70 export const getWalletAppFeature = (): PlanCardFeatureDefinition => {
72 text: WALLET_APP_NAME,
73 tooltip: c('wallet_signup_2024:app-switcher').t`A safer/easier way to hold & send Bitcoin`,
79 export const getWalletFeatures = (): PlanCardFeature[] => {
84 [PLANS.FREE]: getWallets(FREE_WALLETS),
85 [PLANS.WALLET]: getWallets(WALLET_PLUS_WALLETS),
86 [PLANS.BUNDLE]: getWallets(UNLIMITED_WALLETS),
87 [PLANS.MAIL]: getWallets(FREE_WALLETS),
88 [PLANS.VPN]: getWallets(FREE_WALLETS),
89 [PLANS.DRIVE]: getWallets(FREE_WALLETS),
90 [PLANS.DRIVE_BUSINESS]: getWallets(FREE_WALLETS),
91 [PLANS.PASS]: getWallets(FREE_WALLETS),
92 [PLANS.PASS_FAMILY]: getWallets(FREE_WALLETS),
93 [PLANS.FAMILY]: getWallets(UNLIMITED_WALLETS),
94 [PLANS.DUO]: getWallets(UNLIMITED_WALLETS), // TODO validate with product
95 [PLANS.MAIL_PRO]: null,
96 [PLANS.MAIL_BUSINESS]: null,
97 [PLANS.BUNDLE_PRO]: null,
98 [PLANS.BUNDLE_PRO_2024]: null,
99 [PLANS.PASS_PRO]: null,
100 [PLANS.PASS_BUSINESS]: null,
101 [PLANS.VPN_PRO]: null,
102 [PLANS.VPN_BUSINESS]: null,
106 name: 'wallet-accounts',
108 [PLANS.FREE]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
109 [PLANS.WALLET]: getWalletAccounts(WALLET_PLUS_WALLET_ACCOUNTS),
110 [PLANS.BUNDLE]: getWalletAccounts(UNLIMITED_WALLET_ACCOUNTS),
111 [PLANS.MAIL]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
112 [PLANS.VPN]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
113 [PLANS.DRIVE]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
114 [PLANS.DRIVE_BUSINESS]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
115 [PLANS.PASS]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
116 [PLANS.PASS_FAMILY]: getWalletAccounts(FREE_WALLET_ACCOUNTS),
117 [PLANS.FAMILY]: getWalletAccounts(UNLIMITED_WALLET_ACCOUNTS),
118 [PLANS.DUO]: getWallets(UNLIMITED_WALLET_ACCOUNTS), // TODO validate with product
119 [PLANS.MAIL_PRO]: null,
120 [PLANS.MAIL_BUSINESS]: null,
121 [PLANS.BUNDLE_PRO]: null,
122 [PLANS.BUNDLE_PRO_2024]: null,
123 [PLANS.PASS_PRO]: null,
124 [PLANS.PASS_BUSINESS]: null,
125 [PLANS.VPN_PRO]: null,
126 [PLANS.VPN_BUSINESS]: null,
130 name: 'wallet-email-addresses',
132 [PLANS.FREE]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
133 [PLANS.WALLET]: getWalletEmailAddresses(WALLET_PLUS_WALLET_EMAIL),
134 [PLANS.BUNDLE]: getWalletEmailAddresses(UNLIMITED_WALLET_EMAIL),
135 [PLANS.MAIL]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
136 [PLANS.VPN]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
137 [PLANS.DRIVE]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
138 [PLANS.DRIVE_BUSINESS]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
139 [PLANS.PASS]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
140 [PLANS.PASS_FAMILY]: getWalletEmailAddresses(FREE_WALLET_EMAIL),
141 [PLANS.FAMILY]: getWalletEmailAddresses(UNLIMITED_WALLET_EMAIL),
142 [PLANS.DUO]: getWallets(UNLIMITED_WALLET_EMAIL), // TODO validate with product
143 [PLANS.MAIL_PRO]: null,
144 [PLANS.MAIL_BUSINESS]: null,
145 [PLANS.BUNDLE_PRO]: null,
146 [PLANS.BUNDLE_PRO_2024]: null,
147 [PLANS.PASS_PRO]: null,
148 [PLANS.PASS_BUSINESS]: null,
149 [PLANS.VPN_PRO]: null,
150 [PLANS.VPN_BUSINESS]: null,
154 name: 'wallet-bitcoin-via-email',
156 [PLANS.FREE]: getBitcoinViaEmail(),
157 [PLANS.WALLET]: getBitcoinViaEmail(),
158 [PLANS.BUNDLE]: getBitcoinViaEmail(),
159 [PLANS.MAIL]: getBitcoinViaEmail(),
160 [PLANS.VPN]: getBitcoinViaEmail(),
161 [PLANS.DRIVE]: getBitcoinViaEmail(),
162 [PLANS.DRIVE_BUSINESS]: getBitcoinViaEmail(),
163 [PLANS.PASS]: getBitcoinViaEmail(),
164 [PLANS.PASS_FAMILY]: getBitcoinViaEmail(),
165 [PLANS.FAMILY]: getBitcoinViaEmail(),
166 [PLANS.DUO]: getBitcoinViaEmail(), // TODO validate with product
167 [PLANS.MAIL_PRO]: null,
168 [PLANS.MAIL_BUSINESS]: null,
169 [PLANS.BUNDLE_PRO]: null,
170 [PLANS.BUNDLE_PRO_2024]: null,
171 [PLANS.PASS_PRO]: null,
172 [PLANS.PASS_BUSINESS]: null,
173 [PLANS.VPN_PRO]: null,
174 [PLANS.VPN_BUSINESS]: null,