"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9221],{64163:function(e,n,s){var t=s(1413),r=s(72791),i=s(61889),o=s(11135),l=s(25787),a=s(23814),c=s(80184);n.Z=(0,l.Z)((function(e){return(0,o.Z)((0,t.Z)({},a.xx))}))((function(e){var n=e.classes,s=e.label,t=void 0===s?"":s,o=e.content,l=e.multiLine,a=void 0!==l&&l,d=e.actionButton;return(0,c.jsx)(r.Fragment,{children:(0,c.jsxs)(i.ZP,{className:n.prefinedContainer,children:[""!==t&&(0,c.jsx)(i.ZP,{item:!0,xs:12,className:n.predefinedTitle,children:t}),(0,c.jsxs)(i.ZP,{item:!0,xs:12,className:"".concat(n.predefinedList," ").concat(d?n.includesActionButton:""),children:[(0,c.jsx)(i.ZP,{item:!0,xs:12,className:a?n.innerContentMultiline:n.innerContent,children:o}),d&&(0,c.jsx)("div",{className:n.overlayShareOption,children:d})]})]})})}))},49221:function(e,n,s){s.r(n);var t=s(29439),r=s(1413),i=s(72791),o=s(11135),l=s(25787),a=s(36151),c=s(40986),d=s(61889),u=s(23814),x=s(81207),m=s(83658),Z=s(56028),h=s(64163),j=s(38734),f=s(87995),p=s(25469),b=s(80184);n.default=(0,l.Z)((function(e){return(0,o.Z)((0,r.Z)((0,r.Z)({},u.ID),u.DF))}))((function(e){var n=e.open,s=e.checkedUsers,r=e.closeModalAndRefresh,o=e.classes,l=(0,p.TL)(),u=(0,i.useState)(!1),v=(0,t.Z)(u,2),P=v[0],g=v[1],C=(0,i.useState)(!1),N=(0,t.Z)(C,2),S=N[0],k=N[1],w=(0,i.useState)([]),F=(0,t.Z)(w,2),y=F[0],U=F[1];(0,i.useEffect)((function(){P&&(y.length>0?x.Z.invoke("PUT","/api/v1/users-groups-bulk",{groups:y,users:s}).then((function(){g(!1),k(!0)})).catch((function(e){g(!1),l((0,f.zb)(e))})):(g(!1),l((0,f.zb)({errorMessage:"You need to select at least one group to assign",detailedError:""}))))}),[P,g,r,y,s,l]);return(0,b.jsx)(Z.Z,{modalOpen:n,onClose:function(){r(S)},title:S?"The selected users were added to the following groups.":"Add Users to Group",titleIcon:(0,b.jsx)(j.ZmA,{}),children:S?(0,b.jsxs)(i.Fragment,{children:[(0,b.jsxs)(d.ZP,{container:!0,children:[(0,b.jsx)(h.Z,{label:"Groups",content:y.join(", ")}),(0,b.jsx)(h.Z,{label:"Users",content:s.join(", ")})]}),(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),(0,b.jsx)("br",{})]}):(0,b.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),g(!0)},children:(0,b.jsxs)(d.ZP,{container:!0,children:[(0,b.jsxs)(d.ZP,{item:!0,xs:12,className:o.modalFormScrollable,children:[(0,b.jsx)(d.ZP,{item:!0,xs:12,className:o.formFieldRow,children:(0,b.jsx)(h.Z,{label:"Selected Users",content:s.join(", ")})}),(0,b.jsx)(d.ZP,{item:!0,xs:12,className:o.formFieldRow,children:(0,b.jsx)(m.Z,{selectedGroups:y,setSelectedGroups:U})})]}),(0,b.jsxs)(d.ZP,{item:!0,xs:12,className:o.modalButtonBar,children:[(0,b.jsx)(a.Z,{type:"button",variant:"outlined",color:"primary",onClick:function(){U([])},children:"Clear"}),(0,b.jsx)(a.Z,{type:"submit",variant:"contained",color:"primary",disabled:P||y.length<1,children:"Save"})]}),P&&(0,b.jsx)(d.ZP,{item:!0,xs:12,children:(0,b.jsx)(c.Z,{})})]})})})}))}}]);
//# sourceMappingURL=9221.696bb93f.chunk.js.map