mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
1 line
43 KiB
Plaintext
1 line
43 KiB
Plaintext
{"version":3,"file":"133.8c0baeff1e13dd2e52f0.js","mappings":"uSAoBA,MAEMA,EAAeC,EAAAA,GAA0BC,EAAAA,GAA2BC,EAAAA,GA+E1E,GAAeC,EAAAA,EAAAA,KA7EsB,IAM/B,IANgC,KACpCC,EADoC,WAEpCC,EAFoC,kBAGpCC,EAHoC,WAIpCC,EAJoC,MAKpCC,GACI,EACJ,MAAOC,EAAgBC,IAAqBC,EAAAA,EAAAA,OACrCC,EAAoBC,IAAyBF,EAAAA,EAAAA,OAC7CG,EAAqBC,IAA0BJ,EAAAA,EAAAA,KAAS,GACzDK,EAA6B,IAA8CX,GAEjFY,EAAAA,EAAAA,KAAU,KACHR,IACHS,EAAAA,EAAAA,GAAiB,cAAcC,KAAKT,KAErC,CAACD,KAEJQ,EAAAA,EAAAA,KAAU,KACHL,IACHM,EAAAA,EAAAA,GAAiB,kBAAkBC,KAAKN,KAEzC,CAACD,IAEJ,MAAMQ,GAAwBC,EAAAA,EAAAA,KAAY,IAAMN,GAAuB,IAAO,IAuB9E,OACE,0BAAKO,GAAG,SAASC,UAAWf,EAAQ,MAAQ,KACxCM,GACA,0BAAKS,UAAU,mBAEhBd,GACC,mBAACe,EAAA,EAAD,CACEF,GAAG,aACHG,KAAMjB,EAAQkB,EAAAA,GAAsB3B,EACpCwB,UAAWhB,EAAa,cAAWoB,EACnCC,cAAenB,EACfoB,MAAOtB,EACPuB,OAAQV,IAGXR,GACC,mBAACY,EAAA,EAAD,CACEF,GAAG,iBACHG,KAAMjB,EAAQkB,EAAAA,GAAsB3B,EACpCwB,UAAYhB,EAAwB,QAAX,SACzBqB,cAAehB,EACfmB,YAAaxB,EA1CrB,WACE,MAAMyB,EAAc5B,GAAQA,EAAK6B,OAAS,GAAM3B,EAAoB,EA/B3C,GAgCEU,GAA8BZ,EAAK6B,OAAS,GACnE,EACEC,E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AAWxL,UACdwL,EAAWxL,QAAUkG,SAASuF,cAAc,SAG9CC,EAAAA,EAAAA,KAAgB,KACd,MAAMC,EAAYzF,SAAS0F,cAA8BL,GAAe,YACxE,IAAKI,EACH,OAGF,MAAMhC,EAAU6B,EAAWxL,QAO3B,OANIlC,GACF6L,EAAQsB,UAAUY,IAAI/N,GAGxB6N,EAAUG,YAAYnC,GAEf,KACLoC,EAAAA,EAAAA,YAAgB7N,EAAWyL,GAC3BgC,EAAUK,YAAYrC,MAEvB,CAAC7L,EAAWyN,IAERQ,EAAAA,EAAAA,OAAgB9C,EAA4BuC,EAAWxL","sources":["webpack://telegram-t/./src/components/common/TrackingMonkey.tsx","webpack://telegram-t/./src/components/auth/AuthCode.tsx","webpack://telegram-t/./src/components/auth/AuthPassword.tsx","webpack://telegram-t/./src/components/auth/AuthRegister.tsx","webpack://telegram-t/./src/components/common/PasswordForm.tsx","webpack://telegram-t/./src/components/common/PasswordMonkey.tsx","webpack://telegram-t/./src/components/ui/CropModal.tsx","webpack://telegram-t/./src/components/ui/AvatarEditable.tsx","webpack://telegram-t/./src/components/ui/Modal.tsx","webpack://telegram-t/./src/util/trapFocus.ts","webpack://telegram-t/./src/components/ui/Portal.ts"],"sourcesContent":["import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n code: string;\n codeLength: number;\n trackingDirection: number;\n isTracking: boolean;\n isBig?: boolean;\n};\n\nconst TRACKING_START_FRAME = 15;\nconst TRACKING_END_FRAME = 180;\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst TrackingMonkey: FC<OwnProps> = ({\n code,\n codeLength,\n trackingDirection,\n isTracking,\n isBig,\n}) => {\n const [idleMonkeyData, setIdleMonkeyData] = useState<string>();\n const [trackingMonkeyData, setTrackingMonkeyData] = useState<string>();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const TRACKING_FRAMES_PER_SYMBOL = (TRACKING_END_FRAME - TRACKING_START_FRAME) / codeLength;\n\n useEffect(() => {\n if (!idleMonkeyData) {\n getAnimationData('MonkeyIdle').then(setIdleMonkeyData);\n }\n }, [idleMonkeyData]);\n\n useEffect(() => {\n if (!trackingMonkeyData) {\n getAnimationData('MonkeyTracking').then(setTrackingMonkeyData);\n }\n }, [trackingMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n function getTrackingFrames(): [number, number] {\n const startFrame = (code && code.length > 1) || trackingDirection < 0\n ? TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * (code.length - 1)\n : 0;\n const endFrame = code.length === codeLength\n ? TRACKING_END_FRAME\n : TRACKING_START_FRAME + TRACKING_FRAMES_PER_SYMBOL * code.length;\n\n if (trackingDirection < 1) {\n return [\n endFrame,\n startFrame,\n ];\n }\n\n return [\n startFrame,\n endFrame,\n ];\n }\n\n return (\n <div id=\"monkey\" className={isBig ? 'big' : ''}>\n {!isFirstMonkeyLoaded && (\n <div className=\"monkey-preview\" />\n )}\n {idleMonkeyData && (\n <AnimatedSticker\n id=\"idleMonkey\"\n size={isBig ? STICKER_SIZE_TWO_FA : STICKER_SIZE}\n className={isTracking ? 'hidden' : undefined}\n animationData={idleMonkeyData}\n play={!isTracking}\n onLoad={handleFirstMonkeyLoad}\n />\n )}\n {trackingMonkeyData && (\n <AnimatedSticker\n id=\"trackingMonkey\"\n size={isBig ? STICKER_SIZE_TWO_FA : STICKER_SIZE}\n className={!isTracking ? 'hidden' : 'shown'}\n animationData={trackingMonkeyData}\n playSegment={isTracking ? getTrackingFrames() : undefined}\n speed={2}\n noLoop\n />\n )}\n </div>\n );\n};\n\nexport default memo(TrackingMonkey);\n","import { FormEvent } from 'react';\nimport React, {\n FC, useState, useEffect, useCallback, memo, useRef,\n} from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\nimport { GlobalState } from '../../global/types';\n\nimport { IS_TOUCH_ENV } from '../../util/environment';\nimport { pick } from '../../util/iteratees';\nimport renderText from '../common/helpers/renderText';\nimport useHistoryBack from '../../hooks/useHistoryBack';\nimport useLang from '../../hooks/useLang';\n\nimport InputText from '../ui/InputText';\nimport Loading from '../ui/Loading';\nimport TrackingMonkey from '../common/TrackingMonkey';\n\ntype StateProps = Pick<GlobalState, 'authPhoneNumber' | 'authIsCodeViaApp' | 'authIsLoading' | 'authError'>;\n\nconst CODE_LENGTH = 5;\n\nconst AuthCode: FC<StateProps> = ({\n authPhoneNumber,\n authIsCodeViaApp,\n authIsLoading,\n authError,\n}) => {\n const {\n setAuthCode,\n returnToAuthPhoneNumber,\n clearAuthError,\n } = getActions();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef<HTMLInputElement>(null);\n\n const [code, setCode] = useState<string>('');\n const [isTracking, setIsTracking] = useState(false);\n const [trackingDirection, setTrackingDirection] = useState(1);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n inputRef.current!.focus();\n }\n }, []);\n\n useHistoryBack(true, returnToAuthPhoneNumber);\n\n const onCodeChange = useCallback((e: FormEvent<HTMLInputElement>) => {\n if (authError) {\n clearAuthError();\n }\n\n const { currentTarget: target } = e;\n target.value = target.value.replace(/[^\\d]+/, '').substr(0, CODE_LENGTH);\n\n if (target.value === code) {\n return;\n }\n\n setCode(target.value);\n\n if (!isTracking) {\n setIsTracking(true);\n } else if (!target.value.length) {\n setIsTracking(false);\n }\n\n if (code && code.length > target.value.length) {\n setTrackingDirection(-1);\n } else {\n setTrackingDirection(1);\n }\n\n if (target.value.length === CODE_LENGTH) {\n setAuthCode({ code: target.value });\n }\n }, [authError, clearAuthError, code, isTracking, setAuthCode]);\n\n return (\n <div id=\"auth-code-form\" className=\"custom-scroll\">\n <div className=\"auth-form\">\n <TrackingMonkey\n code={code}\n codeLength={CODE_LENGTH}\n isTracking={isTracking}\n trackingDirection={trackingDirection}\n />\n <h2>\n {authPhoneNumber}\n <div\n className=\"auth-number-edit\"\n onClick={returnToAuthPhoneNumber}\n role=\"button\"\n tabIndex={0}\n title={lang('WrongNumber')}\n >\n <i className=\"icon-edit\" />\n </div>\n </h2>\n <p className=\"note\">\n {renderText(lang(authIsCodeViaApp ? 'SentAppCode' : 'Login.JustSentSms'), ['simple_markdown'])}\n </p>\n <InputText\n ref={inputRef}\n id=\"sign-in-code\"\n label={lang('Code')}\n onInput={onCodeChange}\n value={code}\n error={authError && lang(authError)}\n autoComplete=\"off\"\n inputMode=\"numeric\"\n />\n {authIsLoading && <Loading />}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authPhoneNumber', 'authIsCodeViaApp', 'authIsLoading', 'authError']),\n)(AuthCode));\n","import React, {\n FC, memo, useCallback, useState,\n} from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport MonkeyPassword from '../common/PasswordMonkey';\nimport PasswordForm from '../common/PasswordForm';\n\ntype StateProps = Pick<GlobalState, 'authIsLoading' | 'authError' | 'authHint'>;\n\nconst AuthPassword: FC<StateProps> = ({\n authIsLoading, authError, authHint,\n}) => {\n const { setAuthPassword, clearAuthError } = getActions();\n\n const lang = useLang();\n const [showPassword, setShowPassword] = useState(false);\n\n const handleChangePasswordVisibility = useCallback((isVisible) => {\n setShowPassword(isVisible);\n }, []);\n\n const handleSubmit = useCallback((password: string) => {\n setAuthPassword({ password });\n }, [setAuthPassword]);\n\n return (\n <div id=\"auth-password-form\" className=\"custom-scroll\">\n <div className=\"auth-form\">\n <MonkeyPassword isPasswordVisible={showPassword} />\n <h2>{lang('Login.Header.Password')}</h2>\n <p className=\"note\">{lang('Login.EnterPasswordDescription')}</p>\n <PasswordForm\n clearError={clearAuthError}\n error={authError && lang(authError)}\n hint={authHint}\n isLoading={authIsLoading}\n isPasswordVisible={showPassword}\n onChangePasswordVisibility={handleChangePasswordVisibility}\n onSubmit={handleSubmit}\n />\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError', 'authHint']),\n)(AuthPassword));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, memo, useCallback,\n} from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\n\nimport { GlobalState } from '../../global/types';\n\nimport { pick } from '../../util/iteratees';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\nimport InputText from '../ui/InputText';\nimport AvatarEditable from '../ui/AvatarEditable';\n\ntype StateProps = Pick<GlobalState, 'authIsLoading' | 'authError'>;\n\nconst AuthRegister: FC<StateProps> = ({\n authIsLoading, authError,\n}) => {\n const { signUp, clearAuthError, uploadProfilePhoto } = getActions();\n\n const lang = useLang();\n const [isButtonShown, setIsButtonShown] = useState(false);\n const [croppedFile, setCroppedFile] = useState<File | undefined>();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n\n const handleFirstNameChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n if (authError) {\n clearAuthError();\n }\n\n const { target } = event;\n\n setFirstName(target.value);\n setIsButtonShown(target.value.length > 0);\n }, [authError, clearAuthError]);\n\n const handleLastNameChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const { target } = event;\n\n setLastName(target.value);\n }, []);\n\n function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n event.preventDefault();\n\n signUp({ firstName, lastName });\n\n if (croppedFile) {\n uploadProfilePhoto({ file: croppedFile });\n }\n }\n\n return (\n <div id=\"auth-registration-form\" className=\"custom-scroll\">\n <div className=\"auth-form\">\n <form action=\"\" method=\"post\" onSubmit={handleSubmit}>\n <AvatarEditable onChange={setCroppedFile} />\n <h2>{lang('YourName')}</h2>\n <p className=\"note\">{lang('Login.Register.Desc')}</p>\n <InputText\n id=\"registration-first-name\"\n label={lang('Login.Register.FirstName.Placeholder')}\n onChange={handleFirstNameChange}\n value={firstName}\n error={authError && lang(authError)}\n autoComplete=\"given-name\"\n />\n <InputText\n id=\"registration-last-name\"\n label={lang('Login.Register.LastName.Placeholder')}\n onChange={handleLastNameChange}\n value={lastName}\n autoComplete=\"family-name\"\n />\n {isButtonShown && (\n <Button type=\"submit\" ripple isLoading={authIsLoading}>{lang('Next')}</Button>\n )}\n </form>\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => pick(global, ['authIsLoading', 'authError']),\n)(AuthRegister));\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, memo, useEffect, useRef, useState,\n} from '../../lib/teact/teact';\n\nimport { MIN_PASSWORD_LENGTH } from '../../config';\nimport { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport Button from '../ui/Button';\n\ntype OwnProps = {\n submitLabel?: string;\n error?: string;\n hint?: string;\n placeholder?: string;\n isLoading?: boolean;\n isPasswordVisible?: boolean;\n clearError: NoneToVoidFunction;\n onChangePasswordVisibility: (state: boolean) => void;\n onInputChange?: (password: string) => void;\n onSubmit: (password: string) => void;\n};\n\nconst FOCUS_DELAY_TIMEOUT_MS = IS_SINGLE_COLUMN_LAYOUT ? 550 : 400;\n\nconst PasswordForm: FC<OwnProps> = ({\n isLoading = false,\n isPasswordVisible,\n error,\n hint,\n placeholder = 'Password',\n submitLabel = 'Next',\n clearError,\n onChangePasswordVisibility,\n onInputChange,\n onSubmit,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const inputRef = useRef<HTMLInputElement>(null);\n const lang = useLang();\n\n const [password, setPassword] = useState('');\n const [canSubmit, setCanSubmit] = useState(false);\n\n useEffect(() => {\n if (!IS_TOUCH_ENV) {\n setTimeout(() => {\n inputRef.current!.focus();\n }, FOCUS_DELAY_TIMEOUT_MS);\n }\n }, []);\n\n useEffect(() => {\n if (error) {\n requestAnimationFrame(() => {\n inputRef.current!.focus();\n inputRef.current!.select();\n });\n }\n }, [error]);\n\n function onPasswordChange(e: ChangeEvent<HTMLInputElement>) {\n if (error) {\n clearError();\n }\n\n const { target } = e;\n setPassword(target.value);\n setCanSubmit(target.value.length >= MIN_PASSWORD_LENGTH);\n if (onInputChange) {\n onInputChange(target.value);\n }\n }\n\n function togglePasswordVisibility() {\n onChangePasswordVisibility(!isPasswordVisible);\n }\n\n function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n event.preventDefault();\n\n if (isLoading) {\n return;\n }\n\n if (canSubmit) {\n onSubmit(password);\n }\n }\n\n return (\n <form action=\"\" onSubmit={handleSubmit} autoComplete=\"off\">\n <div\n className={buildClassName('input-group password-input', password && 'touched', error && 'error')}\n dir={lang.isRtl ? 'rtl' : undefined}\n >\n <input\n ref={inputRef}\n className=\"form-control\"\n type={isPasswordVisible ? 'text' : 'password'}\n id=\"sign-in-password\"\n value={password || ''}\n autoComplete=\"current-password\"\n onChange={onPasswordChange}\n dir=\"auto\"\n />\n <label>{error || hint || placeholder}</label>\n <div\n className=\"toggle-password\"\n onClick={togglePasswordVisibility}\n role=\"button\"\n tabIndex={0}\n title=\"Toggle password visibility\"\n >\n <i className={isPasswordVisible ? 'icon-eye' : 'icon-eye-closed'} />\n </div>\n </div>\n {canSubmit && (\n <Button type=\"submit\" ripple isLoading={isLoading}>\n {submitLabel}\n </Button>\n )}\n </form>\n );\n};\n\nexport default memo(PasswordForm);\n","import React, {\n FC, useState, useEffect, useCallback, memo,\n} from '../../lib/teact/teact';\n\nimport { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config';\nimport { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';\nimport getAnimationData from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\nimport './PasswordMonkey.scss';\n\ntype OwnProps = {\n isPasswordVisible: boolean;\n isBig?: boolean;\n};\n\nconst PEEK_MONKEY_SHOW_DELAY = 2000;\nconst SEGMENT_COVER_EYES: [number, number] = [0, 50];\nconst SEGMENT_UNCOVER_EYE: [number, number] = [0, 20];\nconst SEGMENT_COVER_EYE: [number, number] = [20, 0];\nconst STICKER_SIZE = IS_SINGLE_COLUMN_LAYOUT ? STICKER_SIZE_AUTH_MOBILE : STICKER_SIZE_AUTH;\n\nconst PasswordMonkey: FC<OwnProps> = ({ isPasswordVisible, isBig }) => {\n const [closeMonkeyData, setCloseMonkeyData] = useState<string>();\n const [peekMonkeyData, setPeekMonkeyData] = useState<string>();\n const [isFirstMonkeyLoaded, setIsFirstMonkeyLoaded] = useState(false);\n const [isPeekShown, setIsPeekShown] = useState(false);\n\n useEffect(() => {\n if (!closeMonkeyData) {\n getAnimationData('MonkeyClose').then(setCloseMonkeyData);\n } else {\n setTimeout(() => setIsPeekShown(true), PEEK_MONKEY_SHOW_DELAY);\n }\n }, [closeMonkeyData]);\n\n useEffect(() => {\n if (!peekMonkeyData) {\n getAnimationData('MonkeyPeek').then(setPeekMonkeyData);\n }\n }, [peekMonkeyData]);\n\n const handleFirstMonkeyLoad = useCallback(() => setIsFirstMonkeyLoaded(true), []);\n\n return (\n <div id=\"monkey\" className={isBig ? 'big' : ''}>\n {!isFirstMonkeyLoaded && (\n <div className=\"monkey-preview\" />\n )}\n {closeMonkeyData && (\n <AnimatedSticker\n id=\"closeMonkey\"\n size={isBig ? STICKER_SIZE_TWO_FA : STICKER_SIZE}\n className={isPeekShown ? 'hidden' : 'shown'}\n animationData={closeMonkeyData}\n playSegment={SEGMENT_COVER_EYES}\n noLoop\n onLoad={handleFirstMonkeyLoad}\n />\n )}\n {peekMonkeyData && (\n <AnimatedSticker\n id=\"peekMonkey\"\n size={isBig ? STICKER_SIZE_TWO_FA : STICKER_SIZE}\n className={isPeekShown ? 'shown' : 'hidden'}\n animationData={peekMonkeyData}\n playSegment={isPasswordVisible ? SEGMENT_UNCOVER_EYE : SEGMENT_COVER_EYE}\n noLoop\n />\n )}\n </div>\n );\n};\n\nexport default memo(PasswordMonkey);\n","import React, {\n FC, useEffect, useState, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport { DEBUG } from '../../config';\nimport { blobToFile, blobToDataUri } from '../../util/files';\nimport useLang from '../../hooks/useLang';\n\nimport Button from './Button';\nimport Modal from './Modal';\nimport Loading from './Loading';\n\nimport './CropModal.scss';\n\n// Change to 'base64' to get base64-encoded string\nconst cropperResultOptions: Croppie.ResultOptions & { type: 'blob' } = {\n type: 'blob',\n quality: 1,\n format: 'jpeg',\n circle: false,\n size: { width: 1024, height: 1024 },\n};\n\ntype ICroppie = typeof import('croppie');\nlet Croppie: ICroppie;\nlet croppiePromise: Promise<{ default: ICroppie }>;\n\nasync function ensureCroppie() {\n if (!croppiePromise) {\n croppiePromise = import('../../lib/croppie') as unknown as Promise<{ default: ICroppie }>;\n Croppie = (await croppiePromise).default;\n }\n\n return croppiePromise;\n}\n\nlet cropper: Croppie;\n\nasync function initCropper(imgFile: File) {\n try {\n const cropContainer = document.getElementById('avatar-crop');\n if (!cropContainer) {\n return;\n }\n\n const { offsetWidth, offsetHeight } = cropContainer;\n\n cropper = new Croppie(cropContainer, {\n enableZoom: true,\n boundary: {\n width: offsetWidth,\n height: offsetHeight,\n },\n viewport: {\n width: offsetWidth - 16,\n height: offsetHeight - 16,\n type: 'circle',\n },\n });\n\n const dataUri = await blobToDataUri(imgFile);\n await cropper.bind({ url: dataUri });\n } catch (err) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error(err);\n }\n }\n}\n\ntype OwnProps = {\n file?: File;\n onChange: (file: File) => void;\n onClose: () => void;\n};\n\nconst CropModal: FC<OwnProps> = ({ file, onChange, onClose }: OwnProps) => {\n const [isCroppieReady, setIsCroppieReady] = useState(false);\n\n useEffect(() => {\n if (!file) {\n return;\n }\n\n if (!isCroppieReady) {\n ensureCroppie().then(() => setIsCroppieReady(true));\n\n return;\n }\n\n initCropper(file);\n }, [file, isCroppieReady]);\n\n const lang = useLang();\n\n const handleCropClick = useCallback(async () => {\n if (!cropper) {\n return;\n }\n\n const result: Blob | string = await cropper.result(cropperResultOptions);\n const croppedImg = typeof result === 'string' ? result : blobToFile(result, 'avatar.jpg');\n\n onChange(croppedImg);\n }, [onChange]);\n\n return (\n <Modal\n isOpen={Boolean(file)}\n onClose={onClose}\n title=\"Drag to reposition\"\n className=\"CropModal\"\n hasCloseButton\n >\n {isCroppieReady ? (\n <div id=\"avatar-crop\" />\n ) : (\n <Loading />\n )}\n <Button\n className=\"confirm-button\"\n round\n color=\"primary\"\n onClick={handleCropClick}\n ariaLabel={lang('CropImage')}\n >\n <i className=\"icon-check\" />\n </Button>\n </Modal>\n );\n};\n\nexport default memo(CropModal);\n","import { ChangeEvent } from 'react';\nimport React, {\n FC, useState, useEffect, memo, useCallback,\n} from '../../lib/teact/teact';\n\nimport buildClassName from '../../util/buildClassName';\n\nimport CropModal from './CropModal';\n\nimport './AvatarEditable.scss';\n\ninterface OwnProps {\n title?: string;\n disabled?: boolean;\n currentAvatarBlobUrl?: string;\n onChange: (file: File) => void;\n}\n\nconst AvatarEditable: FC<OwnProps> = ({\n title = 'Change your profile picture',\n disabled,\n currentAvatarBlobUrl,\n onChange,\n}) => {\n const [selectedFile, setSelectedFile] = useState<File | undefined>();\n const [croppedBlobUrl, setCroppedBlobUrl] = useState<string | undefined>(currentAvatarBlobUrl);\n\n useEffect(() => {\n setCroppedBlobUrl(currentAvatarBlobUrl);\n }, [currentAvatarBlobUrl]);\n\n function handleSelectFile(event: ChangeEvent<HTMLInputElement>) {\n const target = event.target as HTMLInputElement;\n\n if (!target || !target.files || !target.files[0]) {\n return;\n }\n\n setSelectedFile(target.files[0]);\n target.value = '';\n }\n\n const handleAvatarCrop = useCallback((croppedImg: File) => {\n setSelectedFile(undefined);\n onChange(croppedImg);\n\n if (croppedBlobUrl) {\n URL.revokeObjectURL(croppedBlobUrl);\n }\n setCroppedBlobUrl(URL.createObjectURL(croppedImg));\n }, [croppedBlobUrl, onChange]);\n\n const handleModalClose = useCallback(() => {\n setSelectedFile(undefined);\n }, []);\n\n const labelClassName = buildClassName(\n croppedBlobUrl && 'filled',\n disabled && 'disabled',\n );\n\n return (\n <div className=\"AvatarEditable\">\n <label\n className={labelClassName}\n role=\"button\"\n tabIndex={0}\n title={title}\n >\n <input\n type=\"file\"\n onChange={handleSelectFile}\n accept=\"image/png, image/jpeg\"\n />\n <i className=\"icon-camera-add\" />\n {croppedBlobUrl && <img src={croppedBlobUrl} alt=\"Avatar\" />}\n </label>\n <CropModal file={selectedFile} onClose={handleModalClose} onChange={handleAvatarCrop} />\n </div>\n );\n};\n\nexport default memo(AvatarEditable);\n","import { RefObject } from 'react';\nimport React, {\n FC, useEffect, useRef,\n} from '../../lib/teact/teact';\n\nimport { TextPart } from '../common/helpers/renderMessageText';\n\nimport captureKeyboardListeners from '../../util/captureKeyboardListeners';\nimport trapFocus from '../../util/trapFocus';\nimport buildClassName from '../../util/buildClassName';\nimport { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck';\nimport useShowTransition from '../../hooks/useShowTransition';\nimport useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';\nimport useLang from '../../hooks/useLang';\nimport useHistoryBack from '../../hooks/useHistoryBack';\n\nimport Button from './Button';\nimport Portal from './Portal';\n\nimport './Modal.scss';\n\nconst ANIMATION_DURATION = 200;\n\ntype OwnProps = {\n title?: string | TextPart[];\n className?: string;\n isOpen?: boolean;\n header?: any;\n hasCloseButton?: boolean;\n noBackdrop?: boolean;\n children: React.ReactNode;\n onClose: () => void;\n onCloseAnimationEnd?: () => void;\n onEnter?: () => void;\n dialogRef?: RefObject<HTMLDivElement>;\n};\n\ntype StateProps = {\n shouldSkipHistoryAnimations?: boolean;\n};\n\nconst Modal: FC<OwnProps & StateProps> = ({\n dialogRef,\n title,\n className,\n isOpen,\n header,\n hasCloseButton,\n noBackdrop,\n children,\n onClose,\n onCloseAnimationEnd,\n onEnter,\n shouldSkipHistoryAnimations,\n}) => {\n const {\n shouldRender,\n transitionClassNames,\n } = useShowTransition(\n isOpen, onCloseAnimationEnd, shouldSkipHistoryAnimations, undefined, shouldSkipHistoryAnimations,\n );\n // eslint-disable-next-line no-null/no-null\n const modalRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => (isOpen\n ? captureKeyboardListeners({ onEsc: onClose, onEnter })\n : undefined), [isOpen, onClose, onEnter]);\n useEffect(() => (isOpen && modalRef.current ? trapFocus(modalRef.current) : undefined), [isOpen]);\n\n const { forceClose } = useHistoryBack(isOpen, onClose);\n\n // For modals that are closed by unmounting without changing `isOpen` to `false`\n useEffect(() => {\n return () => {\n if (isOpen) {\n forceClose();\n }\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffectWithPrevDeps(([prevIsOpen]) => {\n document.body.classList.toggle('has-open-dialog', isOpen);\n if (isOpen || (!isOpen && prevIsOpen !== undefined)) {\n dispatchHeavyAnimationEvent(ANIMATION_DURATION);\n }\n\n return () => {\n document.body.classList.remove('has-open-dialog');\n };\n }, [isOpen]);\n\n const lang = useLang();\n\n if (!shouldRender) {\n return undefined;\n }\n\n function renderHeader() {\n if (header) {\n return header;\n }\n\n if (!title) {\n return undefined;\n }\n\n return (\n <div className=\"modal-header\">\n {hasCloseButton && (\n <Button\n round\n color=\"translucent\"\n size=\"smaller\"\n ariaLabel={lang('Close')}\n onClick={onClose}\n >\n <i className=\"icon-close\" />\n </Button>\n )}\n <div className=\"modal-title\">{title}</div>\n </div>\n );\n }\n\n const fullClassName = buildClassName(\n 'Modal',\n className,\n transitionClassNames,\n noBackdrop && 'transparent-backdrop',\n );\n\n return (\n <Portal>\n <div\n ref={modalRef}\n className={fullClassName}\n tabIndex={-1}\n role=\"dialog\"\n >\n <div className=\"modal-container\">\n <div className=\"modal-backdrop\" onClick={onClose} />\n <div className=\"modal-dialog\" ref={dialogRef}>\n {renderHeader()}\n <div className=\"modal-content custom-scroll\">\n {children}\n </div>\n </div>\n </div>\n </div>\n </Portal>\n );\n};\n\nexport default Modal;\n","export default function trapFocus(element: HTMLElement) {\n function handleKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Tab') {\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusableElements = Array.from(\n element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'),\n ) as HTMLElement[];\n if (!focusableElements.length) {\n return;\n }\n\n const currentFocusedIndex = focusableElements.findIndex((em) => em.isSameNode(document.activeElement));\n let newFocusedIndex = 0;\n if (currentFocusedIndex >= 0) {\n if (e.shiftKey) {\n newFocusedIndex = currentFocusedIndex > 0\n ? currentFocusedIndex - 1\n : focusableElements.length - 1;\n } else {\n newFocusedIndex = currentFocusedIndex < focusableElements.length - 1\n ? currentFocusedIndex + 1\n : 0;\n }\n }\n\n focusableElements[newFocusedIndex].focus();\n }\n\n document.addEventListener('keydown', handleKeyDown, false);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown, false);\n };\n}\n","import {\n FC, useRef, useLayoutEffect, VirtualElement,\n} from '../../lib/teact/teact';\nimport TeactDOM from '../../lib/teact/teact-dom';\n\ntype OwnProps = {\n containerId?: string;\n className?: string;\n children: React.ReactNode;\n};\n\nconst Portal: FC<OwnProps> = ({ containerId, className, children }) => {\n const elementRef = useRef<HTMLDivElement>();\n if (!elementRef.current) {\n elementRef.current = document.createElement('div');\n }\n\n useLayoutEffect(() => {\n const container = document.querySelector<HTMLDivElement>(containerId || '#portals');\n if (!container) {\n return undefined;\n }\n\n const element = elementRef.current!;\n if (className) {\n element.classList.add(className);\n }\n\n container.appendChild(element);\n\n return () => {\n TeactDOM.render(undefined, element);\n container.removeChild(element);\n };\n }, [className, containerId]);\n\n return TeactDOM.render(children as VirtualElement, elementRef.current);\n};\n\nexport default Portal;\n"],"names":["STICKER_SIZE","IS_SINGLE_COLUMN_LAYOUT","STICKER_SIZE_AUTH_MOBILE","STICKER_SIZE_AUTH","memo","code","codeLength","trackingDirection","isTracking","isBig","idleMonkeyData","setIdleMonkeyData","useState","trackingMonkeyData","setTrackingMonkeyData","isFirstMonkeyLoaded","setIsFirstMonkeyLoaded","TRACKING_FRAMES_PER_SYMBOL","useEffect","getAnimationData","then","handleFirstMonkeyLoad","useCallback","id","className","AnimatedSticker","size","STICKER_SIZE_TWO_FA","undefined","animationData","play","onLoad","playSegment","startFrame","length","endFrame","getTrackingFrames","speed","noLoop","withGlobal","global","pick","authPhoneNumber","authIsCodeViaApp","authIsLoading","authError","setAuthCode","returnToAuthPhoneNumber","clearAuthError","getActions","lang","useLang","inputRef","useRef","setCode","setIsTracking","setTrackingDirection","IS_TOUCH_ENV","current","focus","useHistoryBack","onCodeChange","e","currentTarget","target","value","replace","substr","onClick","role","tabIndex","title","renderText","InputText","ref","label","onInput","error","autoComplete","inputMode","Loading","authHint","setAuthPassword","showPassword","setShowPassword","handleChangePasswordVisibility","isVisible","handleSubmit","password","isPasswordVisible","PasswordForm","clearError","hint","isLoading","onChangePasswordVisibility","onSubmit","signUp","uploadProfilePhoto","isButtonShown","setIsButtonShown","croppedFile","setCroppedFile","firstName","setFirstName","lastName","setLastName","handleFirstNameChange","event","handleLastNameChange","action","method","preventDefault","file","AvatarEditable","onChange","Button","type","ripple","FOCUS_DELAY_TIMEOUT_MS","placeholder","submitLabel","onInputChange","setPassword","canSubmit","setCanSubmit","setTimeout","requestAnimationFrame","select","buildClassName","dir","isRtl","MIN_PASSWORD_LENGTH","SEGMENT_COVER_EYES","SEGMENT_UNCOVER_EYE","SEGMENT_COVER_EYE","closeMonkeyData","setCloseMonkeyData","peekMonkeyData","setPeekMonkeyData","isPeekShown","setIsPeekShown","cropperResultOptions","quality","format","circle","width","height","Croppie","croppiePromise","cropper","onClose","isCroppieReady","setIsCroppieReady","async","imgFile","cropContainer","document","getElementById","offsetWidth","offsetHeight","enableZoom","boundary","viewport","dataUri","blobToDataUri","bind","url","err","DEBUG","console","initCropper","default","ensureCroppie","handleCropClick","result","croppedImg","blobToFile","Modal","isOpen","Boolean","hasCloseButton","round","color","ariaLabel","disabled","currentAvatarBlobUrl","selectedFile","setSelectedFile","croppedBlobUrl","setCroppedBlobUrl","handleAvatarCrop","URL","revokeObjectURL","createObjectURL","handleModalClose","labelClassName","files","accept","src","alt","dialogRef","header","noBackdrop","children","onCloseAnimationEnd","onEnter","shouldSkipHistoryAnimations","shouldRender","transitionClassNames","useShowTransition","modalRef","captureKeyboardListeners","onEsc","element","handleKeyDown","key","stopPropagation","focusableElements","Array","from","querySelectorAll","currentFocusedIndex","findIndex","em","isSameNode","activeElement","newFocusedIndex","shiftKey","addEventListener","removeEventListener","trapFocus","forceClose","useEffectWithPrevDeps","prevIsOpen","body","classList","toggle","dispatchHeavyAnimationEvent","remove","fullClassName","Portal","containerId","elementRef","createElement","useLayoutEffect","container","querySelector","add","appendChild","TeactDOM","removeChild"],"sourceRoot":""} |