!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("prop-types"),require("react"),require("react-immutable-proptypes"),require("@emotion/react"),require("decap-cms-ui-default")):"function"==typeof define&&define.amd?define("DecapCmsWidgetBoolean",["prop-types","react","react-immutable-proptypes","@emotion/react","decap-cms-ui-default"],r):"object"==typeof exports?exports.DecapCmsWidgetBoolean=r(require("prop-types"),require("react"),require("react-immutable-proptypes"),require("@emotion/react"),require("decap-cms-ui-default")):e.DecapCmsWidgetBoolean=r(e.DecapCmsDefaultExports.PropTypes,e.React,e.DecapCmsDefaultExports.ImmutablePropTypes,e.DecapCmsDefaultExports.EmotionCore,e.DecapCmsUiDefault)}(window,((e,r,t,o,n)=>(()=>{"use strict";var i={244:e=>{e.exports=r},756:e=>{e.exports=o},841:e=>{e.exports=t},673:r=>{r.exports=e},327:e=>{e.exports=n}},a={};function c(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={exports:{}};return i[e](t,t.exports,c),t.exports}c.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return c.d(r,{a:r}),r},c.d=(e,r)=>{for(var t in r)c.o(r,t)&&!c.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},c.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);var p={};return(()=>{c.d(p,{DecapCmsWidgetBoolean:()=>y});var e=c(673),r=c.n(e),t=c(244),o=c.n(t),n=c(841),i=c.n(n),a=c(756),s=c(327);const u=["isActive"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},l.apply(this,arguments)}function f(e){let{isActive:r}=e,t=function(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(e,u);return(0,a.jsx)(s.ToggleBackground,l({css:(0,a.css)("background-color:",r?s.colors.active:s.colors.textFieldBorder,";;label:BooleanBackground;")},t))}class d extends o().Component{render(){const{value:e,forID:r,onChange:t,classNameWrapper:o,setActiveStyle:n,setInactiveStyle:i}=this.props;return(0,a.jsx)("div",{className:o},(0,a.jsx)(s.Toggle,{id:r,active:e,onChange:t,onFocus:n,onBlur:i,Background:f}))}}function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}d.propTypes={field:i().map.isRequired,onChange:r().func.isRequired,classNameWrapper:r().string.isRequired,setActiveStyle:r().func.isRequired,setInactiveStyle:r().func.isRequired,forID:r().string,value:r().bool},d.defaultProps={value:!1};const y={Widget:function(e={}){return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?m(Object(t),!0).forEach((function(r){var o,n,i,a;o=e,n=r,i=t[r],(n="symbol"==typeof(a=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n))?a:String(a))in o?Object.defineProperty(o,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):o[n]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({name:"boolean",controlComponent:d},e)},controlComponent:d}})(),p.DecapCmsWidgetBoolean})()));
//# sourceMappingURL=decap-cms-widget-boolean.js.map