index-3ed1f986.js 48 KB

1
  1. import{d as X,u as Oe,q as Be,s as It,c as n,b as $,P as z,v as ot,x as Ta,y as ua,z as _a,_ as k,e as Ct,r as j,g as Rt,B as at,a as Q,K as ve,h as Ae,C as ct,D as G,o as rt,w as Fe,p as wa,f as ka,E as Pa,F as Gt,G as Qe,R as xt,H as Ea,A as Bt,i as ca,I as Ia,J as Ra,L as Ba,M as st,N as Aa,O as et,Q as Oa,S as qt,T as $a,U as Da,V as Na,W as St,X as La,Y as Ma,Z as Fa,$ as Ua,a0 as ja,a1 as ke,a2 as Ka,l as oe,a3 as tt,a4 as Ha,a5 as ce,a6 as xe,a7 as nt,a8 as Wa,a9 as za,aa as Tt,ab as gt,ac as Vt,ad as me,k as Ga,ae as qa}from"./index-c0ea9eee.js";import{D as Va,u as J,i as Xa,a as Xt,R as He,C as de,b as Ya,c as Za,T as Ja}from"./index-02a906e5.js";import{c as da,t as Qa,a as en,b as tn,h as an,f as nn,F as fe}from"./Form-e6eeda59.js";import{R as Yt}from"./Col-c05b789a.js";import{D as rn,M as _t,E as on,b as ln,c as sn}from"./index-97c28cb7.js";import{A as un,S as it}from"./index-84bc77be.js";import{i as cn}from"./useFlexGapSupport-20a12060.js";import"./useSize-7089b0c3.js";var dn=["class","style"],vn=function(){return{prefixCls:String,href:String,separator:z.any,overlay:z.any,onClick:Function}};const dt=X({compatConfig:{MODE:3},name:"ABreadcrumbItem",inheritAttrs:!1,__ANT_BREADCRUMB_ITEM:!0,props:vn(),slots:["separator","overlay"],setup:function(e,a){var r=a.slots,o=a.attrs,i=Oe("breadcrumb",e),l=i.prefixCls,d=function(u,s){var v=Be(r,e,"overlay");return v?n(rn,{overlay:v,placement:"bottom"},{default:function(){return[n("span",{class:"".concat(s,"-overlay-link")},[u,n(Va,null,null)])]}}):u};return function(){var f,u=(f=Be(r,e,"separator"))!==null&&f!==void 0?f:"/",s=Be(r,e),v=o.class,c=o.style,b=It(o,dn),p;return e.href!==void 0?p=n("a",$({class:"".concat(l.value,"-link"),onClick:e.onClick},b),[s]):p=n("span",$({class:"".concat(l.value,"-link"),onClick:e.onClick},b),[s]),p=d(p,l.value),s?n("span",{class:v,style:c},[p,u&&n("span",{class:"".concat(l.value,"-separator")},[u])]):null}}});var fn=function(){return{prefixCls:String,routes:{type:Array},params:z.any,separator:z.any,itemRender:{type:Function}}};function bn(t,e){if(!t.breadcrumbName)return null;var a=Object.keys(e).join("|"),r=t.breadcrumbName.replace(new RegExp(":(".concat(a,")"),"g"),function(o,i){return e[i]||o});return r}function Zt(t){var e=t.route,a=t.params,r=t.routes,o=t.paths,i=r.indexOf(e)===r.length-1,l=bn(e,a);return i?n("span",null,[l]):n("a",{href:"#/".concat(o.join("/"))},[l])}const We=X({compatConfig:{MODE:3},name:"ABreadcrumb",props:fn(),slots:["separator","itemRender"],setup:function(e,a){var r=a.slots,o=Oe("breadcrumb",e),i=o.prefixCls,l=o.direction,d=function(v,c){return v=(v||"").replace(/^\//,""),Object.keys(c).forEach(function(b){v=v.replace(":".concat(b),c[b])}),v},f=function(v,c,b){var p=Ct(v),C=d(c||"",b);return C&&p.push(C),p},u=function(v){var c=v.routes,b=c===void 0?[]:c,p=v.params,C=p===void 0?{}:p,w=v.separator,x=v.itemRender,S=x===void 0?Zt:x,y=[];return b.map(function(m){var g=d(m.path,C);g&&y.push(g);var T=[].concat(y),E=null;return m.children&&m.children.length&&(E=n(_t,null,{default:function(){return[m.children.map(function(D){return n(_t.Item,{key:D.path||D.breadcrumbName},{default:function(){return[S({route:D,params:C,routes:b,paths:f(T,D.path,C)})]}})})]}})),n(dt,{overlay:E,separator:w,key:g||m.breadcrumbName},{default:function(){return[S({route:m,params:C,routes:b,paths:T})]}})})};return function(){var s,v,c,b=e.routes,p=e.params,C=p===void 0?{}:p,w=ot(Be(r,e)),x=(s=Be(r,e,"separator"))!==null&&s!==void 0?s:"/",S=e.itemRender||r.itemRender||Zt;b&&b.length>0?c=u({routes:b,params:C,separator:x,itemRender:S}):w.length&&(c=w.map(function(m,g){return Ta(ua(m.type)==="object"&&(m.type.__ANT_BREADCRUMB_ITEM||m.type.__ANT_BREADCRUMB_SEPARATOR),"Breadcrumb","Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children"),_a(m,{separator:x,key:g})}));var y=(v={},k(v,i.value,!0),k(v,"".concat(i.value,"-rtl"),l.value==="rtl"),v);return n("div",{class:y},[c])}}});var mn=["separator","class"],pn=function(){return{prefixCls:String}};const wt=X({compatConfig:{MODE:3},name:"ABreadcrumbSeparator",__ANT_BREADCRUMB_SEPARATOR:!0,inheritAttrs:!1,props:pn(),setup:function(e,a){var r=a.slots,o=a.attrs,i=Oe("breadcrumb",e),l=i.prefixCls;return function(){var d;o.separator;var f=o.class,u=It(o,mn),s=ot((d=r.default)===null||d===void 0?void 0:d.call(r));return n("span",$({class:["".concat(l.value,"-separator"),f]},u),[s.length>0?s:"/"])}}});We.Item=dt;We.Separator=wt;We.install=function(t){return t.component(We.name,We),t.component(dt.name,dt),t.component(wt.name,wt),t};function yn(t){var e=j(),a=j(!1);function r(){for(var o=arguments.length,i=new Array(o),l=0;l<o;l++)i[l]=arguments[l];a.value||(at.cancel(e.value),e.value=at(function(){t.apply(void 0,i)}))}return Rt(function(){a.value=!0,at.cancel(e.value)}),r}function hn(t){var e=j([]),a=j(typeof t=="function"?t():t),r=yn(function(){var i=a.value;e.value.forEach(function(l){i=l(i)}),e.value=[],a.value=i});function o(i){e.value.push(i),r()}return[a,o]}const gn=X({compatConfig:{MODE:3},name:"TabNode",props:{id:{type:String},prefixCls:{type:String},tab:{type:Object},active:{type:Boolean},closable:{type:Boolean},editable:{type:Object},onClick:{type:Function},onResize:{type:Function},renderWrapper:{type:Function},removeAriaLabel:{type:String},onFocus:{type:Function}},emits:["click","resize","remove","focus"],setup:function(e,a){var r=a.expose,o=a.attrs,i=j();function l(u){var s;(s=e.tab)!==null&&s!==void 0&&s.disabled||e.onClick(u)}r({domRef:i});function d(u){var s;u.preventDefault(),u.stopPropagation(),e.editable.onEdit("remove",{key:(s=e.tab)===null||s===void 0?void 0:s.key,event:u})}var f=Q(function(){var u;return e.editable&&e.closable!==!1&&!((u=e.tab)!==null&&u!==void 0&&u.disabled)});return function(){var u,s,v=e.prefixCls,c=e.id,b=e.active,p=e.tab,C=p.key,w=p.tab,x=p.disabled,S=p.closeIcon,y=e.renderWrapper,m=e.removeAriaLabel,g=e.editable,T=e.onFocus,E="".concat(v,"-tab"),I=n("div",{key:C,ref:i,class:Ae(E,(u={},k(u,"".concat(E,"-with-remove"),f.value),k(u,"".concat(E,"-active"),b),k(u,"".concat(E,"-disabled"),x),u)),style:o.style,onClick:l},[n("div",{role:"tab","aria-selected":b,id:c&&"".concat(c,"-tab-").concat(C),class:"".concat(E,"-btn"),"aria-controls":c&&"".concat(c,"-panel-").concat(C),"aria-disabled":x,tabindex:x?null:0,onClick:function(L){L.stopPropagation(),l(L)},onKeydown:function(L){[ve.SPACE,ve.ENTER].includes(L.which)&&(L.preventDefault(),l(L))},onFocus:T},[typeof w=="function"?w():w]),f.value&&n("button",{type:"button","aria-label":m||"remove",tabindex:0,class:"".concat(E,"-remove"),onClick:function(L){L.stopPropagation(),d(L)}},[(S==null?void 0:S())||((s=g.removeIcon)===null||s===void 0?void 0:s.call(g))||"×"])]);return y?y(I):I}}});var Jt={width:0,height:0,left:0,top:0};function Cn(t,e){var a=j(new Map);return ct(function(){for(var r,o=new Map,i=t.value,l=e.value.get((r=i[0])===null||r===void 0?void 0:r.key)||Jt,d=l.left+l.width,f=0;f<i.length;f+=1){var u=i[f].key,s=e.value.get(u);if(!s){var v;s=e.value.get((v=i[f-1])===null||v===void 0?void 0:v.key)||Jt}var c=o.get(u)||$({},s);c.right=d-c.left-c.width,o.set(u,c)}a.value=new Map(o)}),a}const va=X({compatConfig:{MODE:3},name:"AddButton",inheritAttrs:!1,props:{prefixCls:String,editable:{type:Object},locale:{type:Object,default:void 0}},setup:function(e,a){var r=a.expose,o=a.attrs,i=j();return r({domRef:i}),function(){var l=e.prefixCls,d=e.editable,f=e.locale;return!d||d.showAdd===!1?null:n("button",{ref:i,type:"button",class:"".concat(l,"-nav-add"),style:o.style,"aria-label":(f==null?void 0:f.addAriaLabel)||"Add tab",onClick:function(s){d.onEdit("add",{event:s})}},[d.addIcon?d.addIcon():"+"])}}});var xn={prefixCls:{type:String},id:{type:String},tabs:{type:Object},rtl:{type:Boolean},tabBarGutter:{type:Number},activeKey:{type:[String,Number]},mobile:{type:Boolean},moreIcon:z.any,moreTransitionName:{type:String},editable:{type:Object},locale:{type:Object,default:void 0},removeAriaLabel:String,onTabClick:{type:Function}};const Sn=X({compatConfig:{MODE:3},name:"OperationNode",inheritAttrs:!1,props:xn,emits:["tabClick"],slots:["moreIcon"],setup:function(e,a){var r=a.attrs,o=a.slots,i=J(!1),l=G(i,2),d=l[0],f=l[1],u=J(null),s=G(u,2),v=s[0],c=s[1],b=function(y){for(var m=e.tabs.filter(function(D){return!D.disabled}),g=m.findIndex(function(D){return D.key===v.value})||0,T=m.length,E=0;E<T;E+=1){g=(g+y+T)%T;var I=m[g];if(!I.disabled){c(I.key);return}}},p=function(y){var m=y.which;if(!d.value){[ve.DOWN,ve.SPACE,ve.ENTER].includes(m)&&(f(!0),y.preventDefault());return}switch(m){case ve.UP:b(-1),y.preventDefault();break;case ve.DOWN:b(1),y.preventDefault();break;case ve.ESC:f(!1);break;case ve.SPACE:case ve.ENTER:v.value!==null&&e.onTabClick(v.value,y);break}},C=Q(function(){return"".concat(e.id,"-more-popup")}),w=Q(function(){return v.value!==null?"".concat(C.value,"-").concat(v.value):null}),x=function(y,m){y.preventDefault(),y.stopPropagation(),e.editable.onEdit("remove",{key:m,event:y})};return rt(function(){Fe(v,function(){var S=document.getElementById(w.value);S&&S.scrollIntoView&&S.scrollIntoView(!1)},{flush:"post",immediate:!0})}),Fe(d,function(){d.value||c(null)}),function(){var S,y=e.prefixCls,m=e.id,g=e.tabs,T=e.locale,E=e.mobile,I=e.moreIcon,D=I===void 0?((S=o.moreIcon)===null||S===void 0?void 0:S.call(o))||n(on,null,null):I,L=e.moreTransitionName,M=e.editable,te=e.tabBarGutter,P=e.rtl,h=e.onTabClick,_="".concat(y,"-dropdown"),R=T==null?void 0:T.dropdownAriaLabel,K=k({},P?"marginRight":"marginLeft",te);g.length||(K.visibility="hidden",K.order=1);var N=Ae(k({},"".concat(_,"-rtl"),P)),O=E?null:n(sn,{prefixCls:_,trigger:["hover"],visible:d.value,transitionName:L,onVisibleChange:f,overlayClassName:N,mouseEnterDelay:.1,mouseLeaveDelay:.1},{overlay:function(){return n(_t,{onClick:function(F){var Y=F.key,se=F.domEvent;h(Y,se),f(!1)},id:C.value,tabindex:-1,role:"listbox","aria-activedescendant":w.value,selectedKeys:[v.value],"aria-label":R!==void 0?R:"expanded dropdown"},{default:function(){return[g.map(function(F){var Y,se,pe=M&&F.closable!==!1&&!F.disabled;return n(ln,{key:F.key,id:"".concat(C.value,"-").concat(F.key),role:"option","aria-controls":m&&"".concat(m,"-panel-").concat(F.key),disabled:F.disabled},{default:function(){return[n("span",null,[typeof F.tab=="function"?F.tab():F.tab]),pe&&n("button",{type:"button","aria-label":e.removeAriaLabel||"remove",tabindex:0,class:"".concat(_,"-menu-item-remove"),onClick:function(ye){ye.stopPropagation(),x(ye,F.key)}},[((Y=F.closeIcon)===null||Y===void 0?void 0:Y.call(F))||((se=M.removeIcon)===null||se===void 0?void 0:se.call(M))||"×"])]}})})]}})},default:function(){return n("button",{type:"button",class:"".concat(y,"-nav-more"),style:K,tabindex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":C.value,id:"".concat(m,"-more"),"aria-expanded":d.value,onKeydown:p},[D])}});return n("div",{class:Ae("".concat(y,"-nav-operations"),r.class),style:r.style},[O,n(va,{prefixCls:y,locale:T,editable:M},null)])}}});var fa=Symbol("tabsContextKey"),Tn=function(e){wa(fa,e)},ba=function(){return ka(fa,{tabs:j([]),prefixCls:j()})},_n=.1,Qt=.01,ut=20,ea=Math.pow(.995,ut);function wn(t,e){var a=J(),r=G(a,2),o=r[0],i=r[1],l=J(0),d=G(l,2),f=d[0],u=d[1],s=J(0),v=G(s,2),c=v[0],b=v[1],p=J(),C=G(p,2),w=C[0],x=C[1],S=j();function y(P){var h=P.touches[0],_=h.screenX,R=h.screenY;i({x:_,y:R}),clearInterval(S.value)}function m(P){if(o.value){P.preventDefault();var h=P.touches[0],_=h.screenX,R=h.screenY,K=_-o.value.x,N=R-o.value.y;e(K,N),i({x:_,y:R});var O=Date.now();b(O-f.value),u(O),x({x:K,y:N})}}function g(){if(o.value){var P=w.value;if(i(null),x(null),P){var h=P.x/c.value,_=P.y/c.value,R=Math.abs(h),K=Math.abs(_);if(Math.max(R,K)<_n)return;var N=h,O=_;S.value=setInterval(function(){if(Math.abs(N)<Qt&&Math.abs(O)<Qt){clearInterval(S.value);return}N*=ea,O*=ea,e(N*ut,O*ut)},ut)}}}var T=j();function E(P){var h=P.deltaX,_=P.deltaY,R=0,K=Math.abs(h),N=Math.abs(_);K===N?R=T.value==="x"?h:_:K>N?(R=h,T.value="x"):(R=_,T.value="y"),e(-R,-R)&&P.preventDefault()}var I=j({onTouchStart:y,onTouchMove:m,onTouchEnd:g,onWheel:E});function D(P){I.value.onTouchStart(P)}function L(P){I.value.onTouchMove(P)}function M(P){I.value.onTouchEnd(P)}function te(P){I.value.onWheel(P)}rt(function(){var P,h;document.addEventListener("touchmove",L,{passive:!1}),document.addEventListener("touchend",M,{passive:!1}),(P=t.value)===null||P===void 0||P.addEventListener("touchstart",D,{passive:!1}),(h=t.value)===null||h===void 0||h.addEventListener("wheel",te,{passive:!1})}),Rt(function(){document.removeEventListener("touchmove",L),document.removeEventListener("touchend",M)})}function ta(t,e){var a=j(t);function r(o){var i=typeof o=="function"?o(a.value):o;i!==a.value&&e(i,a.value),a.value=i}return[a,r]}var kn=function(){var e=j(new Map),a=function(o){return function(i){e.value.set(o,i)}};return Pa(function(){e.value=new Map}),[a,e]};const Pn=kn;function En(t,e,a,r){if(!Gt(t))return t;e=da(e,t);for(var o=-1,i=e.length,l=i-1,d=t;d!=null&&++o<i;){var f=Qa(e[o]),u=a;if(f==="__proto__"||f==="constructor"||f==="prototype")return t;if(o!=l){var s=d[f];u=r?r(s,f,d):void 0,u===void 0&&(u=Gt(s)?s:cn(e[o+1])?[]:{})}en(d,f,u),d=d[f]}return t}function In(t,e,a){for(var r=-1,o=e.length,i={};++r<o;){var l=e[r],d=tn(t,l);a(d,l)&&En(i,da(l,t),d)}return i}function Rn(t,e){return In(t,e,function(a,r){return an(t,r)})}var Bn=nn(function(t,e){return t==null?{}:Rn(t,e)});const ma=Bn;var aa={width:0,height:0,left:0,top:0,right:0},An=function(){return{id:{type:String},tabPosition:{type:String},activeKey:{type:[String,Number]},rtl:{type:Boolean},animated:{type:Object,default:void 0},editable:{type:Object},moreIcon:z.any,moreTransitionName:{type:String},mobile:{type:Boolean},tabBarGutter:{type:Number},renderTabBar:{type:Function},locale:{type:Object,default:void 0},onTabClick:{type:Function},onTabScroll:{type:Function}}};const na=X({compatConfig:{MODE:3},name:"TabNavList",inheritAttrs:!1,props:An(),slots:["moreIcon","leftExtra","rightExtra","tabBarExtraContent"],emits:["tabClick","tabScroll"],setup:function(e,a){var r=a.attrs,o=a.slots,i=ba(),l=i.tabs,d=i.prefixCls,f=j(),u=j(),s=j(),v=j(),c=Pn(),b=G(c,2),p=b[0],C=b[1],w=Q(function(){return e.tabPosition==="top"||e.tabPosition==="bottom"}),x=ta(0,function(A,U){w.value&&e.onTabScroll&&e.onTabScroll({direction:A>U?"left":"right"})}),S=G(x,2),y=S[0],m=S[1],g=ta(0,function(A,U){!w.value&&e.onTabScroll&&e.onTabScroll({direction:A>U?"top":"bottom"})}),T=G(g,2),E=T[0],I=T[1],D=J(0),L=G(D,2),M=L[0],te=L[1],P=J(0),h=G(P,2),_=h[0],R=h[1],K=J(null),N=G(K,2),O=N[0],be=N[1],ie=J(null),F=G(ie,2),Y=F[0],se=F[1],pe=J(0),H=G(pe,2),$e=H[0],ye=H[1],ee=J(0),ae=G(ee,2),Ue=ae[0],je=ae[1],De=hn(new Map),Se=G(De,2),qe=Se[0],Ve=Se[1],Ke=Cn(l,qe),Ne=Q(function(){return"".concat(d.value,"-nav-operations-hidden")}),q=j(0),Ee=j(0);ct(function(){w.value?e.rtl?(q.value=0,Ee.value=Math.max(0,M.value-O.value)):(q.value=Math.min(0,O.value-M.value),Ee.value=0):(q.value=Math.min(0,Y.value-_.value),Ee.value=0)});var Ie=function(U){return U<q.value?q.value:U>Ee.value?Ee.value:U},Xe=j(),Ye=J(),Dt=G(Ye,2),vt=Dt[0],Nt=Dt[1],ft=function(){Nt(Date.now())},bt=function(){clearTimeout(Xe.value)},Lt=function(U,B){U(function(V){var W=Ie(V+B);return W})};wn(f,function(A,U){if(w.value){if(O.value>=M.value)return!1;Lt(m,A)}else{if(Y.value>=_.value)return!1;Lt(I,U)}return bt(),ft(),!0}),Fe(vt,function(){bt(),vt.value&&(Xe.value=setTimeout(function(){Nt(0)},100))});var Mt=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activeKey,B=Ke.value.get(U)||{width:0,height:0,left:0,right:0,top:0};if(w.value){var V=y.value;e.rtl?B.right<y.value?V=B.right:B.right+B.width>y.value+O.value&&(V=B.right+B.width-O.value):B.left<-y.value?V=-B.left:B.left+B.width>-y.value+O.value&&(V=-(B.left+B.width-O.value)),I(0),m(Ie(V))}else{var W=E.value;B.top<-E.value?W=-B.top:B.top+B.height>-E.value+Y.value&&(W=-(B.top+B.height-Y.value)),m(0),I(Ie(W))}},mt=j(0),pt=j(0);ct(function(){var A,U,B,V,W,ne,re,Le=Ke.value;["top","bottom"].includes(e.tabPosition)?(U="width",W=O.value,ne=M.value,re=$e.value,B=e.rtl?"right":"left",V=Math.abs(y.value)):(U="height",W=Y.value,ne=M.value,re=Ue.value,B="top",V=-E.value);var ue=W;ne+re>W&&ne<W&&(ue=W-re);var Te=l.value;if(!Te.length){var _e;return _e=[0,0],mt.value=_e[0],pt.value=_e[1],_e}for(var Me=Te.length,Z=Me,he=0;he<Me;he+=1){var ge=Le.get(Te[he].key)||aa;if(ge[B]+ge[U]>V+ue){Z=he-1;break}}for(var we=0,le=Me-1;le>=0;le-=1){var Ce=Le.get(Te[le].key)||aa;if(Ce[B]<V){we=le+1;break}}return A=[we,Z],mt.value=A[0],pt.value=A[1],A});var yt=function(){var U,B,V,W,ne,re=((U=f.value)===null||U===void 0?void 0:U.offsetWidth)||0,Le=((B=f.value)===null||B===void 0?void 0:B.offsetHeight)||0,ue=((V=v.value)===null||V===void 0?void 0:V.$el)||{},Te=ue.offsetWidth||0,_e=ue.offsetHeight||0;be(re),se(Le),ye(Te),je(_e);var Me=(((W=u.value)===null||W===void 0?void 0:W.offsetWidth)||0)-Te,Z=(((ne=u.value)===null||ne===void 0?void 0:ne.offsetHeight)||0)-_e;te(Me),R(Z),Ve(function(){var he=new Map;return l.value.forEach(function(ge){var we=ge.key,le=C.value.get(we),Ce=(le==null?void 0:le.$el)||le;Ce&&he.set(we,{width:Ce.offsetWidth,height:Ce.offsetHeight,left:Ce.offsetLeft,top:Ce.offsetTop})}),he})},Ft=Q(function(){return[].concat(Ct(l.value.slice(0,mt.value)),Ct(l.value.slice(pt.value+1)))}),ha=J(),Ut=G(ha,2),ga=Ut[0],Ca=Ut[1],Re=Q(function(){return Ke.value.get(e.activeKey)}),jt=j(),Kt=function(){at.cancel(jt.value)};Fe([Re,w,function(){return e.rtl}],function(){var A={};Re.value&&(w.value?(e.rtl?A.right=Qe(Re.value.right):A.left=Qe(Re.value.left),A.width=Qe(Re.value.width)):(A.top=Qe(Re.value.top),A.height=Qe(Re.value.height))),Kt(),jt.value=at(function(){Ca(A)})}),Fe([function(){return e.activeKey},Re,Ke,w],function(){Mt()},{flush:"post"}),Fe([function(){return e.rtl},function(){return e.tabBarGutter},function(){return e.activeKey},function(){return l.value}],function(){yt()},{flush:"post"});var ht=function(U){var B=U.position,V=U.prefixCls,W=U.extra;if(!W)return null;var ne=W==null?void 0:W({position:B});return ne?n("div",{class:"".concat(V,"-extra-content")},[ne]):null};return Rt(function(){bt(),Kt()}),function(){var A,U=e.id,B=e.animated,V=e.activeKey,W=e.rtl,ne=e.editable,re=e.locale,Le=e.tabPosition,ue=e.tabBarGutter,Te=e.onTabClick,_e=r.class,Me=r.style,Z=d.value,he=!!Ft.value.length,ge="".concat(Z,"-nav-wrap"),we,le,Ce,Ht;w.value?W?(le=y.value>0,we=y.value+O.value<M.value):(we=y.value<0,le=-y.value+O.value<M.value):(Ce=E.value<0,Ht=-E.value+Y.value<_.value);var lt={};Le==="top"||Le==="bottom"?lt[W?"marginRight":"marginLeft"]=typeof ue=="number"?"".concat(ue,"px"):ue:lt.marginTop=typeof ue=="number"?"".concat(ue,"px"):ue;var Wt=l.value.map(function(Ze,zt){var Je=Ze.key;return n(gn,{id:U,prefixCls:Z,key:Je,tab:Ze,style:zt===0?void 0:lt,closable:Ze.closable,editable:ne,active:Je===V,removeAriaLabel:re==null?void 0:re.removeAriaLabel,ref:p(Je),onClick:function(Sa){Te(Je,Sa)},onFocus:function(){Mt(Je),ft(),f.value&&(W||(f.value.scrollLeft=0),f.value.scrollTop=0)}},o)});return n("div",{role:"tablist",class:Ae("".concat(Z,"-nav"),_e),style:Me,onKeydown:function(){ft()}},[n(ht,{position:"left",prefixCls:Z,extra:o.leftExtra},null),n(xt,{onResize:yt},{default:function(){return[n("div",{class:Ae(ge,(A={},k(A,"".concat(ge,"-ping-left"),we),k(A,"".concat(ge,"-ping-right"),le),k(A,"".concat(ge,"-ping-top"),Ce),k(A,"".concat(ge,"-ping-bottom"),Ht),A)),ref:f},[n(xt,{onResize:yt},{default:function(){return[n("div",{ref:u,class:"".concat(Z,"-nav-list"),style:{transform:"translate(".concat(y.value,"px, ").concat(E.value,"px)"),transition:vt.value?"none":void 0}},[Wt,n(va,{ref:v,prefixCls:Z,locale:re,editable:ne,style:$($({},Wt.length===0?void 0:lt),{},{visibility:he?"hidden":null})},null),n("div",{class:Ae("".concat(Z,"-ink-bar"),k({},"".concat(Z,"-ink-bar-animated"),B.inkBar)),style:ga.value},null)])]}})])]}}),n(Sn,$($({},e),{},{removeAriaLabel:re==null?void 0:re.removeAriaLabel,ref:s,prefixCls:Z,tabs:Ft.value,class:!he&&Ne.value}),ma(o,["moreIcon"])),n(ht,{position:"right",prefixCls:Z,extra:o.rightExtra},null),n(ht,{position:"right",prefixCls:Z,extra:o.tabBarExtraContent},null)])}}}),On=X({compatConfig:{MODE:3},name:"TabPanelList",inheritAttrs:!1,props:{activeKey:{type:[String,Number]},id:{type:String},rtl:{type:Boolean},animated:{type:Object,default:void 0},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean}},setup:function(e){var a=ba(),r=a.tabs,o=a.prefixCls;return function(){var i=e.id,l=e.activeKey,d=e.animated,f=e.tabPosition,u=e.rtl,s=e.destroyInactiveTabPane,v=d.tabPane,c=o.value,b=r.value.findIndex(function(p){return p.key===l});return n("div",{class:"".concat(c,"-content-holder")},[n("div",{class:["".concat(c,"-content"),"".concat(c,"-content-").concat(f),k({},"".concat(c,"-content-animated"),v)],style:b&&v?k({},u?"marginRight":"marginLeft","-".concat(b,"00%")):null},[r.value.map(function(p){return Ea(p.node,{key:p.key,prefixCls:c,tabKey:p.key,id:i,animated:v,active:p.key===l,destroyInactiveTabPane:s})})])])}}});var $n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"};const Dn=$n;function ra(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),r.forEach(function(o){Nn(t,o,a[o])})}return t}function Nn(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var At=function(e,a){var r=ra({},e,a.attrs);return n(Bt,ra({},r,{icon:Dn}),null)};At.displayName="PlusOutlined";At.inheritAttrs=!1;const Ln=At;var oa=0,pa=function(){return{prefixCls:{type:String},id:{type:String},activeKey:{type:[String,Number]},defaultActiveKey:{type:[String,Number]},direction:{type:String},animated:{type:[Boolean,Object]},renderTabBar:{type:Function},tabBarGutter:{type:Number},tabBarStyle:{type:Object},tabPosition:{type:String},destroyInactiveTabPane:{type:Boolean},hideAdd:Boolean,type:{type:String},size:{type:String},centered:Boolean,onEdit:{type:Function},onChange:{type:Function},onTabClick:{type:Function},onTabScroll:{type:Function},"onUpdate:activeKey":{type:Function},locale:{type:Object,default:void 0},onPrevClick:Function,onNextClick:Function,tabBarExtraContent:z.any}};function Mn(t){return t.map(function(e){if(Ra(e)){for(var a=$({},e.props||{}),r=0,o=Object.entries(a);r<o.length;r++){var i=G(o[r],2),l=i[0],d=i[1];delete a[l],a[Ba(l)]=d}var f=e.children||{},u=e.key!==void 0?e.key:void 0,s=a.tab,v=s===void 0?f.tab:s,c=a.disabled,b=a.forceRender,p=a.closable,C=a.animated,w=a.active,x=a.destroyInactiveTabPane;return $($({key:u},a),{},{node:e,closeIcon:f.closeIcon,tab:v,disabled:c===""||c,forceRender:b===""||b,closable:p===""||p,animated:C===""||C,active:w===""||w,destroyInactiveTabPane:x===""||x})}return null}).filter(function(e){return e})}var Fn=X({compatConfig:{MODE:3},name:"InternalTabs",inheritAttrs:!1,props:$($({},ca(pa(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}})),{},{tabs:{type:Array}}),slots:["tabBarExtraContent","leftExtra","rightExtra","moreIcon","addIcon","removeIcon","renderTabBar"],setup:function(e,a){var r=a.attrs,o=a.slots;st(e.onPrevClick===void 0&&e.onNextClick===void 0,"Tabs","`onPrevClick / @prevClick` and `onNextClick / @nextClick` has been removed. Please use `onTabScroll / @tabScroll` instead."),st(e.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` prop has been removed. Please use `rightExtra` slot instead."),st(o.tabBarExtraContent===void 0,"Tabs","`tabBarExtraContent` slot is deprecated. Please use `rightExtra` slot instead.");var i=Oe("tabs",e),l=i.prefixCls,d=i.direction,f=i.size,u=i.rootPrefixCls,s=Q(function(){return d.value==="rtl"}),v=Q(function(){var h=e.animated,_=e.tabPosition;return h===!1||["left","right"].includes(_)?{inkBar:!1,tabPane:!1}:h===!0?{inkBar:!0,tabPane:!0}:$({inkBar:!0,tabPane:!1},ua(h)==="object"?h:{})}),c=J(!1),b=G(c,2),p=b[0],C=b[1];rt(function(){C(Xa())});var w=Xt(function(){var h;return(h=e.tabs[0])===null||h===void 0?void 0:h.key},{value:Q(function(){return e.activeKey}),defaultValue:e.defaultActiveKey}),x=G(w,2),S=x[0],y=x[1],m=J(function(){return e.tabs.findIndex(function(h){return h.key===S.value})}),g=G(m,2),T=g[0],E=g[1];ct(function(){var h=e.tabs.findIndex(function(R){return R.key===S.value});if(h===-1){var _;h=Math.max(0,Math.min(T.value,e.tabs.length-1)),y((_=e.tabs[h])===null||_===void 0?void 0:_.key)}E(h)});var I=Xt(null,{value:Q(function(){return e.id})}),D=G(I,2),L=D[0],M=D[1],te=Q(function(){return p.value&&!["left","right"].includes(e.tabPosition)?"top":e.tabPosition});rt(function(){e.id||(M("rc-tabs-".concat(oa)),oa+=1)});var P=function(_,R){var K;(K=e.onTabClick)===null||K===void 0||K.call(e,_,R);var N=_!==S.value;if(y(_),N){var O;(O=e.onChange)===null||O===void 0||O.call(e,_)}};return Tn({tabs:Q(function(){return e.tabs}),prefixCls:l}),function(){var h,_=e.id,R=e.type,K=e.tabBarGutter,N=e.tabBarStyle,O=e.locale,be=e.destroyInactiveTabPane,ie=e.renderTabBar,F=ie===void 0?o.renderTabBar:ie,Y=e.onTabScroll,se=e.hideAdd,pe=e.centered,H={id:L.value,activeKey:S.value,animated:v.value,tabPosition:te.value,rtl:s.value,mobile:p.value},$e;R==="editable-card"&&($e={onEdit:function(je,De){var Se,qe=De.key,Ve=De.event;(Se=e.onEdit)===null||Se===void 0||Se.call(e,je==="add"?Ve:qe,je)},removeIcon:function(){return n(Aa,null,null)},addIcon:o.addIcon?o.addIcon:function(){return n(Ln,null,null)},showAdd:se!==!0});var ye,ee=$($({},H),{},{moreTransitionName:"".concat(u.value,"-slide-up"),editable:$e,locale:O,tabBarGutter:K,onTabClick:P,onTabScroll:Y,style:N});F?ye=F($($({},ee),{},{DefaultTabBar:na})):ye=n(na,ee,ma(o,["moreIcon","leftExtra","rightExtra","tabBarExtraContent"]));var ae=l.value;return n("div",$($({},r),{},{id:_,class:Ae(ae,"".concat(ae,"-").concat(te.value),(h={},k(h,"".concat(ae,"-").concat(f.value),f.value),k(h,"".concat(ae,"-card"),["card","editable-card"].includes(R)),k(h,"".concat(ae,"-editable-card"),R==="editable-card"),k(h,"".concat(ae,"-centered"),pe),k(h,"".concat(ae,"-mobile"),p.value),k(h,"".concat(ae,"-editable"),R==="editable-card"),k(h,"".concat(ae,"-rtl"),s.value),h),r.class)}),[ye,n(On,$($({destroyInactiveTabPane:be},H),{},{animated:v.value}),null)])}}});const ze=X({compatConfig:{MODE:3},name:"ATabs",inheritAttrs:!1,props:ca(pa(),{tabPosition:"top",animated:{inkBar:!0,tabPane:!1}}),slots:["tabBarExtraContent","leftExtra","rightExtra","moreIcon","addIcon","removeIcon","renderTabBar"],setup:function(e,a){var r=a.attrs,o=a.slots,i=a.emit,l=function(f){i("update:activeKey",f),i("change",f)};return function(){var d,f=Mn(ot((d=o.default)===null||d===void 0?void 0:d.call(o)));return n(Fn,$($($({},Ia(e,["onUpdate:activeKey"])),r),{},{onChange:l,tabs:f}),o)}}});var Un=function(){return{tab:z.any,disabled:{type:Boolean},forceRender:{type:Boolean},closable:{type:Boolean},animated:{type:Boolean},active:{type:Boolean},destroyInactiveTabPane:{type:Boolean},prefixCls:{type:String},tabKey:{type:[String,Number]},id:{type:String}}};const kt=X({compatConfig:{MODE:3},name:"ATabPane",inheritAttrs:!1,__ANT_TAB_PANE:!0,props:Un(),slots:["closeIcon","tab"],setup:function(e,a){var r=a.attrs,o=a.slots,i=j(e.forceRender);Fe([function(){return e.active},function(){return e.destroyInactiveTabPane}],function(){e.active?i.value=!0:e.destroyInactiveTabPane&&(i.value=!1)},{immediate:!0});var l=Q(function(){return e.active?{}:e.animated?{visibility:"hidden",height:0,overflowY:"hidden"}:{display:"none"}});return function(){var d,f=e.prefixCls,u=e.forceRender,s=e.id,v=e.active,c=e.tabKey;return n("div",{id:s&&"".concat(s,"-panel-").concat(c),role:"tabpanel",tabindex:v?0:-1,"aria-labelledby":s&&"".concat(s,"-tab-").concat(c),"aria-hidden":!v,style:[l.value,r.style],class:["".concat(f,"-tabpane"),v&&"".concat(f,"-tabpane-active"),r.class]},[(v||i.value||u)&&((d=o.default)===null||d===void 0?void 0:d.call(o))])}}});ze.TabPane=kt;ze.install=function(t){return t.component(ze.name,ze),t.component(kt.name,kt),t};var jn=ze.TabPane,Kn=function(){return{prefixCls:String,title:z.any,extra:z.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:z.any,tabList:{type:Array},tabBarExtraContent:z.any,activeTabKey:String,defaultActiveTabKey:String,cover:z.any,onTabChange:{type:Function}}},Hn=X({compatConfig:{MODE:3},name:"ACard",props:Kn(),slots:["title","extra","tabBarExtraContent","actions","cover","customTab"],setup:function(e,a){var r=a.slots,o=Oe("card",e),i=o.prefixCls,l=o.direction,d=o.size,f=function(c){var b=c.map(function(p,C){return qt(p)&&!$a(p)||!qt(p)?n("li",{style:{width:"".concat(100/c.length,"%")},key:"action-".concat(C)},[n("span",null,[p])]):null});return b},u=function(c){var b;(b=e.onTabChange)===null||b===void 0||b.call(e,c)},s=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],b;return c.forEach(function(p){p&&Da(p.type)&&p.type.__ANT_CARD_GRID&&(b=!0)}),b};return function(){var v,c,b,p,C,w,x,S,y=e.headStyle,m=y===void 0?{}:y,g=e.bodyStyle,T=g===void 0?{}:g,E=e.loading,I=e.bordered,D=I===void 0?!0:I,L=e.type,M=e.tabList,te=e.hoverable,P=e.activeTabKey,h=e.defaultActiveTabKey,_=e.tabBarExtraContent,R=_===void 0?et((v=r.tabBarExtraContent)===null||v===void 0?void 0:v.call(r)):_,K=e.title,N=K===void 0?et((c=r.title)===null||c===void 0?void 0:c.call(r)):K,O=e.extra,be=O===void 0?et((b=r.extra)===null||b===void 0?void 0:b.call(r)):O,ie=e.actions,F=ie===void 0?et((p=r.actions)===null||p===void 0?void 0:p.call(r)):ie,Y=e.cover,se=Y===void 0?et((C=r.cover)===null||C===void 0?void 0:C.call(r)):Y,pe=ot((w=r.default)===null||w===void 0?void 0:w.call(r)),H=i.value,$e=(x={},k(x,"".concat(H),!0),k(x,"".concat(H,"-loading"),E),k(x,"".concat(H,"-bordered"),D),k(x,"".concat(H,"-hoverable"),!!te),k(x,"".concat(H,"-contain-grid"),s(pe)),k(x,"".concat(H,"-contain-tabs"),M&&M.length),k(x,"".concat(H,"-").concat(d.value),d.value),k(x,"".concat(H,"-type-").concat(L),!!L),k(x,"".concat(H,"-rtl"),l.value==="rtl"),x),ye=T.padding===0||T.padding==="0px"?{padding:"24px"}:void 0,ee=n("div",{class:"".concat(H,"-loading-block")},null),ae=n("div",{class:"".concat(H,"-loading-content"),style:ye},[n(He,{gutter:8},{default:function(){return[n(de,{span:22},{default:function(){return[ee]}})]}}),n(He,{gutter:8},{default:function(){return[n(de,{span:8},{default:function(){return[ee]}}),n(de,{span:15},{default:function(){return[ee]}})]}}),n(He,{gutter:8},{default:function(){return[n(de,{span:6},{default:function(){return[ee]}}),n(de,{span:18},{default:function(){return[ee]}})]}}),n(He,{gutter:8},{default:function(){return[n(de,{span:13},{default:function(){return[ee]}}),n(de,{span:9},{default:function(){return[ee]}})]}}),n(He,{gutter:8},{default:function(){return[n(de,{span:4},{default:function(){return[ee]}}),n(de,{span:3},{default:function(){return[ee]}}),n(de,{span:16},{default:function(){return[ee]}})]}})]),Ue=P!==void 0,je=(S={size:"large"},k(S,Ue?"activeKey":"defaultActiveKey",Ue?P:h),k(S,"onChange",u),k(S,"class","".concat(H,"-head-tabs")),S),De,Se=M&&M.length?n(ze,je,{default:function(){return[M.map(function(q){var Ee=q.tab,Ie=q.slots,Xe=Ie==null?void 0:Ie.tab;st(!Ie,"Card","tabList slots is deprecated, Please use `customTab` instead.");var Ye=Ee!==void 0?Ee:r[Xe]?r[Xe](q):null;return Ye=Oa(r,"customTab",q,function(){return[Ye]}),n(jn,{tab:Ye,key:q.key,disabled:q.disabled},null)})]},rightExtra:R?function(){return R}:null}):null;(N||be||Se)&&(De=n("div",{class:"".concat(H,"-head"),style:m},[n("div",{class:"".concat(H,"-head-wrapper")},[N&&n("div",{class:"".concat(H,"-head-title")},[N]),be&&n("div",{class:"".concat(H,"-extra")},[be])]),Se]));var qe=se?n("div",{class:"".concat(H,"-cover")},[se]):null,Ve=n("div",{class:"".concat(H,"-body"),style:T},[E?ae:pe]),Ke=F&&F.length?n("ul",{class:"".concat(H,"-actions")},[f(F)]):null;return n("div",{class:$e,ref:"cardContainerRef"},[De,qe,pe&&pe.length?Ve:null,Ke])}}});const Ge=Hn;var Wn=function(){return{prefixCls:String,title:z.any,description:z.any,avatar:z.any}};const Pt=X({compatConfig:{MODE:3},name:"ACardMeta",props:Wn(),slots:["title","description","avatar"],setup:function(e,a){var r=a.slots,o=Oe("card",e),i=o.prefixCls;return function(){var l=k({},"".concat(i.value,"-meta"),!0),d=Be(r,e,"avatar"),f=Be(r,e,"title"),u=Be(r,e,"description"),s=d?n("div",{class:"".concat(i.value,"-meta-avatar")},[d]):null,v=f?n("div",{class:"".concat(i.value,"-meta-title")},[f]):null,c=u?n("div",{class:"".concat(i.value,"-meta-description")},[u]):null,b=v||c?n("div",{class:"".concat(i.value,"-meta-detail")},[v,c]):null;return n("div",{class:l},[s,b])}}});var zn=function(){return{prefixCls:String,hoverable:{type:Boolean,default:!0}}};const Et=X({compatConfig:{MODE:3},name:"ACardGrid",__ANT_CARD_GRID:!0,props:zn(),setup:function(e,a){var r=a.slots,o=Oe("card",e),i=o.prefixCls,l=Q(function(){var d;return d={},k(d,"".concat(i.value,"-grid"),!0),k(d,"".concat(i.value,"-grid-hoverable"),e.hoverable),d});return function(){var d;return n("div",{class:l.value},[(d=r.default)===null||d===void 0?void 0:d.call(r)])}}});Ge.Meta=Pt;Ge.Grid=Et;Ge.install=function(t){return t.component(Ge.name,Ge),t.component(Pt.name,Pt),t.component(Et.name,Et),t};fe.useInjectFormItemContext=Na;fe.ItemRest=St;fe.install=function(t){return t.component(fe.name,fe),t.component(fe.Item.name,fe.Item),t.component(St.name,St),t};var Gn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"};const qn=Gn;function la(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),r.forEach(function(o){Vn(t,o,a[o])})}return t}function Vn(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Ot=function(e,a){var r=la({},e,a.attrs);return n(Bt,la({},r,{icon:qn}),null)};Ot.displayName="ArrowLeftOutlined";Ot.inheritAttrs=!1;const Xn=Ot;var Yn={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"};const Zn=Yn;function ia(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable}))),r.forEach(function(o){Jn(t,o,a[o])})}return t}function Jn(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var $t=function(e,a){var r=ia({},e,a.attrs);return n(Bt,ia({},r,{icon:Zn}),null)};$t.displayName="ArrowRightOutlined";$t.inheritAttrs=!1;const Qn=$t;var er=["noStyle","disabled"],tr={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},ar=X({compatConfig:{MODE:3},name:"TransButton",inheritAttrs:!1,props:{noStyle:{type:Boolean,default:void 0},onClick:Function,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0}},setup:function(e,a){var r=a.slots,o=a.emit,i=a.attrs,l=a.expose,d=j(),f=function(p){var C=p.keyCode;C===ve.ENTER&&p.preventDefault()},u=function(p){var C=p.keyCode;C===ve.ENTER&&o("click",p)},s=function(p){o("click",p)},v=function(){d.value&&d.value.focus()},c=function(){d.value&&d.value.blur()};return rt(function(){e.autofocus&&v()}),l({focus:v,blur:c}),function(){var b,p=e.noStyle,C=e.disabled,w=It(e,er),x={};return p||(x=$({},tr)),C&&(x.pointerEvents="none"),n("div",$($($({role:"button",tabindex:0,ref:d},w),i),{},{onClick:s,onKeydown:f,onKeyup:u,style:$($({},x),i.style||{})}),[(b=r.default)===null||b===void 0?void 0:b.call(r)])}}});const nr=ar;var rr=function(){return{backIcon:z.any,prefixCls:String,title:z.any,subTitle:z.any,breadcrumb:z.object,tags:z.any,footer:z.any,extra:z.any,avatar:z.object,ghost:{type:Boolean,default:void 0},onBack:Function}},or=X({compatConfig:{MODE:3},name:"APageHeader",props:rr(),slots:["backIcon","avatar","breadcrumb","title","subTitle","tags","extra","footer"],setup:function(e,a){var r=a.emit,o=a.slots,i=Oe("page-header",e),l=i.prefixCls,d=i.direction,f=i.pageHeader,u=j(!1),s=Ma(),v=function(m){var g=m.width;s.value||(u.value=g<768)},c=Q(function(){var y,m,g;return(y=(m=e.ghost)!==null&&m!==void 0?m:(g=f.value)===null||g===void 0?void 0:g.ghost)!==null&&y!==void 0?y:!0}),b=function(){var m,g,T;return(m=(g=e.backIcon)!==null&&g!==void 0?g:(T=o.backIcon)===null||T===void 0?void 0:T.call(o))!==null&&m!==void 0?m:d.value==="rtl"?n(Qn,null,null):n(Xn,null,null)},p=function(m){return!m||!e.onBack?null:n(ja,{componentName:"PageHeader",children:function(T){var E=T.back;return n("div",{class:"".concat(l.value,"-back")},[n(nr,{onClick:function(D){r("back",D)},class:"".concat(l.value,"-back-button"),"aria-label":E},{default:function(){return[m]}})])}},null)},C=function(){var m;return e.breadcrumb?n(We,e.breadcrumb,null):(m=o.breadcrumb)===null||m===void 0?void 0:m.call(o)},w=function(){var m,g,T,E,I,D,L,M,te,P=e.avatar,h=(m=e.title)!==null&&m!==void 0?m:(g=o.title)===null||g===void 0?void 0:g.call(o),_=(T=e.subTitle)!==null&&T!==void 0?T:(E=o.subTitle)===null||E===void 0?void 0:E.call(o),R=(I=e.tags)!==null&&I!==void 0?I:(D=o.tags)===null||D===void 0?void 0:D.call(o),K=(L=e.extra)!==null&&L!==void 0?L:(M=o.extra)===null||M===void 0?void 0:M.call(o),N="".concat(l.value,"-heading"),O=h||_||R||K;if(!O)return null;var be=b(),ie=p(be),F=ie||P||O;return n("div",{class:N},[F&&n("div",{class:"".concat(N,"-left")},[ie,P?n(un,P,null):(te=o.avatar)===null||te===void 0?void 0:te.call(o),h&&n("span",{class:"".concat(N,"-title"),title:typeof h=="string"?h:void 0},[h]),_&&n("span",{class:"".concat(N,"-sub-title"),title:typeof _=="string"?_:void 0},[_]),R&&n("span",{class:"".concat(N,"-tags")},[R])]),K&&n("span",{class:"".concat(N,"-extra")},[K])])},x=function(){var m,g,T=(m=e.footer)!==null&&m!==void 0?m:Fa((g=o.footer)===null||g===void 0?void 0:g.call(o));return Ua(T)?null:n("div",{class:"".concat(l.value,"-footer")},[T])},S=function(m){return n("div",{class:"".concat(l.value,"-content")},[m])};return function(){var y,m,g,T=((y=e.breadcrumb)===null||y===void 0?void 0:y.routes)||o.breadcrumb,E=e.footer||o.footer,I=ot((m=o.default)===null||m===void 0?void 0:m.call(o)),D=Ae(l.value,(g={"has-breadcrumb":T,"has-footer":E},k(g,"".concat(l.value,"-ghost"),c.value),k(g,"".concat(l.value,"-rtl"),d.value==="rtl"),k(g,"".concat(l.value,"-compact"),u.value),g));return n(xt,{onResize:v},{default:function(){return[n("div",{class:D},[C(),w(),I.length?S(I):null,x()])]}})}}});const lr=La(or),Pe={getUsersList(t){return ke("/admin/user/list",{method:"GET",params:t})},createUser(t){return ke("/admin/user/create",{method:"POST",data:t})},updateUser(t){return ke("/admin/user/update",{method:"POST",data:t})},deleteUser(t){return ke(`/admin/user/delete/${t}`,{method:"POST"})},deleteUsers(t){return ke("/admin/user/delete/batch",{method:"POST",data:{ids:t}})},userDtl(t){return ke(`/admin/user/detail/${t}`,{method:"GET"})},exportUser(){return ke("/admin/user/export",{method:"GET",responseType:"blob"})},importUser(t){return ke("/admin/user/import",{method:"POST",data:t,timeout:6e5,headers:{"Content-Type":"multipart/form-data"}})},downloadUserTpl(){return ke("/admin/user/tmplate",{method:"GET",responseType:"blob"})}},ir=X({props:{data:Ka()},setup(t){const e=a=>a<=60?`${a}分钟`:`${Math.floor(a/60)}小时 ${a%60}分钟`;return()=>{const{data:a}=t;return n("div",null,[n(He,{gutter:[12,6]},{default:()=>[n(de,{span:12,class:"text-right"},{default:()=>[oe("总学习时长")]}),n(de,{span:12},{default:()=>[a.learnTime>0?e(a.learnTime):"0分钟"]})]})])}}});var ya={exports:{}};(function(t,e){(function(a,r){r()})(tt,function(){function a(u,s){return typeof s>"u"?s={autoBom:!1}:typeof s!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,s,v){var c=new XMLHttpRequest;c.open("GET",u),c.responseType="blob",c.onload=function(){f(c.response,s,v)},c.onerror=function(){console.error("could not download file")},c.send()}function o(u){var s=new XMLHttpRequest;s.open("HEAD",u,!1);try{s.send()}catch{}return 200<=s.status&&299>=s.status}function i(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(s)}}var l=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof tt=="object"&&tt.global===tt?tt:void 0,d=l.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),f=l.saveAs||(typeof window!="object"||window!==l?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(u,s,v){var c=l.URL||l.webkitURL,b=document.createElement("a");s=s||u.name||"download",b.download=s,b.rel="noopener",typeof u=="string"?(b.href=u,b.origin===location.origin?i(b):o(b.href)?r(u,s,v):i(b,b.target="_blank")):(b.href=c.createObjectURL(u),setTimeout(function(){c.revokeObjectURL(b.href)},4e4),setTimeout(function(){i(b)},0))}:"msSaveOrOpenBlob"in navigator?function(u,s,v){if(s=s||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(a(u,v),s);else if(o(u))r(u,s,v);else{var c=document.createElement("a");c.href=u,c.target="_blank",setTimeout(function(){i(c)})}}:function(u,s,v,c){if(c=c||open("","_blank"),c&&(c.document.title=c.document.body.innerText="downloading..."),typeof u=="string")return r(u,s,v);var b=u.type==="application/octet-stream",p=/constructor/i.test(l.HTMLElement)||l.safari,C=/CriOS\/[\d]+/.test(navigator.userAgent);if((C||b&&p||d)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var y=w.result;y=C?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),c?c.location.href=y:location=y,c=null},w.readAsDataURL(u)}else{var x=l.URL||l.webkitURL,S=x.createObjectURL(u);c?c.location=S:location.href=S,c=null,setTimeout(function(){x.revokeObjectURL(S)},4e4)}});l.saveAs=f.saveAs=f,t.exports=f})})(ya);var sa=ya.exports;const sr=Ha("users",{state:()=>({list:[],page:0,size:20,total:0}),getters:{canLoadNext:t=>{const{size:e,page:a,total:r}=t;return a*e<r}},actions:{async listRefresh(){await this.getUsersList(this.$state.page),this.$state.list.length<1&&this.$state.page>1&&this.getUsersList(this.$state.page-1)},async loadNextPage(){await this.getUsersList(this.$state.page+1)},async addOrUpdateUser(t){ce.show("保存中");try{let e={};if(t._id?e=await Pe.updateUser(t):e=await Pe.createUser(t),e.errorNo!=200){xe.error("保存失败");return}xe.success("保存成功"),this.listRefresh()}catch(e){console.log(e)}finally{ce.hidden()}},async deleteUser(t){await nt.confirm({title:"删除确认",content:`删除后数据无法恢复,确认删除${t!=null&&t.loginName?`用户${t==null?void 0:t.loginName}`:"该用户"}?`,type:"danger"})&&(ce.show("删除中"),await Pe.deleteUser(t._id),ce.hidden(),xe.success("删除成功"),this.listRefresh())},async deleteAll(t){await nt.confirm({title:"删除确认",content:"删除后数据无法恢复,确认删除所选用户?",type:"danger"})&&(ce.show("删除中"),await Pe.deleteUsers(t),ce.hidden(),xe.success("删除成功"),this.listRefresh())},async getUsersList(t=1){ce.show("");const e=await Pe.getUsersList({page:t,size:this.$state.size});if(ce.hidden(),e.errorNo!=200)return xe.error(e.errorDesc),!1;this.$state.list=e.result.list,this.$state.page=t,this.$state.total=e.result.total},async userDtl(t){ce.show("");const e=await Pe.userDtl(t._id);if(ce.hidden(),e.errorNo!=200)return xe.error(e.errorDesc),!1;nt.show(n(ir,{data:e.result},null),{title:"用户详情",width:"500px"})},async downloadUser(){const t=await Pe.downloadUserTpl();sa.saveAs(t,"用户模板.xlsx")},async exportUser(){const t=await Pe.exportUser();sa.saveAs(t,"所有用户.xlsx")},async importUser(){var a;const[t]=await Wa.selectFile({accept:".xlsx"});if(((a=t.name.split(".").pop())==null?void 0:a.toLowerCase())!="xlsx")return xe.error("文件格式不支持!"),!1;ce.show("导入中");try{const r=await Pe.importUser({file:t});if(r.errorNo!==200)return xe.error("导入失败"),!1;r.result&&r.result.length>0?xe.error(r.result[0]):xe.success("导入成功"),this.listRefresh()}catch{}finally{ce.hidden()}}}});const ur=X({props:{data:za()},setup(t){var d;const e=nt.use(),a=Tt({formData:{loginName:"",password:"",roles:["student"],...t.data}}),r=Tt({loginName:[{required:!0,message:"登录名不能为空",trigger:"change"}],password:[{required:!((d=t.data)!=null&&d._id),message:"登录密码不能为空",trigger:"change"}],roles:[{required:!0,message:"用户角色不能为空",trigger:"change"}]}),{validate:o,validateInfos:i}=fe.useForm(a.formData,r),l=()=>{o().then(async()=>{e.submit(a.formData)})};return()=>n("div",null,[n("div",{class:cr},[n("div",{class:"form_box"},[n(fe,{labelCol:{span:6},wrapperCol:{span:18}},{default:()=>[n(fe.Item,gt({label:"登录名",name:"loginName"},i.loginName),{default:()=>[n(Vt,{value:a.formData.loginName,"onUpdate:value":f=>a.formData.loginName=f},null)]}),n(fe.Item,gt({label:"登录密码",name:"password"},i.password),{default:()=>[n(Vt.Password,{value:a.formData.password,"onUpdate:value":f=>a.formData.password=f},null)]}),n(fe.Item,gt({label:"用户角色",name:"roles"},i.roles),{default:()=>[n(Ya,{class:"flex w-full login_role",value:a.formData.roles[0],"onUpdate:value":f=>a.formData.roles[0]=f},{default:()=>[n(Yt,{value:"student"},{default:()=>[oe("学员")]}),n(Yt,{value:"admin"},{default:()=>[oe("管理员")]})]})]})]})]),n("div",{class:"footer"},[n(me,{type:"primary",block:!0,onClick:l},{default:()=>[oe("保存")]})])])])}}),cr="m9za2m9";const Cr=X({setup(){const t=sr(),e=Ga();t.getUsersList();const a=Za(),r=Tt({selectedRows:[]}),o=[{title:"账号",dataIndex:"loginName"},{title:"角色",dataIndex:"roles",customRender:({record:l})=>l.roles.includes("admin")?"管理员":"学员"},{title:"操作",customRender:({record:l})=>e.isAdmin?n(it,null,{default:()=>[n(me,{type:"link",onClick:()=>{i(l)}},{default:()=>[oe("编辑")]}),n(me,{type:"link",onClick:()=>{a.showHistory(l._id)}},{default:()=>[oe("考核历史")]}),!l.roles.includes("admin")&&n(me,{danger:!0,type:"link",onClick:()=>{t.deleteUser(l)}},{default:()=>[oe("删除")]})]}):n(it,null,{default:()=>[n(me,{type:"link",onClick:()=>{a.showHistory(l._id)}},{default:()=>[oe("考核历史")]})]})}],i=async l=>{const d=qa.cloneDeep(l),f=await nt.show(n(ur,{data:d},null),{title:l._id?"编辑用户":"添加用户"});t.addOrUpdateUser(f)};return()=>n(Ge,{class:dr},{default:()=>[n(lr,{title:"用户管理"},{extra:()=>{if(e.isAdmin)return n(it,null,{default:()=>[n(me,{type:"primary",onClick:()=>{i({})}},{default:()=>[oe("+ 新增用户")]}),n(me,{onClick:()=>{t.downloadUser()}},{default:()=>[oe("用户模板下载")]}),n(me,{onClick:()=>{t.importUser()}},{default:()=>[oe("导入用户")]}),n(me,{onClick:()=>{t.exportUser()}},{default:()=>[oe("导出用户")]})]})}}),r.selectedRows.length>0&&n("div",{class:"selected_view"},[n("div",null,["已选择",r.selectedRows.length,"项"]),n(it,null,{default:()=>[n(me,{onClick:async()=>{await t.deleteAll(r.selectedRows),r.selectedRows=[]}},{default:()=>[oe("批量删除")]}),n(me,{type:"link",onClick:()=>{r.selectedRows=[]}},{default:()=>[oe("取消选择")]})]})]),n(Ja,{class:"banner_table",bordered:!0,size:"small",rowKey:"_id",rowSelection:{selectedRowKeys:r.selectedRows,onChange:l=>{r.selectedRows=l},getCheckboxProps:l=>({disabled:l.roles.includes("admin")})},pagination:{size:"small",showSizeChanger:!1,hideOnSinglePage:!0,pageSize:t.$state.size,total:t.$state.total,onChange:l=>t.getUsersList(l)},columns:o,dataSource:t.$state.list},null)]})}}),dr="pwd2bxw";export{Cr as default};