Liferay.Loader.define("fragment-web@4.0.73/js/ViewFragmentEntriesManagementToolbarPropsTransformer",["module","exports","require","@liferay/frontend-js-react-web","frontend-js-web","./AddFragmentModal","./openDeleteFragmentModal"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function propsTransformer(e){let{additionalProps:{addFragmentEntryURL:t,copyFragmentEntryURL:n,deleteFragmentCompositionsAndFragmentEntriesURL:i,exportFragmentCompositionsAndFragmentEntriesURL:l,fieldTypes:m,fragmentCollectionId:s,fragmentTypes:d,moveFragmentCompositionsAndFragmentEntriesURL:u,selectFragmentCollectionURL:f},portletNamespace:g}=e,p=function _objectWithoutProperties(e,t){if(null==e)return{};var n,o,r=function _objectWithoutPropertiesLoose(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}(e,["additionalProps","portletNamespace"]);return _objectSpread(_objectSpread({},p),{},{onActionButtonClick(e,{item:t}){var o;const c=null===(o=t.data)||void 0===o?void 0:o.action;"copySelectedFragmentEntries"===c?(()=>{const e=document.getElementById("".concat(g,"fm"));if(!e)return;const t=(0,r.getCheckedCheckboxes)(e,"".concat(g,"allRowIds")),o=document.getElementById("".concat(g,"fragmentCollectionId"));o&&o.setAttribute("value",s);const c=document.getElementById("".concat(g,"fragmentEntryIds"));c&&c.setAttribute("value",t);const a=document.getElementById("".concat(g,"fragmentEntryFm"));a&&submitForm(a,n)})():"deleteFragmentCompositionsAndFragmentEntries"===c?(0,a.default)({multiple:!0,onDelete:()=>{const e=document.getElementById("".concat(g,"fm"));e&&submitForm(e,i)}}):"exportFragmentCompositionsAndFragmentEntries"===c?(()=>{const e=document.getElementById("".concat(g,"fm"));e&&submitForm(e,l)})():"moveFragmentCompositionsAndFragmentEntries"===c&&(()=>{const e=document.getElementById("".concat(g,"fm"));if(!e)return;const t=(0,r.getCheckedCheckboxes)(e,"".concat(g,"allRowIds"),"".concat(g,"rowIdsFragmentComposition")),n=(0,r.getCheckedCheckboxes)(e,"".concat(g,"allRowIds"),"".concat(g,"rowIdsFragmentEntry"));(0,r.openSelectionModal)({id:"".concat(g,"selectFragmentCollection"),onSelect(e){if(e){const o=document.getElementById("".concat(g,"fragmentEntryFm"));if(!o)return;const r=document.getElementById("".concat(g,"fragmentCollectionId"));r&&r.setAttribute("value",e.id);const c=document.getElementById("".concat(g,"fragmentCompositionIds"));c&&c.setAttribute("value",t);const a=document.getElementById("".concat(g,"fragmentEntryIds"));a&&a.setAttribute("value",n),submitForm(o,u)}},selectEventName:"".concat(g,"selectFragmentCollection"),title:Liferay.Language.get("select-fragment-set"),url:f})})()},onCreateButtonClick(){(0,o.render)(c.default,{addFragmentEntryURL:t,fieldTypes:m,fragmentTypes:d,namespace:g},document.createElement("div"))}})};var o=n("@liferay/frontend-js-react-web"),r=n("frontend-js-web"),c=_interopRequireDefault(n("./AddFragmentModal")),a=_interopRequireDefault(n("./openDeleteFragmentModal"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}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}}}));
//# sourceMappingURL=ViewFragmentEntriesManagementToolbarPropsTransformer.js.map