Liferay.Loader.define("account-admin-web@2.0.54/account_entries_admin/js/AccountOrganizationsManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{portletNamespace:t}=e;return a(a({},function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,["portletNamespace"])),{},{onActionButtonClick:(e,{item:n})=>{const r=null==n?void 0:n.data;"removeOrganizations"===(null==r?void 0:r.action)&&(0,o.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-remove-the-selected-organizations"),onConfirm:e=>{if(e){const e=document.getElementById("".concat(t,"fm"));e&&(0,o.postForm)(e,{data:{accountOrganizationIds:(0,o.getCheckedCheckboxes)(e,"".concat(t,"allRowIds"))},url:null==r?void 0:r.removeOrganizationsURL})}}})},onCreateButtonClick:(e,{item:n})=>{const r=null==n?void 0:n.data;(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(t,"fm"));if(n){const t=e.map((e=>e.value));(0,o.postForm)(n,{data:{accountOrganizationIds:t.join(",")},url:null==r?void 0:r.assignAccountOrganizationsURL})}},title:(0,o.sub)(Liferay.Language.get("assign-organizations-to-x"),null==r?void 0:r.accountEntryName),url:null==r?void 0:r.selectAccountOrganizationsURL})}})};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 a(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){i(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 i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=AccountOrganizationsManagementToolbarPropsTransformer.js.map