import{a as ba,y as g,C as ga,cL as v,K as va,M as c,j as a,c0 as xa,b9 as ha,cz as H,cM as ya,cN as ma}from"./index.0d073eaa.js";import"./index.aa6b7013.js";import{R as x,C as p}from"./index.1d29734e.js";import{T as J}from"./index.78efd931.js";var _a=J.TabPane,wa=function(){return{prefixCls:String,title:g.any,extra:g.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:g.any,tabList:{type:Array},tabBarExtraContent:g.any,activeTabKey:String,defaultActiveTabKey:String,cover:g.any,onTabChange:{type:Function}}},Ca=ba({name:"ACard",props:wa(),slots:["title","extra","tabBarExtraContent","actions","cover","customTab"],setup:function(n,X){var r=X.slots,m=ga("card",n),Y=m.prefixCls,Z=m.direction,B=m.size,aa=function(o){var i=o.map(function(l,f){return H(l)&&!ya(l)||!H(l)?a("li",{style:{width:"".concat(100/o.length,"%")},key:"action-".concat(f)},[a("span",null,[l])]):null});return i},ta=function(o){var i;(i=n.onTabChange)===null||i===void 0||i.call(n,o)},na=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i;return o.forEach(function(l){l&&ma(l.type)&&l.type.__ANT_CARD_GRID&&(i=!0)}),i};return function(){var d,o,i,l,f,_,w,C,E=n.headStyle,ea=E===void 0?{}:E,K=n.bodyStyle,k=K===void 0?{}:K,P=n.loading,$=n.bordered,ra=$===void 0?!0:$,j=n.type,u=n.tabList,da=n.hoverable,L=n.activeTabKey,oa=n.defaultActiveTabKey,R=n.tabBarExtraContent,D=R===void 0?v((i=r.tabBarExtraContent)===null||i===void 0?void 0:i.call(r)):R,G=n.title,T=G===void 0?v((l=r.title)===null||l===void 0?void 0:l.call(r)):G,N=n.extra,z=N===void 0?v((f=r.extra)===null||f===void 0?void 0:f.call(r)):N,I=n.actions,S=I===void 0?v((_=r.actions)===null||_===void 0?void 0:_.call(r)):I,O=n.cover,M=O===void 0?v((w=r.cover)===null||w===void 0?void 0:w.call(r)):O,h=va((C=r.default)===null||C===void 0?void 0:C.call(r)),t=Y.value,ia=(d={},c(d,"".concat(t),!0),c(d,"".concat(t,"-loading"),P),c(d,"".concat(t,"-bordered"),ra),c(d,"".concat(t,"-hoverable"),!!da),c(d,"".concat(t,"-contain-grid"),na(h)),c(d,"".concat(t,"-contain-tabs"),u&&u.length),c(d,"".concat(t,"-").concat(B.value),B.value),c(d,"".concat(t,"-type-").concat(j),!!j),c(d,"".concat(t,"-rtl"),Z.value==="rtl"),d),la=k.padding===0||k.padding==="0px"?{padding:"24px"}:void 0,s=a("div",{class:"".concat(t,"-loading-block")},null),ca=a("div",{class:"".concat(t,"-loading-content"),style:la},[a(x,{gutter:8},{default:function(){return[a(p,{span:22},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:8},{default:function(){return[s]}}),a(p,{span:15},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:6},{default:function(){return[s]}}),a(p,{span:18},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:13},{default:function(){return[s]}}),a(p,{span:9},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:4},{default:function(){return[s]}}),a(p,{span:3},{default:function(){return[s]}}),a(p,{span:16},{default:function(){return[s]}})]}})]),V=L!==void 0,sa=(o={size:"large"},c(o,V?"activeKey":"defaultActiveKey",V?L:oa),c(o,"onChange",ta),c(o,"class","".concat(t,"-head-tabs")),o),W,F=u&&u.length?a(J,sa,{default:function(){return[u.map(function(e){var U=e.tab,y=e.slots,q=y==null?void 0:y.tab;xa(!y,"Card","tabList slots is deprecated, Please use `customTab` instead.");var A=U!==void 0?U:r[q]?r[q](e):null;return A=ha(r,"customTab",e,function(){return[A]}),a(_a,{tab:A,key:e.key,disabled:e.disabled},null)})]},rightExtra:D?function(){return D}:null}):null;(T||z||F)&&(W=a("div",{class:"".concat(t,"-head"),style:ea},[a("div",{class:"".concat(t,"-head-wrapper")},[T&&a("div",{class:"".concat(t,"-head-title")},[T]),z&&a("div",{class:"".concat(t,"-extra")},[z])]),F]));var pa=M?a("div",{class:"".concat(t,"-cover")},[M]):null,fa=a("div",{class:"".concat(t,"-body"),style:k},[P?ca:h]),ua=S&&S.length?a("ul",{class:"".concat(t,"-actions")},[aa(S)]):null;return a("div",{class:ia,ref:"cardContainerRef"},[W,pa,h&&h.length?fa:null,ua])}}}),Aa=Ca;export{Aa as C};
