(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[4],{1206:function(t,e,n){"use strict";var a=n(1),n=n(3);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function i(t,e,n){e&&r(t.prototype,e),n&&r(t,n)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){if(!e||"object"!=typeof e&&"function"!=typeof e){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}return e}function f(n){var o=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 t,e=c(n);return l(this,o?(t=c(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function p(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?m(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function d(t,e){var n,o,r,e=1<arguments.length&&void 0!==e?e:2,t=String(t);return 0===e?t:(n=(r=t.match(/(.*?)([0-9]+)(.*)/))?r[1]:"",o=r?r[3]:"",t=(r=r?r[2]:t).length>=e?r:(p(Array(e)).map(function(){return"0"}).join("")+r).slice(-1*e),"".concat(n).concat(t).concat(o))}var h={daysInHours:!1,zeroPadTime:2};s(T,a["Component"]),y=f(T),i(T,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?Object(a.cloneElement)(this.props.children,{count:this.state.count}):null}}]);var y,v=T;function T(){var t;return o(this,T),(t=y.apply(this,arguments)).state={count:t.props.count||3},t.startCountdown=function(){t.interval=window.setInterval(function(){0==t.state.count-1?(t.stopCountdown(),t.props.onComplete&&t.props.onComplete()):t.setState(function(t){return{count:t.count-1}})},1e3)},t.stopCountdown=function(){clearInterval(t.interval)},t.addTime=function(e){t.stopCountdown(),t.setState(function(t){return{count:t.count+e}},t.startCountdown)},t}v.propTypes={count:n.number,children:n.element,onComplete:n.func};s(D,a["Component"]),b=f(D),i(D,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(t){this.legacyMode||this.props.date!==t.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var t=this.props,e=t.date,n=t.now,o=t.precision,r=t.controlled,t=t.overtime;return function(t,e){var e=1<arguments.length&&void 0!==e?e:{},n=void 0===(n=e.now)?Date.now:n,o=void 0===(o=e.precision)?0:o,r=e.controlled,i=void 0===(i=e.offsetTime)?0:i,e=e.overtime,t="string"==typeof t?new Date(t).getTime():t instanceof Date?t.getTime():t,i=(r||(t+=i),r?t:t-n()),r=Math.min(20,Math.max(0,o)),t=Math.round(1e3*parseFloat(((e?i:Math.max(0,i))/1e3).toFixed(r))),n=Math.abs(t)/1e3;return{total:t,days:Math.floor(n/86400),hours:Math.floor(n/3600%24),minutes:Math.floor(n/60%60),seconds:Math.floor(n%60),milliseconds:Number((n%1*1e3).toFixed()),completed:t<=0}}(e,{now:n,precision:o,controlled:r,offsetTime:this.offsetTime,overtime:t})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(t){this.legacyCountdownRef.current.addTime(t)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(t){return this.state.status===t}},{key:"setTimeDeltaState",value:function(e,n,t){var o,r,i=this;if(this.mounted)return o=e.completed&&!this.state.timeDelta.completed,r=e.completed&&"STARTED"===n,o&&!this.props.overtime&&this.clearTimer(),this.setState(function(t){t=n||t.status;return e.completed&&!i.props.overtime?t="COMPLETED":n||"COMPLETED"!==t||(t="STOPPED"),{timeDelta:e,status:t}},function(){t&&t(i.state.timeDelta),i.props.onComplete&&(o||r)&&i.props.onComplete(e,r)})}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var t,e,n,o,r=this.props,i=r.daysInHours,a=r.zeroPadTime,r=r.zeroPadDays,s=this.state.timeDelta;return Object.assign(Object.assign({},s),{api:this.getApi(),props:this.props,formatted:(i={daysInHours:i,zeroPadTime:a,zeroPadDays:r},r=(a=s).days,t=s.hours,e=s.minutes,a=s.seconds,s=(i=Object.assign(Object.assign({},h),i)).daysInHours,n=i.zeroPadTime,i=void 0===(i=i.zeroPadDays)?n:i,o=Math.min(2,n),n=s?d(t+24*r,n):d(t,o),{days:s?"":d(r,i),hours:n,minutes:d(e,o),seconds:d(a,o)})})}},{key:"render",value:function(){var t,e,n,o,r,i;return this.legacyMode?(i=(t=this.props).count,n=t.children,t=t.onComplete,Object(a.createElement)(v,{ref:this.legacyCountdownRef,count:i,onComplete:t},n)):(t=(i=this.props).className,n=i.overtime,o=i.children,i=i.renderer,e=this.getRenderProps(),i?i(e):o&&this.state.timeDelta.completed&&!n?Object(a.cloneElement)(o,{countdown:e}):(n=(i=e.formatted).days,o=i.hours,r=i.minutes,i=i.seconds,Object(a.createElement)("span",{className:t},e.total<0?"-":"",n,n?":":"",o,":",r,":",i)))}}]);var b,S=D;function D(t){var n;return o(this,D),(n=b.call(this,t)).mounted=!1,n.initialTimestamp=n.calcOffsetStartTimestamp(),n.offsetStartTimestamp=n.props.autoStart?0:n.initialTimestamp,n.offsetTime=0,n.legacyMode=!1,n.legacyCountdownRef=Object(a.createRef)(),n.tick=function(){var t=n.calcTimeDelta(),e=t.completed&&!n.props.overtime?void 0:n.props.onTick;n.setTimeDeltaState(t,void 0,e)},n.start=function(){var t;n.isStarted()||(t=n.offsetStartTimestamp,n.offsetStartTimestamp=0,n.offsetTime+=t?n.calcOffsetStartTimestamp()-t:0,t=n.calcTimeDelta(),n.setTimeDeltaState(t,"STARTED",n.props.onStart),n.props.controlled)||t.completed&&!n.props.overtime||(n.clearTimer(),n.interval=window.setInterval(n.tick,n.props.intervalDelay))},n.pause=function(){n.isPaused()||(n.clearTimer(),n.offsetStartTimestamp=n.calcOffsetStartTimestamp(),n.setTimeDeltaState(n.state.timeDelta,"PAUSED",n.props.onPause))},n.stop=function(){n.isStopped()||(n.clearTimer(),n.offsetStartTimestamp=n.calcOffsetStartTimestamp(),n.offsetTime=n.offsetStartTimestamp-n.initialTimestamp,n.setTimeDeltaState(n.calcTimeDelta(),"STOPPED",n.props.onStop))},n.isStarted=function(){return n.isStatus("STARTED")},n.isPaused=function(){return n.isStatus("PAUSED")},n.isStopped=function(){return n.isStatus("STOPPED")},n.isCompleted=function(){return n.isStatus("COMPLETED")},t.date?(t=n.calcTimeDelta(),n.state={timeDelta:t,status:t.completed?"COMPLETED":"STOPPED"}):n.legacyMode=!0,n}S.defaultProps=Object.assign(Object.assign({},h),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0}),S.propTypes={date:Object(n.oneOfType)([Object(n.instanceOf)(Date),n.string,n.number]),daysInHours:n.bool,zeroPadTime:n.number,zeroPadDays:n.number,controlled:n.bool,intervalDelay:n.number,precision:n.number,autoStart:n.bool,overtime:n.bool,className:n.string,children:n.element,renderer:n.func,now:n.func,onMount:n.func,onStart:n.func,onPause:n.func,onStop:n.func,onTick:n.func,onComplete:n.func},e.a=S},1270:function(b,t,e){!function(t){var n=9007199254740991,o="[object Arguments]",r="[object Function]",i="[object GeneratorFunction]",a="[object Symbol]",t="object"==typeof t&&t&&t.Object===Object&&t,e="object"==typeof self&&self&&self.Object===Object&&self,t=t||e||Function("return this")();var e=Object.prototype,s=e.hasOwnProperty,c=e.toString,t=t.Symbol,u=e.propertyIsEnumerable,l=t?t.isConcatSpreadable:void 0,f=Math.max;function d(t){return m(t)||function(t){return h(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=n}(t.length)&&!function(t){t=function(t){var e=typeof t;return t&&("object"==e||"function"==e)}(t)?c.call(t):"";return t==r||t==i}(t)}(t)}(e=t)&&s.call(e,"callee")&&(!u.call(e,"callee")||c.call(e)==o)||!!(l&&t&&t[l]);var e}function p(t){var e;return"string"==typeof t||"symbol"==typeof(e=t)||h(e)&&c.call(e)==a?t:"0"==(e=t+"")&&1/t==-1/0?"-0":e}var m=Array.isArray;function h(t){return!!t&&"object"==typeof t}function y(){for(var t=arguments,e=-1,n=f(t.length-T,0),o=Array(n);++e<n;)o[e]=t[T+e];for(var e=-1,r=Array(T+1);++e<T;)r[e]=t[e];r[T]=o;var i=v,a=this,s=r;switch(s.length){case 0:return i.call(a);case 1:return i.call(a,s[0]);case 2:return i.call(a,s[0],s[1]);case 3:return i.call(a,s[0],s[1],s[2])}return i.apply(a,s)}var v,T;v=function(t,e){if(null==t)return{};for(var n=t,t=function(t,e){for(var n=-1,o=t?t.length:0,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r}(function t(e,n,o,r,i){var a=-1,s=e.length;for(o=o||d,i=i||[];++a<s;){var c=e[a];if(0<n&&o(c))if(1<n)t(c,n-1,o,r,i);else{m=p=f=l=u=void 0;for(var u=i,l=c,f=-1,p=l.length,m=u.length;++f<p;)u[m+f]=l[f]}else r||(i[i.length]=c)}return i}(e,1),p),o=n=Object(n),r=t,i=function(t,e){return e in n},a=-1,s=r.length,c={};++a<s;){var u=r[a],l=o[u];i(l,u)&&(c[u]=l)}return c},T=f(void 0===T?v.length-1:T,0);b.exports=y}.call(this,e(55))}}]);