Liferay.Loader.define("layout-template-admin-web@2.0.75/js/propsTransformers/LayoutPageTemplateEntryPropsTransformer",["module","exports","require","frontend-js-web","../modal/openDeletePageTemplateModal"],(function(e,t,a){var r;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let{actions:a,portletNamespace:r}=t;return i(i({},function(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(t,["actions","portletNamespace"])),{},{actions:null==a?void 0:a.map((t=>{var a;return i(i({},t),{},{items:null===(a=t.items)||void 0===a?void 0:a.map((t=>i(i({},t),{},{onClick(a){var n;const l=null===(n=t.data)||void 0===n?void 0:n.action;l&&(a.preventDefault(),e[l](t.data,r))}})))})})),portletNamespace:r})};var n=a("frontend-js-web"),l=(r=a("../modal/openDeletePageTemplateModal"))&&r.__esModule?r:{default:r};function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){u(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function u(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e={deleteLayoutPageTemplateEntry({deleteLayoutPageTemplateEntryURL:e}){(0,l.default)({onDelete:()=>{m(e)},title:Liferay.Language.get("page-template")})},deleteLayoutPageTemplateEntryPreview({deleteLayoutPageTemplateEntryPreviewURL:e}){m(e)},discardDraft({discardDraftURL:e}){(0,n.openConfirmModal)({message:Liferay.Language.get("are-you-sure-you-want-to-discard-current-draft-and-apply-latest-published-changes"),onConfirm:t=>{t&&m(e)}})},moveLayoutPageTemplateEntry({itemSelectorURL:e,moveLayoutPageTemplateEntryURL:t},a){(0,n.openSelectionModal)({onSelect:e=>{if(!e)return;const a=JSON.parse(e.value);m(new n.createPortletURL(t,{targetLayoutPageTemplateCollectionId:a.layoutPageTemplateCollectionId}).toString())},selectEventName:"".concat(a,"selectItem"),title:Liferay.Language.get("select-destination"),url:e})},permissionsLayoutPageTemplateEntry({permissionsLayoutPageTemplateEntryURL:e}){(0,n.openModal)({title:Liferay.Language.get("permissions"),url:e})},renameLayoutPageTemplateEntry({idFieldName:e,idFieldValue:t,layoutPageTemplateEntryName:a,updateLayoutPageTemplateEntryURL:r},l){(0,n.openSimpleInputModal)({dialogTitle:Liferay.Language.get("rename-display-page-template"),formSubmitURL:r,idFieldName:e,idFieldValue:t,mainFieldLabel:Liferay.Language.get("name"),mainFieldName:"name",mainFieldPlaceholder:Liferay.Language.get("name"),mainFieldValue:a,namespace:l})},updateLayoutPageTemplateEntryPreview({itemSelectorURL:e,layoutPageTemplateEntryId:t},a){(0,n.openSelectionModal)({onSelect:e=>{if(e){const r=JSON.parse(e.value);document.getElementById("".concat(a,"layoutPageTemplateEntryId")).value=t,document.getElementById("".concat(a,"fileEntryId")).value=r.fileEntryId,submitForm(document.getElementById("".concat(a,"layoutPageTemplateEntryPreviewFm")))}},selectEventName:Liferay.Util.ns(a,"changePreview"),title:Liferay.Language.get("page-template-thumbnail"),url:e})}};function m(e){submitForm(document.hrefFm,e)}}}));
//# sourceMappingURL=LayoutPageTemplateEntryPropsTransformer.js.map