var F=Object.defineProperty;var R=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var i=(o,t,e)=>(R(o,typeof t!="symbol"?t+"":t,e),e);import{i as C,R as p,j as s,l as n}from"./vendor/react-core.DXghOv-E.min.js";import{D as g,av as B,bQ as I,ag as N,ah as A,aa as D,ab as T,ac as m,t as d,ad as M,bB as L}from"../assets/layouts-e9o3BY4c.js";import{f as E,F as O,a as S}from"./FrameBody.D3xcktWQ.min.js";import{f as k,F as v}from"./FrameFooter.BOZVZXNi.min.js";const z=g(()=>({root:C({display:"flex",alignItems:"center",justifyContent:"center",width:B(100)},"label:smartAlignStyles-root"),inner:C({textAlign:"start"},"label:smartAlignStyles-inner")}));class P extends p.Component{render(){const t=this.props.outerTag||"div",e=this.props.outerTag||"div",a=z();return s.jsx(t,{className:n(a.root,this.props.className),children:s.jsx(e,{className:n(a.inner),children:this.props.children})})}}class _ extends p.Component{constructor(){super(...arguments);i(this,"cancelRef",p.createRef());i(this,"id",I("confirmModal"));i(this,"handleCancel",e=>{this.props.onCancel&&this.props.onCancel(e)})}render(){const{onConfirm:e,confirmLinkTo:a,srOnlyTitle:b,isConfirmLoading:r,isConfirmDisabled:h,title:j,children:u,size:f,fullWidthContent:y}=this.props,l=this.handleCancel,x=E(),c=k();return s.jsx(N,{isVisible:this.props.isVisible,size:f||A.SMALL,elementToFocus:this.cancelRef.current,exitHandler:l,titleID:this.titleID,elementToFocusOnExit:this.props.elementToFocusOnExit,children:s.jsx(O,{header:s.jsx(D,{titleID:this.titleID,closeFrame:l,srOnlyTitle:b,title:j}),body:s.jsx(S,{children:y?s.jsx("div",{className:n(x.contents,this.props.bodyClassName),children:u}):s.jsx(P,{className:n(x.contents,this.props.bodyClassName),children:u})}),footer:s.jsxs(v,{justifyRight:!0,children:[s.jsx(T,{className:c.actionButton,buttonType:m.TEXT,buttonRef:this.cancelRef,onClick:l,children:this.props.cancelTitle??d("Cancel")}),!!e&&s.jsx(T,{className:n(c.actionButton,this.props.confirmClasses),onClick:e,buttonType:m.TEXT_PRIMARY,disabled:r||h,children:r?s.jsx(M,{}):this.props.confirmTitle||d("OK")}),!!a&&s.jsx(L,{className:n(c.actionButton,this.props.confirmClasses),to:a,buttonType:m.TEXT_PRIMARY,disabled:r||h,children:this.props.confirmTitle||d("OK")})]})})})}get titleID(){return this.id+"-title"}componentDidMount(){this.forceUpdate()}}export{_ as M,P as S};
