Liferay.Loader.define("@liferay/document-library-web@6.0.111/document_library/js/saveDDMStructure.es",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.getInputLocalizedValues=c,t.getDataEngineStructure=u,t.default=function({namespace:e}){const t=document["".concat(e,"fm")];t.addEventListener("submit",(async n=>{n.preventDefault();const a=await Liferay.componentReady("".concat(e,"dataLayoutBuilder"));(0,r.postForm)(t,{data:u({dataLayoutBuilder:a,namespace:e})})}),!0)};var r=n("frontend-js-web");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(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}function c(e,t){const n=Liferay.component("".concat(e).concat(t)),r={};if(n){n.get("translatedLanguages").values().forEach((e=>{r[e]=n.getValue(e)}))}return r}function u({dataLayoutBuilder:e,namespace:t}){const{dataDefinition:n,dataLayout:r}=e.current.state,a=c(t,"name"),i=c(t,"description");return{dataDefinition:JSON.stringify(o(o({},n.serialize()),{},{description:i,name:a})),dataLayout:JSON.stringify(o(o({},r.serialize()),{},{description:i,name:a}))}}}}));
//# sourceMappingURL=saveDDMStructure.es.js.map