import{o as e}from"./chunk-jRWAZmH_.js";import{n as t}from"./jsx-runtime-CEixWuwE.js";import{L as n,Ot as r,Wn as i,Y as a,an as o,cn as s,cr as c,ft as l,pt as u,sr as d}from"./axios-v6FV69Ne.js";import{n as f,t as p}from"./slicedToArray-YLaz90ka.js";import{c as m,n as h,s as g,t as _}from"./button-C7b7AmGo.js";import{n as v,t as y}from"./popover-2l-e2rjz.js";import{tt as b}from"./index-BqyXv5bE.js";var x=e(i());f(),l(),m(),c();var S=e(t()),C=function(e){var t=e.prefixCls,n=e.okButtonProps,r=e.cancelButtonProps,i=e.title,c=e.cancelText,l=e.okText,u=e.okType,f=e.icon,p=e.showCancel,m=p===void 0?!0:p,g=e.close,y=e.onConfirm,x=e.onCancel,C=S.useContext(a).getPrefixCls;return S.createElement(o,{componentName:`Popconfirm`,defaultLocale:s.Popconfirm},function(e){return S.createElement(`div`,{className:`${t}-inner-content`},S.createElement(`div`,{className:`${t}-message`},f&&S.createElement(`span`,{className:`${t}-message-icon`},f),S.createElement(`div`,{className:`${t}-message-title`},v(i))),S.createElement(`div`,{className:`${t}-buttons`},m&&S.createElement(_,d({onClick:x,size:`small`},r),c??e.cancelText),S.createElement(b,{buttonProps:d(d({size:`small`},h(u)),n),actionFn:y,close:g,prefixCls:C(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},l??e.okText)))})};c();var w=void 0,T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},E=S.forwardRef(function(e,t){var i=e.prefixCls,o=e.placement,s=o===void 0?`top`:o,c=e.trigger,l=c===void 0?`click`:c,f=e.okType,m=f===void 0?`primary`:f,h=e.icon,_=h===void 0?S.createElement(r,null):h,v=e.children,b=e.overlayClassName,E=e.onOpenChange,D=e.onVisibleChange,O=T(e,[`prefixCls`,`placement`,`trigger`,`okType`,`icon`,`children`,`overlayClassName`,`onOpenChange`,`onVisibleChange`]),k=S.useContext(a).getPrefixCls,A=p(u(!1,{value:e.open===void 0?e.visible:e.open,defaultValue:e.defaultOpen===void 0?e.defaultVisible:e.defaultOpen}),2),j=A[0],M=A[1],N=function(e,t){M(e,!0),D?.(e,t),E?.(e,t)},P=function(e){N(!1,e)},F=function(t){return e.onConfirm?.call(w,t)},I=function(t){var n;N(!1,t),(n=e.onCancel)==null||n.call(w,t)},L=function(e){e.keyCode===g.ESC&&j&&N(!1,e)},R=function(t){var n=e.disabled;n!==void 0&&n||N(t)},z=k(`popover`,i),B=(0,x.default)(k(`popconfirm`,i),b);return S.createElement(y,d({},O,{trigger:l,prefixCls:z,placement:s,onOpenChange:R,open:j,ref:t,overlayClassName:B,_overlay:S.createElement(C,d({okType:m,icon:_},e,{prefixCls:z,close:P,onConfirm:F,onCancel:I}))}),n(v,{onKeyDown:function(e){var t,n;S.isValidElement(v)&&((n=v==null?void 0:(t=v.props).onKeyDown)==null||n.call(t,e)),L(e)}}))});export{E as t};