"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[67221,70436],{670436(e,t,n){n.r(t),n.d(t,{default:()=>d});var s=n(274934),i=n(602086),a=n(977872),l=n(762705),o=n(869332),r=n(470070),u=n(267221);const d=({onConfirm:e,name:t,withRemoveGlobalPermissions:n,...d})=>{const c=(0,a.wA)(),[m,A]=(0,i.useState)(!1),C=(0,i.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),A(!m)},[m]),O=(0,i.useCallback)(()=>{e(m),c((0,o.AS)())},[e,m,c]);return(0,s.jsx)(u.default,{message:"COMMON_QUESTION_ARE_YOU_SURE_YOU_WANT_TO_REMOVE",messageValues:{name:t},title:"COMMON_QUESTION_REMOVE",titleValues:{name:t},onConfirm:O,...d,children:n?(0,s.jsx)(l.A,{checked:m,id:"adminRemove",onChange:C,children:(0,s.jsx)(r.sA,{id:"COMMON_ADMIN_REMOVE_GLOBAL_PERMISSIONS"})}):null})}},267221(e,t,n){n.r(t),n.d(t,{default:()=>C});var s=n(274934),i=n(602086),a=n(938984),l=n(247816),o=n(977872),r=n(521376),u=n(869332),d=n(470070),c=n(384783);const m=(0,l.A)("div")`
  line-height: 1.5;
  word-break: break-word;
`,A=(0,l.A)(a.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,C=({message:e,title:t,onConfirm:n,children:l=null,messageValues:C={},size:O="small",titleValues:E={},onCancel:h=null,confirmButtonProps:k={},confirmButtonText:_,...f})=>{const N=(0,o.wA)(),p=(0,i.useCallback)(()=>{h?h():N((0,u.AS)())},[h,N]);return(0,i.useEffect)(()=>{function e(e){e.stopPropagation(),e.key===r.U.ENTER?n():e.key===r.U.ESCAPE&&p()}return window.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0)}},[p,n]),(0,s.jsxs)(c.A,{actions:[{text:(0,s.jsx)(d.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:p},{text:(0,s.jsx)(d.sA,{id:_??"COMMON_ACTION_CONFIRM"}),type:"button",variant:"primary",onClick:()=>n(),...k}],size:O,title:(0,s.jsx)(A,{size:"large",isTruncated:!0,children:(0,s.jsx)(d.sA,{id:t,values:E})}),...f,children:[(0,s.jsx)(m,{children:(0,s.jsx)(a.A,{size:"medium",children:(0,s.jsx)(d.sA,{id:e,values:C})})}),l]})}}}]);