Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/util/options",["module","exports","require"],(function(e,t,n){window;{function r(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?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(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}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOptions=function({editingLanguageId:e,fixedOptions:t,multiple:n,options:r,showEmptyOption:i,valueArray:a}){const l=[];i&&!n&&l.push({label:Liferay.Language.get("choose-an-option"),value:null});const u=t=>{t.forEach((t=>{const r=function({editingLanguageId:e,multiple:t,option:n,valueArray:r}){const i=r.includes(n.value),a="string"==typeof n.label?n.label:n.label[e];return o(o({},n),{},{active:!t&&i,checked:t&&i,label:a,type:t?"checkbox":"item"})}({editingLanguageId:e,multiple:n,option:t,valueArray:a});""!==r.value&&l.push(r)}))};u(r),t.length&&(r.length&&(l[r.length-1].separator=!0),u(t));return l},t.normalizeValue=function({localizedValueEdited:e,multiple:t,normalizedOptions:n,predefinedValueArray:r,valueArray:o}){const i=o.length||!o.length&&e?o:r,a=t?i:[i[0]],l=new Set(n.map((({value:e})=>e)));return a.filter((e=>l.has(e)))}}}));
//# sourceMappingURL=options.js.map