Liferay.Loader.define("account-admin-web@2.0.98/account_entries_admin/js/AccountUsersManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{additionalProps:{accountEntryName:t},portletNamespace:n}=e;return _objectSpread(_objectSpread({},function _objectWithoutProperties(e,t){if(null==e)return{};var n,o,r=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,o,r={},s=Object.keys(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["additionalProps","portletNamespace"])),{},{onActionButtonClick:(e,{item:t})=>{const r=null==t?void 0:t.data;"removeUsers"===(null==r?void 0:r.action)&&(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-remove-the-selected-users"),onConfirm:e=>{if(e){const e=document.getElementById("".concat(n,"fm"));e&&(0,o.postForm)(e,{data:{accountUserIds:(0,o.getCheckedCheckboxes)(e,"".concat(n,"allRowIds"))},url:null==r?void 0:r.removeUsersURL})}}})},onCreateButtonClick:(e,{item:o})=>{const r=o.data;"selectAccountUsers"===(null==r?void 0:r.action)&&openSelectAccountUsersModal(t,null==r?void 0:r.assignAccountUsersURL,null==r?void 0:r.selectAccountUsersURL,n)},onCreationMenuItemClick:(e,{item:r})=>{const s=null==r?void 0:r.data,c=null==s?void 0:s.action;"inviteAccountUsers"===c?(0,o.openModal)({buttons:[{displayType:"secondary",label:Liferay.Language.get("cancel"),type:"cancel"},{formId:"".concat(n,"inviteUserForm"),label:Liferay.Language.get("invite"),type:"submit"}],containerProps:{className:"modal-height-xl"},id:"".concat(n,"inviteUsersDialog"),iframeBodyCssClass:"",size:"lg",title:(0,o.sub)(Liferay.Language.get("invite-users-to-x"),t),url:null==s?void 0:s.requestInvitationsURL}):"selectAccountUsers"===c&&openSelectAccountUsersModal(t,null==s?void 0:s.assignAccountUsersURL,null==s?void 0:s.selectAccountUsersURL,n)}})};var o=n("frontend-js-web");function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function openSelectAccountUsersModal(e,t,n,r){(0,o.openSelectionModal)({buttonAddLabel:Liferay.Language.get("assign"),containerProps:{className:""},iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const n=document.getElementById("".concat(r,"fm"));if(n){const r=e.map((e=>e.value));(0,o.postForm)(n,{data:{accountUserIds:r.join(",")},url:t})}},title:(0,o.sub)(Liferay.Language.get("assign-users-to-x"),e),url:n})}}}));
//# sourceMappingURL=AccountUsersManagementToolbarPropsTransformer.js.map