Liferay.Loader.define("account-admin-web@2.0.54/account_users_admin/js/AccountUsersAdminManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let{portletNamespace:n}=t,r=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},c=Object.keys(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)n=c[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(t,["portletNamespace"]);return c(c({},r),{},{onActionButtonClick:(t,{item:r})=>{const c=null==r?void 0:r.data,a=null==c?void 0:c.action;var l;"activateAccountUsers"===a?e(n,null==(l=c)?void 0:l.activateAccountUsersURL):"deactivateAccountUsers"===a?(t=>{(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-deactivate-the-selected-users"),onConfirm:o=>{o&&e(n,null==t?void 0:t.deactivateAccountUsersURL)}})})(c):"deleteAccountUsers"===a&&(t=>{(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-delete-the-selected-users"),onConfirm:o=>{o&&e(n,null==t?void 0:t.deleteAccountUsersURL)}})})(c)},onCreateButtonClick:(e,{item:t})=>{const r=null==t?void 0:t.data;(0,o.openSelectionModal)({id:"".concat(n,"addAccountUser"),onSelect:e=>{const t=(0,o.createPortletURL)(null==r?void 0:r.addAccountUserURL,{accountEntryId:e.accountentryid});(0,o.navigate)(t)},selectEventName:"".concat(n,"selectAccountEntry"),title:null==r?void 0:r.dialogTitle,url:null==r?void 0:r.accountEntrySelectorURL})},onFilterDropdownItemClick(e,{item:t}){var n,r;"selectAccountEntries"===(null==t||null===(n=t.data)||void 0===n?void 0:n.action)&&(r=null==t?void 0:t.data,(0,o.openSelectionModal)({buttonAddLabel:Liferay.Language.get("select"),containerProps:{className:""},iframeBodyCssClass:"",multiple:!0,onSelect:e=>{if(!(null==e?void 0:e.length))return;const t=e.map((e=>e.value)),n=(0,o.createPortletURL)(null==r?void 0:r.redirectURL,{accountEntriesNavigation:"selected-accounts",accountEntryIds:t.join(",")});(0,o.navigate)(n)},title:null==r?void 0:r.dialogTitle,url:null==r?void 0:r.accountEntriesSelectorURL}))}})};var o=n("frontend-js-web");function r(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e=(e,t)=>{const n=document.getElementById("".concat(e,"fm"));n&&(0,o.postForm)(n,{data:{accountUserIds:(0,o.getCheckedCheckboxes)(n,"".concat(e,"allRowIds"))},url:t})}}}));
//# sourceMappingURL=AccountUsersAdminManagementToolbarPropsTransformer.js.map