|
`;return function(){var h=new Error("get-stack-trace"),d=h&&h.stack?h.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",E=x.console&&(x.console.warn||x.console.log);return E&&E.call(x.console,a,d),e.apply(this,arguments)}}var z;typeof Object.assign!="function"?z=function(n){if(n===P||n===null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(n),a=1;a<arguments.length;a++){var h=arguments[a];if(h!==P&&h!==null)for(var d in h)h.hasOwnProperty(d)&&(s[d]=h[d])}return s}:z=Object.assign;var qt=Bt(function(n,s,a){for(var h=Object.keys(s),d=0;d<h.length;)(!a||a&&n[h[d]]===P)&&(n[h[d]]=s[h[d]]),d++;return n},"extend","Use `assign`."),ye=Bt(function(n,s){return qt(n,s,!0)},"merge","Use `assign`.");function N(e,n,s){var a=n.prototype,h;h=e.prototype=Object.create(a),h.constructor=e,h._super=a,s&&z(h,s)}function Nt(e,n){return function(){return e.apply(n,arguments)}}function wt(e,n){return typeof e==Te?e.apply(n&&n[0]||P,n):e}function Kt(e,n){return e===P?n:e}function yt(e,n,s){X(xt(n),function(a){e.addEventListener(a,s,!1)})}function Et(e,n,s){X(xt(n),function(a){e.removeEventListener(a,s,!1)})}function Jt(e,n){for(;e;){if(e==n)return!0;e=e.parentNode}return!1}function B(e,n){return e.indexOf(n)>-1}function xt(e){return e.trim().split(/\s+/g)}function st(e,n,s){if(e.indexOf&&!s)return e.indexOf(n);for(var a=0;a<e.length;){if(s&&e[a][s]==n||!s&&e[a]===n)return a;a++}return-1}function _t(e){return Array.prototype.slice.call(e,0)}function k(e,n,s){for(var a=[],h=[],d=0;d<e.length;){var E=n?e[d][n]:e[d];st(h,E)<0&&a.push(e[d]),h[d]=E,d++}return s&&(n?a=a.sort(function(M,L){return M[n]>L[n]}):a=a.sort()),a}function bt(e,n){for(var s,a,h=n[0].toUpperCase()+n.slice(1),d=0;d<Gt.length;){if(s=Gt[d],a=s?s+h:n,a in e)return a;d++}return P}var Ee=1;function lt(){return Ee++}function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||x}var ut=/mobile|tablet|ip(ad|hone|od)|android/i,Lt="ontouchstart"in x,Dt=bt(x,"PointerEvent")!==P,V=Lt&&ut.test(navigator.userAgent),q="touch",xe="pen",kt="mouse",$t="kinect",Rt=25,y=1,K=2,b=4,O=8,St=1,U=2,ct=4,ht=8,rt=16,F=U|ct,J=ht|rt,te=F|J,ee=["x","y"],Ct=["clientX","clientY"];function w(e,n){var s=this;this.manager=e,this.callback=n,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(a){wt(e.options.enable,[e])&&s.handler(a)},this.init()}w.prototype={handler:function(){},init:function(){this.evEl&&yt(this.element,this.evEl,this.domHandler),this.evTarget&&yt(this.target,this.evTarget,this.domHandler),this.evWin&&yt(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Et(this.element,this.evEl,this.domHandler),this.evTarget&&Et(this.target,this.evTarget,this.domHandler),this.evWin&&Et(T(this.element),this.evWin,this.domHandler)}};function ne(e){var n,s=e.options.inputClass;return s?n=s:Dt?n=tt:V?n=Pt:Lt?n=Yt:n=dt,new n(e,zt)}function zt(e,n,s){var a=s.pointers.length,h=s.changedPointers.length,d=n&y&&a-h===0,E=n&(b|O)&&a-h===0;s.isFirst=!!d,s.isFinal=!!E,d&&(e.session={}),s.eventType=n,Ut(e,s),e.emit("hammer.input",s),e.recognize(s),e.session.prevInput=s}function Ut(e,n){var s=e.session,a=n.pointers,h=a.length;s.firstInput||(s.firstInput=jt(n)),h>1&&!s.firstMultiple?s.firstMultiple=jt(n):h===1&&(s.firstMultiple=!1);var d=s.firstInput,E=s.firstMultiple,I=E?E.center:d.center,M=n.center=$(a);n.timeStamp=At(),n.deltaTime=n.timeStamp-d.timeStamp,n.angle=ft(I,M),n.distance=It(I,M),Ft(s,n),n.offsetDirection=Ht(n.deltaX,n.deltaY);var L=Xt(n.deltaTime,n.deltaX,n.deltaY);n.overallVelocityX=L.x,n.overallVelocityY=L.y,n.overallVelocity=G(L.x)>G(L.y)?L.x:L.y,n.scale=E?be(E.pointers,a):1,n.rotation=E?ie(E.pointers,a):0,n.maxPointers=s.prevInput?n.pointers.length>s.prevInput.maxPointers?n.pointers.length:s.prevInput.maxPointers:n.pointers.length,_e(s,n);var Q=e.element;Jt(n.srcEvent.target,Q)&&(Q=n.srcEvent.target),n.target=Q}function Ft(e,n){var s=n.center,a=e.offsetDelta||{},h=e.prevDelta||{},d=e.prevInput||{};(n.eventType===y||d.eventType===b)&&(h=e.prevDelta={x:d.deltaX||0,y:d.deltaY||0},a=e.offsetDelta={x:s.x,y:s.y}),n.deltaX=h.x+(s.x-a.x),n.deltaY=h.y+(s.y-a.y)}function _e(e,n){var s=e.lastInterval||n,a=n.timeStamp-s.timeStamp,h,d,E,I;if(n.eventType!=O&&(a>Rt||s.velocity===P)){var M=n.deltaX-s.deltaX,L=n.deltaY-s.deltaY,Q=Xt(a,M,L);d=Q.x,E=Q.y,h=G(Q.x)>G(Q.y)?Q.x:Q.y,I=Ht(M,L),e.lastInterval=n}else h=s.velocity,d=s.velocityX,E=s.velocityY,I=s.direction;n.velocity=h,n.velocityX=d,n.velocityY=E,n.direction=I}function jt(e){for(var n=[],s=0;s<e.pointers.length;)n[s]={clientX:it(e.pointers[s].clientX),clientY:it(e.pointers[s].clientY)},s++;return{timeStamp:At(),pointers:n,center:$(n),deltaX:e.deltaX,deltaY:e.deltaY}}function $(e){var n=e.length;if(n===1)return{x:it(e[0].clientX),y:it(e[0].clientY)};for(var s=0,a=0,h=0;h<n;)s+=e[h].clientX,a+=e[h].clientY,h++;return{x:it(s/n),y:it(a/n)}}function Xt(e,n,s){return{x:n/e||0,y:s/e||0}}function Ht(e,n){return e===n?St:G(e)>=G(n)?e<0?U:ct:n<0?ht:rt}function It(e,n,s){s||(s=ee);var a=n[s[0]]-e[s[0]],h=n[s[1]]-e[s[1]];return Math.sqrt(a*a+h*h)}function ft(e,n,s){s||(s=ee);var a=n[s[0]]-e[s[0]],h=n[s[1]]-e[s[1]];return Math.atan2(h,a)*180/Math.PI}function ie(e,n){return ft(n[1],n[0],Ct)+ft(e[1],e[0],Ct)}function be(e,n){return It(n[0],n[1],Ct)/It(e[0],e[1],Ct)}var Se={mousedown:y,mousemove:K,mouseup:b},Ce="mousedown",Ie="mousemove mouseup";function dt(){this.evEl=Ce,this.evWin=Ie,this.pressed=!1,w.apply(this,arguments)}N(dt,w,{handler:function(n){var s=Se[n.type];s&y&&n.button===0&&(this.pressed=!0),s&K&&n.which!==1&&(s=b),this.pressed&&(s&b&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[n],changedPointers:[n],pointerType:kt,srcEvent:n}))}});var oe={pointerdown:y,pointermove:K,pointerup:b,pointercancel:O,pointerout:O},se={2:q,3:xe,4:kt,5:$t},re="pointerdown",A="pointermove pointerup pointercancel";x.MSPointerEvent&&!x.PointerEvent&&(re="MSPointerDown",A="MSPointerMove MSPointerUp MSPointerCancel");function tt(){this.evEl=re,this.evWin=A,w.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}N(tt,w,{handler:function(n){var s=this.store,a=!1,h=n.type.toLowerCase().replace("ms",""),d=oe[h],E=se[n.pointerType]||n.pointerType,I=E==q,M=st(s,n.pointerId,"pointerId");d&y&&(n.button===0||I)?M<0&&(s.push(n),M=s.length-1):d&(b|O)&&(a=!0),!(M<0)&&(s[M]=n,this.callback(this.manager,d,{pointers:s,changedPointers:[n],pointerType:E,srcEvent:n}),a&&s.splice(M,1))}});var Pe={touchstart:y,touchmove:K,touchend:b,touchcancel:O},Oe="touchstart",ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=Oe,this.evWin=ae,this.started=!1,w.apply(this,arguments)}N(le,w,{handler:function(n){var s=Pe[n.type];if(s===y&&(this.started=!0),!!this.started){var a=ue.call(this,n,s);s&(b|O)&&a[0].length-a[1].length===0&&(this.started=!1),this.callback(this.manager,s,{pointers:a[0],changedPointers:a[1],pointerType:q,srcEvent:n})}}});function ue(e,n){var s=_t(e.touches),a=_t(e.changedTouches);return n&(b|O)&&(s=k(s.concat(a),"identifier",!0)),[s,a]}var Ae={touchstart:y,touchmove:K,touchend:b,touchcancel:O},Me="touchstart touchmove touchend touchcancel";function Pt(){this.evTarget=Me,this.targetIds={},w.apply(this,arguments)}N(Pt,w,{handler:function(n){var s=Ae[n.type],a=Ne.call(this,n,s);a&&this.callback(this.manager,s,{pointers:a[0],changedPointers:a[1],pointerType:q,srcEvent:n})}});function Ne(e,n){var s=_t(e.touches),a=this.targetIds;if(n&(y|K)&&s.length===1)return a[s[0].identifier]=!0,[s,s];var h,d,E=_t(e.changedTouches),I=[],M=this.target;if(d=s.filter(function(L){return Jt(L.target,M)}),n===y)for(h=0;h<d.length;)a[d[h].identifier]=!0,h++;for(h=0;h<E.length;)a[E[h].identifier]&&I.push(E[h]),n&(b|O)&&delete a[E[h].identifier],h++;if(I.length)return[k(d.concat(I),"identifier",!0),I]}var we=2500,ce=25;function Yt(){w.apply(this,arguments);var e=Nt(this.handler,this);this.touch=new Pt(this.manager,e),this.mouse=new dt(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}N(Yt,w,{handler:function(n,s,a){var h=a.pointerType==q,d=a.pointerType==kt;if(!(d&&a.sourceCapabilities&&a.sourceCapabilities.firesTouchEvents)){if(h)Le.call(this,s,a);else if(d&&De.call(this,a))return;this.callback(n,s,a)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Le(e,n){e&y?(this.primaryTouch=n.changedPointers[0].identifier,Wt.call(this,n)):e&(b|O)&&Wt.call(this,n)}function Wt(e){var n=e.changedPointers[0];if(n.identifier===this.primaryTouch){var s={x:n.clientX,y:n.clientY};this.lastTouches.push(s);var a=this.lastTouches,h=function(){var d=a.indexOf(s);d>-1&&a.splice(d,1)};setTimeout(h,we)}}function De(e){for(var n=e.srcEvent.clientX,s=e.srcEvent.clientY,a=0;a<this.lastTouches.length;a++){var h=this.lastTouches[a],d=Math.abs(n-h.x),E=Math.abs(s-h.y);if(d<=ce&&E<=ce)return!0}return!1}var he=bt(ge.style,"touchAction"),Vt=he!==P,fe="compute",de="auto",mt="manipulation",et="none",pt="pan-x",vt="pan-y",nt=Ot();function Zt(e,n){this.manager=e,this.set(n)}Zt.prototype={set:function(e){e==fe&&(e=this.compute()),Vt&&this.manager.element.style&&nt[e]&&(this.manager.element.style[he]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return X(this.manager.recognizers,function(n){wt(n.options.enable,[n])&&(e=e.concat(n.getTouchAction()))}),ke(e.join(" "))},preventDefaults:function(e){var n=e.srcEvent,s=e.offsetDirection;if(this.manager.session.prevented){n.preventDefault();return}var a=this.actions,h=B(a,et)&&!nt[et],d=B(a,vt)&&!nt[vt],E=B(a,pt)&&!nt[pt];if(h){var I=e.pointers.length===1,M=e.distance<2,L=e.deltaTime<250;if(I&&M&&L)return}if(!(E&&d)&&(h||d&&s&F||E&&s&J))return this.preventSrc(n)},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function ke(e){if(B(e,et))return et;var n=B(e,pt),s=B(e,vt);return n&&s?et:n||s?n?pt:vt:B(e,mt)?mt:de}function Ot(){if(!Vt)return!1;var e={},n=x.CSS&&x.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(s){e[s]=n?x.CSS.supports("touch-action",s):!0}),e}var at=1,D=2,gt=4,Z=8,H=Z,Tt=16,j=32;function Y(e){this.options=z({},this.defaults,e||{}),this.id=lt(),this.manager=null,this.options.enable=Kt(this.options.enable,!0),this.state=at,this.simultaneous={},this.requireFail=[]}Y.prototype={defaults:{},set:function(e){return z(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(ot(e,"recognizeWith",this))return this;var n=this.simultaneous;return e=t(e,this),n[e.id]||(n[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return ot(e,"dropRecognizeWith",this)?this:(e=t(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(ot(e,"requireFailure",this))return this;var n=this.requireFail;return e=t(e,this),st(n,e)===-1&&(n.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(ot(e,"dropRequireFailure",this))return this;e=t(e,this);var n=st(this.requireFail,e);return n>-1&&this.requireFail.splice(n,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var n=this,s=this.state;function a(h){n.manager.emit(h,e)}s<Z&&a(n.options.event+Re(s)),a(n.options.event),e.additionalEvent&&a(e.additionalEvent),s>=Z&&a(n.options.event+Re(s))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=j},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(j|at)))return!1;e++}return!0},recognize:function(e){var n=z({},e);if(!wt(this.options.enable,[this,n])){this.reset(),this.state=j;return}this.state&(H|Tt|j)&&(this.state=at),this.state=this.process(n),this.state&(D|gt|Z|Tt)&&this.tryEmit(n)},process:function(e){},getTouchAction:function(){},reset:function(){}};function Re(e){return e&Tt?"cancel":e&Z?"end":e>?"move":e&D?"start":""}function me(e){return e==rt?"down":e==ht?"up":e==U?"left":e==ct?"right":""}function t(e,n){var s=n.manager;return s?s.get(e):e}function i(){Y.apply(this,arguments)}N(i,Y,{defaults:{pointers:1},attrTest:function(e){var n=this.options.pointers;return n===0||e.pointers.length===n},process:function(e){var n=this.state,s=e.eventType,a=n&(D|gt),h=this.attrTest(e);return a&&(s&O||!h)?n|Tt:a||h?s&b?n|Z:n&D?n|gt:D:j}});function o(){i.apply(this,arguments),this.pX=null,this.pY=null}N(o,i,{defaults:{event:"pan",threshold:10,pointers:1,direction:te},getTouchAction:function(){var e=this.options.direction,n=[];return e&F&&n.push(vt),e&J&&n.push(pt),n},directionTest:function(e){var n=this.options,s=!0,a=e.distance,h=e.direction,d=e.deltaX,E=e.deltaY;return h&n.direction||(n.direction&F?(h=d===0?St:d<0?U:ct,s=d!=this.pX,a=Math.abs(e.deltaX)):(h=E===0?St:E<0?ht:rt,s=E!=this.pY,a=Math.abs(e.deltaY))),e.direction=h,s&&a>n.threshold&&h&n.direction},attrTest:function(e){return i.prototype.attrTest.call(this,e)&&(this.state&D||!(this.state&D)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var n=me(e.direction);n&&(e.additionalEvent=this.options.event+n),this._super.emit.call(this,e)}});function r(){i.apply(this,arguments)}N(r,i,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&D)},emit:function(e){if(e.scale!==1){var n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}this._super.emit.call(this,e)}});function l(){Y.apply(this,arguments),this._timer=null,this._input=null}N(l,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[de]},process:function(e){var n=this.options,s=e.pointers.length===n.pointers,a=e.distance<n.threshold,h=e.deltaTime>n.time;if(this._input=e,!a||!s||e.eventType&(b|O)&&!h)this.reset();else if(e.eventType&y)this.reset(),this._timer=Mt(function(){this.state=H,this.tryEmit()},n.time,this);else if(e.eventType&b)return H;return j},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===H&&(e&&e.eventType&b?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=At(),this.manager.emit(this.options.event,this._input)))}});function u(){i.apply(this,arguments)}N(u,i,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[et]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&D)}});function c(){i.apply(this,arguments)}N(c,i,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:F|J,pointers:1},getTouchAction:function(){return o.prototype.getTouchAction.call(this)},attrTest:function(e){var n=this.options.direction,s;return n&(F|J)?s=e.overallVelocity:n&F?s=e.overallVelocityX:n&J&&(s=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&G(s)>this.options.velocity&&e.eventType&b},emit:function(e){var n=me(e.offsetDirection);n&&this.manager.emit(this.options.event+n,e),this.manager.emit(this.options.event,e)}});function m(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}N(m,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[mt]},process:function(e){var n=this.options,s=e.pointers.length===n.pointers,a=e.distance<n.threshold,h=e.deltaTime<n.time;if(this.reset(),e.eventType&y&&this.count===0)return this.failTimeout();if(a&&h&&s){if(e.eventType!=b)return this.failTimeout();var d=this.pTime?e.timeStamp-this.pTime<n.interval:!0,E=!this.pCenter||It(this.pCenter,e.center)<n.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,!E||!d?this.count=1:this.count+=1,this._input=e;var I=this.count%n.taps;if(I===0)return this.hasRequireFailures()?(this._timer=Mt(function(){this.state=H,this.tryEmit()},n.interval,this),D):H}return j},failTimeout:function(){return this._timer=Mt(function(){this.state=j},this.options.interval,this),j},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==H&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function v(e,n){return n=n||{},n.recognizers=Kt(n.recognizers,v.defaults.preset),new S(e,n)}v.VERSION="2.0.7",v.defaults={domEvents:!1,touchAction:fe,enable:!0,inputTarget:null,inputClass:null,preset:[[u,{enable:!1}],[r,{enable:!1},["rotate"]],[c,{direction:F}],[o,{direction:F},["swipe"]],[m],[m,{event:"doubletap",taps:2},["tap"]],[l]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var p=1,g=2;function S(e,n){this.options=z({},v.defaults,n||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ne(this),this.touchAction=new Zt(this,this.options.touchAction),_(this,!0),X(this.options.recognizers,function(s){var a=this.add(new s[0](s[1]));s[2]&&a.recognizeWith(s[2]),s[3]&&a.requireFailure(s[3])},this)}S.prototype={set:function(e){return z(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?g:p},recognize:function(e){var n=this.session;if(!n.stopped){this.touchAction.preventDefaults(e);var s,a=this.recognizers,h=n.curRecognizer;(!h||h&&h.state&H)&&(h=n.curRecognizer=null);for(var d=0;d<a.length;)s=a[d],n.stopped!==g&&(!h||s==h||s.canRecognizeWith(h))?s.recognize(e):s.reset(),!h&&s.state&(D|gt|Z)&&(h=n.curRecognizer=s),d++}},get:function(e){if(e instanceof Y)return e;for(var n=this.recognizers,s=0;s<n.length;s++)if(n[s].options.event==e)return n[s];return null},add:function(e){if(ot(e,"add",this))return this;var n=this.get(e.options.event);return n&&this.remove(n),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(ot(e,"remove",this))return this;if(e=this.get(e),e){var n=this.recognizers,s=st(n,e);s!==-1&&(n.splice(s,1),this.touchAction.update())}return this},on:function(e,n){if(e!==P&&n!==P){var s=this.handlers;return X(xt(e),function(a){s[a]=s[a]||[],s[a].push(n)}),this}},off:function(e,n){if(e!==P){var s=this.handlers;return X(xt(e),function(a){n?s[a]&&s[a].splice(st(s[a],n),1):delete s[a]}),this}},emit:function(e,n){this.options.domEvents&&R(e,n);var s=this.handlers[e]&&this.handlers[e].slice();if(!(!s||!s.length)){n.type=e,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var a=0;a<s.length;)s[a](n),a++}},destroy:function(){this.element&&_(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function _(e,n){var s=e.element;if(s.style){var a;X(e.options.cssProps,function(h,d){a=bt(s.style,d),n?(e.oldCssProps[a]=s.style[a],s.style[a]=h):s.style[a]=e.oldCssProps[a]||""}),n||(e.oldCssProps={})}}function R(e,n){var s=ve.createEvent("Event");s.initEvent(e,!0,!0),s.gesture=n,n.target.dispatchEvent(s)}z(v,{INPUT_START:y,INPUT_MOVE:K,INPUT_END:b,INPUT_CANCEL:O,STATE_POSSIBLE:at,STATE_BEGAN:D,STATE_CHANGED:gt,STATE_ENDED:Z,STATE_RECOGNIZED:H,STATE_CANCELLED:Tt,STATE_FAILED:j,DIRECTION_NONE:St,DIRECTION_LEFT:U,DIRECTION_RIGHT:ct,DIRECTION_UP:ht,DIRECTION_DOWN:rt,DIRECTION_HORIZONTAL:F,DIRECTION_VERTICAL:J,DIRECTION_ALL:te,Manager:S,Input:w,TouchAction:Zt,TouchInput:Pt,MouseInput:dt,PointerEventInput:tt,TouchMouseInput:Yt,SingleTouchInput:le,Recognizer:Y,AttrRecognizer:i,Tap:m,Pan:o,Swipe:c,Pinch:r,Rotate:u,Press:l,on:yt,off:Et,each:X,merge:ye,extend:qt,assign:z,inherit:N,bindFn:Nt,prefixed:bt});var W=typeof x<"u"?x:typeof self<"u"?self:{};W.Hammer=v,f=function(){return v}.call(Qt,C,Qt,pe),f!==P&&(pe.exports=f)})(window,document,"Hammer")},"./web_src/js/components/RepoContributors.vue":function(pe,Qt,C){"use strict";C.d(Qt,{default:function(){return me}});var f=C("./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js"),x=C("./node_modules/@vue/shared/dist/shared.esm-bundler.js");const ve=t=>(_pushScopeId("data-v-47958124"),t=t(),_popScopeId(),t),ze={class:"ui header tw-flex tw-items-center tw-justify-between"},P=["datetime"],Gt=["datetime"],ge={class:"ui dropdown jump",id:"repo-contributors"},Te={class:"ui basic compact button"},it={class:"not-mobile"},G={class:"menu"},At={class:"tw-flex ui segment main-graph"},Mt={key:0,class:"gt-tc tw-m-auto"},ot={key:0},X={key:1,class:"text red"},Bt={class:"contributor-grid"},z={class:"ui top attached header tw-flex tw-flex-1"},qt={class:"ui right"},ye=["href"],N=["src"],Nt={class:"tw-ml-2"},wt=["href"],Kt={key:1,class:"contributor-name"},yt={class:"tw-text-12 tw-flex tw-gap-1"},Et={key:0},Jt={key:1,class:"text green"},B={key:2,class:"text red"},xt={class:"ui attached segment"};function st(t,i,o,r,l,u){const c=(0,f.g2)("svg-icon"),m=(0,f.g2)("SvgIcon"),v=(0,f.g2)("ChartLine");return(0,f.uX)(),(0,f.CE)("div",null,[(0,f.Lk)("div",ze,[(0,f.Lk)("div",null,[t.xAxisMin>0?((0,f.uX)(),(0,f.CE)("relative-time",{key:0,format:"datetime",year:"numeric",month:"short",day:"numeric",weekday:"",datetime:new Date(t.xAxisMin)},(0,x.v_)(new Date(t.xAxisMin)),9,P)):(0,f.Q3)("v-if",!0),(0,f.eW)(" "+(0,x.v_)(t.isLoading?o.locale.loadingTitle:t.errorText?o.locale.loadingTitleFailed:"-")+" ",1),t.xAxisMax>0?((0,f.uX)(),(0,f.CE)("relative-time",{key:1,format:"datetime",year:"numeric",month:"short",day:"numeric",weekday:"",datetime:new Date(t.xAxisMax)},(0,x.v_)(new Date(t.xAxisMax)),9,Gt)):(0,f.Q3)("v-if",!0)]),(0,f.Lk)("div",null,[(0,f.Q3)(" Contribution type "),(0,f.Lk)("div",ge,[(0,f.Lk)("div",Te,[(0,f.Lk)("span",it,(0,x.v_)(o.locale.filterLabel),1),(0,f.eW)(),(0,f.Lk)("strong",null,(0,x.v_)(o.locale.contributionType[t.type]),1),(0,f.bF)(c,{name:"octicon-triangle-down",size:14})]),(0,f.Lk)("div",G,[(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="commits"}]),"data-value":"commits"},(0,x.v_)(o.locale.contributionType.commits),3),(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="additions"}]),"data-value":"additions"},(0,x.v_)(o.locale.contributionType.additions),3),(0,f.Lk)("div",{class:(0,x.C4)(["item",{selected:t.type==="deletions"}]),"data-value":"deletions"},(0,x.v_)(o.locale.contributionType.deletions),3)])])])]),(0,f.Lk)("div",At,[t.isLoading||t.errorText!==""?((0,f.uX)(),(0,f.CE)("div",Mt,[t.isLoading?((0,f.uX)(),(0,f.CE)("div",ot,[(0,f.bF)(m,{name:"octicon-sync",class:"tw-mr-2 job-status-rotate"}),(0,f.eW)(" "+(0,x.v_)(o.locale.loadingInfo),1)])):((0,f.uX)(),(0,f.CE)("div",X,[(0,f.bF)(m,{name:"octicon-x-circle-fill"}),(0,f.eW)(" "+(0,x.v_)(t.errorText),1)]))])):(0,f.Q3)("v-if",!0),Object.keys(t.totalStats).length!==0?(0,f.bU)([t.totalStats.weeks,t.type],()=>((0,f.uX)(),(0,f.Wv)(v,{key:1,data:u.toGraphData(t.totalStats.weeks),options:u.getOptions("main")},null,8,["data","options"])),i,0):(0,f.Q3)("v-if",!0)]),(0,f.Lk)("div",Bt,[((0,f.uX)(!0),(0,f.CE)(f.FK,null,(0,f.pI)(t.sortedContributors,(p,g,S,_)=>{const R=[t.sortedContributors,t.type];if(_&&_.key===g&&(0,f.Bs)(_,R))return _;const W=((0,f.uX)(),(0,f.CE)("div",{key:g},[(0,f.Lk)("div",z,[(0,f.Lk)("b",qt,"#"+(0,x.v_)(g+1),1),(0,f.Lk)("a",{href:p.home_link},[(0,f.Lk)("img",{class:"ui avatar tw-align-middle",height:"40",width:"40",src:p.avatar_link},null,8,N)],8,ye),(0,f.Lk)("div",Nt,[p.home_link!==""?((0,f.uX)(),(0,f.CE)("a",{key:0,href:p.home_link},[(0,f.Lk)("h4",null,(0,x.v_)(p.name),1)],8,wt)):((0,f.uX)(),(0,f.CE)("h4",Kt,(0,x.v_)(p.name),1)),(0,f.Lk)("p",yt,[p.total_commits?((0,f.uX)(),(0,f.CE)("strong",Et,(0,x.v_)(p.total_commits.toLocaleString())+" "+(0,x.v_)(o.locale.contributionType.commits),1)):(0,f.Q3)("v-if",!0),p.total_additions?((0,f.uX)(),(0,f.CE)("strong",Jt,(0,x.v_)(p.total_additions.toLocaleString())+"++ ",1)):(0,f.Q3)("v-if",!0),p.total_deletions?((0,f.uX)(),(0,f.CE)("strong",B,(0,x.v_)(p.total_deletions.toLocaleString())+"--",1)):(0,f.Q3)("v-if",!0)])])]),(0,f.Lk)("div",xt,[(0,f.Lk)("div",null,[(0,f.bF)(v,{data:u.toGraphData(p.weeks),options:u.getOptions("contributor")},null,8,["data","options"])])])]));return W.memo=R,W},i,1),128))])])}var _t=C("./web_src/js/svg.js"),k=C("./node_modules/chart.js/dist/chart.js"),bt=C("./web_src/js/modules/fetch.js"),Ee=C("./node_modules/hammerjs/hammer.js"),lt=C.n(Ee),T=C("./node_modules/chart.js/dist/chunks/helpers.segment.js");const ut=t=>t&&t.enabled&&t.modifierKey,Lt=(t,i)=>t&&i[t+"Key"],Dt=(t,i)=>t&&!i[t+"Key"];function V(t,i,o){return t===void 0?!0:typeof t=="string"?t.indexOf(i)!==-1:typeof t=="function"?t({chart:o}).indexOf(i)!==-1:!1}function q(t,i){return typeof t=="function"&&(t=t({chart:i})),typeof t=="string"?{x:t.indexOf("x")!==-1,y:t.indexOf("y")!==-1}:{x:!1,y:!1}}function xe(t,i){let o;return function(){return clearTimeout(o),o=setTimeout(t,i),i}}function kt({x:t,y:i},o){const r=o.scales,l=Object.keys(r);for(let u=0;u<l.length;u++){const c=r[l[u]];if(i>=c.top&&i<=c.bottom&&t>=c.left&&t<=c.right)return c}return null}function $t(t,i,o){const{mode:r="xy",scaleMode:l,overScaleMode:u}=t||{},c=kt(i,o),m=q(r,o),v=q(l,o);if(u){const g=q(u,o);for(const S of["x","y"])g[S]&&(v[S]=m[S],m[S]=!1)}if(c&&v[c.axis])return[c];const p=[];return(0,T.F)(o.scales,function(g){m[g.axis]&&p.push(g)}),p}const Rt=new WeakMap;function y(t){let i=Rt.get(t);return i||(i={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},Rt.set(t,i)),i}function K(t){Rt.delete(t)}function b(t,i,o){const r=t.max-t.min,l=r*(i-1),u=t.isHorizontal()?o.x:o.y,c=Math.max(0,Math.min(1,(t.getValueForPixel(u)-t.min)/r||0)),m=1-c;return{min:l*c,max:l*m}}function O(t,i,o,r,l){let u=o[r];if(u==="original"){const c=t.originalScaleLimits[i.id][r];u=(0,T.v)(c.options,c.scale)}return(0,T.v)(u,l)}function St(t,i,o){const r=t.getValueForPixel(i),l=t.getValueForPixel(o);return{min:Math.min(r,l),max:Math.max(r,l)}}function U(t,{min:i,max:o},r,l=!1){const u=y(t.chart),{id:c,axis:m,options:v}=t,p=r&&(r[c]||r[m])||{},{minRange:g=0}=p,S=O(u,t,p,"min",-1/0),_=O(u,t,p,"max",1/0),R=l?Math.max(o-i,g):t.max-t.min,W=(R-o+i)/2;return i-=W,o+=W,i<S?(i=S,o=Math.min(S+R,_)):o>_&&(o=_,i=Math.max(_-R,S)),v.min=i,v.max=o,u.updatedScaleLimits[t.id]={min:i,max:o},t.parse(i)!==t.min||t.parse(o)!==t.max}function ct(t,i,o,r){const l=b(t,i,o),u={min:t.min+l.min,max:t.max-l.max};return U(t,u,r,!0)}function ht(t,i,o,r){U(t,St(t,i,o),r,!0)}const rt=t=>t===0||isNaN(t)?0:t<0?Math.min(Math.round(t),-1):Math.max(Math.round(t),1);function F(t){const o=t.getLabels().length-1;t.min>0&&(t.min-=1),t.max<o&&(t.max+=1)}function J(t,i,o,r){const l=b(t,i,o);t.min===t.max&&i<1&&F(t);const u={min:t.min+rt(l.min),max:t.max-rt(l.max)};return U(t,u,r,!0)}function te(t){return t.isHorizontal()?t.width:t.height}function ee(t,i,o){const l=t.getLabels().length-1;let{min:u,max:c}=t;const m=Math.max(c-u,1),v=Math.round(te(t)/Math.max(m,10)),p=Math.round(Math.abs(i/v));let g;return i<-v?(c=Math.min(c+p,l),u=m===1?c:c-m,g=c===l):i>v&&(u=Math.max(0,u-p),c=m===1?u:u+m,g=u===0),U(t,{min:u,max:c},o)||g}const Ct={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function w(t,i,o,r=!1){const{min:l,max:u,options:c}=t,m=c.time&&c.time.round,v=Ct[m]||0,p=t.getValueForPixel(t.getPixelForValue(l+v)-i),g=t.getValueForPixel(t.getPixelForValue(u+v)-i),{min:S=-1/0,max:_=1/0}=r&&o&&o[t.axis]||{};return isNaN(p)||isNaN(g)||p<S||g>_?!0:U(t,{min:p,max:g},o,r)}function ne(t,i,o){return w(t,i,o,!0)}const zt={category:J,default:ct},Ut={default:ht},Ft={category:ee,default:w,logarithmic:ne,timeseries:ne};function _e(t,i,o){const{id:r,options:{min:l,max:u}}=t;if(!i[r]||!o[r])return!0;const c=o[r];return c.min!==l||c.max!==u}function jt(t,i){(0,T.F)(t,(o,r)=>{i[r]||delete t[r]})}function $(t,i){const{scales:o}=t,{originalScaleLimits:r,updatedScaleLimits:l}=i;return(0,T.F)(o,function(u){_e(u,r,l)&&(r[u.id]={min:{scale:u.min,options:u.options.min},max:{scale:u.max,options:u.options.max}})}),jt(r,o),jt(l,o),r}function Xt(t,i,o,r){const l=zt[t.type]||zt.default;(0,T.Q)(l,[t,i,o,r])}function Ht(t,i,o,r,l){const u=Ut[t.type]||Ut.default;(0,T.Q)(u,[t,i,o,r,l])}function It(t){const i=t.chartArea;return{x:(i.left+i.right)/2,y:(i.top+i.bottom)/2}}function ft(t,i,o="none"){const{x:r=1,y:l=1,focalPoint:u=It(t)}=typeof i=="number"?{x:i,y:i}:i,c=y(t),{options:{limits:m,zoom:v}}=c;$(t,c);const p=r!==1,g=l!==1,S=$t(v,u,t);(0,T.F)(S||t.scales,function(_){_.isHorizontal()&&p?Xt(_,r,u,m):!_.isHorizontal()&&g&&Xt(_,l,u,m)}),t.update(o),(0,T.Q)(v.onZoom,[{chart:t}])}function ie(t,i,o,r="none"){const l=y(t),{options:{limits:u,zoom:c}}=l,{mode:m="xy"}=c;$(t,l);const v=V(m,"x",t),p=V(m,"y",t);(0,T.F)(t.scales,function(g){g.isHorizontal()&&v?Ht(g,i.x,o.x,u):!g.isHorizontal()&&p&&Ht(g,i.y,o.y,u)}),t.update(r),(0,T.Q)(c.onZoom,[{chart:t}])}function be(t,i,o,r="none"){$(t,y(t));const l=t.scales[i];U(l,o,void 0,!0),t.update(r)}function Se(t,i="default"){const o=y(t),r=$(t,o);(0,T.F)(t.scales,function(l){const u=l.options;r[l.id]?(u.min=r[l.id].min.options,u.max=r[l.id].max.options):(delete u.min,delete u.max)}),t.update(i),(0,T.Q)(o.options.zoom.onZoomComplete,[{chart:t}])}function Ce(t,i){const o=t.originalScaleLimits[i];if(!o)return;const{min:r,max:l}=o;return(0,T.v)(l.options,l.scale)-(0,T.v)(r.options,r.scale)}function Ie(t){const i=y(t);let o=1,r=1;return(0,T.F)(t.scales,function(l){const u=Ce(i,l.id);if(u){const c=Math.round(u/(l.max-l.min)*100)/100;o=Math.min(o,c),r=Math.max(r,c)}}),o<1?o:r}function dt(t,i,o,r){const{panDelta:l}=r,u=l[t.id]||0;(0,T.s)(u)===(0,T.s)(i)&&(i+=u);const c=Ft[t.type]||Ft.default;(0,T.Q)(c,[t,i,o])?l[t.id]=0:l[t.id]=i}function oe(t,i,o,r="none"){const{x:l=0,y:u=0}=typeof i=="number"?{x:i,y:i}:i,c=y(t),{options:{pan:m,limits:v}}=c,{onPan:p}=m||{};$(t,c);const g=l!==0,S=u!==0;(0,T.F)(o||t.scales,function(_){_.isHorizontal()&&g?dt(_,l,v,c):!_.isHorizontal()&&S&&dt(_,u,v,c)}),t.update(r),(0,T.Q)(p,[{chart:t}])}function se(t){const i=y(t);$(t,i);const o={};for(const r of Object.keys(t.scales)){const{min:l,max:u}=i.originalScaleLimits[r]||{min:{},max:{}};o[r]={min:l.scale,max:u.scale}}return o}function re(t){const i=se(t);for(const o of Object.keys(t.scales)){const{min:r,max:l}=i[o];if(r!==void 0&&t.scales[o].min!==r||l!==void 0&&t.scales[o].max!==l)return!0}return!1}function A(t,i){const{handlers:o}=y(t),r=o[i];r&&r.target&&(r.target.removeEventListener(i,r),delete o[i])}function tt(t,i,o,r){const{handlers:l,options:u}=y(t),c=l[o];c&&c.target===i||(A(t,o),l[o]=m=>r(t,m,u),l[o].target=i,i.addEventListener(o,l[o]))}function Pe(t,i){const o=y(t);o.dragStart&&(o.dragging=!0,o.dragEnd=i,t.update("none"))}function Oe(t,i){const o=y(t);!o.dragStart||i.key!=="Escape"||(A(t,"keydown"),o.dragging=!1,o.dragStart=o.dragEnd=null,t.update("none"))}function ae(t,i,o){const{onZoomStart:r,onZoomRejected:l}=o;if(r){const u=(0,T.z)(i,t);if((0,T.Q)(r,[{chart:t,event:i,point:u}])===!1)return(0,T.Q)(l,[{chart:t,event:i}]),!1}}function le(t,i){const o=y(t),{pan:r,zoom:l={}}=o.options;if(i.button!==0||Lt(ut(r),i)||Dt(ut(l.drag),i))return(0,T.Q)(l.onZoomRejected,[{chart:t,event:i}]);ae(t,i,l)!==!1&&(o.dragStart=i,tt(t,t.canvas,"mousemove",Pe),tt(t,window.document,"keydown",Oe))}function ue(t,i,o,r){const l=V(i,"x",t),u=V(i,"y",t);let{top:c,left:m,right:v,bottom:p,width:g,height:S}=t.chartArea;const _=(0,T.z)(o,t),R=(0,T.z)(r,t);l&&(m=Math.min(_.x,R.x),v=Math.max(_.x,R.x)),u&&(c=Math.min(_.y,R.y),p=Math.max(_.y,R.y));const W=v-m,e=p-c;return{left:m,top:c,right:v,bottom:p,width:W,height:e,zoomX:l&&W?1+(g-W)/g:1,zoomY:u&&e?1+(S-e)/S:1}}function Ae(t,i){const o=y(t);if(!o.dragStart)return;A(t,"mousemove");const{mode:r,onZoomComplete:l,drag:{threshold:u=0}}=o.options.zoom,c=ue(t,r,o.dragStart,i),m=V(r,"x",t)?c.width:0,v=V(r,"y",t)?c.height:0,p=Math.sqrt(m*m+v*v);if(o.dragStart=o.dragEnd=null,p<=u){o.dragging=!1,t.update("none");return}ie(t,{x:c.left,y:c.top},{x:c.right,y:c.bottom},"zoom"),setTimeout(()=>o.dragging=!1,500),(0,T.Q)(l,[{chart:t}])}function Me(t,i,o){if(Dt(ut(o.wheel),i)){(0,T.Q)(o.onZoomRejected,[{chart:t,event:i}]);return}if(ae(t,i,o)!==!1&&(i.cancelable&&i.preventDefault(),i.deltaY!==void 0))return!0}function Pt(t,i){const{handlers:{onZoomComplete:o},options:{zoom:r}}=y(t);if(!Me(t,i,r))return;const l=i.target.getBoundingClientRect(),u=1+(i.deltaY>=0?-r.wheel.speed:r.wheel.speed),c={x:u,y:u,focalPoint:{x:i.clientX-l.left,y:i.clientY-l.top}};ft(t,c),o&&o()}function Ne(t,i,o,r){o&&(y(t).handlers[i]=xe(()=>(0,T.Q)(o,[{chart:t}]),r))}function we(t,i){const o=t.canvas,{wheel:r,drag:l,onZoomComplete:u}=i.zoom;r.enabled?(tt(t,o,"wheel",Pt),Ne(t,"onZoomComplete",u,250)):A(t,"wheel"),l.enabled?(tt(t,o,"mousedown",le),tt(t,o.ownerDocument,"mouseup",Ae)):(A(t,"mousedown"),A(t,"mousemove"),A(t,"mouseup"),A(t,"keydown"))}function ce(t){A(t,"mousedown"),A(t,"mousemove"),A(t,"mouseup"),A(t,"wheel"),A(t,"click"),A(t,"keydown")}function Yt(t,i){return function(o,r){const{pan:l,zoom:u={}}=i.options;if(!l||!l.enabled)return!1;const c=r&&r.srcEvent;return c&&!i.panning&&r.pointerType==="mouse"&&(Dt(ut(l),c)||Lt(ut(u.drag),c))?((0,T.Q)(l.onPanRejected,[{chart:t,event:r}]),!1):!0}}function Le(t,i){const o=Math.abs(t.clientX-i.clientX),r=Math.abs(t.clientY-i.clientY),l=o/r;let u,c;return l>.3&&l<1.7?u=c=!0:o>r?u=!0:c=!0,{x:u,y:c}}function Wt(t,i,o){if(i.scale){const{center:r,pointers:l}=o,u=1/i.scale*o.scale,c=o.target.getBoundingClientRect(),m=Le(l[0],l[1]),v=i.options.zoom.mode,p={x:m.x&&V(v,"x",t)?u:1,y:m.y&&V(v,"y",t)?u:1,focalPoint:{x:r.x-c.left,y:r.y-c.top}};ft(t,p),i.scale=o.scale}}function De(t,i){i.options.zoom.pinch.enabled&&(i.scale=1)}function he(t,i,o){i.scale&&(Wt(t,i,o),i.scale=null,(0,T.Q)(i.options.zoom.onZoomComplete,[{chart:t}]))}function Vt(t,i,o){const r=i.delta;r&&(i.panning=!0,oe(t,{x:o.deltaX-r.x,y:o.deltaY-r.y},i.panScales),i.delta={x:o.deltaX,y:o.deltaY})}function fe(t,i,o){const{enabled:r,onPanStart:l,onPanRejected:u}=i.options.pan;if(!r)return;const c=o.target.getBoundingClientRect(),m={x:o.center.x-c.left,y:o.center.y-c.top};if((0,T.Q)(l,[{chart:t,event:o,point:m}])===!1)return(0,T.Q)(u,[{chart:t,event:o}]);i.panScales=$t(i.options.pan,m,t),i.delta={x:0,y:0},clearTimeout(i.panEndTimeout),Vt(t,i,o)}function de(t,i){i.delta=null,i.panning&&(i.panEndTimeout=setTimeout(()=>i.panning=!1,500),(0,T.Q)(i.options.pan.onPanComplete,[{chart:t}]))}const mt=new WeakMap;function et(t,i){const o=y(t),r=t.canvas,{pan:l,zoom:u}=i,c=new(lt()).Manager(r);u&&u.pinch.enabled&&(c.add(new(lt()).Pinch),c.on("pinchstart",()=>De(t,o)),c.on("pinch",m=>Wt(t,o,m)),c.on("pinchend",m=>he(t,o,m))),l&&l.enabled&&(c.add(new(lt()).Pan({threshold:l.threshold,enable:Yt(t,o)})),c.on("panstart",m=>fe(t,o,m)),c.on("panmove",m=>Vt(t,o,m)),c.on("panend",()=>de(t,o))),mt.set(t,c)}function pt(t){const i=mt.get(t);i&&(i.remove("pinchstart"),i.remove("pinch"),i.remove("pinchend"),i.remove("panstart"),i.remove("pan"),i.remove("panend"),i.destroy(),mt.delete(t))}var vt="2.0.1";function nt(t,i,o){const r=o.zoom.drag,{dragStart:l,dragEnd:u}=y(t);if(r.drawTime!==i||!u)return;const{left:c,top:m,width:v,height:p}=ue(t,o.zoom.mode,l,u),g=t.ctx;g.save(),g.beginPath(),g.fillStyle=r.backgroundColor||"rgba(225,225,225,0.3)",g.fillRect(c,m,v,p),r.borderWidth>0&&(g.lineWidth=r.borderWidth,g.strokeStyle=r.borderColor||"rgba(225,225,225)",g.strokeRect(c,m,v,p)),g.restore()}var Zt={id:"zoom",version:vt,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(t,i,o){const r=y(t);r.options=o,Object.prototype.hasOwnProperty.call(o.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(o.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(o.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),lt()&&et(t,o),t.pan=(l,u,c)=>oe(t,l,u,c),t.zoom=(l,u)=>ft(t,l,u),t.zoomRect=(l,u,c)=>ie(t,l,u,c),t.zoomScale=(l,u,c)=>be(t,l,u,c),t.resetZoom=l=>Se(t,l),t.getZoomLevel=()=>Ie(t),t.getInitialScaleBounds=()=>se(t),t.isZoomedOrPanned=()=>re(t)},beforeEvent(t){const i=y(t);if(i.panning||i.dragging)return!1},beforeUpdate:function(t,i,o){const r=y(t);r.options=o,we(t,o)},beforeDatasetsDraw(t,i,o){nt(t,"beforeDatasetsDraw",o)},afterDatasetsDraw(t,i,o){nt(t,"afterDatasetsDraw",o)},beforeDraw(t,i,o){nt(t,"beforeDraw",o)},afterDraw(t,i,o){nt(t,"afterDraw",o)},stop:function(t){ce(t),lt()&&pt(t),K(t)},panFunctions:Ft,zoomFunctions:zt,zoomRectFunctions:Ut},ke=C("./node_modules/vue-chartjs/dist/index.js"),Ot=C("./web_src/js/utils/time.js"),at=C("./web_src/js/utils/color.js"),D=C("./web_src/js/utils.js"),gt=C("./node_modules/chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm.js"),Z=C("./node_modules/jquery/dist/jquery.js"),H=C.n(Z);const Tt={id:"customEventListener",afterEvent:(t,i,o)=>{i.event.type==="dblclick"&&o.chartType==="main"&&!i.replay&&(t.resetZoom(),o.instance.updateOtherCharts(i.event,!0))}};k.t1.defaults.color=at.K.text,k.t1.defaults.borderColor=at.K.border,k.t1.register(k.UA,k.kc,k.E8,k.hE,k.FN,k.No,k.dN,Zt,Tt);var j={components:{ChartLine:ke.N1,SvgIcon:_t.Ah},props:{locale:{type:Object,required:!0},repoLink:{type:String,required:!0}},data:()=>({isLoading:!1,errorText:"",totalStats:{},sortedContributors:{},type:"commits",contributorsStats:[],xAxisStart:null,xAxisEnd:null,xAxisMin:null,xAxisMax:null}),mounted(){this.fetchGraphData(),H()("#repo-contributors").dropdown({onChange:t=>{this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.type=t,this.sortContributors()}})},methods:{sortContributors(){const t=this.filterContributorWeeksByDateRange(),i=`total_${this.type}`;this.sortedContributors=Object.values(t).filter(o=>o[i]!==0).sort((o,r)=>o[i]>r[i]?-1:o[i]===r[i]?0:1).slice(0,100)},async fetchGraphData(){this.isLoading=!0;try{let t;do t=await(0,bt.fG)(`${this.repoLink}/activity/contributors/data`),t.status===202&&await(0,D.yy)(1e3);while(t.status===202);if(t.ok){const i=await t.json(),{total:o,...r}=i;o.weeks=Object.fromEntries(Object.entries(o.weeks).sort());const l=Object.values(o.weeks);this.xAxisStart=l[0].week,this.xAxisEnd=(0,Ot.Z1)(new Date);const u=(0,Ot.Ex)(this.xAxisStart,this.xAxisEnd);o.weeks=(0,Ot.a$)(u,o.weeks),this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.contributorsStats={};for(const[c,m]of Object.entries(r))m.weeks=(0,Ot.a$)(u,m.weeks),this.contributorsStats[c]=m;this.sortContributors(),this.totalStats=o,this.errorText=""}else this.errorText=t.statusText}catch(t){this.errorText=t.message}finally{this.isLoading=!1}},filterContributorWeeksByDateRange(){const t={},i=this.contributorsStats;for(const o of Object.keys(i)){const r=i[o];r.total_commits=0,r.total_additions=0,r.total_deletions=0,r.max_contribution_type=0;const l=r.weeks.filter(u=>u.week>=this.xAxisMin-6048e5&&u.week<=this.xAxisMax+6048e5?(r.total_commits+=u.commits,r.total_additions+=u.additions,r.total_deletions+=u.deletions,u[this.type]>r.max_contribution_type&&(r.max_contribution_type=u[this.type]),!0):!1);r.max_contribution_type+=1,t[o]={...r,weeks:l}}return t},maxMainGraph(){const t=Math.max(...this.totalStats.weeks.map(r=>r[this.type])),[i,o]=t.toExponential().split("e").map(Number);return i%1===0?t:(1-i%1)*10**o+t},maxContributorGraph(){const t=Math.max(...this.sortedContributors.map(r=>r.max_contribution_type)),[i,o]=t.toExponential().split("e").map(Number);return i%1===0?t:(1-i%1)*10**o+t},toGraphData(t){return{datasets:[{data:t.map(i=>({x:i.week,y:i[this.type]})),pointRadius:0,pointHitRadius:0,fill:"start",backgroundColor:at.K[this.type],borderWidth:0,tension:.3}]}},updateOtherCharts(t,i){const o=t.chart.options.scales.x.min,r=t.chart.options.scales.x.max;i?(this.xAxisMin=this.xAxisStart,this.xAxisMax=this.xAxisEnd,this.sortContributors()):o&&(this.xAxisMin=o,this.xAxisMax=r,this.sortContributors())},getOptions(t){return{responsive:!0,maintainAspectRatio:!1,animation:!1,events:["mousemove","mouseout","click","touchstart","touchmove","dblclick"],plugins:{title:{display:t==="main",text:"drag: zoom, shift+drag: pan, double click: reset zoom",position:"top",align:"center"},customEventListener:{chartType:t,instance:this},zoom:{pan:{enabled:!0,modifierKey:"shift",mode:"x",threshold:20,onPanComplete:this.updateOtherCharts},limits:{x:{min:"original",max:"original",minRange:2*7*24*60*60*1e3}},zoom:{drag:{enabled:t==="main"},pinch:{enabled:t==="main"},mode:"x",onZoomComplete:this.updateOtherCharts}}},scales:{x:{min:this.xAxisMin,max:this.xAxisMax,type:"time",grid:{display:!1},time:{minUnit:"month"},ticks:{maxRotation:0,maxTicksLimit:t==="main"?12:6}},y:{min:0,max:t==="main"?this.maxMainGraph():this.maxContributorGraph(),ticks:{maxTicksLimit:t==="main"?6:4}}}}}}},Y=C("./node_modules/vue-loader/dist/exportHelper.js"),me=(0,Y.A)(j,[["render",st],["__scopeId","data-v-47958124"]])}}]);
|