1 import { ACCENT_COLORS } from '../colors';
2 import { BASE_SIZE } from '../helpers/size';
4 export const MAX_CALENDARS_FREE = 3;
5 export const MAX_CALENDARS_PAID = 25; // Only paid mail
6 export const MAX_CALENDARS_FAMILY = 150;
7 export const MAX_CALENDARS_DUO = 50;
9 export const MAX_DEFAULT_NOTIFICATIONS = 5;
10 export const MAX_NOTIFICATIONS = 10;
11 export const MAX_ATTENDEES = 100;
12 export const MAX_CALENDAR_MEMBERS = 49;
13 export const MAX_LINKS_PER_CALENDAR = 5;
15 export enum CALENDAR_CARD_TYPE {
19 ENCRYPTED_AND_SIGNED = 3,
22 export enum CALENDAR_PERMISSIONS {
32 export enum ATTENDEE_PERMISSIONS {
40 export const DEFAULT_ATTENDEE_PERMISSIONS = ATTENDEE_PERMISSIONS.SEE;
42 export enum CALENDAR_FLAGS {
45 UPDATE_PASSPHRASE = 2,
50 SUPER_OWNER_DISABLED = 64,
53 export enum CALENDAR_TYPE {
59 export enum CALENDAR_STATUS {
64 export enum CALENDAR_DISPLAY {
69 export enum CALENDAR_SHARE_BUSY_TIME_SLOTS {
74 export enum ICAL_CALSCALE {
75 GREGORIAN = 'GREGORIAN',
78 export enum ICAL_METHOD {
84 DECLINECOUNTER = 'DECLINECOUNTER',
89 export const ICAL_METHODS_ATTENDEE = [ICAL_METHOD.REPLY, ICAL_METHOD.COUNTER, ICAL_METHOD.REFRESH];
90 export const ICAL_METHODS_ORGANIZER = [
94 ICAL_METHOD.DECLINECOUNTER,
97 export enum ICAL_EVENT_STATUS {
98 TENTATIVE = 'TENTATIVE',
99 CONFIRMED = 'CONFIRMED',
100 CANCELLED = 'CANCELLED',
103 export enum ICAL_ATTENDEE_RSVP {
108 export enum ICAL_ATTENDEE_ROLE {
109 REQUIRED = 'REQ-PARTICIPANT', // Indicates a participant whose participation is required
110 OPTIONAL = 'OPT-PARTICIPANT', // Indicates a participant whose participation is optional
111 NON = 'NON-PARTICIPANT', // Indicates a participant who is copied for information purposes only
114 export enum ICAL_ATTENDEE_STATUS {
115 NEEDS_ACTION = 'NEEDS-ACTION',
116 ACCEPTED = 'ACCEPTED',
117 DECLINED = 'DECLINED',
118 TENTATIVE = 'TENTATIVE',
119 DELEGATED = 'DELEGATED',
122 export enum ICAL_ALARM_ACTION {
128 export enum ATTENDEE_STATUS_API {
135 export const MAX_ICAL_SEQUENCE = 2 ** 31;
137 export const MAX_CHARS_API = {
140 CALENDAR_DESCRIPTION: 255,
142 EVENT_DESCRIPTION: 3000,
146 export const MAX_CHARS_CLEARTEXT = {
150 export const MINIMUM_DATE = new Date(1970, 0, 1);
151 export const MINIMUM_DATE_UTC = new Date(
152 Date.UTC(MINIMUM_DATE.getFullYear(), MINIMUM_DATE.getMonth(), MINIMUM_DATE.getDate())
154 export const MAXIMUM_DATE = new Date(2037, 11, 31);
155 export const MAXIMUM_DATE_UTC = new Date(
156 Date.UTC(MAXIMUM_DATE.getFullYear(), MAXIMUM_DATE.getMonth(), MAXIMUM_DATE.getDate())
159 export enum FREQUENCY {
169 export const FREQUENCY_INTERVALS_MAX = {
170 [FREQUENCY.ONCE]: 1000 - 1,
171 [FREQUENCY.DAILY]: 1000 - 1,
172 [FREQUENCY.WEEKLY]: 5000 - 1,
173 [FREQUENCY.MONTHLY]: 1000 - 1,
174 [FREQUENCY.YEARLY]: 100 - 1,
175 [FREQUENCY.CUSTOM]: 1000 - 1,
176 [FREQUENCY.OTHER]: 1,
178 export const FREQUENCY_COUNT_MAX = 50 - 1;
179 export const FREQUENCY_COUNT_MAX_INVITATION = 500 - 1;
181 export enum DAILY_TYPE {
185 export enum WEEKLY_TYPE {
189 export enum MONTHLY_TYPE {
192 ON_MINUS_NTH_DAY = -1,
195 export enum YEARLY_TYPE {
196 BY_MONTH_ON_MONTH_DAY = 0,
199 export enum END_TYPE {
201 AFTER_N_TIMES = 'COUNT',
205 export const ICAL_EXTENSIONS = ['ics', 'ical', 'ifb', 'icalendar'];
206 export const ICAL_MIME_TYPE = 'text/calendar';
208 export const DEFAULT_CALENDAR = {
210 color: ACCENT_COLORS[0],
227 export enum ACTION_VIEWS {
231 export enum NOTIFICATION_WHEN {
236 export enum NOTIFICATION_UNITS {
243 export const NOTIFICATION_UNITS_MAX = {
244 [NOTIFICATION_UNITS.WEEK]: 1000 - 1,
245 [NOTIFICATION_UNITS.DAY]: 7000 - 1,
246 [NOTIFICATION_UNITS.HOUR]: 1000 - 1,
247 [NOTIFICATION_UNITS.MINUTE]: 10000 - 1,
250 export const DEFAULT_EVENT_DURATION = 30;
252 export const COLORS = {
257 export enum SAVE_CONFIRMATION_TYPES {
262 export enum DELETE_CONFIRMATION_TYPES {
267 export enum RECURRING_TYPES {
273 export const MAX_IMPORT_EVENTS = 15000;
274 export const MAX_IMPORT_EVENTS_STRING = MAX_IMPORT_EVENTS.toLocaleString();
275 export const MAX_IMPORT_FILE_SIZE = 10 * BASE_SIZE ** 2;
276 export const MAX_IMPORT_FILE_SIZE_STRING = '10 MB';
277 export const MAX_UID_CHARS_DISPLAY = 43;
278 export const MAX_FILENAME_CHARS_DISPLAY = 100;
279 export const IMPORT_CALENDAR_FAQ_URL = '/how-to-import-calendar-to-proton-calendar';
280 export const IMPORT_CALENDAR_UNSUPPORTED_FAQ_URL = `${IMPORT_CALENDAR_FAQ_URL}/#data-not-supported`;
282 export const TITLE_INPUT_ID = 'event-title-input';
283 export const FREQUENCY_INPUT_ID = 'event-frequency-input';
284 export const LOCATION_INPUT_ID = 'event-location-input';
285 export const NOTIFICATION_INPUT_ID = 'event-notification-input';
286 export const VIDEO_CONFERENCE_INPUT_ID = 'event-video-conference-input';
287 export const CALENDAR_INPUT_ID = 'event-calendar-input';
288 export const DESCRIPTION_INPUT_ID = 'event-description-input';
289 export const DATE_INPUT_ID = 'event-date-input';
290 export const PARTICIPANTS_INPUT_ID = 'event-participants-input';
291 export const MEMBERS_INPUT_ID = 'shared-members-input';
293 export enum IMPORT_ERROR_TYPE {
294 NO_FILE_SELECTED = 'NO_FILE_SELECTED',
295 NO_ICS_FILE = 'NO_ICS_FILE',
296 FILE_EMPTY = 'FILE_EMPTY',
297 FILE_TOO_BIG = 'FILE_TOO_BIG',
298 FILE_CORRUPTED = 'FILE_CORRUPTED',
299 INVALID_CALENDAR = 'INVALID_CALENDAR',
300 INVALID_METHOD = 'INVALID_METHOD',
301 NO_EVENTS = 'NO_EVENTS',
302 TOO_MANY_EVENTS = 'TOO_MANY_EVENTS',
305 export const SHARED_SIGNED_FIELDS = [
315 'x-pm-conference-id',
318 export const SHARED_ENCRYPTED_FIELDS = [
325 'x-pm-conference-url',
328 export const CALENDAR_SIGNED_FIELDS = ['uid', 'dtstamp', 'exdate', 'status', 'transp'] as const;
329 export const CALENDAR_ENCRYPTED_FIELDS = ['uid', 'dtstamp', 'comment'] as const;
331 export const USER_SIGNED_FIELDS = ['uid', 'dtstamp'] as const;
332 export const USER_ENCRYPTED_FIELDS = [] as const;
334 export const ATTENDEES_SIGNED_FIELDS = [] as const;
335 export const ATTENDEES_ENCRYPTED_FIELDS = ['uid', 'attendee'] as const;
337 export const REQUIRED_SET = new Set(['uid', 'dtstamp'] as const);
339 // Set of taken keys to put the rest
340 export const TAKEN_KEYS = [
342 ...SHARED_SIGNED_FIELDS,
343 ...SHARED_ENCRYPTED_FIELDS,
344 ...CALENDAR_SIGNED_FIELDS,
345 ...CALENDAR_ENCRYPTED_FIELDS,
346 ...USER_SIGNED_FIELDS,
347 ...USER_ENCRYPTED_FIELDS,
348 ...ATTENDEES_ENCRYPTED_FIELDS,
349 ...ATTENDEES_SIGNED_FIELDS,
353 export enum NOTIFICATION_TYPE_API {
358 export enum EVENT_VERIFICATION_STATUS {
364 export enum SETTINGS_VIEW {
372 export enum CALENDAR_VALIDATION_MODE {
374 DOWNLOAD_AND_PARSE = 1,
377 export const CALENDAR_SETTINGS_ROUTE = {
379 CALENDARS: '/calendars',
380 INTEROPS: '/import-export',
381 GET_APPS: '/get-the-apps',
384 export const CALENDAR_SETTINGS_SECTION_ID = {
385 TIME_ZONE: 'time-zone',
387 INVITATIONS: 'invitations',
389 PERSONAL_CALENDARS: 'my-calendars',
390 OTHER_CALENDARS: 'other-calendars',
394 SHARE_PRIVATELY: 'share-privately',
395 SHARE_PUBLICLY: 'share-publicly',
396 MOBILE_APP: 'mobile-app',
397 DESKTOP_APP: 'desktop-app',
398 INTEGRATIONS: 'integrations',
401 /** Visual limit of the attendees busy slots we display */
402 export const BUSY_TIME_SLOTS_MAX_ATTENDEES_DISPLAYED = 10;
404 export const TMP_UID = 'tmp';
405 export const TMP_UNIQUE_ID = 'tmp';