(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d3e36"],{"5f4c":function(t,s,i){"use strict";i.r(s);var e=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"ibps-marquee",class:t.classes,on:{mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave}},[i("div",{staticClass:"ibps-marquee__scroll",style:t.scrollStyle},[i("div",{ref:"content",staticClass:"ibps-marquee__content"},[t._t("default")],2),i("div",{staticClass:"ibps-marquee__copy-content",domProps:{innerHTML:t._s(t.copyHtml)}})])])},o=[],n=(i("caad"),i("a9e3"),{name:"IbpsMarquee",props:{data:{type:Array,default:function(){return[]}},direction:{type:String,default:"up",validator:function(t){return["up","down","left","right"].includes(t)}},auto:{type:Boolean,default:!0},speed:{type:Number,default:1},waitTime:{type:Number,default:3e3},scrollLength:Number},data:function(){return this.timerId=null,{copyHtml:"",contentWidth:0,contentHeight:0,scrollPosition:0,isPause:!1}},computed:{isHorizontal:function(){return["left","right"].includes(this.direction)},classes:function(){return{"ibps-marquee--horizontal":this.isHorizontal}},scrollStyle:function(){return{transform:this.isHorizontal?"translate3d(-".concat(this.scrollPosition,"px, 0, 0)"):"translate3d(0, -".concat(this.scrollPosition,"px, 0)"),width:this.isHorizontal?"".concat(2*this.contentWidth,"px"):"100%"}}},watch:{data:{immediate:!0,handler:function(){this.$nextTick(this.renderCopyHtml)}}},mounted:function(){this.auto&&this.start()},beforeDestroy:function(){this.stop(),this.copyHtml=""},methods:{renderCopyHtml:function(){this.$refs.content&&(this.copyHtml=this.$refs.content.innerHTML,this.updateView())},updateView:function(){if(this.$refs.content){var t=this.$refs.content.getBoundingClientRect();this.contentHeight=t.height,this.contentWidth=t.width}},start:function(){switch(this.isPause=!1,this.direction){case"up":this.scrollPosition=this.scrollPosition||0,this.scrollUp();break;case"down":this.scrollPosition=this.scrollPosition||this.contentHeight,this.scrollDown();break;case"left":this.scrollPosition=this.scrollPosition||0,this.scrollLeft();break;case"right":this.scrollPosition=this.scrollPosition||this.contentWidth,this.scrollRight();break}},stop:function(){this.timerId&&clearTimeout(this.timerId),this.resumeId&&clearTimeout(this.resumeId)},pause:function(){this.isPause=!0},scrollUp:function(){var t=this;this.timerId=setTimeout((function(){t.isPause||(t.scrollPosition+=t.speed,t.resume()?t.isPause=!0:(t.scrollPosition>=t.contentHeight&&(t.scrollPosition=0),t.scrollUp()))}),1e3/60)},scrollDown:function(){var t=this;this.timerId=requestAnimationFrame((function(){t.isPause||(t.scrollPosition-=t.speed,t.resume()?t.isPause=!0:(t.scrollPosition<=0&&(t.scrollPosition=t.contentHeight),t.scrollDown()))}))},scrollLeft:function(){var t=this;this.timerId=requestAnimationFrame((function(){t.isPause||(t.scrollPosition+=t.speed,t.resume()?t.isPause=!0:(t.scrollPosition>=t.contentWidth&&(t.scrollPosition=0),t.scrollLeft()))}))},scrollRight:function(){var t=this;this.timerId=requestAnimationFrame((function(){t.isPause||(t.scrollPosition-=t.speed,t.resume()?t.isPause=!0:(t.scrollPosition<=0&&(t.scrollPosition=t.contentWidth),t.scrollRight()))}))},resume:function(){var t=this.scrollPosition%this.scrollLength===0;return t&&(this.resumeId&&clearTimeout(this.resumeId),this.resumeId=setTimeout(this.start,this.waitTime)),t},handleMouseEnter:function(){this.isPause=!0},handleMouseLeave:function(){this.start()}}}),r=n,l=i("2877"),c=Object(l["a"])(r,e,o,!1,null,null,null);s["default"]=c.exports}}]);