mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-02 17:48:34 +01:00
2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[878],{8878:(t,e,n)=>{n.r(e),n.d(e,{create:()=>ut});const o=window.devicePixelRatio||1,a={begin:.8,end:1},i=300,l=10,s=.5,r="300 10px Helvetica, Arial, sans-serif",c=i,d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f=["begin 200 fast","end 200 fast","labelFromIndex 200 fast floor","labelToIndex 200 fast ceil","xAxisScale 400","yMinViewport","yMaxViewport","yMinViewportSecond","yMaxViewportSecond","yMinMinimap","yMaxMinimap","yMinMinimapSecond","yMaxMinimapSecond","yAxisScale","yAxisScaleSecond"];function m(t){const e=t.length;let n=t[0],o=t[0];for(let a=0;a<e;a++){const e=t[a];e>n?n=e:e<o&&(o=e)}return{max:n,min:o}}function p(t){return[].concat.apply([],t)}function g(t){const e=[],n=t.length;for(let o=0,a=t[0].length;o<a;o++){e[o]=0;for(let a=0;a<n;a++)e[o]+=t[a][o]}return e}function y(t,e){return new Proxy({},{get:(n,o)=>void 0!==n[o]?n[o]:void 0!==e[o]?e[o]:t[o]})}function v(t,e){let n,o,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=null;return function(){n=!0;for(var l=arguments.length,s=new Array(l),r=0;r<l;r++)s[r]=arguments[r];o=s,i||(a&&(n=!1,t(...o)),i=window.setInterval((()=>{if(!n)return window.clearInterval(i),void(i=null);n=!1,t(...o)}),e))}}function x(t){let e,n=!1;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];e=a,n||(n=!0,requestAnimationFrame((()=>{n=!1,t(...e)})))}}const M=[1,2,8,18,50,100,250,500,1e3,2500,5e3,1e4,25e3,5e4,1e5,25e4,5e5,1e6,25e5,5e6,1e7,25e6,5e7,1e8];function b(t){return M[t]||M[M.length-1]}function w(t,e,n){const o=Math.min(e+l,n-e);return o<=40&&(t=Math.min(1,t,o/40)),t}function k(t,e){return e-l<=20?Math.min(1,t,(e-l)/20):t}function S(t){return.45*Math.min(...t.getSize())}function L(t){return t>=1e3?Math.min(t/1e3,1):0}function F(t,e,n,o,a,i,l){const{begin:s,end:r}=n,c=t.xLabels.length-1,d=Math.max(0,Math.ceil(c*s)),u=Math.min(Math.floor(c*r),c),h=function(t,e,n){return o=(n-e)/Math.floor(t/45),Math.ceil(Math.log2(o||1));var o}(e.width,d,u),f=t.isStacked?function(t,e,n,o,a){const i=t.datasets.filter((t=>e[t.key])).map((t=>{let{values:e}=t;return e})),l=i.length?g(i):[],{max:s=a.yMaxMinimap}=m(l),{max:r=a.yMaxViewport}=m(l.slice(n,o+1));return{yMinViewport:0,yMaxViewport:r,yMinMinimap:0,yMaxMinimap:s}}(t,o,d,u,l):function(t,e,n,o,a){const i=t.hasSecondYAxis&&t.datasets.slice(-1)[0],l=t.datasets.filter((t=>e[t.key]&&t!==i)),s=T(t,n,o,a,l);if(i){const{yMinViewport:e,yMaxViewport:l,yMinMinimap:r,yMaxMinimap:c}=T(t,n,o,a,[i]);Object.assign(s,{yMinViewportSecond:e,yMaxViewportSecond:l,yMinMinimapSecond:r,yMaxMinimapSecond:c})}return s}(t,o,d,u,l),p=A(e.height,f.yMinViewport,f.yMaxViewport),y=t.hasSecondYAxis&&A(e.height,f.yMinViewportSecond,f.yMaxViewportSecond),v=b(p);if(f.yMinViewport-=f.yMinViewport%v,y){const t=b(y);f.yMinViewportSecond-=f.yMinViewportSecond%t}const x={};return t.datasets.forEach((t=>{let{key:e}=t;x[`opacity#${e}`]=o[e]?1:0})),Object.assign({totalXWidth:c,xAxisScale:h,yAxisScale:p,yAxisScaleSecond:y,labelFromIndex:Math.max(0,d-1),labelToIndex:Math.min(u+1,c),filter:Object.assign({},o),focusOn:void 0!==a?a:l.focusOn,minimapDelta:void 0!==i?i:l.minimapDelta},f,x,n)}function T(t,e,n,o,a){const{min:i=o.yMinMinimap,max:l=o.yMaxMinimap}=m(p(a.map((t=>{let{yMax:e,yMin:n}=t;return[e,n]})))),s=i/l>.1?i:0;let r,c;if(0===e&&n===t.xLabels.length-1)r=s,c=l;else{const t=m(p(a.map((t=>{let{values:e}=t;return e})).map((t=>t.slice(e,n+1))))),i=void 0!==t.min?t.min:o.yMinViewport;c=void 0!==t.max?t.max:o.yMaxViewport,r=i/c>.1?i:0}return{yMinViewport:r,yMaxViewport:c,yMinMinimap:s,yMaxMinimap:l}}function A(t,e,n){const o=t-30,a=n-e,i=Math.floor(o/50);return l=a/i,M.findIndex((t=>t>=l))||M.length-1;var l}const P=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return document.createElement(t)};function $(t,e,n){t.addEventListener(e,n)}function I(t,e,n){t.removeEventListener(e
|
||
|
//# sourceMappingURL=878.10fc2a2ac02923a134fa.js.map
|