1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5326],{85326:(t,e,n)=>{var r=n(124994),u=n(373738);function o(){var t=r(n(517383));return o=function(){return t},t}function i(){var t=r(n(334579));return i=function(){return t},t}function a(){var t=r(n(728452));return a=function(){return t},t}function c(){var t=r(n(863072));return c=function(){return t},t}function s(){var t=r(n(829511));return s=function(){return t},t}function f(){var t=r(n(443693));return f=function(){return t},t}function l(){var t=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=u(t)&&"function"!=typeof t)return{default:t};var n=m(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}(n(296540));return l=function(){return t},t}function p(){var t=r(n(605556));return p=function(){return t},t}function d(){var t=n(323527);return d=function(){return t},t}function h(){var t=n(855362);return h=function(){return t},t}function m(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(m=function(t){return t?n:e})(t)}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var y=function(t){function e(t){var n,r,u,i;return(0,o().default)(this,e),r=this,u=e,i=[t],u=(0,c().default)(u),n=(0,a().default)(r,v()?Reflect.construct(u,i||[],(0,c().default)(r).constructor):u.apply(r,i)),(0,f().default)(n,"countFun",(function(t){var e=n.props.delatTime,r=new Date(t+e).getTime()-(new Date).getTime();n.worker=(0,h().createTimerWorker)(),n.worker.onmessage=function(t){(r=1e3*t.data)>0?n.setTimeData(r):(n.setState({isCount:!1}),setTimeout((function(){n.props.setCount(!1)}),1e3))},n.worker.postMessage(r/1e3)})),n.state={day:0,hour:0,minute:0,second:0,isCount:void 0},n}return(0,s().default)(e,t),(0,i().default)(e,[{key:"componentWillMount",value:function(){this.setState({day:0,hour:0,minute:0,second:0,isCount:void 0})}},{key:"componentDidMount",value:function(){this.caculateTime(this.props.endTime)}},{key:"componentWillUnmount",value:function(){clearInterval(this.timer),this.worker&&this.worker.terminate()}},{key:"componentDidUpdate",value:function(t,e,n){var r=this;t.endTime!==this.props.endTime&&this.props.endTime&&(this.worker&&this.worker.terminate(),this.setState((function(){return{day:0,hour:0,minute:0,second:0,isCount:void 0}}),(function(){return r.caculateTime(r.props.endTime)})))}},{key:"splitSecond",value:function(t){var e=Math.floor(t/1e3/3600/24);return{day:e,hour:Math.floor(t/1e3/3600%24)-24*e,minute:Math.floor(t/1e3/60%60),second:Math.floor(t/1e3%60)}}},{key:"setTimeData",value:function(t){var e=this.splitSecond(t),n=e.day,r=e.hour,u=e.minute,o=e.second;this.setState({day:n,hour:parseInt(r)+24*parseInt(n)<10?"0"+(parseInt(r)+24*parseInt(n)):parseInt(r)+24*parseInt(n),minute:u<10?"0"+u:u,second:o<10?"0"+o:o,isCount:!0})}},{key:"caculateTime",value:function(t){if(t){var e=this.props.delatTime,n=new Date(t+e).getTime()-(new Date).getTime();n>1e3?(n-=1e3,this.setTimeData(n)):(clearInterval(this.timer),this.setState({isCount:!1}),this.props.setCount(!1)),this.countFun(t),this.props.setCount(t+e-(new Date).getTime()>1e3)}}},{key:"render",value:function(){if(this.props.render)return this.props.render(this.state);var t=this.state,e=(t.isCount,t.day),n=t.second,r=t.minute,u=t.hour;return d().isCN?"".concat(e," 天 ").concat(u," æ¶ ").concat(r," å ").concat(n," ç§"):"".concat(e," Day ").concat(u," hour ").concat(r," minute ").concat(n," second")}}])}(l().Component);y.propTypes={setCount:p().default.func,endTime:p().default.number,delatTime:p().default.number,render:p().default.func},y.defaultProps={delatTime:288e5};e.default=y;t.exports=e.default}}]); 2//# sourceMappingURL=5326.eb87a9fa.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.