clmm-v2/public/themes/js/wheel.min.js
Nguyễn Tiến Dũng 96e0513959 1/5/2022
2022-05-01 22:01:12 +07:00

1 line
81 KiB
JavaScript

function Winwheel(t,e){for(var i in defaultOptions={canvasId:"canvas",centerX:null,centerY:null,outerRadius:null,innerRadius:0,numSegments:1,drawMode:"code",rotationAngle:0,textFontFamily:"Arial",textFontSize:20,textFontWeight:"bold",textOrientation:"horizontal",textAlignment:"center",textDirection:"normal",textMargin:null,textFillStyle:"black",textStrokeStyle:null,textLineWidth:1,fillStyle:"silver",strokeStyle:"black",lineWidth:1,clearTheCanvas:!0,imageOverlay:!1,drawText:!0,pointerAngle:0,wheelImage:null,imageDirection:"N",responsive:!1,scaleFactor:1},defaultOptions)this[i]=null!=t&&void 0!==t[i]?t[i]:defaultOptions[i];if(null!=t)for(var n in t)void 0===this[n]&&(this[n]=t[n]);for(this.canvasId&&(this.canvas=document.getElementById(this.canvasId))?(null==this.centerX&&(this.centerX=this.canvas.width/2),null==this.centerY&&(this.centerY=this.canvas.height/2),null==this.outerRadius&&(this.outerRadius=this.canvas.width<this.canvas.height?this.canvas.width/2-this.lineWidth:this.canvas.height/2-this.lineWidth),this.ctx=this.canvas.getContext("2d")):this.ctx=this.canvas=null,this.segments=Array(null),i=1;i<=this.numSegments;i++)this.segments[i]=null!=t&&t.segments&&void 0!==t.segments[i-1]?new Segment(t.segments[i-1]):new Segment;if(this.updateSegmentSizes(),null===this.textMargin&&(this.textMargin=this.textFontSize/1.7),this.animation=null!=t&&t.animation&&void 0!==t.animation?new Animation(t.animation):new Animation,null!=t&&t.pins&&void 0!==t.pins&&(this.pins=new Pin(t.pins)),"image"==this.drawMode||"segmentImage"==this.drawMode?(void 0===t.fillStyle&&(this.fillStyle=null),void 0===t.strokeStyle&&(this.strokeStyle="red"),void 0===t.drawText&&(this.drawText=!1),void 0===t.lineWidth&&(this.lineWidth=1),void 0===e&&(e=!1)):void 0===e&&(e=!0),this.pointerGuide=null!=t&&t.pointerGuide&&void 0!==t.pointerGuide?new PointerGuide(t.pointerGuide):new PointerGuide,this.responsive&&(winwheelToDrawDuringAnimation=this,this._originalCanvasWidth=this.canvas.width,this._originalCanvasHeight=this.canvas.height,this._responsiveScaleHeight=this.canvas.dataset.responsivescaleheight,this._responsiveMinWidth=this.canvas.dataset.responsiveminwidth,this._responsiveMinHeight=this.canvas.dataset.responsiveminheight,this._responsiveMargin=this.canvas.dataset.responsivemargin,window.addEventListener("load",winwheelResize),window.addEventListener("resize",winwheelResize)),1==e)this.draw(this.clearTheCanvas);else if("segmentImage"==this.drawMode)for(winwheelToDrawDuringAnimation=this,winhweelAlreadyDrawn=!1,i=1;i<=this.numSegments;i++)null!==this.segments[i].image&&(this.segments[i].imgData=new Image,this.segments[i].imgData.onload=winwheelLoadedImage,this.segments[i].imgData.src=this.segments[i].image)}function Pin(t){var e,i={visible:!0,number:36,outerRadius:3,fillStyle:"grey",strokeStyle:"black",lineWidth:1,margin:3,responsive:!1};for(e in i)this[e]=null!=t&&void 0!==t[e]?t[e]:i[e];if(null!=t)for(var n in t)void 0===this[n]&&(this[n]=t[n])}function Animation(t){var e,i={type:"spinOngoing",direction:"clockwise",propertyName:null,propertyValue:null,duration:10,yoyo:!1,repeat:null,easing:null,stopAngle:null,spins:null,clearTheCanvas:null,callbackFinished:null,callbackBefore:null,callbackAfter:null,callbackSound:null,soundTrigger:"segment"};for(e in i)this[e]=null!=t&&void 0!==t[e]?t[e]:i[e];if(null!=t)for(var n in t)void 0===this[n]&&(this[n]=t[n])}function Segment(t){var e,i={size:null,text:"",fillStyle:null,strokeStyle:null,lineWidth:null,textFontFamily:null,textFontSize:null,textFontWeight:null,textOrientation:null,textAlignment:null,textDirection:null,textMargin:null,textFillStyle:null,textStrokeStyle:null,textLineWidth:null,image:null,imageDirection:null,imgData:null};for(e in i)this[e]=null!=t&&void 0!==t[e]?t[e]:i[e];if(null!=t)for(var n in t)void 0===this[n]&&(this[n]=t[n]);this.endAngle=this.startAngle=0}function PointerGuide(t){var e,i={display:!1,strokeStyle:"red",lineWidth:3};for(e in i)this[e]=null!=t&&void 0!==t[e]?t[e]:i[e]}function winwheelPercentToDegrees(t){var e=0;return 0<t&&100>=t&&(e=t/100*360),e}function winwheelAnimationLoop(){if(winwheelToDrawDuringAnimation){0!=winwheelToDrawDuringAnimation.animation.clearTheCanvas&&winwheelToDrawDuringAnimation.ctx.clearRect(0,0,winwheelToDrawDuringAnimation.canvas.width,winwheelToDrawDuringAnimation.canvas.height);var a=winwheelToDrawDuringAnimation.animation.callbackBefore,c=winwheelToDrawDuringAnimation.animation.callbackAfter;null!=a&&("function"==typeof a?a():eval(a)),winwheelToDrawDuringAnimation.draw(!1),null!=c&&("function"==typeof c?c():eval(c)),winwheelToDrawDuringAnimation.animation.callbackSound&&winwheelTriggerSound()}}function winwheelTriggerSound(){0==winwheelToDrawDuringAnimation.hasOwnProperty("_lastSoundTriggerNumber")&&(winwheelToDrawDuringAnimation._lastSoundTriggerNumber=0);var a=winwheelToDrawDuringAnimation.animation.callbackSound,c="pin"==winwheelToDrawDuringAnimation.animation.soundTrigger?winwheelToDrawDuringAnimation.getCurrentPinNumber():winwheelToDrawDuringAnimation.getIndicatedSegmentNumber();c!=winwheelToDrawDuringAnimation._lastSoundTriggerNumber&&("function"==typeof a?a():eval(a),winwheelToDrawDuringAnimation._lastSoundTriggerNumber=c)}Winwheel.prototype.updateSegmentSizes=function(){if(this.segments){for(var t=0,e=0,i=1;i<=this.numSegments;i++)null!==this.segments[i].size&&(t+=this.segments[i].size,e++);for(i=360-t,t=0,0<i&&(t=i/(this.numSegments-e)),e=0,i=1;i<=this.numSegments;i++)this.segments[i].startAngle=e,e=this.segments[i].size?e+this.segments[i].size:e+t,this.segments[i].endAngle=e}},Winwheel.prototype.clearCanvas=function(){this.ctx&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},Winwheel.prototype.draw=function(t){this.ctx&&(void 0!==t?1==t&&this.clearCanvas():this.clearCanvas(),"image"==this.drawMode?(this.drawWheelImage(),1==this.drawText&&this.drawSegmentText(),1==this.imageOverlay&&this.drawSegments()):"segmentImage"==this.drawMode?(this.drawSegmentImages(),1==this.drawText&&this.drawSegmentText(),1==this.imageOverlay&&this.drawSegments()):(this.drawSegments(),1==this.drawText&&this.drawSegmentText()),void 0!==this.pins&&1==this.pins.visible&&this.drawPins(),1==this.pointerGuide.display&&this.drawPointerGuide())},Winwheel.prototype.drawPins=function(){if(this.pins&&this.pins.number){var t=this.centerX*this.scaleFactor,e=this.centerY*this.scaleFactor,i=this.outerRadius*this.scaleFactor,n=this.pins.outerRadius,r=this.pins.margin;this.pins.responsive&&(n=this.pins.outerRadius*this.scaleFactor,r=this.pins.margin*this.scaleFactor);for(var s=360/this.pins.number,a=1;a<=this.pins.number;a++)this.ctx.save(),this.ctx.strokeStyle=this.pins.strokeStyle,this.ctx.lineWidth=this.pins.lineWidth,this.ctx.fillStyle=this.pins.fillStyle,this.ctx.translate(t,e),this.ctx.rotate(this.degToRad(a*s+this.rotationAngle)),this.ctx.translate(-t,-e),this.ctx.beginPath(),this.ctx.arc(t,e-i+n+r,n,0,2*Math.PI),this.pins.fillStyle&&this.ctx.fill(),this.pins.strokeStyle&&this.ctx.stroke(),this.ctx.restore()}},Winwheel.prototype.drawPointerGuide=function(){if(this.ctx){var t=this.centerX*this.scaleFactor,e=this.centerY*this.scaleFactor,i=this.outerRadius*this.scaleFactor;this.ctx.save(),this.ctx.translate(t,e),this.ctx.rotate(this.degToRad(this.pointerAngle)),this.ctx.translate(-t,-e),this.ctx.strokeStyle=this.pointerGuide.strokeStyle,this.ctx.lineWidth=this.pointerGuide.lineWidth,this.ctx.beginPath(),this.ctx.moveTo(t,e),this.ctx.lineTo(t,-i/4),this.ctx.stroke(),this.ctx.restore()}},Winwheel.prototype.drawWheelImage=function(){if(null!=this.wheelImage){var t=this.centerX*this.scaleFactor,e=this.centerY*this.scaleFactor,i=this.wheelImage.width*this.scaleFactor,n=this.wheelImage.height*this.scaleFactor,r=t-i/2,s=e-n/2;this.ctx.save(),this.ctx.translate(t,e),this.ctx.rotate(this.degToRad(this.rotationAngle)),this.ctx.translate(-t,-e),this.ctx.drawImage(this.wheelImage,r,s,i,n),this.ctx.restore()}},Winwheel.prototype.drawSegmentImages=function(){if(this.ctx){var t=this.centerX*this.scaleFactor,e=this.centerY*this.scaleFactor;if(this.segments)for(var i=1;i<=this.numSegments;i++){var n=this.segments[i];if(n.imgData.height){var r=n.imgData.width*this.scaleFactor,s=n.imgData.height*this.scaleFactor,a=null!==n.imageDirection?n.imageDirection:this.imageDirection;if("S"==a){a=t-r/2;var o=e,h=n.startAngle+180+(n.endAngle-n.startAngle)/2}else"E"==a?(a=t,o=e-s/2,h=n.startAngle+270+(n.endAngle-n.startAngle)/2):"W"==a?(a=t-r,o=e-s/2,h=n.startAngle+90+(n.endAngle-n.startAngle)/2):(a=t-r/2,o=e-s,h=n.startAngle+(n.endAngle-n.startAngle)/2);this.ctx.save(),this.ctx.translate(t,e),this.ctx.rotate(this.degToRad(this.rotationAngle+h)),this.ctx.translate(-t,-e),this.ctx.drawImage(n.imgData,a,o,r,s),this.ctx.restore()}else console.log("Segment "+i+" imgData is not loaded")}}},Winwheel.prototype.drawSegments=function(){if(this.ctx&&this.segments)for(var t=this.centerX*this.scaleFactor,e=this.centerY*this.scaleFactor,i=this.innerRadius*this.scaleFactor,n=this.outerRadius*this.scaleFactor,r=1;r<=this.numSegments;r++){var s=this.segments[r],a=null!==s.fillStyle?s.fillStyle:this.fillStyle;this.ctx.fillStyle=a;var o=null!==s.lineWidth?s.lineWidth:this.lineWidth;this.ctx.lineWidth=o;var h=null!==s.strokeStyle?s.strokeStyle:this.strokeStyle;if((this.ctx.strokeStyle=h)||a){if(this.ctx.beginPath(),this.innerRadius){var l=Math.cos(this.degToRad(s.startAngle+this.rotationAngle-90))*(i-o/2);o=Math.sin(this.degToRad(s.startAngle+this.rotationAngle-90))*(i-o/2),this.ctx.moveTo(t+l,e+o)}else this.ctx.moveTo(t,e);this.ctx.arc(t,e,n,this.degToRad(s.startAngle+this.rotationAngle-90),this.degToRad(s.endAngle+this.rotationAngle-90),!1),this.innerRadius?this.ctx.arc(t,e,i,this.degToRad(s.endAngle+this.rotationAngle-90),this.degToRad(s.startAngle+this.rotationAngle-90),!0):this.ctx.lineTo(t,e),a&&this.ctx.fill(),h&&this.ctx.stroke()}}},Winwheel.prototype.drawSegmentText=function(){if(this.ctx)for(var t,e,i,n,r,s,a,o,h,l,u=this.centerX*this.scaleFactor,c=this.centerY*this.scaleFactor,f=this.outerRadius*this.scaleFactor,d=this.innerRadius*this.scaleFactor,p=1;p<=this.numSegments;p++){this.ctx.save();var g=this.segments[p];if(g.text){t=null!==g.textFontFamily?g.textFontFamily:this.textFontFamily,e=null!==g.textFontSize?g.textFontSize:this.textFontSize,i=null!==g.textFontWeight?g.textFontWeight:this.textFontWeight,n=null!==g.textOrientation?g.textOrientation:this.textOrientation,r=null!==g.textAlignment?g.textAlignment:this.textAlignment,s=null!==g.textDirection?g.textDirection:this.textDirection,a=null!==g.textMargin?g.textMargin:this.textMargin,o=null!==g.textFillStyle?g.textFillStyle:this.textFillStyle,h=null!==g.textStrokeStyle?g.textStrokeStyle:this.textStrokeStyle,l=null!==g.textLineWidth?g.textLineWidth:this.textLineWidth,e*=this.scaleFactor,a*=this.scaleFactor;var m="";for(null!=i&&(m+=i+" "),null!=e&&(m+=e+"px "),null!=t&&(m+=t),this.ctx.font=m,this.ctx.fillStyle=o,this.ctx.strokeStyle=h,this.ctx.lineWidth=l,i=-(t=g.text.split("\n")).length/2*e+e/2,"curved"!=n||"inner"!=r&&"outer"!=r||(i=0),l=0;l<t.length;l++){if("reversed"==s){if("horizontal"==n)this.ctx.textAlign="inner"==r?"right":"outer"==r?"left":"center",this.ctx.textBaseline="middle",m=this.degToRad(g.endAngle-(g.endAngle-g.startAngle)/2+this.rotationAngle-90-180),this.ctx.save(),this.ctx.translate(u,c),this.ctx.rotate(m),this.ctx.translate(-u,-c),"inner"==r?(o&&this.ctx.fillText(t[l],u-d-a,c+i),h&&this.ctx.strokeText(t[l],u-d-a,c+i)):"outer"==r?(o&&this.ctx.fillText(t[l],u-f+a,c+i),h&&this.ctx.strokeText(t[l],u-f+a,c+i)):(o&&this.ctx.fillText(t[l],u-d-(f-d)/2-a,c+i),h&&this.ctx.strokeText(t[l],u-d-(f-d)/2-a,c+i)),this.ctx.restore();else if("vertical"==n){this.ctx.textAlign="center",this.ctx.textBaseline="inner"==r?"top":"outer"==r?"bottom":"middle",m=g.endAngle-(g.endAngle-g.startAngle)/2-180,m+=this.rotationAngle,this.ctx.save(),this.ctx.translate(u,c),this.ctx.rotate(this.degToRad(m)),this.ctx.translate(-u,-c);var _=0;if("outer"==r?_=c+f-a:"inner"==r&&(_=c+d+a),m=e-e/9,"outer"==r)for(var v=t[l].length-1;0<=v;v--){var w=t[l].charAt(v);o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_-=m}else if("inner"==r)for(v=0;v<t[l].length;v++)w=t[l].charAt(v),o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_+=m;else if("center"==r)for(_=0,1<t[l].length&&(_=m*(t[l].length-1)/2),_=c+d+(f-d)/2+_+a,v=t[l].length-1;0<=v;v--)w=t[l].charAt(v),o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_-=m;this.ctx.restore()}else if("curved"==n)for(m=0,"inner"==r?(m=d+a,this.ctx.textBaseline="top"):"outer"==r?(m=f-a,this.ctx.textBaseline="bottom",m-=e*(t.length-1)):"center"==r&&(m=d+a+(f-d)/2,this.ctx.textBaseline="middle"),_=0,1<t[l].length?(this.ctx.textAlign="left",_=e/10*4,_*=100/m,v=g.startAngle+((g.endAngle-g.startAngle)/2-_*t[l].length/2)):(v=g.startAngle+(g.endAngle-g.startAngle)/2,this.ctx.textAlign="center"),v+=this.rotationAngle,v-=180,w=t[l].length;0<=w;w--){this.ctx.save();var x=t[l].charAt(w);this.ctx.translate(u,c),this.ctx.rotate(this.degToRad(v)),this.ctx.translate(-u,-c),h&&this.ctx.strokeText(x,u,c+m+i),o&&this.ctx.fillText(x,u,c+m+i),v+=_,this.ctx.restore()}}else if("horizontal"==n)this.ctx.textAlign="inner"==r?"left":"outer"==r?"right":"center",this.ctx.textBaseline="middle",m=this.degToRad(g.endAngle-(g.endAngle-g.startAngle)/2+this.rotationAngle-90),this.ctx.save(),this.ctx.translate(u,c),this.ctx.rotate(m),this.ctx.translate(-u,-c),"inner"==r?(o&&this.ctx.fillText(t[l],u+d+a,c+i),h&&this.ctx.strokeText(t[l],u+d+a,c+i)):"outer"==r?(o&&this.ctx.fillText(t[l],u+f-a,c+i),h&&this.ctx.strokeText(t[l],u+f-a,c+i)):(o&&this.ctx.fillText(t[l],u+d+(f-d)/2+a,c+i),h&&this.ctx.strokeText(t[l],u+d+(f-d)/2+a,c+i)),this.ctx.restore();else if("vertical"==n){if(this.ctx.textAlign="center",this.ctx.textBaseline="inner"==r?"bottom":"outer"==r?"top":"middle",m=g.endAngle-(g.endAngle-g.startAngle)/2,m+=this.rotationAngle,this.ctx.save(),this.ctx.translate(u,c),this.ctx.rotate(this.degToRad(m)),this.ctx.translate(-u,-c),_=0,"outer"==r?_=c-f+a:"inner"==r&&(_=c-d-a),m=e-e/9,"outer"==r)for(v=0;v<t[l].length;v++)w=t[l].charAt(v),o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_+=m;else if("inner"==r)for(v=t[l].length-1;0<=v;v--)w=t[l].charAt(v),o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_-=m;else if("center"==r)for(_=0,1<t[l].length&&(_=m*(t[l].length-1)/2),_=c-d-(f-d)/2-_-a,v=0;v<t[l].length;v++)w=t[l].charAt(v),o&&this.ctx.fillText(w,u+i,_),h&&this.ctx.strokeText(w,u+i,_),_+=m;this.ctx.restore()}else if("curved"==n)for(m=0,"inner"==r?(m=d+a,this.ctx.textBaseline="bottom",m+=e*(t.length-1)):"outer"==r?(m=f-a,this.ctx.textBaseline="top"):"center"==r&&(m=d+a+(f-d)/2,this.ctx.textBaseline="middle"),_=0,1<t[l].length?(this.ctx.textAlign="left",_=e/10*4,_*=100/m,v=g.startAngle+((g.endAngle-g.startAngle)/2-_*t[l].length/2)):(v=g.startAngle+(g.endAngle-g.startAngle)/2,this.ctx.textAlign="center"),v+=this.rotationAngle,w=0;w<t[l].length;w++)this.ctx.save(),x=t[l].charAt(w),this.ctx.translate(u,c),this.ctx.rotate(this.degToRad(v)),this.ctx.translate(-u,-c),h&&this.ctx.strokeText(x,u,c-m+i),o&&this.ctx.fillText(x,u,c-m+i),v+=_,this.ctx.restore();i+=e}}this.ctx.restore()}},Winwheel.prototype.degToRad=function(t){return.017453292519943295*t},Winwheel.prototype.setCenter=function(t,e){this.centerX=t,this.centerY=e},Winwheel.prototype.addSegment=function(t,e){var i=new Segment(t);if(this.numSegments++,void 0!==e){for(var n=this.numSegments;n>e;n--)this.segments[n]=this.segments[n-1];this.segments[e]=i,i=e}else this.segments[this.numSegments]=i,i=this.numSegments;return this.updateSegmentSizes(),this.segments[i]},Winwheel.prototype.setCanvasId=function(t){t?(this.canvasId=t,(this.canvas=document.getElementById(this.canvasId))&&(this.ctx=this.canvas.getContext("2d"))):this.canvas=this.ctx=this.canvasId=null},Winwheel.prototype.deleteSegment=function(t){if(1<this.numSegments){if(void 0!==t)for(;t<this.numSegments;t++)this.segments[t]=this.segments[t+1];this.segments[this.numSegments]=void 0,this.numSegments--,this.updateSegmentSizes()}},Winwheel.prototype.windowToCanvas=function(t,e){var i=this.canvas.getBoundingClientRect();return{x:Math.floor(t-this.canvas.width/i.width*i.left),y:Math.floor(e-this.canvas.height/i.height*i.top)}},Winwheel.prototype.getSegmentAt=function(t,e){var i=null,n=this.getSegmentNumberAt(t,e);return null!==n&&(i=this.segments[n]),i},Winwheel.prototype.getSegmentNumberAt=function(t,e){var i=this.windowToCanvas(t,e),n=this.centerX*this.scaleFactor,r=this.centerY*this.scaleFactor,s=this.outerRadius*this.scaleFactor,a=this.innerRadius*this.scaleFactor;if(i.x>n){var o=i.x-n;n="R"}else o=n-i.x,n="L";if(i.y>r){var h=i.y-r;r="B"}else h=r-i.y,r="T";var l=180*Math.atan(h/o)/Math.PI;for(i=0,o=Math.sqrt(h*h+o*o),"T"==r&&"R"==n?i=Math.round(90-l):"B"==r&&"R"==n?i=Math.round(l+90):"B"==r&&"L"==n?i=Math.round(90-l+180):"T"==r&&"L"==n&&(i=Math.round(l+270)),0!=this.rotationAngle&&(0>(i-=n=this.getRotationPosition())&&(i=360-Math.abs(i))),n=null,r=1;r<=this.numSegments;r++)if(i>=this.segments[r].startAngle&&i<=this.segments[r].endAngle&&o>=a&&o<=s){n=r;break}return n},Winwheel.prototype.getIndicatedSegment=function(){var t=this.getIndicatedSegmentNumber();return this.segments[t]},Winwheel.prototype.getIndicatedSegmentNumber=function(){var t=0,e=this.getRotationPosition();0>(e=Math.floor(this.pointerAngle-e))&&(e=360-Math.abs(e));for(var i=1;i<this.segments.length;i++)if(e>=this.segments[i].startAngle&&e<=this.segments[i].endAngle){t=i;break}return t},Winwheel.prototype.getCurrentPinNumber=function(){var t=0;if(this.pins){var e=this.getRotationPosition();0>(e=Math.floor(this.pointerAngle-e))&&(e=360-Math.abs(e));for(var i=360/this.pins.number,n=0,r=0;r<this.pins.number;r++){if(e>=n&&e<=n+i){t=r;break}n+=i}"clockwise"==this.animation.direction&&(++t>this.pins.number&&(t=0))}return t},Winwheel.prototype.getRotationPosition=function(){var t=this.rotationAngle;return 0<=t?360<t&&(t-=360*Math.floor(t/360)):(-360>t&&(t-=360*Math.ceil(t/360)),t=360+t),t},Winwheel.prototype.startAnimation=function(){if(this.animation){this.computeAnimation(),winwheelToDrawDuringAnimation=this;var t=Array(null);t[this.animation.propertyName]=this.animation.propertyValue,t.yoyo=this.animation.yoyo,t.repeat=this.animation.repeat,t.ease=this.animation.easing,t.onUpdate=winwheelAnimationLoop,t.onComplete=winwheelStopAnimation,this.tween=TweenMax.to(this,this.animation.duration,t)}},Winwheel.prototype.stopAnimation=function(t){winwheelToDrawDuringAnimation&&(winwheelToDrawDuringAnimation.tween&&winwheelToDrawDuringAnimation.tween.kill(),winwheelStopAnimation(t)),winwheelToDrawDuringAnimation=this},Winwheel.prototype.pauseAnimation=function(){this.tween&&this.tween.pause()},Winwheel.prototype.resumeAnimation=function(){this.tween&&this.tween.play()},Winwheel.prototype.computeAnimation=function(){this.animation&&("spinOngoing"==this.animation.type?(this.animation.propertyName="rotationAngle",null==this.animation.spins&&(this.animation.spins=5),null==this.animation.repeat&&(this.animation.repeat=-1),null==this.animation.easing&&(this.animation.easing="Linear.easeNone"),null==this.animation.yoyo&&(this.animation.yoyo=!1),this.animation.propertyValue=360*this.animation.spins,"anti-clockwise"==this.animation.direction&&(this.animation.propertyValue=0-this.animation.propertyValue)):"spinToStop"==this.animation.type?(this.animation.propertyName="rotationAngle",null==this.animation.spins&&(this.animation.spins=5),null==this.animation.repeat&&(this.animation.repeat=0),null==this.animation.easing&&(this.animation.easing="Power3.easeOut"),this.animation._stopAngle=null==this.animation.stopAngle?Math.floor(359*Math.random()):360-this.animation.stopAngle+this.pointerAngle,null==this.animation.yoyo&&(this.animation.yoyo=!1),this.animation.propertyValue=360*this.animation.spins,"anti-clockwise"==this.animation.direction?(this.animation.propertyValue=0-this.animation.propertyValue,this.animation.propertyValue-=360-this.animation._stopAngle):this.animation.propertyValue+=this.animation._stopAngle):"spinAndBack"==this.animation.type&&(this.animation.propertyName="rotationAngle",null==this.animation.spins&&(this.animation.spins=5),null==this.animation.repeat&&(this.animation.repeat=1),null==this.animation.easing&&(this.animation.easing="Power2.easeInOut"),null==this.animation.yoyo&&(this.animation.yoyo=!0),this.animation._stopAngle=null==this.animation.stopAngle?0:360-this.animation.stopAngle,this.animation.propertyValue=360*this.animation.spins,"anti-clockwise"==this.animation.direction?(this.animation.propertyValue=0-this.animation.propertyValue,this.animation.propertyValue-=360-this.animation._stopAngle):this.animation.propertyValue+=this.animation._stopAngle))},Winwheel.prototype.getRandomForSegment=function(t){var e=0;if(t)if(void 0!==this.segments[t]){var i=this.segments[t].startAngle;0<(t=this.segments[t].endAngle-i-2)?e=i+1+Math.floor(Math.random()*t):console.log("Segment size is too small to safely get random angle inside it")}else console.log("Segment "+t+" undefined");else console.log("Segment number not specified");return e},Segment.prototype.changeImage=function(t,e){this.image=t,this.imgData=null,e&&(this.imageDirection=e),winhweelAlreadyDrawn=!1,this.imgData=new Image,this.imgData.onload=winwheelLoadedImage,this.imgData.src=this.image};var winwheelToDrawDuringAnimation=null;function winwheelStopAnimation(a){0!=a&&(a=winwheelToDrawDuringAnimation.animation.callbackFinished,null!=a&&("function"==typeof a?a(winwheelToDrawDuringAnimation.getIndicatedSegment()):eval(a)))}var winhweelAlreadyDrawn=!1;function winwheelLoadedImage(){if(0==winhweelAlreadyDrawn){for(var t=0,e=1;e<=winwheelToDrawDuringAnimation.numSegments;e++)null!=winwheelToDrawDuringAnimation.segments[e].imgData&&winwheelToDrawDuringAnimation.segments[e].imgData.height&&t++;t==winwheelToDrawDuringAnimation.numSegments&&(winhweelAlreadyDrawn=!0,winwheelToDrawDuringAnimation.draw())}}function winwheelResize(){var t=40;void 0!==winwheelToDrawDuringAnimation._responsiveMargin&&(t=winwheelToDrawDuringAnimation._responsiveMargin);var e=window.innerWidth-t,i=winwheelToDrawDuringAnimation._responsiveMinWidth;t=winwheelToDrawDuringAnimation._responsiveMinHeight,e<i?e=i:e>winwheelToDrawDuringAnimation._originalCanvasWidth&&(e=winwheelToDrawDuringAnimation._originalCanvasWidth),e/=winwheelToDrawDuringAnimation._originalCanvasWidth,winwheelToDrawDuringAnimation.canvas.width=winwheelToDrawDuringAnimation._originalCanvasWidth*e,winwheelToDrawDuringAnimation._responsiveScaleHeight&&((i=winwheelToDrawDuringAnimation._originalCanvasHeight*e)<t?i=t:i>winwheelToDrawDuringAnimation._originalCanvasHeight&&(i=winwheelToDrawDuringAnimation._originalCanvasHeight),winwheelToDrawDuringAnimation.canvas.height=i),winwheelToDrawDuringAnimation.scaleFactor=e,winwheelToDrawDuringAnimation.draw()}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(t){"use strict";function e(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t){return"string"==typeof t}function r(t){return"function"==typeof t}function s(t){return"number"==typeof t}function a(t){return void 0===t}function o(t){return"object"==typeof t}function h(t){return!1!==t}function l(){return"undefined"!=typeof window}function u(t){return r(t)||n(t)}function c(t){return(wt=pe(t,se))&&fi}function f(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function d(t,e){return!e&&console.warn(t)}function p(t,e){return t&&(se[t]=e)&&wt&&(wt[t]=e)||se}function g(){return 0}function m(t){var e,i,n=t[0];if(o(n)||r(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(i=fe.length;i--&&!fe[i].targetTest(n););e=fe[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ie(t[i],e)))||t.splice(i,1);return t}function _(t){return t._gsap||m(we(t))[0]._gsap}function v(t,e,i){return(i=t[e])&&r(i)?t[e]():a(i)&&t.getAttribute&&t.getAttribute(e)||i}function w(t,e){return(t=t.split(",")).forEach(e)||t}function x(t){return Math.round(1e5*t)/1e5||0}function y(t,e){for(var i=e.length,n=0;t.indexOf(e[n])<0&&++n<i;);return n<i}function T(t,e,i){var n,r=s(t[1]),a=(r?2:1)+(e<2?0:1),o=t[a];if(r&&(o.duration=t[1]),o.parent=i,e){for(n=o;i&&!("immediateRender"in n);)n=i.vars.defaults||{},i=h(i.vars.inherit)&&i.parent;o.immediateRender=h(n.immediateRender),e<2?o.runBackwards=1:o.startAt=t[a-1]}return o}function A(){var t,e,i=oe.length,n=oe.slice(0);for(he={},t=oe.length=0;t<i;t++)(e=n[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function b(t,e,i,n){oe.length&&A(),t.render(e,i,n),oe.length&&A()}function D(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(ne).length<2?e:n(t)?t.trim():t}function S(t){return t}function k(t,e){for(var i in e)i in t||(t[i]=e[i]);return t}function M(t,e){for(var i in e)i in t||"duration"===i||"ease"===i||(t[i]=e[i])}function O(t,e){for(var i in e)"__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&(t[i]=o(e[i])?O(t[i]||(t[i]={}),e[i]):e[i]);return t}function F(t,e){var i,n={};for(i in t)i in e||(n[i]=t[i]);return n}function C(t){var e=t.parent||gt,i=t.keyframes?M:k;if(h(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t}function R(t,e,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=e._prev,s=e._next;r?r._next=s:t[i]===e&&(t[i]=s),s?s._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null}function P(t,e){!t.parent||e&&!t.parent.autoRemoveChildren||t.parent.remove(t),t._act=0}function z(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t}function W(t){return t._repeat?ge(t._tTime,t=t.duration()+t._rDelay)*t:0}function I(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function B(t){return t._end=x(t._start+(t._tDur/Math.abs(t._ts||t._rts||Vt)||0))}function E(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=x(i._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),B(t),i._dirty||z(i,t)),t}function L(t,e){var i;if((e._time||e._initted&&!e._dur)&&(i=I(t.rawTime(),e),(!e._dur||_e(0,e.totalDuration(),i)-e._tTime>Vt)&&e.render(i,!0)),z(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)0<=i.rawTime()&&i.totalTime(i._tTime),i=i._dp;t._zTime=-Vt}}function N(t,e,i,n){return e.parent&&P(e),e._start=x(i+e._delay),e._end=x(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),function(t,e,i,n,r){void 0===i&&(i="_first"),void 0===n&&(n="_last");var s,a=t[n];if(r)for(s=e[r];a&&a[r]>s;)a=a._prev;a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=a,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),t._recent=e,n||L(t,e),t}function Y(t,e){return(se.ScrollTrigger||f("scrollTrigger",e))&&se.ScrollTrigger.create(e,t)}function X(t,e,i,n){return Ve(t,e),t._initted?!i&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&yt!==Se.frame?(oe.push(t),t._lazy=[e,n],1):void 0:1}function V(t,e,i,n){var r=t._repeat,s=x(e)||0,a=t._tTime/t._tDur;return a&&!n&&(t._time*=s/t._dur),t._dur=s,t._tDur=r?r<0?1e10:x(s*(r+1)+t._rDelay*r):s,a&&!n?E(t,t._tTime=t._tDur*a):t.parent&&B(t),i||z(t.parent,t),t}function U(t){return t instanceof Le?z(t):V(t,t._dur)}function G(t,e){var i,r,s=t.labels,a=t._recent||me,o=t.duration()>=Xt?a.endTime(!1):t._dur;return n(e)&&(isNaN(e)||e in s)?"<"===(i=e.charAt(0))||">"===i?("<"===i?a._start:a.endTime(0<=a._repeat))+(parseFloat(e.substr(1))||0):(i=e.indexOf("="))<0?(e in s||(s[e]=o),s[e]):(r=+(e.charAt(i-1)+e.substr(i+1)),1<i?G(t,e.substr(0,i-1))+r:o+r):null==e?o:+e}function q(t,e){return t||0===t?e(t):e}function H(t){if("string"!=typeof t)return"";var e=re.exec(t);return e?t.substr(e.index+e[0].length):""}function j(t,e){return t&&o(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&o(t[0]))&&!t.nodeType&&t!==mt}function Q(t){return t.sort(function(){return.5-Math.random()})}function Z(t){if(r(t))return t;var e=o(t)?t:{each:t},i=Re(e.ease),s=e.from||0,a=parseFloat(e.base)||0,h={},l=0<s&&s<1,u=isNaN(s)||l,c=e.axis,f=s,d=s;return n(s)?f=d={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],d=s[1]),function(t,n,r){var o,l,p,g,m,_,v,w,y,T=(r||e).length,A=h[T];if(!A){if(!(y="auto"===e.grid?0:(e.grid||[1,Xt])[1])){for(v=-Xt;v<(v=r[y++].getBoundingClientRect().left)&&y<T;);y--}for(A=h[T]=[],o=u?Math.min(y,T)*f-.5:s%y,l=u?T*d/y-.5:s/y|0,w=Xt,_=v=0;_<T;_++)p=_%y-o,g=l-(_/y|0),A[_]=m=c?Math.abs("y"===c?g:p):Ht(p*p+g*g),v<m&&(v=m),m<w&&(w=m);"random"===s&&Q(A),A.max=v-w,A.min=w,A.v=T=(parseFloat(e.amount)||parseFloat(e.each)*(T<y?T-1:c?"y"===c?T/y:y:Math.max(y,T/y))||0)*("edges"===s?-1:1),A.b=T<0?a-T:a,A.u=H(e.amount||e.each)||0,i=i&&T<0?Ce(i):i}return T=(A[t]-A.min)/A.max||0,x(A.b+(i?i(T):T)*A.v)+A.u}}function $(t){var e=t<1?Math.pow(10,(t+"").length-2):1;return function(i){var n=Math.round(parseFloat(i)/t)*t*e;return(n-n%1)/e+(s(i)?0:H(i))}}function J(t,e){var i,n,a=$t(t);return!a&&o(t)&&(i=a=t.radius||Xt,t.values?(t=we(t.values),(n=!s(t[0]))&&(i*=i)):t=$(t.increment)),q(e,a?r(t)?function(e){return n=t(e),Math.abs(n-e)<=i?n:e}:function(e){for(var r,a,o=parseFloat(n?e.x:e),h=parseFloat(n?e.y:0),l=Xt,u=0,c=t.length;c--;)(r=n?(r=t[c].x-o)*r+(a=t[c].y-h)*a:Math.abs(t[c]-o))<l&&(l=r,u=c);return u=!i||l<=i?t[u]:e,n||u===e||s(e)?u:u+H(e)}:$(t))}function K(t,e,i,n){return q($t(t)?!e:!0===i?!!(i=0):!n,function(){return $t(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+.99*i))/i)*i*n)/n})}function tt(t,e,i){return q(i,function(i){return t[~~e(i)]})}function et(t){for(var e,i,n,r,s=0,a="";~(e=t.indexOf("random(",s));)n=t.indexOf(")",e),r="["===t.charAt(e+7),i=t.substr(e+7,n-e-7).match(r?ne:Jt),a+=t.substr(s,e-s)+K(r?i:+i[0],r?0:+i[1],+i[2]||1e-5),s=n+1;return a+t.substr(s,t.length-s)}function it(t,e,i){var n,r,s,a=t.labels,o=Xt;for(n in a)(r=a[n]-e)<0==!!i&&r&&o>(r=Math.abs(r))&&(s=n,o=r);return s}function nt(t){return P(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&ye(t,"onInterrupt"),t}function rt(t,e,i){return(6*(t=t<0?t+1:1<t?t-1:t)<1?e+(i-e)*t*6:t<.5?i:3*t<2?e+(i-e)*(2/3-t)*6:e)*Te+.5|0}function st(t,e,i){var n,r,a,o,h,l,u,c,f,d,p=t?s(t)?[t>>16,t>>8&Te,t&Te]:0:Ae.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),Ae[t])p=Ae[t];else if("#"===t.charAt(0)){if(t.length<6&&(t="#"+(n=t.charAt(1))+n+(r=t.charAt(2))+r+(a=t.charAt(3))+a+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&Te,p&Te,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&Te,t&Te]}else if("hsl"===t.substr(0,3))if(p=d=t.match(Jt),e){if(~t.indexOf("="))return p=t.match(Kt),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,h=p[1]/100,n=2*(l=p[2]/100)-(r=l<=.5?l*(h+1):l+h-l*h),3<p.length&&(p[3]*=1),p[0]=rt(o+1/3,n,r),p[1]=rt(o,n,r),p[2]=rt(o-1/3,n,r);else p=t.match(Jt)||Ae.transparent;p=p.map(Number)}return e&&!d&&(n=p[0]/Te,r=p[1]/Te,a=p[2]/Te,l=((u=Math.max(n,r,a))+(c=Math.min(n,r,a)))/2,u===c?o=h=0:(f=u-c,h=.5<l?f/(2-u-c):f/(u+c),o=u===n?(r-a)/f+(r<a?6:0):u===r?(a-n)/f+2:(n-r)/f+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*h+.5),p[2]=~~(100*l+.5)),i&&p.length<4&&(p[3]=1),p}function at(t){var e=[],i=[],n=-1;return t.split(be).forEach(function(t){var r=t.match(te)||[];e.push.apply(e,r),i.push(n+=r.length+1)}),e.c=i,e}function ot(t,e,i){var n,r,s,a,o="",h=(t+o).match(be),l=e?"hsla(":"rgba(",u=0;if(!h)return t;if(h=h.map(function(t){return(t=st(t,e,1))&&l+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),i&&(s=at(t),(n=i.c).join(o)!==s.c.join(o)))for(a=(r=t.replace(be,"1").split(te)).length-1;u<a;u++)o+=r[u]+(~n.indexOf(u)?h.shift()||l+"0,0,0,0)":(s.length?s:h.length?h:i).shift());if(!r)for(a=(r=t.split(be)).length-1;u<a;u++)o+=r[u]+h[u];return o+r[a]}function ht(t){var e,i=t.join(" ");if(be.lastIndex=0,be.test(i))return e=De.test(i),t[1]=ot(t[1],e),t[0]=ot(t[0],e,at(t[1])),!0}function lt(t,e){for(var i,n=t._first;n;)n instanceof Le?lt(n,e):!n.vars.yoyoEase||n._yoyo&&n._repeat||n._yoyo===e||(n.timeline?lt(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next}function ut(t,e,i,n){void 0===i&&(i=function(t){return 1-e(1-t)}),void 0===n&&(n=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var r,s={easeIn:e,easeOut:i,easeInOut:n};return w(t,function(t){for(var e in Me[t]=se[t]=s,Me[r=t.toLowerCase()]=i,s)Me[r+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Me[t+"."+e]=s[e]}),s}function ct(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}}function ft(t,e,i){function n(t){return 1===t?1:r*Math.pow(2,-10*t)*Qt((t-a)*s)+1}var r=1<=e?e:1,s=(i||(t?.3:.45))/(e<1?e:1),a=s/Ut*(Math.asin(1/r)||0),o="out"===t?n:"in"===t?function(t){return 1-n(1-t)}:ct(n);return s=Ut/s,o.config=function(e,i){return ft(t,e,i)},o}function dt(t,e){function i(t){return t?--t*t*((e+1)*t+e)+1:0}void 0===e&&(e=1.70158);var n="out"===t?i:"in"===t?function(t){return 1-i(1-t)}:ct(i);return n.config=function(e){return dt(t,e)},n}var pt,gt,mt,_t,vt,wt,xt,yt,Tt,At,bt,Dt,St,kt,Mt,Ot,Ft,Ct,Rt,Pt,zt,Wt,It,Bt,Et,Lt,Nt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Yt={duration:.5,overwrite:!1,delay:0},Xt=1e8,Vt=1/Xt,Ut=2*Math.PI,Gt=Ut/4,qt=0,Ht=Math.sqrt,jt=Math.cos,Qt=Math.sin,Zt="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$t=Array.isArray,Jt=/(?:-?\.?\d|\.)+/gi,Kt=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,te=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ee=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ie=/[+-]=-?[.\d]+/,ne=/[#\-+.]*\b[a-z\d-=+%.]+/gi,re=/[\d.+\-=]+(?:e[-+]\d*)*/i,se={},ae={},oe=[],he={},le={},ue={},ce=30,fe=[],de="",pe=function(t,e){for(var i in e)t[i]=e[i];return t},ge=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},me={_start:0,endTime:g},_e=function(t,e,i){return i<t?t:e<i?e:i},ve=[].slice,we=function(t,e){return!n(t)||e||!_t&&ke()?$t(t)?function(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return n(t)&&!e||j(t,1)?i.push.apply(i,we(t)):i.push(t)})||i}(t,e):j(t)?ve.call(t,0):t?[t]:[]:ve.call(vt.querySelectorAll(t),0)},xe=function(t,e,i,n,r){var s=e-t,a=n-i;return q(r,function(e){return i+((e-t)/s*a||0)})},ye=function(t,e,i){var n,r,s=t.vars,a=s[e];if(a)return n=s[e+"Params"],r=s.callbackScope||t,i&&oe.length&&A(),n?a.apply(r,n):a.call(r)},Te=255,Ae={aqua:[0,Te,Te],lime:[0,Te,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Te],navy:[0,0,128],white:[Te,Te,Te],olive:[128,128,0],yellow:[Te,Te,0],orange:[Te,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Te,0,0],pink:[Te,192,203],cyan:[0,Te,Te],transparent:[Te,Te,Te,0]},be=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Ae)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),De=/hsl[a]?\(/,Se=(Ft=Date.now,Ct=500,Rt=33,Pt=Ft(),zt=Pt,It=Wt=1e3/240,kt={time:0,frame:0,tick:function(){Pe(!0)},deltaRatio:function(t){return Mt/(1e3/(t||60))},wake:function(){xt&&(!_t&&l()&&(mt=_t=window,vt=mt.document||{},se.gsap=fi,(mt.gsapVersions||(mt.gsapVersions=[])).push(fi.version),c(wt||mt.GreenSockGlobals||!mt.gsap&&mt||{}),St=mt.requestAnimationFrame),bt&&kt.sleep(),Dt=St||function(t){return setTimeout(t,It-1e3*kt.time+1|0)},At=1,Pe(2))},sleep:function(){(St?mt.cancelAnimationFrame:clearTimeout)(bt),At=0,Dt=g},lagSmoothing:function(t,e){Ct=t||1e8,Rt=Math.min(e,Ct,0)},fps:function(t){Wt=1e3/(t||240),It=1e3*kt.time+Wt},add:function(t){Bt.indexOf(t)<0&&Bt.push(t),ke()},remove:function(t){var e;~(e=Bt.indexOf(t))&&Bt.splice(e,1)&&e<=Ot&&Ot--},_listeners:Bt=[]}),ke=function(){return!At&&Se.wake()},Me={},Oe=/^[\d.\-M][\d.\-,\s]/,Fe=/["']/g,Ce=function(t){return function(e){return 1-t(1-e)}},Re=function(t,e){return t&&(r(t)?t:Me[t]||function(t){var e=(t+"").split("("),i=Me[e[0]];return i&&1<e.length&&i.config?i.config.apply(null,~t.indexOf("{")?[function(t){for(var e,i,n,r={},s=t.substr(1,t.length-3).split(":"),a=s[0],o=1,h=s.length;o<h;o++)i=s[o],e=o!==h-1?i.lastIndexOf(","):i.length,n=i.substr(0,e),r[a]=isNaN(n)?n.replace(Fe,"").trim():+n,a=i.substr(e+1).trim();return r}(e[1])]:function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),n=t.indexOf("(",e);return t.substring(e,~n&&n<i?t.indexOf(")",i+1):i)}(t).split(",").map(D)):Me._CE&&Oe.test(t)?Me._CE("",t):i}(t))||e};function Pe(t){var e,i,n,r,s=Ft()-zt,a=!0===t;if(Ct<s&&(Pt+=s-Rt),(0<(e=(n=(zt+=s)-Pt)-It)||a)&&(r=++kt.frame,Mt=n-1e3*kt.time,kt.time=n/=1e3,It+=e+(Wt<=e?4:Wt-e),i=1),a||(bt=Dt(Pe)),i)for(Ot=0;Ot<Bt.length;Ot++)Bt[Ot](n,Mt,r,t)}function ze(t){return t<Lt?Et*t*t:t<.7272727272727273?Et*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?Et*(t-=2.25/2.75)*t+.9375:Et*Math.pow(t-2.625/2.75,2)+.984375}w("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var i=e<5?e+1:e;ut(t+",Power"+(i-1),e?function(t){return Math.pow(t,i)}:function(t){return t},function(t){return 1-Math.pow(1-t,i)},function(t){return t<.5?Math.pow(2*t,i)/2:1-Math.pow(2*(1-t),i)/2})}),Me.Linear.easeNone=Me.none=Me.Linear.easeIn,ut("Elastic",ft("in"),ft("out"),ft()),Et=7.5625,Lt=1/2.75,ut("Bounce",function(t){return 1-ze(1-t)},ze),ut("Expo",function(t){return t?Math.pow(2,10*(t-1)):0}),ut("Circ",function(t){return-(Ht(1-t*t)-1)}),ut("Sine",function(t){return 1===t?1:1-jt(t*Gt)}),ut("Back",dt("in"),dt("out"),dt()),Me.SteppedEase=Me.steps=se.SteppedEase={config:function(t,e){void 0===t&&(t=1);var i=1/t,n=t+(e?0:1),r=e?1:0;return function(t){return((n*_e(0,.99999999,t)|0)+r)*i}}},Yt.ease=Me["quad.out"],w("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return de+=t+","+t+"Params,"});var We,Ie=function(t,e){this.id=qt++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:v,this.set=e?e.getSetter:Ke},Be=((We=Ee.prototype).delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},We.duration=function(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},We.totalDuration=function(t){return arguments.length?(this._dirty=0,V(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},We.totalTime=function(t,e){if(ke(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(E(this,t),!i._dp||i.parent||L(i,this);i.parent;)i.parent._time!==i._start+(0<=i._ts?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&N(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===Vt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),b(this,t,e)),this},We.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+W(this))%this._dur||(t?this._dur:0),e):this._time},We.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},We.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+W(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},We.iteration=function(t,e){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,e):this._repeat?ge(this._tTime,i)+1:1},We.timeScale=function(t){if(!arguments.length)return this._rts===-Vt?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?I(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Vt?0:this._rts,function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this.totalTime(_e(-this._delay,this._tDur,e),!0))},We.paused=function(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ke(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&(this._tTime-=Vt)&&Math.abs(this._zTime)!==Vt))),this):this._ps},We.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return!e||!e._sort&&this.parent||N(e,this,t-this._delay),this}return this._start},We.endTime=function(t){return this._start+(h(t)?this.totalDuration():this.duration())/Math.abs(this._ts)},We.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?I(e.rawTime(t),this):this._tTime:this._tTime},We.globalTime=function(t){for(var e=this,i=arguments.length?t:e.rawTime();e;)i=e._start+i/(e._ts||1),e=e._dp;return i},We.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,U(this)):-2===this._repeat?1/0:this._repeat},We.repeatDelay=function(t){return arguments.length?(this._rDelay=t,U(this)):this._rDelay},We.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},We.seek=function(t,e){return this.totalTime(G(this,t),h(e))},We.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,h(e))},We.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},We.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},We.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},We.resume=function(){return this.paused(!1)},We.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Vt:0)),this):this._rts<0},We.invalidate=function(){return this._initted=this._act=0,this._zTime=-Vt,this},We.isActive=function(){var t,e=this.parent||this._dp,i=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<this.endTime(!0)-Vt))},We.eventCallback=function(t,e,i){var n=this.vars;return 1<arguments.length?(e?(n[t]=e,i&&(n[t+"Params"]=i),"onUpdate"===t&&(this._onUpdate=e)):delete n[t],this):n[t]},We.then=function(t){var e=this;return new Promise(function(i){function n(){var t=e.then;e.then=null,r(s)&&(s=s(e))&&(s.then||s===e)&&(e.then=t),i(s),e.then=t}var s=r(t)?t:S;e._initted&&1===e.totalProgress()&&0<=e._ts||!e._tTime&&e._ts<0?n():e._prom=n})},We.kill=function(){nt(this)},Ee);function Ee(t,e){var i=t.parent||gt;this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,V(this,+t.duration,1,1),this.data=t.data,At||Se.wake(),i&&N(i,this,e||0===e?e:i._time,1),t.reversed&&this.reverse(),t.paused&&this.paused(!0)}k(Be.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Vt,_prom:0,_ps:!1,_rts:1});var Le=function(t){function a(e,n){var r;return void 0===e&&(e={}),(r=t.call(this,e,n)||this).labels={},r.smoothChildTiming=!!e.smoothChildTiming,r.autoRemoveChildren=!!e.autoRemoveChildren,r._sort=h(e.sortChildren),r.parent&&L(r.parent,i(r)),e.scrollTrigger&&Y(i(r),e.scrollTrigger),r}e(a,t);var o=a.prototype;return o.to=function(t,e,i,n){return new He(t,T(arguments,0,this),G(this,s(e)?n:i)),this},o.from=function(t,e,i,n){return new He(t,T(arguments,1,this),G(this,s(e)?n:i)),this},o.fromTo=function(t,e,i,n,r){return new He(t,T(arguments,2,this),G(this,s(e)?r:n)),this},o.set=function(t,e,i){return e.duration=0,e.parent=this,C(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new He(t,e,G(this,i),1),this},o.call=function(t,e,i){return N(this,He.delayedCall(0,t,e),G(this,i))},o.staggerTo=function(t,e,i,n,r,s,a){return i.duration=e,i.stagger=i.stagger||n,i.onComplete=s,i.onCompleteParams=a,i.parent=this,new He(t,i,G(this,r)),this},o.staggerFrom=function(t,e,i,n,r,s,a){return i.runBackwards=1,C(i).immediateRender=h(i.immediateRender),this.staggerTo(t,e,i,n,r,s,a)},o.staggerFromTo=function(t,e,i,n,r,s,a,o){return n.startAt=i,C(n).immediateRender=h(n.immediateRender),this.staggerTo(t,e,n,r,s,a,o)},o.render=function(t,e,i){var n,r,s,a,o,h,l,u,c,f,d,p,g=this._time,m=this._dirty?this.totalDuration():this._tDur,_=this._dur,v=this!==gt&&m-Vt<t&&0<=t?m:t<Vt?0:t,w=this._zTime<0!=t<0&&(this._initted||!_);if(v!==this._tTime||i||w){if(g!==this._time&&_&&(v+=this._time-g,t+=this._time-g),n=v,c=this._start,h=!(u=this._ts),w&&(_||(g=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(d=this._yoyo,o=_+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,i);if(n=x(v%o),v===m?(a=this._repeat,n=_):((a=~~(v/o))&&a===v/o&&(n=_,a--),_<n&&(n=_)),f=ge(this._tTime,o),!g&&this._tTime&&f!==a&&(f=a),d&&1&a&&(n=_-n,p=1),a!==f&&!this._lock){var y=d&&1&f,T=y===(d&&1&a);if(a<f&&(y=!y),g=y?0:_,this._lock=1,this.render(g||(p?0:x(a*o)),e,!_)._lock=0,!e&&this.parent&&ye(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1),g&&g!==this._time||h!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(_=this._dur,m=this._tDur,T&&(this._lock=2,g=y?_:-1e-4,this.render(g,!0)),this._lock=0,!this._ts&&!h)return this;lt(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(l=function(t,e,i){var n;if(e<i)for(n=t._first;n&&n._start<=i;){if(!n._dur&&"isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if(!n._dur&&"isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,x(g),x(n)))&&(v-=n-(n=l._start)),this._tTime=v,this._time=n,this._act=!u,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,g=0),g||!n||e||ye(this,"onStart"),g<=n&&0<=t)for(r=this._first;r;){if(s=r._next,(r._act||n>=r._start)&&r._ts&&l!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(0<r._ts?(n-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(n-r._start)*r._ts,e,i),n!==this._time||!this._ts&&!h){l=0,s&&(v+=this._zTime=-Vt);break}}r=s}else{r=this._last;for(var A=t<0?t:n;r;){if(s=r._prev,(r._act||A<=r._end)&&r._ts&&l!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(0<r._ts?(A-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(A-r._start)*r._ts,e,i),n!==this._time||!this._ts&&!h){l=0,s&&(v+=this._zTime=A?-Vt:Vt);break}}r=s}}if(l&&!e&&(this.pause(),l.render(g<=n?0:-Vt)._zTime=g<=n?1:-1,this._ts))return this._start=c,B(this),this.render(t,e,i);this._onUpdate&&!e&&ye(this,"onUpdate",!0),(v===m&&m>=this.totalDuration()||!v&&g)&&(c!==this._start&&Math.abs(u)===Math.abs(this._ts)||this._lock||(!t&&_||!(v===m&&0<this._ts||!v&&this._ts<0)||P(this,1),e||t<0&&!g||!v&&!g||(ye(this,v===m?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},o.add=function(t,e){var i=this;if(s(e)||(e=G(this,e)),!(t instanceof Be)){if($t(t))return t.forEach(function(t){return i.add(t,e)}),this;if(n(t))return this.addLabel(t,e);if(!r(t))return this;t=He.delayedCall(0,t)}return this!==t?N(this,t,e):this},o.getChildren=function(t,e,i,n){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=-Xt);for(var r=[],s=this._first;s;)s._start>=n&&(s instanceof He?e&&r.push(s):(i&&r.push(s),t&&r.push.apply(r,s.getChildren(!0,e,i)))),s=s._next;return r},o.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},o.remove=function(t){return n(t)?this.removeLabel(t):r(t)?this.killTweensOf(t):(R(this,t),t===this._recent&&(this._recent=this._last),z(this))},o.totalTime=function(e,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=x(Se.time-(0<this._ts?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,i),this._forcing=0,this):this._tTime},o.addLabel=function(t,e){return this.labels[t]=G(this,e),this},o.removeLabel=function(t){return delete this.labels[t],this},o.addPause=function(t,e,i){var n=He.delayedCall(0,e||g,i);return n.data="isPause",this._hasPause=1,N(this,n,G(this,t))},o.removePause=function(t){var e=this._first;for(t=G(this,t);e;)e._start===t&&"isPause"===e.data&&P(e),e=e._next},o.killTweensOf=function(t,e,i){for(var n=this.getTweensOf(t,i),r=n.length;r--;)Ye!==n[r]&&n[r].kill(t,e);return this},o.getTweensOf=function(t,e){for(var i,n=[],r=we(t),a=this._first,o=s(e);a;)a instanceof He?y(a._targets,r)&&(o?(!Ye||a._initted&&a._ts)&&a.globalTime(0)<=e&&a.globalTime(a.totalDuration())>e:!e||a.isActive())&&n.push(a):(i=a.getTweensOf(r,e)).length&&n.push.apply(n,i),a=a._next;return n},o.tweenTo=function(t,e){e=e||{};var i=this,n=G(i,t),r=e.startAt,s=e.onStart,a=e.onStartParams,o=e.immediateRender,h=He.to(i,k({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(r&&"time"in r?r.time:i._time))/i.timeScale())||Vt,onStart:function(){i.pause();var t=e.duration||Math.abs((n-i._time)/i.timeScale());h._dur!==t&&V(h,t,0,1).render(h._time,!0,!0),s&&s.apply(h,a||[])}},e));return o?h.render(0):h},o.tweenFromTo=function(t,e,i){return this.tweenTo(e,k({startAt:{time:G(this,t)}},i))},o.recent=function(){return this._recent},o.nextLabel=function(t){return void 0===t&&(t=this._time),it(this,G(this,t))},o.previousLabel=function(t){return void 0===t&&(t=this._time),it(this,G(this,t),1)},o.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+Vt)},o.shiftChildren=function(t,e,i){void 0===i&&(i=0);for(var n,r=this._first,s=this.labels;r;)r._start>=i&&(r._start+=t,r._end+=t),r=r._next;if(e)for(n in s)s[n]>=i&&(s[n]+=t);return z(this)},o.invalidate=function(){var e=this._first;for(this._lock=0;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},o.clear=function(t){void 0===t&&(t=!0);for(var e,i=this._first;i;)e=i._next,this.remove(i),i=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),z(this)},o.totalDuration=function(t){var e,i,n,r=0,s=this,a=s._last,o=Xt;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(n=s.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),o<(i=a._start)&&s._sort&&a._ts&&!s._lock?(s._lock=1,N(s,a,i-a._delay,1)._lock=0):o=i,i<0&&a._ts&&(r-=i,(!n&&!s._dp||n&&n.smoothChildTiming)&&(s._start+=i/s._ts,s._time-=i,s._tTime-=i),s.shiftChildren(-i,!1,-1/0),o=0),a._end>r&&a._ts&&(r=a._end),a=e;V(s,s===gt&&s._time>r?s._time:r,1,1),s._dirty=0}return s._tDur},a.updateRoot=function(t){if(gt._ts&&(b(gt,I(t,gt)),yt=Se.frame),Se.frame>=ce){ce+=Nt.autoSleep||120;var e=gt._first;if((!e||!e._ts)&&Nt.autoSleep&&Se._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Se.sleep()}}},a}(Be);function Ne(t,e,i,s,a,h){var l,u,c,f;if(le[t]&&!1!==(l=new le[t]).init(a,l.rawVars?e[t]:function(t,e,i,s,a){if(r(t)&&(t=Ue(t,a,e,i,s)),!o(t)||t.style&&t.nodeType||$t(t)||Zt(t))return n(t)?Ue(t,a,e,i,s):t;var h,l={};for(h in t)l[h]=Ue(t[h],a,e,i,s);return l}(e[t],s,a,h,i),i,s,h)&&(i._pt=u=new oi(i._pt,a,t,0,1,l.render,l,0,l.priority),i!==Tt))for(c=i._ptLookup[i._targets.indexOf(a)],f=l._props.length;f--;)c[l._props[f]]=u;return l}k(Le.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ye,Xe=function(t,e,i,s,a,o,h,l,u){r(s)&&(s=s(a||0,t,o));var c,d=t[e],p="get"!==i?i:r(d)?u?t[e.indexOf("set")||!r(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():d,g=r(d)?u?Je:$e:Ze;if(n(s)&&(~s.indexOf("random(")&&(s=et(s)),"="===s.charAt(1)&&(s=parseFloat(p)+parseFloat(s.substr(2))*("-"===s.charAt(0)?-1:1)+(H(p)||0))),p!==s)return isNaN(p*s)?(d||e in t||f(e,s),function(t,e,i,n,r,s,a){var o,h,l,u,c,f,d,p,g=new oi(this._pt,t,e,0,1,ii,null,r),m=0,_=0;for(g.b=i,g.e=n,i+="",(d=~(n+="").indexOf("random("))&&(n=et(n)),s&&(s(p=[i,n],t,e),i=p[0],n=p[1]),h=i.match(ee)||[];o=ee.exec(n);)u=o[0],c=n.substring(m,o.index),l?l=(l+1)%5:"rgba("===c.substr(-5)&&(l=1),u!==h[_++]&&(f=parseFloat(h[_-1])||0,g._pt={_next:g._pt,p:c||1===_?c:",",s:f,c:"="===u.charAt(1)?parseFloat(u.substr(2))*("-"===u.charAt(0)?-1:1):parseFloat(u)-f,m:l&&l<4?Math.round:0},m=ee.lastIndex);return g.c=m<n.length?n.substring(m,n.length):"",g.fp=a,(ie.test(n)||d)&&(g.e=0),this._pt=g}.call(this,t,e,p,s,g,l||Nt.stringFilter,u)):(c=new oi(this._pt,t,e,+p||0,s-(p||0),"boolean"==typeof d?ei:ti,0,g),u&&(c.fp=u),h&&c.modifier(h,this,t),this._pt=c)},Ve=function t(e,i){var n,r,s,a,o,l,u,c,f,d,p,g,v,w=e.vars,x=w.ease,y=w.startAt,T=w.immediateRender,b=w.lazy,D=w.onUpdate,S=w.onUpdateParams,M=w.callbackScope,O=w.runBackwards,C=w.yoyoEase,R=w.keyframes,z=w.autoRevert,W=e._dur,I=e._startAt,B=e._targets,E=e.parent,L=E&&"nested"===E.data?E.parent._targets:B,N="auto"===e._overwrite&&!pt,Y=e.timeline;if(!Y||R&&x||(x="none"),e._ease=Re(x,Yt.ease),e._yEase=C?Ce(Re(!0===C?x:C,Yt.ease)):0,C&&e._yoyo&&!e._repeat&&(C=e._yEase,e._yEase=e._ease,e._ease=C),!Y){if(g=(c=B[0]?_(B[0]).harness:0)&&w[c.prop],n=F(w,ae),I&&I.render(-1,!0).kill(),y)if(P(e._startAt=He.set(B,k({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:h(b),startAt:null,delay:0,onUpdate:D,onUpdateParams:S,callbackScope:M,stagger:0},y))),T){if(0<i)z||(e._startAt=0);else if(W&&!(i<0&&I))return void(i&&(e._zTime=i))}else!1===z&&(e._startAt=0);else if(O&&W)if(I)z||(e._startAt=0);else if(i&&(T=!1),s=k({overwrite:!1,data:"isFromStart",lazy:T&&h(b),immediateRender:T,stagger:0,parent:E},n),g&&(s[c.prop]=g),P(e._startAt=He.set(B,s)),T){if(!i)return}else t(e._startAt,Vt);for(e._pt=0,b=W&&h(b)||b&&!W,r=0;r<B.length;r++){if(u=(o=B[r])._gsap||m(B)[r]._gsap,e._ptLookup[r]=d={},he[u.id]&&oe.length&&A(),p=L===B?r:L.indexOf(o),c&&!1!==(f=new c).init(o,g||n,e,p,L)&&(e._pt=a=new oi(e._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){d[t]=a}),f.priority&&(l=1)),!c||g)for(s in n)le[s]&&(f=Ne(s,n,e,p,o,L))?f.priority&&(l=1):d[s]=a=Xe.call(e,o,s,"get",n[s],p,L,0,w.stringFilter);e._op&&e._op[r]&&e.kill(o,e._op[r]),N&&e._pt&&(Ye=e,gt.killTweensOf(o,d,e.globalTime(0)),v=!e.parent,Ye=0),e._pt&&b&&(he[u.id]=1)}l&&ai(e),e._onInit&&e._onInit(e)}e._from=!Y&&!!w.runBackwards,e._onUpdate=D,e._initted=(!e._op||e._pt)&&!v},Ue=function(t,e,i,s,a){return r(t)?t.call(e,i,s,a):n(t)&&~t.indexOf("random(")?et(t):t},Ge=de+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase",qe=(Ge+",id,stagger,delay,duration,paused,scrollTrigger").split(","),He=function(t){function r(e,n,r,a){var l;"number"==typeof n&&(r.duration=n,n=r,r=null);var c,f,p,_,v,w,y,T,A=(l=t.call(this,a?n:C(n),r)||this).vars,b=A.duration,D=A.delay,S=A.immediateRender,M=A.stagger,O=A.overwrite,F=A.keyframes,R=A.defaults,P=A.scrollTrigger,z=A.yoyoEase,W=l.parent,I=($t(e)||Zt(e)?s(e[0]):"length"in n)?[e]:we(e);if(l._targets=I.length?m(I):d("GSAP target "+e+" not found. https://greensock.com",!Nt.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=O,F||M||u(b)||u(D)){if(n=l.vars,(c=l.timeline=new Le({data:"nested",defaults:R||{}})).kill(),c.parent=c._dp=i(l),c._start=0,F)k(c.vars.defaults,{ease:"none"}),F.forEach(function(t){return c.to(I,t,">")});else{if(_=I.length,y=M?Z(M):g,o(M))for(v in M)~Ge.indexOf(v)&&((T=T||{})[v]=M[v]);for(f=0;f<_;f++){for(v in p={},n)qe.indexOf(v)<0&&(p[v]=n[v]);p.stagger=0,z&&(p.yoyoEase=z),T&&pe(p,T),w=I[f],p.duration=+Ue(b,i(l),f,w,I),p.delay=(+Ue(D,i(l),f,w,I)||0)-l._delay,!M&&1===_&&p.delay&&(l._delay=D=p.delay,l._start+=D,p.delay=0),c.to(w,p,y(f,w,I))}c.duration()?b=D=0:l.timeline=0}b||l.duration(b=c.duration())}else l.timeline=0;return!0!==O||pt||(Ye=i(l),gt.killTweensOf(I),Ye=0),W&&L(W,i(l)),(S||!b&&!F&&l._start===x(W._time)&&h(S)&&function t(e){return!e||e._ts&&t(e.parent)}(i(l))&&"nested"!==W.data)&&(l._tTime=-Vt,l.render(Math.max(0,-D))),P&&Y(i(l),P),l}e(r,t);var a=r.prototype;return a.render=function(t,e,i){var n,r,s,a,o,h,l,u,c,f=this._time,d=this._tDur,p=this._dur,g=d-Vt<t&&0<=t?d:t<Vt?0:t;if(p){if(g!==this._tTime||!t||i||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=t<0){if(n=g,u=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*a+t,e,i);if(n=x(g%a),g===d?(s=this._repeat,n=p):((s=~~(g/a))&&s===g/a&&(n=p,s--),p<n&&(n=p)),(h=this._yoyo&&1&s)&&(c=this._yEase,n=p-n),o=ge(this._tTime,a),n===f&&!i&&this._initted)return this;s!==o&&(u&&this._yEase&&lt(u,h),!this.vars.repeatRefresh||h||this._lock||(this._lock=i=1,this.render(x(a*s),!0).invalidate()._lock=0))}if(!this._initted){if(X(this,t<0?t:n,i,e))return this._tTime=0,this;if(p!==this._dur)return this.render(t,e,i)}for(this._tTime=g,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(c||this._ease)(n/p),this._from&&(this.ratio=l=1-l),!n||f||e||ye(this,"onStart"),r=this._pt;r;)r.r(l,r.d),r=r._next;u&&u.render(t<0?t:!n&&h?-Vt:u._dur*l,e,i)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(t<0&&this._startAt&&this._startAt.render(t,!0,i),ye(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!e&&this.parent&&ye(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(t<0&&this._startAt&&!this._onUpdate&&this._startAt.render(t,!0,!0),!t&&p||!(g===this._tDur&&0<this._ts||!g&&this._ts<0)||P(this,1),e||t<0&&!f||!g&&!f||(ye(this,g===d?"onComplete":"onReverseComplete",!0),!this._prom||g<d&&0<this.timeScale()||this._prom()))}}else!function(t,e,i,n){var r,s,a,o=t.ratio,h=e<0||!e&&(!t._start&&function t(e){var i=e.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||t(i))}(t)||(t._ts<0||t._dp._ts<0)&&"isFromStart"!==t.data&&"isStart"!==t.data)?0:1,l=t._rDelay,u=0;if(l&&t._repeat&&(u=_e(0,t._tDur,e),s=ge(u,l),a=ge(t._tTime,l),t._yoyo&&1&s&&(h=1-h),s!==a&&(o=1-h,t.vars.repeatRefresh&&t._initted&&t.invalidate())),h!==o||n||t._zTime===Vt||!e&&t._zTime){if(!t._initted&&X(t,e,n,i))return;for(a=t._zTime,t._zTime=e||(i?Vt:0),i=i||e&&!a,t.ratio=h,t._from&&(h=1-h),t._time=0,t._tTime=u,r=t._pt;r;)r.r(h,r.d),r=r._next;t._startAt&&e<0&&t._startAt.render(e,!0,!0),t._onUpdate&&!i&&ye(t,"onUpdate"),u&&t._repeat&&!i&&t.parent&&ye(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===h&&(h&&P(t,1),i||(ye(t,h?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,i);return this},a.targets=function(){return this._targets},a.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),t.prototype.invalidate.call(this)},a.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?nt(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ye&&!0!==Ye.vars.overwrite)._first||nt(this),this.parent&&i!==this.timeline.totalDuration()&&V(this,this._dur*this.timeline._tDur/i,0,1),this}var r,s,a,o,h,l,u,c=this._targets,f=t?we(t):c,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0}(c,f))return"all"===e&&(this._pt=0),nt(this);for(r=this._op=this._op||[],"all"!==e&&(n(e)&&(h={},w(e,function(t){return h[t]=1}),e=h),e=function(t,e){var i,n,r,s,a=t[0]?_(t[0]).harness:0,o=a&&a.aliases;if(!o)return e;for(n in i=pe({},e),o)if(n in i)for(r=(s=o[n].split(",")).length;r--;)i[s[r]]=i[n];return i}(c,e)),u=c.length;u--;)if(~f.indexOf(c[u]))for(h in s=d[u],"all"===e?(r[u]=e,o=s,a={}):(a=r[u]=r[u]||{},o=e),o)(l=s&&s[h])&&("kill"in l.d&&!0!==l.d.kill(h)||R(this,l,"_pt"),delete s[h]),"all"!==a&&(a[h]=1);return this._initted&&!this._pt&&p&&nt(this),this},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e){return new r(t,T(arguments,1))},r.delayedCall=function(t,e,i,n){return new r(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:n})},r.fromTo=function(t,e,i){return new r(t,T(arguments,2))},r.set=function(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new r(t,e)},r.killTweensOf=function(t,e,i){return gt.killTweensOf(t,e,i)},r}(Be);function je(t,e,i){return t.setAttribute(e,i)}function Qe(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)}k(He.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),w("staggerTo,staggerFrom,staggerFromTo",function(t){He[t]=function(){var e=new Le,i=ve.call(arguments,0);return i.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,i)}});var Ze=function(t,e,i){return t[e]=i},$e=function(t,e,i){return t[e](i)},Je=function(t,e,i,n){return t[e](n.fp,i)},Ke=function(t,e){return r(t[e])?$e:a(t[e])&&t.setAttribute?je:Ze},ti=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4,e)},ei=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ii=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round(1e4*(i.s+i.c*t))/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},ni=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},ri=function(t,e,i,n){for(var r,s=this._pt;s;)r=s._next,s.p===n&&s.modifier(t,e,i),s=r},si=function(t){for(var e,i,n=this._pt;n;)i=n._next,n.p===t&&!n.op||n.op===t?R(this,n,"_pt"):n.dep||(e=1),n=i;return!e},ai=function(t){for(var e,i,n,r,s=t._pt;s;){for(e=s._next,i=n;i&&i.pr>s.pr;)i=i._next;(s._prev=i?i._prev:r)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:r=s,s=e}t._pt=n},oi=(hi.prototype.modifier=function(t,e,i){this.mSet=this.mSet||this.set,this.set=Qe,this.m=t,this.mt=i,this.tween=e},hi);function hi(t,e,i,n,r,s,a,o,h){this.t=e,this.s=n,this.c=r,this.p=i,this.r=s||ti,this.d=a||this,this.set=o||Ze,this.pr=h||0,(this._next=t)&&(t._prev=this)}w(de+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ae[t]=1}),se.TweenMax=se.TweenLite=He,se.TimelineLite=se.TimelineMax=Le,gt=new Le({sortChildren:!1,defaults:Yt,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Nt.stringFilter=ht;var li={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(t){return function(t){var e=(t=!t.name&&t.default||t).name,i=r(t),n=e&&!i&&t.init?function(){this._props=[]}:t,s={init:g,render:ni,add:Xe,kill:si,modifier:ri,rawVars:0},a={targetTest:0,get:0,getSetter:Ke,aliases:{},register:0};if(ke(),t!==n){if(le[e])return;k(n,k(F(t,s),a)),pe(n.prototype,pe(s,F(t,a))),le[n.prop=e]=n,t.targetTest&&(fe.push(n),ae[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}p(e,n),t.register&&t.register(fi,n,oi)}(t)})},timeline:function(t){return new Le(t)},getTweensOf:function(t,e){return gt.getTweensOf(t,e)},getProperty:function(t,e,i,r){n(t)&&(t=we(t)[0]);var s=_(t||{}).get,a=i?S:D;return"native"===i&&(i=""),t?e?a((le[e]&&le[e].get||s)(t,e,i,r)):function(e,i,n){return a((le[e]&&le[e].get||s)(t,e,i,n))}:t},quickSetter:function(t,e,i){if(1<(t=we(t)).length){var n=t.map(function(t){return fi.quickSetter(t,e,i)}),r=n.length;return function(t){for(var e=r;e--;)n[e](t)}}t=t[0]||{};var s=le[e],a=_(t),o=a.harness&&(a.harness.aliases||{})[e]||e,h=s?function(e){var n=new s;Tt._pt=0,n.init(t,i?e+i:e,Tt,0,[t]),n.render(1,n),Tt._pt&&ni(1,Tt)}:a.set(t,o);return s?h:function(e){return h(t,o,i?e+i:e,a,1)}},isTweening:function(t){return 0<gt.getTweensOf(t,!0).length},defaults:function(t){return t&&t.ease&&(t.ease=Re(t.ease,Yt.ease)),O(Yt,t||{})},config:function(t){return O(Nt,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,n=t.plugins,r=t.defaults,s=t.extendTimeline;(n||"").split(",").forEach(function(t){return t&&!le[t]&&!se[t]&&d(e+" effect requires "+t+" plugin.")}),ue[e]=function(t,e,n){return i(we(t),k(e||{},r),n)},s&&(Le.prototype[e]=function(t,i,n){return this.add(ue[e](t,o(i)?i:(n=i)&&{},this),n)})},registerEase:function(t,e){Me[t]=Re(e)},parseEase:function(t,e){return arguments.length?Re(t,e):Me},getById:function(t){return gt.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var i,n,r=new Le(t);for(r.smoothChildTiming=h(t.smoothChildTiming),gt.remove(r),r._dp=0,r._time=r._tTime=gt._time,i=gt._first;i;)n=i._next,!e&&!i._dur&&i instanceof He&&i.vars.onComplete===i._targets[0]||N(r,i,i._start-i._delay),i=n;return N(gt,r,0),r},utils:{wrap:function t(e,i,n){var r=i-e;return $t(e)?tt(e,t(0,e.length),i):q(n,function(t){return(r+(t-e)%r)%r+e})},wrapYoyo:function t(e,i,n){var r=i-e,s=2*r;return $t(e)?tt(e,t(0,e.length-1),i):q(n,function(t){return e+(r<(t=(s+(t-e)%s)%s||0)?s-t:t)})},distribute:Z,random:K,snap:J,normalize:function(t,e,i){return xe(t,e,0,1,i)},getUnit:H,clamp:function(t,e,i){return q(i,function(i){return _e(t,e,i)})},splitColor:st,toArray:we,mapRange:xe,pipe:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function(t,e){return function(i){return t(parseFloat(i))+(e||H(i))}},interpolate:function t(e,i,r,s){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var o,h,l,u,c,f=n(e),d={};if(!0===r&&(s=1)&&(r=null),f)e={p:e},i={p:i};else if($t(e)&&!$t(i)){for(l=[],u=e.length,c=u-2,h=1;h<u;h++)l.push(t(e[h-1],e[h]));u--,a=function(t){t*=u;var e=Math.min(c,~~t);return l[e](t-e)},r=i}else s||(e=pe($t(e)?[]:{},e));if(!l){for(o in i)Xe.call(d,e,o,"get",i[o]);a=function(t){return ni(t,d)||(f?e.p:e)}}}return q(r,a)},shuffle:Q},install:c,effects:ue,ticker:Se,updateRoot:Le.updateRoot,plugins:le,globalTimeline:gt,core:{PropTween:oi,globals:p,Tween:He,Timeline:Le,Animation:Be,getCache:_,_removeLinkedListItem:R,suppressOverwrites:function(t){return pt=t}}};function ui(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i}function ci(t,e){return{name:t,rawVars:1,init:function(t,i,r){r._onInit=function(t){var r,s;if(n(i)&&(r={},w(i,function(t){return r[t]=1}),i=r),e){for(s in r={},i)r[s]=e(i[s]);i=r}!function(t,e){var i,n,r,s=t._targets;for(i in e)for(n=s.length;n--;)(r=(r=t._ptLookup[n][i])&&r.d)&&(r._pt&&(r=ui(r,i)),r&&r.modifier&&r.modifier(e[i],t,s[n],i))}(t,i)}}}}w("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return li[t]=He[t]}),Se.add(Le.updateRoot),Tt=li.to({},{duration:0});var fi=li.registerPlugin({name:"attr",init:function(t,e,i,n,r){var s,a;for(s in e)(a=this.add(t,"setAttribute",(t.getAttribute(s)||0)+"",e[s],n,r,0,0,s))&&(a.op=s),this._props.push(s)}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i])}},ci("roundProps",$),ci("modifiers"),ci("snap",J))||li;function di(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function pi(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function gi(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function mi(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)}function _i(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function vi(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function wi(t,e,i){return t.style[e]=i}function xi(t,e,i){return t.style.setProperty(e,i)}function yi(t,e,i){return t._gsap[e]=i}function Ti(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i}function Ai(t,e,i,n,r){var s=t._gsap;s.scaleX=s.scaleY=i,s.renderTransform(r,s)}function bi(t,e,i,n,r){var s=t._gsap;s[e]=i,s.renderTransform(r,s)}function Di(t,e){var i=ji.createElementNS?ji.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ji.createElement(t);return i.style?i:ji.createElement(t)}function Si(t,e,i){var n=getComputedStyle(t);return n[e]||n.getPropertyValue(e.replace(An,"-$1").toLowerCase())||n.getPropertyValue(e)||!i&&Si(t,Fn(e)||e,1)||""}function ki(){"undefined"!=typeof window&&window.document&&(Hi=window,ji=Hi.document,Qi=ji.documentElement,$i=Di("div")||{style:{}},Di("div"),kn=Fn(kn),Mn=kn+"Origin",$i.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ki=!!Fn("perspective"),Zi=1)}function Mi(t){var e,i=Di("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,r=this.nextSibling,s=this.style.cssText;if(Qi.appendChild(i),i.appendChild(this),this.style.display="block",t)try{e=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=Mi}catch(t){}else this._gsapBBox&&(e=this._gsapBBox());return n&&(r?n.insertBefore(this,r):n.appendChild(this)),Qi.removeChild(i),this.style.cssText=s,e}function Oi(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])}function Fi(t){var e;try{e=t.getBBox()}catch(i){e=Mi.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Mi||(e=Mi.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+Oi(t,["x","cx","x1"])||0,y:+Oi(t,["y","cy","y1"])||0,width:0,height:0}}function Ci(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Fi(t))}function Ri(t,e){if(e){var i=t.style;e in wn&&e!==Mn&&(e=kn),i.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty(e.replace(An,"-$1").toLowerCase())):i.removeAttribute(e)}}function Pi(t,e,i,n,r,s){var a=new oi(t._pt,e,i,0,1,s?vi:_i);return(t._pt=a).b=n,a.e=r,t._props.push(i),a}function zi(t,e,i,n){var r,s,a,o,h=parseFloat(i)||0,l=(i+"").trim().substr((h+"").length)||"px",u=$i.style,c=bn.test(e),f="svg"===t.tagName.toLowerCase(),d=(f?"client":"offset")+(c?"Width":"Height"),p="px"===n,g="%"===n;return n===l||!h||Cn[n]||Cn[l]?h:("px"===l||p||(h=zi(t,e,i,"px")),o=t.getCTM&&Ci(t),!g&&"%"!==l||!wn[e]&&!~e.indexOf("adius")?(u[c?"width":"height"]=100+(p?l:n),s=~e.indexOf("adius")||"em"===n&&t.appendChild&&!f?t:t.parentNode,o&&(s=(t.ownerSVGElement||{}).parentNode),s&&s!==ji&&s.appendChild||(s=ji.body),(a=s._gsap)&&g&&a.width&&c&&a.time===Se.time?x(h/a.width*100):(!g&&"%"!==l||(u.position=Si(t,"position")),s===t&&(u.position="static"),s.appendChild($i),r=$i[d],s.removeChild($i),u.position="absolute",c&&g&&((a=_(s)).time=Se.time,a.width=s[d]),x(p?r*h/100:r&&h?100/r*h:0))):(r=o?t.getBBox()[c?"width":"height"]:t[d],x(g?h/r*100:h/100*r)))}function Wi(t,e,i,n){var r;return Zi||ki(),e in Sn&&"transform"!==e&&~(e=Sn[e]).indexOf(",")&&(e=e.split(",")[0]),wn[e]&&"transform"!==e?(r=In(t,n),r="transformOrigin"!==e?r[e]:Bn(Si(t,Mn))+" "+r.zOrigin+"px"):(r=t.style[e])&&"auto"!==r&&!n&&!~(r+"").indexOf("calc(")||(r=Pn[e]&&Pn[e](t,e,i)||Si(t,e)||v(t,e)||("opacity"===e?1:0)),i&&!~(r+"").trim().indexOf(" ")?zi(t,e,r,i)+i:r}function Ii(t,e,i,n){if(!i||"none"===i){var r=Fn(e,t,1),s=r&&Si(t,r,1);s&&s!==i?(e=r,i=s):"borderColor"===e&&(i=Si(t,"borderTopColor"))}var a,o,h,l,u,c,f,d,p,g,m,_,v=new oi(this._pt,t.style,e,0,1,ii),w=0,x=0;if(v.b=i,v.e=n,i+="","auto"==(n+="")&&(t.style[e]=n,n=Si(t,e)||n,t.style[e]=i),ht(a=[i,n]),n=a[1],h=(i=a[0]).match(te)||[],(n.match(te)||[]).length){for(;o=te.exec(n);)f=o[0],p=n.substring(w,o.index),u?u=(u+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(u=1),f!==(c=h[x++]||"")&&(l=parseFloat(c)||0,m=c.substr((l+"").length),(_="="===f.charAt(1)?+(f.charAt(0)+"1"):0)&&(f=f.substr(2)),d=parseFloat(f),g=f.substr((d+"").length),w=te.lastIndex-g.length,g||(g=g||Nt.units[e]||m,w===n.length&&(n+=g,v.e+=g)),m!==g&&(l=zi(t,e,c,g)||0),v._pt={_next:v._pt,p:p||1===x?p:",",s:l,c:_?_*d:d-l,m:u&&u<4||"zIndex"===e?Math.round:0});v.c=w<n.length?n.substring(w,n.length):""}else v.r="display"===e&&"none"===n?vi:_i;return ie.test(n)&&(v.e=0),this._pt=v}function Bi(t){var e=t.split(" "),i=e[0],n=e[1]||"50%";return"top"!==i&&"bottom"!==i&&"left"!==n&&"right"!==n||(t=i,i=n,n=t),e[0]=Rn[i]||i,e[1]=Rn[n]||n,e.join(" ")}function Ei(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i,n,r,s=e.t,a=s.style,o=e.u,h=s._gsap;if("all"===o||!0===o)a.cssText="",n=1;else for(r=(o=o.split(",")).length;-1<--r;)i=o[r],wn[i]&&(n=1,i="transformOrigin"===i?Mn:kn),Ri(s,i);n&&(Ri(s,kn),h&&(h.svg&&s.removeAttribute("transform"),In(s,1),h.uncache=1))}}function Li(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function Ni(t){var e=Si(t,kn);return Li(e)?zn:e.substr(7).match(Kt).map(x)}function Yi(t,e){var i,n,r,s,a=t._gsap||_(t),o=t.style,h=Ni(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(h=[(r=t.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?zn:h:(h!==zn||t.offsetParent||t===Qi||a.svg||(r=o.display,o.display="block",(i=t.parentNode)&&t.offsetParent||(s=1,n=t.nextSibling,Qi.appendChild(t)),h=Ni(t),r?o.display=r:Ri(t,"display"),s&&(n?i.insertBefore(t,n):i?i.appendChild(t):Qi.removeChild(t))),e&&6<h.length?[h[0],h[1],h[4],h[5],h[12],h[13]]:h)}function Xi(t,e,i,n,r,s){var a,o,h,l=t._gsap,u=r||Yi(t,!0),c=l.xOrigin||0,f=l.yOrigin||0,d=l.xOffset||0,p=l.yOffset||0,g=u[0],m=u[1],_=u[2],v=u[3],w=u[4],x=u[5],y=e.split(" "),T=parseFloat(y[0])||0,A=parseFloat(y[1])||0;i?u!==zn&&(o=g*v-m*_)&&(h=T*(-m/o)+A*(g/o)-(g*x-m*w)/o,T=T*(v/o)+A*(-_/o)+(_*x-v*w)/o,A=h):(T=(a=Fi(t)).x+(~y[0].indexOf("%")?T/100*a.width:T),A=a.y+(~(y[1]||y[0]).indexOf("%")?A/100*a.height:A)),n||!1!==n&&l.smooth?(w=T-c,x=A-f,l.xOffset=d+(w*g+x*_)-w,l.yOffset=p+(w*m+x*v)-x):l.xOffset=l.yOffset=0,l.xOrigin=T,l.yOrigin=A,l.smooth=!!n,l.origin=e,l.originIsAbsolute=!!i,t.style[Mn]="0px 0px",s&&(Pi(s,l,"xOrigin",c,T),Pi(s,l,"yOrigin",f,A),Pi(s,l,"xOffset",d,l.xOffset),Pi(s,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",T+" "+A)}function Vi(t,e,i){var n=H(e);return x(parseFloat(e)+parseFloat(zi(t,"x",i+"px",n)))+n}function Ui(t,e,i,r,s,a){var o,h,l=360,u=n(s),c=parseFloat(s)*(u&&~s.indexOf("rad")?xn:1),f=a?c*a:c-r,d=r+f+"deg";return u&&("short"===(o=s.split("_")[1])&&(f%=l)!=f%180&&(f+=f<0?l:-l),"cw"===o&&f<0?f=(f+36e9)%l-~~(f/l)*l:"ccw"===o&&0<f&&(f=(f-36e9)%l-~~(f/l)*l)),t._pt=h=new oi(t._pt,e,i,r,f,pi),h.e=d,h.u="deg",t._props.push(i),h}function Gi(t,e){for(var i in e)t[i]=e[i];return t}function qi(t,e,i){var n,r,s,a,o,h,l,u=Gi({},i._gsap),c=i.style;for(r in u.svg?(s=i.getAttribute("transform"),i.setAttribute("transform",""),c[kn]=e,n=In(i,1),Ri(i,kn),i.setAttribute("transform",s)):(s=getComputedStyle(i)[kn],c[kn]=e,n=In(i,1),c[kn]=s),wn)(s=u[r])!==(a=n[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(o=H(s)!==(l=H(a))?zi(i,r,s,l):parseFloat(s),h=parseFloat(a),t._pt=new oi(t._pt,n,r,o,h-o,di),t._pt.u=l||0,t._props.push(r));Gi(n,u)}He.version=Le.version=fi.version="3.6.1",xt=1,l()&&ke();var Hi,ji,Qi,Zi,$i,Ji,Ki,tn=Me.Power0,en=Me.Power1,nn=Me.Power2,rn=Me.Power3,sn=Me.Power4,an=Me.Linear,on=Me.Quad,hn=Me.Cubic,ln=Me.Quart,un=Me.Quint,cn=Me.Strong,fn=Me.Elastic,dn=Me.Back,pn=Me.SteppedEase,gn=Me.Bounce,mn=Me.Sine,_n=Me.Expo,vn=Me.Circ,wn={},xn=180/Math.PI,yn=Math.PI/180,Tn=Math.atan2,An=/([A-Z])/g,bn=/(?:left|right|width|margin|padding|x)/i,Dn=/[\s,\(]\S/,Sn={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},kn="transform",Mn=kn+"Origin",On="O,Moz,ms,Ms,Webkit".split(","),Fn=function(t,e,i){var n=(e||$i).style,r=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);r--&&!(On[r]+t in n););return r<0?null:(3===r?"ms":0<=r?On[r]:"")+t},Cn={deg:1,rad:1,turn:1},Rn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Pn={clearProps:function(t,e,i,n,r){if("isFromStart"!==r.data){var s=t._pt=new oi(t._pt,e,i,0,0,Ei);return s.u=n,s.pr=-10,s.tween=r,t._props.push(i),1}}},zn=[1,0,0,1,0,0],Wn={},In=function(t,e){var i=t._gsap||new Ie(t);if("x"in i&&!e&&!i.uncache)return i;var n,r,s,a,o,h,l,u,c,f,d,p,g,m,_,v,w,y,T,A,b,D,S,k,M,O,F,C,R,P,z,W,I=t.style,B=i.scaleX<0,E="deg",L=Si(t,Mn)||"0";return n=r=s=h=l=u=c=f=d=0,a=o=1,i.svg=!(!t.getCTM||!Ci(t)),m=Yi(t,i.svg),i.svg&&(k=!i.uncache&&!e&&t.getAttribute("data-svg-origin"),Xi(t,k||L,!!k||i.originIsAbsolute,!1!==i.smooth,m)),p=i.xOrigin||0,g=i.yOrigin||0,m!==zn&&(y=m[0],T=m[1],A=m[2],b=m[3],n=D=m[4],r=S=m[5],6===m.length?(a=Math.sqrt(y*y+T*T),o=Math.sqrt(b*b+A*A),h=y||T?Tn(T,y)*xn:0,(c=A||b?Tn(A,b)*xn+h:0)&&(o*=Math.abs(Math.cos(c*yn))),i.svg&&(n-=p-(p*y+g*A),r-=g-(p*T+g*b))):(W=m[6],P=m[7],F=m[8],C=m[9],R=m[10],z=m[11],n=m[12],r=m[13],s=m[14],l=(_=Tn(W,R))*xn,_&&(k=D*(v=Math.cos(-_))+F*(w=Math.sin(-_)),M=S*v+C*w,O=W*v+R*w,F=D*-w+F*v,C=S*-w+C*v,R=W*-w+R*v,z=P*-w+z*v,D=k,S=M,W=O),u=(_=Tn(-A,R))*xn,_&&(v=Math.cos(-_),z=b*(w=Math.sin(-_))+z*v,y=k=y*v-F*w,T=M=T*v-C*w,A=O=A*v-R*w),h=(_=Tn(T,y))*xn,_&&(k=y*(v=Math.cos(_))+T*(w=Math.sin(_)),M=D*v+S*w,T=T*v-y*w,S=S*v-D*w,y=k,D=M),l&&359.9<Math.abs(l)+Math.abs(h)&&(l=h=0,u=180-u),a=x(Math.sqrt(y*y+T*T+A*A)),o=x(Math.sqrt(S*S+W*W)),_=Tn(D,S),c=2e-4<Math.abs(_)?_*xn:0,d=z?1/(z<0?-z:z):0),i.svg&&(k=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Li(Si(t,kn)),k&&t.setAttribute("transform",k))),90<Math.abs(c)&&Math.abs(c)<270&&(B?(a*=-1,c+=h<=0?180:-180,h+=h<=0?180:-180):(o*=-1,c+=c<=0?180:-180)),i.x=n-((i.xPercent=n&&(i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+"px",i.y=r-((i.yPercent=r&&(i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-r)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+"px",i.z=s+"px",i.scaleX=x(a),i.scaleY=x(o),i.rotation=x(h)+E,i.rotationX=x(l)+E,i.rotationY=x(u)+E,i.skewX=c+E,i.skewY=f+E,i.transformPerspective=d+"px",(i.zOrigin=parseFloat(L.split(" ")[2])||0)&&(I[Mn]=Bn(L)),i.xOffset=i.yOffset=0,i.force3D=Nt.force3D,i.renderTransform=i.svg?Vn:Ki?Xn:En,i.uncache=0,i},Bn=function(t){return(t=t.split(" "))[0]+" "+t[1]},En=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Xn(t,e)},Ln="0deg",Nn="0px",Yn=") ",Xn=function(t,e){var i=e||this,n=i.xPercent,r=i.yPercent,s=i.x,a=i.y,o=i.z,h=i.rotation,l=i.rotationY,u=i.rotationX,c=i.skewX,f=i.skewY,d=i.scaleX,p=i.scaleY,g=i.transformPerspective,m=i.force3D,_=i.target,v=i.zOrigin,w="",x="auto"===m&&t&&1!==t||!0===m;if(v&&(u!==Ln||l!==Ln)){var y,T=parseFloat(l)*yn,A=Math.sin(T),b=Math.cos(T);T=parseFloat(u)*yn,s=Vi(_,s,A*(y=Math.cos(T))*-v),a=Vi(_,a,-Math.sin(T)*-v),o=Vi(_,o,b*y*-v+v)}g!==Nn&&(w+="perspective("+g+Yn),(n||r)&&(w+="translate("+n+"%, "+r+"%) "),!x&&s===Nn&&a===Nn&&o===Nn||(w+=o!==Nn||x?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+Yn),h!==Ln&&(w+="rotate("+h+Yn),l!==Ln&&(w+="rotateY("+l+Yn),u!==Ln&&(w+="rotateX("+u+Yn),c===Ln&&f===Ln||(w+="skew("+c+", "+f+Yn),1===d&&1===p||(w+="scale("+d+", "+p+Yn),_.style[kn]=w||"translate(0, 0)"},Vn=function(t,e){var i,n,r,s,a,o=e||this,h=o.xPercent,l=o.yPercent,u=o.x,c=o.y,f=o.rotation,d=o.skewX,p=o.skewY,g=o.scaleX,m=o.scaleY,_=o.target,v=o.xOrigin,w=o.yOrigin,y=o.xOffset,T=o.yOffset,A=o.forceCSS,b=parseFloat(u),D=parseFloat(c);f=parseFloat(f),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),f+=p),f||d?(f*=yn,d*=yn,i=Math.cos(f)*g,n=Math.sin(f)*g,r=Math.sin(f-d)*-m,s=Math.cos(f-d)*m,d&&(p*=yn,a=Math.tan(d-p),r*=a=Math.sqrt(1+a*a),s*=a,p&&(a=Math.tan(p),i*=a=Math.sqrt(1+a*a),n*=a)),i=x(i),n=x(n),r=x(r),s=x(s)):(i=g,s=m,n=r=0),(b&&!~(u+"").indexOf("px")||D&&!~(c+"").indexOf("px"))&&(b=zi(_,"x",u,"px"),D=zi(_,"y",c,"px")),(v||w||y||T)&&(b=x(b+v-(v*i+w*r)+y),D=x(D+w-(v*n+w*s)+T)),(h||l)&&(b=x(b+h/100*(a=_.getBBox()).width),D=x(D+l/100*a.height)),a="matrix("+i+","+n+","+r+","+s+","+b+","+D+")",_.setAttribute("transform",a),A&&(_.style[kn]=a)};w("padding,margin,Width,Radius",function(t,e){var i="Right",n="Bottom",r="Left",s=(e<3?["Top",i,n,r]:["Top"+r,"Top"+i,n+i,n+r]).map(function(i){return e<2?t+i:"border"+i+t});Pn[1<e?"border"+t:t]=function(t,e,i,n,r){var a,o;if(arguments.length<4)return a=s.map(function(e){return Wi(t,e,i)}),5===(o=a.join(" ")).split(a[0]).length?a[0]:o;a=(n+"").split(" "),o={},s.forEach(function(t,e){return o[t]=a[e]=a[e]||a[(e-1)/2|0]}),t.init(e,o,r)}});var Un,Gn,qn={name:"css",register:ki,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,n,r){var s,a,o,h,l,u,c,d,p,g,m,_,v,w,x,y=this._props,T=t.style,A=i.vars.startAt;for(c in Zi||ki(),e)if("autoRound"!==c&&(a=e[c],!le[c]||!Ne(c,e,i,n,t,r)))if(l=typeof a,u=Pn[c],"function"===l&&(l=typeof(a=a.call(i,n,t,r))),"string"===l&&~a.indexOf("random(")&&(a=et(a)),u)u(this,t,c,a,i)&&(x=1);else if("--"===c.substr(0,2))s=(getComputedStyle(t).getPropertyValue(c)+"").trim(),a+="",be.lastIndex=0,be.test(s)||(d=H(s),p=H(a)),p?d!==p&&(s=zi(t,c,s,p)+p):d&&(a+=d),this.add(T,"setProperty",s,a,n,r,0,0,c);else if("undefined"!==l){if(A&&c in A?(s="function"==typeof A[c]?A[c].call(i,n,t,r):A[c],c in Nt.units&&!H(s)&&(s+=Nt.units[c]),"="===(s+"").charAt(1)&&(s=Wi(t,c))):s=Wi(t,c),h=parseFloat(s),(g="string"===l&&"="===a.charAt(1)?+(a.charAt(0)+"1"):0)&&(a=a.substr(2)),o=parseFloat(a),c in Sn&&("autoAlpha"===c&&(1===h&&"hidden"===Wi(t,"visibility")&&o&&(h=0),Pi(this,T,"visibility",h?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==c&&"transform"!==c&&~(c=Sn[c]).indexOf(",")&&(c=c.split(",")[0])),m=c in wn)if(_||((v=t._gsap).renderTransform&&!e.parseTransform||In(t,e.parseTransform),w=!1!==e.smoothOrigin&&v.smooth,(_=this._pt=new oi(this._pt,T,kn,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===c)this._pt=new oi(this._pt,v,"scaleY",v.scaleY,g?g*o:o-v.scaleY),y.push("scaleY",c),c+="X";else{if("transformOrigin"===c){a=Bi(a),v.svg?Xi(t,a,0,w,0,this):((p=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&Pi(this,v,"zOrigin",v.zOrigin,p),Pi(this,T,c,Bn(s),Bn(a)));continue}if("svgOrigin"===c){Xi(t,a,1,w,0,this);continue}if(c in Wn){Ui(this,v,c,h,a,g);continue}if("smoothOrigin"===c){Pi(this,v,"smooth",v.smooth,a);continue}if("force3D"===c){v[c]=a;continue}if("transform"===c){qi(this,a,t);continue}}else c in T||(c=Fn(c)||c);if(m||(o||0===o)&&(h||0===h)&&!Dn.test(a)&&c in T)o=o||0,(d=(s+"").substr((h+"").length))!==(p=H(a)||(c in Nt.units?Nt.units[c]:d))&&(h=zi(t,c,s,p)),this._pt=new oi(this._pt,m?v:T,c,h,g?g*o:o-h,m||"px"!==p&&"zIndex"!==c||!1===e.autoRound?di:mi),this._pt.u=p||0,d!==p&&(this._pt.b=s,this._pt.r=gi);else if(c in T)Ii.call(this,t,c,s,a);else{if(!(c in t)){f(c,a);continue}this.add(t,c,t[c],a,n,r)}y.push(c)}x&&ai(this)},get:Wi,aliases:Sn,getSetter:function(t,e,i){var n=Sn[e];return n&&n.indexOf(",")<0&&(e=n),e in wn&&e!==Mn&&(t._gsap.x||Wi(t,"x"))?i&&Ji===i?"scale"===e?Ti:yi:(Ji=i||{})&&("scale"===e?Ai:bi):t.style&&!a(t.style[e])?wi:~e.indexOf("-")?xi:Ke(t,e)},core:{_removeProperty:Ri,_getMatrix:Yi}};fi.utils.checkPrefix=Fn,Gn=w("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(Un="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){wn[t]=1}),w(Un,function(t){Nt.units[t]="deg",Wn[t]=1}),Sn[Gn[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Un,w("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");Sn[e[1]]=Gn[e[0]]}),w("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Nt.units[t]="px"}),fi.registerPlugin(qn);var Hn=fi.registerPlugin(qn)||fi,jn=Hn.core.Tween;t.Back=dn,t.Bounce=gn,t.CSSPlugin=qn,t.Circ=vn,t.Cubic=hn,t.Elastic=fn,t.Expo=_n,t.Linear=an,t.Power0=tn,t.Power1=en,t.Power2=nn,t.Power3=rn,t.Power4=sn,t.Quad=on,t.Quart=ln,t.Quint=un,t.Sine=mn,t.SteppedEase=pn,t.Strong=cn,t.TimelineLite=Le,t.TimelineMax=Le,t.TweenLite=He,t.TweenMax=jn,t.default=Hn,t.gsap=Hn,"undefined"==typeof window||window!==t?Object.defineProperty(t,"__esModule",{value:!0}):delete t.default});