import{b as g}from"./chunk-DJRTLRX5.mjs";import{ConfirmDialog as M}from"@baseapp-frontend/design-system/components/web/dialogs";import{useNotification as P}from"@baseapp-frontend/utils";import{LoadingButton as S}from"@mui/lab";import{ConnectionHandler as x}from"react-relay";import{jsx as C}from"react/jsx-runtime";function T(o,t){return U(o)||w(o,t)||j(o,t)||_()}function _(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(o,t){if(o){if(typeof o=="string")return h(o,t);var e={}.toString.call(o).slice(8,-1);return e==="Object"&&o.constructor&&(e=o.constructor.name),e==="Map"||e==="Set"?Array.from(o):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?h(o,t):void 0}}function h(o,t){(t==null||t>o.length)&&(t=o.length);for(var e=0,i=Array(t);e<t;e++)i[e]=o[e];return i}function w(o,t){var e=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(e!=null){var i,l,m,a,u=[],r=!0,n=!1;try{if(m=(e=e.call(o)).next,t===0){if(Object(e)!==e)return;r=!1}else for(;!(r=(i=m.call(e)).done)&&(u.push(i.value),u.length!==t);r=!0);}catch(s){n=!0,l=s}finally{try{if(!r&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(n)throw l}}return u}}function U(o){if(Array.isArray(o))return o}var D=function(t){var e=t.title,i=e===void 0?"Leave group chat?":e,l=t.content,m=l===void 0?"You will stop receiving messages from this conversation and people will see that you left.":l,a=t.onClose,u=t.open,r=t.profileId,n=t.removingParticipantId,s=t.removingParticipantName,d=t.roomId,b=g(),f=T(b,2),I=f[0],v=f[1],A=P(),y=A.sendToast,R=function(){!d||!r||I({variables:{input:{roomId:d,profileId:r,removeParticipants:[n??r]},connections:[x.getConnectionID(d,"ChatRoom_participants")]},onCompleted:function(c){var p;n&&n!==r&&!(c!=null&&(p=c.chatRoomUpdate)!==null&&p!==void 0&&p.errors)&&y("".concat(s," was successfully removed")),a()},onError:function(c){y(c.message,{type:"error"})}})};return C(M,{title:i,content:m,action:C(S,{color:"error",onClick:R,disabled:v,loading:v,children:n===r?"Leave group":"Remove"}),onClose:a,open:u})},B=D;export{B as a};
//# sourceMappingURL=chunk-6NM6GRN3.mjs.map