Liferay.Loader.define("journal-web@5.0.81/js/ManagementToolbarPropsTransformer",["module","exports","require","frontend-js-web","./modals/openDeleteArticleModal"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{additionalProps:{addArticleURL:t,exportTranslationURL:r,moveArticlesAndFoldersURL:n,openViewMoreStructuresURL:c,selectEntityURL:i,trashEnabled:u,viewDDMStructureArticlesURL:d},portletNamespace:s}=e,f=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["additionalProps","portletNamespace"]);return l(l({},f),{},{onActionButtonClick(e,{item:t}){var c;const l=null==t||null===(c=t.data)||void 0===c?void 0:c.action;"deleteEntries"===l?u?Liferay.fire("".concat(s,"editEntry"),{action:"/journal/move_articles_and_folders_to_trash"}):(0,a.default)({onDelete:()=>{Liferay.fire("".concat(s,"editEntry"),{action:"/journal/delete_articles_and_folders"})}}):"expireEntries"===l?Liferay.fire("".concat(s,"editEntry"),{action:"/journal/expire_articles_and_folders"}):"exportTranslation"===l?(()=>{const e=new URL(r),t=new URLSearchParams(e.search),n="_".concat(t.get("p_p_id"),"_key"),a=Liferay.SearchContainer.get("".concat(s,"articles")).select.getAllSelectedElements().get("value");for(const t of a)e.searchParams.append(n,t);(0,o.navigate)(e.toString())})():"moveEntries"===l&&(()=>{let e=document.querySelectorAll(".entry-selector");0===e.length&&(e=document.querySelectorAll('.card-page-item input[type="checkbox"]')),e.forEach((e=>{e.checked&&(n=(0,o.addParams)("".concat(e.name,"=").concat(e.value),n))})),(0,o.navigate)(n)})()},onFilterDropdownItemClick(e,{item:t}){var r;"openDDMStructuresSelector"===(null==t||null===(r=t.data)||void 0===r?void 0:r.action)&&(0,o.openSelectionModal)({onSelect:e=>{(0,o.navigate)((0,o.addParams)({["".concat(s,"ddmStructureKey")]:e.ddmstructurekey},d))},selectEventName:"".concat(s,"selectDDMStructure"),title:Liferay.Language.get("structures"),url:i})},onShowMoreButtonClick(){let e=!0;(0,o.openSelectionModal)({onClose:()=>{e&&(0,o.navigate)(location.href)},onSelect:r=>{r&&(e=!1,(0,o.navigate)((0,o.addParams)({["".concat(s,"ddmStructureKey")]:r.ddmstructurekey},t)))},selectEventName:"".concat(s,"selectAddMenuItem"),title:Liferay.Language.get("more"),url:c})}})};var o=r("frontend-js-web"),a=(n=r("./modals/openDeleteArticleModal"))&&n.__esModule?n:{default:n};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=ManagementToolbarPropsTransformer.js.map