Delete wrong stats data

Hello! How to delete wrong data in new statistic? In the watch time tab I have a « negative » value, looks like this -
wrong
Thanks you!

Hi,

What is the displayed graph? Can you screen it entirely?

All right?


TY!

Can you paste the request response from web browser developer tools (network tab)?

What exactly do you need to watch, are there a lot of files being loaded, or is it just trying to save everything?

Try to extract the one that ends with /stats/timeseries/aggregateWatchTime

This? - (self.webpackChunkPeerTube=self.webpackChunkPeerTube||[]).push([[9951],{79951:(Gt,st,C)=>{« use strict »;C.r(st),C.d(st,{StatsModule:()=>De});var E=C(70708),M=C(75886),at=C(1733),B=C(9207),D=C(86884),et=C(38320),nt=C(59232),V=C(15977),N=C.n(V),p=C(7567);const P=e=>e&&e.enabled&&e.modifierKey,Q=(e,o)=>e&&o[e+« Key »],Z=(e,o)=>e&&!o[e+« Key »];function y(e,o,n){return void 0===e||(« string »==typeof e?-1!==e.indexOf(o):« function »==typeof e&&-1!==e({chart:n}).indexOf(o))}function Dt(e,o,n){const a=function X({x:e,y:o},n){const a=n.scales,r=Object.keys(a);for(let u=0;u<r.length;u++){const h=a[r[u]];if(o>=h.top&&o<=h.bottom&&e>=h.left&&e<=h.right)return h}return null}(o,n);if(a&&y(e,a.axis,n))return[a];const r=[];return(0,p.D)(n.scales,function(u){y(e,u.axis,n)||r.push(u)}),r}const Nt=new WeakMap;function O(e){let o=Nt.get(e);return o||(o={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},Nt.set(e,o)),o}function t(e,o,n){const a=e.max-e.min,r=a*(o-1),u=e.isHorizontal()?n.x:n.y,h=Math.max(0,Math.min(1,(e.getValueForPixel(u)-e.min)/a||0));return{min:rh,max:r(1-h)}}function Ft(e,o,n,a,r){let u=n[a];if(« original »===u){const h=e.originalScaleLimits[o.id][a];u=(0,p.v)(h.options,h.scale)}return(0,p.v)(u,r)}function $(e,{min:o,max:n},a,r=!1){const u=O(e.chart),{id:h,axis:m,options:g}=e,v=a&&(a[h]||a[m])||{},{minRange:T=0}=v,z=Ft(u,e,v,« min »,-1/0),S=Ft(u,e,v,« max »,1/0),b=Math.max(o,z),I=Math.min(n,S),H=r?Math.max(I-b,T):e.max-e.min;if(I-b!==H)if(z>I-H)o=b,n=b+H;else if(S<b+H)n=I,o=I-H;else{const Mt=(H-I+b)/2;o=b-Mt,n=I+Mt}else o=b,n=I;return g.min=o,g.max=n,u.updatedScaleLimits[e.id]={min:o,max:n},e.parse(o)!==e.min||e.parse(n)!==e.max}const wt=e=>0===e||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1),Jt={second:500,minute:3e4,hour:18e5,day:432e5,week:3024e5,month:1296e6,quarter:5184e6,year:157248e5};function rt(e,o,n,a=!1){const{min:r,max:u,options:h}=e,g=Jt[h.time&&h.time.round]||0,v=e.getValueForPixel(e.getPixelForValue(r+g)-o),T=e.getValueForPixel(e.getPixelForValue(u+g)-o),{min:z=-1/0,max:S=1/0}=a&&n&&n[e.axis]||{};return!!(isNaN(v)||isNaN(T)||v<z||T>S)||$(e,{min:v,max:T},n,a)}function Qt(e,o,n){return rt(e,o,n,!0)}const Rt={category:function Ot(e,o,n,a){const r=t(e,o,n);return e.min===e.max&&o<1&&function j(e){const n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}(e),$(e,{min:e.min+wt(r.min),max:e.max-wt(r.max)},a,!0)},default:function Ct(e,o,n,a){const r=t(e,o,n);return $(e,{min:e.min+r.min,max:e.max-r.max},a,!0)}},yt={category:function Et(e,o,n){const r=e.getLabels().length-1;let{min:u,max:h}=e;const m=Math.max(h-u,1),g=Math.round(function it(e){return e.isHorizontal()?e.width:e.height}(e)/Math.max(m,10)),v=Math.round(Math.abs(o/g));let T;return o<-g?(h=Math.min(h+v,r),u=1===m?h:h-m,T=h===r):o>g&&(u=Math.max(0,u-v),h=1===m?u:u+m,T=0===u),$(e,{min:u,max:h},n)||T},default:rt,logarithmic:Qt,timeseries:Qt};function zt(e,o){(0,p.D)(e,(n,a)=>{o[a]||delete e[a]})}function lt(e,o){const{scales:n}=e,{originalScaleLimits:a,updatedScaleLimits:r}=o;return(0,p.D)(n,function(u){(function he(e,o,n){const{id:a,options:{min:r,max:u}}=e;if(!o[a]||!n[a])return!0;const h=n[a];return h.min!==r||h.max!==u})(u,a,r)&&(a[u.id]={min:{scale:u.min,options:u.options.min},max:{scale:u.max,options:u.options.max}})}),zt(a,n),zt(r,n),a}function jt(e,o,n,a){(0,p.O)(Rt[e.type]||Rt.default,[e,o,n,a])}function ct(e){const o=e.chartArea;return{x:(o.left+o.right)/2,y:(o.top+o.bottom)/2}}function Lt(e,o,n=« none »){const{x:a=1,y:r=1,focalPoint:u=ct(e)}=« number »==typeof o?{x:o,y:o}:o,h=O(e),{options:{limits:m,zoom:g}}=h,{mode:v=« xy »,overScaleMode:T}=g||{};lt(e,h);const z=1!==a&&y(v,« x »,e),S=1!==r&&y(v,« y »,e),b=T&&Dt(T,u,e);(0,p.D)(b||e.scales,function(I){I.isHorizontal()&&z?jt(I,a,u,m):!I.isHorizontal()&&S&&jt(I,r,u,m)}),e.update(n),(0,p.O)(g.onZoom,[{chart:e}])}function St(e,o,n){const a=e.getValueForPixel(o),r=e.getValueForPixel(n);return{min:Math.min(a,r),max:Math.max(a,r)}}function w(e,o,n,a){const{panDelta:r}=a,u=r[e.id]||0;(0,p.s)(u)===(0,p.s)(o)&&(o+=u),r[e.id]=(0,p.O)(yt[e.type]||yt.default,[e,o,n])?0:o}function ut(e,o,n,a=« none »){const{x:r=0,y:u=0}=« number »==typeof o?{x:o,y:o}:o,h=O(e),{options:{pan:m,limits:g}}=h,{mode:v=« xy »,onPan:T}=m||{};lt(e,h);const z=0!==r&&y(v,« x »,e),S=0!==u&&y(v,« y »,e);(0,p.D)(n||e.scales,function(b){b.isHorizontal()&&z?w(b,r,g,h):!b.isHorizontal()&&S&&w(b,u,g,h)}),e.update(a),(0,p.O)(T,[{chart:e}])}function ot(e){const o=O(e),n={};for(const a of Object.keys(e.scales)){const{min:r,max:u}=o.originalScaleLimits[a]||{min:{},max:{}};n[a]={min:r.scale,max:u.scale}}return n}function R(e,o){const{handlers:n}=O(e),a=n[o];a&&a.target&&(a.target.removeEventListener(o,a),delete n[o])}function k(e,o,n,a){const{handlers:r,options:u}=O(e),h=r[n];h&&h.target===o||(R(e,n),r[n]=m=>a(e,m,u),r[n].target=o,o.addEventListener(n,r[n]))}function W(e,o){const n=O(e);n.dragStart&&(n.dragging=!0,n.dragEnd=o,e.update(« none »))}function G(e,o,n){const{onZoomStart:a,onZoomRejected:r}=n;if(a){const{left:u,top:h}=o.target.getBoundingClientRect();if(!1===(0,p.O)(a,[{chart:e,event:o,point:{x:o.clientX-u,y:o.clientY-h}}]))return(0,p.O)(r,[{chart:e,event:o}]),!1}}function Kt(e,o){const n=O(e),{pan:a,zoom:r={}}=n.options;if(Q(P(a),o)||Z(P(r.drag),o))return(0,p.O)(r.onZoomRejected,[{chart:e,event:o}]);!1!==G(e,o,r)&&(n.dragStart=o,k(e,e.canvas,« mousemove »,W))}function Vt(e,o,n,a){const{left:r,top:u}=n.target.getBoundingClientRect(),h=y(o,« x »,e),m=y(o,« y »,e);let{top:g,left:v,right:T,bottom:z,width:S,height:b}=e.chartArea;h&&(v=Math.min(n.clientX,a.clientX)-r,T=Math.max(n.clientX,a.clientX)-r),m&&(g=Math.min(n.clientY,a.clientY)-u,z=Math.max(n.clientY,a.clientY)-u);const I=T-v,H=z-g;return{left:v,top:g,right:T,bottom:z,width:I,height:H,zoomX:h&&I?1+(S-I)/S:1,zoomY:m&&H?1+(b-H)/b:1}}function bt(e,o){const n=O(e);if(!n.dragStart)return;R(e,« mousemove »);const{mode:a,onZoomComplete:r,drag:{threshold:u=0}}=n.options.zoom,h=Vt(e,a,n.dragStart,o),m=y(a,« x »,e)?h.width:0,g=y(a,« y »,e)?h.height:0,v=Math.sqrt(mm+gg);if(n.dragStart=n.dragEnd=null,v<=u)return n.dragging=!1,void e.update(« none »);(function de(e,o,n,a=« none »){const r=O(e),{options:{limits:u,zoom:h}}=r,{mode:m=« xy »}=h;lt(e,r);const g=y(m,« x »,e),v=y(m,« y »,e);(0,p.D)(e.scales,function(T){T.isHorizontal()&&g?$(T,St(T,o.x,n.x),u,!0):!T.isHorizontal()&&v&&$(T,St(T,o.y,n.y),u,!0)}),e.update(a),(0,p.O)(h.onZoom,[{chart:e}])})(e,{x:h.left,y:h.top},{x:h.right,y:h.bottom},« zoom »),setTimeout(()=>n.dragging=!1,500),(0,p.O)(r,[{chart:e}])}function fe(e,o){const{handlers:{onZoomComplete:n},options:{zoom:a}}=O(e);if(!function Y(e,o,n){if(!Z(P(n.wheel),o))return!1!==G(e,o,n)&&(o.cancelable&&o.preventDefault(),void 0!==o.deltaY)||void 0;(0,p.O)(n.onZoomRejected,[{chart:e,event:o}])}(e,o,a))return;const r=o.target.getBoundingClientRect(),u=1+(o.deltaY>=0?-a.wheel.speed:a.wheel.speed);Lt(e,{x:u,y:u,focalPoint:{x:o.clientX-r.left,y:o.clientY-r.top}}),n&&n()}function Te(e,o){return function(n,a){const{pan:r,zoom:u={}}=o.options;if(!r||!r.enabled)return!1;const h=a&&a.srcEvent;return!(h&&!o.panning&&« mouse »===a.pointerType&&(Z(P(r),h)||Q(P(u.drag),h))&&((0,p.O)(r.onPanRejected,[{chart:e,event:a}]),1))}}function Ut(e,o,n){if(o.scale){const{center:a,pointers:r}=n,u=1/o.scale*n.scale,h=n.target.getBoundingClientRect(),m=function te(e,o){const n=Math.abs(e.clientX-o.clientX),a=Math.abs(e.clientY-o.clientY),r=n/a;let u,h;return r>.3&&r<1.7?u=h=!0:n>a?u=!0:h=!0,{x:u,y:h}}(r[0],r[1]),g=o.options.zoom.mode;Lt(e,{x:m.x&&y(g,« x »,e)?u:1,y:m.y&&y(g,« y »,e)?u:1,focalPoint:{x:a.x-h.left,y:a.y-h.top}}),o.scale=n.scale}}function dt(e,o,n){const a=o.delta;a&&(o.panning=!0,ut(e,{x:n.deltaX-a.x,y:n.deltaY-a.y},o.panScales),o.delta={x:n.deltaX,y:n.deltaY})}const Yt=new WeakMap;var Pt={id:« zoom »,version:« 1.2.1 »,defaults:{pan:{enabled:!1,mode:« xy »,threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,modifierKey:null},pinch:{enabled:!1},mode:« xy »}},start:function(e,o,n){O(e).options=n,Object.prototype.hasOwnProperty.call(n.zoom,« enabled »)&&console.warn(« The option zoom.enabled is no longer supported. Please use zoom.wheel.enabled, zoom.drag.enabled, or zoom.pinch.enabled. »),N()&&function Ce(e,o){const n=O(e),a=e.canvas,{pan:r,zoom:u}=o,h=new(N().Manager)(a);u&&u.pinch.enabled&&(h.add(new(N().Pinch)),h.on(« pinchstart »,()=>function ee(e,o){o.options.zoom.pinch.enabled&&(o.scale=1)}(0,n)),h.on(« pinch »,m=>Ut(e,n,m)),h.on(« pinchend »,m=>function ne(e,o,n){o.scale&&(Ut(e,o,n),o.scale=null,(0,p.O)(o.options.zoom.onZoomComplete,[{chart:e}]))}(e,n,m))),r&&r.enabled&&(h.add(new(N().Pan)({threshold:r.threshold,enable:Te(e,n)})),h.on(« panstart »,m=>function Zt(e,o,n){const{enabled:a,overScaleMode:r,onPanStart:u,onPanRejected:h}=o.options.pan;if(!a)return;const m=n.target.getBoundingClientRect(),g={x:n.center.x-m.left,y:n.center.y-m.top};if(!1===(0,p.O)(u,[{chart:e,event:n,point:g}]))return(0,p.O)(h,[{chart:e,event:n}]);o.panScales=r&&Dt(r,g,e),o.delta={x:0,y:0},clearTimeout(o.panEndTimeout),dt(e,o,n)}(e,n,m)),h.on(« panmove »,m=>dt(e,n,m)),h.on(« panend »,()=>function e(e,o){o.delta=null,o.panning&&(o.panEndTimeout=setTimeout(()=>o.panning=!1,500),(0,p.O)(o.options.pan.onPanComplete,[{chart:e}]))}(e,n))),Yt.set(e,h)}(e,n),e.pan=(r,u,h)=>ut(e,r,u,h),e.zoom=(r,u)=>Lt(e,r,u),e.zoomScale=(r,u,h)=>function me(e,o,n,a=« none »){lt(e,O(e)),$(e.scales[o],n,void 0,!0),e.update(a)}(e,r,u,h),e.resetZoom=r=>function F(e,o=« default »){const n=O(e),a=lt(e,n);(0,p.D)(e.scales,function(r){const u=r.options;a[r.id]?(u.min=a[r.id].min.options,u.max=a[r.id].max.options):(delete u.min,delete u.max)}),e.update(o),(0,p.O)(n.options.zoom.onZoomComplete,[{chart:e}])}(e,r),e.getZoomLevel=()=>function x(e){const o=O(e);let n=1,a=1;return(0,p.D)(e.scales,function(r){const u=function K(e,o){const n=e.originalScaleLimits[o];if(!n)return;const{min:a,max:r}=n;return(0,p.v)(r.options,r.scale)-(0,p.v)(a.options,a.scale)}(o,r.id);if(u){const h=Math.round(u/(r.max-r.min)100)/100;n=Math.min(n,h),a=Math.max(a,h)}}),n<1?n:a}(e),e.getInitialScaleBounds=()=>ot(e),e.isZoomedOrPanned=()=>function ht(e){const o=ot(e);for(const n of Object.keys(e.scales)){const{min:a,max:r}=o[n];if(void 0!==a&&e.scales[n].min!==a||void 0!==r&&e.scales[n].max!==r)return!0}return!1}(e)},beforeEvent(e){const o=O(e);if(o.panning||o.dragging)return!1},beforeUpdate:function(e,o,n){O(e).options=n,function ge(e,o){const n=e.canvas,{wheel:a,drag:r,onZoomComplete:u}=o.zoom;a.enabled?(k(e,n,« wheel »,fe),function pe(e,o,n,a){n&&(O(e).handlers[o]=function qt(e,o){let n;return function(){return clearTimeout(n),n=setTimeout(e,o),o}}(()=>(0,p.O)(n,[{chart:e}]),a))}(e,« onZoomComplete »,u,250)):R(e,« wheel »),r.enabled?(k(e,n,« mousedown »,Kt),k(e,n.ownerDocument,« mouseup »,bt)):(R(e,« mousedown »),R(e,« mousemove »),R(e,« mouseup »))}(e,n)},beforeDatasetsDraw:function(e,o,n){const{dragStart:a,dragEnd:r}=O(e);if(r){const{left:u,top:h,width:m,height:g}=Vt(e,n.zoom.mode,a,r),v=n.zoom.drag,T=e.ctx;T.save(),T.beginPath(),T.fillStyle=v.backgroundColor||« rgba(225,225,225,0.3) »,T.fillRect(u,h,m,g),v.borderWidth>0&&(T.lineWidth=v.borderWidth,T.strokeStyle=v.borderColor||« rgba(225,225,225) »,T.strokeRect(u,h,m,g)),T.restore()}},stop:function(e){(function ve(e){R(e,« mousedown »),R(e,« mousemove »),R(e,« mouseup »),R(e,« wheel »),R(e,« click »)})(e),N()&&function Oe(e){const o=Yt.get(e);o&&(o.remove(« pinchstart »),o.remove(« pinch »),o.remove(« pinchend »),o.remove(« panstart »),o.remove(« pan »),o.remove(« panend »),o.destroy(),Yt.delete(e))}(e),function At(e){Nt.delete(e)}(e)},panFunctions:yt,zoomFunctions:Rt},ye=C(10745),l=C(3184),mt=C(42921),xt=C(53158),Ht=C(92340),Xt=C(28784);class q{constructor(o,n){this.authHttp=o,this.restExtractor=n}getOverallStats(o){const{videoId:n,startDate:a,endDate:r}=o;let u=new Xt.LE;return a&&(u=u.append(« startDate »,a.toISOString())),r&&(u=u.append(« endDate »,r.toISOString())),this.authHttp.get(B.kI.BASE_VIDEO_URL+"/"+n+"/stats/overall",{params:u}).pipe((0,xt.K)(h=>this.restExtractor.handleError(h)))}getTimeserieStats(o){const{videoId:n,metric:a,startDate:r,endDate:u}=o;let h=new Xt.LE;return r&&(h=h.append(« startDate »,r.toISOString())),u&&(h=h.append(« endDate »,u.toISOString())),this.authHttp.get(B.kI.BASE_VIDEO_URL+"/"+n+"/stats/timeseries/"+a,{params:h}).pipe((0,xt.K)(m=>this.restExtractor.handleError(m)))}getRetentionStats(o){return this.authHttp.get(B.kI.BASE_VIDEO_URL+"/"+o+"/stats/retention").pipe((0,xt.K)(n=>this.restExtractor.handleError(n)))}}q.BASE_VIDEO_STATS_URL=Ht.N.apiUrl+"/api/v1/videos/",q.\u0275fac=function(o){return new(o||q)(l.LFG(Xt.eN),l.LFG(nt.DI))},q.\u0275prov=l.Yz7({token:q,factory:q.\u0275fac,providedIn:« root »});var $t=C(36362),ie=C(19857),Se=C(56643),be=C(94285),Pe=C(10473),ft=C(90587),pt=C(59747),xe=C(34311);function oe(e,o){if(1&e&&l._uU(0),2&e){const n=l.oxw(2).$implicit;l.Oqu(n.help)}}function Wt(e,o){1&e&&(l.TgZ(0,« my-help »),l.YNc(1,oe,1,1,« ng-template »,22),l.qZA())}function Ie(e,o){if(1&e&&(l.TgZ(0,« div »,23),l._uU(1),l.qZA()),2&e){const n=l.oxw().$implicit;l.xp6(1),l.Oqu(n.moreInfo)}}function se(e,o){if(1&e&&(l.TgZ(0,« div »,17)(1,« div »,18),l._uU(2),l.YNc(3,Wt,2,0,« my-help »,19),l.qZA(),l.TgZ(4,« div »,20),l._uU(5),l.qZA(),l.YNc(6,Ie,2,1,« div »,21),l.qZA()),2&e){const n=o.$implicit;l.xp6(2),l.hij(" « ,n.label, » « ),l.xp6(1),l.Q6J(« ngIf »,n.help),l.xp6(2),l.Oqu(n.value),l.xp6(1),l.Q6J(« ngIf »,n.moreInfo)}}function Me(e,o){if(1&e&&(l.TgZ(0,« div »,23),l._uU(1),l.qZA()),2&e){const n=l.oxw().$implicit;l.xp6(1),l.Oqu(n.moreInfo)}}function ae(e,o){if(1&e&&(l.TgZ(0,« div »,17)(1,« div »,18),l._uU(2),l.qZA(),l.TgZ(3,« div »,20),l._uU(4),l.qZA(),l.YNc(5,Me,2,1,« div »,21),l.qZA()),2&e){const n=o.$implicit;l.xp6(2),l.Oqu(n.label),l.xp6(2),l.Oqu(n.value),l.xp6(1),l.Q6J(« ngIf »,n.moreInfo)}}function re(e,o){if(1&e&&l._UZ(0,« p-chart »,32),2&e){const n=l.oxw(2).$implicit,a=l.oxw();l.Q6J(« height »,a.chartHeight)(« width »,a.chartWidth)(« type »,a.chartOptions[n.id].type)(« options »,a.chartOptions[n.id].options)(« data »,a.chartOptions[n.id].data)(« plugins »,a.chartPlugins)}}function le(e,o){1&e&&(l.TgZ(0,« span »,33),l.SDv(1,34),l.qZA())}function ce(e,o){if(1&e){const n=l.EpF();l.TgZ(0,« my-button »,35),l.NdJ(« click »,function(){return l.CHM(n),l.oxw(3).resetZoom()}),l.SDv(1,36),l.qZA()}}const Bt=function(e){return{« min-height »:e}};function tt(e,o){if(1&e&&(l.TgZ(0,« div »,27),l.YNc(1,re,1,6,« p-chart »,28),l.qZA(),l.TgZ(2,« div »,29),l.YNc(3,le,2,0,« span »,30),l.YNc(4,ce,2,0,« my-button »,31),l.qZA()),2&e){const n=l.oxw().$implicit,a=l.oxw();l.Q6J(« ngStyle »,l.VKq(4,Bt,a.chartHeight)),l.xp6(1),l.Q6J(« ngIf »,a.chartOptions[n.id]),l.xp6(2),l.Q6J(« ngIf »,!a.hasZoom()&&n.zoomEnabled),l.xp6(1),l.Q6J(« ngIf »,a.hasZoom())}}function gt(e,o){if(1&e&&(l.ynx(0,24),l.TgZ(1,« a »,25)(2,« span »),l._uU(3),l.qZA()(),l.YNc(4,tt,5,6,« ng-template »,26),l.BQk()),2&e){const n=o.$implicit;l.Q6J(« ngbNavItem »,n.id),l.xp6(3),l.Oqu(n.label)}}const It=[{path:« videos/:videoId »,canActivate:[nt.ie],component:(()=>{class e{constructor(n,a,r,u,h,m,g){this.localeId=n,this.route=a,this.notifier=r,this.statsService=u,this.peertubeRouter=h,this.numberFormatter=m,this.liveService=g,this.globalStatsCards=[],this.overallStatCards=[],this.chartOptions={},this.chartHeight=« 300px »,this.chartWidth=null,this.availableCharts=[],this.activeGraphId=« viewers »,this.countries=[],this.chartPlugins=[Pt],this.currentDateFilter=« all »,this.dateFilters=[{id:« all »,label:« Since the video publication »}],this.chartIngestData={}}ngOnInit(){this.video=this.route.snapshot.data.video,this.availableCharts=[{id:« viewers »,label:« Viewers »,zoomEnabled:!0},{id:« aggregateWatchTime »,label:« Watch time »,zoomEnabled:!0},{id:« countries »,label:« Countries »,zoomEnabled:!1}],this.video.isLive||this.availableCharts.push({id:« retention »,label:« Retention »,zoomEnabled:!1});const n=this.route.snapshot.queryParams;(n.startDate||n.endDate)&&this.addAndSelectCustomDateFilter(),this.route.queryParams.subscribe(a=>{this.statsStartDate=a.startDate?new Date(a.startDate):void 0,this.statsEndDate=a.endDate?new Date(a.endDate):void 0,this.loadChart(),this.loadOverallStats()}),this.loadDateFilters()}hasCountries(){return 0!==this.countries.length}onChartChange(n){this.activeGraphId=n,this.loadChart()}resetZoom(){this.peertubeRouter.silentNavigate([],{}),this.removeAndResetCustomDateFilter()}hasZoom(){return!!this.statsStartDate&&this.isTimeserieGraph(this.activeGraphId)}getViewersStatsTitle(){return this.statsStartDate&&this.statsEndDate?« Viewers stats between " + this.toMediumDate(this.statsStartDate) + " and " + this.toMediumDate(this.statsEndDate) + «  »:« Viewers stats »}onDateFilterChange(){if(« all »===this.currentDateFilter)return this.resetZoom();const n=this.currentDateFilter.split( »| »);return 2===n.length?this.peertubeRouter.silentNavigate([],{startDate:n[0],endDate:n[1]}):void 0}isTimeserieGraph(n){return"aggregateWatchTime"===n||« viewers »===n}loadOverallStats(){this.statsService.getOverallStats({videoId:this.video.uuid,startDate:this.statsStartDate,endDate:this.statsEndDate}).subscribe({next:n=>{this.countries=n.countries.slice(0,10).map(a=>({name:this.countryCodeToName(a.isoCode),viewers:a.viewers})),this.buildOverallStatCard(n)},error:n=>this.notifier.error(n.message)})}loadDateFilters(){return this.video.isLive?this.loadLiveDateFilters():this.loadVODDateFilters()}loadLiveDateFilters(){this.liveService.listSessions(this.video.id).subscribe({next:({data:n})=>{const a=n.map(r=>this.buildLiveFilter(r));this.dateFilters=this.dateFilters.concat(a)},error:n=>this.notifier.error(n.message)})}loadVODDateFilters(){this.liveService.findLiveSessionFromVOD(this.video.id).subscribe({next:n=>{this.dateFilters=this.dateFilters.concat([this.buildLiveFilter(n)])},error:n=>{404!==n.status&&this.notifier.error(n.message)}})}buildLiveFilter(n){return{id:n.startDate+"|"+n.endDate,label:« Live as of " + this.toMediumDate(new Date(n.startDate)) + «  »}}addAndSelectCustomDateFilter(){this.dateFilters.some(a=>« custom »===a.id)||(this.dateFilters=this.dateFilters.concat([{id:« custom »,label:« Custom dates »}])),this.currentDateFilter=« custom »}removeAndResetCustomDateFilter(){this.dateFilters=this.dateFilters.filter(n=>« custom »!==n.id),this.currentDateFilter=« all »}buildOverallStatCard(n){this.globalStatsCards=[{label:« Views »,value:this.numberFormatter.transform(this.video.views),help:« A view means that someone watched the video for at least 30 seconds »},{label:« Likes »,value:this.numberFormatter.transform(this.video.likes)}],this.overallStatCards=[{label:« Average watch time »,value:(0,mt.nH)(n.averageWatchTime)},{label:« Total watch time »,value:(0,mt.nH)(n.totalWatchTime)},{label:« Peak viewers »,value:this.numberFormatter.transform(n.viewersPeak),moreInfo:0!==n.viewersPeak?« at " + this.toMediumDate(new Date(n.viewersPeakDate)) + «  »:void 0},{label:« Unique viewers »,value:this.numberFormatter.transform(n.totalViewers)}],0!==n.countries.length&&this.overallStatCards.push({label:« Countries »,value:this.numberFormatter.transform(n.countries.length)})}loadChart(){({retention:this.statsService.getRetentionStats(this.video.uuid),aggregateWatchTime:this.statsService.getTimeserieStats({videoId:this.video.uuid,startDate:this.statsStartDate,endDate:this.statsEndDate,metric:« aggregateWatchTime »}),viewers:this.statsService.getTimeserieStats({videoId:this.video.uuid,startDate:this.statsStartDate,endDate:this.statsEndDate,metric:« viewers »}),countries:(0,ye.of)(this.countries)})[this.activeGraphId].subscribe({next:a=>{this.chartIngestData[this.activeGraphId]=a,this.chartOptions[this.activeGraphId]=this.buildChartOptions(this.activeGraphId)},error:a=>this.notifier.error(a.message)})}buildChartOptions(n){const a={retention:v=>this.buildRetentionChartOptions(v),aggregateWatchTime:v=>this.buildTimeserieChartOptions(v),viewers:v=>this.buildTimeserieChartOptions(v),countries:v=>this.buildCountryChartOptions(v)},{type:r,data:u,displayLegend:h,plugins:m}=an,g=this;return{type:r,data:u,options:{responsive:!0,scales:{x:{ticks:{callback:function(v){return g.formatXTick({graphId:n,value:v,data:g.chartIngestData[n],scale:this})}}},y:{beginAtZero:!0,max:« retention »===this.activeGraphId?100:void 0,ticks:{callback:v=>this.formatYTick({graphId:n,value:v})}}},plugins:Object.assign({legend:{display:h},tooltip:{callbacks:{title:v=>this.formatTooltipTitle({graphId:n,items:v}),label:v=>this.formatYTick({graphId:n,value:v.raw})}}},m)}}}buildRetentionChartOptions(n){const a=[],r=[];for(const u of n.data)a.push((0,mt.nH)(u.second)),r.push(u.retentionPercent);return{type:« line »,displayLegend:!1,plugins:Object.assign({},this.buildDisabledZoomPlugin()),data:{labels:a,datasets:[{data:r,borderColor:this.buildChartColor()}]}}}buildTimeserieChartOptions(n){const a=[],r=[];for(const u of n.data)a.push(u.date),r.push(u.value);return{type:« line »,displayLegend:!1,plugins:{zoom:{zoom:{wheel:{enabled:!1},drag:{enabled:!0},pinch:{enabled:!0},mode:« x »,onZoomComplete:({chart:u})=>{const{min:h,max:m}=u.scales.x,g=n.data[h].date,v=this.buildZoomEndDate(n.groupInterval,n.data[m].date);this.peertubeRouter.silentNavigate([],{startDate:g,endDate:v}),this.addAndSelectCustomDateFilter()}},limits:{x:{minRange:2}}}},data:{labels:a,datasets:[{data:r,borderColor:this.buildChartColor()}]}}}buildCountryChartOptions(n){const a=[],r=[];for(const u of n)a.push(u.name),r.push(u.viewers);return{type:« bar »,displayLegend:!0,plugins:Object.assign({},this.buildDisabledZoomPlugin()),data:{labels:a,datasets:[{label:« Viewers »,backgroundColor:this.buildChartColor(),maxBarThickness:20,data:r}]}}}buildChartColor(){return getComputedStyle(document.body).getPropertyValue( »–mainColorLighter »)}formatXTick(n){const{graphId:a,value:r,data:u,scale:h}=n,m=h.getLabelForValue(r);if(!this.isTimeserieGraph(a))return m;const g=new Date(m);return u.groupInterval.match(/ month?$/)?g.toLocaleDateString([],{month:« numeric »}):u.groupInterval.match(/ days?$/)?g.toLocaleDateString([],{month:« numeric »,day:« numeric »}):u.groupInterval.match(/ hours?$/)?g.toLocaleTimeString([],{month:« numeric »,day:« numeric »,hour:« numeric »,minute:« numeric »}):g.toLocaleTimeString([],{hour:« numeric »,minute:« numeric »})}formatYTick(n){const{graphId:a,value:r}=n;return"retention"===a?r+" %":« aggregateWatchTime »===a?(0,mt.nH)(+r):r.toLocaleString(this.localeId)}formatTooltipTitle(n){const{graphId:a,items:r}=n,u=r[0];return this.isTimeserieGraph(a)?this.toMediumDate(new Date(u.label)):u.label}countryCodeToName(n){const a=Intl;return a.DisplayNames?new a.DisplayNames([],{type:« region »}).of(n):n}buildDisabledZoomPlugin(){return{zoom:{zoom:{wheel:{enabled:!1},drag:{enabled:!1},pinch:{enabled:!1}}}}}toMediumDate(n){return new Date(n).toLocaleString(this.localeId,{day:« numeric »,month:« short »,year:« numeric »,hour:« numeric »,minute:« numeric »,second:« numeric »})}buildZoomEndDate(n,a){const r=new Date(a);return n.endsWith(" day")||n.endsWith(" days")?r.setHours(23,59,59):n.endsWith(" hour")||n.endsWith(" hours")?r.setMinutes(59,59):r.setSeconds(59),r.toISOString()}}return e.\u0275fac=function(n){return new(n||e)(l.Y36(l.soG),l.Y36(et.gz),l.Y36(nt.d4),l.Y36(q),l.Y36(nt.T1),l.Y36(B.mI),l.Y36(D.CS))},e.\u0275cmp=l.Xpm({type:e,selectors:[[« ng-component »]],features:[l._Bn([B.mI])],decls:20,vars:10,consts:function(){let o,n,a;return o="" + « \ufffd0\ufffd » + «  »,n=« You can select a part of the graph to zoom in »,a=« Reset zoom »,[[1,« margin-content »],[1,« title-page »,« title-page-single »],o,[1,« stats-embed »],[1,« global-stats »],[« class »,« card stats-card »,4,« ngFor »,« ngForOf »],[3,« video »],[1,« stats-with-date »],[1,« overall-stats »],[1,« date-filter-wrapper »],[3,« ngModel »,« items »,« ngModelChange »],[1,« cards »],[1,« timeserie »],[« ngbNav »,"",1,« nav-tabs »,3,« activeId »,« activeIdChange »],[« nav »,« ngbNav »],[3,« ngbNavItem »,4,« ngFor »,« ngForOf »],[3,« ngbNavOutlet »],[1,« card »,« stats-card »],[1,« label »],[4,« ngIf »],[1,« value »],[« class »,« more-info »,4,« ngIf »],[« ptTemplate »,« customHtml »],[1,« more-info »],[3,« ngbNavItem »],[« ngbNavLink »,""],[« ngbNavContent »,""],[1,« chart-container »,3,« ngStyle »],[3,« height »,« width »,« type »,« options »,« data »,« plugins »,4,« ngIf »],[1,« zoom-container »],[« class »,« description »,4,« ngIf »],[3,« click »,4,« ngIf »],[3,« height »,« width »,« type »,« options »,« data »,« plugins »],[1,« description »],n,[3,« click »],a]},template:function(n,a){if(1&n&&(l.TgZ(0,« div »,0)(1,« h1 »,1),l.SDv(2,2),l.qZA(),l.TgZ(3,« div »,3)(4,« div »,4),l.YNc(5,se,7,4,« div »,5),l.qZA(),l._UZ(6,« my-embed »,6),l.qZA(),l.TgZ(7,« div »,7)(8,« div »,8)(9,« div »,9)(10,« h2 »),l._uU(11),l.qZA(),l.TgZ(12,« my-select-options »,10),l.NdJ(« ngModelChange »,function(u){return a.currentDateFilter=u})(« ngModelChange »,function(){return a.onDateFilterChange()}),l.qZA()(),l.TgZ(13,« div »,11),l.YNc(14,ae,6,3,« div »,5),l.qZA()(),l.TgZ(15,« div »,12)(16,« div »,13,14),l.NdJ(« activeIdChange »,function(u){return a.onChartChange(u)}),l.YNc(18,gt,5,2,« ng-container »,15),l.qZA(),l._UZ(19,« div »,16),l.qZA()()()),2&n){const r=l.MAs(17);l.xp6(2),l.pQV(a.video.name),l.QtT(2),l.xp6(3),l.Q6J(« ngForOf »,a.globalStatsCards),l.xp6(1),l.Q6J(« video »,a.video),l.xp6(5),l.Oqu(a.getViewersStatsTitle()),l.xp6(1),l.Q6J(« ngModel »,a.currentDateFilter)(« items »,a.dateFilters),l.xp6(2),l.Q6J(« ngForOf »,a.overallStatCards),l.xp6(2),l.Q6J(« activeId »,a.activeGraphId),l.xp6(2),l.Q6J(« ngForOf »,a.availableCharts),l.xp6(1),l.Q6J(« ngbNavOutlet »,r)}},directives:[$t.sg,$t.O5,ie.I,Se.Y,be.m,Pe.I,ft.JJ,ft.On,pt.Pz,pt.nv,pt.Vx,pt.uN,$t.PC,E.C,xe.r,pt.tO],styles:[".stats-embed[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.overall-stats[_ngcontent-%COMP%], .global-stats[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.overall-stats[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .global-stats[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:16px;width:100%}.overall-stats[_ngcontent-%COMP%]{justify-content:space-between}.overall-stats[_ngcontent-%COMP%] .cards[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.overall-stats[_ngcontent-%COMP%] .date-filter-wrapper[_ngcontent-%COMP%]{margin-bottom:10px;min-width:300px}.stats-card[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:-moz-fit-content;height:fit-content;min-height:100px;min-width:200px;margin-right:15px;background-color:var(–submenuBackgroundColor);margin-bottom:15px}.stats-card[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .stats-card[_ngcontent-%COMP%] .more-info[_ngcontent-%COMP%]{font-size:14px}.stats-card[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{font-size:24px;font-weight:600}@media screen and (max-width: 500px){.stats-card[_ngcontent-%COMP%]{min-height:-moz-fit-content;min-height:fit-content;min-width:-moz-fit-content;min-width:fit-content;padding:15px}}my-embed[_ngcontent-%COMP%]{display:block;max-width:500px;width:100%}.stats-with-date[_ngcontent-%COMP%]{margin-top:30px;padding-top:30px;border-top:1px solid rgba(0,0,0,.1)}@media screen and (max-width: 1040px){.main-col:not(.expanded)[_nghost-%COMP%] my-embed[_ngcontent-%COMP%], .main-col:not(.expanded) [_nghost-%COMP%] my-embed[_ngcontent-%COMP%]{display:none}}@media screen and (max-width: 800px){.main-col.expanded[_nghost-%COMP%] my-embed[_ngcontent-%COMP%], .main-col.expanded [_nghost-%COMP%] my-embed[_ngcontent-%COMP%]{display:none}}.tab-content[_ngcontent-%COMP%]{margin-top:5px}.nav-tabs[_ngcontent-%COMP%]{border-bottom:2px solid #EAEAEA;margin:20px 0 0!important}.nav-tabs.hide-nav[_ngcontent-%COMP%]{display:none!important}.nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%]{margin-bottom:-2px;height:40px!important;padding:0 30px!important;font-size:15px;border:2px solid transparent}.nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%]:active{text-decoration:none!important;outline:none!important}.nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{border-bottom:2px solid transparent}.nav-tabs[_ngcontent-%COMP%] a.nav-link.active[_ngcontent-%COMP%]{border-color:#eaeaea;border-bottom-color:transparent}.nav-tabs[_ngcontent-%COMP%] a.nav-link.active[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{border-bottom-color:var(–mainColor)}.nav-tabs[_ngcontent-%COMP%] a.nav-link[_ngcontent-%COMP%]:hover:not(.active){border-color:transparent}.chart-container[_ngcontent-%COMP%]{margin-bottom:10px}.zoom-container[_ngcontent-%COMP%]{display:flex;justify-content:center}.zoom-container[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-style:italic}"]}),e})(),data:{meta:{title:« Video stats »}},resolve:{video:B.tC}}];let kt=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=l.oAB({type:e}),e.\u0275inj=l.cJS({imports:[[et.Bz.forChild(It)],et.Bz]}),e})(),De=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=l.oAB({type:e}),e.\u0275inj=l.cJS({providers:[q],imports:[[kt,B.nC,M.hA,at.Y,D.Pd,E.S]]}),e})()},10473:(Gt,st,C)=>{« use strict »;C.d(st,{I:()=>nt});var E=C(3184),M=C(90587),at=C(88660),B=C(36362);function D(V,N){if(1&V&&(E.ynx(0),E._UZ(1,« br »),E.TgZ(2,« span »,3),E._uU(3),E.qZA(),E.BQk()),2&V){const p=E.oxw().item;E.xp6(2),E.Q6J(« title »,p.description),E.xp6(1),E.Oqu(p.description)}}function et(V,N){if(1&V&&(E._uU(0),E.YNc(1,D,4,2,« ng-container »,2)),2&V){const p=N.item;E.hij(" « ,p.label, » « ),E.xp6(1),E.Q6J(« ngIf »,p.description)}}let nt=(()=>{class V{constructor(){this.items=[],this.clearable=!1,this.searchable=!1,this.disabled=!1,this.propagateChange=p=>{}}handleChange(p){this.writeValue(p.value),this.onModelChange()}writeValue(p){this.selectedId=p}registerOnChange(p){this.propagateChange=p}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId)}setDisabledState(p){this.disabled=p}}return V.\u0275fac=function(p){return new(p||V)},V.\u0275cmp=E.Xpm({type:V,selectors:[[« my-select-options »]],hostBindings:function(p,P){1&p&&E.NdJ(« change »,function(Z){return P.handleChange(Z.target)})},inputs:{items:« items »,clearable:« clearable »,searchable:« searchable »,groupBy:« groupBy »,labelForId:« labelForId »,searchFn:« searchFn »},features:[E._Bn([{provide:M.JU,useExisting:(0,E.Gpc)(()=>V),multi:!0}])],decls:2,vars:8,consts:[[« bindLabel »,« label »,« bindValue »,« id »,3,« items »,« groupBy »,« ngModel »,« clearable »,« labelForId »,« searchable »,« searchFn »,« disabled »,« ngModelChange »],[« ng-option-tmp », »"],[4,« ngIf »],[1,« muted »,3,« title »]],template:function(p,P){1&p&&(E.TgZ(0,« ng-select »,0),E.NdJ(« ngModelChange »,function(Z){return P.selectedId=Z})(« ngModelChange »,function(){return P.onModelChange()}),E.YNc(1,et,2,2,« ng-template »,1),E.qZA()),2&p&&E.Q6J(« items »,P.items)(« groupBy »,P.groupBy)(« ngModel »,P.selectedId)(« clearable »,P.clearable)(« labelForId »,P.labelForId)(« searchable »,P.searchable)(« searchFn »,P.searchFn)(« disabled »,P.disabled)},directives:[at.w9,M.JJ,M.On,at.ir,B.O5],styles:[".muted[_ngcontent-%COMP%]{font-size:90%}ng-select[_ngcontent-%COMP%]{width:auto}@media screen and (max-width: auto){ng-select[_ngcontent-%COMP%]{width:100%}}ng-select[_ngcontent-%COMP%] .ng-value-container{max-height:100px;overflow-y:auto;overflow-x:hidden}ng-select[_ngcontent-%COMP%] .ng-value-label img{position:relative;top:-1px}ng-select[_ngcontent-%COMP%] img{border-radius:50%;height:20px;width:20px}.root[_ngcontent-%COMP%]{display:flex;align-items:center}.root[_ngcontent-%COMP%] > my-select-options[_ngcontent-%COMP%]{flex-grow:1}my-select-options[_ngcontent-%COMP%] + input[_ngcontent-%COMP%]{padding:0 15px;display:inline-block;height:30px;width:auto;color:var(–inputForegroundColor);background-color:var(–inputBackgroundColor);border:1px solid #C6C6C6;border-radius:3px;font-size:15px;display:block}my-select-options[_ngcontent-%COMP%] + input[_ngcontent-%COMP%]::placeholder{color:var(–inputPlaceholderColor)}my-select-options[_ngcontent-%COMP%] + input[readonly][_ngcontent-%COMP%]{opacity:.7}@media screen and (max-width: calc(auto + 40px)){my-select-options[_ngcontent-%COMP%] + input[_ngcontent-%COMP%]{width:100%}}@supports (margin-inline-start: 5px){my-select-options[_ngcontent-%COMP%] + input[_ngcontent-%COMP%]{margin-inline-start:5px}}@supports not (margin-inline-start: 5px){my-select-options[_ngcontent-%COMP%] + input[_ngcontent-%COMP%]{margin-left:5px}}@supports (margin-inline-start: 5px){.input-suffix[_ngcontent-%COMP%]{margin-inline-start:5px}}@supports not (margin-inline-start: 5px){.input-suffix[_ngcontent-%COMP%]{margin-left:5px}}"]}),V})()},15977:(Gt,st,C)=>{var E;!function(M,at,B,D){« use strict »;var X,et=["",« webkit »,« Moz »,« MS »,« ms »,« o »],nt=at.createElement(« div »),N=Math.round,p=Math.abs,P=Date.now;function Q(t,i,s){return setTimeout(At(t,s),i)}function Z(t,i,s){return!!Array.isArray(t)&&(y(t,s[i],s),!0)}function y(t,i,s){var c;if(t)if(t.forEach)t.forEach(i,s);else if(t.length!==D)for(c=0;c<t.length;)i.call(s,t[c],c,t),c++;else for(c in t)t.hasOwnProperty(c)&&i.call(s,t[c],c,t)}function qt(t,i,s){var c=« DEPRECATED METHOD: « +i+ »\n »+s+" AT \n";return function(){var d=new Error(« get-stack-trace »),f=d&&d.stack?d.stack.replace(/^[^(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.\s(/gm,"{anonymous}()@"):« Unknown Stack Trace »,=M.console&&(M.console.warn||M.console.log);return &&.call(M.console,c,f),t.apply(this,arguments)}}X=« function »!=typeof Object.assign?function(i){if(i===D||null===i)throw new TypeError(« Cannot convert undefined or null to object »);for(var s=Object(i),c=1;c<arguments.length;c++){var d=arguments[c];if(d!==D&&null!==d)for(var f in d)d.hasOwnProperty(f)&&(s[f]=d[f])}return s}:Object.assign;var Dt=qt(function(i,s,c){for(var d=Object.keys(s),f=0;f<d.length;)(!c||c&&i[d[f]]===D)&&(i[d[f]]=s[d[f]]),f++;return i},« extend »,« Use assign. »),Nt=qt(function(i,s){return Dt(i,s,!0)},« merge »,« Use assign. »);function O(t,i,s){var d,c=i.prototype;(d=t.prototype=Object.create(c)).constructor=t,d.super=c,s&&X(d,s)}function At(t,i){return function(){return t.apply(i,arguments)}}function t(t,i){return"function"==typeof t?t.apply(i&&i[0]||D,i):t}function Ft(t,i){return t===D?i:t}function $(t,i,s){y(Ot(i),function(c){t.addEventListener(c,s,!1)})}function Ct(t,i,s){y(Ot(i),function(c){t.removeEventListener(c,s,!1)})}function wt(t,i){for(;t;){if(t==i)return!0;t=t.parentNode}return!1}function j(t,i){return t.indexOf(i)>-1}function Ot(t){return t.trim().split(/\s+/g)}function it(t,i,s){if(t.indexOf&&!s)return t.indexOf(i);for(var c=0;c<t.length;){if(s&&t[c][s]==i||!s&&t[c]===i)return c;c++}return-1}function Et(t){return Array.prototype.slice.call(t,0)}function Jt(t,i,s){for(var c=[],d=[],f=0;f<t.length;){var =i?t[f][i]:t[f];it(d,)<0&&c.push(t[f]),d[f]=,f++}return s&&(c=i?c.sort(function(L,U){return L[i]>U[i]}):c.sort()),c}function rt(t,i){for(var s,c,d=i[0].toUpperCase()+i.slice(1),f=0;f<et.length;){if((c=(s=et[f])?s+d:i)in t)return c;f++}return D}var Qt=1;function yt(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||M}var zt="ontouchstart"in M,lt=rt(M,« PointerEvent »)!==D,jt=zt&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ct=« touch »,St=« mouse »,Vt=[« x »,« y »],bt=[« clientX »,« clientY »];function Y(t,i){var s=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(c){t(t.options.enable,[t])&&s.handler(c)},this.init()}function pe(t,i,s){var c=s.pointers.length,d=s.changedPointers.length,f=1&i&&c-d==0,=12&i&&c-d==0;s.isFirst=!!f,s.isFinal=!!,f&&(t.session={}),s.eventType=i,function ge(t,i){var s=t.session,c=i.pointers,d=c.length;s.firstInput||(s.firstInput=te(i)),d>1&&!s.firstMultiple?s.firstMultiple=te(i):1===d&&(s.firstMultiple=!1);var f=s.firstInput,=s.firstMultiple,A=?.center:f.center,L=i.center=Ut(c);i.timeStamp=P(),i.deltaTime=i.timeStamp-f.timeStamp,i.angle=Zt(A,L),i.distance=dt(A,L),function ve(t,i){var s=i.center,c=t.offsetDelta||{},d=t.prevDelta||{},f=t.prevInput||{};(1===i.eventType||4===f.eventType)&&(d=t.prevDelta={x:f.deltaX||0,y:f.deltaY||0},c=t.offsetDelta={x:s.x,y:s.y}),i.deltaX=d.x+(s.x-c.x),i.deltaY=d.y+(s.y-c.y)}(s,i),i.offsetDirection=ne(i.deltaX,i.deltaY);var U=ee(i.deltaTime,i.deltaX,i.deltaY);i.overallVelocityX=U.x,i.overallVelocityY=U.y,i.overallVelocity=p(U.x)>p(U.y)?U.x:U.y,i.scale=?function Yt(t,i){return dt(i[0],i[1],bt)/dt(t[0],t[1],bt)}(.pointers,c):1,i.rotation=?function e(t,i){return Zt(i[1],i[0],bt)+Zt(t[1],t[0],bt)}(.pointers,c):0,i.maxPointers=s.prevInput?i.pointers.length>s.prevInput.maxPointers?i.pointers.length:s.prevInput.maxPointers:i.pointers.length,function Te(t,i){var d,f,,A,s=t.lastInterval||i,c=i.timeStamp-s.timeStamp;if(8!=i.eventType&&(c>25||s.velocity===D)){var L=i.deltaX-s.deltaX,U=i.deltaY-s.deltaY,J=ee(c,L,U);f=J.x,=J.y,d=p(J.x)>p(J.y)?J.x:J.y,A=ne(L,U),t.lastInterval=i}else d=s.velocity,f=s.velocityX,=s.velocityY,A=s.direction;i.velocity=d,i.velocityX=f,i.velocityY=,i.direction=A}(s,i);var J=t.element;wt(i.srcEvent.target,J)&&(J=i.srcEvent.target),i.target=J}(t,s),t.emit(« hammer.input »,s),t.recognize(s),t.session.prevInput=s}function te(t){for(var i=[],s=0;s<t.pointers.length;)i[s]={clientX:N(t.pointers[s].clientX),clientY:N(t.pointers[s].clientY)},s++;return{timeStamp:P(),pointers:i,center:Ut(i),deltaX:t.deltaX,deltaY:t.deltaY}}function Ut(t){var i=t.length;if(1===i)return{x:N(t[0].clientX),y:N(t[0].clientY)};for(var s=0,c=0,d=0;d<i;)s+=t[d].clientX,c+=t[d].clientY,d++;return{x:N(s/i),y:N(c/i)}}function ee(t,i,s){return{x:i/t||0,y:s/t||0}}function ne(t,i){return t===i?1:p(t)>=p(i)?t<0?2:4:i<0?8:16}function dt(t,i,s){s||(s=Vt);var c=i[s[0]]-t[s[0]],d=i[s[1]]-t[s[1]];return Math.sqrt(cc+dd)}function Zt(t,i,s){return s||(s=Vt),180*Math.atan2(i[s[1]]-t[s[1]],i[s[0]]-t[s[0]])/Math.PI}Y.prototype={handler:function(){},init:function(){this.evEl&&$(this.element,this.evEl,this.domHandler),this.evTarget&&$(this.target,this.evTarget,this.domHandler),this.evWin&&$(yt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Ct(this.element,this.evEl,this.domHandler),this.evTarget&&Ct(this.target,this.evTarget,this.domHandler),this.evWin&&Ct(yt(this.element),this.evWin,this.domHandler)}};var Ce={mousedown:1,mousemove:2,mouseup:4},Oe=« mousedown »,Ee=« mousemove mouseup »;function Pt(){this.evEl=Oe,this.evWin=Ee,this.pressed=!1,Y.apply(this,arguments)}O(Pt,Y,{handler:function(i){var s=Ce[i.type];1&s&&0===i.button&&(this.pressed=!0),2&s&&1!==i.which&&(s=4),this.pressed&&(4&s&&(this.pressed=!1),this.callback(this.manager,s,{pointers:[i],changedPointers:[i],pointerType:St,srcEvent:i}))}});var ye={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},l={2:ct,3:« pen »,4:St,5:« kinect »},mt=« pointerdown »,xt=« pointermove pointerup pointercancel »;function Ht(){this.evEl=mt,this.evWin=xt,Y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}M.MSPointerEvent&&!M.PointerEvent&&(mt=« MSPointerDown »,xt=« MSPointerMove MSPointerUp MSPointerCancel »),O(Ht,Y,{handler:function(i){var s=this.store,c=!1,d=i.type.toLowerCase().replace(« ms »,""),f=ye[d],=l[i.pointerType]||i.pointerType,A===ct,L=it(s,i.pointerId,« pointerId »);1&f&&(0===i.button||A)?L<0&&(s.push(i),L=s.length-1):12&f&&(c=!0),!(L<0)&&(s[L]=i,this.callback(this.manager,f,{pointers:s,changedPointers:[i],pointerType:,srcEvent:i}),c&&s.splice(L,1))}});var Xt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},q=« touchstart »,$t=« touchstart touchmove touchend touchcancel »;function ie(){this.evTarget=q,this.evWin=$t,this.started=!1,Y.apply(this,arguments)}function Se(t,i){var s=Et(t.touches),c=Et(t.changedTouches);return 12&i&&(s=Jt(s.concat(c),« identifier »,!0)),[s,c]}O(ie,Y,{handler:function(i){var s=Xt[i.type];if(1===s&&(this.started=!0),this.started){var c=Se.call(this,i,s);12&s&&c[0].length-c[1].length==0&&(this.started=!1),this.callback(this.manager,s,{pointers:c[0],changedPointers:c[1],pointerType:ct,srcEvent:i})}}});var be={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Pe=« touchstart touchmove touchend touchcancel »;function ft(){this.evTarget=Pe,this.targetIds={},Y.apply(this,arguments)}function pt(t,i){var s=Et(t.touches),c=this.targetIds;if(3&i&&1===s.length)return c[s[0].identifier]=!0,[s,s];var d,f,=Et(t.changedTouches),A=[],L=this.target;if(f=s.filter(function(U){return wt(U.target,L)}),1===i)for(d=0;d<f.length;)c[f[d].identifier]=!0,d++;for(d=0;d<.length;)c[[d].identifier]&&A.push([d]),12&i&&delete c[[d].identifier],d++;return A.length?[Jt(f.concat(A),« identifier »,!0),A]:void 0}function Wt(){Y.apply(this,arguments);var t=At(this.handler,this);this.touch=new ft(this.manager,t),this.mouse=new Pt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Ie(t,i){1&t?(this.primaryTouch=i.changedPointers[0].identifier,se.call(this,i)):12&t&&se.call(this,i)}function se(t){var i=t.changedPointers[0];if(i.identifier===this.primaryTouch){var s={x:i.clientX,y:i.clientY};this.lastTouches.push(s);var c=this.lastTouches;setTimeout(function(){var f=c.indexOf(s);f>-1&&c.splice(f,1)},2500)}}function Me(t){for(var i=t.srcEvent.clientX,s=t.srcEvent.clientY,c=0;c<this.lastTouches.length;c++){var d=this.lastTouches[c],f=Math.abs(i-d.x),=Math.abs(s-d.y);if(f<=25&&_<=25)return!0}return!1}O(ft,Y,{handler:function(i){var s=be[i.type],c=pt.call(this,i,s);!c||this.callback(this.manager,s,{pointers:c[0],changedPointers:c[1],pointerType:ct,srcEvent:i})}}),O(Wt,Y,{handler:function(i,s,c){var f=c.pointerType==St;if(!(f&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(c.pointerType==ct)Ie.call(this,s,c);else if(f&&Me.call(this,c))return;this.callback(i,s,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ae=rt(nt.style,« touchAction »),re=ae!==D,le=« compute »,Bt=« manipulation »,tt=« none »,gt=« pan-x »,vt=« pan-y »,It=function e(){if(!re)return!1;var t={},i=M.CSS&&M.CSS.supports;return[« auto »,« manipulation »,« pan-y »,« pan-x »,« pan-x pan-y »,« none »].forEach(function(s){t[s]=!i||M.CSS.supports(« touch-action »,s)}),t}();function kt(t,i){this.manager=t,this.set(i)}kt.prototype={set:function(t){t==le&&(t=this.compute()),re&&this.manager.element.style&&It[t]&&(this.manager.element.style[ae]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return y(this.manager.recognizers,function(i){t(i.options.enable,[i])&&(t=t.concat(i.getTouchAction()))}),function De(t){if(j(t,tt))return tt;var i=j(t,gt),s=j(t,vt);return i&&s?tt:i||s?i?gt:vt:j(t,Bt)?Bt:« auto »}(t.join(" "))},preventDefaults:function(t){var i=t.srcEvent,s=t.offsetDirection;if(!this.manager.session.prevented){var c=this.actions,d=j(c,tt)&&!It[tt],f=j(c,vt)&&!It[vt],=j(c,gt)&&!It[gt];if(d&&1===t.pointers.length&&t.distance<2&&t.deltaTime<250)return;return &&f||!(d||f&&6&s||&&24&s)?void 0:this.preventSrc(i)}i.preventDefault()},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var m=32;function g(t){this.options=X({},this.defaults,t||{}),this.id=function Rt(){return Qt++}(),this.manager=null,this.options.enable=Ft(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function v(t){return 16&t?« cancel »:8&t?« end »:4&t?« move »:2&t?« start »:""}function T(t){return 16==t?« down »:8==t?« up »:2==t?« left »:4==t?« right »:""}function z(t,i){var s=i.manager;return s?s.get(t):t}function S(){g.apply(this,arguments)}function b(){S.apply(this,arguments),this.pX=null,this.pY=null}function I(){S.apply(this,arguments)}function H(){g.apply(this,arguments),this._timer=null,this.input=null}function Mt(){S.apply(this,arguments)}function Ne(){S.apply(this,arguments)}function ue(){g.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this.timer=null,this.input=null,this.count=0}function Tt(t,i){return(i=i||{}).recognizers=Ft(i.recognizers,Tt.defaults.preset),new Ae(t,i)}function Ae(t,i){this.options=X({},Tt.defaults,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function fe(t){return new(t.options.inputClass||(lt?Ht:jt?ft:zt?Wt:Pt))(t,pe)}(this),this.touchAction=new kt(this,this.options.touchAction),we(this,!0),y(this.options.recognizers,function(s){var c=this.add(new s0);s[2]&&c.recognizeWith(s[2]),s[3]&&c.requireFailure(s[3])},this)}function we(t,i){var c,s=t.element;s.style&&(y(t.options.cssProps,function(d,f){c=rt(s.style,f),i?(t.oldCssProps[c]=s.style[c],s.style[c]=d):s.style[c]=t.oldCssProps[c]||""}),i||(t.oldCssProps={}))}g.prototype={defaults:{},set:function(t){return X(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(Z(t,« recognizeWith »,this))return this;var i=this.simultaneous;return i[(t=z(t,this)).id]||(i[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return Z(t,« dropRecognizeWith »,this)||(t=z(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(Z(t,« requireFailure »,this))return this;var i=this.requireFail;return-1===it(i,t=z(t,this))&&(i.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(Z(t,« dropRequireFailure »,this))return this;t=z(t,this);var i=it(this.requireFail,t);return i>-1&&this.requireFail.splice(i,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var i=this,s=this.state;function c(d){i.manager.emit(d,t)}s<8&&c(i.options.event+v(s)),c(i.options.event),t.additionalEvent&&c(t.additionalEvent),s>=8&&c(i.options.event+v(s))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=m},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var i=X({},t);if(!t(this.options.enable,[this,i]))return this.reset(),void(this.state=m);56&this.state&&(this.state=1),this.state=this.process(i),30&this.state&&this.tryEmit(i)},process:function(t){},getTouchAction:function(){},reset:function(){}},O(S,g,{defaults:{pointers:1},attrTest:function(t){var i=this.options.pointers;return 0===i||t.pointers.length===i},process:function(t){var i=this.state,s=t.eventType,c=6&i,d=this.attrTest(t);return c&&(8&s||!d)?16|i:c||d?4&s?8|i:2&i?4|i:2:m}}),O(b,S,{defaults:{event:« pan »,threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,i=[];return 6&t&&i.push(vt),24&t&&i.push(gt),i},directionTest:function(t){var i=this.options,s=!0,c=t.distance,d=t.direction,f=t.deltaX,=t.deltaY;return d&i.direction||(6&i.direction?(d=0===f?1:f<0?2:4,s=f!=this.pX,c=Math.abs(t.deltaX)):(d=0===?1:<0?8:16,s=!=this.pY,c=Math.abs(t.deltaY))),t.direction=d,s&&c>i.threshold&&d&i.direction},attrTest:function(t){return S.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var i=T(t.direction);i&&(t.additionalEvent=this.options.event+i),this._super.emit.call(this,t)}}),O(I,S,{defaults:{event:« pinch »,threshold:0,pointers:2},getTouchAction:function(){return[tt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?« in »:« out »)),this._super.emit.call(this,t)}}),O(H,g,{defaults:{event:« press »,pointers:1,time:251,threshold:9},getTouchAction:function(){return[« auto »]},process:function(t){var i=this.options,s=t.pointers.length===i.pointers,c=t.distance<i.threshold,d=t.deltaTime>i.time;if(this._input=t,!c||!s||12&t.eventType&&!d)this.reset();else if(1&t.eventType)this.reset(),this._timer=Q(function(){this.state=8,this.tryEmit()},i.time,this);else if(4&t.eventType)return 8;return m},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+« up »,t):(this._input.timeStamp=P(),this.manager.emit(this.options.event,this._input)))}}),O(Mt,S,{defaults:{event:« rotate »,threshold:0,pointers:2},getTouchAction:function(){return[tt]},attrTest:function(t){return this.super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),O(Ne,S,{defaults:{event:« swipe »,threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return b.prototype.getTouchAction.call(this)},attrTest:function(t){var s,i=this.options.direction;return 30&i?s=t.overallVelocity:6&i?s=t.overallVelocityX:24&i&&(s=t.overallVelocityY),this.super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(s)>this.options.velocity&&4&t.eventType},emit:function(t){var i=T(t.offsetDirection);i&&this.manager.emit(this.options.event+i,t),this.manager.emit(this.options.event,t)}}),O(ue,g,{defaults:{event:« tap »,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Bt]},process:function(t){var i=this.options,s=t.pointers.length===i.pointers,c=t.distance<i.threshold,d=t.deltaTime<i.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(c&&d&&s){if(4!=t.eventType)return this.failTimeout();var f=!this.pTime||t.timeStamp-this.pTime<i.interval,=!this.pCenter||dt(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,&&f?this.count+=1:this.count=1,this._input=t,0==this.count%i.taps)return this.hasRequireFailures()?(this._timer=Q(function(){this.state=8,this.tryEmit()},i.interval,this),2):8}return m},failTimeout:function(){return this._timer=Q(function(){this.state=m},this.options.interval,this),m},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Tt.VERSION=« 2.0.7 »,Tt.defaults={domEvents:!1,touchAction:le,enable:!0,inputTarget:null,inputClass:null,preset:[[Mt,{enable:!1}],[I,{enable:!1},[« rotate »]],[Ne,{direction:6}],[b,{direction:6},[« swipe »]],[ue],[ue,{event:« doubletap »,taps:2},[« tap »]],[H]],cssProps:{userSelect:« none »,touchSelect:« none »,touchCallout:« none »,contentZooming:« none »,userDrag:« none »,tapHighlightColor:« rgba(0,0,0,0) »}},Ae.prototype={set:function(t){return X(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var i=this.session;if(!i.stopped){this.touchAction.preventDefaults(t);var s,c=this.recognizers,d=i.curRecognizer;(!d||d&&8&d.state)&&(d=i.curRecognizer=null);for(var f=0;f<c.length;)s=c[f],2===i.stopped||d&&s!=d&&!s.canRecognizeWith(d)?s.reset():s.recognize(t),!d&&14&s.state&&(d=i.curRecognizer=s),f++}},get:function(t){if(t instanceof g)return t;for(var i=this.recognizers,s=0;s<i.length;s++)if(i[s].options.event==t)return i[s];return null},add:function(t){if(Z(t,« add »,this))return this;var i=this.get(t.options.event);return i&&this.remove(i),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(Z(t,« remove »,this))return this;if(t=this.get(t)){var i=this.recognizers,s=it(i,t);-1!==s&&(i.splice(s,1),this.touchAction.update())}return this},on:function(t,i){if(t!==D&&i!==D){var s=this.handlers;return y(Ot(t),function(c){s[c]=s[c]||[],s[c].push(i)}),this}},off:function(t,i){if(t!==D){var s=this.handlers;return y(Ot(t),function(c){i?s[c]&&s[c].splice(it(s[c],i),1):delete s[c]}),this}},emit:function(t,i){this.options.domEvents&&function ze(t,i){var s=at.createEvent(« Event »);s.initEvent(t,!0,!0),s.gesture=i,i.target.dispatchEvent(s)}(t,i);var s=this.handlers[t]&&this.handlers[t].slice();if(s&&s.length){i.type=t,i.preventDefault=function(){i.srcEvent.preventDefault()};for(var c=0;c<s.length;)sc,c++}},destroy:function(){this.element&&we(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},X(Tt,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:m,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ae,Input:Y,TouchAction:kt,TouchInput:ft,MouseInput:Pt,PointerEventInput:Ht,TouchMouseInput:Wt,SingleTouchInput:ie,Recognizer:g,AttrRecognizer:S,Tap:ue,Pan:b,Swipe:Ne,Pinch:I,Rotate:Mt,Press:H,on:$,off:Ct,each:y,merge:Nt,extend:Dt,assign:X,inherit:O,bindFn:At,prefixed:rt}),(void 0!==M?M:« undefined »!=typeof self?self:{}).Hammer=Tt,(E=function(){return Tt}.call(st,C,st,Gt))!==D&&(Gt.exports=E)}(window,document)}}]);
//# sourceMappingURL=9951.0c991c75ba4ed70c.js.map

I`m sorry - im noob in web development :expressionless:

Wow. lots of message - maybe delete this, and put in file or other place?