(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[3],{1807:function(e,t,a){"use strict";a.d(t,"a",(function(){return j}));var n=a(2),c=a(11),r=a(225);var i=function(e,t,a){return null==e?e:Object(r.a)(e,t,a)},o=a(8),d=a(12),s=a(593),l=a(5),p=(a(7),a(0)),u=a.n(p),h=a(30),b=a(117),m=a(116),f=a(85),O=a(174),j=function(e){function t(){for(var t,a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(t=e.call.apply(e,[this].concat(c))||this).inputRef=Object(p.createRef)(),t.labelRef=Object(p.createRef)(),t.canToggle=function(){var e=t.props,a=e.disabled,n=e.radio,c=e.readOnly,r=t.state.checked;return!a&&!c&&!(n&&r)},t.computeTabIndex=function(){var e=t.props,a=e.disabled,n=e.tabIndex;return Object(d.a)(n)?a?-1:0:n},t.handleClick=function(e){var a=t.props.id,c=t.state,r=c.checked,i=c.indeterminate,s=Object(o.a)(t.inputRef.current,"contains",e.target),l=Object(o.a)(t.labelRef.current,"contains",e.target),p=!l&&!s,u=!Object(d.a)(a);l&&u||Object(o.a)(t.props,"onClick",e,Object(n.a)({},t.props,{checked:!r,indeterminate:!!i})),t.isClickFromMouse&&(t.isClickFromMouse=!1,l&&!u&&t.handleChange(e),p&&t.handleChange(e),l&&u&&e.stopPropagation())},t.handleChange=function(e){var a=t.state.checked;t.canToggle()&&(Object(o.a)(t.props,"onChange",e,Object(n.a)({},t.props,{checked:!a,indeterminate:!1})),t.setState({checked:!a,indeterminate:!1}))},t.handleMouseDown=function(e){var a=t.state,c=a.checked,r=a.indeterminate;Object(o.a)(t.props,"onMouseDown",e,Object(n.a)({},t.props,{checked:!!c,indeterminate:!!r})),e.defaultPrevented||Object(o.a)(t.inputRef.current,"focus"),e.preventDefault()},t.handleMouseUp=function(e){var a=t.state,c=a.checked,r=a.indeterminate;t.isClickFromMouse=!0,Object(o.a)(t.props,"onMouseUp",e,Object(n.a)({},t.props,{checked:!!c,indeterminate:!!r}))},t.setIndeterminate=function(){var e=t.state.indeterminate;i(t.inputRef,"current.indeterminate",!!e)},t}Object(c.a)(t,e);var a=t.prototype;return a.componentDidMount=function(){this.setIndeterminate()},a.componentDidUpdate=function(){this.setIndeterminate()},a.render=function(){var e=this.props,a=e.className,c=e.disabled,r=e.label,i=e.id,o=e.name,p=e.radio,j=e.readOnly,k=e.slider,g=e.toggle,v=e.type,C=e.value,y=this.state,M=y.checked,R=y.indeterminate,I=Object(l.a)("ui",Object(h.a)(M,"checked"),Object(h.a)(c,"disabled"),Object(h.a)(R,"indeterminate"),Object(h.a)(Object(d.a)(r),"fitted"),Object(h.a)(p,"radio"),Object(h.a)(j,"read-only"),Object(h.a)(k,"slider"),Object(h.a)(g,"toggle"),"checkbox",a),w=Object(b.a)(t,this.props),D=Object(m.a)(t,this.props),x=Object(f.c)(w,{htmlProps:f.b}),P=x[0],U=x[1],E=Object(O.d)(r,{defaultProps:{htmlFor:i},autoGenerateKey:!1})||u.a.createElement("label",{htmlFor:i});return u.a.createElement(D,Object(n.a)({},U,{className:I,onClick:this.handleClick,onChange:this.handleChange,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp}),u.a.createElement(s.a,{innerRef:this.inputRef},u.a.createElement("input",Object(n.a)({},P,{checked:M,className:"hidden",disabled:c,id:i,name:o,readOnly:!0,tabIndex:this.computeTabIndex(),type:v,value:C}))),u.a.createElement(s.a,{innerRef:this.labelRef},E))},t}(a(228).a);j.handledProps=["as","checked","className","defaultChecked","defaultIndeterminate","disabled","fitted","id","indeterminate","label","name","onChange","onClick","onMouseDown","onMouseUp","radio","readOnly","slider","tabIndex","toggle","type","value"],j.propTypes={},j.defaultProps={type:"checkbox"},j.autoControlledProps=["checked","indeterminate"]}}]);
//# sourceMappingURL=3.6b3ef0ac.chunk.js.map