Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.147/util/withConfirmationField.es",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function withConfirmationField(e){return t=>{let{requireConfirmation:r}=t,a=function _objectWithoutProperties(e,t){if(null==e)return{};var r,n,a=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["requireConfirmation"]);if(!r)return n.default.createElement(e,a);const{confirmationErrorMessage:o,confirmationLabel:l,confirmationValue:i,direction:c,errorMessage:u,label:d,name:f,onChange:s,valid:m}=a,p=getClassNameBasedOnDirection(c),b=m||(null==u?void 0:u.length)>0;return n.default.createElement("div",{className:"row"},n.default.createElement("div",{className:p},n.default.createElement(e,_extends({},a,{label:getLabel(l,d)}))),n.default.createElement("div",{className:p},n.default.createElement(e,_extends({},a,{errorMessage:o,id:"".concat(f,"confirmationField"),label:getConfirmationLabel(l,d),localizable:!1,localizedValue:{},name:"".concat(f,"confirmationField"),onBlur:()=>{},onChange:e=>{s(e,e.target.value,"confirmationValue")},onFocus:()=>{},placeholder:"",predefinedValue:"",repeatable:!1,tip:"",valid:b,value:i}))))}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("liferay!frontend-js-react-web$react"));function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}const getClassNameBasedOnDirection=e=>(null==e?void 0:e.includes("horizontal"))?"col-md-6":"col-md-12",getConfirmationLabel=(e,t)=>e&&t?[e,t].join(" "):e||t,getLabel=(e,t)=>e&&!t?" ":t}}));
//# sourceMappingURL=withConfirmationField.es.js.map