Files
xin-procurement/public/assets/card-CAlqEh_K.js
T
2026-09-16 23:53:05 +08:00

25 lines
43 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{o as e}from"./request-DWqS4XYU.js";import{$ as t,$n as n,B as r,Bn as i,Ct as a,Er as o,Ft as s,Gn as c,Hn as l,K as u,Ln as d,Pr as f,Q as p,Tr as m,V as h,Wn as g,Xt as _,Yt as v,Zn as y,Zt as b,cr as x,en as S,er as C,jr as w,kr as T,kt as E,l as D,n as O,nn as k,q as A,qt as j,r as M,rr as N,s as P,u as F,wn as I,wt as L,yr as ee,yt as te,z as R}from"./jsx-runtime-Dk2XcqH2.js";import{n as ne,r as re,t as ie}from"./PlusOutlined-B7_Swmw6.js";var z=e(f()),B=(0,z.createContext)(null),V=e=>{let{activeTabOffset:t,horizontal:n,rtl:r,indicator:i={}}=e,{size:a,align:o=`center`}=i,[s,c]=(0,z.useState)(),l=(0,z.useRef)(void 0),u=z.useCallback(e=>typeof a==`function`?a(e):typeof a==`number`?a:e,[a]);function d(){m.cancel(l.current)}return(0,z.useEffect)(()=>{let e={};if(t){if(n){e.width=u(t.width);let n=r?`right`:`left`;o===`start`&&(e[n]=t[n]),o===`center`&&(e[n]=t[n]+t.width/2,e.transform=r?`translateX(50%)`:`translateX(-50%)`),o===`end`&&(e[n]=t[n]+t.width,e.transform=`translateX(-100%)`)}else e.height=u(t.height),o===`start`&&(e.top=t.top),o===`center`&&(e.top=t.top+t.height/2,e.transform=`translateY(-50%)`),o===`end`&&(e.top=t.top+t.height,e.transform=`translateY(-100%)`)}return d(),l.current=m(()=>{s&&e&&Object.keys(e).every(t=>{let n=e[t],r=s[t];return typeof n==`number`&&typeof r==`number`?Math.round(n)===Math.round(r):n===r})||c(e)}),d},[JSON.stringify(t),n,r,o,u]),{style:s}},H={width:0,height:0,left:0,top:0};function ae(e,t,n){return(0,z.useMemo)(()=>{let n=new Map,r=t.get(e[0]?.key)||H,i=r.left+r.width;for(let r=0;r<e.length;r+=1){let{key:a}=e[r],o=t.get(a);o||=t.get(e[r-1]?.key)||H;let s=n.get(a)||{...o};s.right=i-s.left-s.width,n.set(a,s)}return n},[e.map(e=>e.key).join(`_`),t,n])}function U(e,t){let n=z.useRef(e),[,r]=z.useState({});function i(e){let i=typeof e==`function`?e(n.current):e;i!==n.current&&t(i,n.current),n.current=i,r({})}return[n.current,i]}var W=.1,oe=.01,G=20,se=.995**G;function K(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(0),[o,s]=(0,z.useState)(0),[c,l]=(0,z.useState)(),u=(0,z.useRef)(void 0);function d(e){let{screenX:t,screenY:n}=e.touches[0];r({x:t,y:n}),window.clearInterval(u.current)}function f(e){if(!n)return;let{screenX:o,screenY:c}=e.touches[0];r({x:o,y:c});let u=o-n.x,d=c-n.y;t(u,d);let f=Date.now();a(f),s(f-i),l({x:u,y:d})}function p(){if(n&&(r(null),l(null),c)){let e=c.x/o,n=c.y/o;if(Math.max(Math.abs(e),Math.abs(n))<W)return;let r=e,i=n;u.current=window.setInterval(()=>{if(Math.abs(r)<oe&&Math.abs(i)<oe){window.clearInterval(u.current);return}r*=se,i*=se,t(r*G,i*G)},G)}}let m=(0,z.useRef)(void 0);function h(e){let{deltaX:n,deltaY:r}=e,i,a=Math.abs(n),o=Math.abs(r);a===o?i=m.current===`x`?n:r:a>o?(i=n,m.current=`x`):(i=r,m.current=`y`),t(-i,-i)&&e.preventDefault()}let g=(0,z.useRef)(null);g.current={onTouchStart:d,onTouchMove:f,onTouchEnd:p,onWheel:h},z.useEffect(()=>{function t(e){g.current.onTouchStart(e)}function n(e){g.current.onTouchMove(e)}function r(e){g.current.onTouchEnd(e)}function i(e){g.current.onWheel(e)}return document.addEventListener(`touchmove`,n,{passive:!1}),document.addEventListener(`touchend`,r,{passive:!0}),e.current.addEventListener(`touchstart`,t,{passive:!0}),e.current.addEventListener(`wheel`,i,{passive:!1}),()=>{document.removeEventListener(`touchmove`,n),document.removeEventListener(`touchend`,r)}},[])}function ce(e){let[t,n]=(0,z.useState)(0),r=(0,z.useRef)(0),i=(0,z.useRef)(void 0);return i.current=e,T(()=>{i.current?.()},[t]),()=>{r.current===t&&(r.current+=1,n(r.current))}}function le(e){let t=(0,z.useRef)([]),[,n]=(0,z.useState)({}),r=(0,z.useRef)(typeof e==`function`?e():e),i=ce(()=>{let e=r.current;t.current.forEach(t=>{e=t(e)}),t.current=[],r.current=e,n({})});function a(e){t.current.push(e),i()}return[r.current,a]}var q={width:0,height:0,left:0,top:0,right:0};function ue(e,t,n,r,i,a,{tabs:o,tabPosition:s,rtl:c}){let l,u,d;return[`top`,`bottom`].includes(s)?(l=`width`,u=c?`right`:`left`,d=Math.abs(n)):(l=`height`,u=`top`,d=-n),(0,z.useMemo)(()=>{if(!o.length)return[0,0];let n=o.length,r=n;for(let i=0;i<n;i+=1){let n=e.get(o[i].key)||q;if(Math.floor(n[u]+n[l])>Math.floor(d+t)){r=i-1;break}}let i=0;for(let t=n-1;t>=0;--t)if((e.get(o[t].key)||q)[u]<d){i=t+1;break}return i>r?[0,-1]:[i,r]},[e,t,r,i,a,d,s,o.map(e=>e.key).join(`_`),c])}function de(e){let t;return e instanceof Map?(t={},e.forEach((e,n)=>{t[n]=e})):t=e,JSON.stringify(t)}var fe=`TABS_DQ`;function pe(e){return String(e).replace(/"/g,fe)}function J(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}var me=z.forwardRef((e,t)=>{let{prefixCls:n,editable:r,locale:i,style:a}=e;return!r||r.showAdd===!1?null:z.createElement(`button`,{ref:t,type:`button`,className:`${n}-nav-add`,style:a,"aria-label":i?.addAriaLabel||`Add tab`,onClick:e=>{r.onEdit(`add`,{event:e})}},r.addIcon||`+`)}),he=z.forwardRef((e,t)=>{let{position:n,prefixCls:r,extra:i}=e;if(!i)return null;let a,o={};return typeof i==`object`&&!z.isValidElement(i)?o=i:o.right=i,n===`right`&&(a=o.right),n===`left`&&(a=o.left),a?z.createElement(`div`,{className:`${r}-extra-content`,ref:t},a):null});function ge(){return ge=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},ge.apply(this,arguments)}var _e=z.forwardRef((e,t)=>{let{prefixCls:n,id:r,tabs:i,locale:a,mobile:o,more:s={},style:c,className:l,editable:u,tabBarGutter:d,rtl:f,removeAriaLabel:p,onTabClick:m,getPopupContainer:h,popupClassName:_,popupStyle:v,classNames:y,styles:b}=e,[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)(null),{icon:E=`More`,popupRender:O}=s,k=`${r}-more-popup`,A=`${n}-dropdown`,j=w===null?null:`${k}-${w}`,N=a?.dropdownAriaLabel;function F(e,t){e.preventDefault(),e.stopPropagation(),u.onEdit(`remove`,{key:t,event:e})}let I=z.createElement(M,{onClick:({key:e,domEvent:t})=>{m(e,t),C(!1)},prefixCls:`${A}-menu`,id:k,tabIndex:-1,role:`listbox`,"aria-activedescendant":j,selectedKeys:[w],"aria-label":N===void 0?`expanded dropdown`:N},i.map(e=>{let{closable:t,disabled:n,closeIcon:i,key:a,label:o}=e,s=J(t,i,u,n);return z.createElement(P,{key:a,id:`${k}-${a}`,role:`option`,"aria-controls":r&&`${r}-panel-${a}`,disabled:n},z.createElement(`span`,null,o),s&&z.createElement(`button`,{type:`button`,"aria-label":p||`remove`,tabIndex:0,className:g(`${A}-menu-item-remove`,y?.remove),style:b?.remove,onClick:e=>{e.stopPropagation(),F(e,a)}},i||u.removeIcon||`×`))})),L=O?O(I,{restTabs:i,onClose:()=>C(!1)}):I;function ee(e){let t=i.filter(e=>!e.disabled),n=t.findIndex(e=>e.key===w)||0,r=t.length;for(let i=0;i<r;i+=1){n=(n+e+r)%r;let i=t[n];if(!i.disabled){T(i.key);return}}}function te(e){let{which:t}=e;if(!S){[x.DOWN,x.SPACE,x.ENTER].includes(t)&&(C(!0),e.preventDefault());return}switch(t){case x.UP:ee(-1),e.preventDefault();break;case x.DOWN:ee(1),e.preventDefault();break;case x.ESC:C(!1);break;case x.SPACE:case x.ENTER:w!==null&&m(w,e)}}(0,z.useEffect)(()=>{let e=document.getElementById(j);e?.scrollIntoView&&e.scrollIntoView(!1)},[j,w]),(0,z.useEffect)(()=>{S||T(null)},[S]);let R={marginInlineStart:d};i.length||(R.visibility=`hidden`,R.order=1);let ne=g(_,{[`${A}-rtl`]:f}),re=o?null:z.createElement(D,ge({prefixCls:A,overlay:L,visible:i.length?S:!1,onVisibleChange:C,overlayClassName:ne,overlayStyle:v,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:h},s),z.createElement(`button`,{type:`button`,className:`${n}-nav-more`,style:R,"aria-haspopup":`listbox`,"aria-controls":k,id:`${r}-more`,"aria-expanded":S,onKeyDown:te},E));return z.createElement(`div`,{className:g(`${n}-nav-operations`,l),style:c,ref:t},re,z.createElement(me,{prefixCls:n,locale:a,editable:u}))}),ve=z.memo(_e,(e,t)=>t.tabMoving),ye=e=>{let{prefixCls:t,id:n,active:r,focus:i,tab:{key:a,label:o,disabled:s,closeIcon:c,icon:l},closable:u,renderWrapper:d,removeAriaLabel:f,editable:p,onClick:m,onFocus:h,onBlur:_,onKeyDown:v,onMouseDown:y,onMouseUp:b,styles:x,classNames:S,tabCount:C,currentPosition:w}=e,T=`${t}-tab`,E=J(u,c,p,s);function D(e){s||m(e)}function O(e){e.preventDefault(),e.stopPropagation(),p.onEdit(`remove`,{key:a,event:e})}let k=z.useMemo(()=>l&&typeof o==`string`?z.createElement(`span`,null,o):o,[o,l]),A=z.useRef(null);z.useEffect(()=>{i&&A.current&&A.current.focus()},[i]);let j=z.createElement(`div`,{key:a,"data-node-key":pe(a),className:g(T,S?.item,{[`${T}-with-remove`]:E,[`${T}-active`]:r,[`${T}-disabled`]:s,[`${T}-focus`]:i}),style:x?.item,onClick:D},z.createElement(`div`,{ref:A,role:`tab`,"aria-selected":r,id:n&&`${n}-tab-${a}`,className:`${T}-btn`,"aria-controls":n&&`${n}-panel-${a}`,"aria-disabled":s,tabIndex:s?null:r?0:-1,onClick:e=>{e.stopPropagation(),D(e)},onKeyDown:v,onMouseDown:y,onMouseUp:b,onFocus:h,onBlur:_},i&&z.createElement(`div`,{"aria-live":`polite`,style:{width:0,height:0,position:`absolute`,overflow:`hidden`,opacity:0}},`Tab ${w} of ${C}`),l&&z.createElement(`span`,{className:`${T}-icon`},l),o&&k),E&&z.createElement(`button`,{type:`button`,"aria-label":f||`remove`,tabIndex:r?0:-1,className:g(`${T}-remove`,S?.remove),style:x?.remove,onClick:e=>{e.stopPropagation(),O(e)}},c||p.removeIcon||`×`));return d?d(j):j};function be(){return be=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},be.apply(this,arguments)}var xe=(e,t)=>{let{offsetWidth:n,offsetHeight:r,offsetTop:i,offsetLeft:a}=e,{width:o,height:s,left:c,top:l}=e.getBoundingClientRect();return Math.abs(o-n)<1?[o,s,c-t.left,l-t.top]:[n,r,a,i]},Se=e=>{let{offsetWidth:t=0,offsetHeight:n=0}=e.current||{};if(e.current){let{width:n,height:r}=e.current.getBoundingClientRect();if(Math.abs(n-t)<1)return[n,r]}return[t,n]},Ce=(e,t)=>e[+!t],Y=z.forwardRef((e,t)=>{let{className:n,style:r,id:i,animated:a,activeKey:o,rtl:s,extra:l,editable:u,locale:d,tabPosition:f,tabBarGutter:p,children:m,onTabClick:h,onTabScroll:_,indicator:v,classNames:y,styles:b}=e,{prefixCls:x,tabs:S}=z.useContext(B),C=(0,z.useRef)(null),T=(0,z.useRef)(null),E=(0,z.useRef)(null),D=(0,z.useRef)(null),O=(0,z.useRef)(null),k=(0,z.useRef)(null),A=(0,z.useRef)(null),j=f===`top`||f===`bottom`,[M,N]=U(0,(e,t)=>{j&&_&&_({direction:e>t?`left`:`right`})}),[P,F]=U(0,(e,t)=>{!j&&_&&_({direction:e>t?`top`:`bottom`})}),[I,L]=(0,z.useState)([0,0]),[te,R]=(0,z.useState)([0,0]),[ne,re]=(0,z.useState)([0,0]),[ie,H]=(0,z.useState)([0,0]),[W,oe]=le(new Map),G=ae(S,W,te[0]),se=Ce(I,j),q=Ce(te,j),fe=Ce(ne,j),ge=Ce(ie,j),_e=Math.floor(se)<Math.floor(q+fe),Y=_e?se-ge:se-fe,we=`${x}-nav-operations-hidden`,X=0,Z=0;j&&s?(X=0,Z=Math.max(0,q-Y)):(X=Math.min(0,Y-q),Z=0);function Te(e){return e<X?X:e>Z?Z:e}let Ee=(0,z.useRef)(null),[Q,De]=(0,z.useState)();function Oe(){De(Date.now())}function ke(){Ee.current&&clearTimeout(Ee.current)}K(D,(e,t)=>{function n(e,t){e(e=>Te(e+t))}return _e?(j?n(N,e):n(F,t),ke(),Oe(),!0):!1}),(0,z.useEffect)(()=>(ke(),Q&&(Ee.current=setTimeout(()=>{De(0)},100)),ke),[Q]);let[Ae,je]=ue(G,Y,j?M:P,q,fe,ge,{...e,tabs:S}),Me=w((e=o)=>{let t=G.get(e)||{width:0,height:0,left:0,right:0,top:0};if(j){let e=M;s?t.right<M?e=t.right:t.right+t.width>M+Y&&(e=t.right+t.width-Y):t.left<-M?e=-t.left:t.left+t.width>-M+Y&&(e=-(t.left+t.width-Y)),F(0),N(Te(e))}else{let e=P;t.top<-P?e=-t.top:t.top+t.height>-P+Y&&(e=-(t.top+t.height-Y)),N(0),F(Te(e))}}),[Ne,Pe]=(0,z.useState)(),[Fe,Ie]=(0,z.useState)(!1),$=S.filter(e=>!e.disabled).map(e=>e.key),Le=e=>{let t=$.indexOf(Ne||o),n=$.length,r=(t+e+n)%n,i=$[r];Pe(i)},Re=(e,t)=>{let n=$.indexOf(e),r=S.find(t=>t.key===e);J(r?.closable,r?.closeIcon,u,r?.disabled)&&(t.preventDefault(),t.stopPropagation(),u.onEdit(`remove`,{key:e,event:t}),n===$.length-1?Le(-1):Le(1))},ze=(e,t)=>{Ie(!0),t.button===1&&Re(e,t)},Be=e=>{let{code:t}=e,n=s&&j,r=$[0],i=$[$.length-1];switch(t){case`ArrowLeft`:j&&Le(n?1:-1);break;case`ArrowRight`:j&&Le(n?-1:1);break;case`ArrowUp`:e.preventDefault(),j||Le(-1);break;case`ArrowDown`:e.preventDefault(),j||Le(1);break;case`Home`:e.preventDefault(),Pe(r);break;case`End`:e.preventDefault(),Pe(i);break;case`Enter`:case`Space`:e.preventDefault(),h(Ne??o,e);break;case`Backspace`:case`Delete`:Re(Ne,e)}},Ve={};j?Ve.marginInlineStart=p:Ve.marginTop=p;let He=S.map((e,t)=>{let{key:n}=e;return z.createElement(ye,{id:i,prefixCls:x,key:n,tab:e,classNames:{item:y?.item,remove:y?.remove},styles:{item:t===0?b?.item:{...Ve,...b?.item},remove:b?.remove},closable:e.closable,editable:u,active:n===o,focus:n===Ne,renderWrapper:m,removeAriaLabel:d?.removeAriaLabel,tabCount:$.length,currentPosition:t+1,onClick:e=>{h(n,e)},onKeyDown:Be,onFocus:()=>{Fe||Pe(n),Me(n),Oe(),D.current&&(s||(D.current.scrollLeft=0),D.current.scrollTop=0)},onBlur:()=>{Pe(void 0)},onMouseDown:e=>ze(n,e),onMouseUp:()=>{Ie(!1)}})}),Ue=()=>oe(()=>{let e=new Map,t=O.current?.getBoundingClientRect();return S.forEach(({key:n})=>{let r=O.current?.querySelector(`[data-node-key="${pe(n)}"]`);if(r){let[i,a,o,s]=xe(r,t);e.set(n,{width:i,height:a,left:o,top:s})}}),e});(0,z.useEffect)(()=>{Ue()},[S.map(e=>e.key).join(`_`)]);let We=ce(()=>{let e=Se(C),t=Se(T),n=Se(E);L([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);let r=Se(A);re(r);let i=Se(k);H(i);let a=Se(O);R([a[0]-r[0],a[1]-r[1]]),Ue()}),Ge=S.slice(0,Ae),Ke=S.slice(je+1),qe=[...Ge,...Ke],Je=G.get(o),{style:Ye}=V({activeTabOffset:Je,horizontal:j,indicator:v,rtl:s});(0,z.useEffect)(()=>{Me()},[o,X,Z,de(Je),de(G),j]),(0,z.useEffect)(()=>{We()},[s]);let Xe=!!qe.length,Ze=`${x}-nav-wrap`,Qe,$e,et,tt;return j?s?($e=M>0,Qe=M!==Z):(Qe=M<0,$e=M!==X):(et=P<0,tt=P!==X),z.createElement(c,{onResize:We},z.createElement(`div`,{ref:ee(t,C),role:`tablist`,"aria-orientation":j?`horizontal`:`vertical`,className:g(`${x}-nav`,n,y?.header),style:{...b?.header,...r},onKeyDown:()=>{Oe()}},z.createElement(he,{ref:T,position:`left`,extra:l,prefixCls:x}),z.createElement(c,{onResize:We},z.createElement(`div`,{className:g(Ze,{[`${Ze}-ping-left`]:Qe,[`${Ze}-ping-right`]:$e,[`${Ze}-ping-top`]:et,[`${Ze}-ping-bottom`]:tt}),ref:D},z.createElement(c,{onResize:We},z.createElement(`div`,{ref:O,className:`${x}-nav-list`,style:{transform:`translate(${M}px, ${P}px)`,transition:Q?`none`:void 0}},He,z.createElement(me,{ref:A,prefixCls:x,locale:d,editable:u,style:{...He.length===0?void 0:Ve,visibility:Xe?`hidden`:null}}),z.createElement(`div`,{className:g(`${x}-ink-bar`,y?.indicator,{[`${x}-ink-bar-animated`]:a.inkBar}),style:{...Ye,...b?.indicator}}))))),z.createElement(ve,be({},e,{removeAriaLabel:d?.removeAriaLabel,ref:k,prefixCls:x,tabs:qe,className:!Xe&&we,popupStyle:b?.popup,tabMoving:!!Q})),z.createElement(he,{ref:E,position:`right`,extra:l,prefixCls:x})))}),we=({renderTabBar:e,...t})=>e?e(t,Y):z.createElement(Y,t),X=z.forwardRef((e,t)=>{let{prefixCls:n,className:r,style:i,id:a,active:o,tabKey:s,children:c}=e,l=z.Children.count(c)>0;return z.createElement(`div`,{id:a&&`${a}-panel-${s}`,role:`tabpanel`,tabIndex:o&&l?0:-1,"aria-labelledby":a&&`${a}-tab-${s}`,"aria-hidden":!o,style:i,className:g(n,o&&`${n}-active`,r),ref:t},c)});function Z(){return Z=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},Z.apply(this,arguments)}var Te=e=>{let{id:t,activeKey:n,animated:r,tabPosition:i,destroyOnHidden:a,bodyStyle:o,bodyClassName:c,contentStyle:l,contentClassName:u}=e,{prefixCls:d,tabs:f}=z.useContext(B),p=r.tabPane,m=`${d}-body`,h=`${d}-content`;return z.createElement(`div`,{className:g(`${m}-holder`)},z.createElement(`div`,{className:g(m,`${m}-${i}`,{[`${m}-animated`]:p},c),style:o},f.map(e=>{let{key:i,forceRender:o,style:c,className:d,destroyOnHidden:f,...m}=e,_=i===n;return z.createElement(s,Z({key:i,visible:_,forceRender:o,removeOnLeave:!!(a??f),leavedClassName:`${h}-hidden`},r.tabPaneMotion),({style:e,className:n},r)=>z.createElement(X,Z({},m,{prefixCls:h,id:t,tabKey:i,animated:p,active:_,style:{...l,...c,...e},className:g(u,d,n),ref:r})))})))};function Ee(e={inkBar:!0,tabPane:!1}){let t;return t=e===!1?{inkBar:!1,tabPane:!1}:e===!0?{inkBar:!0,tabPane:!1}:{inkBar:!0,...typeof e==`object`?e:{}},t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}function Q(){return Q=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},Q.apply(this,arguments)}var De=0,Oe=z.forwardRef((e,t)=>{let{id:n,prefixCls:r=`rc-tabs`,className:i,items:a,direction:s,activeKey:c,defaultActiveKey:l,editable:u,animated:d,tabPosition:f=`top`,tabBarGutter:p,tabBarStyle:m,tabBarExtraContent:h,locale:_,more:v,destroyOnHidden:y,renderTabBar:b,onChange:x,onTabClick:S,onTabScroll:w,getPopupContainer:T,popupClassName:E,indicator:D,classNames:O,styles:k,...A}=e,j=z.useMemo(()=>(a||[]).filter(e=>e&&typeof e==`object`&&`key`in e),[a]),M=s===`rtl`,N=Ee(d),[P,F]=(0,z.useState)(!1);(0,z.useEffect)(()=>{F(C())},[]);let[I,L]=o(l??j[0]?.key,c),[ee,te]=(0,z.useState)(()=>j.findIndex(e=>e.key===I));(0,z.useEffect)(()=>{let e=j.findIndex(e=>e.key===I);e===-1&&(e=Math.max(0,Math.min(ee,j.length-1)),L(j[e]?.key)),te(e)},[j.map(e=>e.key).join(`_`),I,ee]);let[R,ne]=o(null,n);(0,z.useEffect)(()=>{n||(ne(`rc-tabs-${De}`),De+=1)},[]);function re(e,t){S?.(e,t);let n=e!==I;L(e),n&&x?.(e)}let ie={id:R,activeKey:I,animated:N,tabPosition:f,rtl:M,mobile:P},V={...ie,editable:u,locale:_,more:v,tabBarGutter:p,onTabClick:re,onTabScroll:w,extra:h,style:m,getPopupContainer:T,popupClassName:g(E,O?.popup),indicator:D,styles:k,classNames:O},H=z.useMemo(()=>({tabs:j,prefixCls:r}),[j,r]);return z.createElement(B.Provider,{value:H},z.createElement(`div`,Q({ref:t,id:n,className:g(r,`${r}-${f}`,{[`${r}-mobile`]:P,[`${r}-editable`]:u,[`${r}-rtl`]:M},i)},A),z.createElement(we,Q({},V,{renderTabBar:b})),z.createElement(Te,Q({destroyOnHidden:y},ie,{bodyStyle:k?.body,bodyClassName:O?.body,contentStyle:k?.content,contentClassName:O?.content,animated:N}))))}),ke={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Ae(e,n={inkBar:!0,tabPane:!1}){let r;return r=n===!1?{inkBar:!1,tabPane:!1}:n===!0?{inkBar:!0,tabPane:!0}:{inkBar:!0,...E(n)?n:{}},r.tabPane&&(r.tabPaneMotion={...ke,motionName:t(e,`switch`)}),r}function je(e){return e.filter(e=>e)}function Me(e,t){return e?e.map(e=>({...e,destroyOnHidden:e.destroyOnHidden??e.destroyInactiveTabPane})):je(y(t).map(e=>{if(z.isValidElement(e)){let{key:t,props:n}=e,{tab:r,...i}=n||{};return{key:String(t),...i,label:r}}return null}))}var Ne=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:`none`,"&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:`absolute`,transition:`none`,inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[R(e,`slide-up`),R(e,`slide-down`)]]},Pe=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:i,colorBorderSecondary:a,itemSelectedColor:o}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${d(e.lineWidth)} ${e.lineType} ${a}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:o,background:e.colorBgContainer},[`${t}-tab-focus:has(${t}-tab-btn:focus-visible)`]:_(e,-3),[`& ${t}-tab${t}-tab-focus ${t}-tab-btn:focus-visible`]:{outline:`none`},[`${t}-ink-bar`]:{visibility:`hidden`}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:d(i)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:d(i)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${d(e.borderRadiusLG)} 0 0 ${d(e.borderRadiusLG)}`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},Fe=e=>{let{antCls:t,componentCls:n,itemHoverColor:i,dropdownEdgeChildVerticalPadding:a}=e;return{[`${n}-dropdown`]:{...S(e),position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:`block`,"&-hidden":{display:`none`},[`&${t}-slide-down-enter${t}-slide-down-enter-active${n}-dropdown-placement-bottomLeft,
&${t}-slide-down-appear${t}-slide-down-appear-active${n}-dropdown-placement-bottomLeft,
&${t}-slide-down-enter${t}-slide-down-enter-active${n}-dropdown-placement-bottom,
&${t}-slide-down-appear${t}-slide-down-appear-active${n}-dropdown-placement-bottom,
&${t}-slide-down-enter${t}-slide-down-enter-active${n}-dropdown-placement-bottomRight,
&${t}-slide-down-appear${t}-slide-down-appear-active${n}-dropdown-placement-bottomRight`]:{animationName:u},[`&${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-topLeft,
&${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-topLeft,
&${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-top,
&${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-top,
&${t}-slide-up-enter${t}-slide-up-enter-active${n}-dropdown-placement-topRight,
&${t}-slide-up-appear${t}-slide-up-appear-active${n}-dropdown-placement-topRight`]:{animationName:r},[`&${t}-slide-down-leave${t}-slide-down-leave-active${n}-dropdown-placement-bottomLeft,
&${t}-slide-down-leave${t}-slide-down-leave-active${n}-dropdown-placement-bottom,
&${t}-slide-down-leave${t}-slide-down-leave-active${n}-dropdown-placement-bottomRight`]:{animationName:A},[`&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-topLeft,
&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-top,
&${t}-slide-up-leave${t}-slide-up-leave-active${n}-dropdown-placement-topRight`]:{animationName:h},[`${n}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${d(a)} 0`,overflowX:`hidden`,overflowY:`auto`,textAlign:{_skip_check_:!0,value:`left`},listStyleType:`none`,backgroundColor:e.colorBgContainer,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,"&-item":{...k,display:`flex`,alignItems:`center`,minWidth:e.tabsDropdownWidth,margin:0,padding:`${d(e.paddingXXS)} ${d(e.paddingSM)}`,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:`nowrap`},"&-remove":{flex:`none`,marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorIcon,fontSize:e.fontSizeSM,background:`transparent`,border:0,cursor:`pointer`,"&:hover":{color:i}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:`transparent`,cursor:`not-allowed`}}}}}}},Ie=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:i,verticalItemPadding:a,verticalItemMargin:o,motionDurationSlow:s,calc:c}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:`column`,[`> ${t}-nav, > div > ${t}-nav`]:{margin:i,"&::before":{position:`absolute`,right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${d(e.lineWidth)} ${e.lineType} ${r}`,content:`''`},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:[`width`,`left`,`right`].map(e=>`${e} ${s}`).join(`, `)}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:`column`,minWidth:c(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:a,textAlign:`center`},[`${t}-tab + ${t}-tab`]:{margin:o},[`${t}-nav-wrap`]:{flexDirection:`column`,"&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:[`height`,`top`].map(e=>`${e} ${s}`).join(`, `)}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:`1 0 auto`,flexDirection:`column`}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{marginLeft:{_skip_check_:!0,value:d(c(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${d(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-body > ${t}-content`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-body-holder, > div > ${t}-body-holder`]:{order:0,marginRight:{_skip_check_:!0,value:c(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${d(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-body > ${t}-content`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},$=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,cardHeightSM:i,cardHeightLG:a,horizontalItemPaddingSM:o,horizontalItemPaddingLG:s}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:s,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:i,minHeight:i}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${d(e.borderRadius)} ${d(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${d(e.borderRadius)} ${d(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${d(e.borderRadius)} ${d(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${d(e.borderRadius)} 0 0 ${d(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},Le=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:i,tabsHorizontalItemMargin:a,horizontalItemPadding:o,itemSelectedColor:s,itemColor:c}=e,l=`${t}-tab`;return{[l]:{position:`relative`,WebkitTouchCallout:`none`,WebkitTapHighlightColor:`transparent`,display:`inline-flex`,alignItems:`center`,padding:o,fontSize:e.titleFontSize,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,color:c,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:`none`,transition:`all ${e.motionDurationSlow}`,[`${l}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM},[`${l}-icon > svg`]:{display:`inline-block`,verticalAlign:`middle`,marginBlockEnd:`0.2em`}},"&-remove":{flex:`none`,lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading},...b(e)},"&:hover":{color:r},[`&${l}-active ${l}-btn`]:{color:s},[`&${l}-focus ${l}-btn:focus-visible`]:_(e),[`&${l}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${l}-disabled ${l}-btn, &${l}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${l}-remove ${i}`]:{margin:0,verticalAlign:`middle`},[`${i}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${l} + ${l}`]:{margin:{_skip_check_:!0,value:a}}}},Re=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:i,calc:a}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:e.marginSM}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:e.marginXS},marginLeft:{_skip_check_:!0,value:a(e.marginXXS).mul(-1).equal()},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-body-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-body-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:i},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:`rtl`},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:`right`}}}}},ze=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:i,itemHoverColor:a,itemActiveColor:o,colorBorderSecondary:s}=e;return{[t]:{...S(e),display:`flex`,[`> ${t}-nav, > div > ${t}-nav`]:{position:`relative`,display:`flex`,flex:`none`,alignItems:`center`,[`${t}-nav-wrap`]:{position:`relative`,display:`flex`,flex:`auto`,alignSelf:`stretch`,overflow:`hidden`,whiteSpace:`nowrap`,transform:`translate(0)`,"&::before, &::after":{position:`absolute`,zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:`''`,pointerEvents:`none`}},[`${t}-nav-list`]:{position:`relative`,display:`flex`,transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:`flex`,alignSelf:`stretch`},[`${t}-nav-operations-hidden`]:{position:`absolute`,visibility:`hidden`,pointerEvents:`none`},[`${t}-nav-more`]:{position:`relative`,padding:n,background:`transparent`,border:0,color:e.colorText,"&::after":{position:`absolute`,right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:`translateY(100%)`,content:`''`}},[`${t}-nav-add`]:{minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:i},background:`transparent`,border:`${d(e.lineWidth)} ${e.lineType} ${s}`,borderRadius:`${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0 0`,outline:`none`,cursor:`pointer`,color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:o},...b(e,-3)}},[`${t}-extra-content`]:{flex:`none`},[`${t}-ink-bar`]:{position:`absolute`,background:e.inkBarColor,pointerEvents:`none`},...Le(e),[`${t}-body`]:{position:`relative`,width:`100%`},[`${t}-body-holder`]:{flex:`auto`,minWidth:0,minHeight:0},[`${t}-content`]:{...b(e),"&-hidden":{display:`none`}}},[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping']) > ${t}-nav-list`]:{margin:`auto`}}}}}},Be=j(`Tabs`,e=>{let t=I(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${d(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${d(e.horizontalItemGutter)}`});return[$(t),Re(t),Ie(t),Fe(t),Pe(t),ze(t),Ne(t)]},e=>{let{cardHeight:t,cardHeightSM:n,cardHeightLG:r,controlHeight:i,controlHeightLG:a}=e,o=t||a,s=n||i,c=r||a+8;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:o,cardHeightSM:s,cardHeightLG:c,cardPadding:`${(o-e.fontHeight)/2-e.lineWidth}px ${e.padding}px`,cardPaddingSM:`${(s-e.fontHeight)/2-e.lineWidth}px ${e.paddingXS}px`,cardPaddingLG:`${(c-e.fontHeightLG)/2-e.lineWidth}px ${e.padding}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:``,horizontalItemMarginRTL:``,horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),Ve=()=>null,He=z.forwardRef((e,t)=>{let{type:n,className:r,rootClassName:o,size:s,onEdit:c,hideAdd:u,centered:d,addIcon:f,removeIcon:m,moreIcon:h,more:_,popupClassName:v,children:y,items:b,animated:x,style:S,indicatorSize:C,indicator:w,classNames:T,styles:E,destroyInactiveTabPane:D,destroyOnHidden:k,tabPlacement:A,tabPosition:j,...M}=e,{prefixCls:N}=M,{getPrefixCls:P,direction:F,getPopupContainer:I,className:ee,style:R,classNames:ne,styles:B}=l(`tabs`),{tabs:V}=z.useContext(i),H=P(`tabs`,N),ae=te(H),[U,W]=Be(H,ae),oe=z.useRef(null);z.useImperativeHandle(t,()=>({nativeElement:oe.current}));let G;n===`editable-card`&&(G={onEdit:(e,{key:t,event:n})=>{c?.(e===`add`?n:t,e)},removeIcon:m??V?.removeIcon??z.createElement(re,null),addIcon:(f??V?.addIcon)||z.createElement(ie,null),showAdd:u!==!0});let se=P(),K=p(s),ce=Me(b,y),le=Ae(H,x),q={align:w?.align??V?.indicator?.align,size:w?.size??C??V?.indicator?.size??V?.indicatorSize},ue=z.useMemo(()=>{let e=A??j??void 0,t=F===`rtl`;switch(e){case`start`:return t?`right`:`left`;case`end`:return t?`left`:`right`;default:return e}},[A,j,F]),de={...e,size:K,tabPlacement:ue,items:ce},fe=L(R),pe=L(S),[J,me]=a([ne,T],[B,fe,E,pe],{props:de},{popup:{_default:`root`}});return z.createElement(Oe,{ref:oe,direction:F,getPopupContainer:I,...M,items:ce,className:g({[`${H}-large`]:K===`large`,[`${H}-small`]:K===`small`,[`${H}-card`]:[`card`,`editable-card`].includes(n),[`${H}-editable-card`]:n===`editable-card`,[`${H}-centered`]:d},ee,r,o,J.root,U,W,ae),classNames:{...J,popup:g(v,U,W,ae,J.popup?.root)},styles:{...me,popup:me.popup?.root},style:me.root,editable:G,more:{icon:V?.more?.icon??V?.moreIcon??h??z.createElement(O,null),transitionName:`${se}-slide-up`,..._},prefixCls:H,animated:le,indicator:q,destroyOnHidden:k??D,tabPosition:ue})});He.TabPane=Ve;var Ue=z.forwardRef((e,t)=>{let{prefixCls:n,className:r,hoverable:a=!0,...o}=e,{getPrefixCls:s}=z.useContext(i),c=s(`card`,n),l=g(`${c}-grid`,r,{[`${c}-grid-hoverable`]:a}),u=z.useRef(null);return z.useImperativeHandle(t,()=>({nativeElement:u.current})),z.createElement(`div`,{ref:u,...o,className:l})}),We=e=>{let{antCls:t,componentCls:n,headerHeight:r,headerPadding:i,tabsMarginBottom:a}=e;return{display:`flex`,justifyContent:`center`,flexDirection:`column`,minHeight:r,marginBottom:-1,padding:`0 ${d(i)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${d(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0 0`,...v(),"&-wrapper":{width:`100%`,display:`flex`,alignItems:`center`},"&-title":{display:`inline-block`,flex:1,...k,[`
> ${n}-typography,
> ${n}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}},[`${t}-tabs-top`]:{clear:`both`,marginBottom:a,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,"&-bar":{borderBottom:`${d(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}}},Ge=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:`
${d(i)} 0 0 0 ${n},
0 ${d(i)} 0 0 ${n},
${d(i)} ${d(i)} 0 0 ${n},
${d(i)} 0 0 0 ${n} inset,
0 ${d(i)} 0 0 ${n} inset;
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},Ke=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:i,colorBorderSecondary:a,actionsBg:o}=e;return{margin:0,padding:0,listStyle:`none`,background:o,borderTop:`${d(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)}`,...v(),"& > li":{margin:r,color:e.colorTextDescription,textAlign:`center`,"> span":{position:`relative`,display:`block`,minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,"&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:`inline-block`,width:`100%`,color:e.colorIcon,lineHeight:d(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:d(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${d(e.lineWidth)} ${e.lineType} ${a}`}}}},qe=e=>({margin:`${d(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`,...v(),"&-avatar":{paddingInlineEnd:e.padding},"&-section":{overflow:`hidden`,flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,...k},"&-description":{color:e.colorTextDescription}}),Je=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${d(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${d(e.padding)} ${d(i)}`}}},Ye=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},Xe=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadowTertiary:a,bodyPadding:o,extraColor:s,motionDurationMid:c}=e;return{[t]:{...S(e),position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:We(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:s,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)}`,"&:first-child":{borderStartStartRadius:e.borderRadiusLG,borderStartEndRadius:e.borderRadiusLG},"&:not(:last-child)":{borderEndStartRadius:0,borderEndEndRadius:0}},[`${t}-grid`]:Ge(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:Ke(e),[`${t}-meta`]:qe(e)},[`${t}-bordered`]:{border:`${d(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:`pointer`,transition:[`box-shadow`,`border-color`].map(e=>`${e} ${c}`).join(`, `),"&:hover":{borderColor:`transparent`,boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${d(e.borderRadiusLG)} ${d(e.borderRadiusLG)} 0 0 `,[`&:not(:has(> ${t}-head))`]:{borderRadius:0},[`${t}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:Je(e),[`${t}-loading`]:Ye(e),[`${t}-rtl`]:{direction:`rtl`}}},Ze=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${d(r)}`,fontSize:a,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:`flex`,alignItems:`center`}}}}},Qe=j(`Card`,e=>{let t=I(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[Xe(t),Ze(t)]},e=>({headerBg:`transparent`,headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:e.bodyPadding??e.paddingLG,headerPadding:e.headerPadding??e.paddingLG})),$e=e=>{let{actionClasses:t,actions:n=[],actionStyle:r}=e;return z.createElement(`ul`,{className:t,style:r},n.map((e,t)=>{let r=`action-${t}`;return z.createElement(`li`,{style:{width:`${100/n.length}%`},key:r},z.createElement(`span`,null,e))}))},et=z.forwardRef((e,t)=>{let{prefixCls:r,className:i,rootClassName:o,style:s,extra:c,headStyle:u={},bodyStyle:d={},title:f,loading:m,bordered:h,variant:_,size:v,type:b,cover:x,actions:S,tabList:C,children:w,activeTabKey:T,defaultActiveTabKey:E,tabBarExtraContent:D,hoverable:O,tabProps:k={},classNames:A,styles:j,...M}=e,{getPrefixCls:P,direction:I,className:ee,style:te,classNames:R,styles:re}=l(`card`),[ie]=F(`card`,_,h),B=p(v),V={...e,size:B,variant:ie},H=L(te),ae=L(s),[U,W]=a([R,A],[re,H,j,ae],{props:V}),oe=t=>{e.onTabChange?.(t)},G=z.useMemo(()=>y(w),[w]),se=z.useMemo(()=>G.some(e=>z.isValidElement(e)&&e.type===Ue),[G]),K=P(`card`,r),[ce,le]=Qe(K),q=z.createElement(ne,{loading:!0,active:!0,paragraph:{rows:4},title:!1},w),ue=T!==void 0,de={...k,[ue?`activeKey`:`defaultActiveKey`]:ue?T:E,tabBarExtraContent:D},fe,pe=B===`small`?B:`large`,J=C?z.createElement(He,{size:pe,...de,className:`${K}-head-tabs`,onChange:oe,items:C.map(({tab:e,...t})=>({label:e,...t}))}):null;if(N(f)||N(c)||J){let e=g(`${K}-head`,U.header),t=g(`${K}-head-title`,U.title),n=g(`${K}-extra`,U.extra),r={...u,...W.header};fe=z.createElement(`div`,{className:e,style:r},z.createElement(`div`,{className:`${K}-head-wrapper`},N(f)&&z.createElement(`div`,{className:t,style:W.title},f),N(c)&&z.createElement(`div`,{className:n,style:W.extra},c)),J)}let me=g(`${K}-cover`,U.cover),he=N(x)?z.createElement(`div`,{className:me,style:W.cover},x):null,ge=g(`${K}-body`,U.body),_e={...d,...W.body},ve=m||G.length?z.createElement(`div`,{className:ge,style:_e},m?q:w):null,ye=g(`${K}-actions`,U.actions),be=S?.length?z.createElement($e,{actionClasses:ye,actionStyle:W.actions,actions:S}):null,xe=n(M,[`onTabChange`]),Se=g(K,ee,{[`${K}-loading`]:m,[`${K}-bordered`]:ie!==`borderless`,[`${K}-hoverable`]:O,[`${K}-contain-grid`]:se,[`${K}-contain-tabs`]:C?.length,[`${K}-small`]:B===`small`,[`${K}-type-${b}`]:!!b,[`${K}-rtl`]:I===`rtl`},i,o,ce,le,U.root),Ce={...W.root};return z.createElement(`div`,{ref:t,...xe,className:Se,style:Ce},fe,he,ve,be)}),tt=z.forwardRef((e,t)=>{let{prefixCls:n,className:r,avatar:i,title:o,description:s,style:c,classNames:u,styles:d,...f}=e,{getPrefixCls:p,className:m,style:h,classNames:_,styles:v}=l(`cardMeta`),y=`${p(`card`,n)}-meta`,b=L(h),x=L(c),[S,C]=a([_,u],[v,b,d,x],{props:e}),w=g(y,r,m,S.root),T={...C.root},E=g(`${y}-avatar`,S.avatar),D=g(`${y}-title`,S.title),O=g(`${y}-description`,S.description),k=g(`${y}-section`,S.section),A=N(i)?z.createElement(`div`,{className:E,style:C.avatar},i):null,j=N(o)?z.createElement(`div`,{className:D,style:C.title},o):null,M=N(s)?z.createElement(`div`,{className:O,style:C.description},s):null,P=j||M?z.createElement(`div`,{className:k,style:C.section},j,M):null,F=z.useRef(null);return z.useImperativeHandle(t,()=>({nativeElement:F.current})),z.createElement(`div`,{ref:F,...f,className:w,style:T},A,P)}),nt=et;nt.Grid=Ue,nt.Meta=tt;export{He as n,nt as t};