import packageJSON from "package.json" ; assert ; { type : "json" ; } ; import { EntryUrlItem , LogLevel } from "./model/common" ; import { PROTON_SHARED_MESSAGE_INTERFACE , PROVIDER_REPO_MAP } from "src/shared/proton-apps-constants" ; const { description : PACKAGE_DESCRIPTION , homepage : PACKAGE_GITHUB_PROJECT_URL , license : PACKAGE_LICENSE , name : PACKAGE_NAME , version : PACKAGE_VERSION , } = packageJSON ; export const PRODUCT_NAME = "ElectronMail" ; export const REPOSITORY_NAME = PRODUCT_NAME ; export const BINARY_NAME = PACKAGE_NAME ; export { PACKAGE_NAME , PACKAGE_VERSION , PACKAGE_LICENSE , PACKAGE_DESCRIPTION , PACKAGE_GITHUB_PROJECT_URL , } ; export const SEMICOLON = ";" ; export const ONE_KB_BYTES = 1024 ; export const ONE_MB_BYTES = ONE_KB_BYTES * ONE_KB_BYTES ; export const ONE_SECOND_MS = 1000 ; export const ONE_MINUTE_MS = ONE_SECOND_MS * 60 ; export const DEFAULT_API_CALL_TIMEOUT = ONE_SECOND_MS * 25 ; export const DEFAULT_TRAY_ICON_COLOR = "#1ca48c" ; export const DEFAULT_UNREAD_BADGE_BG_COLOR = "#de4251" ; export const DEFAULT_UNREAD_BADGE_BG_TEXT = "#ffffff" ; export const DEFAULT_MESSAGES_STORE_PORTION_SIZE = 500 ; export const UPDATE_CHECK_FETCH_TIMEOUT = ONE_SECOND_MS * 10 ; export const PROTON_MONACO_EDITOR_DTS_ASSETS_LOCATION = { system : "./assets/db-search-monaco-editor/node_modules_/typescript/lib/lib.esnext.d.ts.txt" , protonMessage : `./assets/db-search-monaco-editor/proton-shared/${ PROTON_SHARED_MESSAGE_INTERFACE . projectRelativeFile . replace ( ".ts" , ".d.ts.txt" ) }` , } as const ; export const LOCAL_WEBCLIENT_PROTOCOL_PREFIX = "webclient" ; export const LOCAL_WEBCLIENT_PROTOCOL_RE_PATTERN = `${ LOCAL_WEBCLIENT_PROTOCOL_PREFIX }[\\d]+` ; export const PROTON_API_ENTRY_VALUE_PREFIX = "local:::" ; export const PROTON_API_ENTRY_PRIMARY_VALUE = "https://mail.protonmail.com" ; export const PROTON_API_ENTRY_TOR_V2_VALUE = "https://protonirockerxow.onion" ; export const PROTON_API_ENTRY_TOR_V3_VALUE = "https://protonmailrmez3lotccipshtkleegetolb73fuirgj7r4o4vfu7ozyd.onion" ; function getBuiltInWebClientTitle ( ) { return PROVIDER_REPO_MAP [ "proton-mail" ] . tag ; } export const PROTON_API_ENTRY_RECORDS = [ { value : PROTON_API_ENTRY_PRIMARY_VALUE , title : `${ PROTON_API_ENTRY_PRIMARY_VALUE } (${ getBuiltInWebClientTitle ( ) })` , } , { value : "https://app.protonmail.ch" , title : `https://app.protonmail.ch (${ getBuiltInWebClientTitle ( ) })` , } , { value : PROTON_API_ENTRY_TOR_V3_VALUE , title : `Tor version 3 address (${ getBuiltInWebClientTitle ( ) })` , } , ] ; export const PROTON_API_ENTRY_URLS = PROTON_API_ENTRY_RECORDS . map ( ( { value : url } ) => url ) ; export const WEB_CLIENTS_BLANK_HTML_FILE_NAME = "blank.html" ; export const LOG_LEVELS = Object . keys ( ( ( stub ) => stub ) ( { error : null , warn : null , info : null , verbose : null , debug : null , silly : null , } ) ) as Readonly < LogLevel [ ] > ; export const ZOOM_FACTOR_DEFAULT = 1 ; export const ZOOM_FACTORS = [ 0.5 , 0.55 , 0.6 , 0.65 , 0.7 , 0.75 , 0.8 , 0.85 , 0.9 , 0.95 , ZOOM_FACTOR_DEFAULT , 1.05 , 1.1 , 1.15 , 1.2 , 1.25 , 1.3 , 1.35 , 1.4 , 1.45 , 1.5 , 1.6 , 1.7 , 1.8 , 1.9 , 2 , ] ; export const LAYOUT_MODES = [ { value : "top" , title : "Top" } , { value : "left" , title : "Left" } , { value : "left-thin" , title : "Left (thin)" } , ] as const ; export const WEB_VIEW_SESSION_STORAGE_KEY_SKIP_LOGIN_DELAYS = "ELECTRON_MAIL_SKIP_LOGIN_DELAYS" ; export const WEB_PROTOCOL_SCHEME = "web" ; export const ACCOUNT_EXTERNAL_CONTENT_PROXY_URL_REPLACE_PATTERN = "$URL" ; export const RUNTIME_ENV_USER_DATA_DIR = "ELECTRON_MAIL_USER_DATA_DIR" ; export const RUNTIME_ENV_CI_PROTON_CLIENTS_ONLY = "ELECTRON_MAIL_CI_PROTON_CLIENTS_ONLY" ; export const RUNTIME_ENV_CI_REMOVE_OUTPUT_GIT_DIR = "ELECTRON_MAIL_CI_REMOVE_OUTPUT_GIT_DIR" ; export const RUNTIME_ENV_E2E_PROTONMAIL_LOGIN = "ELECTRON_MAIL_E2E_PROTONMAIL_LOGIN" ; export const RUNTIME_ENV_E2E_PROTONMAIL_PASSWORD = "ELECTRON_MAIL_E2E_PROTONMAIL_PASSWORD" ; export const RUNTIME_ENV_E2E_PROTONMAIL_2FA_CODE = "ELECTRON_MAIL_E2E_PROTONMAIL_2FA_CODE" ; export const RUNTIME_ENV_E2E_PROTONMAIL_UNREAD_MIN = "ELECTRON_MAIL_E2E_PROTONMAIL_UNREAD_MIN" ;