mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2024-12-22 08:04:10 +01:00
15 lines
38 KiB
JavaScript
15 lines
38 KiB
JavaScript
/*!
|
|
* VERSION: 0.16.3
|
|
* DATE: 2018-05-04
|
|
* UPDATES AND DOCS AT: http://greensock.com
|
|
*
|
|
* Requires TweenLite and CSSPlugin version 1.17.0 or later (TweenMax contains both TweenLite and CSSPlugin). ThrowPropsPlugin is required for momentum-based continuation of movement after the mouse/touch is released (ThrowPropsPlugin is a membership benefit of Club GreenSock - http://greensock.com/club/).
|
|
*
|
|
* @license Copyright (c) 2008-2018, GreenSock. All rights reserved.
|
|
* This work is subject to the terms at http://greensock.com/standard-license or for
|
|
* Club GreenSock members, the software agreement that was issued with your membership.
|
|
*
|
|
* @author: Jack Doyle, jack@greensock.com
|
|
*/
|
|
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("utils.Draggable",["events.EventDispatcher","TweenLite","plugins.CSSPlugin"],function(a,b,c){var d,e,f,g,h,i,j,k,l={css:{},data:"_draggable"},m={css:{},data:"_draggable"},n={css:{},data:"_draggable"},o={css:{}},p=_gsScope._gsDefine.globals,q={},r={style:{}},s=_gsScope.document||{createElement:function(){return r}},t=s.documentElement||{},u=function(a){return s.createElementNS?s.createElementNS("http://www.w3.org/1999/xhtml",a):s.createElement(a)},v=u("div"),w=[],x=function(){return!1},y=180/Math.PI,z=999999999999999,A=Date.now||function(){return(new Date).getTime()},B=!(s.addEventListener||!s.all),C=s.createElement("div"),D=[],E={},F=0,G=/^(?:a|input|textarea|button|select)$/i,H=0,I=_gsScope.navigator&&-1!==_gsScope.navigator.userAgent.toLowerCase().indexOf("android"),J=0,K={},L={},M=function(a){if("string"==typeof a&&(a=b.selector(a)),!a||a.nodeType)return[a];var c,d=[],e=a.length;for(c=0;c!==e;d.push(a[c++]));return d},N=function(a,b){var c,d={};if(b)for(c in a)d[c]=a[c]*b;else for(c in a)d[c]=a[c];return d},O=function(){for(var a=D.length;--a>-1;)D[a]()},P=function(a){D.push(a),1===D.length&&b.ticker.addEventListener("tick",O,this,!1,1)},Q=function(a){for(var c=D.length;--c>-1;)D[c]===a&&D.splice(c,1);b.to(R,0,{overwrite:"all",delay:15,onComplete:R,data:"_draggable"})},R=function(){D.length||b.ticker.removeEventListener("tick",O)},S=function(a,b){var c;for(c in b)void 0===a[c]&&(a[c]=b[c]);return a},T=function(){return null!=window.pageYOffset?window.pageYOffset:null!=s.scrollTop?s.scrollTop:t.scrollTop||s.body.scrollTop||0},U=function(){return null!=window.pageXOffset?window.pageXOffset:null!=s.scrollLeft?s.scrollLeft:t.scrollLeft||s.body.scrollLeft||0},V=function(a,b){Ia(a,"scroll",b),X(a.parentNode)||V(a.parentNode,b)},W=function(a,b){Ja(a,"scroll",b),X(a.parentNode)||W(a.parentNode,b)},X=function(a){return!(a&&a!==t&&a!==s&&a!==s.body&&a!==window&&a.nodeType&&a.parentNode)},Y=function(a,b){var c="x"===b?"Width":"Height",d="scroll"+c,e="client"+c,f=s.body;return Math.max(0,X(a)?Math.max(t[d],f[d])-(window["inner"+c]||t[e]||f[e]):a[d]-a[e])},Z=function(a){var b=X(a),c=Y(a,"x"),d=Y(a,"y");b?a=L:Z(a.parentNode),a._gsMaxScrollX=c,a._gsMaxScrollY=d,a._gsScrollX=a.scrollLeft||0,a._gsScrollY=a.scrollTop||0},$=function(a,b){return a=a||window.event,q.pageX=a.clientX+s.body.scrollLeft+t.scrollLeft,q.pageY=a.clientY+s.body.scrollTop+t.scrollTop,b&&(a.returnValue=!1),q},_=function(a){return a?("string"==typeof a&&(a=b.selector(a)),a.length&&a!==window&&a[0]&&a[0].style&&!a.nodeType&&(a=a[0]),a===window||a.nodeType&&a.style?a:null):a},aa=function(a,b){var c,e,f,g=a.style;if(void 0===g[b]){for(f=["O","Moz","ms","Ms","Webkit"],e=5,c=b.charAt(0).toUpperCase()+b.substr(1);--e>-1&&void 0===g[f[e]+c];);if(0>e)return"";d=3===e?"ms":f[e],b=d+c}return b},ba=function(a,b,c){var d=a.style;d&&(void 0===d[b]&&(b=aa(a,b)),null==c?d.removeProperty?d.removeProperty(b.replace(/([A-Z])/g,"-$1").toLowerCase()):d.removeAttribute(b):void 0!==d[b]&&(d[b]=c))},ca=s.defaultView?s.defaultView.getComputedStyle:x,da=/(?:Left|Right|Width)/i,ea=/(?:\d|\-|\+|=|#|\.)*/g,fa=function(a,b,c,d,e){if("px"===d||!d)return c;if("auto"===d||!c)return 0;var f,g=da.test(b),h=a,i=v.style,j=0>c;return j&&(c=-c),"%"===d&&-1!==b.indexOf("border")?f=c/100*(g?a.clientWidth:a.clientHeight):(i.cssText="border:0 solid red;position:"+ha(a,"position",!0)+";line-height:0;","%"!==d&&h.appendChild?i[g?"borderLeftWidth":"borderTopWidth"]=c+d:(h=a.parentNode||s.body,i[g?"width":"height"]=c+d),h.appendChild(v),f=parseFloat(v[g?"offsetWidth":"offsetHeight"]),h.removeChild(v),0!==f||e||(f=fa(a,b,c,d,!0))),j?-f:f},ga=function(a,b){if("absolute"!==ha(a,"position",!0))return 0;var c="left"===b?"Left":"Top",d=ha(a,"margin"+c,!0);return a["offset"+c]-(fa(a,b,parseFloat(d),(d+"").replace(ea,""))||0)},ha=function(a,b,c){var d,e=(a._gsTransform||{})[b];return e||0===e?e:(a.style[b]?e=a.style[b]:(d=ca(a))?(e=d.getPropertyValue(b.replace(/([A-Z])/g,"-$1").toLowerCase()),e=e||d.length?e:d[b]):a.currentStyle&&(e=a.currentStyle[b]),"auto"!==e||"top"!==b&&"left"!==b||(e=ga(a,b)),c?e:parseFloat(e)||0)},ia=function(a,b,c){var d=a.vars,e=d[c],f=a._listeners[b];"function"==typeof e&&e.apply(d[c+"Scope"]||d.callbackScope||a,d[c+"Params"]||[a.pointerEvent]),f&&a.dispatchEvent(b)},ja=function(a,b){var c,d,e,f=_(a);return f?Da(f,b):void 0!==a.left?(e=xa(b),{left:a.left-e.x,top:a.top-e.y,width:a.width,height:a.height}):(d=a.min||a.minX||a.minRotation||0,c=a.min||a.minY||0,{left:d,top:c,width:(a.max||a.maxX||a.maxRotation||0)-d,height:(a.max||a.maxY||0)-c})},ka=function(){if(!s.createElementNS)return g=0,void(h=!1);var a,b,c,d,e=u("div"),f=s.createElementNS("http://www.w3.org/2000/svg","svg"),l=u("div"),m=e.style,n=s.body||t,o="flex"===ha(n,"display",!0);s.body&&na&&(m.position="absolute",n.appendChild(l),l.appendChild(e),d=e.offsetParent,l.style[na]="rotate(1deg)",k=e.offsetParent===d,l.style.position="absolute",m.height="10px",d=e.offsetTop,l.style.border="5px solid red",j=d!==e.offsetTop,n.removeChild(l)),m=f.style,f.setAttributeNS(null,"width","400px"),f.setAttributeNS(null,"height","400px"),f.setAttributeNS(null,"viewBox","0 0 400 400"),m.display="block",m.boxSizing="border-box",m.border="0px solid red",m.transform="none",e.style.cssText="width:100px;height:100px;overflow:scroll;-ms-overflow-style:none;",n.appendChild(e),e.appendChild(f),c=f.createSVGPoint().matrixTransform(f.getScreenCTM()),b=c.y,e.scrollTop=100,c.x=c.y=0,c=c.matrixTransform(f.getScreenCTM()),i=b-c.y<100.1?0:b-c.y-150,e.removeChild(f),n.removeChild(e),n.appendChild(f),o&&(n.style.display="block"),a=f.getScreenCTM(),b=a.e,m.border="50px solid red",a=f.getScreenCTM(),0===b&&0===a.e&&0===a.f&&1===a.a?(g=1,h=!0):(g=b!==a.e?1:0,h=1!==a.a),o&&(n.style.display="flex"),n.removeChild(f)},la=""!==aa(v,"perspective"),ma=aa(v,"transformOrigin").replace(/^ms/g,"Ms").replace(/([A-Z])/g,"-$1").toLowerCase(),na=aa(v,"transform"),oa=na.replace(/^ms/g,"Ms").replace(/([A-Z])/g,"-$1").toLowerCase(),pa={},qa={},ra=_gsScope.SVGElement,sa=function(a){return!!(ra&&"function"==typeof a.getBBox&&a.getCTM&&(!a.parentNode||a.parentNode.getBBox&&a.parentNode.getCTM))},ta=(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent))&&parseFloat(RegExp.$1)<11,ua=[],va=[],wa=function(a){if(!a.getBoundingClientRect||!a.parentNode||!na)return{offsetTop:0,offsetLeft:0,scaleX:1,scaleY:1,offsetParent:t};if(Sa.cacheSVGData!==!1&&a._dCache&&a._dCache.lastUpdate===b.ticker.frame)return a._dCache;var c,d,e,f,j,k,l,m,n,o,p,q,r=a,u=ya(a);if(u.lastUpdate=b.ticker.frame,a.getBBox&&!u.isSVGRoot){for(r=a.parentNode,c=a.getBBox();r&&"svg"!==(r.nodeName+"").toLowerCase();)r=r.parentNode;return f=wa(r),u.offsetTop=c.y*f.scaleY,u.offsetLeft=c.x*f.scaleX,u.scaleX=f.scaleX,u.scaleY=f.scaleY,u.offsetParent=r||t,u}for(e=u.offsetParent,e===s.body&&(e=t),va.length=ua.length=0;r&&(j=ha(r,na,!0),"matrix(1, 0, 0, 1, 0, 0)"!==j&&"none"!==j&&"translate3d(0px, 0px, 0px)"!==j&&(va.push(r),ua.push(r.style[na]),r.style[na]="none"),r!==e);)r=r.parentNode;for(d=e.getBoundingClientRect(),j=a.getScreenCTM(),m=a.createSVGPoint(),l=m.matrixTransform(j),u.scaleX=Math.sqrt(j.a*j.a+j.b*j.b),u.scaleY=Math.sqrt(j.d*j.d+j.c*j.c),void 0===g&&ka(),u.borderBox&&!h&&a.getAttribute("width")&&(f=ca(a)||{},n=parseFloat(f.borderLeftWidth)+parseFloat(f.borderRightWidth)||0,o=parseFloat(f.borderTopWidth)+parseFloat(f.borderBottomWidth)||0,p=parseFloat(f.width)||0,q=parseFloat(f.height)||0,u.scaleX*=(p-n)/p,u.scaleY*=(q-o)/q),i?(c=a.getBoundingClientRect(),u.offsetLeft=c.left-d.left,u.offsetTop=c.top-d.top):(u.offsetLeft=l.x-d.left,u.offsetTop=l.y-d.top),u.offsetParent=e,k=va.length;--k>-1;)va[k].style[na]=ua[k];return u},xa=function(a,c){if(c=c||{},!a||a===t||!a.parentNode||a===window)return{x:0,y:0};var d=ca(a),e=ma&&d?d.getPropertyValue(ma):"50% 50%",f=e.split(" "),g=-1!==e.indexOf("left")?"0%":-1!==e.indexOf("right")?"100%":f[0],h=-1!==e.indexOf("top")?"0%":-1!==e.indexOf("bottom")?"100%":f[1];return("center"===h||null==h)&&(h="50%"),("center"===g||isNaN(parseFloat(g)))&&(g="50%"),a.getBBox&&sa(a)?(a._gsTransform||(b.set(a,{x:"+=0",overwrite:!1}),void 0===a._gsTransform.xOrigin&&console.log("Draggable requires at least GSAP 1.17.0")),e=a.getBBox(),c.x=a._gsTransform.xOrigin-e.x,c.y=a._gsTransform.yOrigin-e.y):(a.getBBox&&-1!==(g+h).indexOf("%")&&(a=a.getBBox(),a={offsetWidth:a.width,offsetHeight:a.height}),c.x=-1!==g.indexOf("%")?a.offsetWidth*parseFloat(g)/100:parseFloat(g),c.y=-1!==h.indexOf("%")?a.offsetHeight*parseFloat(h)/100:parseFloat(h)),c},ya=function(a){if(Sa.cacheSVGData!==!1&&a._dCache&&a._dCache.lastUpdate===b.ticker.frame)return a._dCache;var c,d=a._dCache=a._dCache||{},e=ca(a),f=a.getBBox&&sa(a),g="svg"===(a.nodeName+"").toLowerCase();if(d.isSVG=f,d.isSVGRoot=g,d.borderBox="border-box"===e.boxSizing,d.computedStyle=e,g)c=a.parentNode||t,c.insertBefore(v,a),d.offsetParent=v.offsetParent||t,c.removeChild(v);else if(f){for(c=a.parentNode;c&&"svg"!==(c.nodeName+"").toLowerCase();)c=c.parentNode;d.offsetParent=c}else d.offsetParent=a.offsetParent;return d},za=function(a,b,c,d,e){if(a===window||!a||!a.style||!a.parentNode)return[1,0,0,1,0,0];var f,h,i,l,m,n,o,p,q,r,u,v,w,x,y=a._dCache||ya(a),z=a.parentNode,A=z._dCache||ya(z),B=y.computedStyle,C=y.isSVG?A.offsetParent:z.offsetParent;return f=y.isSVG&&-1!==(a.style[na]+"").indexOf("matrix")?a.style[na]:B?B.getPropertyValue(oa):a.currentStyle?a.currentStyle[na]:"1,0,0,1,0,0",a.getBBox&&-1!==(a.getAttribute("transform")+"").indexOf("matrix")&&(f=a.getAttribute("transform")),f=(f+"").match(/(?:\-|\.|\b)(\d|\.|e\-)+/g)||[1,0,0,1,0,0],f.length>6&&(f=[f[0],f[1],f[4],f[5],f[12],f[13]]),d?f[4]=f[5]=0:y.isSVG&&(m=a._gsTransform)&&(m.xOrigin||m.yOrigin)&&(f[0]=parseFloat(f[0]),f[1]=parseFloat(f[1]),f[2]=parseFloat(f[2]),f[3]=parseFloat(f[3]),f[4]=parseFloat(f[4])-(m.xOrigin-(m.xOrigin*f[0]+m.yOrigin*f[2])),f[5]=parseFloat(f[5])-(m.yOrigin-(m.xOrigin*f[1]+m.yOrigin*f[3]))),b&&(void 0===g&&ka(),i=y.isSVG||y.isSVGRoot?wa(a):a,y.isSVG?(l=a.getBBox(),r=A.isSVGRoot?{x:0,y:0}:z.getBBox(),i={offsetLeft:l.x-r.x,offsetTop:l.y-r.y,offsetParent:y.offsetParent}):y.isSVGRoot?(u=parseInt(B.borderTopWidth,10)||0,v=parseInt(B.borderLeftWidth,10)||0,w=(f[0]-g)*v+f[2]*u,x=f[1]*v+(f[3]-g)*u,n=b.x,o=b.y,p=n-(n*f[0]+o*f[2]),q=o-(n*f[1]+o*f[3]),f[4]=parseFloat(f[4])+p,f[5]=parseFloat(f[5])+q,b.x-=p,b.y-=q,n=i.scaleX,o=i.scaleY,e||(b.x*=n,b.y*=o),f[0]*=n,f[1]*=o,f[2]*=n,f[3]*=o,ta||(b.x+=w,b.y+=x),C===s.body&&i.offsetParent===t&&(C=t)):!j&&a.offsetParent&&(b.x+=parseInt(ha(a.offsetParent,"borderLeftWidth"),10)||0,b.y+=parseInt(ha(a.offsetParent,"borderTopWidth"),10)||0),h=z===t||z===s.body,f[4]=Number(f[4])+b.x+(i.offsetLeft||0)-c.x-(h?0:z.scrollLeft||0),f[5]=Number(f[5])+b.y+(i.offsetTop||0)-c.y-(h?0:z.scrollTop||0),z&&"fixed"===ha(a,"position",B)&&(f[4]+=U(),f[5]+=T()),!z||z===t||C!==i.offsetParent||A.isSVG||k&&"100100"!==za(z).join("")||(i=A.isSVGRoot?wa(z):z,f[4]-=i.offsetLeft||0,f[5]-=i.offsetTop||0,j||!A.offsetParent||y.isSVG||y.isSVGRoot||(f[4]-=parseInt(ha(A.offsetParent,"borderLeftWidth"),10)||0,f[5]-=parseInt(ha(A.offsetParent,"borderTopWidth"),10)||0))),f},Aa=function(a,b){if(!a||a===window||!a.parentNode)return[1,0,0,1,0,0];for(var c,d,e,f,g,h,i,j,k=xa(a,pa),l=xa(a.parentNode,qa),m=za(a,k,l,!1,!b);(a=a.parentNode)&&a.parentNode&&a!==t;)k=l,l=xa(a.parentNode,k===pa?qa:pa),i=za(a,k,l),c=m[0],d=m[1],e=m[2],f=m[3],g=m[4],h=m[5],m[0]=c*i[0]+d*i[2],m[1]=c*i[1]+d*i[3],m[2]=e*i[0]+f*i[2],m[3]=e*i[1]+f*i[3],m[4]=g*i[0]+h*i[2]+i[4],m[5]=g*i[1]+h*i[3]+i[5];return b&&(c=m[0],d=m[1],e=m[2],f=m[3],g=m[4],h=m[5],j=c*f-d*e,m[0]=f/j,m[1]=-d/j,m[2]=-e/j,m[3]=c/j,m[4]=(e*h-f*g)/j,m[5]=-(c*h-d*g)/j),m},Ba=function(a,b,c,d,e){a=_(a);var f=Aa(a,!1,e),g=b.x,h=b.y;return c&&(xa(a,b),g-=b.x,h-=b.y),d=d===!0?b:d||{},d.x=g*f[0]+h*f[2]+f[4],d.y=g*f[1]+h*f[3]+f[5],d},Ca=function(a,b,c){var d=a.x*b[0]+a.y*b[2]+b[4],e=a.x*b[1]+a.y*b[3]+b[5];return a.x=d*c[0]+e*c[2]+c[4],a.y=d*c[1]+e*c[3]+c[5],a},Da=function(a,b,c){if(!(a=_(a)))return null;b=_(b);var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,u,v,w,x,y,z,A,C=a.getBBox&&sa(a);if(a===window)g=T(),e=U(),f=e+(t.clientWidth||a.innerWidth||s.body.clientWidth||0),h=g+((a.innerHeight||0)-20<t.clientHeight?t.clientHeight:a.innerHeight||s.body.clientHeight||0);else{if(void 0===b||b===window)return a.getBoundingClientRect();d=xa(a),e=-d.x,g=-d.y,C?(o=a.getBBox(),p=o.width,q=o.height):"svg"!==(a.nodeName+"").toLowerCase()&&a.offsetWidth?(p=a.offsetWidth,q=a.offsetHeight):(z=ca(a),p=parseFloat(z.width),q=parseFloat(z.height)),f=e+p,h=g+q,"svg"!==a.nodeName.toLowerCase()||B||(r=wa(a),A=r.computedStyle||{},w=(a.getAttribute("viewBox")||"0 0").split(" "),x=parseFloat(w[0]),y=parseFloat(w[1]),u=parseFloat(A.borderLeftWidth)||0,v=parseFloat(A.borderTopWidth)||0,f-=p-(p-u)/r.scaleX-x,h-=q-(q-v)/r.scaleY-y,e-=u/r.scaleX-x,g-=v/r.scaleY-y,z&&(f+=(parseFloat(A.borderRightWidth)+u)/r.scaleX,h+=(v+parseFloat(A.borderBottomWidth))/r.scaleY))}return a===b?{left:e,top:g,width:f-e,height:h-g}:(i=Aa(a),j=Aa(b,!0),k=Ca({x:e,y:g},i,j),l=Ca({x:f,y:g},i,j),m=Ca({x:f,y:h},i,j),n=Ca({x:e,y:h},i,j),e=Math.min(k.x,l.x,m.x,n.x),g=Math.min(k.y,l.y,m.y,n.y),K.x=K.y=0,c&&xa(b,K),{left:e+K.x,top:g+K.y,width:Math.max(k.x,l.x,m.x,n.x)-e,height:Math.max(k.y,l.y,m.y,n.y)-g})},Ea=function(a){return a&&a.length&&a[0]&&(a[0].nodeType&&a[0].style&&!a.nodeType||a[0].length&&a[0][0])?!0:!1},Fa=function(a){var b,c,d,e=[],f=a.length;for(b=0;f>b;b++)if(c=a[b],Ea(c))for(d=c.length,d=0;d<c.length;d++)e.push(c[d]);else c&&0!==c.length&&e.push(c);return e},Ga="ontouchstart"in t&&"orientation"in window,Ha=function(a){for(var b=a.split(","),c=(void 0!==v.onpointerdown?"pointerdown,pointermove,pointerup,pointercancel":void 0!==v.onmspointerdown?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":a).split(","),d={},e=4;--e>-1;)d[b[e]]=c[e],d[c[e]]=b[e];return d}("touchstart,touchmove,touchend,touchcancel"),Ia=function(a,b,c,d){if(a.addEventListener){var e=Ha[b];d=d||{passive:!1},a.addEventListener(e||b,c,d),e&&b!==e&&a.addEventListener(b,c,d)}else a.attachEvent&&a.attachEvent("on"+b,c)},Ja=function(a,b,c){if(a.removeEventListener){var d=Ha[b];a.removeEventListener(d||b,c),d&&b!==d&&a.removeEventListener(b,c)}else a.detachEvent&&a.detachEvent("on"+b,c)},Ka=function(a,b){for(var c=a.length;--c>-1;)if(a[c].identifier===b)return!0;return!1},La=function(a){e=a.touches&&H<a.touches.length,Ja(a.target,"touchend",La)},Ma=function(a){e=a.touches&&H<a.touches.length,Ia(a.target,"touchend",La)},Na=function(a,b,c,d,e,f){var g,h,i,j={};if(b)if(1!==e&&b instanceof Array){if(j.end=g=[],i=b.length,"object"==typeof b[0])for(h=0;i>h;h++)g[h]=N(b[h],e);else for(h=0;i>h;h++)g[h]=b[h]*e;c+=1.1,d-=1.1}else"function"==typeof b?j.end=function(c){var d,f,g=b.call(a,c);if(1!==e)if("object"==typeof g){d={};for(f in g)d[f]=g[f]*e;g=d}else g*=e;return g}:j.end=b;return(c||0===c)&&(j.max=c),(d||0===d)&&(j.min=d),f&&(j.velocity=0),j},Oa=function(a){var b;return a&&a.getAttribute&&"BODY"!==a.nodeName?"true"===(b=a.getAttribute("data-clickable"))||"false"!==b&&(a.onclick||G.test(a.nodeName+"")||"true"===a.getAttribute("contentEditable"))?!0:Oa(a.parentNode):!1},Pa=function(a,b){for(var c,d=a.length;--d>-1;)c=a[d],c.ondragstart=c.onselectstart=b?null:x,ba(c,"userSelect",b?"text":"none")},Qa=function(){var a,b=s.createElement("div"),c=s.createElement("div"),d=c.style,e=s.body||v;return d.display="inline-block",d.position="relative",b.style.cssText=c.innerHTML="width:90px; height:40px; padding:10px; overflow:auto; visibility: hidden",b.appendChild(c),e.appendChild(b),a=c.offsetHeight+18>b.scrollHeight,e.removeChild(b),a}(),Ra=function(a,c){a=_(a),c=c||{};var d,e,f,g,h,i,j=s.createElement("div"),k=j.style,l=a.firstChild,m=0,n=0,o=a.scrollTop,p=a.scrollLeft,q=a.scrollWidth,r=a.scrollHeight,t=0,u=0,v=0;la&&c.force3D!==!1?(h="translate3d(",i="px,0px)"):na&&(h="translate(",i="px)"),this.scrollTop=function(a,b){return arguments.length?void this.top(-a,b):-this.top()},this.scrollLeft=function(a,b){return arguments.length?void this.left(-a,b):-this.left()},this.left=function(d,e){if(!arguments.length)return-(a.scrollLeft+n);var f=a.scrollLeft-p,g=n;return(f>2||-2>f)&&!e?(p=a.scrollLeft,b.killTweensOf(this,!0,{left:1,scrollLeft:1}),this.left(-p),void(c.onKill&&c.onKill())):(d=-d,0>d?(n=d-.5|0,d=0):d>u?(n=d-u|0,d=u):n=0,(n||g)&&(h?this._suspendTransforms||(k[na]=h+-n+"px,"+-m+i):k.left=-n+"px",n+t>=0&&(k.paddingRight=n+t+"px")),a.scrollLeft=0|d,void(p=a.scrollLeft))},this.top=function(d,e){if(!arguments.length)return-(a.scrollTop+m);var f=a.scrollTop-o,g=m;return(f>2||-2>f)&&!e?(o=a.scrollTop,b.killTweensOf(this,!0,{top:1,scrollTop:1}),this.top(-o),void(c.onKill&&c.onKill())):(d=-d,0>d?(m=d-.5|0,d=0):d>v?(m=d-v|0,d=v):m=0,(m||g)&&(h?this._suspendTransforms||(k[na]=h+-n+"px,"+-m+i):k.top=-m+"px"),a.scrollTop=0|d,void(o=a.scrollTop))},this.maxScrollTop=function(){return v},this.maxScrollLeft=function(){return u},this.disable=function(){for(l=j.firstChild;l;)g=l.nextSibling,a.appendChild(l),l=g;a===j.parentNode&&a.removeChild(j)},this.enable=function(){if(l=a.firstChild,l!==j){for(;l;)g=l.nextSibling,j.appendChild(l),l=g;a.appendChild(j),this.calibrate()}},this.calibrate=function(b){var c,g,h=a.clientWidth===d;o=a.scrollTop,p=a.scrollLeft,(!h||a.clientHeight!==e||j.offsetHeight!==f||q!==a.scrollWidth||r!==a.scrollHeight||b)&&((m||n)&&(c=this.left(),g=this.top(),this.left(-a.scrollLeft),this.top(-a.scrollTop)),(!h||b)&&(k.display="block",k.width="auto",k.paddingRight="0px",t=Math.max(0,a.scrollWidth-a.clientWidth),t&&(t+=ha(a,"paddingLeft")+(Qa?ha(a,"paddingRight"):0))),k.display="inline-block",k.position="relative",k.overflow="visible",k.verticalAlign="top",k.width="100%",k.paddingRight=t+"px",Qa&&(k.paddingBottom=ha(a,"paddingBottom",!0)),B&&(k.zoom="1"),d=a.clientWidth,e=a.clientHeight,q=a.scrollWidth,r=a.scrollHeight,u=a.scrollWidth-d,v=a.scrollHeight-e,f=j.offsetHeight,k.display="block",(c||g)&&(this.left(c),this.top(g)))},this.content=j,this.element=a,this._suspendTransforms=!1,this.enable()},Sa=function(d,g){a.call(this,d),d=_(d),f||(f=p.com.greensock.plugins.ThrowPropsPlugin),this.vars=g=N(g||{}),this.target=d,this.x=this.y=this.rotation=0,this.dragResistance=parseFloat(g.dragResistance)||0,this.edgeResistance=isNaN(g.edgeResistance)?1:parseFloat(g.edgeResistance)||0,this.lockAxis=g.lockAxis,this.autoScroll=g.autoScroll||0,this.lockedAxis=null,this.allowEventDefault=!!g.allowEventDefault;var h,i,j,k,q,r,u,v,x,D,G,O,R,T,U,Y,aa,ca,da,ea,fa,ga,ka,la,ma,na,oa,pa,qa,ra,ta,ua,va,wa,xa=(g.type||(B?"top,left":"x,y")).toLowerCase(),ya=-1!==xa.indexOf("x")||-1!==xa.indexOf("y"),za=-1!==xa.indexOf("rotation"),Ca=za?"rotation":ya?"x":"left",Da=ya?"y":"top",Ea=-1!==xa.indexOf("x")||-1!==xa.indexOf("left")||"scroll"===xa,Fa=-1!==xa.indexOf("y")||-1!==xa.indexOf("top")||"scroll"===xa,La=g.minimumMovement||2,Qa=this,Ta=M(g.trigger||g.handle||d),Ua={},Va=0,Xa=!1,Ya=g.autoScrollMarginTop||40,Za=g.autoScrollMarginRight||40,$a=g.autoScrollMarginBottom||40,_a=g.autoScrollMarginLeft||40,ab=g.clickableTest||Oa,bb=0,cb=function(a){return Qa.isPressed&&a.which<2?void Qa.endDrag():(a.preventDefault(),a.stopPropagation(),!1)},db=function(a){if(Qa.autoScroll&&Qa.isDragging&&(Xa||ca)){var b,c,e,f,g,h,j,k,l=d,m=15*Qa.autoScroll;for(Xa=!1,L.scrollTop=null!=window.pageYOffset?window.pageYOffset:null!=t.scrollTop?t.scrollTop:s.body.scrollTop,L.scrollLeft=null!=window.pageXOffset?window.pageXOffset:null!=t.scrollLeft?t.scrollLeft:s.body.scrollLeft,f=Qa.pointerX-L.scrollLeft,g=Qa.pointerY-L.scrollTop;l&&!c;)c=X(l.parentNode),b=c?L:l.parentNode,e=c?{bottom:Math.max(t.clientHeight,window.innerHeight||0),right:Math.max(t.clientWidth,window.innerWidth||0),left:0,top:0}:b.getBoundingClientRect(),h=j=0,Fa&&(k=b._gsMaxScrollY-b.scrollTop,0>k?j=k:g>e.bottom-$a&&k?(Xa=!0,j=Math.min(k,m*(1-Math.max(0,e.bottom-g)/$a)|0)):g<e.top+Ya&&b.scrollTop&&(Xa=!0,j=-Math.min(b.scrollTop,m*(1-Math.max(0,g-e.top)/Ya)|0)),j&&(b.scrollTop+=j)),Ea&&(k=b._gsMaxScrollX-b.scrollLeft,0>k?h=k:f>e.right-Za&&k?(Xa=!0,h=Math.min(k,m*(1-Math.max(0,e.right-f)/Za)|0)):f<e.left+_a&&b.scrollLeft&&(Xa=!0,h=-Math.min(b.scrollLeft,m*(1-Math.max(0,f-e.left)/_a)|0)),h&&(b.scrollLeft+=h)),c&&(h||j)&&(window.scrollTo(b.scrollLeft,b.scrollTop),rb(Qa.pointerX+h,Qa.pointerY+j)),l=b}if(ca){var n=Qa.x,o=Qa.y,p=1e-6;p>n&&n>-p&&(n=0),p>o&&o>-p&&(o=0),za?(Qa.deltaX=n-qa.data.rotation,qa.data.rotation=Qa.rotation=n,qa.setRatio(1)):i?(Fa&&(Qa.deltaY=o-i.top(),i.top(o)),Ea&&(Qa.deltaX=n-i.left(),i.left(n))):ya?(Fa&&(Qa.deltaY=o-qa.data.y,qa.data.y=o),Ea&&(Qa.deltaX=n-qa.data.x,qa.data.x=n),qa.setRatio(1)):(Fa&&(Qa.deltaY=o-parseFloat(d.style.top||0),d.style.top=o+"px"),Ea&&(Qa.deltaY=n-parseFloat(d.style.left||0),d.style.left=n+"px")),!v||a||ua||(ua=!0,ia(Qa,"drag","onDrag"),ua=!1)}ca=!1},eb=function(a,c){var e,f=Qa.x,g=Qa.y;d._gsTransform||!ya&&!za||b.set(d,{x:"+=0",overwrite:!1,data:"_draggable"}),ya?(Qa.y=d._gsTransform.y,Qa.x=d._gsTransform.x):za?Qa.x=Qa.rotation=d._gsTransform.rotation:i?(Qa.y=i.top(),Qa.x=i.left()):(Qa.y=parseInt(d.style.top,10)||0,Qa.x=parseInt(d.style.left,10)||0),(ea||fa||ga)&&!c&&(Qa.isDragging||Qa.isThrowing)&&(ga&&(K.x=Qa.x,K.y=Qa.y,e=ga(K),e.x!==Qa.x&&(Qa.x=e.x,ca=!0),e.y!==Qa.y&&(Qa.y=e.y,ca=!0)),ea&&(e=ea(Qa.x),e!==Qa.x&&(Qa.x=e,za&&(Qa.rotation=e),ca=!0)),fa&&(e=fa(Qa.y),e!==Qa.y&&(Qa.y=e),ca=!0)),ca&&db(!0),a||(Qa.deltaX=Qa.x-f,Qa.deltaY=Qa.y-g,ia(Qa,"throwupdate","onThrowUpdate"))},fb=function(){var a,b,c,e;u=!1,i?(i.calibrate(),Qa.minX=D=-i.maxScrollLeft(),Qa.minY=O=-i.maxScrollTop(),Qa.maxX=x=Qa.maxY=G=0,u=!0):g.bounds&&(a=ja(g.bounds,d.parentNode),za?(Qa.minX=D=a.left,Qa.maxX=x=a.left+a.width,Qa.minY=O=Qa.maxY=G=0):void 0!==g.bounds.maxX||void 0!==g.bounds.maxY?(a=g.bounds,Qa.minX=D=a.minX,Qa.minY=O=a.minY,Qa.maxX=x=a.maxX,Qa.maxY=G=a.maxY):(b=ja(d,d.parentNode),Qa.minX=D=ha(d,Ca)+a.left-b.left,Qa.minY=O=ha(d,Da)+a.top-b.top,Qa.maxX=x=D+(a.width-b.width),Qa.maxY=G=O+(a.height-b.height)),D>x&&(Qa.minX=x,Qa.maxX=x=D,D=Qa.minX),O>G&&(Qa.minY=G,Qa.maxY=G=O,O=Qa.minY),za&&(Qa.minRotation=D,Qa.maxRotation=x),u=!0),g.liveSnap&&(c=g.liveSnap===!0?g.snap||{}:g.liveSnap,e=c instanceof Array||"function"==typeof c,za?(ea=nb(e?c:c.rotation,D,x,1),fa=null):c.points?ga=ob(e?c:c.points,D,x,O,G,c.radius,i?-1:1):(Ea&&(ea=nb(e?c:c.x||c.left||c.scrollLeft,D,x,i?-1:1)),Fa&&(fa=nb(e?c:c.y||c.top||c.scrollTop,O,G,i?-1:1))))},gb=function(){Qa.isThrowing=!1,ia(Qa,"throwcomplete","onThrowComplete")},hb=function(){Qa.isThrowing=!1},ib=function(a,b){var c,e,h,j;a&&f?(a===!0&&(c=g.snap||g.liveSnap||{},e=c instanceof Array||"function"==typeof c,a={resistance:(g.throwResistance||g.resistance||1e3)/(za?10:1)},za?a.rotation=Na(Qa,e?c:c.rotation,x,D,1,b):(Ea&&(a[Ca]=Na(Qa,e?c:c.points||c.x||c.left||c.scrollLeft,x,D,i?-1:1,b||"x"===Qa.lockedAxis)),Fa&&(a[Da]=Na(Qa,e?c:c.points||c.y||c.top||c.scrollTop,G,O,i?-1:1,b||"y"===Qa.lockedAxis)),(c.points||c instanceof Array&&"object"==typeof c[0])&&(a.linkedProps=Ca+","+Da,a.radius=c.radius))),Qa.isThrowing=!0,j=isNaN(g.overshootTolerance)?1===g.edgeResistance?0:1-Qa.edgeResistance+.2:g.overshootTolerance,Qa.tween=h=f.to(i||d,{throwProps:a,data:"_draggable",ease:g.ease||p.Power3.easeOut,onComplete:gb,onOverwrite:hb,onUpdate:g.fastMode?ia:eb,onUpdateParams:g.fastMode?[Qa,"onthrowupdate","onThrowUpdate"]:c&&c.radius?[!1,!0]:w},isNaN(g.maxDuration)?2:g.maxDuration,isNaN(g.minDuration)?0===j||"object"==typeof a&&a.resistance>1e3?0:.5:g.minDuration,j),g.fastMode||(i&&(i._suspendTransforms=!0),h.render(h.duration(),!0,!0),eb(!0,!0),Qa.endX=Qa.x,Qa.endY=Qa.y,za&&(Qa.endRotation=Qa.x),h.play(0),eb(!0,!0),i&&(i._suspendTransforms=!1))):u&&Qa.applyBounds()},jb=function(a){var b,c,e,f,g,h,i,l,m,n=ma||[1,0,0,1,0,0];ma=Aa(d.parentNode,!0),a&&Qa.isPressed&&n.join(",")!==ma.join(",")&&(b=n[0],c=n[1],e=n[2],f=n[3],g=n[4],h=n[5],i=b*f-c*e,l=j*(f/i)+k*(-e/i)+(e*h-f*g)/i,m=j*(-c/i)+k*(b/i)+-(b*h-c*g)/i,k=l*ma[1]+m*ma[3]+ma[5],j=l*ma[0]+m*ma[2]+ma[4]),ma[1]||ma[2]||1!=ma[0]||1!=ma[3]||0!=ma[4]||0!=ma[5]||(ma=null)},kb=function(){var a=1-Qa.edgeResistance;jb(!1),ma&&(j=Qa.pointerX*ma[0]+Qa.pointerY*ma[2]+ma[4],k=Qa.pointerX*ma[1]+Qa.pointerY*ma[3]+ma[5]),ca&&(rb(Qa.pointerX,Qa.pointerY),db(!0)),i?(fb(),r=i.top(),q=i.left()):(lb()?(eb(!0,!0),fb()):Qa.applyBounds(),za?(aa=Qa.rotationOrigin=Ba(d,{x:0,y:0}),eb(!0,!0),q=Qa.x,r=Qa.y=Math.atan2(aa.y-Qa.pointerY,Qa.pointerX-aa.x)*y):(oa=d.parentNode?d.parentNode.scrollTop||0:0,pa=d.parentNode?d.parentNode.scrollLeft||0:0,r=ha(d,Da),q=ha(d,Ca))),u&&a&&(q>x?q=x+(q-x)/a:D>q&&(q=D-(D-q)/a),za||(r>G?r=G+(r-G)/a:O>r&&(r=O-(O-r)/a))),Qa.startX=q,Qa.startY=r},lb=function(){return Qa.tween&&Qa.tween.isActive()},mb=function(){!C.parentNode||lb()||Qa.isDragging||C.parentNode.removeChild(C)},nb=function(a,b,c,d){return"function"==typeof a?function(e){var f=Qa.isPressed?1-Qa.edgeResistance:1;return a.call(Qa,e>c?c+(e-c)*f:b>e?b+(e-b)*f:e)*d}:a instanceof Array?function(d){for(var e,f,g=a.length,h=0,i=z;--g>-1;)e=a[g],f=e-d,0>f&&(f=-f),i>f&&e>=b&&c>=e&&(h=g,i=f);return a[h]}:isNaN(a)?function(a){return a}:function(){return a*d}},ob=function(a,b,c,d,e,f,g){return f=f&&z>f?f*f:z,"function"==typeof a?function(h){var i,j,k,l=Qa.isPressed?1-Qa.edgeResistance:1,m=h.x,n=h.y;return h.x=m=m>c?c+(m-c)*l:b>m?b+(m-b)*l:m,h.y=n=n>e?e+(n-e)*l:d>n?d+(n-d)*l:n,i=a.call(Qa,h),i!==h&&(h.x=i.x,h.y=i.y),1!==g&&(h.x*=g,h.y*=g),z>f&&(j=h.x-m,k=h.y-n,j*j+k*k>f&&(h.x=m,h.y=n)),h}:a instanceof Array?function(b){for(var c,d,e,g,h=a.length,i=0,j=z;--h>-1;)e=a[h],c=e.x-b.x,d=e.y-b.y,g=c*c+d*d,j>g&&(i=h,j=g);return f>=j?a[i]:b}:function(a){return a}},pb=function(a,c){var e;if(h&&!Qa.isPressed&&a&&("mousedown"!==a.type&&"pointerdown"!==a.type||c||!(A()-bb<30)||!Ha[Qa.pointerEvent.type])){if(na=lb(),Qa.pointerEvent=a,Ha[a.type]?(la=-1!==a.type.indexOf("touch")?a.currentTarget||a.target:s,Ia(la,"touchend",sb),Ia(la,"touchmove",qb),Ia(la,"touchcancel",sb),Ia(s,"touchstart",Ma)):(la=null,Ia(s,"mousemove",qb)),ta=null,Ia(s,"mouseup",sb),a&&a.target&&Ia(a.target,"mouseup",sb),ka=ab.call(Qa,a.target)&&!g.dragClickables&&!c)return Ia(a.target,"change",sb),ia(Qa,"press","onPress"),void Pa(Ta,!0);if(ra=!la||Ea===Fa||Qa.vars.allowNativeTouchScrolling===!1||Qa.vars.allowContextMenu&&a&&(a.ctrlKey||a.which>2)?!1:Ea?"y":"x",B?a=$(a,!0):ra||Qa.allowEventDefault||(a.preventDefault(),a.preventManipulation&&a.preventManipulation()),a.changedTouches?(a=U=a.changedTouches[0],Y=a.identifier):a.pointerId?Y=a.pointerId:U=Y=null,H++,P(db),k=Qa.pointerY=a.pageY,j=Qa.pointerX=a.pageX,(ra||Qa.autoScroll)&&Z(d.parentNode),!d.parentNode||!Qa.autoScroll||i||za||!d.parentNode._gsMaxScrollX||C.parentNode||d.getBBox||(C.style.width=d.parentNode.scrollWidth+"px",d.parentNode.appendChild(C)),kb(),Qa.tween&&Qa.tween.kill(),Qa.isThrowing=!1,b.killTweensOf(i||d,!0,Ua),i&&b.killTweensOf(d,!0,{scrollTo:1}),Qa.tween=Qa.lockedAxis=null,(g.zIndexBoost||!za&&!i&&g.zIndexBoost!==!1)&&(d.style.zIndex=Sa.zIndex++),Qa.isPressed=!0,v=!(!g.onDrag&&!Qa._listeners.drag),!za)for(e=Ta.length;--e>-1;)ba(Ta[e],"cursor",g.cursor||"move");ia(Qa,"press","onPress")}},qb=function(a){var b,c,d,f,g,i,l=a;if(h&&!e&&Qa.isPressed&&a){if(Qa.pointerEvent=a,b=a.changedTouches){if(a=b[0],a!==U&&a.identifier!==Y){for(f=b.length;--f>-1&&(a=b[f]).identifier!==Y;);if(0>f)return}}else if(a.pointerId&&Y&&a.pointerId!==Y)return;if(B)a=$(a,!0);else{if(la&&ra&&!ta&&(c=a.pageX,d=a.pageY,ma&&(f=c*ma[0]+d*ma[2]+ma[4],d=c*ma[1]+d*ma[3]+ma[5],c=f),g=Math.abs(c-j),i=Math.abs(d-k),(g!==i&&(g>La||i>La)||I&&ra===ta)&&(ta=g>i&&Ea?"x":"y",Qa.vars.lockAxisOnTouchScroll!==!1&&(Qa.lockedAxis="x"===ta?"y":"x","function"==typeof Qa.vars.onLockAxis&&Qa.vars.onLockAxis.call(Qa,l)),I&&ra===ta)))return void sb(l);Qa.allowEventDefault||ra&&(!ta||ra===ta)||l.cancelable===!1||(l.preventDefault(),l.preventManipulation&&l.preventManipulation())}Qa.autoScroll&&(Xa=!0),rb(a.pageX,a.pageY)}},rb=function(a,b){var c,d,e,f,g,h,i=1-Qa.dragResistance,l=1-Qa.edgeResistance;Qa.pointerX=a,Qa.pointerY=b,za?(f=Math.atan2(aa.y-b,a-aa.x)*y,g=Qa.y-f,g>180?(r-=360,Qa.y=f):-180>g&&(r+=360,Qa.y=f),Qa.x!==q||Math.abs(r-f)>La?(Qa.y=f,e=q+(r-f)*i):e=q):(ma&&(h=a*ma[0]+b*ma[2]+ma[4],b=a*ma[1]+b*ma[3]+ma[5],a=h),d=b-k,c=a-j,La>d&&d>-La&&(d=0),La>c&&c>-La&&(c=0),(Qa.lockAxis||Qa.lockedAxis)&&(c||d)&&(h=Qa.lockedAxis,h||(Qa.lockedAxis=h=Ea&&Math.abs(c)>Math.abs(d)?"y":Fa?"x":null,h&&"function"==typeof Qa.vars.onLockAxis&&Qa.vars.onLockAxis.call(Qa,Qa.pointerEvent)),"y"===h?d=0:"x"===h&&(c=0)),e=q+c*i,f=r+d*i),(ea||fa||ga)&&(Qa.x!==e||Qa.y!==f&&!za)?(ga&&(K.x=e,K.y=f,h=ga(K),e=h.x,f=h.y),ea&&(e=ea(e)),fa&&(f=fa(f))):u&&(e>x?e=x+(e-x)*l:D>e&&(e=D+(e-D)*l),za||(f>G?f=G+(f-G)*l:O>f&&(f=O+(f-O)*l))),za||ma||(e=Math.round(e),f=Math.round(f)),(Qa.x!==e||Qa.y!==f&&!za)&&(za?(Qa.endRotation=Qa.x=Qa.endX=e,ca=!0):(Fa&&(Qa.y=Qa.endY=f,ca=!0),Ea&&(Qa.x=Qa.endX=e,ca=!0)),!Qa.isDragging&&Qa.isPressed&&(Qa.isDragging=!0,ia(Qa,"dragstart","onDragStart")))},sb=function(a,c){if(h&&Qa.isPressed&&(!a||null==Y||c||!(a.pointerId&&a.pointerId!==Y||a.changedTouches&&!Ka(a.changedTouches,Y)))){Qa.isPressed=!1;var e,f,i,j,k,l=a,m=Qa.isDragging,n=Qa.vars.allowContextMenu&&a&&(a.ctrlKey||a.which>2),o=b.delayedCall(.001,mb);if(la?(Ja(la,"touchend",sb),Ja(la,"touchmove",qb),Ja(la,"touchcancel",sb),Ja(s,"touchstart",Ma)):Ja(s,"mousemove",qb),Ja(s,"mouseup",sb),a&&a.target&&Ja(a.target,"mouseup",sb),ca=!1,ka&&!n)return a&&(Ja(a.target,"change",sb),Qa.pointerEvent=l),Pa(Ta,!1),ia(Qa,"release","onRelease"),ia(Qa,"click","onClick"),void(ka=!1);if(Q(db),!za)for(f=Ta.length;--f>-1;)ba(Ta[f],"cursor",g.cursor||"move");if(m&&(Va=J=A(),Qa.isDragging=!1),H--,a){if(B&&(a=$(a,!1)),e=a.changedTouches,e&&(a=e[0],a!==U&&a.identifier!==Y)){for(f=e.length;--f>-1&&(a=e[f]).identifier!==Y;);if(0>f)return}Qa.pointerEvent=l,Qa.pointerX=a.pageX,Qa.pointerY=a.pageY}return n&&l?(l.preventDefault(),l.preventManipulation&&l.preventManipulation(),ia(Qa,"release","onRelease")):l&&!m?(na&&(g.snap||g.bounds)&&ib(g.throwProps),ia(Qa,"release","onRelease"),I&&"touchmove"===l.type||-1!==l.type.indexOf("cancel")||(ia(Qa,"click","onClick"),A()-bb<300&&ia(Qa,"doubleclick","onDoubleClick"),j=l.target||l.srcElement||d,bb=A(),k=function(){bb!==va&&Qa.enabled()&&!Qa.isPressed&&(j.click?j.click():s.createEvent&&(i=s.createEvent("MouseEvents"),i.initMouseEvent("click",!0,!0,window,1,Qa.pointerEvent.screenX,Qa.pointerEvent.screenY,Qa.pointerX,Qa.pointerY,!1,!1,!1,!1,0,null),j.dispatchEvent(i)))},I||l.defaultPrevented||b.delayedCall(1e-5,k))):(ib(g.throwProps),B||Qa.allowEventDefault||!l||!g.dragClickables&&ab.call(Qa,l.target)||!m||ra&&(!ta||ra!==ta)||l.cancelable===!1||(l.preventDefault(),l.preventManipulation&&l.preventManipulation()),ia(Qa,"release","onRelease")),lb()&&o.duration(Qa.tween.duration()),m&&ia(Qa,"dragend","onDragEnd"),!0}},tb=function(a){if(a&&Qa.isDragging&&!i){var b=a.target||a.srcElement||d.parentNode,c=b.scrollLeft-b._gsScrollX,e=b.scrollTop-b._gsScrollY;(c||e)&&(ma?(j-=c*ma[0]+e*ma[2],k-=e*ma[3]+c*ma[1]):(j-=c,k-=e),b._gsScrollX+=c,b._gsScrollY+=e,rb(Qa.pointerX,Qa.pointerY))}},ub=function(a){var b=A(),c=40>b-bb,d=40>b-Va,e=c&&va===bb,f=!!a.preventDefault,g=Qa.pointerEvent&&Qa.pointerEvent.defaultPrevented,h=c&&wa===bb,i=a.isTrusted||null==a.isTrusted&&c&&e;return f&&(e||d&&Qa.vars.suppressClickOnDrag!==!1)&&a.stopImmediatePropagation(),!c||Qa.pointerEvent&&Qa.pointerEvent.defaultPrevented||e&&i===h?void((Qa.isPressed||d||c)&&(f?i&&a.detail&&c&&!g||(a.preventDefault(),a.preventManipulation&&a.preventManipulation()):a.returnValue=!1)):(i&&e&&(wa=bb),void(va=bb))},vb=function(a){return ma?{x:a.x*ma[0]+a.y*ma[2]+ma[4],y:a.x*ma[1]+a.y*ma[3]+ma[5]}:{x:a.x,y:a.y}};da=Sa.get(this.target),da&&da.kill(),this.startDrag=function(a,b){var c,e,f,g;pb(a||Qa.pointerEvent,!0),b&&!Qa.hitTest(a||Qa.pointerEvent)&&(c=Wa(a||Qa.pointerEvent),e=Wa(d),
|
|
f=vb({x:c.left+c.width/2,y:c.top+c.height/2}),g=vb({x:e.left+e.width/2,y:e.top+e.height/2}),j-=f.x-g.x,k-=f.y-g.y),Qa.isDragging||(Qa.isDragging=!0,ia(Qa,"dragstart","onDragStart"))},this.drag=qb,this.endDrag=function(a){sb(a||Qa.pointerEvent,!0)},this.timeSinceDrag=function(){return Qa.isDragging?0:(A()-Va)/1e3},this.timeSinceClick=function(){return(A()-bb)/1e3},this.hitTest=function(a,b){return Sa.hitTest(Qa.target,a,b)},this.getDirection=function(a,b){var c,d,e,g,h,i,j="velocity"===a&&f?a:"object"!=typeof a||za?"start":"element";return"element"===j&&(h=Wa(Qa.target),i=Wa(a)),c="start"===j?Qa.x-q:"velocity"===j?f.getVelocity(this.target,Ca):h.left+h.width/2-(i.left+i.width/2),za?0>c?"counter-clockwise":"clockwise":(b=b||2,d="start"===j?Qa.y-r:"velocity"===j?f.getVelocity(this.target,Da):h.top+h.height/2-(i.top+i.height/2),e=Math.abs(c/d),g=1/b>e?"":0>c?"left":"right",b>e&&(""!==g&&(g+="-"),g+=0>d?"up":"down"),g)},this.applyBounds=function(a){var b,c,e,f,h,i;if(a&&g.bounds!==a)return g.bounds=a,Qa.update(!0);if(eb(!0),fb(),u){if(b=Qa.x,c=Qa.y,b>x?b=x:D>b&&(b=D),c>G?c=G:O>c&&(c=O),(Qa.x!==b||Qa.y!==c)&&(e=!0,Qa.x=Qa.endX=b,za?Qa.endRotation=b:Qa.y=Qa.endY=c,ca=!0,db(!0),Qa.autoScroll&&!Qa.isDragging))for(Z(d.parentNode),f=d,L.scrollTop=null!=window.pageYOffset?window.pageYOffset:null!=t.scrollTop?t.scrollTop:s.body.scrollTop,L.scrollLeft=null!=window.pageXOffset?window.pageXOffset:null!=t.scrollLeft?t.scrollLeft:s.body.scrollLeft;f&&!i;)i=X(f.parentNode),h=i?L:f.parentNode,Fa&&h.scrollTop>h._gsMaxScrollY&&(h.scrollTop=h._gsMaxScrollY),Ea&&h.scrollLeft>h._gsMaxScrollX&&(h.scrollLeft=h._gsMaxScrollX),f=h;Qa.isThrowing&&(e||Qa.endX>x||Qa.endX<D||Qa.endY>G||Qa.endY<O)&&ib(g.throwProps,e)}return Qa},this.update=function(a,b,c){var e=Qa.x,f=Qa.y;return jb(!b),a?Qa.applyBounds():(ca&&c&&db(!0),eb(!0)),b&&(rb(Qa.pointerX,Qa.pointerY),ca&&db(!0)),Qa.isPressed&&!b&&(Ea&&Math.abs(e-Qa.x)>.01||Fa&&Math.abs(f-Qa.y)>.01&&!za)&&kb(),Qa.autoScroll&&(Z(d.parentNode),Xa=Qa.isDragging,db(!0)),Qa.autoScroll&&(W(d,tb),V(d,tb)),Qa},this.enable=function(a){var e,j,k;if("soft"!==a){for(j=Ta.length;--j>-1;)k=Ta[j],Ia(k,"mousedown",pb),Ia(k,"touchstart",pb),Ia(k,"click",ub,!0),za||ba(k,"cursor",g.cursor||"move"),ba(k,"touchCallout","none"),ba(k,"touchAction",Ea===Fa?"none":Ea?"pan-y":"pan-x"),sa(k)&&ba(k.ownerSVGElement||k,"touchAction",Ea===Fa?"none":Ea?"pan-y":"pan-x"),this.vars.allowContextMenu||Ia(k,"contextmenu",cb);Pa(Ta,!1)}return V(d,tb),h=!0,f&&"soft"!==a&&f.track(i||d,ya?"x,y":za?"rotation":"top,left"),i&&i.enable(),d._gsDragID=e="d"+F++,E[e]=this,i&&(i.element._gsDragID=e),b.set(d,{x:"+=0",overwrite:!1,data:"_draggable"}),qa={t:d,data:B?T:d._gsTransform,tween:{},setRatio:B?function(){b.set(d,R)}:c._internals.setTransformRatio||c._internals.set3DTransformRatio},kb(),Qa.update(!0),Qa},this.disable=function(a){var b,c,e=Qa.isDragging;if(!za)for(b=Ta.length;--b>-1;)ba(Ta[b],"cursor",null);if("soft"!==a){for(b=Ta.length;--b>-1;)c=Ta[b],ba(c,"touchCallout",null),ba(c,"touchAction",null),Ja(c,"mousedown",pb),Ja(c,"touchstart",pb),Ja(c,"click",ub),Ja(c,"contextmenu",cb);Pa(Ta,!0),la&&(Ja(la,"touchcancel",sb),Ja(la,"touchend",sb),Ja(la,"touchmove",qb)),Ja(s,"mouseup",sb),Ja(s,"mousemove",qb)}return W(d,tb),h=!1,f&&"soft"!==a&&f.untrack(i||d,ya?"x,y":za?"rotation":"top,left"),i&&i.disable(),Q(db),Qa.isDragging=Qa.isPressed=ka=!1,e&&ia(Qa,"dragend","onDragEnd"),Qa},this.enabled=function(a,b){return arguments.length?a?Qa.enable(b):Qa.disable(b):h},this.kill=function(){return Qa.isThrowing=!1,b.killTweensOf(i||d,!0,Ua),Qa.disable(),delete E[d._gsDragID],Qa},-1!==xa.indexOf("scroll")&&(i=this.scrollProxy=new Ra(d,S({onKill:function(){Qa.isPressed&&sb(null)}},g)),d.style.overflowY=Fa&&!Ga?"auto":"hidden",d.style.overflowX=Ea&&!Ga?"auto":"hidden",d=i.content),g.force3D!==!1&&b.set(d,{force3D:!0}),za?Ua.rotation=1:(Ea&&(Ua[Ca]=1),Fa&&(Ua[Da]=1)),za?(R=o,T=R.css,R.overwrite=!1):ya&&(R=Ea&&Fa?l:Ea?m:n,T=R.css,R.overwrite=!1),this.enable()},Ta=Sa.prototype=new a;Ta.constructor=Sa,Ta.pointerX=Ta.pointerY=Ta.startX=Ta.startY=Ta.deltaX=Ta.deltaY=0,Ta.isDragging=Ta.isPressed=!1,Sa.version="0.16.3",Sa.zIndex=1e3,Ia(s,"touchcancel",function(){}),Ia(s,"contextmenu",function(a){var b;for(b in E)E[b].isPressed&&E[b].endDrag()}),Sa.create=function(a,c){"string"==typeof a&&(a=b.selector(a));for(var d=a&&0!==a.length?Ea(a)?Fa(a):[a]:[],e=d.length;--e>-1;)d[e]=new Sa(d[e],c);return d},Sa.get=function(a){return E[(_(a)||{})._gsDragID]},Sa.timeSinceDrag=function(){return(A()-J)/1e3};var Ua={},Va=function(a){var b,c,d=0,e=0;for(a=_(a),b=a.offsetWidth,c=a.offsetHeight;a;)d+=a.offsetTop,e+=a.offsetLeft,a=a.offsetParent;return{top:d,left:e,width:b,height:c}},Wa=function(a,b){if(a===window)return Ua.left=Ua.top=0,Ua.width=Ua.right=t.clientWidth||a.innerWidth||s.body.clientWidth||0,Ua.height=Ua.bottom=(a.innerHeight||0)-20<t.clientHeight?t.clientHeight:a.innerHeight||s.body.clientHeight||0,Ua;var c=a.pageX!==b?{left:a.pageX-U(),top:a.pageY-T(),right:a.pageX-U()+1,bottom:a.pageY-T()+1}:a.nodeType||a.left===b||a.top===b?B?Va(a):_(a).getBoundingClientRect():a;return c.right===b&&c.width!==b?(c.right=c.left+c.width,c.bottom=c.top+c.height):c.width===b&&(c={width:c.right-c.left,height:c.bottom-c.top,right:c.right,left:c.left,bottom:c.bottom,top:c.top}),c};return Sa.hitTest=function(a,b,c){if(a===b)return!1;var d,e,f,g=Wa(a),h=Wa(b),i=h.left>g.right||h.right<g.left||h.top>g.bottom||h.bottom<g.top;return i||!c?!i:(f=-1!==(c+"").indexOf("%"),c=parseFloat(c)||0,d={left:Math.max(g.left,h.left),top:Math.max(g.top,h.top)},d.width=Math.min(g.right,h.right)-d.left,d.height=Math.min(g.bottom,h.bottom)-d.top,d.width<0||d.height<0?!1:f?(c*=.01,e=d.width*d.height,e>=g.width*g.height*c||e>=h.width*h.height*c):d.width>c&&d.height>c)},C.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;",Sa},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(a){"use strict";var b=function(){return(_gsScope.GreenSockGlobals||_gsScope)[a]};"undefined"!=typeof module&&module.exports?(require("../TweenLite.min.js"),require("../plugins/CSSPlugin.min.js"),module.exports=b()):"function"==typeof define&&define.amd&&define(["TweenLite","CSSPlugin"],b)}("Draggable"); |