import{R as F,r as s,dd as T,W as G,p as j,i as X,m as U,j as V,t as q,k as p,l as J,aW as K,n as Q}from"./index-c51caa49.js";const Y={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},Z=Y,k=F.createContext({}),z=k;var ee=globalThis&&globalThis.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const te=e=>G(e).map(t=>Object.assign(Object.assign({},t==null?void 0:t.props),{key:t.key}));function ne(e,t,o){const n=s.useMemo(()=>t||te(o),[t,o]);return s.useMemo(()=>n.map(a=>{var{span:r}=a,c=ee(a,["span"]);return Object.assign(Object.assign({},c),{span:typeof r=="number"?r:T(e,r)})}),[n,e])}function B(e,t,o){let n=e,l=!1;return(o===void 0||o>t)&&(n=Object.assign(Object.assign({},e),{span:t}),l=o!==void 0),[n,l]}function le(e,t){const o=[];let n=[],l=t,a=!1;return e.filter(r=>r).forEach((r,c)=>{const y=r==null?void 0:r.span,d=y||1;if(c===e.length-1){const[i,b]=B(r,l,y);a=a||b,n.push(i),o.push(n);return}if(d<l)l-=d,n.push(r);else{const[i,b]=B(r,l,d);a=a||b,n.push(i),o.push(n),l=t,n=[]}}),[o,a]}const oe=(e,t)=>{const[o,n]=s.useMemo(()=>le(t,e),[t,e]);return o},se=oe,re=e=>{let{children:t}=e;return t},ae=re;function L(e){return e!=null}const ie=e=>{const{itemPrefixCls:t,component:o,span:n,className:l,style:a,labelStyle:r,contentStyle:c,bordered:y,label:d,content:i,colon:b,type:f}=e,g=o;return y?s.createElement(g,{className:j({[`${t}-item-label`]:f==="label",[`${t}-item-content`]:f==="content"},l),style:a,colSpan:n},L(d)&&s.createElement("span",{style:r},d),L(i)&&s.createElement("span",{style:c},i)):s.createElement(g,{className:j(`${t}-item`,l),style:a,colSpan:n},s.createElement("div",{className:`${t}-item-container`},(d||d===0)&&s.createElement("span",{className:j(`${t}-item-label`,{[`${t}-item-no-colon`]:!b}),style:r},d),(i||i===0)&&s.createElement("span",{className:j(`${t}-item-content`),style:c},i)))},N=ie;function P(e,t,o){let{colon:n,prefixCls:l,bordered:a}=t,{component:r,type:c,showLabel:y,showContent:d,labelStyle:i,contentStyle:b}=o;return e.map((f,g)=>{let{label:h,children:v,prefixCls:x=l,className:S,style:C,labelStyle:u,contentStyle:m,span:$=1,key:O}=f;return typeof r=="string"?s.createElement(N,{key:`${c}-${O||g}`,className:S,style:C,labelStyle:Object.assign(Object.assign({},i),u),contentStyle:Object.assign(Object.assign({},b),m),span:$,colon:n,component:r,itemPrefixCls:x,bordered:a,label:y?h:null,content:d?v:null,type:c}):[s.createElement(N,{key:`label-${O||g}`,className:S,style:Object.assign(Object.assign(Object.assign({},i),C),u),span:1,colon:n,component:r[0],itemPrefixCls:x,bordered:a,label:h,type:"label"}),s.createElement(N,{key:`content-${O||g}`,className:S,style:Object.assign(Object.assign(Object.assign({},b),C),m),span:$*2-1,component:r[1],itemPrefixCls:x,bordered:a,content:v,type:"content"})]})}const ce=e=>{const t=s.useContext(z),{prefixCls:o,vertical:n,row:l,index:a,bordered:r}=e;return n?s.createElement(s.Fragment,null,s.createElement("tr",{key:`label-${a}`,className:`${o}-row`},P(l,e,Object.assign({component:"th",type:"label",showLabel:!0},t))),s.createElement("tr",{key:`content-${a}`,className:`${o}-row`},P(l,e,Object.assign({component:"td",type:"content",showContent:!0},t)))):s.createElement("tr",{key:a,className:`${o}-row`},P(l,e,Object.assign({component:r?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0},t)))},de=ce,me=e=>{const{componentCls:t,labelBg:o}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBottom:"none"},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.padding)} ${p(e.paddingLG)}`,borderInlineEnd:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:o,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.paddingSM)} ${p(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.paddingXS)} ${p(e.padding)}`}}}}}},pe=e=>{const{componentCls:t,extraColor:o,itemPaddingBottom:n,itemPaddingEnd:l,colonMarginRight:a,colonMarginLeft:r,titleMarginBottom:c}=e;return{[t]:Object.assign(Object.assign(Object.assign({},V(e)),me(e)),{"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:c},[`${t}-title`]:Object.assign(Object.assign({},q),{flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}),[`${t}-extra`]:{marginInlineStart:"auto",color:o,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:n,paddingInlineEnd:l},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.colorTextTertiary,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${p(r)} ${p(a)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}})}},be=e=>({labelBg:e.colorFillAlter,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}),ge=X("Descriptions",e=>{const t=U(e,{});return pe(t)},be);var ue=globalThis&&globalThis.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(o[n[l]]=e[n[l]]);return o};const I=e=>{const{prefixCls:t,title:o,extra:n,column:l,colon:a=!0,bordered:r,layout:c,children:y,className:d,rootClassName:i,style:b,size:f,labelStyle:g,contentStyle:h,items:v}=e,x=ue(e,["prefixCls","title","extra","column","colon","bordered","layout","children","className","rootClassName","style","size","labelStyle","contentStyle","items"]),{getPrefixCls:S,direction:C,descriptions:u}=s.useContext(J),m=S("descriptions",t),$=K(),O=s.useMemo(()=>{var E;return typeof l=="number"?l:(E=T($,Object.assign(Object.assign({},Z),l)))!==null&&E!==void 0?E:3},[$,l]),R=ne($,v,y),w=Q(f),_=se(O,R),[D,W,A]=ge(m),H=s.useMemo(()=>({labelStyle:g,contentStyle:h}),[g,h]);return D(s.createElement(z.Provider,{value:H},s.createElement("div",Object.assign({className:j(m,u==null?void 0:u.className,{[`${m}-${w}`]:w&&w!=="default",[`${m}-bordered`]:!!r,[`${m}-rtl`]:C==="rtl"},d,i,W,A),style:Object.assign(Object.assign({},u==null?void 0:u.style),b)},x),(o||n)&&s.createElement("div",{className:`${m}-header`},o&&s.createElement("div",{className:`${m}-title`},o),n&&s.createElement("div",{className:`${m}-extra`},n)),s.createElement("div",{className:`${m}-view`},s.createElement("table",null,s.createElement("tbody",null,_.map((E,M)=>s.createElement(de,{key:M,index:M,colon:a,prefixCls:m,vertical:c==="vertical",bordered:r,row:E}))))))))};I.Item=ae;const fe=I;export{fe as D};