text: (window.webpackJsonp=window.webpackJsonp||[]).push([[63],{"+KLJ":function(e,t,n){"use strict";var a=n("QbLZ"),o=n.n(a),r=n("YEIV"),s=n.n(r),l=n("iCc5"),c=n.n(l),i=n("V7oC"),u=n.n(i),p=n("FYw3"),h=n.n(p),d=n("mRg0"),f=n.n(d),v=n("q1tI"),m=n("i8i4"),b=n("MFj2"),C=n("CtXQ"),y=n("eHJ2"),g=n.n(y),k=n("RqAY");function x(){}var E=function(e){function t(e){c()(this,t);var n=h()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleClose=function(e){e.preventDefault();var t=m.findDOMNode(n);t.style.height=t.offsetHeight+"px",t.style.height=t.offsetHeight+"px",n.setState({closing:!1}),(n.props.onClose||x)(e)},n.animationEnd=function(){n.setState({closed:!0,closing:!0}),(n.props.afterClose||x)()},n.state={closing:!0,closed:!1},n}return f()(t,e),u()(t,[{key:"render",value:function(){var e,t=this.props,n=t.closable,a=t.description,r=t.type,l=t.prefixCls,c=void 0===l?"ant-alert":l,i=t.message,u=t.closeText,p=t.showIcon,h=t.banner,d=t.className,f=void 0===d?"":d,m=t.style,y=t.iconType;p=!(!h||void 0!==p)||p,r=h&&void 0===r?"warning":r||"info";var x="filled";if(!y){switch(r){case"success":y="check-circle";break;case"info":y="info-circle";break;case"error":y="close-circle";break;case"warning":y="exclamation-circle";break;default:y="default"}a&&(x="outlined")}var E=g()(c,c+"-"+r,(e={},s()(e,c+"-close",!this.state.closing),s()(e,c+"-with-description",!!a),s()(e,c+"-no-icon",!p),s()(e,c+"-banner",!!h),e),f);u&&(n=!0);var O=n?v.createElement("a",{onClick:this.handleClose,className:c+"-close-icon"},u||v.createElement(C.a,{type:"close"})):null,w=Object(k.a)(this.props),N=v.createElement(C.a,{className:c+"-icon",type:y,theme:x});return this.state.closed?null:v.createElement(b.a,{component:"",showProp:"data-show",transitionName:c+"-slide-up",onEnd:this.animationEnd},v.createElement("div",o()({"data-show":this.state.closing,className:E,style:m},w),p?N:null,v.createElement("span",{className:c+"-message"},i),v.createElement("span",{className:c+"-description"},a),O))}}]),t}(v.Component);t.a=E},"1d8n":function(e,t,n){},BYbs:function(e,t,n){"use strict";n.r(t);var a=n("aArQ"),o=n("yKAp"),r=n("dI71"),s=n("q1tI"),l=n.n(s),c=n("Vl3Y"),i=n("fyUT"),u=n("kaz8"),p=n("+KLJ"),h=(n("1d8n"),c.a.Item),d={span:5},f={span:12},v=function(e){function t(t){var n;return(n=e.call(this,t)||this).onDuplicateChange=function(e){n.setState({duplicate:e.target.checked})},n.onPeopleChange=function(e){n.setState({people:e})},n.onPrizeChange=function(e){n.setState({prize:e})},n.state={duplicate:!0,people:300,prize:100},n}Object(r.a)(t,e);var n=t.prototype;return n.calculateRate=function(){try{var e=this.state,t=e.duplicate,n=e.people,a=e.prize;return t?1-Math.min(Math.pow((n-1)/n,a),1):Math.min(a/n,1)}catch(o){return 0}},n.render=function(){var e=this.state,t=e.duplicate,n=e.people,a=e.prize;return l.a.createElement("div",{className:"atool-prize-rate"},l.a.createElement(c.a,null,l.a.createElement(h,{label:"抽奖人数",labelCol:d,wrapperCol:f},l.a.createElement(i.a,{placeholder:"抽奖人数",value:n,onChange:this.onPeopleChange})),l.a.createElement(h,{label:"奖品数量",labelCol:d,wrapperCol:f},l.a.createElement(i.a,{placeholder:"奖品数量",value:a,onChange:this.onPrizeChange})),l.a.createElement(h,{label:"允许重复中奖",labelCol:d,wrapperCol:f},l.a.createElement(u.a,{check:t,onChange:this.onDuplicateChange})),l.a.createElement(h,{label:"中奖概率",labelCol:d,wrapperCol:f},l.a.createElement(p.a,{description:"您的中奖概率为："+(100*this.calculateRate()).toFixed(3)+"%",type:"info"}))))},t}(s.PureComponent);t.default=Object(a.a)(v,o.a)},RqAY:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("E9XD");function a(e){return Object.keys(e).reduce((function(t,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||"data-__"===n.substr(0,7)||(t[n]=e[n]),t}),{})}},kaz8:function(e,t,n){"use strict";var a=n("YEIV"),o=n.n(a),r=n("QbLZ"),s=n.n(r),l=n("iCc5"),c=n.n(l),i=n("V7oC"),u=n.n(i),p=n("FYw3"),h=n.n(p),d=n("mRg0"),f=n.n(d),v=n("q1tI"),m=n("17x9"),b=n("eHJ2"),C=n.n(b),y=n("x1Ya"),g=n("Gytx"),k=n.n(g),x=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&(n[a[o]]=e[a[o]])}return n},E=function(e){function t(){c()(this,t);var e=h()(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.saveCheckbox=function(t){e.rcCheckbox=t},e}return f()(t,e),u()(t,[{key:"shouldComponentUpdate",value:function(e,t,n){return!k()(this.props,e)||!k()(this.state,t)||!k()(this.context.checkboxGroup,n.checkboxGroup)}},{key:"focus",value:function(){this.rcCheckbox.focus()}},{key:"blur",value:function(){this.rcCheckbox.blur()}},{key:"render",value:function(){var e=this.props,t=this.context,n=e.prefixCls,a=e.className,r=e.children,l=e.indeterminate,c=e.style,i=e.onMouseEnter,u=e.onMouseLeave,p=x(e,["prefixCls","className","children","indeterminate","style","onMouseEnter","onMouseLeave"]),h=t.checkboxGroup,d=s()({},p);h&&(d.onChange=function(){return h.toggleOption({label:r,value:e.value})},d.checked=-1!==h.value.indexOf(e.value),d.disabled=e.disabled||h.disabled);var f=C()(a,o()({},n+"-wrapper",!0)),m=C()(o()({},n+"-indeterminate",l));return v.createElement("label",{className:f,style:c,onMouseEnter:i,onMouseLeave:u},v.createElement(y.a,s()({},d,{prefixCls:n,className:m,ref:this.saveCheckbox})),void 0!==r?v.createElement("span",null,r):null)}}]),t}(v.Component),O=E;E.defaultProps={prefixCls:"ant-checkbox",indeterminate:!1},E.contextTypes={checkboxGroup:m.any};var w=n("m1cH"),N=n.n(w),P=n("94VI"),I=function(e){function t(e){c()(this,t);var n=h()(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toggleOption=function(e){var t=n.state.value.indexOf(e.value),a=[].concat(N()(n.state.value));-1===t?a.push(e.value):a.splice(t,1),"value"in n.props||n.setState({value:a});var o=n.props.onChange;o&&o(a)},n.state={value:e.value||e.defaultValue||[]},n}return f()(t,e),u()(t,[{key:"getChildContext",value:function(){return{checkboxGroup:{toggleOption:this.toggleOption,value:this.state.value,disabled:this.props.disabled}}}},{key:"shouldComponentUpdate",value:function(e,t){return!k()(this.props,e)||!k()(this.state,t)}},{key:"getOptions",value:function(){return this.props.options.map((function(e){return"string"==typeof e?{label:e,value:e}:e}))}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,a=t.prefixCls,o=t.className,r=t.style,s=t.options,l=a+"-group",c=t.children;s&&s.length>0&&(c=this.getOptions().map((function(o){return v.createElement(O,{prefixCls:a,key:o.value.toString(),disabled:"disabled"in o?o.disabled:t.disabled,value:o.value,checked:-1!==n.value.indexOf(o.value),onChange:function(){return e.toggleOption(o)},className:l+"-item"},o.label)})));var i=C()(l,o);return v.createElement("div",{className:i,style:r},c)}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value||[]}:null}}]),t}(v.Component);I.defaultProps={options:[],prefixCls:"ant-checkbox"},I.childContextTypes={checkboxGroup:m.any},Object(P.polyfill)(I);var j=I;O.Group=j;t.a=O},x1Ya:function(e,t,n){"use strict";n("E9XD");var a=n("jo6Y"),o=n.n(a),r=n("QbLZ"),s=n.n(r),l=n("iCc5"),c=n.n(l),i=n("FYw3"),u=n.n(i),p=n("mRg0"),h=n.n(p),d=n("q1tI"),f=n.n(d),v=n("TSYQ"),m=n.n(v),b=n("94VI"),C=function(e){function t(n){c()(this,t);var a=u()(this,e.call(this,n));a.handleChange=function(e){var t=a.props,n=t.disabled,o=t.onChange;n||("checked"in a.props||a.setState({checked:e.target.checked}),o&&o({target:s()({},a.props,{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},a.saveInput=function(e){a.input=e};var o="checked"in n?n.checked:n.defaultChecked;return a.state={checked:o},a}return h()(t,e),t.getDerivedStateFromProps=function(e,t){return"checked"in e?s()({},t,{checked:e.checked}):null},t.prototype.focus=function(){this.input.focus()},t.prototype.blur=function(){this.input.blur()},t.prototype.render=function(){var e,t=this.props,n=t.prefixCls,a=t.className,r=t.style,l=t.name,c=t.id,i=t.type,u=t.disabled,p=t.readOnly,h=t.tabIndex,d=t.onClick,v=t.onFocus,b=t.onBlur,C=t.autoFocus,y=t.value,g=o()(t,["prefixCls","className","style","name","id","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur","autoFocus","value"]),k=Object.keys(g).reduce((function(e,t){return"aria-"!==t.substr(0,5)&&"data-"!==t.substr(0,5)&&"role"!==t||(e[t]=g[t]),e}),{}),x=this.state.checked,E=m()(n,a,((e={})[n+"-checked"]=x,e[n+"-disabled"]=u,e));return f.a.createElement("span",{className:E,style:r},f.a.createElement("input",s()({name:l,id:c,type:i,readOnly:p,disabled:u,tabIndex:h,className:n+"-input",checked:!!x,onClick:d,onFocus:v,onBlur:b,onChange:this.handleChange,autoFocus:C,ref:this.saveInput,value:y},k)),f.a.createElement("span",{className:n+"-inner"}))},t}(d.Component);C.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){}},Object(b.polyfill)(C);var y=C;t.a=y},yKAp:function(e,t,n){"use strict";t.a={id:"PrizeRate",icon:"",name:"年会中奖概率计算",desc:"年底了，准备了那么多的奖品，自己却没有中奖，来算算中奖概率吧，看看自己的运气有多背！",keywords:["中奖","概率","有多背","算算","奖品","年会","运气","年底","计算","看看"],time:"2020-01-10",category:"CONVENIENT",author:"hustcc"}}}]);
  //# sourceMappingURL=component---src-pages-prizerate-js-3056d24cecbedd22cb00.js.map