Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/utils/validation",["module","exports","require","./errorMessages","./inputTypes","./language","./utils"],(function(e,i,r){window;Object.defineProperty(i,"__esModule",{value:!0}),i.validateBoost=function(e,i){if(null===e)return;if(i===t.INPUT_TYPES.FIELD_MAPPING&&e.boost<0)return n.ERROR_MESSAGES.NEGATIVE_BOOST;if(i===t.INPUT_TYPES.FIELD_MAPPING_LIST&&e.some((({boost:e})=>e<0)))return n.ERROR_MESSAGES.NEGATIVE_BOOST},i.validateJSON=function(e,i){if(null==e||!(0,E.isDefined)(e)||""===e)return;if(i!==t.INPUT_TYPES.JSON)return;try{JSON.parse(e)}catch(e){return n.ERROR_MESSAGES.INVALID_JSON}},i.validateNumberRange=function(e,i,r){if(null===e)return;if(![t.INPUT_TYPES.NUMBER,t.INPUT_TYPES.SLIDER].includes(i))return;if((0,E.isDefined)(r.min)&&e<r.min)return(0,u.sub)(n.ERROR_MESSAGES.GREATER_THAN_X,[r.min]);if((0,E.isDefined)(r.max)&&e>r.max)return(0,u.sub)(n.ERROR_MESSAGES.LESS_THAN_X,[r.max])},i.validateRequired=function(e,i,r=!0,t=!1){if(!r||t)return;if((0,E.isEmpty)(e,i))return n.ERROR_MESSAGES.REQUIRED};var n=r("./errorMessages"),t=r("./inputTypes"),u=r("./language"),E=r("./utils")}));
//# sourceMappingURL=validation.js.map