HEX
Server: LiteSpeed
System: Linux premium221.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: madepabj (2566)
PHP: 8.3.26
Disabled: NONE
Upload Files
File: //home/madepabj/www/wp-content/themes/rehub-theme/js/MotionPathHelper.min.js
/*!
 * MotionPathHelper 3.4.2
 * https://greensock.com
 * 
 * @license Copyright 2020, GreenSock. All rights reserved.
 * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
 * @author: Jack Doyle, [email protected]
 */

!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 o(t){return Math.round(1e5*t)/1e5||0}function p(t,e){return e.totalLength=t.totalLength,t.samples?(e.samples=t.samples.slice(0),e.lookup=t.lookup.slice(0),e.minLength=t.minLength,e.resolution=t.resolution):e.totalPoints=t.totalPoints,e}var P,w=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,x=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,j=Math.PI/180,W=Math.sin,F=Math.cos,U=Math.abs,$=Math.sqrt,E=Math.atan2,A=1e8;function copyRawPath(t){for(var e=[],n=0;n<t.length;n++)e[n]=p(t[n],t[n].slice(0));return p(t,e)}function transformRawPath(t,e,n,i,s,a,o){for(var r,h,l,c,d,u=t.length;-1<--u;)for(h=(r=t[u]).length,l=0;l<h;l+=2)c=r[l],d=r[l+1],r[l]=c*e+d*i+a,r[l+1]=c*n+d*s+o;return t._dirty=1,t}function arcToSegment(t,e,n,i,s,a,o,r,h){if(t!==r||e!==h){n=U(n),i=U(i);var l=s%360*j,c=F(l),d=W(l),u=Math.PI,p=2*u,g=(t-r)/2,f=(e-h)/2,_=c*g+d*f,m=-d*g+c*f,v=_*_,b=m*m,y=v/(n*n)+b/(i*i);1<y&&(n=$(y)*n,i=$(y)*i);var P=n*n,A=i*i,w=(P*A-P*b-A*v)/(P*b+A*v);w<0&&(w=0);var x=(a===o?-1:1)*$(w),S=n*m/i*x,C=-i*_/n*x,E=c*S-d*C+(t+r)/2,k=d*S+c*C+(e+h)/2,D=(_-S)/n,M=(m-C)/i,T=(-_-S)/n,H=(-m-C)/i,R=D*D+M*M,N=(M<0?-1:1)*Math.acos(D/$(R)),L=(D*H-M*T<0?-1:1)*Math.acos((D*T+M*H)/$(R*(T*T+H*H)));isNaN(L)&&(L=u),!o&&0<L?L-=p:o&&L<0&&(L+=p),N%=p,L%=p;var z,X=Math.ceil(U(L)/(p/4)),I=[],O=L/X,G=4/3*W(O/2)/(1+F(O/2)),V=c*n,q=d*n,Y=d*-i,B=c*i;for(z=0;z<X;z++)_=F(s=N+z*O),m=W(s),D=F(s+=O),M=W(s),I.push(_-G*m,m+G*_,D+G*M,M-G*D,D,M);for(z=0;z<I.length;z+=2)_=I[z],m=I[z+1],I[z]=_*V+m*Y+E,I[z+1]=_*q+m*B+k;return I[z-2]=r,I[z-1]=h,I}}function stringToRawPath(t){function od(t,e,n,i){c=(n-t)/3,d=(i-e)/3,r.push(t+c,e+d,n-c,i-d,n,i)}var e,n,i,s,a,o,r,h,l,c,d,u,p,g,f,_=(t+"").replace(x,function(t){var e=+t;return e<1e-4&&-1e-4<e?0:e}).match(w)||[],m=[],v=0,b=0,y=_.length,P=0,A="ERROR: malformed path: "+t;if(!t||!isNaN(_[0])||isNaN(_[1]))return console.log(A),m;for(e=0;e<y;e++)if(p=a,isNaN(_[e])?o=(a=_[e].toUpperCase())!==_[e]:e--,i=+_[e+1],s=+_[e+2],o&&(i+=v,s+=b),e||(h=i,l=s),"M"===a)r&&(r.length<8?--m.length:P+=r.length),v=h=i,b=l=s,r=[i,s],m.push(r),e+=2,a="L";else if("C"===a)o||(v=b=0),(r=r||[0,0]).push(i,s,v+1*_[e+3],b+1*_[e+4],v+=1*_[e+5],b+=1*_[e+6]),e+=6;else if("S"===a)c=v,d=b,"C"!==p&&"S"!==p||(c+=v-r[r.length-4],d+=b-r[r.length-3]),o||(v=b=0),r.push(c,d,i,s,v+=1*_[e+3],b+=1*_[e+4]),e+=4;else if("Q"===a)c=v+2/3*(i-v),d=b+2/3*(s-b),o||(v=b=0),v+=1*_[e+3],b+=1*_[e+4],r.push(c,d,v+2/3*(i-v),b+2/3*(s-b),v,b),e+=4;else if("T"===a)c=v-r[r.length-4],d=b-r[r.length-3],r.push(v+c,b+d,i+2/3*(v+1.5*c-i),s+2/3*(b+1.5*d-s),v=i,b=s),e+=2;else if("H"===a)od(v,b,v=i,b),e+=1;else if("V"===a)od(v,b,v,b=i+(o?b-v:0)),e+=1;else if("L"===a||"Z"===a)"Z"===a&&(i=h,s=l,r.closed=!0),("L"===a||.5<U(v-i)||.5<U(b-s))&&(od(v,b,i,s),"L"===a&&(e+=2)),v=i,b=s;else if("A"===a){if(g=_[e+4],f=_[e+5],c=_[e+6],d=_[e+7],n=7,1<g.length&&(g.length<3?(d=c,c=f,n--):(d=f,c=g.substr(2),n-=2),f=g.charAt(1),g=g.charAt(0)),u=arcToSegment(v,b,+_[e+1],+_[e+2],+_[e+3],+g,+f,(o?v:0)+1*c,(o?b:0)+1*d),e+=n,u)for(n=0;n<u.length;n++)r.push(u[n]);v=r[r.length-2],b=r[r.length-1]}else console.log(A);return(e=r.length)<6?(m.pop(),e=0):r[0]===r[e-2]&&r[1]===r[e-1]&&(r.closed=!0),m.totalPoints=P+e,m}function bezierToPoints(t,e,n,i,s,a,o,r,h,l,c){var d,u=(t+n)/2,p=(e+i)/2,g=(n+s)/2,f=(i+a)/2,_=(s+o)/2,m=(a+r)/2,v=(u+g)/2,b=(p+f)/2,y=(g+_)/2,P=(f+m)/2,A=(v+y)/2,w=(b+P)/2,x=o-t,S=r-e,C=U((n-o)*S-(i-r)*x),E=U((s-o)*S-(a-r)*x);return l||(l=[t,e,o,r],c=2),l.splice(c||l.length-2,0,A,w),h*(x*x+S*S)<(C+E)*(C+E)&&(d=l.length,bezierToPoints(t,e,u,p,v,b,A,w,h,l,c),bezierToPoints(A,w,y,P,_,m,o,r,h,l,c+2+(l.length-d))),l}function pointsToSegment(t,e,n){var i,s,a,r,h,l,c,d,u,p,g,f,_,m,v=t.length-2,b=+t[0],y=+t[1],P=+t[2],A=+t[3],w=[b,y,b,y],x=P-b,S=A-y,C=Math.abs(t[v]-b)<.001&&Math.abs(t[v+1]-y)<.001;for(isNaN(n)&&(n=Math.PI/10),C&&(t.push(P,A),P=b,A=y,b=t[v-2],y=t[v-1],t.unshift(b,y),v+=4),e=e||0===e?+e:1,h=2;h<v;h+=2)i=b,s=y,b=P,y=A,f=(l=x)*l+(d=S)*d,_=(x=(P=+t[h+2])-b)*x+(S=(A=+t[h+3])-y)*S,m=(c=P-i)*c+(u=A-s)*u,g=(a=Math.acos((f+_-m)/$(4*f*_)))/Math.PI*e,p=$(f)*g,g*=$(_),b===i&&y===s||(n<a?(r=E(u,c),w.push(o(b-F(r)*p),o(y-W(r)*p),o(b),o(y),o(b+F(r)*g),o(y+W(r)*g))):(r=E(d,l),w.push(o(b-F(r)*p),o(y-W(r)*p)),r=E(S,x),w.push(o(b),o(y),o(b+F(r)*g),o(y+W(r)*g))));return w.push(o(P),o(A),o(P),o(A)),C&&(w.splice(0,6),w.length=w.length-6),w}function simplifyPoints(t,e){var n,i,s,a,o,r,h,l=parseFloat(t[0]),c=parseFloat(t[1]),d=[l,c],u=t.length-2;for(e=Math.pow(e||1,2),n=2;n<u;n+=2)e<(a=l-(i=parseFloat(t[n])))*a+(o=c-(s=parseFloat(t[n+1])))*o&&(d.push(i,s),l=i,c=s);return d.push(parseFloat(t[u]),parseFloat(t[1+u])),function simplifyStep(t,e,n,i,s){var a,o,r,h,l,c,d,u,p,g,f,_,m=i,v=t[e],b=t[e+1],y=t[n],P=t[n+1];for(o=e+2;o<n;o+=2)h=t[o],l=t[o+1],g=void 0,_=(p=P)-(d=b),((f=(u=y)-(c=v))||_)&&(1<(g=((h-c)*f+(l-d)*_)/(f*f+_*_))?(c=u,d=p):0<g&&(c+=f*g,d+=_*g)),m<(r=Math.pow(h-c,2)+Math.pow(l-d,2))&&(a=o,m=r);i<m&&(2<a-e&&simplifyStep(t,e,a,i,s),s.push(t[a],t[a+1]),2<n-a&&simplifyStep(t,a,n,i,s))}(d,0,h=d.length-2,e,r=[d[0],d[1]]),r.push(d[h],d[1+h]),r}function getClosestProgressOnBezier(t,e,n,i,s,a,o,r,h,l,c,d,u,p){var g,f,_,m,v=(s-i)/a,b=0,y=i;for(P=A;y<=s;)(g=(f=(m=1-y)*m*m*o+3*m*m*y*h+3*m*y*y*c+y*y*y*u-e)*f+(_=m*m*m*r+3*m*m*y*l+3*m*y*y*d+y*y*y*p-n)*_)<P&&(P=g,b=y),y+=v;return 1<t?getClosestProgressOnBezier(t-1,e,n,Math.max(b-v,0),Math.min(b+v,1),a,o,r,h,l,c,d,u,p):b}function B(t){var e=t.ownerDocument||t;!(b in t.style)&&"msTransform"in t.style&&(y=(b="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(g=window,m=new k,e){f=(u=e).documentElement,_=e.body;var n=e.createElement("div"),i=e.createElement("div");_.appendChild(n),n.appendChild(i),n.style.position="static",n.style[b]="translate3d(0,0,1px)",v=i.offsetParent!==n,_.removeChild(n)}return e}function H(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)}function J(t,e){if(t.parentNode&&(u||B(t))){var n=H(t),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?e?"rect":"g":"div",a=2!==e?0:100,o=3===e?100:0,r="position:absolute;display:block;pointer-events:none;",h=u.createElementNS?u.createElementNS(i.replace(/^https/,"http"),s):u.createElement(s);return e&&(n?(d=d||J(t),h.setAttribute("width",.01),h.setAttribute("height",.01),h.setAttribute("transform","translate("+a+","+o+")"),d.appendChild(h)):(c||((c=J(t)).style.cssText=r),h.style.cssText=r+"width:0.1px;height:0.1px;top:"+o+"px;left:"+a+"px",c.appendChild(h))),h}throw"Need document and parent."}function L(t,e){var n,i,s,a,o,r=H(t),h=t===r,l=r?S:C;if(t===g)return t;if(l.length||l.push(J(t,1),J(t,2),J(t,3)),n=r?d:c,r)s=h?{x:0,y:0}:t.getBBox(),o=(i=t.transform?t.transform.baseVal:{}).numberOfItems?(a=(i=1<i.numberOfItems?function _consolidate(t){for(var e=new k,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e}(i):i.getItem(0).matrix).a*s.x+i.c*s.y,i.b*s.x+i.d*s.y):(i=m,a=s.x,s.y),e&&"g"===t.tagName.toLowerCase()&&(a=o=0),n.setAttribute("transform","matrix("+i.a+","+i.b+","+i.c+","+i.d+","+(i.e+a)+","+(i.f+o)+")"),(h?r:t.parentNode).appendChild(n);else{if(a=o=0,v)for(i=t.offsetParent,s=t;(s=s&&s.parentNode)&&s!==i&&s.parentNode;)4<(g.getComputedStyle(s)[b]+"").length&&(a=s.offsetLeft,o=s.offsetTop,s=0);(s=n.style).top=t.offsetTop-o+"px",s.left=t.offsetLeft-a+"px",i=g.getComputedStyle(t),s[b]=i[b],s[y]=i[y],s.border=i.border,s.borderLeftStyle=i.borderLeftStyle,s.borderTopStyle=i.borderTopStyle,s.borderLeftWidth=i.borderLeftWidth,s.borderTopWidth=i.borderTopWidth,s.position="fixed"===i.position?"fixed":"absolute",t.parentNode.appendChild(n)}return n}function M(t,e,n,i,s,a,o){return t.a=e,t.b=n,t.c=i,t.d=s,t.e=a,t.f=o,t}var u,g,f,_,c,d,m,v,e,b="transform",y=b+"Origin",S=[],C=[],k=((e=Matrix2D.prototype).inverse=function inverse(){var t=this.a,e=this.b,n=this.c,i=this.d,s=this.e,a=this.f,o=t*i-e*n||1e-10;return M(this,i/o,-e/o,-n/o,t/o,(n*a-i*s)/o,-(t*a-e*s)/o)},e.multiply=function multiply(t){var e=this.a,n=this.b,i=this.c,s=this.d,a=this.e,o=this.f,r=t.a,h=t.c,l=t.b,c=t.d,d=t.e,u=t.f;return M(this,r*e+l*i,r*n+l*s,h*e+c*i,h*n+c*s,a+d*e+u*i,o+d*n+u*s)},e.clone=function clone(){return new Matrix2D(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function equals(t){var e=this.a,n=this.b,i=this.c,s=this.d,a=this.e,o=this.f;return e===t.a&&n===t.b&&i===t.c&&s===t.d&&a===t.e&&o===t.f},e.apply=function apply(t,e){void 0===e&&(e={});var n=t.x,i=t.y,s=this.a,a=this.b,o=this.c,r=this.d,h=this.e,l=this.f;return e.x=n*s+i*o+h||0,e.y=n*a+i*r+l||0,e},Matrix2D);function Matrix2D(t,e,n,i,s,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===s&&(s=0),void 0===a&&(a=0),M(this,t,e,n,i,s,a)}function getGlobalMatrix(t,e,n){if(!t||!t.parentNode||(u||B(t)).documentElement===t)return new k;var i=function _forceNonZeroScale(t){for(var e,n;t&&t!==_;)(n=t._gsap)&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e}(t.parentNode),s=H(t)?S:C,a=L(t,n),o=s[0].getBoundingClientRect(),r=s[1].getBoundingClientRect(),h=s[2].getBoundingClientRect(),l=a.parentNode,c=function _isFixed(t){return"fixed"===g.getComputedStyle(t).position||((t=t.parentNode)&&1===t.nodeType?_isFixed(t):void 0)}(t),d=new k((r.left-o.left)/100,(r.top-o.top)/100,(h.left-o.left)/100,(h.top-o.top)/100,o.left+(c?0:function _getDocScrollLeft(){return g.pageXOffset||u.scrollLeft||f.scrollLeft||_.scrollLeft||0}()),o.top+(c?0:function _getDocScrollTop(){return g.pageYOffset||u.scrollTop||f.scrollTop||_.scrollTop||0}()));if(l.removeChild(a),i)for(o=i.length;o--;)(r=i[o]).scaleX=r.scaleY=0,r.renderTransform(1,r);return e?d.inverse():d}function Z(){return!1}function ka(t){t.preventDefault&&(t.preventDefault(),t.preventManipulation&&t.preventManipulation())}function la(t){return D.createElementNS?D.createElementNS("http://www.w3.org/1999/xhtml",t):D.createElement(t)}function ma(t,e,n){var i,s=D.createElementNS("http://www.w3.org/2000/svg",t),a=/([a-z])([A-Z])/g;for(i in(n=n||{}).class=n.class||"path-editor",n)void 0!==s.style[i]?s.style[i]=n[i]:s.setAttributeNS(null,i.replace(a,"$1-$2").toLowerCase(),n[i]);return e.appendChild(s),s}function oa(t){return(t.transform&&t.transform.baseVal.consolidate()||s).matrix}function ra(t){return~~(1e3*t+(t<0?-.5:.5))/1e3}function ua(t){if(!t.target._gsSelection&&!et&&100<Q()-tt){for(var e=ot.length;-1<--e;)ot[e].deselect();ot.length=0}}function ya(t,e,n,i){if(t.addEventListener){var s=O[e];i=i||{passive:!1},t.addEventListener(s||e,n,i),s&&e!==s&&"pointer"!==s.substr(0,7)&&t.addEventListener(e,n,i)}else t.attachEvent&&t.attachEvent("on"+e,n)}function za(t,e,n){if(t.removeEventListener){var i=O[e];t.removeEventListener(i||e,n),i&&e!==i&&"pointer"!==i.substr(0,7)&&t.removeEventListener(e,n)}else t.detachEvent&&t.detachEvent("on"+e,n)}function Ba(t){a=t.touches&&_dragCount<t.touches.length,za(t.target,"touchend",Ba)}function Ca(t){a=t.touches&&_dragCount<t.touches.length,ya(t.target,"touchend",Ba)}function Da(e,n){return function(t){return e.call(n,t)}}function Ea(t,e,n){var i=e.vars[t];return i&&i.call(e.vars.callbackScope||e,n||e),e}function Ga(){G.style.display="block",G.select(),G.style.display="none"}function Ja(t){var e,n,i=this,s=getGlobalMatrix(i.target.parentNode,!0);this._matrix=this.target.transform.baseVal.getItem(0).matrix,this._ctm=s,O[t.type]?(e=-1!==t.type.indexOf("touch")?t.currentTarget||t.target:D,ya(e,"touchend",i._onRelease),ya(e,"touchmove",i._onMove),ya(e,"touchcancel",i._onRelease),ya(D,"touchstart",Ca),ya(T,"touchforcechange",ka)):(e=null,ya(D,"mousemove",i._onMove)),h||ya(D,"mouseup",i._onRelease),ka(t),Ga(),t.changedTouches?(t=i.touch=t.changedTouches[0],i.touchID=t.identifier):t.pointerId?i.touchID=t.pointerId:i.touch=i.touchID=null,i._startPointerY=i.pointerY=t.pageY,i._startPointerX=i.pointerX=t.pageX,i._startElementX=i._matrix.e,i._startElementY=i._matrix.f,1===this._ctm.a&&0===this._ctm.b&&0===this._ctm.c&&1===this._ctm.d?this._ctm=null:(n=i._startPointerX*this._ctm.a+i._startPointerY*this._ctm.c+this._ctm.e,i._startPointerY=i._startPointerX*this._ctm.b+i._startPointerY*this._ctm.d+this._ctm.f,i._startPointerX=n),i.isPressed=et=!0,i.touchEventTarget=e,i.vars.onPress&&i.vars.onPress.call(i.vars.callbackScope||i,i.pointerEvent)}function Ka(t){var e,n,i=this,s=t;if(i._enabled&&!a&&i.isPressed&&t){if(e=(i.pointerEvent=t).changedTouches){if((t=e[0])!==i.touch&&t.identifier!==i.touchID){for(n=e.length;-1<--n&&(t=e[n]).identifier!==i.touchID;);if(n<0)return}}else if(t.pointerId&&i.touchID&&t.pointerId!==i.touchID)return;ka(s),i.setPointerPosition(t.pageX,t.pageY),i.vars.onDrag&&i.vars.onDrag.call(i.vars.callbackScope||i,i.pointerEvent)}}function La(t,e){var n=this;if(n._enabled&&n.isPressed&&(!t||null==n.touchID||e||!(t.pointerId&&t.pointerId!==n.touchID||t.changedTouches&&!function _hasTouchID(t,e){for(var n=t.length;-1<--n;)if(t[n].identifier===e)return!0;return!1}(t.changedTouches,n.touchID)))){!function _interacted(){tt=Q()}(),n.isPressed=et=!1;var i,s,a=t,o=n.isDragging,r=n.touchEventTarget;if(r?(za(r,"touchend",n._onRelease),za(r,"touchmove",n._onMove),za(r,"touchcancel",n._onRelease),za(D,"touchstart",Ca)):za(D,"mousemove",n._onMove),h||(za(D,"mouseup",n._onRelease),t&&t.target&&za(t.target,"mouseup",n._onRelease)),o?n.isDragging=!1:n.vars.onClick&&n.vars.onClick.call(n.vars.callbackScope||n,a),t){if((i=t.changedTouches)&&(t=i[0])!==n.touch&&t.identifier!==n.touchID){for(s=i.length;-1<--s&&(t=i[s]).identifier!==n.touchID;);if(s<0)return}n.pointerEvent=a,n.pointerX=t.pageX,n.pointerY=t.pageY}return a&&!o&&n.vars.onDragRelease?n.vars.onDragRelease.call(n,n.pointerEvent):(a&&ka(a),n.vars.onRelease&&n.vars.onRelease.call(n.vars.callbackScope||n,n.pointerEvent)),o&&n.vars.onDragEnd&&n.vars.onDragEnd.call(n.vars.callbackScope||n,n.pointerEvent),!0}}function Ma(t,e,n,i){var s,a=t[e].length,o=[];for(s=0;s<a;s+=6)o.push(new lt(n,t,e,s,i));return o}function Na(t,e,n){var i=t[n]-t[e],s=t[n+1]-t[e+1];return Math.sqrt(i*i+s*s)}var D,h,T,r,l,R,N,z,X,I,O,G,V,n,q=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,Y="#4e7fff",K=Math.PI/180,Q=Date.now||function(){return(new Date).getTime()},tt=0,et=0,i={},nt=[],it={},st=[],at=",",ot=[],s={matrix:new k},a=0,rt=((n=DraggableSVG.prototype).setPointerPosition=function setPointerPosition(t,e){var n,i,s,a,o;this.pointerX=t,this.pointerY=e,this._ctm&&(o=t*this._ctm.a+e*this._ctm.c+this._ctm.e,e=t*this._ctm.b+e*this._ctm.d+this._ctm.f,t=o),(i=e-this._startPointerY)<1&&-1<i&&(i=0),(n=t-this._startPointerX)<1&&-1<n&&(n=0),s=(1e3*(this._startElementX+n)|0)/1e3,a=(1e3*(this._startElementY+i)|0)/1e3,this.snap&&!N&&(it.x=s,it.y=a,this.snap.call(this,it),s=it.x,a=it.y),this.x===s&&this.y===a||(this._matrix.f=this.y=a,this._matrix.e=this.x=s,!this.isDragging&&this.isPressed&&(this.isDragging=!0,Ea("onDragStart",this,this.pointerEvent)))},n.enabled=function enabled(t){return arguments.length?((this._enabled=t)?(h||ya(this.target,"mousedown",this._onPress),ya(this.target,"touchstart",this._onPress),ya(this.target,"click",this._onClick,!0)):(e=this.isDragging,za(this.target,"mousedown",this._onPress),za(this.target,"touchstart",this._onPress),za(T,"touchforcechange",ka),za(this.target,"click",this._onClick),this.touchEventTarget&&(za(this.touchEventTarget,"touchcancel",this._onRelease),za(this.touchEventTarget,"touchend",this._onRelease),za(this.touchEventTarget,"touchmove",this._onMove)),za(D,"mouseup",this._onRelease),za(D,"mousemove",this._onMove),this.isDragging=this.isPressed=!1,e&&Ea("onDragEnd",this,this.pointerEvent)),this):this._enabled;var e},n.endDrag=function endDrag(t){this._onRelease(t)},DraggableSVG);function DraggableSVG(t,e){this.target="string"==typeof t?D.querySelectorAll(t)[0]:t,this.vars=e||{},this._onPress=Da(Ja,this),this._onMove=Da(Ka,this),this._onRelease=Da(La,this),this.target.setAttribute("transform",(this.target.getAttribute("transform")||"")+" translate(0,0)"),this._matrix=oa(this.target),this.x=this._matrix.e,this.y=this._matrix.f,this.snap=e.snap,isNaN(e.maxX)&&isNaN(e.minX)?this._bounds=0:(this._bounds=1,this.maxX=+e.maxX,this.minX=+e.minX),this.enabled(!0)}var ht,lt=((ht=Anchor.prototype).onPress=function onPress(){Ea("onPress",this)},ht.onClick=function onClick(){Ea("onClick",this)},ht.onDrag=function onDrag(){var t=this.segment;this.vars.onDrag.call(this.vars.callbackScope||this,this,this._draggable.x-t[this.i],this._draggable.y-t[this.i+1])},ht.onDragEnd=function onDragEnd(){Ea("onDragEnd",this)},ht.onRelease=function onRelease(){Ea("onRelease",this)},ht.update=function update(t,e,n){t&&(this.rawPath=t),arguments.length<=1?(e=this.j,n=this.i):(this.j=e,this.i=n);var i=this.smooth,s=this.rawPath[e];this.segment=s,this.smooth=n&&n<s.length-2&&Math.abs(Math.atan2(s[n+1]-s[n-1],s[n]-s[n-2])-Math.atan2(s[n+3]-s[n+1],s[n+2]-s[n]))<.09?2:0,this.smooth!==i&&this.element.setAttribute("d",this.smooth?this.editor._circleHandle:this.editor._squareHandle),this.element.setAttribute("transform","translate("+s[n]+","+s[n+1]+")")},Anchor);function Anchor(t,e,n,i,s){this.editor=t,this.element=ma("path",t._selection,{fill:Y,stroke:Y,strokeWidth:2,vectorEffect:"non-scaling-stroke"}),this.update(e,n,i),this.element._gsSelection=!0,this.vars=s||{},this._draggable=new rt(this.element,{callbackScope:this,onDrag:this.onDrag,snap:this.vars.snap,onPress:this.onPress,onRelease:this.onRelease,onClick:this.onClick,onDragEnd:this.onDragEnd})}var ct,dt=((ct=PathEditor.prototype)._onRelease=function _onRelease(t){var e=this._editingAnchor;e&&(i.x=e.segment[e.i],i.y=e.segment[e.i+1]),za(T,"touchforcechange",ka),Ea("onRelease",this,t)},ct.init=function init(){var t,e,n=this.path.getAttribute("d"),i=stringToRawPath(n),s=this.path.getAttribute("transform")||"translate(0,0)",a=!this._rawPath||i.totalPoints!==this._rawPath.totalPoints||i.length!==this._rawPath.length,o={callbackScope:this,snap:this.vars.anchorSnap,onDrag:this._onDragAnchor,onPress:this._onPressAnchor,onRelease:this._onRelease,onClick:this._onClickAnchor,onDragEnd:this._onDragEndAnchor,maxX:this.vars.maxX,minX:this.vars.minX};if(a&&this._anchors&&this._anchors.length){for(e=0;e<this._anchors.length;e++)this._anchors[e].element.parentNode.removeChild(this._anchors[e].element),this._anchors[e]._draggable.enabled(!1);this._selectedAnchors.length=0}if(this._rawPath=i,a){if(this._anchors=Ma(i,0,this,o),1<(t=i.length))for(e=1;e<t;e++)this._anchors=this._anchors.concat(Ma(i,e,this,o))}else for(e=this._anchors.length;-1<--e;)this._anchors[e].update(i);return this._selection.appendChild(this._handle1),this._selection.appendChild(this._handle2),this._selectionPath.setAttribute("d",n),this._selectionHittest.setAttribute("d",n),this._g.setAttribute("transform",function _getConcatenatedTransforms(t){for(var e=oa(t),n=t.ownerSVGElement;(t=t.parentNode)&&t.ownerSVGElement===n;)e.multiply(oa(t));return"matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")"}(this.path.parentNode)||"translate(0,0)"),this._selection.setAttribute("transform",s),this._selectionHittest.setAttribute("transform",s),this._updateAnchors(),this},ct._saveState=function _saveState(){!function _addHistory(t){var e,n=[],i=t._selectedAnchors;for(e=0;e<i.length;e++)n[e]=i[e].i;nt.unshift({path:t,d:t.path.getAttribute("d"),transform:t.path.getAttribute("transform")||"",selectedIndexes:n}),30<nt.length&&(nt.length=30)}(this)},ct._onClickSelectionPath=function _onClickSelectionPath(t){if("hidden"===this._selection.style.visibility)this.select();else if(R||t&&t.altKey){var e,n,i,s,a,r,h={callbackScope:this,snap:this.vars.anchorSnap,onDrag:this._onDragAnchor,onPress:this._onPressAnchor,onRelease:this._onRelease,onClick:this._onClickAnchor,onDragEnd:this._onDragEndAnchor,maxX:this.vars.maxX,minX:this.vars.minX},l=this._selection.getScreenCTM().inverse();for(this._draggable&&this._draggable._onRelease(t),l&&(s=t.clientX*l.a+t.clientY*l.c+l.e,a=t.clientX*l.b+t.clientY*l.d+l.f),r=function getClosestData(t,e,n,i){var s,a,o,r,h={j:0,i:0,t:0},l=A;for(a=0;a<t.length;a++)for(r=t[a],s=0;s<r.length;s+=6)o=getClosestProgressOnBezier(1,e,n,0,1,i||20,r[s],r[s+1],r[s+2],r[s+3],r[s+4],r[s+5],r[s+6],r[s+7]),P<l&&(l=P,h.j=a,h.i=s,h.t=o);return h}(this._rawPath,s,a),function subdivideSegment(t,e,n){if(n<=0||1<=n)return 0;var i=t[e],s=t[e+1],a=t[e+2],r=t[e+3],h=t[e+4],l=t[e+5],c=i+(a-i)*n,d=a+(h-a)*n,u=s+(r-s)*n,p=r+(l-r)*n,g=c+(d-c)*n,f=u+(p-u)*n,_=h+(t[e+6]-h)*n,m=l+(t[e+7]-l)*n;return d+=(_-d)*n,p+=(m-p)*n,t.splice(e+2,4,o(c),o(u),o(g),o(f),o(g+(d-g)*n),o(f+(p-f)*n),o(d),o(p),o(_),o(m)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}(this._rawPath[r.j],r.i,r.t),e=r.i+6,n=0;n<this._anchors.length;n++)this._anchors[n].i>=e&&(this._anchors[n].i+=6);i=new lt(this,this._rawPath,r.j,e,h),this._selection.appendChild(this._handle1),this._selection.appendChild(this._handle2),i._draggable._onPress(t),X=i,this._anchors.push(i),this._selectedAnchors.length=0,this._selectedAnchors.push(i),this._updateAnchors(),this.update(),this._saveState()}Ga(),ya(T,"touchforcechange",ka),Ea("onPress",this)},ct._onClickHandle1=function _onClickHandle1(){var t=this._editingAnchor,e=t.i,n=t.segment;R&&Math.abs(n[e]-n[e-2])<5&&Math.abs(n[e+1]-n[e-1])<5&&this._onClickAnchor(t)},ct._onClickHandle2=function _onClickHandle2(){var t=this._editingAnchor,e=t.i,n=t.segment;R&&Math.abs(n[e]-n[e+2])<5&&Math.abs(n[e+1]-n[e+3])<5&&this._onClickAnchor(t)},ct._onDragEndAnchor=function _onDragEndAnchor(){X=null,this._saveState()},ct.isSelected=function isSelected(){return 0<this._selectedAnchors.length},ct.select=function select(t){if(this._selection.style.visibility="visible",this._editingAnchor=null,(this.path._gsSelection=!0)===t)for(var e=this._anchors.length;-1<--e;)this._selectedAnchors[e]=this._anchors[e];return-1===ot.indexOf(this)&&ot.push(this),this._updateAnchors(),this},ct.deselect=function deselect(){return this._selection.style.visibility="hidden",this._selectedAnchors.length=0,this._editingAnchor=null,this.path._gsSelection=!1,ot.splice(ot.indexOf(this),1),this._updateAnchors(),this},ct._onDragPath=function _onDragPath(){var t=this._selectionHittest.getAttribute("transform")||"translate(0,0)";this._selection.setAttribute("transform",t),this.path.setAttribute("transform",t)},ct._onPressAnchor=function _onPressAnchor(t){-1===this._selectedAnchors.indexOf(t)?(N||(this._selectedAnchors.length=0),this._selectedAnchors.push(t)):N&&(this._selectedAnchors.splice(this._selectedAnchors.indexOf(t),1),t._draggable.endDrag()),i.x=t.segment[t.i],i.y=t.segment[t.i+1],this._updateAnchors(),Ea("onPress",this)},ct._deleteSelectedAnchors=function _deleteSelectedAnchors(){for(var t,e,n,i=this._selectedAnchors,s=i.length;-1<--s;)for((t=i[s]).element.parentNode.removeChild(t.element),t._draggable.enabled(!1),(e=t.i)?e<t.segment.length-2?t.segment.splice(e-2,6):t.segment.splice(e-4,6):t.segment.splice(e,6),i.splice(s,1),this._anchors.splice(this._anchors.indexOf(t),1),n=0;n<this._anchors.length;n++)this._anchors[n].i>=e&&(this._anchors[n].i-=6);this._updateAnchors(),this.update(),this._saveState(),this.vars.onDeleteAnchor&&this.vars.onDeleteAnchor.call(this.vars.callbackScope||this)},ct._onClickAnchor=function _onClickAnchor(t){var e,n,i,s,a,o,r=t.i,h=t.segment,l=1e3,c=!r||r>=h.length-2;R&&X!==t&&this._editingAnchor?(t.smooth=!t.smooth,c&&(t.smooth=!1),t.element.setAttribute("d",t.smooth?this._circleHandle:this._squareHandle),t.smooth&&!c?(e=((e=Math.atan2(h[r+1]-h[r-1],h[r]-h[r-2]))+(n=Math.atan2(h[r+3]-h[r+1],h[r+2]-h[r])))/2,i=Na(h,r-2,r),s=Na(h,r,r+2),i<.2&&(i=Na(h,r,r-6)/4,e=n||Math.atan2(h[r+7]-h[r-5],h[r+6]-h[r-6])),s<.2&&(s=Na(h,r,r+6)/4,n=e||Math.atan2(h[r+7]-h[r-5],h[r+6]-h[r-6])),a=Math.sin(e),o=Math.cos(e),Math.abs(n-e)<Math.PI/2&&(a=-a,o=-o),h[r-2]=((h[r]+o*i)*l|0)/l,h[r-1]=((h[r+1]+a*i)*l|0)/l,h[r+2]=((h[r]-o*s)*l|0)/l,h[r+3]=((h[r+1]-a*s)*l|0)/l,this._updateAnchors(),this.update(),this._saveState()):t.smooth||c||(r&&(h[r-2]=h[r],h[r-1]=h[r+1]),r<h.length-2&&(h[r+2]=h[r],h[r+3]=h[r+1]),this._updateAnchors(),this.update(),this._saveState())):N||(this._selectedAnchors.length=0,this._selectedAnchors.push(t)),X=null,this._updateAnchors()},ct._updateAnchors=function _updateAnchors(){var t,e,n,i=1===this._selectedAnchors.length?this._selectedAnchors[0]:null,s=i?i.segment:null;for(this._editingAnchor=i,t=0;t<this._anchors.length;t++)this._anchors[t].element.style.fill=-1!==this._selectedAnchors.indexOf(this._anchors[t])?Y:"white";i&&(this._handle1.setAttribute("d",i.smooth?this._circleHandle:this._squareHandle),this._handle2.setAttribute("d",i.smooth?this._circleHandle:this._squareHandle)),t=i?i.i:0,i&&t?(e=s[t-2],n=s[t-1],this._handle1.style.visibility=this._line1.style.visibility=R||e!==s[t]||n!==s[t+1]?"visible":"hidden",this._handle1.setAttribute("transform","translate("+e+at+n+")"),this._line1.setAttribute("points",e+at+n+at+s[t]+at+s[t+1])):this._handle1.style.visibility=this._line1.style.visibility="hidden",i&&t<s.length-2?(e=s[t+2],n=s[t+3],this._handle2.style.visibility=this._line2.style.visibility=R||e!==s[t]||n!==s[t+1]?"visible":"hidden",this._handle2.setAttribute("transform","translate("+e+at+n+")"),this._line2.setAttribute("points",s[t]+at+s[t+1]+at+e+at+n)):this._handle2.style.visibility=this._line2.style.visibility="hidden"},ct._onPressAlt=function _onPressAlt(){var t=this._editingAnchor;t&&(t.i&&(this._handle1.style.visibility=this._line1.style.visibility="visible"),t.i<t.segment.length-2&&(this._handle2.style.visibility=this._line2.style.visibility="visible"))},ct._onReleaseAlt=function _onReleaseAlt(){var t,e,n=this._editingAnchor;n&&((t=n.segment)[e=n.i]===t[e-2]&&t[e+1]===t[e-1]&&(this._handle1.style.visibility=this._line1.style.visibility="hidden"),t[e]===t[e+2]&&t[e+1]===t[e+3]&&(this._handle2.style.visibility=this._line2.style.visibility="hidden"))},ct._onPressHandle1=function _onPressHandle1(){this._editingAnchor.smooth&&(this._oppositeHandleLength=Na(this._editingAnchor.segment,this._editingAnchor.i,this._editingAnchor.i+2)),Ea("onPress",this)},ct._onPressHandle2=function _onPressHandle2(){this._editingAnchor.smooth&&(this._oppositeHandleLength=Na(this._editingAnchor.segment,this._editingAnchor.i-2,this._editingAnchor.i)),Ea("onPress",this)},ct._onReleaseHandle=function _onReleaseHandle(t){this._onRelease(t),this._saveState()},ct._onDragHandle1=function _onDragHandle1(){var t,e=this._editingAnchor,n=e.segment,i=e.i,s=1e3,a=this._handle1._draggable.x,o=this._handle1._draggable.y;n[i-2]=a=(a*s|0)/s,n[i-1]=o=(o*s|0)/s,e.smooth&&(R?(e.smooth=!1,e.element.setAttribute("d",this._squareHandle),this._handle1.setAttribute("d",this._squareHandle),this._handle2.setAttribute("d",this._squareHandle)):(t=Math.atan2(n[i+1]-o,n[i]-a),a=this._oppositeHandleLength*Math.cos(t),o=this._oppositeHandleLength*Math.sin(t),n[i+2]=((n[i]+a)*s|0)/s,n[i+3]=((n[i+1]+o)*s|0)/s)),this.update()},ct._onDragHandle2=function _onDragHandle2(){var t,e=this._editingAnchor,n=e.segment,i=e.i,s=1e3,a=this._handle2._draggable.x,o=this._handle2._draggable.y;n[i+2]=a=(a*s|0)/s,n[i+3]=o=(o*s|0)/s,e.smooth&&(R?(e.smooth=!1,e.element.setAttribute("d",this._squareHandle),this._handle1.setAttribute("d",this._squareHandle),this._handle2.setAttribute("d",this._squareHandle)):(t=Math.atan2(n[i+1]-o,n[i]-a),a=this._oppositeHandleLength*Math.cos(t),o=this._oppositeHandleLength*Math.sin(t),n[i-2]=((n[i]+a)*s|0)/s,n[i-1]=((n[i+1]+o)*s|0)/s)),this.update()},ct._onDragAnchor=function _onDragAnchor(t,e,n){var i,s,a,o,r=this._selectedAnchors,h=r.length,l=1e3;for(s=0;s<h;s++)i=(o=r[s]).i,a=o.segment,i&&(a[i-2]=((a[i-2]+e)*l|0)/l,a[i-1]=((a[i-1]+n)*l|0)/l),a[i]=((a[i]+e)*l|0)/l,a[i+1]=((a[i+1]+n)*l|0)/l,i<a.length-2&&(a[i+2]=((a[i+2]+e)*l|0)/l,a[i+3]=((a[i+3]+n)*l|0)/l),o!==t&&o.element.setAttribute("transform","translate("+a[i]+at+a[i+1]+")");this.update()},ct.enabled=function enabled(t){if(!arguments.length)return this._enabled;for(var e=this._anchors.length;-1<--e;)this._anchors[e]._draggable.enabled(t);return this._enabled=t,this._handle1._draggable.enabled(t),this._handle2._draggable.enabled(t),this._draggable&&this._draggable.enabled(t),t?this._selection.parentNode||(this.path.ownerSVGElement.appendChild(this._selectionHittest),this.path.ownerSVGElement.appendChild(this._selection),this.init(),this._saveState()):(this.deselect(),this.path.ownerSVGElement.removeChild(this._selectionHittest),this.path.ownerSVGElement.removeChild(this._selection)),this._updateAnchors(),this.update()},ct.update=function update(t){var e,n,i,s,a="",o=this._editingAnchor;if(t&&this.init(),o&&(e=o.i,n=o.segment,e&&(i=n[e-2],s=n[e-1],this._handle1.setAttribute("transform","translate("+i+at+s+")"),this._line1.setAttribute("points",i+at+s+at+n[e]+at+n[e+1])),e<n.length-2&&(i=n[e+2],s=n[e+3],this._handle2.setAttribute("transform","translate("+i+at+s+")"),this._line2.setAttribute("points",n[e]+at+n[e+1]+at+i+at+s))),t)a=this.path.getAttribute("d");else{for(e=0;e<this._rawPath.length;e++)7<(n=this._rawPath[e]).length&&(a+="M"+n[0]+at+n[1]+"C"+n.slice(2).join(at));this.path.setAttribute("d",a),this._selectionPath.setAttribute("d",a),this._selectionHittest.setAttribute("d",a)}return this.vars.onUpdate&&this._enabled&&Ea("onUpdate",this,a),this},ct.getRawPath=function getRawPath(t,e,n){if(t){var i=oa(this.path);return transformRawPath(copyRawPath(this._rawPath),1,0,0,1,i.e+(e||0),i.f+(n||0))}return this._rawPath},ct.getString=function getString(t,e,n){if(t){var i=oa(this.path);return function rawPathToString(t){!function _isNumber(t){return"number"==typeof t}(t[0])||(t=[t]);var e,n,i,s,a="",r=t.length;for(n=0;n<r;n++){for(s=t[n],a+="M"+o(s[0])+","+o(s[1])+" C",e=s.length,i=2;i<e;i++)a+=o(s[i++])+","+o(s[i++])+" "+o(s[i++])+","+o(s[i++])+" "+o(s[i++])+","+o(s[i])+" ";s.closed&&(a+="z")}return a}(transformRawPath(copyRawPath(this._rawPath),1,0,0,1,i.e+(e||0),i.f+(n||0)))}return this.path.getAttribute("d")},ct.getNormalizedSVG=function getNormalizedSVG(t,e,n,i){var s,a,o,r,h,l,c=this._rawPath[0],d=-1*c[0],u=0===e?0:-(e||c[1]),p=c.length,g=1/(c[p-2]+d),f=-t||c[p-1]+u;for(f=f?1/f:-g,g*=1e3,f*=1e3,a=st.length=0;a<p;a+=2)st[a]=((c[a]+d)*g|0)/1e3,st[a+1]=((c[a+1]+u)*f|0)/1e3;if(i){for(s=[],p=st.length,a=2;a<p;a+=6)o=st[a-2],r=st[a-1],h=st[a+4],l=st[a+5],s.push(o,r,h,l),bezierToPoints(o,r,st[a],st[a+1],st[a+2],st[a+3],h,l,.001,s,s.length-2);for(o=s[0],p=s.length,a=2;a<p;a+=2){if((h=s[a])<o||1<h||h<0){i();break}o=h}}return n&&8===p&&0===st[0]&&0===st[1]&&1===st[p-2]&&1===st[p-1]?st.slice(2,6).join(","):(st[2]="C"+st[2],"M"+st.join(","))},PathEditor);function PathEditor(t,e){e=e||{},V||function _initCore(){D=document,T=window,r=D.body,I=la("div"),(G=la("textarea")).style.display="none",r&&r.appendChild(G),O=function(t){for(var e=t.split(","),n=(void 0!==I.onpointerdown?"pointerdown,pointermove,pointerup,pointercancel":void 0!==I.onmspointerdown?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":t).split(","),i={},s=4;-1<--s;)i[e[s]]=n[s],i[n[s]]=e[s];return i}("touchstart,touchmove,touchend,touchcancel"),SVGElement.prototype.getTransformToElement=SVGElement.prototype.getTransformToElement||function(t){return t.getScreenCTM().inverse().multiply(this.getScreenCTM())},D.addEventListener("keydown",function(t){var e,n,i,s,a=t.keyCode||t.which,o=t.key||a;if("Shift"===o||16===a)N=!0;else if("Control"===o||17===a)l=!0;else if("Meta"===o||91===a)z=!0;else if("Alt"===o||18===a)for(R=!0,e=ot.length;-1<--e;)ot[e]._onPressAlt();else if(("z"===o||90===a)&&(l||z)&&1<nt.length){if(nt.shift(),n=nt[0]){for((s=n.path).path.setAttribute("d",n.d),s.path.setAttribute("transform",n.transform),s.init(),i=s._anchors,e=0;e<i.length;e++)-1!==n.selectedIndexes.indexOf(i[e].i)&&s._selectedAnchors.push(i[e]);s._updateAnchors(),s.update(),s.vars.onUndo&&s.vars.onUndo.call(s)}}else if("Delete"===o||"Backspace"===o||8===a||46===a||63272===a||"d"===a&&(l||z))for(e=ot.length;-1<--e;)ot[e]._deleteSelectedAnchors();else if(("a"===o||65===a)&&(z||l))for(e=ot.length;-1<--e;)ot[e].select(!0)},!0),D.addEventListener("keyup",function(t){var e=t.key||t.keyCode||t.which;if("Shift"===e||16===e)N=!1;else if("Control"===e||17===e)l=!1;else if("Meta"===e||91===e)z=!1;else if("Alt"===e||18===e){R=!1;for(var n=ot.length;-1<--n;)ot[n]._onReleaseAlt()}},!0),h=!!T.PointerEvent,ya(D,"mouseup",ua),ya(D,"touchend",ua),ya(D,"touchcancel",Z),ya(T,"touchmove",Z),r&&r.addEventListener("touchstart",Z),V=1}(),this.vars=e,this.path="string"==typeof t?D.querySelectorAll(t)[0]:t,this._g=ma("g",this.path.ownerSVGElement,{class:"path-editor-g path-editor"}),this._selectionHittest=ma("path",this._g,{stroke:"transparent",strokeWidth:16,fill:"none",vectorEffect:"non-scaling-stroke"}),this._selection=e._selection||ma("g",this._g,{class:"path-editor-selection path-editor"}),this._selectionPath=ma("path",this._selection,{stroke:Y,strokeWidth:2,fill:"none",vectorEffect:"non-scaling-stroke"}),this._selectedAnchors=[],this._line1=ma("polyline",this._selection,{stroke:Y,strokeWidth:2,vectorEffect:"non-scaling-stroke"}),this._line2=ma("polyline",this._selection,{stroke:Y,strokeWidth:2,vectorEffect:"non-scaling-stroke"}),this._line1.style.pointerEvents=this._line2.style.pointerEvents=this._selectionPath.style.pointerEvents="none",this._enabled=!0;var n=this.path.parentNode.getScreenCTM().inverse(),i=(n.a+n.d)/2*(e.handleSize||5);this._squareHandle=function _getSquarePathData(t){return["M-"+(t=ra(t)),-t,t,-t,t,t,-t,t+"z"].join(at)}(i),this._circleHandle=function _getCirclePathData(t){var e=ra(.552284749831*t);return"M"+(t=ra(t))+",0C"+[t,e,e,t,0,t,-e,t,-t,e,-t,0,-t,-e,-e,-t,0,-t,e,-t,t,-e,t,0].join(at)+"z"}(1.15*i),this._handle1=ma("path",this._selection,{d:this._squareHandle,fill:Y,stroke:"transparent",strokeWidth:6}),this._handle2=ma("path",this._selection,{d:this._squareHandle,fill:Y,stroke:"transparent",strokeWidth:6}),this._handle1._draggable=new rt(this._handle1,{onDrag:this._onDragHandle1,callbackScope:this,onPress:this._onPressHandle1,onRelease:this._onReleaseHandle,onClick:this._onClickHandle1,snap:e.handleSnap}),this._handle2._draggable=new rt(this._handle2,{onDrag:this._onDragHandle2,callbackScope:this,onPress:this._onPressHandle2,onRelease:this._onReleaseHandle,onClick:this._onClickHandle2,snap:e.handleSnap}),this._handle1.style.visibility=this._handle2.style.visibility="hidden";for(var s=[this._handle1,this._handle2,this._line1,this._line2,this._selection,this._selectionPath,this._selectionHittest],a=s.length;-1<--a;)s[a]._gsSelection=!0;!1!==e.draggable&&(this._draggable=new rt(this._selectionHittest,{callbackScope:this,onPress:this.select,onRelease:this._onRelease,onDrag:this._onDragPath,onDragEnd:this._saveState,maxX:this.vars.maxX,minX:this.vars.minX})),this.init(),this._selection.style.visibility=!1===e.selected?"hidden":"visible",!1!==e.selected&&(this.path._gsSelection=!0,ot.push(this)),this._saveState(),h||(ya(this._selectionHittest,"mousedown",Da(this._onClickSelectionPath,this)),ya(this._selectionHittest,"mouseup",Da(this._onRelease,this))),ya(this._selectionHittest,"touchstart",Da(this._onClickSelectionPath,this)),ya(this._selectionHittest,"touchend",Da(this._onRelease,this))}dt.simplifyPoints=simplifyPoints,dt.pointsToSegment=pointsToSegment,dt.simplifySVG=function(t,e){var n,i,s,a,o,r,h,l,c,d,u,p;if(d=(e=e||{}).tolerance||1,c=e.precision||1/d,p=(void 0===e.cornerThreshold?18:+e.cornerThreshold)*K,"string"!=typeof t&&(t=(n=t).getAttribute("d")),"#"!==t.charAt(0)&&"."!==t.charAt(0)||(n=D.querySelector(t))&&(t=n.getAttribute("d")),i=!1!==e.curved||/[achqstvz]/gi.test(t)?stringToRawPath(t)[0]:t.match(q),!1!==e.curved){for(l=i,i=[],u=l.length,s=2;s<u;s+=6)a=+l[s-2],r=+l[s-1],o=+l[s+4],h=+l[s+5],i.push(ra(a),ra(r),ra(o),ra(h)),bezierToPoints(a,r,+l[s],+l[s+1],+l[s+2],+l[s+3],o,h,1/(2e5*c),i,i.length-2);(i=pointsToSegment(simplifyPoints(i,d),e.curviness,p))[2]="C"+i[2]}else i=simplifyPoints(i,d);return t="M"+i.join(","),n&&n.setAttribute("d",t),t},dt.create=function(t,e){return new dt(t,e)},dt.editingAxis=i,dt.getSnapFunction=function(t){var r=t.radius||2,e=1e20,h=t.x||0===t.x?t.x:t.width?0:-e,l=t.y||0===t.y?t.y:t.height?0:-e,c=h+(t.width||1e40),d=l+(t.height||1e40),u=!1!==t.containX,p=!1!==t.containY,g=t.axis,f=t.gridSize;return r*=r,function(t){var e,n,i,s,a=t.x,o=t.y;u&&a<h||(i=a-h)*i<r?a=h:(u&&c<a||(i=c-a)*i<r)&&(a=c),p&&o<l||(s=o-l)*s<r?o=l:(p&&d<o||(s=d-o)*s<r)&&(o=d),g&&(i=a-g.x,s=o-g.y,i*i<r&&(a=g.x),s*s<r&&(o=g.y)),f&&(i=(e=h+Math.round((a-h)/f)*f)-a)*i+(s=(n=l+Math.round((o-l)/f)*f)-o)*s<r&&(a=e,o=n),t.x=a,t.y=o}},dt.version="3.4.2";function $a(t){return"string"==typeof t}function _a(t,e){var n=gt.createElementNS?gt.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):gt.createElement(t);return n.style?n:gt.createElement(t)}function fb(t,e,n){return $a(t)&&Pt.test(t)?gt.querySelector(t):Array.isArray(t)?bt(vt([{x:ut.getProperty(e,"x"),y:ut.getProperty(e,"y")}].concat(t),n)):$a(t)||t&&"path"===(t.tagName+"").toLowerCase()?t:0}function kb(t,e){var n="Please gsap.registerPlugin(MotionPathPlugin)";pt=window,ut=ut||t||pt.gsap||console.warn(n),gt=document,_t=gt.body,ft=gt.documentElement,(mt=ut&&ut.plugins.motionPath)?(function _initCopyToClipboard(){(yt=_a("textarea")).style.display="none",_t.appendChild(yt)}(),vt=mt.arrayToRawPath,bt=mt.rawPathToString):!0===e&&console.warn(n)}var ut,pt,gt,ft,_t,mt,vt,bt,yt,Pt=/(^[#\.][a-z]|[a-y][a-z])/i,At={matrix:{a:1,b:0,c:0,d:1,e:0,f:0}},wt=(MotionPathHelper.prototype.getString=function getString(){return this.editor.getString(!0,-this.offset.x,-this.offset.y)},MotionPathHelper);function MotionPathHelper(t,e){void 0===e&&(e={}),mt||kb(e.gsap,1);var n,i,s,a,o,r,h,l,c,d,u,p,g,f=_a("div"),_=this,m={x:0,y:0};t instanceof ut.core.Tween?n=(l=t).targets()[0]:(n=ut.utils.toArray(t)[0],l=function _findMotionPathTween(t){for(var e=ut.getTweensOf(t),n=0;n<e.length;n++){if(e[n].vars.motionPath)return e[n];e[n].timeline&&e.push.apply(e,e[n].timeline.getChildren())}}(n)),i=fb(e.path,n,e),this.offset=m,r=function _getPositionOnPage(t){var e=t.getBoundingClientRect(),n=ft.clientTop-(pt.pageYOffset||ft.scrollTop||_t.scrollTop||0),i=ft.clientLeft-(pt.pageXOffset||ft.scrollLeft||_t.scrollLeft||0);return{left:e.left+i,top:e.top+n,right:e.right+i,bottom:e.bottom+n}}(n),a=parseFloat(ut.getProperty(n,"x","px")),o=parseFloat(ut.getProperty(n,"y","px")),s=n.getCTM&&"svg"!==n.tagName.toLowerCase(),l&&!i&&(i=fb(l.vars.motionPath.path||l.vars.motionPath,n,l.vars.motionPath)),f.setAttribute("class","copy-motion-path"),f.style.cssText="border-radius:8px; background-color:rgba(85, 85, 85, 0.7); color:#fff; cursor:pointer; padding:6px 12px; font-family:Signika Negative, Arial, sans-serif; position:fixed; left:50%; transform:translate(-50%, 0); font-size:19px; bottom:10px",f.innerText="COPY MOTION PATH",f._gsHelper=_,(ut.utils.toArray(e.container)[0]||_t).appendChild(f),function _addCopyToClipboard(n,i,s){n.addEventListener("click",function(t){if(t.target._gsHelper){var e=i(t.target);if((yt.value=e)&&yt.select){console.log(e),yt.style.display="block",yt.select();try{gt.execCommand("copy"),yt.blur(),s&&s(n)}catch(t){console.warn("Copy didn't work; this browser doesn't permit that.")}yt.style.display="none"}}})}(f,function(){return _.getString()},function(){return ut.fromTo(f,{backgroundColor:"white"},{duration:.5,backgroundColor:"rgba(85, 85, 85, 0.6)"})}),(h=i&&i.ownerSVGElement)||(c=s&&n.ownerSVGElement&&n.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg",s?(h=n.ownerSVGElement,d=n.getBBox(),a=(u=function _getConsolidatedMatrix(t){return(t.transform.baseVal.consolidate()||At).matrix}(n)).e,o=u.f,m.x=d.x,m.y=d.y):(h=_a("svg",c),_t.appendChild(h),h.setAttribute("viewBox","0 0 100 100"),h.style.cssText="overflow:visible; background-color: transparent; position:absolute; width:100px; height:100px; top:"+r.top+"px; left:"+r.left+"px;"),d=$a(i)&&!Pt.test(i)?i:function _getInitialPath(t,e){var n,i=[0,31,8,58,24,75,40,90,69,100,100,100];for(n=0;n<i.length;n+=2)i[n]+=t,i[n+1]+=e;return"M"+t+","+e+"C"+i.join(",")}(a,o),(i=_a("path",c)).setAttribute("d",d),i.setAttribute("vector-effect","non-scaling-stroke"),i.style.cssText="fill:transparent; stroke-width:"+(e.pathWidth||3)+"; stroke:"+(e.pathColor||"#555")+"; opacity:"+(e.pathOpacity||.6),h.appendChild(i),(m.x||m.y)&&ut.set(i,{x:m.x,y:m.y})),"selected"in e||(e.selected=!0),"anchorSnap"in e||(e.anchorSnap=function(t){t.x*t.x+t.y*t.y<16&&(t.x=t.y=0)}),g=l&&"nested"===l.parent.data?l.parent.parent:l,e.onPress=function(){g.pause(0)},p=function refreshPath(){l.invalidate(),g.restart()},e.onRelease=e.onDeleteAnchor=p,this.editor=dt.create(i,e),e.center&&ut.set(n,{transformOrigin:"50% 50%",xPercent:-50,yPercent:-50}),l?(l.vars.motionPath.path?l.vars.motionPath.path=i:l.vars.motionPath={path:i},g.parent!==ut.globalTimeline&&ut.globalTimeline.add(g,function _getGlobalTime(t){for(var e=t.totalTime();t;)e=t.startTime()+e/(t.timeScale()||1),t=t.parent;return e}(g)-g.delay()),g.repeat(-1).repeatDelay(1)):l=g=ut.to(n,{motionPath:{path:i,start:e.start||0,end:"end"in e?e.end:1,autoRotate:"autoRotate"in e&&e.autoRotate,align:i,alignOrigin:e.alignOrigin},duration:e.duration||5,ease:e.ease||"power1.inOut",repeat:-1,repeatDelay:1,paused:!e.path}),this.animation=l}wt.register=kb,wt.create=function(t,e){return new wt(t,e)},wt.editPath=function(t,e){return dt.create(t,e)},wt.version="3.4.2",t.MotionPathHelper=wt,t.default=wt;if (typeof(window)==="undefined"||window!==t){Object.defineProperty(t,"__esModule",{value:!0})} else {delete t.default}});