Liferay.Loader.define("dynamic-data-mapping-form-field-type@6.0.108/Checkbox/Checkbox",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$react","../FieldBase/ReactFieldBase.es"],(function(e,a,t){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=a.Main=void 0;var l=t("@frontend-taglib-clay$clayui/form"),n=s(t("@frontend-taglib-clay$clayui/icon")),r=s(t("liferay!frontend-js-react-web$react")),i=t("../FieldBase/ReactFieldBase.es");function s(e){return e&&e.__esModule?e:{default:e}}function d(){return(d=Object.assign||function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e}).apply(this,arguments)}function o(e,a){if(null==e)return{};var t,l,n=function(e,a){if(null==e)return{};var t,l,n={},r=Object.keys(e);for(l=0;l<r.length;l++)t=r[l],a.indexOf(t)>=0||(n[t]=e[t]);return n}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)t=r[l],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}const e=({checked:e,disabled:a,label:t,name:i,onChange:s,required:d,showLabel:o,showMaximumRepetitionsInfo:c,systemSettingsURL:u})=>r.default.createElement(r.default.Fragment,null,r.default.createElement("label",{className:"toggle-switch"},r.default.createElement(l.ClayToggle,{disabled:a,name:i,onToggle:e=>{s({target:{value:e}})},toggled:e,value:String(e)}),o&&t,d&&r.default.createElement(n.default,{className:"reference-mark",symbol:"asterisk"})),e&&c&&r.default.createElement("div",{className:"ddm-info"},r.default.createElement("span",{className:"ddm-tooltip"},r.default.createElement(n.default,{symbol:"info-circle"})),r.default.createElement("div",{className:"ddm-info-text",dangerouslySetInnerHTML:{__html:Liferay.Util.sub(Liferay.Language.get("for-security-reasons-upload-field-repeatability-is-limited-the-limit-is-defined-in-x-system-settings-x"),"<a href=".concat(u,' target="_blank">'),"</a>")}}))),u=({checked:e,disabled:a,label:t,name:i,onChange:s,required:d,showLabel:o})=>r.default.createElement(l.ClayCheckbox,{checked:e,disabled:a,label:o?t:"",name:i,onChange:({target:{checked:e}})=>{s({target:{value:e}})}},o&&d&&r.default.createElement("span",{className:"ddm-label-required reference-mark"},r.default.createElement(n.default,{symbol:"asterisk"}))),f=a=>{let{label:t,name:n,onChange:s,predefinedValue:c,readOnly:f,required:m,showAsSwitcher:b=!0,showLabel:y=!0,showMaximumRepetitionsInfo:g=!1,systemSettingsURL:h,value:p,visible:w}=a,v=o(a,["label","name","onChange","predefinedValue","readOnly","required","showAsSwitcher","showLabel","showMaximumRepetitionsInfo","systemSettingsURL","value","visible"]);const L=b?e:u,k=!!(null!=p?p:Array.isArray(c)?"true"===c[0]:c);return r.default.createElement(i.FieldBase,d({name:n,showLabel:!1,visible:w},v),r.default.createElement(L,{checked:k,disabled:f,label:t,name:n,onChange:s,required:m,showLabel:y,showMaximumRepetitionsInfo:g,systemSettingsURL:h}),r.default.createElement(l.ClayInput,{name:n,type:"hidden",value:"".concat(k)}))};a.Main=f,f.displayName="Checkbox";var c=f;a.default=c}}));
//# sourceMappingURL=Checkbox.js.map