/*! For license information please see dll.Timer.js.LICENSE.txt */
(window.webpackJsonp_name_hash_=window.webpackJsonp_name_hash_||[]).push([[113],{1043:function(t,n,e){"use strict";e.r(n);var i=e(13),r=e.n(i),o=e(12),a=e.n(o),u=e(14),s=e.n(u),c=e(15),l=e.n(c),d=e(8),p=e.n(d),f=e(0),v=e.n(f),m=e(1),h=e.n(m),g=e(116),y=e.n(g),w=e(206),b=e.n(w);e(3594);function x(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,i=p()(t);if(n){var r=p()(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return l()(this,e)}}var k=function(t){s()(e,t);var n=x(e);function e(t){var i;r()(this,e),i=n.call(this,t);var o=localStorage.getItem(i.getTimerId());return i.state={timeLeft:o||t.duration,duration:t.duration},i}return a()(e,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentDidUpdate",value:function(t,n){!this.props.active||t.active||this.state.countdown||this.startCountdown()}},{key:"componentWillUnmount",value:function(){var t=this.state.countdown;t&&clearInterval(t)}},{key:"getTimerId",value:function(){var t=this.props.id;return t?"timer::".concat(t):null}},{key:"startCountdown",value:function(){var t=this,n=setInterval((function(){t.setState({timeLeft:b()(0,t.state.timeLeft-1)});var e=t.getTimerId();e&&localStorage.setItem(e,t.state.timeLeft),t.state.timeLeft<=0&&(clearInterval(n),t.props.onTimeUp())}),1e3);this.setState({countdown:n})}},{key:"render",value:function(){return this.props.invisible?null:v.a.createElement("div",{style:this.props.style,className:"timer-div"},this.props.legend,(t=this.state.timeLeft,n=y()(t/60),e=t-60*n,n=n<10?"0".concat(n):n,e=e<10?"0".concat(e):e,"".concat(n,":").concat(e)));var t,n,e}}],[{key:"getDerivedStateFromProps",value:function(t,n){if(t.duration!==n.duration){var e={};return e.duration=t.duration,e.timeLeft=t.duration,e}return null}}]),e}(f.Component);k.propTypes={id:h.a.string,active:h.a.bool.isRequired,duration:h.a.number.isRequired,invisible:h.a.bool,legend:h.a.string,style:h.a.object,onTimeUp:h.a.func},k.defaultProps={id:null,invisible:!1,legend:"",style:{},onTimeUp:function(){}},n.default=k},3594:function(t,n,e){var i=e(36),r=e(3595);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var o={insert:"head",singleton:!1};i(r,o);t.exports=r.locals||{}},3595:function(t,n,e){(n=e(37)(!1)).push([t.i,".timer-div {\n\tposition: fixed;\n\ttop: 0;\n\tright: 0;\n\tmargin-top: 10px;\n\tmargin-right: 25px;\n\tz-index: 9999;\n\tfont-size: 24px;\n\tcolor: white;\n\tbackground-color: #383D48;\n\tpadding-left: 10px;\n\tpadding-right: 10px;\n\tborder-radius: 3px;\n}\n",""]),t.exports=n}}]);