login-Kt8VraJ2.js 20 KB

1
  1. import{$n as e,Br as t,Gn as n,Gr as r,Gt as i,Jr as a,Kr as o,On as s,Qn as c,Rn as l,Ur as u,Vn as d,Wn as f,Wr as p,Xt as m,Yn as h,Yr as g,Zr as _,_r as v,a as y,c as b,d as x,f as S,h as C,hr as w,i as T,jr as E,l as D,m as O,mn as ee,n as k,o as A,ot as j,p as M,pr as N,qn as P,r as F,rr as I,s as L,u as R,un as z,wt as B,x as V,yr as H,zn as U,zr as W}from"./styles-DVUJSal8.js";var G=_(r()),K=_(a()),q=function(e,t){if(!e)return null;var n={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return t?{left:0,right:0,width:0,top:n.top,bottom:n.bottom,height:n.height}:{left:n.left,right:n.right,width:n.width,top:0,bottom:0,height:0}},J=function(e){return e===void 0?void 0:`${e}px`};function te(e){var t=e.prefixCls,n=e.containerRef,r=e.value,i=e.getValueIndex,a=e.motionName,o=e.onMotionStart,s=e.onMotionEnd,c=e.direction,l=e.vertical,u=l===void 0?!1:l,d=K.useRef(null),f=H(K.useState(r),2),p=f[0],m=f[1],h=function(e){var r=i(e),a=n.current?.querySelectorAll(`.${t}-item`)[r];return a?.offsetParent&&a},g=H(K.useState(null),2),_=g[0],v=g[1],y=H(K.useState(null),2),b=y[0],x=y[1];N(function(){if(p!==r){var e=h(p),t=h(r),n=q(e,u),i=q(t,u);m(r),v(n),x(i),e&&t?o():s()}},[r]);var S=K.useMemo(function(){return J(u?_?.top??0:c===`rtl`?-_?.right:_?.left)},[u,c,_]),C=K.useMemo(function(){return J(u?b?.top??0:c===`rtl`?-b?.right:b?.left)},[u,c,b]);return!_||!b?null:K.createElement(U,{visible:!0,motionName:a,motionAppear:!0,onAppearStart:function(){return u?{transform:`translateY(var(--thumb-start-top))`,height:`var(--thumb-start-height)`}:{transform:`translateX(var(--thumb-start-left))`,width:`var(--thumb-start-width)`}},onAppearActive:function(){return u?{transform:`translateY(var(--thumb-active-top))`,height:`var(--thumb-active-height)`}:{transform:`translateX(var(--thumb-active-left))`,width:`var(--thumb-active-width)`}},onVisibleChanged:function(){v(null),x(null),s()}},function(e,n){var r=e.className,i=e.style,a=W(W({},i),{},{"--thumb-start-left":S,"--thumb-start-width":J(_?.width),"--thumb-active-left":C,"--thumb-active-width":J(b?.width),"--thumb-start-top":S,"--thumb-start-height":J(_?.height),"--thumb-active-top":C,"--thumb-active-height":J(b?.height)}),o={ref:E(d,n),style:a,className:(0,G.default)(`${t}-thumb`,r)};return K.createElement(`div`,o)})}var ne=[`prefixCls`,`direction`,`vertical`,`options`,`disabled`,`defaultValue`,`value`,`name`,`onChange`,`className`,`motionName`];function re(e){if(e.title!==void 0)return e.title;if(u(e.label)!==`object`)return e.label?.toString()}function ie(e){return e.map(function(e){if(u(e)===`object`&&e!==null){var t=re(e);return W(W({},e),{},{title:t})}return{label:e?.toString(),title:e?.toString(),value:e}})}var ae=function(e){var n=e.prefixCls,r=e.className,i=e.disabled,a=e.checked,o=e.label,s=e.title,c=e.value,l=e.name,u=e.onChange,d=e.onFocus,f=e.onBlur,p=e.onKeyDown,m=e.onKeyUp,h=e.onMouseDown;return K.createElement(`label`,{className:(0,G.default)(r,t({},`${n}-item-disabled`,i)),onMouseDown:h},K.createElement(`input`,{name:l,className:`${n}-item-input`,type:`radio`,disabled:i,checked:a,onChange:function(e){i||u(e,c)},onFocus:d,onBlur:f,onKeyDown:p,onKeyUp:m}),K.createElement(`div`,{className:`${n}-item-label`,title:s},o))},oe=K.forwardRef(function(n,r){var i=n.prefixCls,a=i===void 0?`rc-segmented`:i,o=n.direction,s=n.vertical,c=n.options,l=c===void 0?[]:c,u=n.disabled,d=n.defaultValue,f=n.value,m=n.name,h=n.onChange,g=n.className,_=g===void 0?``:g,y=n.motionName,b=y===void 0?`thumb-motion`:y,x=v(n,ne),S=K.useRef(null),C=K.useMemo(function(){return E(S,r)},[S,r]),w=K.useMemo(function(){return ie(l)},[l]),T=H(e(w[0]?.value,{value:f,defaultValue:d}),2),D=T[0],O=T[1],k=H(K.useState(!1),2),A=k[0],j=k[1],M=function(e,t){O(t),h?.(t)},N=ee(x,[`children`]),P=H(K.useState(!1),2),F=P[0],I=P[1],L=H(K.useState(!1),2),R=L[0],z=L[1],B=function(){z(!0)},V=function(){z(!1)},U=function(){I(!1)},W=function(e){e.key===`Tab`&&I(!0)},q=function(e){var t=w.findIndex(function(e){return e.value===D}),n=w.length,r=w[(t+e+n)%n];r&&(O(r.value),h?.(r.value))},J=function(e){switch(e.key){case`ArrowLeft`:case`ArrowUp`:q(-1);break;case`ArrowRight`:case`ArrowDown`:q(1);break}};return K.createElement(`div`,p({role:`radiogroup`,"aria-label":`segmented control`,tabIndex:u?void 0:0,"aria-orientation":s?`vertical`:`horizontal`},N,{className:(0,G.default)(a,t(t(t({},`${a}-rtl`,o===`rtl`),`${a}-disabled`,u),`${a}-vertical`,s),_),ref:C}),K.createElement(`div`,{className:`${a}-group`},K.createElement(te,{vertical:s,prefixCls:a,value:D,containerRef:S,motionName:`${a}-${b}`,direction:o,getValueIndex:function(e){return w.findIndex(function(t){return t.value===e})},onMotionStart:function(){j(!0)},onMotionEnd:function(){j(!1)}}),w.map(function(e){return K.createElement(ae,p({},e,{name:m,key:e.value,prefixCls:a,className:(0,G.default)(e.className,`${a}-item`,t(t({},`${a}-item-selected`,e.value===D&&!A),`${a}-item-focused`,R&&F&&e.value===D)),checked:e.value===D,onChange:M,onFocus:B,onBlur:V,onKeyDown:J,onKeyUp:W,onMouseDown:U,disabled:!!u||!!e.disabled}))})))});function se(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:`not-allowed`}}}function ce(e){return{background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}var le=Object.assign({overflow:`hidden`},h),ue=e=>{let{componentCls:t}=e,r=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),i=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},P(e)),{display:`inline-block`,padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`}),n(e)),{[`${t}-group`]:{position:`relative`,display:`flex`,alignItems:`stretch`,justifyItems:`flex-start`,flexDirection:`row`,width:`100%`},[`&${t}-rtl`]:{direction:`rtl`},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:`column`},[`${t}-thumb`]:{width:`100%`,height:0,padding:`0 ${w(e.paddingXXS)}`}},[`&${t}-block`]:{display:`flex`},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:`relative`,textAlign:`center`,cursor:`pointer`,transition:`color ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,transform:`translateZ(0)`,"&-selected":Object.assign(Object.assign({},ce(e)),{color:e.itemSelectedColor}),"&-focused":f(e),"&::after":{content:`""`,position:`absolute`,zIndex:-1,width:`100%`,height:`100%`,top:0,insetInlineStart:0,borderRadius:`inherit`,opacity:0,transition:`opacity ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,pointerEvents:`none`},[`&:not(${t}-item-selected):not(${t}-item-disabled)`]:{"&:hover, &:active":{color:e.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:e.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:r,lineHeight:w(r),padding:`0 ${w(e.segmentedPaddingHorizontal)}`},le),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:`none`}},[`${t}-thumb`]:Object.assign(Object.assign({},ce(e)),{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:`100%`,padding:`${w(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:`transparent`}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:i,lineHeight:w(i),padding:`0 ${w(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:a,lineHeight:w(a),padding:`0 ${w(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),se(`&-disabled ${t}-item`,e)),se(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:`transform, width`},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}})}},de=d(`Segmented`,e=>{let{lineWidth:t,calc:n}=e;return ue(c(e,{segmentedPaddingHorizontal:n(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:n(e.controlPaddingHorizontalSM).sub(t).equal()}))},e=>{let{colorTextLabel:t,colorText:n,colorFillSecondary:r,colorBgElevated:i,colorFill:a,lineWidthBold:o,colorBgLayout:s}=e;return{trackPadding:o,trackBg:s,itemColor:t,itemHoverColor:n,itemHoverBg:r,itemSelectedBg:i,itemActiveBg:a,itemSelectedColor:n}}),fe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function pe(e){return typeof e==`object`&&!!e?.icon}var me=K.forwardRef((e,t)=>{let n=i(),{prefixCls:r,className:a,rootClassName:o,block:s,options:c=[],size:l=`middle`,style:u,vertical:d,shape:f=`default`,name:p=n}=e,m=fe(e,[`prefixCls`,`className`,`rootClassName`,`block`,`options`,`size`,`style`,`vertical`,`shape`,`name`]),{getPrefixCls:h,direction:g,className:_,style:v}=I(`segmented`),y=h(`segmented`,r),[b,x,S]=de(y),C=z(l),w=K.useMemo(()=>c.map(e=>{if(pe(e)){let{icon:t,label:n}=e,r=fe(e,[`icon`,`label`]);return Object.assign(Object.assign({},r),{label:K.createElement(K.Fragment,null,K.createElement(`span`,{className:`${y}-item-icon`},t),n&&K.createElement(`span`,null,n))})}return e}),[c,y]),T=(0,G.default)(a,o,_,{[`${y}-block`]:s,[`${y}-sm`]:C===`small`,[`${y}-lg`]:C===`large`,[`${y}-vertical`]:d,[`${y}-shape-${f}`]:f===`round`},x,S),E=Object.assign(Object.assign({},v),u);return b(K.createElement(oe,Object.assign({},m,{name:p,className:T,style:E,options:w,ref:t,prefixCls:y,direction:g,vertical:d})))}),he=_(g((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z`}},{tag:`path`,attrs:{d:`M376.9 656.4c1.8-33.5 15.7-64.7 39.5-88.6 25.4-25.5 60-39.8 96-39.8 36.2 0 70.3 14.1 96 39.8 1.4 1.4 2.7 2.8 4.1 4.3l-25 19.6a8 8 0 003 14.1l98.2 24c5 1.2 9.9-2.6 9.9-7.7l.5-101.3c0-6.7-7.6-10.5-12.9-6.3L663 532.7c-36.6-42-90.4-68.6-150.5-68.6-107.4 0-195 85.1-199.4 191.7-.2 4.5 3.4 8.3 8 8.3H369c4.2-.1 7.7-3.4 7.9-7.7zM703 664h-47.9c-4.2 0-7.7 3.3-8 7.6-1.8 33.5-15.7 64.7-39.5 88.6-25.4 25.5-60 39.8-96 39.8-36.2 0-70.3-14.1-96-39.8-1.4-1.4-2.7-2.8-4.1-4.3l25-19.6a8 8 0 00-3-14.1l-98.2-24c-5-1.2-9.9 2.6-9.9 7.7l-.4 101.4c0 6.7 7.6 10.5 12.9 6.3l23.2-18.2c36.6 42 90.4 68.6 150.5 68.6 107.4 0 195-85.1 199.4-191.7.2-4.5-3.4-8.3-8-8.3z`}}]},name:`cloud-sync`,theme:`outlined`}}))());function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}var ge=K.forwardRef((e,t)=>K.createElement(x,Y({},e,{ref:t,icon:he.default}))),_e=_(g((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={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`}}))());function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(this,arguments)}var Z=K.forwardRef((e,t)=>K.createElement(x,X({},e,{ref:t,icon:_e.default}))),ve=o();function ye(e,t={}){return xe(e)?{mode:`login`,path:`/login`,message:String(t.message||`注册成功,请先验证邮箱,验证后等待管理员审核。`),redirectTo:``}:{mode:`login`,path:`/login`,message:``,redirectTo:`/`}}function be(e,t=``){let n=String(e||``);return n.endsWith(`/register`)?{mode:`register`,token:``}:n.endsWith(`/forgot-password`)?{mode:`forgot`,token:``}:n.endsWith(`/resend-verification`)?{mode:`resend`,token:``}:n.endsWith(`/reset-password`)?{mode:`reset`,token:new URLSearchParams(String(t||``)).get(`token`)||``}:{mode:`login`,token:``}}function xe(e){return String(e||``).endsWith(`/register`)}var Q=A();function Se(){let{locale:e,locales:t,setLocale:n,t:r}=y(),i=be(window.location.pathname,window.location.search),[a,o]=(0,K.useState)(i.mode),[c,l]=(0,K.useState)(i.token),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`error`),[h,g]=(0,K.useState)(!1),[_]=O.useForm(),[v]=O.useForm(),[x]=O.useForm(),[w]=O.useForm();(0,K.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`error`);e&&(d(e),p(`error`),window.history.replaceState(null,``,window.location.pathname)),i.mode===`reset`&&!i.token&&(d(r(`auth.resetTokenMissing`)),p(`error`))},[]);let T=(0,K.useMemo)(()=>[{label:r(`auth.login`),value:`login`},{label:r(`auth.register`),value:`register`}],[r]);async function E(e,t){g(!0),d(``),p(`error`);try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i=await n.json().catch(()=>({}));if(!n.ok)throw Error(i.error||r(`auth.requestFailed`));let a=ye(e,i);if(a.redirectTo){window.location.href=a.redirectTo;return}A(a.mode),d(a.message),p(`success`)}catch(e){d(e instanceof Error?e.message:r(`auth.requestFailed`)),p(`error`)}finally{g(!1)}}async function ee(e,t){g(!0),d(``),p(`error`);try{let n=e===`forgot`?await F.forgotPassword(t.email):await F.resendVerification(t.email);d(n.message),p(`success`)}catch(e){d(e instanceof Error?e.message:r(`auth.requestFailed`)),p(`error`)}finally{g(!1)}}async function k(e){if(!c){d(r(`auth.resetTokenMissing`)),p(`error`);return}g(!0),d(``),p(`error`);try{let t=await F.resetPassword(c,e.password);A(`login`),l(``),d(t.message),p(`success`),w.resetFields()}catch(e){d(e instanceof Error?e.message:r(`auth.requestFailed`)),p(`error`)}finally{g(!1)}}function A(e){o(e),d(``),p(`error`),window.history.replaceState(null,``,Ce(e))}return(0,Q.jsxs)(`main`,{className:`auth-page`,children:[(0,Q.jsxs)(`section`,{className:`auth-brand-panel`,"aria-label":`MailHub`,children:[(0,Q.jsxs)(`div`,{className:`auth-brand-top`,children:[(0,Q.jsx)(`div`,{className:`brand-logo auth-logo`,"aria-hidden":`true`,children:`MH`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(S.Title,{level:1,children:`MailHub`}),(0,Q.jsx)(S.Text,{children:r(`auth.subtitle`)})]})]}),(0,Q.jsxs)(`div`,{className:`auth-signal-list`,children:[(0,Q.jsx)($,{icon:(0,Q.jsx)(ge,{}),title:`DNS`,text:r(`auth.valueDns`)}),(0,Q.jsx)($,{icon:(0,Q.jsx)(b,{}),title:`SMTP`,text:r(`auth.valueIsolation`)}),(0,Q.jsx)($,{icon:(0,Q.jsx)(R,{}),title:`API`,text:r(`auth.valueObservability`)})]})]}),(0,Q.jsxs)(`section`,{className:`auth-form-panel`,children:[(0,Q.jsx)(`div`,{className:`auth-language-row`,children:(0,Q.jsx)(j,{value:e,options:t,onChange:n,className:`language-select`})}),(0,Q.jsx)(V,{className:`auth-card`,children:(0,Q.jsxs)(C,{direction:`vertical`,size:22,className:`full-width`,children:[(0,Q.jsxs)(`div`,{className:`auth-heading`,children:[(0,Q.jsx)(S.Text,{className:`auth-eyebrow`,children:r(a===`register`?`auth.registerEyebrow`:`auth.loginEyebrow`)}),(0,Q.jsx)(S.Title,{level:2,children:we(a,r)})]}),a===`login`||a===`register`?(0,Q.jsx)(me,{block:!0,value:a,options:T,onChange:e=>A(e)}):null,u?(0,Q.jsx)(s,{type:f,showIcon:!0,message:u}):null,a===`login`?(0,Q.jsxs)(O,{form:_,layout:`vertical`,onFinish:e=>E(`/api/login`,e),requiredMark:!1,children:[(0,Q.jsx)(O.Item,{name:`username`,label:r(`auth.usernameOrEmail`),rules:[{required:!0,message:r(`auth.usernameOrEmail`)}],children:(0,Q.jsx)(M,{prefix:(0,Q.jsx)(L,{}),autoComplete:`username`,autoFocus:!0})}),(0,Q.jsx)(O.Item,{name:`password`,label:r(`auth.password`),rules:[{required:!0,message:r(`auth.password`)}],children:(0,Q.jsx)(M.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`current-password`})}),(0,Q.jsx)(m,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:r(`auth.submitLogin`)}),(0,Q.jsxs)(`div`,{className:`auth-link-row`,children:[(0,Q.jsx)(m,{type:`link`,onClick:()=>A(`forgot`),children:r(`auth.forgotPassword`)}),(0,Q.jsx)(m,{type:`link`,onClick:()=>A(`resend`),children:r(`auth.resendVerification`)})]})]}):null,a===`register`?(0,Q.jsxs)(O,{form:v,layout:`vertical`,onFinish:e=>E(`/api/register`,e),requiredMark:!1,children:[(0,Q.jsx)(O.Item,{name:`username`,label:r(`auth.username`),rules:[{required:!0,min:3,message:r(`auth.username`)}],children:(0,Q.jsx)(M,{prefix:(0,Q.jsx)(L,{}),autoComplete:`username`,autoFocus:!0})}),(0,Q.jsx)(O.Item,{name:`email`,label:r(`auth.email`),rules:[{required:!0,type:`email`,message:r(`auth.email`)}],children:(0,Q.jsx)(M,{prefix:(0,Q.jsx)(D,{}),autoComplete:`email`,placeholder:r(`auth.emailPlaceholder`)})}),(0,Q.jsx)(O.Item,{name:`password`,label:r(`auth.password`),rules:[{required:!0,min:8,message:r(`auth.password`)}],children:(0,Q.jsx)(M.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`new-password`})}),(0,Q.jsx)(m,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:r(`auth.registerButton`)})]}):null,a===`forgot`||a===`resend`?(0,Q.jsxs)(O,{form:x,layout:`vertical`,onFinish:e=>ee(a,e),requiredMark:!1,children:[(0,Q.jsx)(O.Item,{name:`email`,label:r(`auth.email`),rules:[{required:!0,type:`email`,message:r(`auth.email`)}],children:(0,Q.jsx)(M,{prefix:(0,Q.jsx)(D,{}),autoComplete:`email`,placeholder:r(`auth.emailPlaceholder`),autoFocus:!0})}),(0,Q.jsx)(m,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:r(a===`forgot`?`auth.forgotPasswordButton`:`auth.resendVerificationButton`)}),(0,Q.jsx)(m,{type:`link`,block:!0,onClick:()=>A(`login`),children:r(`auth.backToLogin`)})]}):null,a===`reset`?(0,Q.jsxs)(O,{form:w,layout:`vertical`,onFinish:k,requiredMark:!1,children:[(0,Q.jsx)(O.Item,{name:`password`,label:r(`auth.newPassword`),rules:[{required:!0,min:8,message:r(`auth.password`)}],children:(0,Q.jsx)(M.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`new-password`,autoFocus:!0})}),(0,Q.jsx)(m,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,disabled:!c,children:r(`auth.resetPasswordButton`)}),(0,Q.jsx)(m,{type:`link`,block:!0,onClick:()=>A(`login`),children:r(`auth.backToLogin`)})]}):null]})})]})]})}function Ce(e){return{login:`/login`,register:`/register`,forgot:`/forgot-password`,resend:`/resend-verification`,reset:`/reset-password`}[e]}function we(e,t){return{login:t(`auth.loginTitle`),register:t(`auth.registerTitle`),forgot:t(`auth.forgotPasswordTitle`),reset:t(`auth.resetPasswordTitle`),resend:t(`auth.resendVerificationTitle`)}[e]}function $({icon:e,title:t,text:n}){return(0,Q.jsxs)(`div`,{className:`auth-signal-item`,children:[(0,Q.jsx)(`span`,{children:e}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(S.Text,{children:t}),(0,Q.jsx)(S.Title,{level:5,children:n})]})]})}(0,ve.createRoot)(document.getElementById(`auth-root`)).render((0,Q.jsx)(l,{theme:k,children:(0,Q.jsx)(B,{children:(0,Q.jsx)(T,{children:(0,Q.jsx)(Se,{})})})}));