(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{513:function(t,e,n){"use strict";n.r(e);n(302),n(67),n(65),n(12),n(50),n(31),n(87);var r=6e4,o=36e5,m=24*o;function h(t){return(0+t.toString()).slice(-2)}var c={components:{},props:{isSlot:{type:Boolean,default:!1},time:{type:Number,default:0},format:{type:String,default:"hh:mm:ss"},autoStart:{type:Boolean,default:!0}},watch:{time:{immediate:!0,handler:function(t){t&&this.reset()}}},data:function(){return{timeObj:{},formateTime:0}},created:function(){},computed:{},methods:{createTimer:function(t){return setTimeout(t,100)},isSameSecond:function(t,e){return Math.floor(t)===Math.floor(e)},start:function(){this.counting||(this.counting=!0,this.endTime=Date.now()+1e3*this.remain,this.setTimer())},setTimer:function(){var t=this;this.tid=this.createTimer((function(){var e=t.getRemain();t.isSameSecond(e,t.remain)&&0!==e||t.setRemain(e),0!==t.remain&&t.setTimer()}))},getRemain:function(){return Math.max(this.endTime-Date.now(),0)},pause:function(){this.counting=!1,clearTimeout(this.tid)},reset:function(){this.pause(),this.remain=this.time,this.setRemain(this.remain),this.autoStart&&this.start()},setRemain:function(t){var e=this.format;this.remain=t;var time,n=(time=t,{days:Math.floor(time/m),hours:h(Math.floor(time%m/o)),minutes:h(Math.floor(time%o/r)),seconds:h(Math.floor(time%r/1e3))});this.formateTime=function(t,e){var n=e.days,r=e.hours,o=e.minutes,m=e.seconds;return-1!==t.indexOf("dd")&&(t=t.replace("dd",n)),-1!==t.indexOf("hh")&&(t=t.replace("hh",h(r))),-1!==t.indexOf("mm")&&(t=t.replace("mm",h(o))),-1!==t.indexOf("ss")&&(t=t.replace("ss",h(m))),t}(e,n),this.$emit("change",n),0===t&&(this.pause(),this.$emit("finish"))}}},f=n(8),component=Object(f.a)(c,(function(){var t=this,e=t._self._c;return t.time>=0?e("div",[e("client-only",[t.isSlot?t._t("default"):e("span",[t._v(t._s(t.formateTime))])],2)],1):t._e()}),[],!1,null,null,null);e.default=component.exports}}]);