import{Or as e,Sr as t,St as n,Tr as r,Vn as i,_n as a,cn as o,dn as s,ht as c,pt as l,sn as u,ur as d}from"./jsx-runtime-NwRKtVrk.js";import{t as f}from"./ExclamationCircleFilled-gmOeErIU.js";import{o as p}from"./statusUtils-G17j4Ng-.js";import{i as m,n as h}from"./button-CM-rzMOH.js";import{Q as g,X as _,Z as v,tt as y}from"./index-B7MUL4ct.js";var b=e(r()),x=n(`Popconfirm`,e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:a,colorWarning:o,marginXXS:s,marginXS:c,fontSize:l,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:l},[`${t}-message`]:{marginBottom:c,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon`]:{color:o},[`> ${t}-message-icon ${n}`]:{fontSize:l,lineHeight:1,marginInlineEnd:c},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:`normal`}},[`${t}-description`]:{marginTop:s,color:a}},[`${t}-buttons`]:{textAlign:`end`,whiteSpace:`nowrap`,button:{marginInlineStart:c}}}}},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),S=e=>{let{prefixCls:n,okButtonProps:r,cancelButtonProps:i,title:o,description:s,cancelText:d,okText:p,okType:_=`primary`,icon:v=b.createElement(f,null),showCancel:x=!0,close:S,onConfirm:C,onCancel:w,onPopupClick:T,classNames:E,styles:D}=e,{getPrefixCls:O}=b.useContext(u),[k]=l(`Popconfirm`,c.Popconfirm),A=g(o),j=g(s);return b.createElement(`div`,{className:`${n}-inner-content`,onClick:T},b.createElement(`div`,{className:`${n}-message`},v&&b.createElement(`span`,{className:t(`${n}-message-icon`,E?.icon),style:D?.icon},v),b.createElement(`div`,{className:`${n}-message-text`},a(A)&&b.createElement(`div`,{className:t(`${n}-title`,E?.title),style:D?.title},A),a(j)&&b.createElement(`div`,{className:t(`${n}-description`,E?.content),style:D?.content},j))),b.createElement(`div`,{className:`${n}-buttons`},x&&b.createElement(h,{onClick:w,size:`small`,...i},d||k?.cancelText),b.createElement(y,{buttonProps:{size:`small`,...m(_),...r},actionFn:C,close:S,prefixCls:O(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},p||k?.okText)))},C=e=>{let{prefixCls:n,placement:r,className:i,style:a,...o}=e,{getPrefixCls:s}=b.useContext(u),c=s(`popconfirm`,n);return x(c),b.createElement(v,{placement:r,className:t(c,i),style:a,content:b.createElement(S,{prefixCls:c,...o})})},w=b.forwardRef((e,n)=>{let{prefixCls:r,placement:a=`top`,trigger:c,okType:l=`primary`,icon:u=b.createElement(f,null),children:m,overlayClassName:h,onOpenChange:g,overlayStyle:v,styles:y,arrow:C,classNames:w,...T}=e,{getPrefixCls:E,className:D,style:O,classNames:k,styles:A,arrow:j,trigger:M}=o(`popconfirm`),[N,P]=d(e.defaultOpen??!1,e.open),F=p(C,j),I=c||M||`click`,L=e=>{P(e),g?.(e)},R=()=>{L(!1)},z=t=>e.onConfirm?.call(void 0,t),B=t=>{L(!1),e.onCancel?.call(void 0,t)},V=t=>{let{disabled:n=!1}=e;n||L(t)},H=E(`popconfirm`,r),U={...e,placement:a,trigger:I,okType:l,overlayStyle:v,styles:y,classNames:w},[W,G]=s([k,w],[A,y],{props:U}),K=t(H,D,h,W.root);return x(H),b.createElement(_,{arrow:F,...i(T,[`title`]),trigger:I,placement:a,onOpenChange:V,open:N,ref:n,classNames:{root:K,container:W.container,arrow:W.arrow},styles:{root:{...O,...G.root,...v},container:G.container,arrow:G.arrow},content:b.createElement(S,{okType:l,icon:u,...e,prefixCls:H,close:R,onConfirm:z,onCancel:B,classNames:W,styles:G}),"data-popover-inject":!0},m)});w._InternalPanelDoNotUseOrYouWillBeFired=C;export{w as t};