login-C-Jd8_Pp.js 20 KB

1
  1. import{En as e,Gn as t,Hn as n,Hr as r,In as i,Jt as a,Kr as o,Ln as s,Lr as c,Rr as l,St as u,Un as d,Ur as f,Ut as p,Vr as m,Wr as h,Xn as g,Yr as _,Zn as v,_r as y,a as b,c as x,cn as S,d as C,dr as w,f as T,fn as E,hr as D,i as O,it as k,kr as A,l as j,n as ee,o as M,p as N,pr as P,qn as F,qr as I,r as L,s as R,t as z,tr as B,u as V,y as te,zn as ne}from"./styles-BdD3aAK4.js";var H=_(f()),U=_(o()),W=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}},G=function(e){return e===void 0?void 0:`${e}px`};function re(e){var t=e.prefixCls,n=e.containerRef,r=e.value,i=e.getValueIndex,a=e.motionName,o=e.onMotionStart,l=e.onMotionEnd,u=e.direction,d=e.vertical,f=d===void 0?!1:d,p=U.useRef(null),m=y(U.useState(r),2),h=m[0],g=m[1],_=function(e){var r=i(e),a=n.current?.querySelectorAll(`.${t}-item`)[r];return a?.offsetParent&&a},v=y(U.useState(null),2),b=v[0],x=v[1],S=y(U.useState(null),2),C=S[0],T=S[1];w(function(){if(h!==r){var e=_(h),t=_(r),n=W(e,f),i=W(t,f);g(r),x(n),T(i),e&&t?o():l()}},[r]);var E=U.useMemo(function(){return G(f?b?.top??0:u===`rtl`?-b?.right:b?.left)},[f,u,b]),D=U.useMemo(function(){return G(f?C?.top??0:u===`rtl`?-C?.right:C?.left)},[f,u,C]);return!b||!C?null:U.createElement(s,{visible:!0,motionName:a,motionAppear:!0,onAppearStart:function(){return f?{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 f?{transform:`translateY(var(--thumb-active-top))`,height:`var(--thumb-active-height)`}:{transform:`translateX(var(--thumb-active-left))`,width:`var(--thumb-active-width)`}},onVisibleChanged:function(){x(null),T(null),l()}},function(e,n){var r=e.className,i=e.style,a=c(c({},i),{},{"--thumb-start-left":E,"--thumb-start-width":G(b?.width),"--thumb-active-left":D,"--thumb-active-width":G(C?.width),"--thumb-start-top":E,"--thumb-start-height":G(b?.height),"--thumb-active-top":D,"--thumb-active-height":G(C?.height)}),o={ref:A(p,n),style:a,className:(0,H.default)(`${t}-thumb`,r)};return U.createElement(`div`,o)})}var ie=[`prefixCls`,`direction`,`vertical`,`options`,`disabled`,`defaultValue`,`value`,`name`,`onChange`,`className`,`motionName`];function K(e){if(e.title!==void 0)return e.title;if(m(e.label)!==`object`)return e.label?.toString()}function ae(e){return e.map(function(e){if(m(e)===`object`&&e!==null){var t=K(e);return c(c({},e),{},{title:t})}return{label:e?.toString(),title:e?.toString(),value:e}})}var oe=function(e){var t=e.prefixCls,n=e.className,r=e.disabled,i=e.checked,a=e.label,o=e.title,s=e.value,c=e.name,u=e.onChange,d=e.onFocus,f=e.onBlur,p=e.onKeyDown,m=e.onKeyUp,h=e.onMouseDown;return U.createElement(`label`,{className:(0,H.default)(n,l({},`${t}-item-disabled`,r)),onMouseDown:h},U.createElement(`input`,{name:c,className:`${t}-item-input`,type:`radio`,disabled:r,checked:i,onChange:function(e){r||u(e,s)},onFocus:d,onBlur:f,onKeyDown:p,onKeyUp:m}),U.createElement(`div`,{className:`${t}-item-label`,title:o},a))},se=U.forwardRef(function(e,t){var n=e.prefixCls,i=n===void 0?`rc-segmented`:n,a=e.direction,o=e.vertical,s=e.options,c=s===void 0?[]:s,u=e.disabled,d=e.defaultValue,f=e.value,p=e.name,m=e.onChange,h=e.className,g=h===void 0?``:h,_=e.motionName,b=_===void 0?`thumb-motion`:_,x=D(e,ie),S=U.useRef(null),C=U.useMemo(function(){return A(S,t)},[S,t]),w=U.useMemo(function(){return ae(c)},[c]),T=y(v(w[0]?.value,{value:f,defaultValue:d}),2),O=T[0],k=T[1],j=y(U.useState(!1),2),ee=j[0],M=j[1],N=function(e,t){k(t),m?.(t)},P=E(x,[`children`]),F=y(U.useState(!1),2),I=F[0],L=F[1],R=y(U.useState(!1),2),z=R[0],B=R[1],V=function(){B(!0)},te=function(){B(!1)},ne=function(){L(!1)},W=function(e){e.key===`Tab`&&L(!0)},G=function(e){var t=w.findIndex(function(e){return e.value===O}),n=w.length,r=w[(t+e+n)%n];r&&(k(r.value),m?.(r.value))},K=function(e){switch(e.key){case`ArrowLeft`:case`ArrowUp`:G(-1);break;case`ArrowRight`:case`ArrowDown`:G(1);break}};return U.createElement(`div`,r({role:`radiogroup`,"aria-label":`segmented control`,tabIndex:u?void 0:0,"aria-orientation":o?`vertical`:`horizontal`},P,{className:(0,H.default)(i,l(l(l({},`${i}-rtl`,a===`rtl`),`${i}-disabled`,u),`${i}-vertical`,o),g),ref:C}),U.createElement(`div`,{className:`${i}-group`},U.createElement(re,{vertical:o,prefixCls:i,value:O,containerRef:S,motionName:`${i}-${b}`,direction:a,getValueIndex:function(e){return w.findIndex(function(t){return t.value===e})},onMotionStart:function(){M(!0)},onMotionEnd:function(){M(!1)}}),w.map(function(e){return U.createElement(oe,r({},e,{name:p,key:e.value,prefixCls:i,className:(0,H.default)(e.className,`${i}-item`,l(l({},`${i}-item-selected`,e.value===O&&!ee),`${i}-item-focused`,z&&I&&e.value===O)),checked:e.value===O,onChange:N,onFocus:V,onBlur:te,onKeyDown:K,onKeyUp:W,onMouseDown:ne,disabled:!!u||!!e.disabled}))})))});function q(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:`not-allowed`}}}function J(e){return{background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}var ce=Object.assign({overflow:`hidden`},F),le=e=>{let{componentCls:r}=e,i=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),o=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[r]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t(e)),{display:`inline-block`,padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`}),d(e)),{[`${r}-group`]:{position:`relative`,display:`flex`,alignItems:`stretch`,justifyItems:`flex-start`,flexDirection:`row`,width:`100%`},[`&${r}-rtl`]:{direction:`rtl`},[`&${r}-vertical`]:{[`${r}-group`]:{flexDirection:`column`},[`${r}-thumb`]:{width:`100%`,height:0,padding:`0 ${P(e.paddingXXS)}`}},[`&${r}-block`]:{display:`flex`},[`&${r}-block ${r}-item`]:{flex:1,minWidth:0},[`${r}-item`]:{position:`relative`,textAlign:`center`,cursor:`pointer`,transition:`color ${e.motionDurationMid}`,borderRadius:e.borderRadiusSM,transform:`translateZ(0)`,"&-selected":Object.assign(Object.assign({},J(e)),{color:e.itemSelectedColor}),"&-focused":n(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(${r}-item-selected):not(${r}-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:i,lineHeight:P(i),padding:`0 ${P(e.segmentedPaddingHorizontal)}`},ce),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:`none`}},[`${r}-thumb`]:Object.assign(Object.assign({},J(e)),{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:0,height:`100%`,padding:`${P(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${r}-item:not(${r}-item-selected):not(${r}-item-disabled)::after`]:{backgroundColor:`transparent`}}),[`&${r}-lg`]:{borderRadius:e.borderRadiusLG,[`${r}-item-label`]:{minHeight:a,lineHeight:P(a),padding:`0 ${P(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${r}-item, ${r}-thumb`]:{borderRadius:e.borderRadius}},[`&${r}-sm`]:{borderRadius:e.borderRadiusSM,[`${r}-item-label`]:{minHeight:o,lineHeight:P(o),padding:`0 ${P(e.segmentedPaddingHorizontalSM)}`},[`${r}-item, ${r}-thumb`]:{borderRadius:e.borderRadiusXS}}}),q(`&-disabled ${r}-item`,e)),q(`${r}-item-disabled`,e)),{[`${r}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:`transform, width`},[`&${r}-shape-round`]:{borderRadius:9999,[`${r}-item, ${r}-thumb`]:{borderRadius:9999}}})}},ue=ne(`Segmented`,e=>{let{lineWidth:t,calc:n}=e;return le(g(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}}),de=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 fe(e){return typeof e==`object`&&!!e?.icon}var pe=U.forwardRef((e,t)=>{let n=p(),{prefixCls:r,className:i,rootClassName:a,block:o,options:s=[],size:c=`middle`,style:l,vertical:u,shape:d=`default`,name:f=n}=e,m=de(e,[`prefixCls`,`className`,`rootClassName`,`block`,`options`,`size`,`style`,`vertical`,`shape`,`name`]),{getPrefixCls:h,direction:g,className:_,style:v}=B(`segmented`),y=h(`segmented`,r),[b,x,C]=ue(y),w=S(c),T=U.useMemo(()=>s.map(e=>{if(fe(e)){let{icon:t,label:n}=e,r=de(e,[`icon`,`label`]);return Object.assign(Object.assign({},r),{label:U.createElement(U.Fragment,null,U.createElement(`span`,{className:`${y}-item-icon`},t),n&&U.createElement(`span`,null,n))})}return e}),[s,y]),E=(0,H.default)(i,a,_,{[`${y}-block`]:o,[`${y}-sm`]:w===`small`,[`${y}-lg`]:w===`large`,[`${y}-vertical`]:u,[`${y}-shape-${d}`]:d===`round`},x,C),D=Object.assign(Object.assign({},v),l);return b(U.createElement(se,Object.assign({},m,{name:f,className:E,style:D,options:T,ref:t,prefixCls:y,direction:g,vertical:u})))}),me=_(I((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 he=U.forwardRef((e,t)=>U.createElement(j,Y({},e,{ref:t,icon:me.default}))),ge=_(I((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=U.forwardRef((e,t)=>U.createElement(j,X({},e,{ref:t,icon:ge.default}))),_e=h();function ve(e,t={}){return be(e)?{mode:`login`,path:`/login`,message:String(t.message||`注册成功,请先验证邮箱,验证后等待管理员审核。`),redirectTo:``}:{mode:`login`,path:`/login`,message:``,redirectTo:`/`}}function ye(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 be(e){return String(e||``).endsWith(`/register`)}var Q=O();function xe(){let{locale:t,locales:n,setLocale:r,t:i}=L(),o=ye(window.location.pathname,window.location.search),[s,c]=(0,U.useState)(o.mode),[l,u]=(0,U.useState)(o.token),[d,f]=(0,U.useState)(``),[p,m]=(0,U.useState)(`error`),[h,g]=(0,U.useState)(!1),[_]=T.useForm(),[v]=T.useForm(),[y]=T.useForm(),[S]=T.useForm();(0,U.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`error`);e&&(f(e),m(`error`),window.history.replaceState(null,``,window.location.pathname)),o.mode===`reset`&&!o.token&&(f(i(`auth.resetTokenMissing`)),m(`error`))},[]);let w=(0,U.useMemo)(()=>[{label:i(`auth.login`),value:`login`},{label:i(`auth.register`),value:`register`}],[i]);async function E(e,t){g(!0),f(``),m(`error`);try{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||i(`auth.requestFailed`));let a=ve(e,r);if(a.redirectTo){window.location.href=a.redirectTo;return}A(a.mode),f(a.message),m(`success`)}catch(e){f(e instanceof Error?e.message:i(`auth.requestFailed`)),m(`error`)}finally{g(!1)}}async function D(e,t){g(!0),f(``),m(`error`);try{let n=e===`forgot`?await z.forgotPassword(t.email):await z.resendVerification(t.email);f(n.message),m(`success`)}catch(e){f(e instanceof Error?e.message:i(`auth.requestFailed`)),m(`error`)}finally{g(!1)}}async function O(e){if(!l){f(i(`auth.resetTokenMissing`)),m(`error`);return}g(!0),f(``),m(`error`);try{let t=await z.resetPassword(l,e.password);A(`login`),u(``),f(t.message),m(`success`),S.resetFields()}catch(e){f(e instanceof Error?e.message:i(`auth.requestFailed`)),m(`error`)}finally{g(!1)}}function A(e){c(e),f(``),m(`error`),window.history.replaceState(null,``,Se(e))}return(0,Q.jsxs)(`main`,{className:`auth-page`,children:[(0,Q.jsxs)(`section`,{className:`auth-brand-panel`,children:[(0,Q.jsxs)(`div`,{className:`auth-brand-top`,children:[(0,Q.jsx)(`div`,{className:`brand-logo auth-logo`,children:`MH`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(V.Title,{level:1,children:`MailHub`}),(0,Q.jsx)(V.Text,{children:i(`auth.subtitle`)})]})]}),(0,Q.jsxs)(`div`,{className:`auth-signal-list`,children:[(0,Q.jsx)($,{icon:(0,Q.jsx)(he,{}),title:`DNS`,text:i(`auth.valueDns`)}),(0,Q.jsx)($,{icon:(0,Q.jsx)(M,{}),title:`SMTP`,text:i(`auth.valueIsolation`)}),(0,Q.jsx)($,{icon:(0,Q.jsx)(x,{}),title:`API`,text:i(`auth.valueObservability`)})]})]}),(0,Q.jsxs)(`section`,{className:`auth-form-panel`,children:[(0,Q.jsx)(`div`,{className:`auth-language-row`,children:(0,Q.jsx)(k,{value:t,options:n,onChange:r,className:`language-select`})}),(0,Q.jsx)(te,{className:`auth-card`,children:(0,Q.jsxs)(N,{direction:`vertical`,size:22,className:`full-width`,children:[(0,Q.jsxs)(`div`,{className:`auth-heading`,children:[(0,Q.jsx)(V.Text,{className:`auth-eyebrow`,children:i(s===`register`?`auth.registerEyebrow`:`auth.loginEyebrow`)}),(0,Q.jsx)(V.Title,{level:2,children:Ce(s,i)})]}),s===`login`||s===`register`?(0,Q.jsx)(pe,{block:!0,value:s,options:w,onChange:e=>A(e)}):null,d?(0,Q.jsx)(e,{type:p,showIcon:!0,message:d}):null,s===`login`?(0,Q.jsxs)(T,{form:_,layout:`vertical`,onFinish:e=>E(`/api/login`,e),requiredMark:!1,children:[(0,Q.jsx)(T.Item,{name:`username`,label:i(`auth.usernameOrEmail`),rules:[{required:!0,message:i(`auth.usernameOrEmail`)}],children:(0,Q.jsx)(C,{prefix:(0,Q.jsx)(b,{}),autoComplete:`username`,autoFocus:!0})}),(0,Q.jsx)(T.Item,{name:`password`,label:i(`auth.password`),rules:[{required:!0,message:i(`auth.password`)}],children:(0,Q.jsx)(C.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`current-password`})}),(0,Q.jsx)(a,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:i(`auth.submitLogin`)}),(0,Q.jsxs)(`div`,{className:`auth-link-row`,children:[(0,Q.jsx)(a,{type:`link`,onClick:()=>A(`forgot`),children:i(`auth.forgotPassword`)}),(0,Q.jsx)(a,{type:`link`,onClick:()=>A(`resend`),children:i(`auth.resendVerification`)})]})]}):null,s===`register`?(0,Q.jsxs)(T,{form:v,layout:`vertical`,onFinish:e=>E(`/api/register`,e),requiredMark:!1,children:[(0,Q.jsx)(T.Item,{name:`username`,label:i(`auth.username`),rules:[{required:!0,min:3,message:i(`auth.username`)}],children:(0,Q.jsx)(C,{prefix:(0,Q.jsx)(b,{}),autoComplete:`username`,autoFocus:!0})}),(0,Q.jsx)(T.Item,{name:`email`,label:i(`auth.email`),rules:[{required:!0,type:`email`,message:i(`auth.email`)}],children:(0,Q.jsx)(C,{prefix:(0,Q.jsx)(R,{}),autoComplete:`email`,placeholder:i(`auth.emailPlaceholder`)})}),(0,Q.jsx)(T.Item,{name:`password`,label:i(`auth.password`),rules:[{required:!0,min:8,message:i(`auth.password`)}],children:(0,Q.jsx)(C.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`new-password`})}),(0,Q.jsx)(a,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:i(`auth.registerButton`)})]}):null,s===`forgot`||s===`resend`?(0,Q.jsxs)(T,{form:y,layout:`vertical`,onFinish:e=>D(s,e),requiredMark:!1,children:[(0,Q.jsx)(T.Item,{name:`email`,label:i(`auth.email`),rules:[{required:!0,type:`email`,message:i(`auth.email`)}],children:(0,Q.jsx)(C,{prefix:(0,Q.jsx)(R,{}),autoComplete:`email`,placeholder:i(`auth.emailPlaceholder`),autoFocus:!0})}),(0,Q.jsx)(a,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,children:i(s===`forgot`?`auth.forgotPasswordButton`:`auth.resendVerificationButton`)}),(0,Q.jsx)(a,{type:`link`,block:!0,onClick:()=>A(`login`),children:i(`auth.backToLogin`)})]}):null,s===`reset`?(0,Q.jsxs)(T,{form:S,layout:`vertical`,onFinish:O,requiredMark:!1,children:[(0,Q.jsx)(T.Item,{name:`password`,label:i(`auth.newPassword`),rules:[{required:!0,min:8,message:i(`auth.password`)}],children:(0,Q.jsx)(C.Password,{prefix:(0,Q.jsx)(Z,{}),autoComplete:`new-password`,autoFocus:!0})}),(0,Q.jsx)(a,{type:`primary`,htmlType:`submit`,loading:h,block:!0,size:`large`,disabled:!l,children:i(`auth.resetPasswordButton`)}),(0,Q.jsx)(a,{type:`link`,block:!0,onClick:()=>A(`login`),children:i(`auth.backToLogin`)})]}):null]})})]})]})}function Se(e){return{login:`/login`,register:`/register`,forgot:`/forgot-password`,resend:`/resend-verification`,reset:`/reset-password`}[e]}function Ce(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)(V.Text,{children:t}),(0,Q.jsx)(V.Title,{level:5,children:n})]})]})}(0,_e.createRoot)(document.getElementById(`auth-root`)).render((0,Q.jsx)(i,{theme:{token:{colorPrimary:`#1677ff`,borderRadius:10,colorBgLayout:`#f5f7fb`,colorBorderSecondary:`#e5eaf2`},components:{Card:{borderRadiusLG:12}}},children:(0,Q.jsx)(u,{children:(0,Q.jsx)(ee,{children:(0,Q.jsx)(xe,{})})})}));