Files
weiguang-jewelry-ledger/新账系统/web/dist/assets/LoginPage-CX3t9hjZ.js
T

8 lines
28 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{i as t,t as n}from"./react-1o5M9n0k.js";import{d as r,f as i,m as a,p as o,r as s,t as c,z as l}from"./index-D-ox0wtk.js";import{$ as u,Bt as d,Dn as f,En as p,Ft as m,Gt as h,H as g,Lt as _,M as v,Nt as y,O as b,P as x,S,St as C,Tt as w,V as T,X as E,Y as D,Z as O,a as k,bt as A,c as ee,d as j,dn as te,et as M,g as N,gt as ne,h as P,i as F,j as I,l as re,lt as L,m as ie,mn as ae,mt as R,nn as oe,nt as z,o as se,p as B,pn as V,q as H,qt as U,r as W,rn as G,rt as K,s as ce,u as le,vt as ue,wn as de,xt as fe,y as pe,z as me,zt as he}from"./skeleton-B4Z0R3jQ.js";import{n as ge,t as q}from"./input-BnsACfRy.js";import{c as _e,f as ve,i as ye,l as be,n as xe,o as Se,r as Ce,s as we,t as Te,u as Ee}from"./LockOutlined-BPg5cH36.js";import{s as De}from"./style-CBKkTdLU.js";import{t as Oe,u as ke}from"./typography-xRg_3Gco.js";var J=e(t());function Ae(e){return e==null?null:typeof e==`object`&&!(0,J.isValidElement)(e)?e:{title:e}}function Y(e){let[t,n]=J.useState(e);return J.useEffect(()=>{let t=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(t)}},[e]),t}var je=e=>{let{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:`hidden`,transition:`height ${e.motionDurationFast} ${e.motionEaseInOut},
opacity ${e.motionDurationFast} ${e.motionEaseInOut},
transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},Me=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${U(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${U(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),Ne=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},Pe=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},L(e)),Me(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},Ne(e,e.controlHeightSM)),"&-large":Object.assign({},Ne(e,e.controlHeightLG))})}},Fe=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:a,labelColor:o,labelFontSize:s,labelHeight:c,labelColonMarginInlineStart:l,labelColonMarginInlineEnd:u,itemMarginBottom:d}=e;return{[t]:Object.assign(Object.assign({},L(e)),{marginBottom:d,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden,
&-hidden${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:e.lineHeight,whiteSpace:`unset`,"> label":{verticalAlign:`middle`,textWrap:`balance`}},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:c,color:o,fontSize:s,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required`]:{"&::before":{display:`inline-block`,marginInlineEnd:e.marginXXS,color:a,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:`none`}}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:l,marginInlineEnd:u},[`&${t}-no-colon::after`]:{content:`"\\a0"`}}},[`${t}-control`]:{"--ant-display":`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`,[`&:has(> ${i}-switch:only-child, > ${i}-rate:only-child)`]:{display:`flex`,alignItems:`center`}}}},[t]:{"&-additional":{display:`flex`,flexDirection:`column`},"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:S,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},X=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{visibility:`hidden`}}}),Ie=e=>{let{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:`unset`}},[`${t}-col-24${n}-label,
${t}-col-xl-24${n}-label`]:X(e)}}},Le=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[`${n}-inline`]:{flex:`none`,marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:`nowrap`},[`> ${n}-label,
> ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},Re=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:X(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:`wrap`,[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}}},ze=e=>{let{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:`column`},[`${n}-label > label`]:{height:`auto`},[`${n}-control`]:{width:`100%`},[`${n}-label,
${r}-col-24${n}-label,
${r}-col-xl-24${n}-label`]:X(e)},[`@media (max-width: ${U(e.screenXSMax)})`]:[Re(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:X(e)}}}],[`@media (max-width: ${U(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:X(e)}}},[`@media (max-width: ${U(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:X(e)}}},[`@media (max-width: ${U(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:X(e)}}}}},Be=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),Ve=(e,t)=>R(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),He=z(`Form`,(e,{rootPrefixCls:t})=>{let n=Ve(e,t);return[Pe(n),Fe(n),je(n),Ie(n),Le(n),ze(n),ve(n),S]},Be,{order:-1e3}),Z=e(f()),Ue=[];function We(e,t,n,r=0){return{key:typeof e==`string`?e:`${t}-${r}`,error:e,errorStatus:n}}var Ge=({help:e,helpStatus:t,errors:n=Ue,warnings:r=Ue,className:i,fieldId:a,onVisibleChanged:o})=>{let{prefixCls:s}=J.useContext(k),c=`${s}-item-explain`,l=T(s),[d,f,p]=He(s,l),m=J.useMemo(()=>x(s),[s]),h=Y(n),g=Y(r),_=J.useMemo(()=>e==null?[].concat(G(h.map((e,t)=>We(e,`error`,`error`,t))),G(g.map((e,t)=>We(e,`warning`,`warning`,t)))):[We(e,`help`,t)],[e,t,h,g]),v=J.useMemo(()=>{let e={};return _.forEach(({key:t})=>{e[t]=(e[t]||0)+1}),_.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?`${t.key}-fallback-${n}`:t.key}))},[_]),y={};return a&&(y.id=`${a}_help`),d(J.createElement(u,{motionDeadline:m.motionDeadline,motionName:`${s}-show-help`,visible:!!v.length,onVisibleChanged:o},e=>{let{className:t,style:n}=e;return J.createElement(`div`,Object.assign({},y,{className:(0,Z.default)(c,t,p,l,i,f),style:n}),J.createElement(M,Object.assign({keys:v},x(s),{motionName:`${s}-show-help-item`,component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:i,style:a}=e;return J.createElement(`div`,{key:t,className:(0,Z.default)(i,{[`${c}-${r}`]:r}),style:a},n)}))}))},Ke=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},qe=J.forwardRef((e,t)=>{let n=J.useContext(A),{getPrefixCls:r,direction:i,requiredMark:a,colon:o,scrollToFirstError:s,className:c,style:l}=w(`form`),{prefixCls:u,className:d,rootClassName:f,size:p,disabled:m=n,form:h,colon:g,labelAlign:_,labelWrap:v,labelCol:y,wrapperCol:x,hideRequiredMark:S,layout:C=`horizontal`,scrollToFirstError:E,requiredMark:D,onFinishFailed:O,name:k,style:ee,feedbackIcons:j,variant:te}=e,M=Ke(e,[`prefixCls`,`className`,`rootClassName`,`size`,`disabled`,`form`,`colon`,`labelAlign`,`labelWrap`,`labelCol`,`wrapperCol`,`hideRequiredMark`,`layout`,`scrollToFirstError`,`requiredMark`,`onFinishFailed`,`name`,`style`,`feedbackIcons`,`variant`]),N=b(p),ne=J.useContext(De),P=J.useMemo(()=>D===void 0?S?!1:a===void 0||a:D,[S,D,a]),F=g??o,I=r(`form`,u),L=T(I),[ie,ae,R]=He(I,L),oe=(0,Z.default)(I,`${I}-${C}`,{[`${I}-hide-required-mark`]:P===!1,[`${I}-rtl`]:i===`rtl`,[`${I}-${N}`]:N},R,L,ae,c,d,f),[z]=Se(h),{__INTERNAL__:B}=z;B.name=k;let V=J.useMemo(()=>({name:k,labelAlign:_,labelCol:y,labelWrap:v,wrapperCol:x,layout:C,colon:F,requiredMark:P,itemRef:B.itemRef,form:z,feedbackIcons:j}),[k,_,y,x,C,F,P,z,j]),H=J.useRef(null);J.useImperativeHandle(t,()=>Object.assign(Object.assign({},z),{nativeElement:H.current?.nativeElement}));let U=(e,t)=>{if(e){let n={block:`nearest`};typeof e==`object`&&(n=Object.assign(Object.assign({},n),e)),z.scrollToField(t,n)}};return ie(J.createElement(re.Provider,{value:te},J.createElement(fe,{disabled:m},J.createElement(ue.Provider,{value:N},J.createElement(se,{validateMessages:ne},J.createElement(W.Provider,{value:V},J.createElement(ce,{status:!0},J.createElement(le,Object.assign({id:k},M,{name:k,onFinishFailed:e=>{if(O?.(e),e.errorFields.length){let t=e.errorFields[0].name;if(E!==void 0){U(E,t);return}s!==void 0&&U(s,t)}},form:z,ref:H,style:Object.assign(Object.assign({},l),ee),className:oe})))))))))});function Je(e){if(typeof e==`function`)return e;let t=de(e);return t.length<=1?t[0]:t}var Ye=()=>{let{status:e,errors:t=[],warnings:n=[]}=J.useContext(F);return{status:e,errors:t,warnings:n}};Ye.Context=F;function Xe(e){let[t,n]=J.useState(e),r=J.useRef(null),i=J.useRef([]),a=J.useRef(!1);J.useEffect(()=>(a.current=!1,()=>{a.current=!0,oe.cancel(r.current),r.current=null}),[]);function o(e){a.current||(r.current===null&&(i.current=[],r.current=oe(()=>{r.current=null,n(e=>{let t=e;return i.current.forEach(e=>{t=e(t)}),t})})),i.current.push(e))}return[t,o]}function Ze(){let{itemRef:e}=J.useContext(W),t=J.useRef({});function n(n,r){let i=r&&typeof r==`object`&&V(r),a=n.join(`_`);return(t.current.name!==a||t.current.originRef!==i)&&(t.current.name=a,t.current.originRef=i,t.current.ref=te(e(n),i)),t.current.ref}return n}var Qe=e=>{let{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:`flex`}}}},$e=K([`Form`,`item-item`],(e,{rootPrefixCls:t})=>Qe(Ve(e,t))),et=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},tt=24,nt=e=>{let{prefixCls:t,status:n,labelCol:r,wrapperCol:i,children:a,errors:o,warnings:s,_internalItemRender:c,extra:l,help:u,fieldId:f,marginBottom:p,onErrorVisibleChanged:m,label:g}=e,_=`${t}-item`,v=J.useContext(W),y=J.useMemo(()=>{let e=Object.assign({},i||v.wrapperCol||{});return g===null&&!r&&!i&&v.labelCol&&[void 0,`xs`,`sm`,`md`,`lg`,`xl`,`xxl`].forEach(t=>{let n=t?[t]:[],r=d(v.labelCol,n),i=typeof r==`object`?r:{},a=d(e,n),o=typeof a==`object`?a:{};`span`in i&&!(`offset`in o)&&i.span<tt&&(e=he(e,[].concat(n,[`offset`]),i.span))}),e},[i,v.wrapperCol,v.labelCol,g,r]),b=(0,Z.default)(`${_}-control`,y.className),x=J.useMemo(()=>{let{labelCol:e,wrapperCol:t}=v;return et(v,[`labelCol`,`wrapperCol`])},[v]),S=J.useRef(null),[C,w]=J.useState(0);h(()=>{l&&S.current?w(S.current.clientHeight):w(0)},[l]);let T=J.createElement(`div`,{className:`${_}-control-input`},J.createElement(`div`,{className:`${_}-control-input-content`},a)),E=J.useMemo(()=>({prefixCls:t,status:n}),[t,n]),D=p!==null||o.length||s.length?J.createElement(k.Provider,{value:E},J.createElement(Ge,{fieldId:f,errors:o,warnings:s,help:u,helpStatus:n,className:`${_}-explain-connected`,onVisibleChanged:m})):null,O={};f&&(O.id=`${f}_extra`);let A=l?J.createElement(`div`,Object.assign({},O,{className:`${_}-extra`,ref:S}),l):null,ee=D||A?J.createElement(`div`,{className:`${_}-additional`,style:p?{minHeight:p+C}:{}},D,A):null,j=c&&c.mark===`pro_table_render`&&c.render?c.render(e,{input:T,errorList:D,extra:A}):J.createElement(J.Fragment,null,T,ee);return J.createElement(W.Provider,{value:x},J.createElement(ye,Object.assign({},y,{className:b}),j),J.createElement($e,{prefixCls:t}))},rt=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},it=({prefixCls:e,label:t,htmlFor:n,labelCol:r,labelAlign:i,colon:a,required:o,requiredMark:s,tooltip:c,vertical:l})=>{let[u]=y(`Form`),{labelAlign:d,labelCol:f,labelWrap:p,colon:h}=J.useContext(W);if(!t)return null;let g=r||f||{},_=i||d,v=`${e}-item-label`,b=(0,Z.default)(v,_===`left`&&`${v}-left`,g.className,{[`${v}-wrap`]:!!p}),x=t,S=a===!0||h!==!1&&a!==!1;S&&!l&&typeof t==`string`&&t.trim()&&(x=t.replace(/[:|:]\s*$/,``));let C=Ae(c);if(C){let{icon:t=J.createElement(xe,null)}=C,n=rt(C,[`icon`]),r=J.createElement(ke,Object.assign({},n),J.cloneElement(t,{className:`${e}-item-tooltip`,title:``,onClick:e=>{e.preventDefault()},tabIndex:null}));x=J.createElement(J.Fragment,null,x,r)}let w=s===`optional`,T=typeof s==`function`,E=s===!1;T?x=s(x,{required:!!o}):w&&!o&&(x=J.createElement(J.Fragment,null,x,J.createElement(`span`,{className:`${e}-item-optional`,title:``},u?.optional||m.Form?.optional)));let D;E?D=`hidden`:(w||T)&&(D=`optional`);let O=(0,Z.default)({[`${e}-item-required`]:o,[`${e}-item-required-mark-${D}`]:D,[`${e}-item-no-colon`]:!S});return J.createElement(ye,Object.assign({},g,{className:b}),J.createElement(`label`,{htmlFor:n,className:O,title:typeof t==`string`?t:``},x))},at={success:E,warning:H,error:D,validating:me};function ot({children:e,errors:t,warnings:n,hasFeedback:r,validateStatus:i,prefixCls:a,meta:o,noStyle:s,name:c}){let l=`${a}-item`,{feedbackIcons:u}=J.useContext(W),d=_e(t,n,o,null,!!r,i),{isFormItemInput:f,status:p,hasFeedback:m,feedbackIcon:h,name:g}=J.useContext(F),_=J.useMemo(()=>{let e;if(r){let i=r!==!0&&r.icons||u,a=d&&i?.({status:d,errors:t,warnings:n})?.[d],o=d?at[d]:null;e=a!==!1&&o?J.createElement(`span`,{className:(0,Z.default)(`${l}-feedback-icon`,`${l}-feedback-icon-${d}`)},a||J.createElement(o,null)):null}let i={status:d||``,errors:t,warnings:n,hasFeedback:!!r,feedbackIcon:e,isFormItemInput:!0,name:c};return s&&(i.status=(d??p)||``,i.isFormItemInput=f,i.hasFeedback=!!(r??m),i.feedbackIcon=r===void 0?h:i.feedbackIcon,i.name=c??g),i},[d,r,s,f,p]);return J.createElement(F.Provider,{value:_},e)}var st=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 ct(e){let{prefixCls:t,className:n,rootClassName:r,style:i,help:a,errors:o,warnings:s,validateStatus:c,meta:l,hasFeedback:u,hidden:d,children:f,fieldId:p,required:m,isRequired:g,onSubItemMetaChange:_,layout:y,name:b}=e,x=st(e,[`prefixCls`,`className`,`rootClassName`,`style`,`help`,`errors`,`warnings`,`validateStatus`,`meta`,`hasFeedback`,`hidden`,`children`,`fieldId`,`required`,`isRequired`,`onSubItemMetaChange`,`layout`,`name`]),S=`${t}-item`,{requiredMark:C,layout:w}=J.useContext(W),T=y||w,E=T===`vertical`,D=J.useRef(null),O=Y(o),k=Y(s),A=a!=null,j=!!(A||o.length||s.length),te=!!D.current&&I(D.current),[M,N]=J.useState(null);h(()=>{if(j&&D.current){let e=getComputedStyle(D.current);N(Number.parseInt(e.marginBottom,10))}},[j,te]);let ne=e=>{e||N(null)},P=((e=!1)=>{let t=e?O:l.errors,n=e?k:l.warnings;return _e(t,n,l,``,!!u,c)})(),F=(0,Z.default)(S,n,r,{[`${S}-with-help`]:A||O.length||k.length,[`${S}-has-feedback`]:P&&u,[`${S}-has-success`]:P===`success`,[`${S}-has-warning`]:P===`warning`,[`${S}-has-error`]:P===`error`,[`${S}-is-validating`]:P===`validating`,[`${S}-hidden`]:d,[`${S}-${T}`]:T});return J.createElement(`div`,{className:F,style:i,ref:D},J.createElement(Ce,Object.assign({className:`${S}-row`},v(x,`_internalItemRender.colon.dependencies.extra.fieldKey.getValueFromEvent.getValueProps.htmlFor.id.initialValue.isListField.label.labelAlign.labelCol.labelWrap.messageVariables.name.normalize.noStyle.preserve.requiredMark.rules.shouldUpdate.trigger.tooltip.validateFirst.validateTrigger.valuePropName.wrapperCol.validateDebounce`.split(`.`))),J.createElement(it,Object.assign({htmlFor:p},e,{requiredMark:C,required:m??g,prefixCls:t,vertical:E})),J.createElement(nt,Object.assign({},e,l,{errors:O,warnings:k,prefixCls:t,status:P,help:a,marginBottom:M,onErrorVisibleChanged:ne}),J.createElement(ee.Provider,{value:_},J.createElement(ot,{prefixCls:t,meta:l,errors:l.errors,warnings:l.warnings,hasFeedback:u,validateStatus:P,name:b},f)))),!!M&&J.createElement(`div`,{className:`${S}-margin-offset`,style:{marginBottom:-M}}))}var lt=`__SPLIT__`;function ut(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>{let r=e[n],i=t[n];return r===i||typeof r==`function`||typeof i==`function`})}var dt=J.memo(({children:e})=>e,(e,t)=>ut(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((e,n)=>e===t.childProps[n]));function ft(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function pt(e){let{name:t,noStyle:n,className:r,dependencies:i,prefixCls:a,shouldUpdate:o,rules:s,children:c,required:l,label:u,messageVariables:d,trigger:f=`onChange`,validateTrigger:p,hidden:m,help:h,layout:v}=e,{getPrefixCls:y}=J.useContext(C),{name:b}=J.useContext(W),x=Je(c),S=typeof x==`function`,w=J.useContext(ee),{validateTrigger:E}=J.useContext(N),D=p===void 0?E:p,O=t!=null,k=y(`form`,a),A=T(k),[j,te,M]=He(k,A);_(`Form.Item`);let F=J.useContext(P),I=J.useRef(null),[re,L]=Xe({}),[R,oe]=ne(()=>ft()),z=e=>{let t=F?.getKey(e.name);if(oe(e.destroy?ft():e,!0),n&&h!==!1&&w){let n=e.name;if(e.destroy)n=I.current||n;else if(t!==void 0){let[e,r]=t;n=[e].concat(G(r)),I.current=n}w(e,n)}},se=(e,t)=>{L(n=>{let r=Object.assign({},n),i=[].concat(G(e.name.slice(0,-1)),G(t)).join(lt);return e.destroy?delete r[i]:r[i]=e,r})},[B,V]=J.useMemo(()=>{let e=G(R.errors),t=G(R.warnings);return Object.values(re).forEach(n=>{e.push.apply(e,G(n.errors||[])),t.push.apply(t,G(n.warnings||[]))}),[e,t]},[re,R.errors,R.warnings]),H=Ze();function U(i,a,o){return n&&!m?J.createElement(ot,{prefixCls:k,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:R,errors:B,warnings:V,noStyle:!0,name:t},i):J.createElement(ct,Object.assign({key:`row`},e,{className:(0,Z.default)(r,M,A,te),prefixCls:k,fieldId:a,isRequired:o,errors:B,warnings:V,meta:R,onSubItemMetaChange:se,layout:v,name:t}),i)}if(!O&&!S&&!i)return j(U(x));let K={};return typeof u==`string`?K.label=u:t&&(K.label=String(t)),d&&(K=Object.assign(Object.assign({},K),d)),j(J.createElement(ie,Object.assign({},e,{messageVariables:K,trigger:f,validateTrigger:D,onMetaChange:z}),(n,r,a)=>{let c=be(t).length&&r?r.name:[],u=we(c,b),d=l===void 0?!!s?.some(e=>{if(e&&typeof e==`object`&&e.required&&!e.warningOnly)return!0;if(typeof e==`function`){let t=e(a);return t?.required&&!t?.warningOnly}return!1}):l,p=Object.assign({},n),m=null;if(Array.isArray(x)&&O)m=x;else if((!S||(o||i)&&!O)&&(!i||S||O)){if(J.isValidElement(x)){let t=Object.assign(Object.assign({},x.props),p);if(t.id||=u,h||B.length>0||V.length>0||e.extra){let n=[];(h||B.length>0)&&n.push(`${u}_help`),e.extra&&n.push(`${u}_extra`),t[`aria-describedby`]=n.join(` `)}B.length>0&&(t[`aria-invalid`]=`true`),d&&(t[`aria-required`]=`true`),ae(x)&&(t.ref=H(c,x)),new Set([].concat(G(be(f)),G(be(D)))).forEach(e=>{t[e]=(...t)=>{var n,r,i,a,o;(i=p[e])==null||(n=i).call.apply(n,[p].concat(t)),(o=(a=x.props)[e])==null||(r=o).call.apply(r,[a].concat(t))}});let n=[t[`aria-required`],t[`aria-invalid`],t[`aria-describedby`]];m=J.createElement(dt,{control:p,update:x,childProps:n},g(x,t))}else m=S&&(o||i)&&!O?x(a):x}return U(m,u,d)}))}var mt=pt;mt.useStatus=Ye;var ht=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},gt=e=>{var{prefixCls:t,children:n}=e,r=ht(e,[`prefixCls`,`children`]);let{getPrefixCls:i}=J.useContext(C),a=i(`form`,t),o=J.useMemo(()=>({prefixCls:a,status:`error`}),[a]);return J.createElement(B,Object.assign({},r),(e,t,r)=>J.createElement(k.Provider,{value:o},n(e.map(e=>Object.assign(Object.assign({},e),{fieldKey:e.key})),t,{errors:r.errors,warnings:r.warnings})))},Q=qe;Q.Item=mt,Q.List=gt,Q.ErrorList=Ge,Q.useForm=Se,Q.useFormInstance=function(){let{form:e}=J.useContext(W);return e},Q.useWatch=j,Q.Provider=se,Q.create=()=>{};var _t={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z`}}]},name:`arrow-right`,theme:`outlined`},vt=J.forwardRef(function(e,t){return J.createElement(O,p({},e,{ref:t,icon:_t}))}),yt={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`},bt=J.forwardRef(function(e,t){return J.createElement(O,p({},e,{ref:t,icon:yt}))}),$=n();function xt({client:e,session:t,onLoggedIn:n}){let[u,d]=(0,J.useState)(``),[f,p]=(0,J.useState)(``),m=a(null,t),h=t.loginOptions||[],g=t.mode===`demo`?`用虚构订单练习完整流程,演示数据与新账隔离。`:`先设置账号。当前是本机试用,正式云端开账另行配置。`;async function _(e,t){d(``),p(e);try{await t(),await n()}catch(e){d(e.message)}finally{p(``)}}return(0,$.jsxs)(`div`,{className:`login-wrap`,children:[(0,$.jsxs)(ge,{className:`login-card`,children:[(0,$.jsxs)(`div`,{className:`login-head`,children:[(0,$.jsx)(c,{name:m,size:`lg`}),(0,$.jsxs)(Oe.Title,{level:1,className:`login-title`,children:[m,` · 新账系统`]}),(0,$.jsx)(Oe.Paragraph,{type:`secondary`,className:`login-intro`,children:t.setup||t.mode===`demo`?g:`录入、收款与复核,从同一张订单开始。`}),(0,$.jsx)(`span`,{className:`login-mode`,children:s(t.mode)})]}),u&&(0,$.jsx)(l,{type:`error`,showIcon:!0,message:u,className:`login-error`,role:`alert`}),t.mode===`demo`?(0,$.jsx)(`div`,{className:`role-cards`,role:`group`,"aria-label":`选择演示身份`,children:h.map(t=>(0,$.jsxs)(pe,{className:`role-card`+(t.member===`owner`?` role-card-owner`:``),"aria-label":`以`+t.label+`身份进入演示`,loading:f===t.member,disabled:!!f&&f!==t.member,onClick:()=>_(t.member,()=>r(e,t.member)),children:[(0,$.jsx)(`span`,{className:`role-avatar`,"aria-hidden":`true`,children:Array.from(t.label)[0]}),(0,$.jsxs)(`span`,{className:`role-text`,children:[(0,$.jsx)(`strong`,{children:t.label}),(0,$.jsx)(`small`,{children:t.member===`owner`?`店主`:`店员`})]}),(0,$.jsx)(vt,{className:`role-go`,"aria-hidden":`true`})]},t.member))}):t.setup?(0,$.jsx)(Ct,{working:f===`setup`,onSubmit:t=>_(`setup`,()=>o(e,t))}):(0,$.jsx)(St,{options:h,working:f===`login`,onSubmit:(t,n)=>_(`login`,()=>i(e,t,n))}),(0,$.jsxs)(`div`,{className:`login-foot`,children:[(0,$.jsx)(`span`,{className:`small muted`,children:`新版界面(对照试用)`}),(0,$.jsx)(`a`,{href:`/`,className:`old-ui-link`,children:`返回旧版界面`})]})]}),(0,$.jsx)(`p`,{className:`login-note small muted`,children:`云端数据库和飞书同步的真实状态,会在系统内显示。`})]})}function St({options:e,working:t,onSubmit:n}){let[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(``),s=(0,J.useRef)(null);return(0,$.jsx)(`form`,{className:`login-form`,onSubmit:e=>{e.preventDefault(),n(r,a)},children:(0,$.jsxs)(Q,{layout:`vertical`,component:!1,children:[(0,$.jsx)(Q.Item,{label:`登录账号`,required:!0,children:(0,$.jsx)(Ee,{"aria-label":`登录账号`,suffixIcon:(0,$.jsx)(bt,{}),"data-testid":`login-member`,value:r||void 0,placeholder:`请选择账号`,options:e.map(e=>({value:e.member,label:e.label})),onChange:e=>{i(e),window.setTimeout(()=>s.current?.focus(),0)}})}),(0,$.jsx)(Q.Item,{label:`密码`,required:!0,children:(0,$.jsx)(q.Password,{ref:s,name:`password`,"aria-label":`密码`,prefix:(0,$.jsx)(Te,{className:`input-icon`}),autoComplete:`current-password`,value:a,onChange:e=>o(e.target.value)})}),(0,$.jsx)(pe,{type:`primary`,htmlType:`submit`,block:!0,size:`large`,loading:t,children:`登录`})]})})}function Ct({working:e,onSubmit:t}){let[n,r]=(0,J.useState)({storeName:``,ownerLabel:`店主`,ownerLoginName:`owner`,ownerPassword:``}),i=e=>({value:n[e],onChange:t=>r({...n,[e]:t.target.value})});return(0,$.jsx)(`form`,{className:`setup-form`,onSubmit:e=>{e.preventDefault(),t(n)},children:(0,$.jsxs)(Q,{layout:`vertical`,component:!1,children:[(0,$.jsx)(Q.Item,{label:`店铺名称`,required:!0,children:(0,$.jsx)(q,{name:`storeName`,"aria-label":`店铺名称`,maxLength:80,...i(`storeName`)})}),(0,$.jsx)(Q.Item,{label:`店主显示名`,required:!0,children:(0,$.jsx)(q,{name:`ownerLabel`,"aria-label":`店主显示名`,maxLength:30,...i(`ownerLabel`)})}),(0,$.jsx)(Q.Item,{label:`店主登录名`,required:!0,children:(0,$.jsx)(q,{name:`ownerLoginName`,"aria-label":`店主登录名`,maxLength:60,...i(`ownerLoginName`)})}),(0,$.jsx)(Q.Item,{label:`店主密码(至少12个字符)`,required:!0,children:(0,$.jsx)(q.Password,{name:`ownerPassword`,"aria-label":`店主密码`,autoComplete:`new-password`,...i(`ownerPassword`)})}),(0,$.jsx)(Oe.Paragraph,{type:`secondary`,className:`small`,children:`进入系统后,在设置 → 员工管理中添加员工。`}),(0,$.jsx)(pe,{type:`primary`,htmlType:`submit`,block:!0,size:`large`,loading:e,children:`建立试用账号`})]})})}export{xt as LoginPage};