import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Dr as t,Ln as n,Ot as r,Vn as i,Wt as a,Xn as o,ht as s,pt as c,xt as l,yr as u,zn as d}from"./jsx-runtime-CRBytmvs.js";import{i as f}from"./tooltip-SaeG1Uv7.js";import{t as p}from"./ExclamationCircleFilled-B0FwC6ZE.js";import{v as m}from"./useModal-uyHD1DJx.js";import{i as h,n as g}from"./button-BILozH6U.js";import{n as _,r as v,t as y}from"./popover-BGq_MyT2.js";var b=e(t()),x=a(`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:t,okButtonProps:a,cancelButtonProps:o,title:l,description:u,cancelText:d,okText:f,okType:_=`primary`,icon:y=b.createElement(p,null),showCancel:x=!0,close:S,onConfirm:C,onCancel:w,onPopupClick:T,classNames:E,styles:D}=e,{getPrefixCls:O}=b.useContext(n),[k]=c(`Popconfirm`,s.Popconfirm),A=v(l),j=v(u);return b.createElement(`div`,{className:`${t}-inner-content`,onClick:T},b.createElement(`div`,{className:`${t}-message`},y&&b.createElement(`span`,{className:i(`${t}-message-icon`,E?.icon),style:D?.icon},y),b.createElement(`div`,{className:`${t}-message-text`},r(A)&&b.createElement(`div`,{className:i(`${t}-title`,E?.title),style:D?.title},A),r(j)&&b.createElement(`div`,{className:i(`${t}-description`,E?.content),style:D?.content},j))),b.createElement(`div`,{className:`${t}-buttons`},x&&b.createElement(g,{onClick:w,size:`small`,...o},d||k?.cancelText),b.createElement(m,{buttonProps:{size:`small`,...h(_),...a},actionFn:C,close:S,prefixCls:O(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},f||k?.okText)))},C=e=>{let{prefixCls:t,placement:r,className:a,style:o,...s}=e,{getPrefixCls:c}=b.useContext(n),l=c(`popconfirm`,t);return x(l),b.createElement(_,{placement:r,className:i(l,a),style:o,content:b.createElement(S,{prefixCls:l,...s})})},w=b.forwardRef((e,t)=>{let{prefixCls:n,placement:r=`top`,trigger:a,okType:s=`primary`,icon:c=b.createElement(p,null),children:m,overlayClassName:h,onOpenChange:g,overlayStyle:_,styles:v,arrow:C,classNames:w,...T}=e,{getPrefixCls:E,className:D,style:O,classNames:k,styles:A,arrow:j,trigger:M}=d(`popconfirm`),[N,P]=u(e.defaultOpen??!1,e.open),F=f(C,j),I=a||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`,n),U={...e,placement:r,trigger:I,okType:s,overlayStyle:_,styles:v,classNames:w},[W,G]=l([k,w],[A,v],{props:U}),K=i(H,D,h,W.root);return x(H),b.createElement(y,{arrow:F,...o(T,[`title`]),trigger:I,placement:r,onOpenChange:V,open:N,ref:t,classNames:{root:K,container:W.container,arrow:W.arrow},styles:{root:{...O,...G.root,..._},container:G.container,arrow:G.arrow},content:b.createElement(S,{okType:s,icon:c,...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};