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TL,EAAaK,EACf,GACA,CAACZ,EAAUF,EAAeQ,IAG5B,OACEhC,IAAAA,cAACuC,IAAAA,MAAU,CAAC,qBAAoBrB,EAAMT,UAAU,uBAC9CT,IAAAA,cAACV,EAAAA,EAAmB,CAACE,aAAcgD,IAAWf,GAASA,OAAQgB,GAC7DzC,IAAAA,cAAC0C,IAAQC,EAAA,CACPnB,cAAeA,GAA+B,OAAdQ,EAChCd,KAAMA,EACNmB,QAASL,EACTN,SAAUQ,IACNU,EAAAA,EAAAA,IAASjB,IAEZR,EACAC,GAAQG,GAAWvB,IAAAA,cAACuC,IAAAA,SAAa,CAAChB,SAAO,GAAEH,KAG/CA,IAASG,GAAWvB,IAAAA,cAACuC,IAAAA,SAAa,KAAEnB,GAG3C,GACA,CAAC,QAAS,UAEZyB,EAAAA,EAAAA,GAAM,2BAEN,O,wDChEIC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,8NAA+N,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iDAAiD,MAAQ,GAAG,SAAW,kEAAkE,eAAiB,CAAC,+PAA+P,WAAa,MAE1sB,K","sources":["webpack:///./components/rsuite-field-control/index.js","webpack:///./react-rsuite5/checkbox/index.scss?a37e","webpack:///./react-rsuite5/checkbox/index.js","webpack:///./react-rsuite5/checkbox/index.scss"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\n\nimport Whisper from 'rsuite/Whisper';\nimport Popover from 'rsuite/Popover';\n\nconst POPOVER_STYLE = {\n  padding: '6px',\n  color: '#ff6633'\n};\n\nconst RSuite5FieldControl = ({ errorMessage, children }) => {\n  const triggerRef = useRef();\n\n  useEffect(\n    () => {\n      if (errorMessage) {\n        triggerRef.current.open();\n      } else {\n        triggerRef.current.close();\n      }\n    },\n    [errorMessage]\n  );\n\n  return (\n    <Whisper\n      placement=\"bottomStart\"\n      ref={triggerRef}\n      trigger=\"none\"\n      speaker={<Popover \n        style={POPOVER_STYLE} \n        visible={!!errorMessage}\n        className=\"lf-react-rsuite5-error-popover\"\n      ><div>{errorMessage}</div></Popover>}\n    >{children}</Whisper>\n  );\n}\n\nexport { RSuite5FieldControl };\n","\n      import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./index.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./index.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","import React, { useCallback, useState } from 'react';\nimport _ from 'lodash';\nimport Form from 'rsuite/Form';\nimport Checkbox from 'rsuite/Checkbox';\n\nimport { I18N } from '../../components';\nimport { RSuite5FieldControl } from '../../components/rsuite-field-control';\nimport { passRest } from '../../helpers';\nimport { lfLog } from '../../helpers/lf-log';\n\nimport './index.scss';\n\nconst CheckboxRSuite = I18N(\n  ({\n    name,\n    label,\n    hint,\n    value,\n    tooltip = false,\n    indeterminate,\n    error,\n    onChange,\n    ...rest\n  }) => {\n    const [isChecked, setIsChecked] = useState(value ?? null);\n    const handleChange = useCallback(\n      (valueType, checked) => {\n        let newValue;\n        if (isChecked === true) {\n          newValue = false;\n        } if (isChecked === false) {\n          if (indeterminate) {\n            newValue = null;\n          } else {\n            newValue = true;\n          }\n        } else if (isChecked === null) {\n          newValue = true;\n        }\n        onChange(newValue);\n        setIsChecked(newValue);\n      },\n      [onChange, indeterminate, isChecked],\n    );\n\n    return (\n      <Form.Group data-lf-field-name={name} className=\"lt-control-checkbox\">\n        <RSuite5FieldControl errorMessage={_.isString(error) ? error : undefined }>\n          <Checkbox\n            indeterminate={indeterminate && isChecked === null}\n            name={name}\n            checked={isChecked}\n            onChange={handleChange}\n            {...passRest(rest)}\n          >\n            {label}\n            {hint && tooltip && <Form.HelpText tooltip>{hint}</Form.HelpText>}\n          </Checkbox>\n        </RSuite5FieldControl>\n        {hint && !tooltip && <Form.HelpText>{hint}</Form.HelpText>}\n      </Form.Group>\n    );\n  },\n  ['label', 'hint']\n);\nlfLog('Loaded RSuite5.Checkbox');\n\nexport default CheckboxRSuite;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".lf-form-react-rsuite5 .lt-control-checkbox .rs-form-help-text{align-items:inherit;margin-top:-1px;display:inline-block;margin-left:5px}.lf-form-react-rsuite5 .lt-control-checkbox .rs-form-help-text svg{margin-top:-2px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./react-rsuite5/checkbox/index.scss\"],\"names\":[],\"mappings\":\"AAEI,+DACE,mBAAA,CACA,eAAA,CACA,oBAAA,CACA,eAAA,CAEA,mEACE,eAAA\",\"sourcesContent\":[\".lf-form-react-rsuite5 {\\n  .lt-control-checkbox {\\n    .rs-form-help-text {\\n      align-items: inherit;\\n      margin-top: -1px;\\n      display: inline-block;\\n      margin-left: 5px;\\n\\n      svg {\\n        margin-top: -2px;\\n      }\\n    }\\n  }\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["POPOVER_STYLE","padding","color","RSuite5FieldControl","_ref","errorMessage","children","triggerRef","useRef","useEffect","current","open","close","React","Whisper","placement","ref","trigger","speaker","Popover","style","visible","className","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","CheckboxRSuite","I18N","name","label","hint","value","_ref$tooltip","tooltip","indeterminate","error","onChange","rest","_objectWithoutProperties","_excluded","_useState2","useState","isChecked","setIsChecked","handleChange","useCallback","valueType","checked","newValue","Form","_isString","undefined","Checkbox","_extends","passRest","lfLog","___CSS_LOADER_EXPORT___","push","module","id"],"sourceRoot":""}