import{$t as e,B as t,Bt as n,H as r,Hn as i,Jn as a,Ln as o,Or as s,Rn as c,Sn as l,Sr as u,St as d,Tr as f,U as p,V as m,Vn as h,W as g,X as _,Xt as v,Y as y,Yt as b,Zt as x,a as S,an as C,cn as w,dn as T,dt as E,et as D,f as O,hn as k,hr as A,i as j,l as M,n as N,or as ee,pr as P,r as F,sn as I,tn as L,ur as R,wn as te}from"./jsx-runtime-NwRKtVrk.js";import{et as ne}from"./index-B7MUL4ct.js";var z=s(f()),B=(0,z.createContext)(null),re=e=>{let{activeTabOffset:t,horizontal:n,rtl:r,indicator:i={}}=e,{size:a,align:o=`center`}=i,[s,l]=(0,z.useState)(),u=(0,z.useRef)(),d=z.useCallback(e=>typeof a==`function`?a(e):typeof a==`number`?a:e,[a]);function f(){c.cancel(u.current)}return(0,z.useEffect)(()=>{let e={};if(t)if(n){e.width=d(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=d(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 f(),u.current=c(()=>{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})||l(e)}),f},[JSON.stringify(t),n,r,o,d]),{style:s}},V={width:0,height:0,left:0,top:0};function H(e,t,n){return(0,z.useMemo)(()=>{let n=new Map,r=t.get(e[0]?.key)||V,i=r.left+r.width;for(let r=0;re.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,ie=.01,G=20,ae=.995**G;function oe(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)();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)){if(Math.abs(r)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 se(e){let[t,n]=(0,z.useState)(0),r=(0,z.useRef)(0),i=(0,z.useRef)();return i.current=e,P(()=>{i.current?.()},[t]),()=>{r.current===t&&(r.current+=1,n(r.current))}}function ce(e){let t=(0,z.useRef)([]),[,n]=(0,z.useState)({}),r=(0,z.useRef)(typeof e==`function`?e():e),i=se(()=>{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 K={width:0,height:0,left:0,top:0,right:0};function le(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;iMath.floor(d+t)){r=i-1;break}}let i=0;for(let t=n-1;t>=0;--t)if((e.get(o[t].key)||K)[u]r?[0,-1]:[i,r]},[e,t,r,i,a,d,s,o.map(e=>e.key).join(`_`),c])}function ue(e){let t;return e instanceof Map?(t={},e.forEach((e,n)=>{t[n]=e})):t=e,JSON.stringify(t)}var q=`TABS_DQ`;function de(e){return String(e).replace(/"/g,q)}function fe(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}var pe=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||`+`)}),me=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 J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{prefixCls:n,id:r,tabs:i,locale:o,mobile:s,more:c={},style:l,className:d,editable:f,tabBarGutter:p,rtl:m,removeAriaLabel:h,onTabClick:g,getPopupContainer:_,popupClassName:v,popupStyle:y,classNames:b,styles:x}=e,[C,w]=(0,z.useState)(!1),[T,E]=(0,z.useState)(null),{icon:D=`More`}=c,k=`${r}-more-popup`,A=`${n}-dropdown`,j=T===null?null:`${k}-${T}`,N=o?.dropdownAriaLabel;function ee(e,t){e.preventDefault(),e.stopPropagation(),f.onEdit(`remove`,{key:t,event:e})}let P=z.createElement(S,{onClick:({key:e,domEvent:t})=>{g(e,t),w(!1)},prefixCls:`${A}-menu`,id:k,tabIndex:-1,role:`listbox`,"aria-activedescendant":j,selectedKeys:[T],"aria-label":N===void 0?`expanded dropdown`:N},i.map(e=>{let{closable:t,disabled:n,closeIcon:i,key:a,label:o}=e,s=fe(t,i,f,n);return z.createElement(M,{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":h||`remove`,tabIndex:0,className:u(`${A}-menu-item-remove`,b?.remove),style:x?.remove,onClick:e=>{e.stopPropagation(),ee(e,a)}},i||f.removeIcon||`×`))}));function F(e){let t=i.filter(e=>!e.disabled),n=t.findIndex(e=>e.key===T)||0,r=t.length;for(let i=0;i{let e=document.getElementById(j);e?.scrollIntoView&&e.scrollIntoView(!1)},[j,T]),(0,z.useEffect)(()=>{C||E(null)},[C]);let L={marginInlineStart:p};i.length||(L.visibility=`hidden`,L.order=1);let R=u(v,{[`${A}-rtl`]:m}),te=s?null:z.createElement(O,J({prefixCls:A,overlay:P,visible:i.length?C:!1,onVisibleChange:w,overlayClassName:R,overlayStyle:y,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:_},c),z.createElement(`button`,{type:`button`,className:`${n}-nav-more`,style:L,"aria-haspopup":`listbox`,"aria-controls":k,id:`${r}-more`,"aria-expanded":C,onKeyDown:I},D));return z.createElement(`div`,{className:u(`${n}-nav-operations`,d),style:l,ref:t},te,z.createElement(pe,{prefixCls:n,locale:o,editable:f}))}),ge=z.memo(he,(e,t)=>t.tabMoving),_e=e=>{let{prefixCls:t,id:n,active:r,focus:i,tab:{key:a,label:o,disabled:s,closeIcon:c,icon:l},closable:d,renderWrapper:f,removeAriaLabel:p,editable:m,onClick:h,onFocus:g,onBlur:_,onKeyDown:v,onMouseDown:y,onMouseUp:b,styles:x,classNames:S,tabCount:C,currentPosition:w}=e,T=`${t}-tab`,E=fe(d,c,m,s);function D(e){s||h(e)}function O(e){e.preventDefault(),e.stopPropagation(),m.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":de(a),className:u(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:g,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":p||`remove`,tabIndex:r?0:-1,className:u(`${T}-remove`,S?.remove),style:x?.remove,onClick:e=>{e.stopPropagation(),O(e)}},c||m.removeIcon||`×`));return f?f(j):j};function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;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]},be=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]},xe=(e,t)=>e[+!t],Se=z.forwardRef((e,t)=>{let{className:n,style:r,id:i,animated:a,activeKey:o,rtl:s,extra:c,editable:l,locale:d,tabPosition:f,tabBarGutter:p,children:m,onTabClick:h,onTabScroll:g,indicator:_,classNames:v,styles:y}=e,{prefixCls:b,tabs:x}=z.useContext(B),S=(0,z.useRef)(null),C=(0,z.useRef)(null),w=(0,z.useRef)(null),T=(0,z.useRef)(null),D=(0,z.useRef)(null),O=(0,z.useRef)(null),k=(0,z.useRef)(null),j=f===`top`||f===`bottom`,[M,N]=U(0,(e,t)=>{j&&g&&g({direction:e>t?`left`:`right`})}),[P,F]=U(0,(e,t)=>{!j&&g&&g({direction:e>t?`top`:`bottom`})}),[I,L]=(0,z.useState)([0,0]),[R,te]=(0,z.useState)([0,0]),[ne,V]=(0,z.useState)([0,0]),[W,ie]=(0,z.useState)([0,0]),[G,ae]=ce(new Map),K=H(x,G,R[0]),q=xe(I,j),J=xe(R,j),he=xe(ne,j),Se=xe(W,j),Ce=Math.floor(q)Z?Z:e}let Te=(0,z.useRef)(null),[Ee,De]=(0,z.useState)();function Oe(){De(Date.now())}function ke(){Te.current&&clearTimeout(Te.current)}oe(T,(e,t)=>{function n(e,t){e(e=>Q(e+t))}return Ce?(j?n(N,e):n(F,t),ke(),Oe(),!0):!1}),(0,z.useEffect)(()=>(ke(),Ee&&(Te.current=setTimeout(()=>{De(0)},100)),ke),[Ee]);let[Ae,je]=le(K,Y,j?M:P,J,he,Se,{...e,tabs:x}),Me=A((e=o)=>{let t=K.get(e)||{width:0,height:0,left:0,right:0,top:0};if(j){let e=M;s?t.rightM+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(Q(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(Q(e))}}),[Ne,Pe]=(0,z.useState)(),[Fe,Ie]=(0,z.useState)(!1),$=x.filter(e=>!e.disabled).map(e=>e.key),Le=e=>{let t=$.indexOf(Ne||o),n=$.length,r=$[(t+e+n)%n];Pe(r)},Re=(e,t)=>{let n=$.indexOf(e),r=x.find(t=>t.key===e);fe(r?.closable,r?.closeIcon,l,r?.disabled)&&(t.preventDefault(),t.stopPropagation(),l.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);break}},Ve={};j?Ve.marginInlineStart=p:Ve.marginTop=p;let He=x.map((e,t)=>{let{key:n}=e;return z.createElement(_e,{id:i,prefixCls:b,key:n,tab:e,classNames:{item:v?.item,remove:v?.remove},styles:{item:t===0?y?.item:{...Ve,...y?.item},remove:y?.remove},closable:e.closable,editable:l,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(),T.current&&(s||(T.current.scrollLeft=0),T.current.scrollTop=0)},onBlur:()=>{Pe(void 0)},onMouseDown:e=>ze(n,e),onMouseUp:()=>{Ie(!1)}})}),Ue=()=>ae(()=>{let e=new Map,t=D.current?.getBoundingClientRect();return x.forEach(({key:n})=>{let r=D.current?.querySelector(`[data-node-key="${de(n)}"]`);if(r){let[i,a,o,s]=ye(r,t);e.set(n,{width:i,height:a,left:o,top:s})}}),e});(0,z.useEffect)(()=>{Ue()},[x.map(e=>e.key).join(`_`)]);let We=se(()=>{let e=be(S),t=be(C),n=be(w);L([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);let r=be(k);V(r),ie(be(O));let i=be(D);te([i[0]-r[0],i[1]-r[1]]),Ue()}),Ge=x.slice(0,Ae),Ke=x.slice(je+1),qe=[...Ge,...Ke],Je=K.get(o),{style:Ye}=re({activeTabOffset:Je,horizontal:j,indicator:_,rtl:s});(0,z.useEffect)(()=>{Me()},[o,X,Z,ue(Je),ue(K),j]),(0,z.useEffect)(()=>{We()},[s]);let Xe=!!qe.length,Ze=`${b}-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(E,{onResize:We},z.createElement(`div`,{ref:ee(t,S),role:`tablist`,"aria-orientation":j?`horizontal`:`vertical`,className:u(`${b}-nav`,n,v?.header),style:{...y?.header,...r},onKeyDown:()=>{Oe()}},z.createElement(me,{ref:C,position:`left`,extra:c,prefixCls:b}),z.createElement(E,{onResize:We},z.createElement(`div`,{className:u(Ze,{[`${Ze}-ping-left`]:Qe,[`${Ze}-ping-right`]:$e,[`${Ze}-ping-top`]:et,[`${Ze}-ping-bottom`]:tt}),ref:T},z.createElement(E,{onResize:We},z.createElement(`div`,{ref:D,className:`${b}-nav-list`,style:{transform:`translate(${M}px, ${P}px)`,transition:Ee?`none`:void 0}},He,z.createElement(pe,{ref:k,prefixCls:b,locale:d,editable:l,style:{...He.length===0?void 0:Ve,visibility:Xe?`hidden`:null}}),z.createElement(`div`,{className:u(`${b}-ink-bar`,v?.indicator,{[`${b}-ink-bar-animated`]:a.inkBar}),style:{...Ye,...y?.indicator}}))))),z.createElement(ge,ve({},e,{removeAriaLabel:d?.removeAriaLabel,ref:O,prefixCls:b,tabs:qe,className:!Xe&&we,popupStyle:y?.popup,tabMoving:!!Ee})),z.createElement(me,{ref:w,position:`right`,extra:c,prefixCls:b})))}),Ce=({renderTabBar:e,...t})=>e?e(t,Se):z.createElement(Se,t),Y=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:u(n,o&&`${n}-active`,r),ref:t},c)});function we(){return we=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{id:t,activeKey:n,animated:r,tabPosition:i,destroyOnHidden:a,contentStyle:o,contentClassName:s}=e,{prefixCls:c,tabs:d}=z.useContext(B),f=r.tabPane,p=`${c}-tabpane`;return z.createElement(`div`,{className:u(`${c}-content-holder`)},z.createElement(`div`,{className:u(`${c}-content`,`${c}-content-${i}`,{[`${c}-content-animated`]:f})},d.map(e=>{let{key:i,forceRender:c,style:d,className:m,destroyOnHidden:h,...g}=e,_=i===n;return z.createElement(l,we({key:i,visible:_,forceRender:c,removeOnLeave:!!(a??h),leavedClassName:`${p}-hidden`},r.tabPaneMotion),({style:e,className:n},r)=>z.createElement(Y,we({},g,{prefixCls:p,id:t,tabKey:i,animated:f,active:_,style:{...o,...d,...e},className:u(s,m,n),ref:r})))})))};function Z(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{let{id:n,prefixCls:r=`rc-tabs`,className:a,items:o,direction:s,activeKey:c,defaultActiveKey:l,editable:d,animated:f,tabPosition:p=`top`,tabBarGutter:m,tabBarStyle:h,tabBarExtraContent:g,locale:_,more:v,destroyOnHidden:y,renderTabBar:b,onChange:x,onTabClick:S,onTabScroll:C,getPopupContainer:w,popupClassName:T,indicator:E,classNames:D,styles:O,...k}=e,A=z.useMemo(()=>(o||[]).filter(e=>e&&typeof e==`object`&&`key`in e),[o]),j=s===`rtl`,M=Z(f),[N,ee]=(0,z.useState)(!1);(0,z.useEffect)(()=>{ee(i())},[]);let[P,F]=R(l??A[0]?.key,c),[I,L]=(0,z.useState)(()=>A.findIndex(e=>e.key===P));(0,z.useEffect)(()=>{let e=A.findIndex(e=>e.key===P);e===-1&&(e=Math.max(0,Math.min(I,A.length-1)),F(A[e]?.key)),L(e)},[A.map(e=>e.key).join(`_`),P,I]);let[te,ne]=R(null,n);(0,z.useEffect)(()=>{n||(ne(`rc-tabs-${Te}`),Te+=1)},[]);function re(e,t){S?.(e,t);let n=e!==P;F(e),n&&x?.(e)}let V={id:te,activeKey:P,animated:M,tabPosition:p,rtl:j,mobile:N},H={...V,editable:d,locale:_,more:v,tabBarGutter:m,onTabClick:re,onTabScroll:C,extra:g,style:h,getPopupContainer:w,popupClassName:u(T,D?.popup),indicator:E,styles:O,classNames:D},U=z.useMemo(()=>({tabs:A,prefixCls:r}),[A,r]);return z.createElement(B.Provider,{value:U},z.createElement(`div`,Q({ref:t,id:n,className:u(r,`${r}-${p}`,{[`${r}-mobile`]:N,[`${r}-editable`]:d,[`${r}-rtl`]:j},a)},k),z.createElement(Ce,Q({},H,{renderTabBar:b})),z.createElement(X,Q({destroyOnHidden:y},V,{contentStyle:O?.content,contentClassName:D?.content,animated:M}))))}),De={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Oe(e,t={inkBar:!0,tabPane:!1}){let n;return n=t===!1?{inkBar:!1,tabPane:!1}:t===!0?{inkBar:!0,tabPane:!0}:{inkBar:!0,...k(t)?t:{}},n.tabPane&&(n.tabPaneMotion={...De,motionName:_(e,`switch`)}),n}function ke(e){return e.filter(e=>e)}function Ae(e,t){return e?e.map(e=>({...e,destroyOnHidden:e.destroyOnHidden??e.destroyInactiveTabPane})):ke(o(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 je=e=>{let{componentCls:n,motionDurationSlow:r}=e;return[{[n]:{[`${n}-switch`]:{"&-appear, &-enter":{transition:`none`,"&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${r}`}},"&-leave":{position:`absolute`,transition:`none`,inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${r}`}}}}},[t(e,`slide-up`),t(e,`slide-down`)]]},Me=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:`${C(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)`]:v(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:C(i)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${C(e.borderRadiusLG)} ${C(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${C(e.borderRadiusLG)} ${C(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:C(i)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${C(e.borderRadiusLG)} 0 0 ${C(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 ${C(e.borderRadiusLG)} ${C(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},Ne=t=>{let{antCls:n,componentCls:i,itemHoverColor:a,dropdownEdgeChildVerticalPadding:o}=t;return{[`${i}-dropdown`]:{...e(t),position:`absolute`,top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:t.zIndexPopup,display:`block`,"&-hidden":{display:`none`},[`&${n}-slide-down-enter${n}-slide-down-enter-active${i}-dropdown-placement-bottomLeft, &${n}-slide-down-appear${n}-slide-down-appear-active${i}-dropdown-placement-bottomLeft, &${n}-slide-down-enter${n}-slide-down-enter-active${i}-dropdown-placement-bottom, &${n}-slide-down-appear${n}-slide-down-appear-active${i}-dropdown-placement-bottom, &${n}-slide-down-enter${n}-slide-down-enter-active${i}-dropdown-placement-bottomRight, &${n}-slide-down-appear${n}-slide-down-appear-active${i}-dropdown-placement-bottomRight`]:{animationName:p},[`&${n}-slide-up-enter${n}-slide-up-enter-active${i}-dropdown-placement-topLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${i}-dropdown-placement-topLeft, &${n}-slide-up-enter${n}-slide-up-enter-active${i}-dropdown-placement-top, &${n}-slide-up-appear${n}-slide-up-appear-active${i}-dropdown-placement-top, &${n}-slide-up-enter${n}-slide-up-enter-active${i}-dropdown-placement-topRight, &${n}-slide-up-appear${n}-slide-up-appear-active${i}-dropdown-placement-topRight`]:{animationName:m},[`&${n}-slide-down-leave${n}-slide-down-leave-active${i}-dropdown-placement-bottomLeft, &${n}-slide-down-leave${n}-slide-down-leave-active${i}-dropdown-placement-bottom, &${n}-slide-down-leave${n}-slide-down-leave-active${i}-dropdown-placement-bottomRight`]:{animationName:g},[`&${n}-slide-up-leave${n}-slide-up-leave-active${i}-dropdown-placement-topLeft, &${n}-slide-up-leave${n}-slide-up-leave-active${i}-dropdown-placement-top, &${n}-slide-up-leave${n}-slide-up-leave-active${i}-dropdown-placement-topRight`]:{animationName:r},[`${i}-dropdown-menu`]:{maxHeight:t.tabsDropdownHeight,margin:0,padding:`${C(o)} 0`,overflowX:`hidden`,overflowY:`auto`,textAlign:{_skip_check_:!0,value:`left`},listStyleType:`none`,backgroundColor:t.colorBgContainer,backgroundClip:`padding-box`,borderRadius:t.borderRadiusLG,outline:`none`,boxShadow:t.boxShadowSecondary,"&-item":{...L,display:`flex`,alignItems:`center`,minWidth:t.tabsDropdownWidth,margin:0,padding:`${C(t.paddingXXS)} ${C(t.paddingSM)}`,color:t.colorText,fontWeight:`normal`,fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:`pointer`,transition:`all ${t.motionDurationSlow}`,"> span":{flex:1,whiteSpace:`nowrap`},"&-remove":{flex:`none`,marginLeft:{_skip_check_:!0,value:t.marginSM},color:t.colorIcon,fontSize:t.fontSizeSM,background:`transparent`,border:0,cursor:`pointer`,"&:hover":{color:a}},"&:hover":{background:t.controlItemBgHover},"&-disabled":{"&, &:hover":{color:t.colorTextDisabled,background:`transparent`,cursor:`not-allowed`}}}}}}},Pe=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:`${C(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}-content-holder, > div > ${t}-content-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}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:C(c(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${C(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{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}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:c(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${C(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},Fe=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 ${C(e.borderRadius)} ${C(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${C(e.borderRadius)} ${C(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${C(e.borderRadius)} ${C(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${C(e.borderRadius)} 0 0 ${C(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},Ie=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}},"&-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},...x(e)},"&:hover":{color:r},[`&${l}-active ${l}-btn`]:{color:s},[`&${l}-focus ${l}-btn:focus-visible`]:v(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}}}},$=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}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-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`}}}}},Le=t=>{let{componentCls:n,tabsCardPadding:r,cardHeight:i,cardGutter:a,itemHoverColor:o,itemActiveColor:s,colorBorderSecondary:c}=t;return{[n]:{...e(t),display:`flex`,[`> ${n}-nav, > div > ${n}-nav`]:{position:`relative`,display:`flex`,flex:`none`,alignItems:`center`,[`${n}-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 ${t.motionDurationSlow}`,content:`''`,pointerEvents:`none`}},[`${n}-nav-list`]:{position:`relative`,display:`flex`,transition:`opacity ${t.motionDurationSlow}`},[`${n}-nav-operations`]:{display:`flex`,alignSelf:`stretch`},[`${n}-nav-operations-hidden`]:{position:`absolute`,visibility:`hidden`,pointerEvents:`none`},[`${n}-nav-more`]:{position:`relative`,padding:r,background:`transparent`,border:0,color:t.colorText,"&::after":{position:`absolute`,right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:t.calc(t.controlHeightLG).div(8).equal(),transform:`translateY(100%)`,content:`''`}},[`${n}-nav-add`]:{minWidth:i,minHeight:i,marginLeft:{_skip_check_:!0,value:a},background:`transparent`,border:`${C(t.lineWidth)} ${t.lineType} ${c}`,borderRadius:`${C(t.borderRadiusLG)} ${C(t.borderRadiusLG)} 0 0`,outline:`none`,cursor:`pointer`,color:t.colorText,transition:`all ${t.motionDurationSlow} ${t.motionEaseInOut}`,"&:hover":{color:o},"&:active, &:focus:not(:focus-visible)":{color:s},...x(t,-3)}},[`${n}-extra-content`]:{flex:`none`},[`${n}-ink-bar`]:{position:`absolute`,background:t.inkBarColor,pointerEvents:`none`},...Ie(t),[`${n}-content`]:{position:`relative`,width:`100%`},[`${n}-content-holder`]:{flex:`auto`,minWidth:0,minHeight:0},[`${n}-tabpane`]:{...x(t),"&-hidden":{display:`none`}}},[`${n}-centered`]:{[`> ${n}-nav, > div > ${n}-nav`]:{[`${n}-nav-wrap`]:{[`&:not([class*='${n}-nav-wrap-ping']) > ${n}-nav-list`]:{margin:`auto`}}}}}},Re=d(`Tabs`,e=>{let t=n(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${C(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${C(e.horizontalItemGutter)}`});return[Fe(t),$(t),Pe(t),Ne(t),Me(t),Le(t),je(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}}),ze=()=>null,Be=z.forwardRef((e,t)=>{let{type:n,className:r,rootClassName:i,size:a,onEdit:o,hideAdd:s,centered:c,addIcon:l,removeIcon:d,moreIcon:f,more:p,popupClassName:m,children:h,items:g,animated:_,style:v,indicatorSize:b,indicator:x,classNames:S,styles:C,destroyInactiveTabPane:E,destroyOnHidden:O,tabPlacement:k,tabPosition:A,...M}=e,{prefixCls:ee}=M,{getPrefixCls:P,direction:F,getPopupContainer:L,className:R,style:ne,classNames:B,styles:re}=w(`tabs`),{tabs:V}=z.useContext(I),H=P(`tabs`,ee),U=D(H),[W,ie]=Re(H,U),G=z.useRef(null);z.useImperativeHandle(t,()=>({nativeElement:G.current}));let ae;n===`editable-card`&&(ae={onEdit:(e,{key:t,event:n})=>{o?.(e===`add`?n:t,e)},removeIcon:d??V?.removeIcon??z.createElement(te,null),addIcon:(l??V?.addIcon)||z.createElement(N,null),showAdd:s!==!0});let oe=P(),se=y(a),ce=Ae(g,h),K=Oe(H,_),le={align:x?.align??V?.indicator?.align,size:x?.size??b??V?.indicator?.size??V?.indicatorSize},ue=z.useMemo(()=>{let e=k??A??void 0,t=F===`rtl`;switch(e){case`start`:return t?`right`:`left`;case`end`:return t?`left`:`right`;default:return e}},[k,A,F]),q={...e,size:se,tabPlacement:ue,items:ce},[de,fe]=T([B,S],[re,C],{props:q},{popup:{_default:`root`}});return z.createElement(Ee,{ref:G,direction:F,getPopupContainer:L,...M,items:ce,className:u({[`${H}-large`]:se===`large`,[`${H}-small`]:se===`small`,[`${H}-card`]:[`card`,`editable-card`].includes(n),[`${H}-editable-card`]:n===`editable-card`,[`${H}-centered`]:c},R,r,i,de.root,W,ie,U),classNames:{...de,popup:u(m,W,ie,U,de.popup?.root)},styles:fe,style:{...fe.root,...ne,...v},editable:ae,more:{icon:V?.more?.icon??V?.moreIcon??f??z.createElement(j,null),transitionName:`${oe}-slide-up`,...p},prefixCls:H,animated:K,indicator:le,destroyOnHidden:O??E,tabPosition:ue})});Be.TabPane=ze;var Ve=({prefixCls:e,className:t,hoverable:n=!0,...r})=>{let{getPrefixCls:i}=z.useContext(I),a=i(`card`,e),o=u(`${a}-grid`,t,{[`${a}-grid-hoverable`]:n});return z.createElement(`div`,{...r,className:o})},He=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 ${C(i)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${C(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${C(e.borderRadiusLG)} ${C(e.borderRadiusLG)} 0 0`,...b(),"&-wrapper":{width:`100%`,display:`flex`,alignItems:`center`},"&-title":{display:`inline-block`,flex:1,...L,[` > ${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:`${C(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}}},Ue=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:` ${C(i)} 0 0 0 ${n}, 0 ${C(i)} 0 0 ${n}, ${C(i)} ${C(i)} 0 0 ${n}, ${C(i)} 0 0 0 ${n} inset, 0 ${C(i)} 0 0 ${n} inset; `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},We=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:`${C(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${C(e.borderRadiusLG)} ${C(e.borderRadiusLG)}`,...b(),"& > 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:C(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:C(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${C(e.lineWidth)} ${e.lineType} ${a}`}}}},Ge=e=>({margin:`${C(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`,...b(),"&-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,...L},"&-description":{color:e.colorTextDescription}}),Ke=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${C(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${C(e.padding)} ${C(i)}`}}},qe=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},Je=t=>{let{componentCls:n,cardShadow:r,cardHeadPadding:i,colorBorderSecondary:a,boxShadowTertiary:o,bodyPadding:s,extraColor:c,motionDurationMid:l}=t;return{[n]:{...e(t),position:`relative`,background:t.colorBgContainer,borderRadius:t.borderRadiusLG,[`&:not(${n}-bordered)`]:{boxShadow:o},[`${n}-head`]:He(t),[`${n}-extra`]:{marginInlineStart:`auto`,color:c,fontWeight:`normal`,fontSize:t.fontSize},[`${n}-body`]:{padding:s,borderRadius:`0 0 ${C(t.borderRadiusLG)} ${C(t.borderRadiusLG)}`,"&:first-child":{borderStartStartRadius:t.borderRadiusLG,borderStartEndRadius:t.borderRadiusLG},"&:not(:last-child)":{borderEndStartRadius:0,borderEndEndRadius:0}},[`${n}-grid`]:Ue(t),[`${n}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${C(t.borderRadiusLG)} ${C(t.borderRadiusLG)} 0 0`}},[`${n}-actions`]:We(t),[`${n}-meta`]:Ge(t)},[`${n}-bordered`]:{border:`${C(t.lineWidth)} ${t.lineType} ${a}`,[`${n}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${n}-hoverable`]:{cursor:`pointer`,transition:[`box-shadow`,`border-color`].map(e=>`${e} ${l}`).join(`, `),"&:hover":{borderColor:`transparent`,boxShadow:r}},[`${n}-contain-grid`]:{borderRadius:`${C(t.borderRadiusLG)} ${C(t.borderRadiusLG)} 0 0 `,[`&:not(:has(> ${n}-head))`]:{borderRadius:0},[`${n}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${n}-loading) ${n}-body`]:{marginBlockStart:t.calc(t.lineWidth).mul(-1).equal(),marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),padding:0}},[`${n}-contain-tabs`]:{[`> div${n}-head`]:{minHeight:0,[`${n}-head-title, ${n}-extra`]:{paddingTop:i}}},[`${n}-type-inner`]:Ke(t),[`${n}-loading`]:qe(t),[`${n}-rtl`]:{direction:`rtl`}}},Ye=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${C(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`}}}}},Xe=d(`Card`,e=>{let t=n(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[Je(t),Ye(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})),Ze=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))}))},Qe=z.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,style:a,extra:s,headStyle:c={},bodyStyle:l={},title:d,loading:f,bordered:p,variant:m,size:g,type:_,cover:v,actions:b,tabList:x,children:S,activeTabKey:C,defaultActiveTabKey:E,tabBarExtraContent:D,hoverable:O,tabProps:k={},classNames:A,styles:j,...M}=e,{getPrefixCls:N,direction:ee,className:P,style:I,classNames:L,styles:R}=w(`card`),[te]=F(`card`,m,p),B=y(g),re={...e,size:B,variant:te},[V,H]=T([L,A],[R,j],{props:re}),U=t=>{e.onTabChange?.(t)},W=z.useMemo(()=>o(S),[S]),ie=z.useMemo(()=>W.some(e=>z.isValidElement(e)&&e.type===Ve),[W]),G=N(`card`,n),[ae,oe]=Xe(G),se=z.createElement(ne,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),ce=C!==void 0,K={...k,[ce?`activeKey`:`defaultActiveKey`]:ce?C:E,tabBarExtraContent:D},le,ue=B===`small`?B:`large`,q=x?z.createElement(Be,{size:ue,...K,className:`${G}-head-tabs`,onChange:U,items:x.map(({tab:e,...t})=>({label:e,...t}))}):null;if(d||s||q){let e=u(`${G}-head`,V.header),t=u(`${G}-head-title`,V.title),n=u(`${G}-extra`,V.extra),r={...c,...H.header};le=z.createElement(`div`,{className:e,style:r},z.createElement(`div`,{className:`${G}-head-wrapper`},d&&z.createElement(`div`,{className:t,style:H.title},d),s&&z.createElement(`div`,{className:n,style:H.extra},s)),q)}let de=u(`${G}-cover`,V.cover),fe=v?z.createElement(`div`,{className:de,style:H.cover},v):null,pe=u(`${G}-body`,V.body),me={...l,...H.body},J=f||W.length?z.createElement(`div`,{className:pe,style:me},f?se:S):null,he=u(`${G}-actions`,V.actions),ge=b?.length?z.createElement(Ze,{actionClasses:he,actionStyle:H.actions,actions:b}):null,_e=h(M,[`onTabChange`]),ve=u(G,P,{[`${G}-loading`]:f,[`${G}-bordered`]:te!==`borderless`,[`${G}-hoverable`]:O,[`${G}-contain-grid`]:ie,[`${G}-contain-tabs`]:x?.length,[`${G}-small`]:B===`small`,[`${G}-type-${_}`]:!!_,[`${G}-rtl`]:ee===`rtl`},r,i,ae,oe,V.root),ye={...H.root,...I,...a};return z.createElement(`div`,{ref:t,..._e,className:ve,style:ye},le,fe,J,ge)}),$e=e=>{let{prefixCls:t,className:n,avatar:r,title:i,description:a,style:o,classNames:s,styles:c,...l}=e,{getPrefixCls:d,className:f,style:p,classNames:m,styles:h}=w(`cardMeta`),g=`${d(`card`,t)}-meta`,[_,v]=T([m,s],[h,c],{props:e}),y=u(g,n,f,_.root),b={...p,...v.root,...o},x=u(`${g}-avatar`,_.avatar),S=u(`${g}-title`,_.title),C=u(`${g}-description`,_.description),E=u(`${g}-section`,_.section),D=r?z.createElement(`div`,{className:x,style:v.avatar},r):null,O=i?z.createElement(`div`,{className:S,style:v.title},i):null,k=a?z.createElement(`div`,{className:C,style:v.description},a):null,A=O||k?z.createElement(`div`,{className:E,style:v.section},O,k):null;return z.createElement(`div`,{...l,className:y,style:b},D,A)},et=Qe;et.Grid=Ve,et.Meta=$e;export{Be as n,et as t};