Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/Validation/transform",["module","exports","require"],(function(e,r,t){window;{function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?n(Object(t),!0).forEach((function(r){i(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Object.defineProperty(r,"__esModule",{value:!0}),r.normalizeDataType=o,r.getLocalizedValue=function({defaultLanguageId:e,editingLanguageId:r}){return t=>{var n;return null!==(n=t[r])&&void 0!==n?n:t[e]}},r.getSelectedValidation=function(e){return function(r){Array.isArray(r)&&(r=r[0]);let t=e.find((({name:e})=>e===r));return t||(t=e[0]),t}},r.transformData=function({defaultLanguageId:e,editingLanguageId:r,initialDataType:n,validation:i,validations:o,value:l}){var c;const d=null!==(c=null==i?void 0:i.dataType)&&void 0!==c?c:n,s=t(o,d);return a(a({},u(s,i,l)),{},{dataType:d,localizationMode:r!==e,validations:s})};const e=(e,r,t)=>{let n;return!t&&r&&(t=r.expression),t&&(n=e.find((e=>e.name===t.name))),n},t=(e,r)=>e[o(r)].map((e=>a(a({},e),{},{checked:!1,value:e.name}))),u=(r,t,n)=>{const{errorMessage:a={},expression:i={},parameter:o={}}=n;let u="",l=e(r,t,i);const c=!!i.value;return l?u=l.parameterMessage:l=r[0],{enableValidation:c,errorMessage:a,expression:i,parameter:o,parameterMessage:u,selectedValidation:l}};function o(e){return"double"===e||"integer"===e?"numeric":e}}}));
//# sourceMappingURL=transform.js.map