Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.174/page_editor/app/components/fragment_configuration_fields/CheckboxField",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@liferay/layout-js-components-web","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../common/hooks/useId","../../../prop_types/index","../../config/constants/viewportSizes","../../contexts/StoreContext"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxField=function CheckboxField({className:e,disabled:t,field:a,onValueSelect:u,title:f,value:p}){var y,b;const m=(0,c.useId)(),[g,_]=(0,n.useControlledState)(p||!1),h=(0,d.useSelector)((e=>e.selectedViewportSize)),w=null===(y=a.typeOptions)||void 0===y?void 0:y.customValues,v=w?g===w.checked:g,handleChange=e=>{let t=e;w&&(t=t?w.checked:w.unchecked),_(t),u(a.name,t)},j=i.default.createElement("span",{className:"font-weight-normal text-3"},a.label);return i.default.createElement(o.default.Group,{className:(0,l.default)(e,"h-100")},i.default.createElement("div",{className:"align-items-center d-flex justify-content-between page-editor__sidebar__fieldset__field-checkbox","data-tooltip-align":"bottom",title:f},"toggle"===(null===(b=a.typeOptions)||void 0===b?void 0:b.displayType)?i.default.createElement(o.ClayToggle,{"aria-describedby":a.description?m:null,containerProps:{className:"mb-0"},disabled:t,label:j,onToggle:e=>handleChange(e),toggled:v}):i.default.createElement(o.ClayCheckbox,{"aria-describedby":a.description?m:null,checked:v,containerProps:{className:"mb-0"},disabled:t,label:j,onChange:e=>handleChange(e.target.checked)}),a.responsive&&h!==s.VIEWPORT_SIZES.desktop&&i.default.createElement(r.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("restore-default"),"data-tooltip-align":"bottom",displayType:"secondary",onClick:()=>{u(a.name,null)},size:"sm",symbol:"restore",title:Liferay.Language.get("restore-default")})),a.description?i.default.createElement("p",{className:"m-0 mt-1 small text-secondary",id:m},a.description):null)};var r=a("@frontend-taglib-clay$clayui/button"),o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=r?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(a,o,n):a[o]=e[o]}a.default=e,t&&t.set(e,a);return a}(a("@frontend-taglib-clay$clayui/form")),n=a("@liferay/layout-js-components-web"),l=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),i=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireDefault(a("liferay!frontend-js-react-web$react"))),c=a("../../../common/hooks/useId"),s=(a("../../../prop_types/index"),a("../../config/constants/viewportSizes")),d=a("../../contexts/StoreContext");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}}}));
//# sourceMappingURL=CheckboxField.js.map