{"version":3,"file":"page_login_phone-ea2577b3.js","sources":["../../../../../shared/node_modules/@ant-design/icons-svg/es/asn/LockOutlined.js","../../../../../shared/node_modules/@ant-design/icons/es/icons/LockOutlined.js","../../../../../shared/node_modules/@ant-design/icons-svg/es/asn/MobileOutlined.js","../../../../../shared/node_modules/@ant-design/icons/es/icons/MobileOutlined.js","../../../../../shared/node_modules/@ant-design/icons-svg/es/asn/UserOutlined.js","../../../../../shared/node_modules/@ant-design/icons/es/icons/UserOutlined.js","../../../../../shared/node_modules/@ant-design/pro-form/es/components/Captcha/index.js","../../../../../shared/node_modules/@ant-design/pro-form/es/components/Checkbox/index.js","../../../../../shared/node_modules/@ant-design/pro-form/es/layouts/LoginForm/style.js","../../../../../shared/node_modules/@ant-design/pro-form/es/layouts/LoginForm/index.js","../../../../../shared/node_modules/spark-md5/spark-md5.js","../../../app/javascript/components/PhoneLogin.jsx","../../../app/javascript/entrypoints/page_login_phone.jsx"],"sourcesContent":["// This icon file is generated automatically.\nvar LockOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z\" } }] }, \"name\": \"lock\", \"theme\": \"outlined\" };\nexport default LockOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport LockOutlinedSvg from \"@ant-design/icons-svg/es/asn/LockOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar LockOutlined = function LockOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: LockOutlinedSvg\n }));\n};\nif (process.env.NODE_ENV !== 'production') {\n LockOutlined.displayName = 'LockOutlined';\n}\nexport default /*#__PURE__*/React.forwardRef(LockOutlined);","// This icon file is generated automatically.\nvar MobileOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M744 62H280c-35.3 0-64 28.7-64 64v768c0 35.3 28.7 64 64 64h464c35.3 0 64-28.7 64-64V126c0-35.3-28.7-64-64-64zm-8 824H288V134h448v752zM472 784a40 40 0 1080 0 40 40 0 10-80 0z\" } }] }, \"name\": \"mobile\", \"theme\": \"outlined\" };\nexport default MobileOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport MobileOutlinedSvg from \"@ant-design/icons-svg/es/asn/MobileOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar MobileOutlined = function MobileOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: MobileOutlinedSvg\n }));\n};\nif (process.env.NODE_ENV !== 'production') {\n MobileOutlined.displayName = 'MobileOutlined';\n}\nexport default /*#__PURE__*/React.forwardRef(MobileOutlined);","// This icon file is generated automatically.\nvar UserOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z\" } }] }, \"name\": \"user\", \"theme\": \"outlined\" };\nexport default UserOutlined;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\n\nimport * as React from 'react';\nimport UserOutlinedSvg from \"@ant-design/icons-svg/es/asn/UserOutlined\";\nimport AntdIcon from \"../components/AntdIcon\";\nvar UserOutlined = function UserOutlined(props, ref) {\n return /*#__PURE__*/React.createElement(AntdIcon, _extends({}, props, {\n ref: ref,\n icon: UserOutlinedSvg\n }));\n};\nif (process.env.NODE_ENV !== 'production') {\n UserOutlined.displayName = 'UserOutlined';\n}\nexport default /*#__PURE__*/React.forwardRef(UserOutlined);","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _regeneratorRuntime from \"@babel/runtime/helpers/esm/regeneratorRuntime\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nvar _excluded = [\"rules\", \"name\", \"phoneName\", \"fieldProps\", \"captchaTextRender\", \"captchaProps\"];\nimport { Button, Form, Input } from 'antd';\nimport React, { useEffect, useImperativeHandle, useState } from 'react';\nimport { createField } from \"../../BaseForm/createField\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nvar BaseProFormCaptcha = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var form = Form.useFormInstance();\n var _useState = useState(props.countDown || 60),\n _useState2 = _slicedToArray(_useState, 2),\n count = _useState2[0],\n setCount = _useState2[1];\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n timing = _useState4[0],\n setTiming = _useState4[1];\n var _useState5 = useState(),\n _useState6 = _slicedToArray(_useState5, 2),\n loading = _useState6[0],\n setLoading = _useState6[1];\n // 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props tabUtil\n var rules = props.rules,\n name = props.name,\n phoneName = props.phoneName,\n fieldProps = props.fieldProps,\n _props$captchaTextRen = props.captchaTextRender,\n captchaTextRender = _props$captchaTextRen === void 0 ? function (paramsTiming, paramsCount) {\n return paramsTiming ? \"\".concat(paramsCount, \" \\u79D2\\u540E\\u91CD\\u65B0\\u83B7\\u53D6\") : '获取验证码';\n } : _props$captchaTextRen,\n captchaProps = props.captchaProps,\n restProps = _objectWithoutProperties(props, _excluded);\n var onGetCaptcha = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(mobile) {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n setLoading(true);\n _context.next = 4;\n return restProps.onGetCaptcha(mobile);\n case 4:\n setLoading(false);\n setTiming(true);\n _context.next = 13;\n break;\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](0);\n setTiming(false);\n setLoading(false);\n // eslint-disable-next-line no-console\n console.log(_context.t0);\n case 13:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[0, 8]]);\n }));\n return function onGetCaptcha(_x) {\n return _ref.apply(this, arguments);\n };\n }();\n /**\n * 暴露ref方法\n */\n useImperativeHandle(ref, function () {\n return {\n startTiming: function startTiming() {\n return setTiming(true);\n },\n endTiming: function endTiming() {\n return setTiming(false);\n }\n };\n });\n useEffect(function () {\n var interval = 0;\n var countDown = props.countDown;\n if (timing) {\n interval = window.setInterval(function () {\n setCount(function (preSecond) {\n if (preSecond <= 1) {\n setTiming(false);\n clearInterval(interval);\n // 重置秒数\n return countDown || 60;\n }\n return preSecond - 1;\n });\n }, 1000);\n }\n return function () {\n return clearInterval(interval);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [timing]);\n return /*#__PURE__*/_jsxs(\"div\", {\n style: _objectSpread(_objectSpread({}, fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.style), {}, {\n display: 'flex',\n alignItems: 'center'\n }),\n ref: ref,\n children: [/*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({}, fieldProps), {}, {\n style: {\n flex: 1,\n transition: 'width .3s',\n marginRight: 8\n }\n })), /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({\n style: {\n display: 'block'\n },\n disabled: timing,\n loading: loading\n }, captchaProps), {}, {\n onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _mobile;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n if (!phoneName) {\n _context2.next = 9;\n break;\n }\n _context2.next = 4;\n return form.validateFields([phoneName].flat(1));\n case 4:\n _mobile = form.getFieldValue([phoneName].flat(1));\n _context2.next = 7;\n return onGetCaptcha(_mobile);\n case 7:\n _context2.next = 11;\n break;\n case 9:\n _context2.next = 11;\n return onGetCaptcha('');\n case 11:\n _context2.next = 16;\n break;\n case 13:\n _context2.prev = 13;\n _context2.t0 = _context2[\"catch\"](0);\n // eslint-disable-next-line no-console\n console.log(_context2.t0);\n case 16:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, null, [[0, 13]]);\n })),\n children: captchaTextRender(timing, count)\n }))]\n });\n});\nvar ProFormCaptcha = createField(BaseProFormCaptcha);\nexport default ProFormCaptcha;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"options\", \"fieldProps\", \"proFieldProps\", \"valueEnum\"];\nimport { runFunction } from '@ant-design/pro-utils';\nimport { Checkbox } from 'antd';\nimport React from 'react';\nimport { createField } from \"../../BaseForm/createField\";\nimport ProFormField from \"../Field\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar CheckboxGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var options = _ref.options,\n fieldProps = _ref.fieldProps,\n proFieldProps = _ref.proFieldProps,\n valueEnum = _ref.valueEnum,\n rest = _objectWithoutProperties(_ref, _excluded);\n return /*#__PURE__*/_jsx(ProFormField, _objectSpread({\n ref: ref,\n valueType: \"checkbox\",\n valueEnum: runFunction(valueEnum, undefined),\n fieldProps: _objectSpread({\n options: options\n }, fieldProps),\n lightProps: _objectSpread({\n labelFormatter: function labelFormatter() {\n return /*#__PURE__*/_jsx(ProFormField, _objectSpread({\n ref: ref,\n valueType: \"checkbox\",\n mode: \"read\",\n valueEnum: runFunction(valueEnum, undefined),\n filedConfig: {\n customLightMode: true\n },\n fieldProps: _objectSpread({\n options: options\n }, fieldProps),\n proFieldProps: proFieldProps\n }, rest));\n }\n }, rest.lightProps),\n proFieldProps: proFieldProps\n }, rest));\n});\n/**\n * 多选框的\n *\n * @param\n */\nvar ProFormCheckboxComponents = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {\n var fieldProps = _ref2.fieldProps,\n children = _ref2.children;\n return /*#__PURE__*/_jsx(Checkbox, _objectSpread(_objectSpread({\n ref: ref\n }, fieldProps), {}, {\n children: children\n }));\n});\nvar ProFormCheckbox = createField(ProFormCheckboxComponents, {\n valuePropName: 'checked'\n});\nvar WrappedProFormCheckbox = ProFormCheckbox;\nWrappedProFormCheckbox.Group = CheckboxGroup;\nexport default WrappedProFormCheckbox;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { useStyle as useAntdStyle } from '@ant-design/pro-provider';\nvar genLoginFormStyle = function genLoginFormStyle(token) {\n var _ref;\n return _ref = {}, _defineProperty(_ref, token.componentCls, {\n '&-container': {\n display: 'flex',\n flex: '1',\n flexDirection: 'column',\n height: '100%',\n paddingInline: 32,\n paddingBlock: 24,\n overflow: 'auto',\n background: 'inherit'\n },\n '&-top': {\n textAlign: 'center'\n },\n '&-header': {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '44px',\n lineHeight: '44px',\n a: {\n textDecoration: 'none'\n }\n },\n '&-title': {\n position: 'relative',\n insetBlockStart: '2px',\n color: '@heading-color',\n fontWeight: '600',\n fontSize: '33px'\n },\n '&-logo': {\n width: '44px',\n height: '44px',\n marginInlineEnd: '16px',\n verticalAlign: 'top',\n img: {\n width: '100%'\n }\n },\n '&-desc': {\n marginBlockStart: '12px',\n marginBlockEnd: '40px',\n color: token.colorTextSecondary,\n fontSize: token.fontSize\n },\n '&-main': {\n minWidth: '328px',\n maxWidth: '580px',\n margin: '0 auto',\n '&-other': {\n marginBlockStart: '24px',\n lineHeight: '22px',\n textAlign: 'start'\n }\n }\n }), _defineProperty(_ref, '@media (min-width: @screen-md-min)', _defineProperty({}, \"\".concat(token.componentCls, \"-container\"), {\n paddingInline: 0,\n paddingBlockStart: 32,\n paddingBlockEnd: 24,\n backgroundRepeat: 'no-repeat',\n backgroundPosition: 'center 110px',\n backgroundSize: '100%'\n })), _ref;\n};\nexport function useStyle(prefixCls) {\n return useAntdStyle('LoginForm', function (token) {\n var loginFormToken = _objectSpread(_objectSpread({}, token), {}, {\n componentCls: \".\".concat(prefixCls)\n });\n return [genLoginFormStyle(loginFormToken)];\n });\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"logo\", \"message\", \"contentStyle\", \"title\", \"subTitle\", \"actions\", \"children\"];\nimport { useIntl } from '@ant-design/pro-provider';\nimport { ConfigProvider } from 'antd';\nimport classNames from 'classnames';\nimport React, { useContext, useMemo } from 'react';\nimport { ProForm } from \"../ProForm\";\nimport { useStyle } from \"./style\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction LoginForm(props) {\n var _proFormProps$submitt;\n var logo = props.logo,\n message = props.message,\n contentStyle = props.contentStyle,\n title = props.title,\n subTitle = props.subTitle,\n actions = props.actions,\n children = props.children,\n proFormProps = _objectWithoutProperties(props, _excluded);\n var intl = useIntl();\n var submitter = proFormProps.submitter === false ? false : _objectSpread(_objectSpread({\n searchConfig: {\n submitText: intl.getMessage('loginForm.submitText', '登录')\n }\n }, proFormProps.submitter), {}, {\n submitButtonProps: _objectSpread({\n size: 'large',\n style: {\n width: '100%'\n }\n }, (_proFormProps$submitt = proFormProps.submitter) === null || _proFormProps$submitt === void 0 ? void 0 : _proFormProps$submitt.submitButtonProps),\n render: function render(_, dom) {\n var _proFormProps$submitt2;\n var loginButton = dom.pop();\n if (typeof (proFormProps === null || proFormProps === void 0 ? void 0 : (_proFormProps$submitt2 = proFormProps.submitter) === null || _proFormProps$submitt2 === void 0 ? void 0 : _proFormProps$submitt2.render) === 'function') {\n var _proFormProps$submitt3, _proFormProps$submitt4;\n return proFormProps === null || proFormProps === void 0 ? void 0 : (_proFormProps$submitt3 = proFormProps.submitter) === null || _proFormProps$submitt3 === void 0 ? void 0 : (_proFormProps$submitt4 = _proFormProps$submitt3.render) === null || _proFormProps$submitt4 === void 0 ? void 0 : _proFormProps$submitt4.call(_proFormProps$submitt3, _, dom);\n }\n return loginButton;\n }\n });\n var context = useContext(ConfigProvider.ConfigContext);\n var baseClassName = context.getPrefixCls('pro-form-login');\n var _useStyle = useStyle(baseClassName),\n wrapSSR = _useStyle.wrapSSR,\n hashId = _useStyle.hashId;\n var getCls = function getCls(className) {\n return \"\".concat(baseClassName, \"-\").concat(className, \" \").concat(hashId);\n };\n\n /** 生成logo 的dom,如果是string 设置为图片 如果是个 dom 就原样保留 */\n var logoDom = useMemo(function () {\n if (!logo) return null;\n if (typeof logo === 'string') {\n return /*#__PURE__*/_jsx(\"img\", {\n src: logo\n });\n }\n return logo;\n }, [logo]);\n return wrapSSR( /*#__PURE__*/_jsxs(\"div\", {\n className: classNames(getCls('container'), hashId),\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: \"\".concat(getCls('top'), \" \").concat(hashId).trim(),\n children: [title || logoDom ? /*#__PURE__*/_jsxs(\"div\", {\n className: \"\".concat(getCls('header')),\n children: [logoDom ? /*#__PURE__*/_jsx(\"span\", {\n className: getCls('logo'),\n children: logoDom\n }) : null, title ? /*#__PURE__*/_jsx(\"span\", {\n className: getCls('title'),\n children: title\n }) : null]\n }) : null, subTitle ? /*#__PURE__*/_jsx(\"div\", {\n className: getCls('desc'),\n children: subTitle\n }) : null]\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: getCls('main'),\n style: _objectSpread({\n width: 328\n }, contentStyle),\n children: [/*#__PURE__*/_jsxs(ProForm, _objectSpread(_objectSpread({\n isKeyPressSubmit: true\n }, proFormProps), {}, {\n submitter: submitter,\n children: [message, children]\n })), actions ? /*#__PURE__*/_jsx(\"div\", {\n className: getCls('main-other'),\n children: actions\n }) : null]\n })]\n }));\n}\nexport { LoginForm };","(function (factory) {\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n define(factory);\n } else {\n // Browser globals (with support for web workers)\n var glob;\n\n try {\n glob = window;\n } catch (e) {\n glob = self;\n }\n\n glob.SparkMD5 = factory();\n }\n}(function (undefined) {\n\n 'use strict';\n\n /*\n * Fastest md5 implementation around (JKM md5).\n * Credits: Joseph Myers\n *\n * @see http://www.myersdaily.org/joseph/javascript/md5-text.html\n * @see http://jsperf.com/md5-shootout/7\n */\n\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n var add32 = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n },\n hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\n\n\n function cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n }\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n // Not sure if it is a bug, however IE10 will always produce a sub array of length 1\n // containing the last element of the parent array if the sub array specified starts\n // beyond the length of the parent array - weird.\n // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue\n a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);\n\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << ((i % 4) << 3);\n }\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n\n return state;\n }\n\n function rhex(n) {\n var s = '',\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n }\n\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n }\n\n // In some cases the fast add32 function cannot be used..\n if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {\n add32 = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n }\n\n // ---------------------------------------------------\n\n /**\n * ArrayBuffer slice polyfill.\n *\n * @see https://github.com/ttaubert/node-arraybuffer-slice\n */\n\n if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = (val | 0) || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n\n return target;\n };\n })();\n }\n\n // ---------------------------------------------------\n\n /**\n * Helpers.\n */\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation.\n *\n * Use this class to perform an incremental md5, otherwise use the\n * static methods instead.\n */\n\n function SparkMD5() {\n // call reset to init the instance\n this.reset();\n }\n\n /**\n * Appends a string.\n * A conversion will be applied if an utf8 string is detected.\n *\n * @param {String} str The string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.append = function (str) {\n // Converts the string to utf8 bytes if necessary\n // Then append as binary\n this.appendBinary(toUtf8(str));\n\n return this;\n };\n\n /**\n * Appends a binary string.\n *\n * @param {String} contents The binary string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.reset = function () {\n this._buff = '';\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n\n return this;\n };\n\n /**\n * Releases memory used by the incremental buffer and other additional\n * resources. If you plan to use the instance again, use reset instead.\n */\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n /**\n * Finish the final calculation based on the tail.\n *\n * @param {Array} tail The tail (will be modified)\n * @param {Number} length The length of the remaining buffer\n */\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n /**\n * Performs the md5 hash on a string.\n * A conversion will be applied if utf8 string is detected.\n *\n * @param {String} str The string\n * @param {Boolean} [raw] True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hash = function (str, raw) {\n // Converts the string to utf8 bytes if necessary\n // Then compute it using the binary function\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n /**\n * Performs the md5 hash on a binary string.\n *\n * @param {String} content The binary string\n * @param {Boolean} [raw] True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation for array buffers.\n *\n * Use this class to perform an incremental md5 ONLY for array buffers.\n */\n SparkMD5.ArrayBuffer = function () {\n // call reset to init the instance\n this.reset();\n };\n\n /**\n * Appends an array buffer.\n *\n * @param {ArrayBuffer} arr The array to be appended\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n\n // Convert buffer to a string\n state.buff = arrayBuffer2Utf8Str(state.buff);\n\n return state;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n // Convert string to buffer\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n /**\n * Performs the md5 hash on an array buffer.\n *\n * @param {ArrayBuffer} arr The array buffer\n * @param {Boolean} [raw] True to get the raw string, false to get the hex one\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n}));\n","import React, { useState, useRef } from \"react\"\nimport {\n LoginForm, \n ProFormCaptcha,\n ProFormCheckbox,\n ProFormText,\n} from \"@ant-design/pro-components\"\nimport { \n LockOutlined,\n MobileOutlined, \n UserOutlined, \n} from \"@ant-design/icons\"\nimport { message, Space, Tabs } from \"antd\"\nimport queryString from \"query-string\"\nimport { post } from \"@rails/request.js\"\nimport SparkMD5 from \"spark-md5\"\n\nconst iconStyles = {\n marginInlineStart: \"16px\",\n color: \"rgba(0, 0, 0, 0.2)\",\n fontSize: \"24px\",\n verticalAlign: \"middle\",\n cursor: \"pointer\",\n}\n\nconst PhoneLogin = (props) => {\n const formRef = useRef(null)\n const [loginType, setLoginType] = useState(\"phone\")\n\n const passwordLogin = async (values) => {\n const user = values\n const response = await post(\"/users/sign_in\", {\n body: JSON.stringify(user),\n })\n if (response.ok) {\n const redirectUrl = response.response?.url || \"/\"\n window.location.href = redirectUrl\n } else {\n message.error(\"用户名或者密码错误\")\n }\n }\n\n const sendSmsCode = async () => {\n const phone = formRef?.current?.getFieldValue(\"phone\")\n if (!phone || !/^1\\d{10}$/.test(phone)) {\n message.error(\"请输入合法的手机号\")\n throw new Error(\"请输入手机号\")\n return\n }\n const timestamp = new Date().getTime()\n const secret = SparkMD5.hash(`phone_${phone}_${timestamp}`)\n const body = {\n phone: phone,\n timestamp: timestamp,\n secret: secret,\n }\n const response = await post(\"/api/user_phones/send_phone_code\", {\n body: JSON.stringify(body),\n })\n if (response.ok) {\n message.success(\"获取验证码成功\")\n } else {\n message.error(\"获取验证码失败,请稍后重试\")\n throw new Error(\"获取验证码错误\")\n }\n }\n\n const phoneLogin = async (values) => {\n const body = { phone: values.phone, phone_code: values.phone_code }\n const response = await post(\"/api/user_phones/phone_login\", {\n body: JSON.stringify(body),\n })\n if (response.ok) {\n const parsed = queryString.parse(location.search)\n const redirectUrl = parsed?.redirect\n if (redirectUrl) {\n window.location.href = redirectUrl\n } else {\n window.location.href = \"/manage\"\n }\n } else {\n const responseBody = await response.json\n message.error(`${responseBody.error},请稍后重试`)\n }\n }\n\n const tryLogin = async (values) => {\n if (loginType === \"phone\") {\n await phoneLogin(values)\n } else {\n await passwordLogin(values)\n }\n }\n\n return (\n <>\n