Liferay.Loader.define("segments-web@3.0.77/js/utils/contributors.es",["module","exports","require","./constants.es","./odata.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.initialContributorsToContributors=function initialContributorsToContributors(e,t){const r={conjunctionId:n.CONJUNCTIONS.AND},{conjunctionId:i}=e.find((e=>e.conjunctionId))||r;return e.map((e=>{const r=t&&t.find((t=>e.propertyKey===t.propertyKey));return{conjunctionId:e.conjunctionId||i,conjunctionInputId:e.conjunctionInputId,criteriaMap:e.initialQuery||null,entityName:r&&r.entityName,inputId:e.inputId,modelLabel:r&&r.name,properties:r&&r.properties,propertyKey:e.propertyKey,query:e.initialQuery?(0,o.buildQueryString)([e.initialQuery],e.conjunctionId||i,r&&r.properties):""}}))},t.applyCriteriaChangeToContributors=function applyCriteriaChangeToContributors(e,t){return e.map((e=>{const{conjunctionId:r,properties:n,propertyKey:i}=e;return t.propertyKey===i?_objectSpread(_objectSpread({},e),{},{criteriaMap:t.criteriaChange,query:(0,o.buildQueryString)([t.criteriaChange],r,n)}):e}))},t.applyConjunctionChangeToContributor=function applyConjunctionChangeToContributor(e,t){if(-1===n.SUPPORTED_CONJUNCTIONS.findIndex((e=>e.name===t)))return e;return e.map((e=>_objectSpread(_objectSpread({},e),{},{conjunctionId:t})))};var n=r("./constants.es"),o=r("./odata.es");function ownKeys(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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=contributors.es.js.map