Cube('pandav:/com/tableListV2/1.0.0/components/AnimateText.jsx',['pandav:/npm/react/16.13.1','pandav:/com/tween-animation/1.0.0','pandav:/com/tableListV2/1.0.0/common/cssModules'],function(a,b,c){function d(a){"@babel/helpers - typeof";return d='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},d(a)}function e(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function f(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,h(c.key),c)}function g(a,b,c){return b&&f(a.prototype,b),c&&f(a,c),Object.defineProperty(a,'prototype',{writable:!1}),a}function h(a){var b=j(a,'string');return'symbol'==d(b)?b:b+''}function j(a,b){if('object'!=d(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var e=c.call(a,b||'default');if('object'!=d(e))return e;throw new TypeError('@@toPrimitive must return a primitive value.')}return('string'===b?String:Number)(a)}function k(a,b,c){return b=p(b),l(a,n()?Reflect.construct(b,c||[],p(a).constructor):b.apply(a,c))}function l(a,b){if(b&&('object'===d(b)||'function'==typeof b))return b;if(void 0!==b)throw new TypeError('Derived constructors may only return object or undefined');return m(a)}function m(a){if(void 0===a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return a}function n(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(a){}return(n=function b(){return!!a})()}function p(a){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},p(a)}function q(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&r(a,b)}function r(a,b){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},r(a,b)}var s=c('pandav:/npm/react/16.13.1'),t=c('pandav:/com/tween-animation/1.0.0'),u=c('pandav:/com/tableListV2/1.0.0/common/cssModules'),v=function(a){function b(a){var c;return e(this,b),c=k(this,b,[a]),c.state={offsetWidth:0,translateX:0,duration:a.duration,textOverflow:'text-overflow-break-word'},c.dom=null,c.textExcuteAnimationInstance=null,c}return q(b,a),g(b,[{key:'componentDidMount',value:function a(){this._measureText()}},{key:'componentWillUnmount',value:function a(){this.cleanTween(),this.state=null,this.dom=null}},{key:'componentWillReceiveProps',value:function c(a,b){this.state.duration!==a.duration&&this.setState({duration:a.duration},this._measureText),this.state.textOverflow!==a.textOverflow&&'text-overflow-marquee'===a.textOverflow&&this.setState({textOverflow:a.textOverflow},this._measureText)}},{key:'cleanTween',value:function a(){this.textTween&&this.textTween.destroy(),this.textExcuteAnimationInstance&&this.textExcuteAnimationInstance.endAnimation(),this.textTween=null,this.textExcuteAnimationInstance=null,this._tid&&window.clearTimeout(this._tid)}},{key:'_measureText',value:function a(){this.cleanTween();var b=this.dom,c=this;if(b&&'text-overflow-marquee'===this.props.textOverflow){this.dom.style.transform='translate3d(0, 0, 0)';var d=b.offsetWidth,e=d-(this.props.containerWidth||b.parentElement.offsetWidth);this.setState({translateX:e,offsetWidth:d},function(){0<e&&c.run()}),0===e&&(this._tid=setTimeout(this._measureText.bind(this),1e3))}}},{key:'getEaseType',value:function b(a){return'Linear'===a?{type:Animation.Linear,ratio:1}:'EaseInOut'===a?{type:Animation.EaseOut,ratio:4}:'EaseIn'===a?{type:Animation.EaseIn,ratio:4}:'EaseOut'===a?{type:Animation.EaseOut,ratio:4}:void 0}},{key:'run',value:function a(){var b=this.state,c=b.duration,d=b.offsetWidth,e=this.dom;this.cleanTween(),this.textExcuteAnimationInstance=t.createAnimation();var f={translateX:0},g=this.textExcuteAnimationInstance.startAnimation(Object.assign({},f));this.textTween=g,g.set(f);var h=this.getEaseType('Linear');g=g.to({translateX:-d/2-5},1e3*c,h.type,h.ratio),g.onUpdate(function(a){e.style.transform='translateX('.concat(a.translateX,'px)')}),g.loop()}},{key:'render',value:function a(){var b=this.props,c=b.style,d=b.children,e=b.textOverflow,f=b.title,g=b.renderType,h=this.state.translateX,i=this,j=Object.assign({},c,{left:'0',top:'0',color:this.props.__color__?this.props.__color__:c.color});return s.createElement(s.Fragment,null,c.percentBg&&c.percentBg.show&&c.percentBg.width&&s.createElement('div',{style:{position:'absolute',left:0,zIndex:'-1',display:'inline-block',background:c.percentBg.color,width:''.concat(c.percentBg.width,'%'),height:'100%'}}),s.createElement('div',{className:u.pr+' '+u['align-items-center']+' '+u[e],ref:function b(a){return i.dom=a},style:j,title:f||null},s.createElement('div',{className:u[e],style:{overflow:'sortBar'===g?'initial':'hidden',height:c.wrapLock?1.55*c.fontSize+'px':'auto',transform:'translate('.concat(c.left,'px, ').concat(c.top,'px)')}},s.createElement('div',{style:{paddingLeft:''.concat(c.left,'px'),display:'sortBar'===g?'flex':'bar'===g?'block':'inline-flex',alignItems:'center',justifyContent:'center'}},d),'text-overflow-marquee'===e&&0<h&&s.createElement('span',{style:{paddingLeft:10}},d))))}}])}(s.Component);return a.exports=v,a.exports});