1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9270],{62230:(t,e,i)=>{function r(t,e,i,r,n,o){}function n(t,e,i){r("%c\uD83D\uDE11 klinecharts warning%c %s%s%s","padding:3px 4px;border-radius:2px;color:#ffffff;background-color:#FF9600","color:#FF9600",t,e,null!=i?i:"")}function o(t,e){if(u(t)||u(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t[i],n=e[i];u(n)&&u(r)?o(r,n):t[i]=a(n)}}}function a(t){if(!u(t))return t;var e=null;for(var i in e=s(t)?[]:{},t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];u(r)?e[i]=a(r):e[i]=r}return e}function s(t){return"[object Array]"===Object.prototype.toString.call(t)}function l(t){return"function"==typeof t}function u(t){return"object"==typeof t&&h(t)}function c(t){return"number"==typeof t&&Number.isFinite(t)}function h(t){return null!=t}function d(t){return"boolean"==typeof t}function p(t){return"string"==typeof t}i.d(e,{AS:()=>ew,Ts:()=>eb});var g=/\\(\\)?/g,f=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");function v(t,e,i){if(h(t)){var r=[];e.replace(f,function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=t;return h(e[1])?n=e[2].replace(g,"$1"):h(e[0])&&(n=e[0].trim()),r.push(n),""});for(var n=t,o=0,a=r.length;h(n)&&o<a;)n=null==n?void 0:n[r[o++]];return h(n)?n:null!=i?i:"--"}return null!=i?i:"--"}function m(t,e){var i=+t;return c(i)?i.toFixed(null!=e?e:2):"".concat(t)}function y(t){var e=+t;if(c(e)){if(e>1e9)return"".concat(+(e/1e9).toFixed(3),"B");if(e>1e6)return"".concat(+(e/1e6).toFixed(3),"M");if(e>1e3)return"".concat(+(e/1e3).toFixed(3),"K")}return"".concat(t)}function _(t,e){return t.replace(/\{(\w+)\}/g,function(t,i){var r=e[i];return h(r)?r:"{".concat(i,"}")})}var x=null;function b(t){var e,i;return null!=(i=null==(e=t.ownerDocument.defaultView)?void 0:e.devicePixelRatio)?i:1}function w(t,e,i){return"".concat(null!=e?e:"normal"," ").concat(null!=t?t:12,"px ").concat(null!=i?i:"Helvetica Neue")}function C(t,e,i,r){if(!h(x)){var n=document.createElement("canvas"),o=b(n);(x=n.getContext("2d")).scale(o,o)}return x.font=w(e,i,r),Math.round(x.measureText(t).width)}var E=function(t,e){return(E=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function S(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var T=function(){return(T=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function P(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]]);return i}function M(t,e,i,r){return new(i||(i=Promise))(function(n,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(a,s)}l((r=r.apply(t,e||[])).next())})}function I(t,e){var i,r,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(i)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(i=1,r&&(n=2&u[0]?r.return:u[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,u[1])).done)return n;switch(r=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){o.label=u[1];break}if(6===u[0]&&o.label<n[1]){o.label=n[1],n=u;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(u);break}n[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(t){u=[6,t],r=0}finally{i=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function k(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function A(t,e,i){if(i||2==arguments.length)for(var r,n=0,o=e.length;n<o;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))}
1function F(t){var e={width:0,height:0,left:0,right:0,top:0,bottom:0};return h(t)&&o(e,t),e}function B(t){return l(window.requestAnimationFrame)?window.requestAnimationFrame(t):window.setTimeout(t,20)}function R(t){l(window.cancelAnimationFrame)?window.cancelAnimationFrame(t):window.clearTimeout(t)}"function"==typeof SuppressedError&&SuppressedError;var L=function(){function t(t){this._options={duration:500,iterationCount:1},this._currentIterationCount=0,this._running=!1,this._time=0,o(this._options,t)}return t.prototype._loop=function(){var t=this;this._running=!0;var e=function(){var i;if(t._running){var r=new Date().getTime()-t._time;r<t._options.duration?(null==(i=t._doFrameCallback)||i.call(t,r),B(e)):(t.stop(),t._currentIterationCount++,t._currentIterationCount<t._options.iterationCount&&t.start())}};B(e)},t.prototype.doFrame=function(t){return this._doFrameCallback=t,this},t.prototype.setDuration=function(t){return this._options.duration=t,this},t.prototype.setIterationCount=function(t){return this._options.iterationCount=t,this},t.prototype.start=function(){this._running||(this._time=new Date().getTime(),this._loop())},t.prototype.stop=function(){var t;this._running&&(null==(t=this._doFrameCallback)||t.call(this,this._options.duration)),this._running=!1},t}(),O=1,W=new Date().getTime();function z(t){var e=new Date().getTime();return e===W?++O:O=1,W=e,"".concat(null!=t?t:"").concat(e,"_").concat(O)}function V(t,e){var i,r=document.createElement(t),n=null!=e?e:{};for(var o in n)r.style[o]=null!=(i=n[o])?i:"";return r}function Y(t,e,i){var r=0,n=0;for(n=t.length-1;r!==n;){var o=Math.floor((n+r)/2),a=n-r,s=t[o][e];if(i===t[r][e])break;if(i===t[n][e])return n;if(i===s)return o;if(i>s?r=o:n=o,a<=2)break}return r}function N(t,e){var i=Math.pow(10,e=Math.max(0,null!=e?e:0));return Math.round(t*i)/i}function H(t,e,i){for(var r,n,o=[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],a=t.length,s=0;s<a;){var l=t[s];o[0]=Math.max(null!=(r=l[e])?r:Number.MIN_SAFE_INTEGER,o[0]),o[1]=Math.min(null!=(n=l[i])?n:Number.MAX_SAFE_INTEGER,o[1]),++s}return o}function X(t){return 0===t?0:Math.log10(t)}function Z(t){return Math.pow(10,t)}function G(){return{from:0,to:0,realFrom:0,realTo:0}}var U=function(){function t(t){this._holdingTasks=null,this._running=!1,this._callback=t}return t.prototype.add=function(t){this._running?h(this._holdingTasks)?this._holdingTasks=T(T({},this._holdingTasks),t):this._holdingTasks=t:this._runTask(t)},t.prototype._runTask=function(t){return M(this,void 0,void 0,function(){var e,i;return I(this,function(r){switch(r.label){case 0:this._running=!0,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,Promise.all(Object.values(t))];case 2:return r.sent(),[3,4];case 3:return this._running=!1,null==(i=this._callback)||i.call(this),h(this._holdingTasks)&&(e=this._holdingTasks,this._runTask(e),this._holdingTasks=null),[7];case 4:return[2]}})})},t.prototype.clear=function(){this._holdingTasks=null},t}(),q=function(){function t(){this._callbacks=[]}return t.prototype.subscribe=function(t){0>this._callbacks.indexOf(t)&&this._callbacks.push(t)},t.prototype.unsubscribe=function(t){if(l(t)){var e=this._callbacks.indexOf(t);e>-1&&this._callbacks.splice(e,1)}else this._callbacks=[]},t.prototype.execute=function(t){this._callbacks.forEach(function(e){e(t)})},t.prototype.isEmpty=function(){return 0===this._callbacks.length},t}();function j(t){return"transparent"===t||"none"===t||/^[rR][gG][Bb][Aa]\(([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){3}[\s]*0[\s]*\)$/.test(t)||/^[hH][Ss][Ll][Aa]\(([\s]*(360ï½3[0-5][0-9]|[012]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*0[\s]*)\)$/.test(t)}function Q(t,e){var i=parseInt(t.replace(/^#/,""),16);return"rgba(".concat(i>>16&255,", ").concat(i>>8&255,", ").concat(255&i,", ").concat(null!=e?e:1,")")}var K="#F92855",J="#2DC08E",$="#FFFFFF",tt="#76808F",te="#1677FF";function ti(){return{show:!0,size:"auto",axisLine:{show:!0,color:"#DDDDDD",size:1},tickText:{show:!0,color:tt,size:12,family:"Helvetica Neue",weight:"normal",marginStart:4,marginEnd:6},tickLine:{show:!0,size:1,length:3,color:"#DDDDDD"}}}function tr(t,e,i,r){var n,o=t.result,a=t.figures,s=t.styles,l=v(s,"circles",i.circles),u=l.length,c=v(s,"bars",i.bars),d=c.length,p=v(s,"lines",i.lines),g=p.length,f=0,m=0,y=0,_=0;a.forEach(function(a){var s;switch(a.type){case"circle":_=f;var v=l[f%u];n=T(T({},v),{color:v.noChangeColor}),f++;break;case"bar":_=m;var x=c[m%d];n=T(T({},x),{color:x.noChangeColor}),m++;break;case"line":_=y,n=p[y%g],y++}if(h(a.type)){var b=null==(s=a.styles)?void 0:s.call(a,{data:{prev:o[e-1],current:o[e],next:o[e+1]},indicator:t,defaultStyles:i});r(a,T(T({},n),b),_)}})}var tn=function(){function t(t){this.precision=4,this.calcParams=[],this.shouldOhlc=!1,this.shouldFormatBigNumber=!1,this.visible=!0,this.zLevel=0,this.series="normal",this.figures=[],this.minValue=null,this.maxValue=null,this.styles=null,this.shouldUpdate=function(t,e){var i=JSON.stringify(t.calcParams)!==JSON.stringify(e.calcParams)||t.figures!==e.figures||t.calc!==e.calc,r=i||t.shortName!==e.shortName||t.series!==e.series||t.minValue!==e.minValue||t.maxValue!==e.maxValue||t.precision!==e.precision||t.shouldOhlc!==e.shouldOhlc||t.shouldFormatBigNumber!==e.shouldFormatBigNumber||t.visible!==e.visible||t.zLevel!==e.zLevel||t.extendData!==e.extendData||t.regenerateFigures!==e.regenerateFigures||t.createTooltipDataSource!==e.createTooltipDataSource||t.draw!==e.draw;return{calc:i,draw:r}},this.calc=function(){return[]},this.regenerateFigures=null,this.createTooltipDataSource=null,this.draw=null,this.result=[],this._lockSeriesPrecision=!1,this.override(t),this._lockSeriesPrecision=!1}return t.prototype.override=function(t){var e,i=this.result,r=P(this,["result"]);this._prevIndicator=T(T({},a(r)),{result:i});var n=t.id,s=t.name,u=t.shortName,d=t.precision,g=t.styles,f=t.figures,v=t.calcParams,m=P(t,["id","name","shortName","precision","styles","figures","calcParams"]);!p(this.id)&&p(n)&&(this.id=n),p(this.name)||(this.name=null!=s?s:""),this.shortName=null!=(e=null!=u?u:this.shortName)?e:this.name,c(d)&&(this.precision=d,this._lockSeriesPrecision=!0),h(g)&&(null!=this.styles||(this.styles={}),o(this.styles,g)),o(this,m),h(v)&&(this.calcParams=v,l(this.regenerateFigures)&&(this.figures=this.regenerateFigures(this.calcParams))),this.figures=null!=f?f:this.figures},t.prototype.setSeriesPrecision=function(t){this._lockSeriesPrecision||(this.precision=t)},t.prototype.shouldUpdateImp=function(){var t=this._prevIndicator.zLevel!==this.zLevel,e=this.shouldUpdate(this._prevIndicator,this);return d(e)?{calc:e,draw:e,sort:t}:T(T({},e),{sort:t})},t.prototype.calcImp=function(t){return M(this,void 0,void 0,function(){var e;return I(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.calc(t,this)];case 1:return e=i.sent(),this.result=e,[2,!0];case 2:return i.sent(),[2,!1];case 3:return[2]}})})},t.extend=function(e){var i=t;function r(){return i.call(this,e)||this}return S(r,i),r},t}();function to(){return{key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,styles:function(t){var e=t.data,i=t.indicator,r=t.defaultStyles,n=e.current,o=v(i.styles,"bars[0].noChangeColor",r.bars[0].noChangeColor);return h(n)&&(n.close>n.open?o=v(i.styles,"bars[0].upColor",r.bars[0].upColor):n.close<n.open&&(o=v(i.styles,"bars[0].downColor",r.bars[0].downColor))),{color:o}}}}var ta={name:"VOL",shortName:"VOL",series:"volume",calcParams:[5,10,20],shouldFormatBigNumber:!0,precision:0,minValue:0,figures:[{key:"ma1",title:"MA5: ",type:"line"},{key:"ma2",title:"MA10: ",type:"line"},{key:"ma3",title:"MA20: ",type:"line"},to()],regenerateFigures:function(t){var e=t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}});return e.push(to()),e},calc:function(t,e){var i=e.calcParams,r=e.figures,n=[];return t.map(function(e,o){var a,s=null!=(a=e.volume)?a:0,l={volume:s,open:e.open,close:e.close};
1return i.forEach(function(e,i){var a,u;n[i]=(null!=(a=n[i])?a:0)+s,o>=e-1&&(l[r[i].key]=n[i]/e,n[i]-=null!=(u=t[o-(e-1)].volume)?u:0)}),l})}},ts={};function tl(t){var e;return null!=(e=ts[t])?e:null}function tu(t,e){var i,r=null!=(i=null==e?void 0:e.ignoreEvent)&&i;return d(r)?!r:!r.includes(t)}[{name:"AVP",shortName:"AVP",series:"price",precision:2,figures:[{key:"avp",title:"AVP: ",type:"line"}],calc:function(t){var e=0,i=0;return t.map(function(t){var r,n,o={},a=null!=(r=t.turnover)?r:0,s=null!=(n=t.volume)?n:0;return e+=a,0!==(i+=s)&&(o.avp=e/i),o})}},{name:"AO",shortName:"AO",calcParams:[5,34],figures:[{key:"ao",title:"AO: ",type:"bar",baseValue:0,styles:function(t){var e,i,r=t.data,n=t.indicator,o=t.defaultStyles,a=r.prev,s=r.current,l=null!=(e=null==a?void 0:a.ao)?e:Number.MIN_SAFE_INTEGER,u=null!=(i=null==s?void 0:s.ao)?i:Number.MIN_SAFE_INTEGER,c="";return{color:c=u>l?v(n.styles,"bars[0].upColor",o.bars[0].upColor):v(n.styles,"bars[0].downColor",o.bars[0].downColor),style:u>l?"stroke":"fill",borderColor:c}}}],calc:function(t,e){var i=e.calcParams,r=Math.max(i[0],i[1]),n=0,o=0,a=0,s=0;return t.map(function(e,l){var u={},c=(e.low+e.high)/2;if(n+=c,o+=c,l>=i[0]-1){a=n/i[0];var h=t[l-(i[0]-1)];n-=(h.low+h.high)/2}if(l>=i[1]-1){s=o/i[1];var h=t[l-(i[1]-1)];o-=(h.low+h.high)/2}return l>=r-1&&(u.ao=a-s),u})}},{name:"BIAS",shortName:"BIAS",calcParams:[6,12,24],figures:[{key:"bias1",title:"BIAS6: ",type:"line"},{key:"bias2",title:"BIAS12: ",type:"line"},{key:"bias3",title:"BIAS24: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"bias".concat(e+1),title:"BIAS".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,r=e.figures,n=[];return t.map(function(e,o){var a={},s=e.close;return i.forEach(function(e,l){var u;if(n[l]=(null!=(u=n[l])?u:0)+s,o>=e-1){var c=n[l]/i[l];a[r[l].key]=(s-c)/c*100,n[l]-=t[o-(e-1)].close}}),a})}},{name:"BOLL",shortName:"BOLL",series:"price",calcParams:[20,2],precision:2,shouldOhlc:!0,figures:[{key:"up",title:"UP: ",type:"line"},{key:"mid",title:"MID: ",type:"line"},{key:"dn",title:"DN: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=i[0]-1,n=0;return t.map(function(e,o){var a=e.close,s={};if(n+=a,o>=r){s.mid=n/i[0];var l,u,c,h,d=(l=t.slice(o-r,o+1),u=s.mid,c=l.length,h=0,l.forEach(function(t){var e=t.close-u;h+=e*e}),Math.sqrt((h=Math.abs(h))/c));s.up=s.mid+i[1]*d,s.dn=s.mid-i[1]*d,n-=t[o-r].close}return s})}},{name:"BRAR",shortName:"BRAR",calcParams:[26],figures:[{key:"br",title:"BR: ",type:"line"},{key:"ar",title:"AR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=0,a=0;return t.map(function(e,s){var l,u,c={},h=e.high,d=e.low,p=e.open,g=(null!=(l=t[s-1])?l:e).close;if(o+=h-p,a+=p-d,r+=h-g,n+=g-d,s>=i[0]-1){0!==a?c.ar=o/a*100:c.ar=0,0!==n?c.br=r/n*100:c.br=0;var f=t[s-(i[0]-1)],v=f.high,m=f.low,y=f.open,_=(null!=(u=t[s-i[0]])?u:t[s-(i[0]-1)]).close;r-=v-_,n-=_-m,o-=v-y,a-=y-m}return c})}},{name:"BBI",shortName:"BBI",series:"price",precision:2,calcParams:[3,6,12,24],shouldOhlc:!0,figures:[{key:"bbi",title:"BBI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=Math.max.apply(Math,A([],D(i),!1)),n=[],o=[];return t.map(function(e,a){var s={},l=e.close;if(i.forEach(function(e,i){var r;n[i]=(null!=(r=n[i])?r:0)+l,a>=e-1&&(o[i]=n[i]/e,n[i]-=t[a-(e-1)].close)}),a>=r-1){var u=0;o.forEach(function(t){u+=t}),s.bbi=u/4}return s})}},{name:"CCI",shortName:"CCI",calcParams:[20],figures:[{key:"cci",title:"CCI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=i[0]-1,n=0,o=[];return t.map(function(e,a){var s={},l=(e.high+e.low+e.close)/3;if(n+=l,o.push(l),a>=r){var u=n/i[0],c=o.slice(a-r,a+1),h=0;
1c.forEach(function(t){h+=Math.abs(t-u)});var d=h/i[0];s.cci=0!==d?(l-u)/d/.015:0;var p=(t[a-r].high+t[a-r].low+t[a-r].close)/3;n-=p}return s})}},{name:"CR",shortName:"CR",calcParams:[26,10,20,40,60],figures:[{key:"cr",title:"CR: ",type:"line"},{key:"ma1",title:"MA1: ",type:"line"},{key:"ma2",title:"MA2: ",type:"line"},{key:"ma3",title:"MA3: ",type:"line"},{key:"ma4",title:"MA4: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=Math.ceil(i[1]/2.5+1),n=Math.ceil(i[2]/2.5+1),o=Math.ceil(i[3]/2.5+1),a=Math.ceil(i[4]/2.5+1),s=0,l=[],u=0,c=[],h=0,d=[],p=0,g=[],f=[];return t.forEach(function(e,v){var m,y,_,x,b,w={},C=null!=(m=t[v-1])?m:e,E=(C.high+C.close+C.low+C.open)/4,S=Math.max(0,e.high-E),T=Math.max(0,E-e.low);v>=i[0]-1&&(0!==T?w.cr=S/T*100:w.cr=0,s+=w.cr,u+=w.cr,h+=w.cr,p+=w.cr,v>=i[0]+i[1]-2&&(l.push(s/i[1]),v>=i[0]+i[1]+r-3&&(w.ma1=l[l.length-1-r]),s-=null!=(y=f[v-(i[1]-1)].cr)?y:0),v>=i[0]+i[2]-2&&(c.push(u/i[2]),v>=i[0]+i[2]+n-3&&(w.ma2=c[c.length-1-n]),u-=null!=(_=f[v-(i[2]-1)].cr)?_:0),v>=i[0]+i[3]-2&&(d.push(h/i[3]),v>=i[0]+i[3]+o-3&&(w.ma3=d[d.length-1-o]),h-=null!=(x=f[v-(i[3]-1)].cr)?x:0),v>=i[0]+i[4]-2&&(g.push(p/i[4]),v>=i[0]+i[4]+a-3&&(w.ma4=g[g.length-1-a]),p-=null!=(b=f[v-(i[4]-1)].cr)?b:0)),f.push(w)}),f}},{name:"DMA",shortName:"DMA",calcParams:[10,50,10],figures:[{key:"dma",title:"DMA: ",type:"line"},{key:"ama",title:"AMA: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=Math.max(i[0],i[1]),n=0,o=0,a=0,s=[];return t.forEach(function(e,l){var u,c={},h=e.close;n+=h,o+=h;var d=0,p=0;if(l>=i[0]-1&&(d=n/i[0],n-=t[l-(i[0]-1)].close),l>=i[1]-1&&(p=o/i[1],o-=t[l-(i[1]-1)].close),l>=r-1){var g=d-p;c.dma=g,a+=g,l>=r+i[2]-2&&(c.ama=a/i[2],a-=null!=(u=s[l-(i[2]-1)].dma)?u:0)}s.push(c)}),s}},{name:"DMI",shortName:"DMI",calcParams:[14,6],figures:[{key:"pdi",title:"PDI: ",type:"line"},{key:"mdi",title:"MDI: ",type:"line"},{key:"adx",title:"ADX: ",type:"line"},{key:"adxr",title:"ADXR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=[];return t.forEach(function(e,d){var p,g,f={},v=null!=(p=t[d-1])?p:e,m=v.close,y=e.high,_=e.low,x=Math.abs(y-m),b=Math.abs(m-_),w=y-v.high,C=v.low-_,E=Math.max(Math.max(y-_,x),b),S=w>0&&w>C?w:0,T=C>0&&C>w?C:0;if(r+=E,n+=S,o+=T,d>=i[0]-1){d>i[0]-1?(a=a-a/i[0]+E,s=s-s/i[0]+S,l=l-l/i[0]+T):(a=r,s=n,l=o);var P=0,M=0;0!==a&&(P=100*s/a,M=100*l/a),f.pdi=P,f.mdi=M;var I=0;M+P!==0&&(I=Math.abs(M-P)/(M+P)*100),u+=I,d>=2*i[0]-2&&(f.adx=c=d>2*i[0]-2?(c*(i[0]-1)+I)/i[0]:u/i[0],d>=2*i[0]+i[1]-3&&(f.adxr=((null!=(g=h[d-(i[1]-1)].adx)?g:0)+c)/2))}h.push(f)}),h}},{name:"EMV",shortName:"EMV",calcParams:[14,9],figures:[{key:"emv",title:"EMV: ",type:"line"},{key:"maEmv",title:"MAEMV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=[];return t.map(function(e,o){var a,s={};if(o>0){var l=t[o-1],u=e.high,c=e.low,h=null!=(a=e.volume)?a:0,d=(u+c)/2-(l.high+l.low)/2;0===h||u-c==0?s.emv=0:s.emv=d/(h/1e8/(u-c)),r+=s.emv,n.push(s.emv),o>=i[0]&&(s.maEmv=r/i[0],r-=n[o-i[0]])}return s})}},{name:"EMA",shortName:"EMA",series:"price",calcParams:[6,12,20],precision:2,shouldOhlc:!0,figures:[{key:"ema1",title:"EMA6: ",type:"line"},{key:"ema2",title:"EMA12: ",type:"line"},{key:"ema3",title:"EMA20: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ema".concat(e+1),title:"EMA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,r=e.figures,n=0,o=[];return t.map(function(t,e){var a={},s=t.close;return n+=s,i.forEach(function(t,i){e>=t-1&&(e>t-1?o[i]=(2*s+(t-1)*o[i])/(t+1):o[i]=n/t,a[r[i].key]=o[i])}),a})}},{name:"MTM",shortName:"MTM",calcParams:[12,6],figures:[{key:"mtm",title:"MTM: ",type:"line"},{key:"maMtm",title:"MAMTM: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=[];return t.forEach(function(e,o){var a,s={};o>=i[0]&&(s.mtm=e.close-t[o-i[0]].close,r+=s.mtm,o>=i[0]+i[1]-1&&(s.maMtm=r/i[1],r-=null!=(a=n[o-(i[1]-1)].mtm)?a:0)),n.push(s)}),n}},{name:"MA",shortName:"MA",series:"price",calcParams:[5,10,30,60],precision:2,shouldOhlc:!0,figures:[{key:"ma1",title:"MA5: ",type:"line"},{key:"ma2",title:"MA10: ",type:"line"},{key:"ma3",title:"MA30: ",type:"line"},{key:"ma4",title:"MA60: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,r=e.figures,n=[];return t.map(function(e,o){var a={},s=e.close;
1return i.forEach(function(e,i){var l;n[i]=(null!=(l=n[i])?l:0)+s,o>=e-1&&(a[r[i].key]=n[i]/e,n[i]-=t[o-(e-1)].close)}),a})}},{name:"MACD",shortName:"MACD",calcParams:[12,26,9],figures:[{key:"dif",title:"DIF: ",type:"line"},{key:"dea",title:"DEA: ",type:"line"},{key:"macd",title:"MACD: ",type:"bar",baseValue:0,styles:function(t){var e,i,r=t.data,n=t.indicator,o=t.defaultStyles,a=r.prev,s=r.current,l=null!=(e=null==a?void 0:a.macd)?e:Number.MIN_SAFE_INTEGER,u=null!=(i=null==s?void 0:s.macd)?i:Number.MIN_SAFE_INTEGER,c="";return c=u>0?v(n.styles,"bars[0].upColor",o.bars[0].upColor):u<0?v(n.styles,"bars[0].downColor",o.bars[0].downColor):v(n.styles,"bars[0].noChangeColor",o.bars[0].noChangeColor),{style:l<u?"stroke":"fill",color:c,borderColor:c}}}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=0,a=0,s=0,l=0,u=Math.max(i[0],i[1]);return t.map(function(t,e){var c={},h=t.close;return r+=h,e>=i[0]-1&&(n=e>i[0]-1?(2*h+(i[0]-1)*n)/(i[0]+1):r/i[0]),e>=i[1]-1&&(o=e>i[1]-1?(2*h+(i[1]-1)*o)/(i[1]+1):r/i[1]),e>=u-1&&(c.dif=a=n-o,s+=a,e>=u+i[2]-2&&(l=e>u+i[2]-2?(2*a+l*(i[2]-1))/(i[2]+1):s/i[2],c.macd=(a-l)*2,c.dea=l)),c})}},{name:"OBV",shortName:"OBV",calcParams:[30],figures:[{key:"obv",title:"OBV: ",type:"line"},{key:"maObv",title:"MAOBV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=[];return t.forEach(function(e,a){var s,l,u,c,h=null!=(s=t[a-1])?s:e;e.close<h.close?n-=null!=(l=e.volume)?l:0:e.close>h.close&&(n+=null!=(u=e.volume)?u:0);var d={obv:n};r+=n,a>=i[0]-1&&(d.maObv=r/i[0],r-=null!=(c=o[a-(i[0]-1)].obv)?c:0),o.push(d)}),o}},{name:"PVT",shortName:"PVT",figures:[{key:"pvt",title:"PVT: ",type:"line"}],calc:function(t){var e=0;return t.map(function(i,r){var n,o,a={},s=i.close,l=null!=(n=i.volume)?n:1,u=(null!=(o=t[r-1])?o:i).close,c=0,h=u*l;return 0!==h&&(c=(s-u)/h),a.pvt=e+=c,a})}},{name:"PSY",shortName:"PSY",calcParams:[12,6],figures:[{key:"psy",title:"PSY: ",type:"line"},{key:"maPsy",title:"MAPSY: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=[],a=[];return t.forEach(function(e,s){var l,u,c={},h=(null!=(l=t[s-1])?l:e).close,d=+(e.close-h>0);o.push(d),r+=d,s>=i[0]-1&&(c.psy=r/i[0]*100,n+=c.psy,s>=i[0]+i[1]-2&&(c.maPsy=n/i[1],n-=null!=(u=a[s-(i[1]-1)].psy)?u:0),r-=o[s-(i[0]-1)]),a.push(c)}),a}},{name:"ROC",shortName:"ROC",calcParams:[12,6],figures:[{key:"roc",title:"ROC: ",type:"line"},{key:"maRoc",title:"MAROC: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=[],n=0;return t.forEach(function(e,o){var a,s,l={};if(o>=i[0]-1){var u=e.close,c=(null!=(a=t[o-i[0]])?a:t[o-(i[0]-1)]).close;0!==c?l.roc=(u-c)/c*100:l.roc=0,n+=l.roc,o>=i[0]-1+i[1]-1&&(l.maRoc=n/i[1],n-=null!=(s=r[o-(i[1]-1)].roc)?s:0)}r.push(l)}),r}},{name:"RSI",shortName:"RSI",calcParams:[6,12,24],figures:[{key:"rsi1",title:"RSI1: ",type:"line"},{key:"rsi2",title:"RSI2: ",type:"line"},{key:"rsi3",title:"RSI3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){var i=e+1;return{key:"rsi".concat(i),title:"RSI".concat(i,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,r=e.figures,n=[],o=[];return t.map(function(e,a){var s,l={},u=(null!=(s=t[a-1])?s:e).close,c=e.close-u;return i.forEach(function(e,i){var s,u,h;if(c>0?n[i]=(null!=(s=n[i])?s:0)+c:o[i]=(null!=(u=o[i])?u:0)+Math.abs(c),a>=e-1){0!==o[i]?l[r[i].key]=100-100/(1+n[i]/o[i]):l[r[i].key]=0;var d=t[a-(e-1)],p=null!=(h=t[a-e])?h:d,g=d.close-p.close;g>0?n[i]-=g:o[i]-=Math.abs(g)}}),l})}},{name:"SMA",shortName:"SMA",series:"price",calcParams:[12,2],precision:2,figures:[{key:"sma",title:"SMA: ",type:"line"}],shouldOhlc:!0,calc:function(t,e){var i=e.calcParams,r=0,n=0;return t.map(function(t,e){var o={},a=t.close;return r+=a,e>=i[0]-1&&(o.sma=n=e>i[0]-1?(a*i[1]+n*(i[0]-i[1]+1))/(i[0]+1):r/i[0]),o})}},{name:"KDJ",shortName:"KDJ",calcParams:[9,3,3],figures:[{key:"k",title:"K: ",type:"line"},{key:"d",title:"D: ",type:"line"},{key:"j",title:"J: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=[];return t.forEach(function(e,n){var o,a,s,l,u={},c=e.close;if(n>=i[0]-1){var h=H(t.slice(n-(i[0]-1),n+1),"high","low"),d=h[0],p=h[1],g=d-p;u.k=((i[1]-1)*(null!=(a=null==(o=r[n-1])?void 0:o.k)?a:50)+(c-p)/(0===g?1:g)*100)/i[1],u.d=((i[2]-1)*(null!=(l=null==(s=r[n-1])?void 0:s.d)?l:50)+u.k)/i[2],u.j=3*u.k-2*u.d}r.push(u)}),r}},{name:"SAR",shortName:"SAR",series:"price",calcParams:[2,2,20],precision:2,
1shouldOhlc:!0,figures:[{key:"sar",title:"SAR: ",type:"circle",styles:function(t){var e,i,r,n=t.data,o=t.indicator,a=t.defaultStyles,s=n.current;return{color:(null!=(e=null==s?void 0:s.sar)?e:Number.MIN_SAFE_INTEGER)<((null!=(i=null==s?void 0:s.high)?i:0)+(null!=(r=null==s?void 0:s.low)?r:0))/2?v(o.styles,"circles[0].upColor",a.circles[0].upColor):v(o.styles,"circles[0].downColor",a.circles[0].downColor)}}}],calc:function(t,e){var i=e.calcParams,r=i[0]/100,n=i[1]/100,o=i[2]/100,a=r,s=-100,l=!1,u=0;return t.map(function(e,i){var c=u,h=e.high,d=e.low;if(l){(-100===s||s<h)&&(s=h,a=Math.min(a+n,o)),u=c+a*(s-c);var p=Math.min(t[Math.max(1,i)-1].low,d);u>e.low?(u=s,a=r,s=-100,l=!l):u>p&&(u=p)}else{(-100===s||s>d)&&(s=d,a=Math.min(a+n,o)),u=c+a*(s-c);var g=Math.max(t[Math.max(1,i)-1].high,h);u<e.high?(u=s,a=0,s=-100,l=!l):u<g&&(u=g)}return{high:h,low:d,sar:u}})}},{name:"TRIX",shortName:"TRIX",calcParams:[12,9],figures:[{key:"trix",title:"TRIX: ",type:"line"},{key:"maTrix",title:"MATRIX: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=[];return t.forEach(function(t,e){var h,d={},p=t.close;if(r+=p,e>=i[0]-1&&(n=e>i[0]-1?(2*p+(i[0]-1)*n)/(i[0]+1):r/i[0],s+=n,e>=2*i[0]-2)&&(o=e>2*i[0]-2?(2*n+(i[0]-1)*o)/(i[0]+1):s/i[0],l+=o,e>=3*i[0]-3)){var g=0,f=0;e>3*i[0]-3?f=((g=(2*o+(i[0]-1)*a)/(i[0]+1))-a)/a*100:g=l/i[0],a=g,d.trix=f,u+=f,e>=3*i[0]+i[1]-4&&(d.maTrix=u/i[1],u-=null!=(h=c[e-(i[1]-1)].trix)?h:0)}c.push(d)}),c}},ta,{name:"VR",shortName:"VR",calcParams:[26,6],figures:[{key:"vr",title:"VR: ",type:"line"},{key:"maVr",title:"MAVR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,r=0,n=0,o=0,a=0,s=[];return t.forEach(function(e,l){var u,c,h,d,p,g={},f=e.close,v=(null!=(u=t[l-1])?u:e).close,m=null!=(c=e.volume)?c:0;if(f>v?r+=m:f<v?n+=m:o+=m,l>=i[0]-1){var y=o/2;n+y===0?g.vr=0:g.vr=(r+y)/(n+y)*100,a+=g.vr,l>=i[0]+i[1]-2&&(g.maVr=a/i[1],a-=null!=(h=s[l-(i[1]-1)].vr)?h:0);var _=t[l-(i[0]-1)],x=null!=(d=t[l-i[0]])?d:_,b=_.close,w=null!=(p=_.volume)?p:0;b>x.close?r-=w:b<x.close?n-=w:o-=w}s.push(g)}),s}},{name:"WR",shortName:"WR",calcParams:[6,10,14],figures:[{key:"wr1",title:"WR1: ",type:"line"},{key:"wr2",title:"WR2: ",type:"line"},{key:"wr3",title:"WR3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"wr".concat(e+1),title:"WR".concat(e+1,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,r=e.figures;return t.map(function(e,n){var o={},a=e.close;return i.forEach(function(e,i){var s=e-1;if(n>=s){var l=H(t.slice(n-s,n+1),"high","low"),u=l[0],c=u-l[1];o[r[i].key]=0===c?0:(a-u)/c*100}}),o})}}].forEach(function(t){ts[t.name]=tn.extend(t)});var tc="overlay_figure_",th=function(){function t(t){this.groupId="",this.totalStep=1,this.currentStep=1,this.lock=!1,this.visible=!0,this.zLevel=0,this.needDefaultPointFigure=!1,this.needDefaultXAxisFigure=!1,this.needDefaultYAxisFigure=!1,this.mode="normal",this.modeSensitivity=8,this.points=[],this.styles=null,this.createPointFigures=null,this.createXAxisFigures=null,this.createYAxisFigures=null,this.performEventPressedMove=null,this.performEventMoveForDrawing=null,this.onDrawStart=null,this.onDrawing=null,this.onDrawEnd=null,this.onClick=null,this.onDoubleClick=null,this.onRightClick=null,this.onPressedMoveStart=null,this.onPressedMoving=null,this.onPressedMoveEnd=null,this.onMouseMove=null,this.onMouseEnter=null,this.onMouseLeave=null,this.onRemoved=null,this.onSelected=null,this.onDeselected=null,this._prevZLevel=0,this._prevPressedPoint=null,this._prevPressedPoints=[],this.override(t)}return t.prototype.override=function(t){this._prevOverlay=a(T(T({},this),{_prevOverlay:null}));var e,i=t.id,r=t.name;t.currentStep;var n=t.points,u=t.styles;if(o(this,P(t,["id","name","currentStep","points","styles"])),p(this.name)||(this.name=null!=r?r:""),!p(this.id)&&p(i)&&(this.id=i),h(u)&&(null!=this.styles||(this.styles={}),o(this.styles,u)),s(n)&&n.length>0){var c=0;if(this.points=A([],D(n),!1),n.length>=this.totalStep-1?(this.currentStep=-1,c=this.totalStep-1):(this.currentStep=n.length+1,c=n.length),l(this.performEventMoveForDrawing))for(var d=0;d<c;d++)this.performEventMoveForDrawing({currentStep:d+2,mode:this.mode,points:this.points,performPointIndex:d,performPoint:this.points[d]});-1===this.currentStep&&(null==(e=this.performEventPressedMove)||e.call(this,{currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:this.points.length-1,performPoint:this.points[this.points.length-1]}))}},t.prototype.getPrevZLevel=function(){return this._prevZLevel},t.prototype.setPrevZLevel=function(t){this._prevZLevel=t},t.prototype.shouldUpdate=function(){var t=this._prevOverlay.zLevel!==this.zLevel,e=t||JSON.stringify(this._prevOverlay.points)!==JSON.stringify(this.points)||this._prevOverlay.visible!==this.visible||this._prevOverlay.extendData!==this.extendData||this._prevOverlay.styles!==this.styles;return{sort:t,draw:e}},t.prototype.nextStep=function(){this.currentStep===this.totalStep-1?this.currentStep=-1:this.currentStep++},t.prototype.forceComplete=function(){this.currentStep=-1},t.prototype.isDrawing=function(){return -1!==this.currentStep},t.prototype.isStart=function(){return 1===this.currentStep},t.prototype.eventMoveForDrawing=function(t){var e,i=this.currentStep-1,r={};c(t.timestamp)&&(r.timestamp=t.timestamp),c(t.dataIndex)&&(r.dataIndex=t.dataIndex),c(t.value)&&(r.value=t.value),this.points[i]=r,null==(e=this.performEventMoveForDrawing)||e.call(this,{currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:i,performPoint:r})},t.prototype.eventPressedPointMove=function(t,e){var i;this.points[e].timestamp=t.timestamp,c(t.value)&&(this.points[e].value=t.value),null==(i=this.performEventPressedMove)||i.call(this,{currentStep:this.currentStep,points:this.points,mode:this.mode,performPointIndex:e,performPoint:this.points[e]})},t.prototype.startPressedMove=function(t){this._prevPressedPoint=T({},t),this._prevPressedPoints=a(this.points)},t.prototype.eventPressedOtherMove=function(t,e){if(null!==this._prevPressedPoint){var i=null;c(t.dataIndex)&&c(this._prevPressedPoint.dataIndex)&&(i=t.dataIndex-this._prevPressedPoint.dataIndex);var r=null;c(t.value)&&c(this._prevPressedPoint.value)&&(r=t.value-this._prevPressedPoint.value),this.points=this._prevPressedPoints.map(function(t){c(t.timestamp)&&(t.dataIndex=e.timestampToDataIndex(t.timestamp));var n,o=T({},t);return c(i)&&c(t.dataIndex)&&(o.dataIndex=t.dataIndex+i,o.timestamp=null!=(n=e.dataIndexToTimestamp(o.dataIndex))?n:void 0),c(r)&&c(t.value)&&(o.value=t.value+r),o})}},t.extend=function(e){var i=t;function r(){return i.call(this,e)||this}return S(r,i),r},t}(),td=function(){function t(){this._children=[],this._callbacks=new Map}return t.prototype.registerEvent=function(t,e){return this._callbacks.set(t,e),this},t.prototype.onEvent=function(t,e){var i=this._callbacks.get(t);return!!(h(i)&&this.checkEventOn(e))&&i(e)},t.prototype.dispatchEventToChildren=function(t,e){var i=this._children.length-1;if(i>-1){for(var r=i;r>-1;r--)if(this._children[r].dispatchEvent(t,e))return!0}return!1},t.prototype.dispatchEvent=function(t,e){return!!this.dispatchEventToChildren(t,e)||this.onEvent(t,e)},t.prototype.addChild=function(t){return this._children.push(t),this},t.prototype.clear=function(){this._children=[]},t}(),tp=function(t){function e(e){var i=t.call(this)||this;return i.attrs=e.attrs,i.styles=e.styles,i}return S(e,t),e.prototype.checkEventOn=function(t){return this.checkEventOnImp(t,this.attrs,this.styles)},e.prototype.setAttrs=function(t){return this.attrs=t,this},e.prototype.setStyles=function(t){return this.styles=t,this},e.prototype.draw=function(t){this.drawImp(t,this.attrs,this.styles)},e.extend=function(t){var i=e;function r(){return null!==i&&i.apply(this,arguments)||this}return S(r,i),r.prototype.checkEventOnImp=function(e,i,r){return t.checkEventOn(e,i,r)},r.prototype.drawImp=function(e,i,r){t.draw(e,i,r)},r},e}(td);function tg(t,e){return null!==t?e.x*t[0]+t[1]:e.y}function tf(t,e){var i=t.x-e.x;if(0!==i){var r=(t.y-e.y)/i,n=t.y-r*t.x;return[r,n]}return null}function tv(t,e,i){var r=e.length,n=c(i)?i>0&&i<1?i:0:.5*!!i;if(n>0&&r>2){for(var o=e[0].x,a=e[0].y,s=1;s<r-1;s++){var l=e[s-1],u=e[s],h=e[s+1],d=u.x-l.x,p=u.y-l.y,g=h.x-u.x,f=h.y-u.y,v=h.x-l.x,m=h.y-l.y,y=Math.sqrt(d*d+p*p),_=Math.sqrt(g*g+f*f),x=_/(_+y),b=u.x+v*n*x,w=u.y+m*n*x;b=Math.min(b,Math.max(h.x,u.x)),w=Math.min(w,Math.max(h.y,u.y)),b=Math.max(b,Math.min(h.x,u.x)),w=Math.max(w,Math.min(h.y,u.y)),v=b-u.x,m=w-u.y;
1var C=u.x-v*y/_,E=u.y-m*y/_;C=Math.min(C,Math.max(l.x,u.x)),E=Math.min(E,Math.max(l.y,u.y)),C=Math.max(C,Math.min(l.x,u.x)),E=Math.max(E,Math.min(l.y,u.y)),v=u.x-C,m=u.y-E,b=u.x+v*_/y,w=u.y+m*_/y,t.bezierCurveTo(o,a,C,E,u.x,u.y),o=b,a=w}var S=e[r-1];t.bezierCurveTo(o,a,S.x,S.y,S.x,S.y)}else for(var s=1;s<r;s++)t.lineTo(e[s].x,e[s].y)}function tm(t,e,i){var r=null!=i?i:0,n=[];if(t.length>1)if(t[0].x===t[1].x){var o=e.height;if(n.push({coordinates:[{x:t[0].x,y:0},{x:t[0].x,y:o}]}),t.length>2){n.push({coordinates:[{x:t[2].x,y:0},{x:t[2].x,y:o}]});for(var a=t[0].x-t[2].x,s=0;s<r;s++){var l=a*(s+1);n.push({coordinates:[{x:t[0].x+l,y:0},{x:t[0].x+l,y:o}]})}}}else{var u=e.width,c=tf(t[0],t[1]),h=c[0],d=c[1];if(n.push({coordinates:[{x:0,y:0*h+d},{x:u,y:u*h+d}]}),t.length>2){var p=t[2].y-h*t[2].x;n.push({coordinates:[{x:0,y:0*h+p},{x:u,y:u*h+p}]});for(var a=d-p,s=0;s<r;s++){var g=d+a*(s+1);n.push({coordinates:[{x:0,y:0*h+g},{x:u,y:u*h+g}]})}}}return n}var ty={};[{name:"fibonacciLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i,r,n=t.chart,o=t.coordinates,a=t.bounding,s=t.overlay,l=t.yAxis,u=s.points;if(o.length>0){var h=0;null==(e=null==l?void 0:l.isInCandle())||e?h=null!=(r=null==(i=n.getSymbol())?void 0:i.pricePrecision)?r:2:n.getIndicators({paneId:s.paneId}).forEach(function(t){h=Math.max(h,t.precision)});var d=[],p=[],g=a.width;if(o.length>1&&c(u[0].value)&&c(u[1].value)){var f=o[0].y-o[1].y,v=u[0].value-u[1].value;[1,.786,.618,.5,.382,.236,0].forEach(function(t){var e,i=o[1].y+f*t,r=n.getDecimalFold().format(n.getThousandsSeparator().format(((null!=(e=u[1].value)?e:0)+v*t).toFixed(h)));d.push({coordinates:[{x:0,y:i},{x:g,y:i}]}),p.push({x:0,y:i,text:"".concat(r," (").concat((100*t).toFixed(1),"%)"),baseline:"bottom"})})}return[{type:"line",attrs:d},{type:"text",isCheckEvent:!1,attrs:p}]}return[]}},{name:"horizontalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding,r={x:0,y:e[0].y};return h(e[1])&&e[0].x<e[1].x&&(r.x=i.width),[{type:"line",attrs:{coordinates:[e[0],r]}}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,r=t.performPoint;2===e&&(i[0].value=r.value)}},{name:"horizontalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=[];return 2===e.length&&i.push({coordinates:e}),[{type:"line",attrs:i}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,r=t.performPoint;2===e&&(i[0].value=r.value)}},{name:"horizontalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:0,y:e[0].y},{x:i.width,y:e[0].y}]}}]}},{name:"parallelStraightLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:tm(t.coordinates,t.bounding)}]}},{name:"priceChannelLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:tm(t.coordinates,t.bounding,1)}]}},{name:"priceLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i,r,n=t.chart,o=t.coordinates,a=t.bounding,s=t.overlay,l=t.yAxis,u=0;null==(e=null==l?void 0:l.isInCandle())||e?u=null!=(r=null==(i=n.getSymbol())?void 0:i.pricePrecision)?r:2:n.getIndicators({paneId:s.paneId}).forEach(function(t){u=Math.max(u,t.precision)});var c=s.points[0].value;return[{type:"line",attrs:{coordinates:[o[0],{x:a.width,y:o[0].y}]}},{type:"text",ignoreEvent:!0,attrs:{x:o[0].x,y:o[0].y,text:n.getDecimalFold().format(n.getThousandsSeparator().format((void 0===c?0:c).toFixed(u))),baseline:"bottom"}}]}},{name:"rayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:function(t,e){if(t.length>1){var i,r,n,o,a,s,l={x:0,y:0};return l=t[0].x===t[1].x&&t[0].y!==t[1].y?t[0].y<t[1].y?{x:t[0].x,y:e.height}:{x:t[0].x,y:0}:t[0].x>t[1].x?{x:0,y:(i=t[0],r=t[1],n={x:0,y:t[0].y},tg(tf(i,r),n))}:{x:e.width,y:(o=t[0],a=t[1],s={x:e.width,y:t[0].y},tg(tf(o,a),s))},{coordinates:[t[0],l]}}return[]}(t.coordinates,t.bounding)}]}},{name:"segment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]}},{name:"straightLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i,r,n,o,a,s=t.coordinates,l=t.bounding;if(2===s.length)return s[0].x===s[1].x?[{type:"line",attrs:{coordinates:[{x:s[0].x,y:0}
1,{x:s[0].x,y:l.height}]}}]:[{type:"line",attrs:{coordinates:[{x:0,y:(e=s[0],i=s[1],r={x:0,y:s[0].y},tg(tf(e,i),r))},{x:l.width,y:(n=s[0],o=s[1],a={x:l.width,y:s[0].y},tg(tf(n,o),a))}]}}];return[]}},{name:"verticalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;if(2===e.length){var r={x:e[0].x,y:0};return e[0].y<e[1].y&&(r.y=i.height),[{type:"line",attrs:{coordinates:[e[0],r]}}]}return[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,r=t.performPoint;2===e&&(i[0].timestamp=r.timestamp,i[0].dataIndex=r.dataIndex)}},{name:"verticalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,r=t.performPoint;2===e&&(i[0].timestamp=r.timestamp,i[0].dataIndex=r.dataIndex)}},{name:"verticalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]}}]}},{name:"simpleAnnotation",totalStep:2,styles:{line:{style:"dashed"}},createPointFigures:function(t){var e,i=t.overlay,r=t.coordinates,n="";h(i.extendData)&&(n=l(i.extendData)?i.extendData(i):null!=(e=i.extendData)?e:"");var o=r[0].x,a=r[0].y-6,s=a-50,u=s-5;return[{type:"line",attrs:{coordinates:[{x:o,y:a},{x:o,y:s}]},ignoreEvent:!0},{type:"polygon",attrs:{coordinates:[{x:o,y:s},{x:o-4,y:u},{x:o+4,y:u}]},ignoreEvent:!0},{type:"text",attrs:{x:o,y:u,text:n,align:"center",baseline:"bottom"},ignoreEvent:!0}]}},{name:"simpleTag",totalStep:2,styles:{line:{style:"dashed"}},createPointFigures:function(t){var e=t.bounding,i=t.coordinates;return{type:"line",attrs:{coordinates:[{x:0,y:i[0].y},{x:e.width,y:i[0].y}]},ignoreEvent:!0}},createYAxisFigures:function(t){var e,i,r,n,o=t.chart,a=t.overlay,s=t.coordinates,u=t.bounding,d=t.yAxis,p=null!=(e=null==d?void 0:d.isFromZero())&&e,g="left",f=0;p?(g="left",f=0):(g="right",f=u.width);var v="";return h(a.extendData)&&(v=l(a.extendData)?a.extendData(a):null!=(i=a.extendData)?i:""),!h(v)&&c(a.points[0].value)&&(v=m(a.points[0].value,null!=(n=null==(r=o.getSymbol())?void 0:r.pricePrecision)?n:2)),{type:"text",attrs:{x:f,y:s[0].y,text:v,align:g,baseline:"middle"}}}}].forEach(function(t){ty[t.name]=th.extend(t)});var t_={light:{grid:{horizontal:{color:"#EDEDED"},vertical:{color:"#EDEDED"}},candle:{priceMark:{high:{color:"#76808F"},low:{color:"#76808F"}},tooltip:{rect:{color:"#FEFEFE",borderColor:"#F2F3F5"},title:{color:"#76808F"},legend:{color:"#76808F"}}},indicator:{tooltip:{title:{color:"#76808F"},legend:{color:"#76808F"}}},xAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},yAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},separator:{color:"#DDDDDD"},crosshair:{horizontal:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}},vertical:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}}}},dark:{grid:{horizontal:{color:"#292929"},vertical:{color:"#292929"}},candle:{priceMark:{high:{color:"#929AA5"},low:{color:"#929AA5"}},tooltip:{rect:{color:"rgba(10, 10, 10, .6)",borderColor:"rgba(10, 10, 10, .6)"},title:{color:"#929AA5"},legend:{color:"#929AA5"}}},indicator:{tooltip:{title:{color:"#929AA5"},legend:{color:"#929AA5"}}},xAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},yAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},separator:{color:"#333333"},crosshair:{horizontal:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}},vertical:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}}}}},tx="candle_pane",tb="indicator_pane_",tw="x_axis_pane",tC=function(){function t(t,e){var i,r,n,o,a,s=this;this._styles={grid:{show:!0,horizontal:{show:!0,size:1,color:"#EDEDED",style:"dashed",dashedValue:[2,2]},vertical:{show:!0,size:1,color:"#EDEDED",style:"dashed",dashedValue:[2,2]}},candle:(i={show:!0,color:tt,textOffset:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"},{type:"candle_solid",bar:{compareRule:"current_open",upColor:J,downColor:K,noChangeColor:tt,upBorderColor:J,downBorderColor:K,noChangeBorderColor:tt,upWickColor:J,downWickColor:K,noChangeWickColor:tt},area:{lineSize:2,lineColor:te,smooth:!1,value:"close",backgroundColor:[{offset:0,color:Q(te,.01)},{offset:1,color:Q(te,.2)}],point:{show:!0,color:te,radius:4,rippleColor:Q(te,.3),rippleRadius:8,animation:!0,animationDuration:1e3}},priceMark:{show:!0,high:T({},i),low:T({},i),last:{show:!0,compareRule:"current_open",upColor:J,downColor:K,noChangeColor:tt,line:{show:!0,style:"dashed",dashedValue:[4,4],size:1},text:{show:!0,style:"fill",size:12,paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderColor:"transparent",borderStyle:"solid",borderSize:0,borderDashedValue:[2,2],color:$,family:"Helvetica Neue",weight:"normal",borderRadius:2},extendTexts:[]}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:"always",showType:"standard",rect:{position:"fixed",paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,offsetLeft:4,offsetTop:4,offsetRight:4,offsetBottom:4,borderRadius:4,borderSize:1,borderColor:"#F2F3F5",color:"#FEFEFE"},title:{show:!0,size:14,family:"Helvetica Neue",weight:"normal",color:tt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4,template:"{ticker} \xb7 {period}"},legend:{size:12,family:"Helvetica Neue",weight:"normal",color:tt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4,defaultValue:"n/a",template:[{title:"time",value:"{time}"},{title:"open",value:"{open}"},{title:"high",value:"{high}"},{title:"low",value:"{low}"},{title:"close",value:"{close}"},{title:"volume",value:"{volume}"}]},features:[]}}),indicator:{ohlc:{compareRule:"current_open",upColor:r=Q(J,.7),downColor:n=Q(K,.7),noChangeColor:tt},bars:[{style:"fill",borderStyle:"solid",borderSize:1,borderDashedValue:[2,2],upColor:r,downColor:n,noChangeColor:tt}],lines:["#FF9600","#935EBD",te,"#E11D74","#01C5C4"].map(function(t){return{style:"solid",smooth:!1,size:1,dashedValue:[2,2],color:t}}),circles:[{style:"fill",borderStyle:"solid",borderSize:1,borderDashedValue:[2,2],upColor:r,downColor:n,noChangeColor:tt}],lastValueMark:{show:!1,text:{show:!1,style:"fill",color:$,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:"solid",borderColor:"transparent",borderSize:0,borderDashedValue:[2,2],paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderRadius:2}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:"always",showType:"standard",title:{show:!0,showName:!0,showParams:!0,size:12,family:"Helvetica Neue",weight:"normal",color:tt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},legend:{size:12,family:"Helvetica Neue",weight:"normal",color:tt,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4,defaultValue:"n/a"},features:[]}},xAxis:ti(),yAxis:ti(),separator:{size:1,color:"#DDDDDD",fill:!0,activeBackgroun
1dColor:Q(te,.08)},crosshair:{show:!0,horizontal:{show:!0,line:{show:!0,style:"dashed",dashedValue:[4,2],size:1,color:tt},text:{show:!0,style:"fill",color:$,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:"solid",borderDashedValue:[2,2],borderSize:1,borderColor:tt,borderRadius:2,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:tt},features:[]},vertical:{show:!0,line:{show:!0,style:"dashed",dashedValue:[4,2],size:1,color:tt},text:{show:!0,style:"fill",color:$,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:"solid",borderDashedValue:[2,2],borderSize:1,borderColor:tt,borderRadius:2,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:tt}}},overlay:(o=Q(te,.35),a=Q(te,.25),{point:{color:te,borderColor:o,borderSize:1,radius:5,activeColor:te,activeBorderColor:o,activeBorderSize:3,activeRadius:5},line:{style:"solid",smooth:!1,color:te,size:1,dashedValue:[2,2]},rect:{style:"fill",color:a,borderColor:te,borderSize:1,borderRadius:0,borderStyle:"solid",borderDashedValue:[2,2]},polygon:{style:"fill",color:te,borderColor:te,borderSize:1,borderStyle:"solid",borderDashedValue:[2,2]},circle:{style:"fill",color:a,borderColor:te,borderSize:1,borderStyle:"solid",borderDashedValue:[2,2]},arc:{style:"solid",color:te,size:1,dashedValue:[2,2]},text:{style:"fill",color:$,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:"solid",borderDashedValue:[2,2],borderSize:1,borderRadius:2,borderColor:te,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:te}})},this._formatter={formatDate:function(t){var e,i,r=t.dateTimeFormat,n=t.timestamp,o=t.template;return e={},r.formatToParts(new Date(n)).forEach(function(t){var i=t.type,r=t.value;switch(i){case"year":e.YYYY=r;break;case"month":e.MM=r;break;case"day":e.DD=r;break;case"hour":e.HH="24"===r?"00":r;break;case"minute":e.mm=r;break;case"second":e.ss=r}}),i=e,o.replace(/YYYY|MM|DD|HH|mm|ss/g,function(t){return i[t]})},formatBigNumber:y,formatExtendText:function(t){return""}},this._innerFormatter={formatDate:function(t,e,i){return s._formatter.formatDate({dateTimeFormat:s._dateTimeFormat,timestamp:t,template:e,type:i})},formatBigNumber:function(t){return s._formatter.formatBigNumber(t)},formatExtendText:function(t){return s._formatter.formatExtendText(t)}},this._locale="en-US",this._thousandsSeparator={sign:",",format:function(t){var e=s._thousandsSeparator.sign,i="".concat(t);if(0===e.length)return i;if(i.includes(".")){var r=i.split(".");return"".concat(r[0].replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)}),".").concat(r[1])}return i.replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)})}},this._decimalFold={threshold:3,format:function(t){return function(t,e){var i="".concat(t);if(RegExp("\\.0{"+e+",}[1-9][0-9]*$").test(i)){var r=i.split("."),n=r.length-1,o=r[n],a=/0*/.exec(o);if(h(a)){var s=a[0].length;return r[n]=o.replace(/0*/,"0{".concat(s,"}")),r.join(".")}}return i}(t,s._decimalFold.threshold)}},this._symbol=null,this._period=null,this._dataList=[],this._dataLoader=null,this._loading=!1,this._dataLoadMore={forward:!1,backward:!1},this._zoomEnabled=!0,this._zoomAnchor={main:"cursor",xAxis:"cursor"},this._scrollEnabled=!0,this._totalBarSpace=0,this._barSpace=10,this._offsetRightDistance=80,this._startLastBarRightSideDiffBarCount=0,this._scrollLimitRole="bar_count",this._minVisibleBarCount={left:2,right:2},this._maxOffsetDistance={left:50,right:50},this._visibleRange=G(),this._visibleRangeDataList=[],this._visibleRangeHighLowPrice=[{x:0,price:Number.MIN_SAFE_INTEGER},{x:0,price:Number.MAX_SAFE_INTEGER}],this._crosshair={},this._actions=new Map,this._indicators=new Map,this._overlays=new Map,this._progressOverlayInfo=null,this._lastPriceMarkExtendTextUpdateTimers=[],this._pressedOverlayInfo={paneId:"",overlay:null,figureType:"none",figureIndex:-1,figure:null},this._hoverOverlayInfo={paneId:"",overlay:null,figureType:"none",figureIndex:-1,figure:null},this._clickOverlayInfo={paneId:"",overlay:null,figureType:"none",figureIndex:-1,figure:null},this._chart=t,this._calcOptimalBarSpace(),this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace;var l=null!=e?e:{},u=l.styles,c=l.locale,d=l.timezone,g=l.formatter,f=l.thousandsSeparator,v=l.decimalFold,m=l.zoomAnchor;h(u)&&this.setStyles(u),p(c)&&this.setLocale(c),this.setTimezone(null!=d?d:""),h(g)&&this.setFormatter(g),h(f)&&this.setThousandsSeparator(f),h(v)&&this.setDecimalFold(v),h(m)&&this.setZoomAnchor(m),this._taskScheduler
1=new U(function(){s._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0})})}return t.prototype.setStyles=function(t){var e,i,r,n,a,l,u,c=this,d=null;if(d=p(t)?null!=(e=t_[t])?e:null:t,o(this._styles,d),s(null==(n=null==(r=null==(i=null==d?void 0:d.candle)?void 0:i.tooltip)?void 0:r.legend)?void 0:n.template)&&(this._styles.candle.tooltip.legend.template=d.candle.tooltip.legend.template),h(null==(u=null==(l=null==(a=null==d?void 0:d.candle)?void 0:a.priceMark)?void 0:l.last)?void 0:u.extendTexts)){this._clearLastPriceMarkExtendTextUpdateTimer();var g=[];this._styles.candle.priceMark.last.extendTexts.forEach(function(t){var e=t.updateInterval;if(t.show&&e>0&&!g.includes(e)){g.push(e);var i=setInterval(function(){c._chart.updatePane(0,tx)},e);c._lastPriceMarkExtendTextUpdateTimers.push(i)}})}},t.prototype.getStyles=function(){return this._styles},t.prototype.setFormatter=function(t){o(this._formatter,t)},t.prototype.getFormatter=function(){return this._formatter},t.prototype.getInnerFormatter=function(){return this._innerFormatter},t.prototype.setLocale=function(t){this._locale=t},t.prototype.getLocale=function(){return this._locale},t.prototype.setTimezone=function(t){if(!h(this._dateTimeFormat)||this.getTimezone()!==t){var e={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};t.length>0&&(e.timeZone=t);var i=null;try{i=new Intl.DateTimeFormat("en",e)}catch(t){n("","","Timezone is error!!!")}null!==i&&(this._dateTimeFormat=i)}},t.prototype.getTimezone=function(){return this._dateTimeFormat.resolvedOptions().timeZone},t.prototype.getDateTimeFormat=function(){return this._dateTimeFormat},t.prototype.setThousandsSeparator=function(t){o(this._thousandsSeparator,t)},t.prototype.getThousandsSeparator=function(){return this._thousandsSeparator},t.prototype.setDecimalFold=function(t){o(this._decimalFold,t)},t.prototype.getDecimalFold=function(){return this._decimalFold},t.prototype.setSymbol=function(t){var e=this;this.resetData(function(){e._symbol=T(T({pricePrecision:2,volumePrecision:0},e._symbol),t),e._synchronizeIndicatorSeriesPrecision()})},t.prototype.getSymbol=function(){return this._symbol},t.prototype.setPeriod=function(t){var e=this;this.resetData(function(){e._period=t})},t.prototype.getPeriod=function(){return this._period},t.prototype.getDataList=function(){return this._dataList},t.prototype.getVisibleRangeDataList=function(){return this._visibleRangeDataList},t.prototype.getVisibleRangeHighLowPrice=function(){return this._visibleRangeHighLowPrice},t.prototype._addData=function(t,e,i){var r,n,o=!1,a=!1,l=0;if(s(t)){var u={backward:!1,forward:!1};switch(d(i)?(u.backward=i,u.forward=i):(u.backward=null!=(r=null==i?void 0:i.backward)&&r,u.forward=null!=(n=null==i?void 0:i.forward)&&n),l=t.length,e){case"init":this._clearData(),this._dataList=t,this._dataLoadMore.backward=u.backward,this._dataLoadMore.forward=u.forward,this.setOffsetRightDistance(this._offsetRightDistance),a=!0;break;case"backward":this._dataList=this._dataList.concat(t),this._dataLoadMore.backward=u.backward,this._lastBarRightSideDiffBarCount-=l,a=l>0;break;case"forward":this._dataList=t.concat(this._dataList),this._dataLoadMore.forward=u.forward,a=l>0}o=!0}else{var c=this._dataList.length,h=t.timestamp,p=v(this._dataList[c-1],"timestamp",0);if(h>p){this._dataList.push(t);var g=this.getLastBarRightSideDiffBarCount();g<0&&this.setLastBarRightSideDiffBarCount(--g),l=1,o=!0,a=!0}else h===p&&(this._dataList[c-1]=t,o=!0,a=!0)}if(o&&a){this._adjustVisibleRange(),this.setCrosshair(this._crosshair,{notInvalidate:!0});var f=this.getIndicatorsByFilter({});f.length>0?this._calcIndicator(f):this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0,cacheYAxisWidth:"init"!==e})}},t.prototype.setDataLoader=function(t){var e=this;this.resetData(function(){e._dataLoader=t})},t.prototype._calcOptimalBarSpace=function(){var t=1-.2*Math.atan(Math.max(4,this._barSpace)-4)/(.5*Math.PI),e=Math.min(Math.floor(this._barSpace*t),Math.floor(this._barSpace));e%2==0&&e+2>=this._barSpace&&--e,this._gapBarSpace=Math.max(1,e)},t.prototype._adjustVisibleRange=function(){var t,e,i=this._dataList.length,r=this._totalBarSpace/this._barSpace,n=0,o=0;"distance"===this._scrollLimitRole?(n=(this._totalBarSpace-this._maxOffsetDistance.right)/this._barSpace,o=(this._totalBarSpace-this._maxOffsetDistance.left)/this._barSpace):(n=this._minVisibleBarCount.left,o=this._minVisibleBarCount.right),n=Math.max(0,n),o=Math.max(0,o);var a=r-Math.min(n,i);this._lastBarRightSideDiffBarCount>a&&(this._lastBarRightSideDiffBarCount=a);var s=-i+Math.min(o,i);this._lastBarRightSideDiffBarCount<s&&(this._lastBarRightSideDiffBarCount=s);var l=Math.round(this._lastBarRightSideDiffBarCount+i+.5),u=l;l>i&&(l=i);var c=Math.round(l-r)-1;c<0&&(c=0);var d=this._lastBarRightSideDiffBarCount>0?Math.round(i+this._lastBarRightSideDiffBarCount-r)-1:c;this._visibleRange={from:c,to:l,realFrom:d,realTo:u},this.executeAction("onVisibleRangeChange",this._visibleRange),this._visibleRangeDataList=[],this._visibleRangeHighLowPrice=[{x:0,price:Number.MIN_SAFE_INTEGER},{x:0,price:Number.MAX_SAFE_INTEGER}];for(var p=d;p<u;p++){var g=this._dataList[p],f=this.dataIndexToCoordinate(p);this._visibleRangeDataList.push({dataIndex:p,x:f,data:{prev:null!=(t=this._dataList[p-1])?t:g,current:g,next:null!=(e=this._dataList[p+1])?e:g}}),h(g)&&(this._visibleRangeHighLowPrice[0].price<g.high&&(this._visibleRangeHighLowPrice[0].price=g.high,this._visibleRangeHighLowPrice[0].x=f),this._visibleRangeHighLowPrice[1].price>g.low&&(this._visibleRangeHighLowPrice[1].price=g.low,this._visibleRangeHighLowPrice[1].x=f))}0===c?this._dataLoadMore.forward&&this._processDataLoad("forward"):l===i&&this._dataLoadMore.backward&&this._processDataLoad("backward")},t.prototype._processDataLoad=function(t){var e,i,r,n,o=this;if(!this._loading&&h(this._dataLoader)&&h(this._symbol)&&h(this._period)){this._loading=!0;var a={type:t,symbol:this._symbol,period:this._period,timestamp:null,callback:function(e,i){var r,n;o._loading=!1,o._addData(e,t,i),"init"===t&&(null==(n=null==(r=o._dataLoader)?void 0:r.subscribeBar)||n.call(r,{symbol:o._symbol,period:o._period,callback:function(t){o._addData(t,"update")}}))}};switch(t){case"backward":a.timestamp=null!=(i=null==(e=this._dataList[this._dataList.length-1])?void 0:e.timestamp)?i:null;break;case"forward":a.timestamp=null!=(n=null==(r=this._dataList[0])?void 0:r.timestamp)?n:null}this._dataLoader.getBars(a)}},t.prototype._processDataUnsubscribe=function(){var t,e;h(this._dataLoader)&&h(this._symbol)&&h(this._period)&&(null==(e=(t=this._dataLoader).unsubscribeBar)||e.call(t,{symbol:this._symbol,period:this._period}))},t.prototype.resetData=function(t){this._processDataUnsubscribe(),null==t||t(),this._loading=!1,this._processDataLoad("init")},t.prototype.getBarSpace=function(){return{bar:this._barSpace,halfBar:this._barSpace/2,gapBar:this._gapBarSpace,halfGapBar:Math.floor(this._gapBarSpace/2)}},t.prototype.setBarSpace=function(t,e){t<1||t>
150||this._barSpace===t||(this._barSpace=t,this._calcOptimalBarSpace(),null==e||e(),this._adjustVisibleRange(),this.setCrosshair(this._crosshair,{notInvalidate:!0}),this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0,cacheYAxisWidth:!0}))},t.prototype.setTotalBarSpace=function(t){this._totalBarSpace!==t&&(this._totalBarSpace=t,this._adjustVisibleRange(),this.setCrosshair(this._crosshair,{notInvalidate:!0}))},t.prototype.setOffsetRightDistance=function(t,e){return this._offsetRightDistance="distance"===this._scrollLimitRole?Math.min(this._maxOffsetDistance.right,t):t,this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace,null!=e&&e&&(this._adjustVisibleRange(),this.setCrosshair(this._crosshair,{notInvalidate:!0}),this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0,cacheYAxisWidth:!0})),this},t.prototype.getInitialOffsetRightDistance=function(){return this._offsetRightDistance},t.prototype.getOffsetRightDistance=function(){return Math.max(0,this._lastBarRightSideDiffBarCount*this._barSpace)},t.prototype.getLastBarRightSideDiffBarCount=function(){return this._lastBarRightSideDiffBarCount},t.prototype.setLastBarRightSideDiffBarCount=function(t){this._lastBarRightSideDiffBarCount=t},t.prototype.setMaxOffsetLeftDistance=function(t){this._scrollLimitRole="distance",this._maxOffsetDistance.left=t},t.prototype.setMaxOffsetRightDistance=function(t){this._scrollLimitRole="distance",this._maxOffsetDistance.right=t},t.prototype.setLeftMinVisibleBarCount=function(t){this._scrollLimitRole="bar_count",this._minVisibleBarCount.left=t},t.prototype.setRightMinVisibleBarCount=function(t){this._scrollLimitRole="bar_count",this._minVisibleBarCount.right=t},t.prototype.getVisibleRange=function(){return this._visibleRange},t.prototype.startScroll=function(){this._startLastBarRightSideDiffBarCount=this._lastBarRightSideDiffBarCount},t.prototype.scroll=function(t){if(this._scrollEnabled){var e=t/this._barSpace,i=this._lastBarRightSideDiffBarCount*this._barSpace;this._lastBarRightSideDiffBarCount=this._startLastBarRightSideDiffBarCount-e,this._adjustVisibleRange(),this.setCrosshair(this._crosshair,{notInvalidate:!0}),this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0,cacheYAxisWidth:!0});var r=Math.round(i-this._lastBarRightSideDiffBarCount*this._barSpace);0!==r&&this.executeAction("onScroll",{distance:r})}},t.prototype.getDataByDataIndex=function(t){var e;return null!=(e=this._dataList[t])?e:null},t.prototype.coordinateToFloatIndex=function(t){var e=this._dataList.length,i=(this._totalBarSpace-t)/this._barSpace;return Math.round(1e6*(e+this._lastBarRightSideDiffBarCount-i))/1e6},t.prototype.dataIndexToTimestamp=function(t){var e=this._dataList.length;if(0===e)return null;var i=this.getDataByDataIndex(t);if(h(i))return i.timestamp;if(h(this._period)){var r=e-1,n=null,o=0;if(t>r?(n=this._dataList[r].timestamp,o=t-r):t<0&&(n=this._dataList[0].timestamp,o=t),c(n)){var a=this._period,s=a.type,l=a.span;switch(s){case"second":return n+1e3*l*o;case"minute":return n+60*l*1e3*o;case"hour":return n+60*l*6e4*o;case"day":return n+24*l*36e5*o;case"week":return n+7*l*864e5*o;case"month":var u=new Date(n),d=u.getDate();u.setDate(1),u.setMonth(u.getMonth()+l*o);var p=new Date(u.getFullYear(),u.getMonth()+1,0).getDate();return u.setDate(Math.min(d,p)),u.getTime();case"year":var u=new Date(n);return u.setFullYear(u.getFullYear()+l*o),u.getTime()}}}return null},t.prototype.timestampToDataIndex=function(t){var e=this._dataList.length;if(0===e)return 0;if(h(this._period)){var i=null,r=0,n=e-1,o=this._dataList[n].timestamp;t>o&&(i=o,r=n);var a=this._dataList[0].timestamp;if(t<a&&(i=a,r=0),c(i)){var s=this._period,l=s.type,u=s.span;switch(l){case"second":return r+Math.floor((t-i)/(1e3*u));case"minute":return r+Math.floor((t-i)/(60*u*1e3));case"hour":return r+Math.floor((t-i)/(60*u*6e4));case"day":return r+Math.floor((t-i)/(24*u*36e5));case"week":return r+Math.floor((t-i)/(7*u*864e5));case"month":var d=new Date(i),p=new Date(t),g=d.getFullYear(),f=p.getFullYear(),v=d.getMonth();return r+Math.floor(((f-g)*12+(p.getMonth()-v))/u);case"year":var g=new Date(i).getFullYear(),f=new Date(t).getFullYear();return r+Math.floor((f-g)/u)}}}return Y(this._dataList,"timestamp",t)},t.prototype.dataIndexToCoordinate=function(t){var e=this._dataList.length+this._lastBarRightSideDiffBarCount-t;return Math.floor(this._totalBarSpace-(e-.5)*this._barSpace+.5)},t.prototype.coordinateToDataIndex=function(t){return Math.ceil(this.coordinateToFloatIndex(t))-1}
1,t.prototype.zoom=function(t,e,i){var r,n=this;if(this._zoomEnabled){var o=null!=e?e:{x:null!=(r=this._crosshair.x)?r:this._totalBarSpace/2};"xAxis"===i?"last_bar"===this._zoomAnchor.xAxis&&(o.x=this.dataIndexToCoordinate(this._dataList.length-1)):"last_bar"===this._zoomAnchor.main&&(o.x=this.dataIndexToCoordinate(this._dataList.length-1));var a=o.x,s=this.coordinateToFloatIndex(a),l=this._barSpace,u=this._barSpace+t*(this._barSpace/10);this.setBarSpace(u,function(){n._lastBarRightSideDiffBarCount+=s-n.coordinateToFloatIndex(a)});var c=this._barSpace/l;1!==c&&this.executeAction("onZoom",{scale:c})}},t.prototype.setZoomEnabled=function(t){this._zoomEnabled=t},t.prototype.isZoomEnabled=function(){return this._zoomEnabled},t.prototype.setZoomAnchor=function(t){p(t)?(this._zoomAnchor.main=t,this._zoomAnchor.xAxis=t):(p(t.main)&&(this._zoomAnchor.main=t.main),p(t.xAxis)&&(this._zoomAnchor.xAxis=t.xAxis))},t.prototype.getZoomAnchor=function(){return T({},this._zoomAnchor)},t.prototype.setScrollEnabled=function(t){this._scrollEnabled=t},t.prototype.isScrollEnabled=function(){return this._scrollEnabled},t.prototype.setCrosshair=function(t,e){var i,r=null!=e?e:{},n=r.notInvalidate,o=r.notExecuteAction,a=r.forceInvalidate,s=null!=t?t:{},l=0,u=0;u=c(s.x)?(l=this.coordinateToDataIndex(s.x))<0?0:l>this._dataList.length-1?this._dataList.length-1:l:l=this._dataList.length-1;var d=this._dataList[u],g=this.dataIndexToCoordinate(l),f={x:this._crosshair.x,y:this._crosshair.y,paneId:this._crosshair.paneId};this._crosshair=T(T({},s),{realX:g,kLineData:d,realDataIndex:l,dataIndex:u,timestamp:null!=(i=this.dataIndexToTimestamp(l))?i:void 0}),(f.x!==s.x||f.y!==s.y||f.paneId!==s.paneId||null!=a&&a)&&(h(d)&&!(null!=o&&o)&&this.hasAction("onCrosshairChange")&&p(this._crosshair.paneId)&&this.executeAction("onCrosshairChange",t),null!=n&&n||this._chart.updatePane(1))},t.prototype.getCrosshair=function(){return this._crosshair},t.prototype.executeAction=function(t,e){var i;null==(i=this._actions.get(t))||i.execute(e)},t.prototype.subscribeAction=function(t,e){var i;this._actions.has(t)||this._actions.set(t,new q),null==(i=this._actions.get(t))||i.subscribe(e)},t.prototype.unsubscribeAction=function(t,e){var i=this._actions.get(t);h(i)&&(i.unsubscribe(e),i.isEmpty()&&this._actions.delete(t))},t.prototype.hasAction=function(t){var e=this._actions.get(t);return h(e)&&!e.isEmpty()},t.prototype._sortIndicators=function(t){var e;p(t)?null==(e=this._indicators.get(t))||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._indicators.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype._calcIndicator=function(t){var e=this,i=[];if((i=i.concat(t)).length>0){var r={};i.forEach(function(t){r[t.id]=t.calcImp(e._dataList)}),this._taskScheduler.add(r)}},t.prototype.addIndicator=function(t,e,i){var r=t.name;if(this.getIndicatorsByFilter(t).length>0)return!1;var n=this.getIndicatorsByPaneId(e),o=new(tl(r));return this._synchronizeIndicatorSeriesPrecision(o),o.paneId=e,o.override(t),i||(this.removeIndicator({paneId:e}),n=[]),n.push(o),this._indicators.set(e,n),this._sortIndicators(e),this._calcIndicator(o),!0},t.prototype.getIndicatorsByPaneId=function(t){var e;return null!=(e=this._indicators.get(t))?e:[]},t.prototype.getIndicatorsByFilter=function(t){var e=t.paneId,i=t.name,r=t.id,n=function(t){return h(r)?t.id===r:!h(i)||t.name===i},o=[];return h(e)?o=o.concat(this.getIndicatorsByPaneId(e).filter(n)):this._indicators.forEach(function(t){o=o.concat(t.filter(n))}),o},t.prototype.removeIndicator=function(t){var e=this,i=!1;return this.getIndicatorsByFilter(t).forEach(function(t){var r=e.getIndicatorsByPaneId(t.paneId),n=r.findIndex(function(e){return e.id===t.id});n>-1&&(r.splice(n,1),i=!0),0===r.length&&e._indicators.delete(t.paneId)}),i},t.prototype.hasIndicators=function(t){return this._indicators.has(t)},t.prototype._synchronizeIndicatorSeriesPrecision=function(t){if(h(this._symbol)){var e=this._symbol,i=e.pricePrecision,r=void 0===i?2:i,n=e.volumePrecision,o=void 0===n?0:n,a=function(t){switch(t.series){case"price":t.setSeriesPrecision(r);break;case"volume":t.setSeriesPrecision(o)}};
1h(t)?a(t):this._indicators.forEach(function(t){t.forEach(function(t){a(t)})})}},t.prototype.overrideIndicator=function(t){var e=this,i=!1,r=!1;return this.getIndicatorsByFilter(t).forEach(function(n){n.override(t);var o=n.shouldUpdateImp(),a=o.calc,s=o.draw;o.sort&&(r=!0),a?e._calcIndicator(n):s&&(i=!0)}),r&&this._sortIndicators(),!!i&&(this._chart.layout({update:!0}),!0)},t.prototype.getOverlaysByFilter=function(t){var e,i=t.id,r=t.groupId,n=t.paneId,o=t.name,a=function(t){return h(i)?t.id===i:h(r)?t.groupId===r&&(!h(o)||t.name===o):!h(o)||t.name===o},s=[];h(n)?s=s.concat(this.getOverlaysByPaneId(n).filter(a)):this._overlays.forEach(function(t){s=s.concat(t.filter(a))});var l=null==(e=this._progressOverlayInfo)?void 0:e.overlay;return h(l)&&a(l)&&s.push(l),s},t.prototype.getOverlaysByPaneId=function(t){var e;if(!p(t)){var i=[];return this._overlays.forEach(function(t){i=i.concat(t)}),i}return null!=(e=this._overlays.get(t))?e:[]},t.prototype._sortOverlays=function(t){var e;p(t)?null==(e=this._overlays.get(t))||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._overlays.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addOverlays=function(t,e){var i=this,r=[],n=t.map(function(t,n){if(h(t.id)){var o,a,s,l,u,c,d,p=null;try{for(var g=k(i._overlays),f=g.next();!f.done;f=g.next()){var v=f.value[1].find(function(e){return e.id===t.id});if(h(v)){p=v;break}}}catch(t){a={error:t}}finally{try{f&&!f.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}if(h(p))return t.id}var m=null!=(o=ty[t.name])?o:null;if(h(m)){var y=null!=(l=t.id)?l:z("overlay_"),v=new m,_=null!=(u=t.paneId)?u:tx;t.id=y,null!=t.groupId||(t.groupId=y);var x=i.getOverlaysByPaneId(_).length;return null!=t.zLevel||(t.zLevel=x),v.override(t),r.includes(_)||r.push(_),v.isDrawing()?i._progressOverlayInfo={paneId:_,overlay:v,appointPaneFlag:e[n]}:(i._overlays.has(_)||i._overlays.set(_,[]),null==(c=i._overlays.get(_))||c.push(v)),v.isStart()&&(null==(d=v.onDrawStart)||d.call(v,{overlay:v,chart:i._chart})),y}return null});return r.length>0&&(this._sortOverlays(),r.forEach(function(t){i._chart.updatePane(1,t)}),this._chart.updatePane(1,tw)),n},t.prototype.getProgressOverlayInfo=function(){return this._progressOverlayInfo},t.prototype.progressOverlayComplete=function(){var t;if(null!==this._progressOverlayInfo){var e=this._progressOverlayInfo,i=e.overlay,r=e.paneId;i.isDrawing()||(this._overlays.has(r)||this._overlays.set(r,[]),null==(t=this._overlays.get(r))||t.push(i),this._sortOverlays(r),this._progressOverlayInfo=null)}},t.prototype.updateProgressOverlayInfo=function(t,e){null!==this._progressOverlayInfo&&(d(e)&&e&&(this._progressOverlayInfo.appointPaneFlag=e),this._progressOverlayInfo.paneId=t,this._progressOverlayInfo.overlay.override({paneId:t}))},t.prototype.overrideOverlay=function(t){var e=this,i=!1,r=[];return this.getOverlaysByFilter(t).forEach(function(e){e.override(t);var n=e.shouldUpdate(),o=n.sort,a=n.draw;o&&(i=!0),(o||a)&&!r.includes(e.paneId)&&r.push(e.paneId)}),i&&this._sortOverlays(),r.length>0&&(r.forEach(function(t){e._chart.updatePane(1,t)}),this._chart.updatePane(1,tw),!0)},t.prototype.removeOverlay=function(t){var e=this,i=[];return this.getOverlaysByFilter(t).forEach(function(t){var r,n=t.paneId,o=e.getOverlaysByPaneId(t.paneId);if(null==(r=t.onRemoved)||r.call(t,{overlay:t,chart:e._chart}),i.includes(n)||i.push(n),t.isDrawing())e._progressOverlayInfo=null;else{var a=o.findIndex(function(e){return e.id===t.id});a>-1&&o.splice(a,1)}0===o.length&&e._overlays.delete(n)}),i.length>0&&(i.forEach(function(t){e._chart.updatePane(1,t)}),this._chart.updatePane(1,tw),!0)},t.prototype.setPressedOverlayInfo=function(t){this._pressedOverlayInfo=t},t.prototype.getPressedOverlayInfo=function(){return this._pressedOverlayInfo},t.prototype.setHoverOverlayInfo=function(t,e,i){var r=this._hoverOverlayInfo,n=r.overlay,o=r.figureType,a=r.figureIndex,s=r.figure,l=t.overlay;if(((null==n?void 0:n.id)!==(null==l?void 0:l.id)||o!==t.figureType||a!==t.figureIndex)&&(this._hoverOverlayInfo=t,(null==n?void 0:n.id)!==(null==l?void 0:l.id))){var u=!1,c=!1;null!==n&&(n.override({zLevel:n.getPrevZLevel()}),c=!0,i(n,s)&&(u=!0)),null!==l&&(l.setPrevZLevel(l.zLevel),l.override({zLevel:Number.MAX_SAFE_INTEGER}),c=!0,e(l,t.figure)&&(u=!0)),c&&this._sortOverlays(),u||this._chart.updatePane(1)}},t.prototype.getHoverOverlayInfo=function(){return this._hoverOverlayInfo}
1,t.prototype.setClickOverlayInfo=function(t,e,i){var r=this._clickOverlayInfo,n=r.paneId,o=r.overlay,a=r.figureType,s=r.figure,l=r.figureIndex,u=t.overlay;((null==o?void 0:o.id)!==(null==u?void 0:u.id)||a!==t.figureType||l!==t.figureIndex)&&(this._clickOverlayInfo=t,(null==o?void 0:o.id)!==(null==u?void 0:u.id)&&(h(o)&&i(o,s),h(u)&&e(u,t.figure),this._chart.updatePane(1,t.paneId),n!==t.paneId&&this._chart.updatePane(1,n),this._chart.updatePane(1,tw)))},t.prototype.getClickOverlayInfo=function(){return this._clickOverlayInfo},t.prototype.isOverlayEmpty=function(){return 0===this._overlays.size&&null===this._progressOverlayInfo},t.prototype.isOverlayDrawing=function(){var t,e;return null!=(e=null==(t=this._progressOverlayInfo)?void 0:t.overlay.isDrawing())&&e},t.prototype._clearLastPriceMarkExtendTextUpdateTimer=function(){this._lastPriceMarkExtendTextUpdateTimers.forEach(function(t){clearInterval(t)}),this._lastPriceMarkExtendTextUpdateTimers=[]},t.prototype._clearData=function(){this._dataLoadMore.backward=!1,this._dataLoadMore.forward=!1,this._loading=!1,this._dataList=[],this._visibleRangeDataList=[],this._visibleRangeHighLowPrice=[{x:0,price:Number.MIN_SAFE_INTEGER},{x:0,price:Number.MAX_SAFE_INTEGER}],this._visibleRange=G(),this._crosshair={}},t.prototype.getChart=function(){return this._chart},t.prototype.destroy=function(){this._clearData(),this._clearLastPriceMarkExtendTextUpdateTimer(),this._taskScheduler.clear(),this._overlays.clear(),this._indicators.clear(),this._actions.clear()},t}(),tE="main",tS="xAxis",tT="yAxis",tP="separator",tM=function(){function t(t,e){var i=this;this._supportedDevicePixelContentBox=!1,this._width=0,this._height=0,this._pixelWidth=0,this._pixelHeight=0,this._nextPixelWidth=0,this._nextPixelHeight=0,this._requestAnimationId=-1,this._mediaQueryListener=function(){var t=b(i._element);i._nextPixelWidth=Math.round(i._element.clientWidth*t),i._nextPixelHeight=Math.round(i._element.clientHeight*t),i._resetPixelRatio()},this._listener=e,this._element=V("canvas",t),this._ctx=this._element.getContext("2d"),(function(){return M(this,void 0,void 0,function(){return I(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var e=new ResizeObserver(function(i){t(i.every(function(t){return"devicePixelContentBoxSize"in t})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})];case 1:return[2,t.sent()]}})})})().then(function(t){i._supportedDevicePixelContentBox=t,t?(i._resizeObserver=new ResizeObserver(function(t){var e=t.find(function(t){return t.target===i._element}),r=null==e?void 0:e.devicePixelContentBoxSize[0];h(r)&&(i._nextPixelWidth=r.inlineSize,i._nextPixelHeight=r.blockSize,(i._pixelWidth!==i._nextPixelWidth||i._pixelHeight!==i._nextPixelHeight)&&i._resetPixelRatio())}),i._resizeObserver.observe(i._element,{box:"device-pixel-content-box"})):(i._mediaQueryList=window.matchMedia("(resolution: ".concat(b(i._element),"dppx)")),i._mediaQueryList.addListener(i._mediaQueryListener))}).catch(function(t){return!1})}return t.prototype._resetPixelRatio=function(){var t=this;this._executeListener(function(){var e=t._element.clientWidth,i=t._element.clientHeight;t._width=e,t._height=i,t._pixelWidth=t._nextPixelWidth,t._pixelHeight=t._nextPixelHeight,t._element.width=t._nextPixelWidth,t._element.height=t._nextPixelHeight;var r=t._nextPixelWidth/e,n=t._nextPixelHeight/i;t._ctx.scale(r,n)})},t.prototype._executeListener=function(t){var e=this;-1===this._requestAnimationId&&(this._requestAnimationId=B(function(){e._ctx.clearRect(0,0,e._width,e._height),null==t||t(),e._listener(),e._requestAnimationId=-1}))},t.prototype.update=function(t,e){if(this._width!==t||this._height!==e){if(this._element.style.width="".concat(t,"px"),this._element.style.height="".concat(e,"px"),!this._supportedDevicePixelContentBox){var i=b(this._element);this._nextPixelWidth=Math.round(t*i),this._nextPixelHeight=Math.round(e*i),this._resetPixelRatio()}}else this._executeListener()},t.prototype.getElement=function(){return this._element},t.prototype.getContext=function(){return this._ctx},t.prototype.destroy=function(){h(this._resizeObserver)&&this._resizeObserver.unobserve(this._element),h(this._mediaQueryList)&&this._mediaQueryList.removeListener(this._mediaQueryListener)},t}(),tI=function(t){function e(e,i){var r=t.call(this)||this;return r._bounding=F(),r._cursor="crosshair",r._forceCursor=null,r._pane=i,r._rootContainer=e,r._container=r.createContainer(),e.appendChild(r._container),r}return S(e,t),e.prototype.setBounding=function(t){return o(this._bounding,t),this},e.prototype.getContainer=function(){return this._container},e.prototype.getBounding=function(){return this._bounding},e.prototype.getPane=function(){return this._pane},e.prototype.checkEventOn=function(t){return!0},e.prototype.setCursor=function(t){p(this._forceCursor)||t===this._cursor||(this._cursor=t,this._container.style.cursor=this._cursor)},e.prototype.setForceCursor=function(t){var e;t!==this._forceCursor&&(this._forceCursor=t,this._container.style.cursor=null!=(e=this._forceCursor)?e:this._cursor)},e.prototype.getForceCursor=function(){return this._forceCursor},e.prototype.update=function(t){this.updateImp(this._container,this._bounding,null!=t?t:3)},e.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},e}(td),tk=function(t){function e(e,i){var r=t.call(this,e,i)||this;r._mainCanvas=new tM({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){r.updateMain(r._mainCanvas.getContext())}),r._overlayCanvas=new tM({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){r.updateOverlay(r._overlayCanvas.getContext())});var n=r.getContainer();return n.appendChild(r._mainCanvas.getElement()),n.appendChild(r._overlayCanvas.getElement()),r}return S(e,t),e.prototype.createContainer=function(){return V("div",{margin:"0",padding:"0",position:"absolute",top:"0",overflow:"hidden",boxSizing:"border-box",zIndex:"1"})}
1,e.prototype.updateImp=function(t,e,i){var r=e.width,n=e.height,o=e.left;t.style.left="".concat(o,"px");var a=i,s=t.clientWidth,l=t.clientHeight;switch((r!==s||n!==l)&&(t.style.width="".concat(r,"px"),t.style.height="".concat(n,"px"),a=3),a){case 0:this._mainCanvas.update(r,n);break;case 1:this._overlayCanvas.update(r,n);break;case 3:case 4:this._mainCanvas.update(r,n),this._overlayCanvas.update(r,n)}},e.prototype.destroy=function(){this._mainCanvas.destroy(),this._overlayCanvas.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,r=e.height,n=V("canvas",{width:"".concat(i,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),o=n.getContext("2d"),a=b(n);return n.width=i*a,n.height=r*a,o.scale(a,a),o.drawImage(this._mainCanvas.getElement(),0,0,i,r),t&&o.drawImage(this._overlayCanvas.getElement(),0,0,i,r),n},e}(tI);function tD(t,e){var i,r,n=[];n=n.concat(e);try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.x,u=s.width;u<4&&(l-=2,u=4);var c=s.y,h=s.height;if(h<4&&(c-=2,h=4),t.x>=l&&t.x<=l+u&&t.y>=c&&t.y<=c+h)return!0}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return!1}function tA(t,e,i){var r,n=[];n=n.concat(e);var o=i.style,a=void 0===o?"fill":o,s=i.color,l=void 0===s?"transparent":s,u=i.borderSize,c=void 0===u?1:u,h=i.borderColor,d=void 0===h?"transparent":h,g=i.borderStyle,f=i.borderRadius,v=void 0===f?0:f,m=i.borderDashedValue,y=null!=(r=t.roundRect)?r:t.rect,_=("fill"===a||"stroke_fill"===i.style)&&(!p(l)||!j(l));if(_&&(t.fillStyle=l,n.forEach(function(e){var i=e.x,r=e.y,n=e.width,o=e.height;t.beginPath(),y.call(t,i,r,n,o,v),t.closePath(),t.fill()})),("stroke"===a||"stroke_fill"===i.style)&&c>0&&!j(d)){t.strokeStyle=d,t.fillStyle=d,t.lineWidth=c,"dashed"===(void 0===g?"solid":g)?t.setLineDash(void 0===m?[2,2]:m):t.setLineDash([]);var x=.5*(c%2==1),b=Math.round(2*x);n.forEach(function(e){var i=e.x,r=e.y,n=e.width,o=e.height;n>2*c&&o>2*c?(t.beginPath(),y.call(t,i+x,r+x,n-b,o-b,v),t.closePath(),t.stroke()):_||t.fillRect(i,r,n,o)})}}function tF(t,e){var i=e.size,r=void 0===i?12:i,n=e.paddingLeft,o=e.paddingTop,a=e.paddingRight,s=e.paddingBottom,l=e.weight,u=e.family,c=t.x,h=t.y,d=t.text,p=t.align,g=t.baseline,f=t.width,v=t.height,m=null!=f?f:(void 0===n?0:n)+C(d,r,void 0===l?"normal":l,u)+(void 0===a?0:a),y=null!=v?v:(void 0===o?0:o)+r+(void 0===s?0:s),_=0;switch(void 0===p?"left":p){case"left":case"start":_=c;break;case"right":case"end":_=c-m;break;default:_=c-m/2}var x=0;switch(void 0===g?"top":g){case"top":case"hanging":x=h;break;case"bottom":case"ideographic":case"alphabetic":x=h-y;break;default:x=h-y/2}return{x:_,y:x,width:m,height:y}}function tB(t,e,i,r,n,o,a){var s=D(r,7),l=s[0],u=s[1],c=s[2],h=s[3],d=s[4],p=s[5],g=s[6];(function(t,e,i,r,n,o,a,s,l){for(var u,c,h,d,p,g,f,v,m,y,_,x,b,w,C,E,S,T,P,M,I,k,D,A,F=(u=t,c=e,h=i,d=r,p=n,g=o,f=a,v=s,m=l,b=Math.cos(y=p*Math.PI/180)*(_=(u-v)/2)+Math.sin(y)*(x=(c-m)/2),(C=Math.pow(b,2)/Math.pow(h,2)+Math.pow(w=-Math.sin(y)*_+Math.cos(y)*x,2)/Math.pow(d,2))>1&&(h*=Math.sqrt(C),d*=Math.sqrt(C)),P=(E=g===f?-1:1)*Math.sqrt(Math.abs((S=Math.pow(h,2)*Math.pow(d,2)-Math.pow(h,2)*Math.pow(w,2)-Math.pow(d,2)*Math.pow(b,2))/(T=Math.pow(h,2)*Math.pow(w,2)+Math.pow(d,2)*Math.pow(b,2))))*(h*w/d),I=Math.cos(y)*P-Math.sin(y)*(M=E*Math.sqrt(Math.abs(S/T))*(-d*b/h))+(u+v)/2,k=Math.sin(y)*P+Math.cos(y)*M+(c+m)/2,D=Math.atan2((w-M)/d,(b-P)/h),(A=Math.atan2((-w-M)/d,(-b-P)/h)-D)<0&&1===f?A+=2*Math.PI:A>0&&0===f&&(A-=2*Math.PI),{cx:I,cy:k,startAngle:D,deltaAngle:A}),B=F.cx,R=F.cy,L=F.startAngle,O=F.deltaAngle,W=[],z=Math.ceil(Math.abs(O)/(Math.PI/2)),V=0;V<z;V++){var Y=function(t,e,i,r,n,o,a){var s=Math.sin(a-o)*(Math.sqrt(4+3*Math.pow(Math.tan((a-o)/2),2))-1)/3,l=Math.cos(n),u=Math.sin(n),c=t+i*Math.cos(o)*l-r*Math.sin(o)*u,h=e+i*Math.cos(o)*u+r*Math.sin(o)*l,d=t+i*Math.cos(a)*l-r*Math.sin(a)*u,p=e+i*Math.cos(a)*u+r*Math.sin(a)*l;return[c+s*(-i*Math.sin(o)*l-r*Math.cos(o)*u),h+s*(-i*Math.sin(o)*u+r*Math.cos(o)*l),d-s*(-i*Math.sin(a)*l-r*Math.cos(a)*u),p-s*(-i*Math.sin(a)*u+r*Math.cos(a)*l),d,p]}(B,R,i,r,n,L+V*O/z,L+(V+1)*O/z);W.push(Y)}return W}
1)(e,i,l,u,c,h,d,a?e+p:p+n,a?i+g:g+o).forEach(function(e){t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])})}var tR={};[{name:"circle",checkEventOn:function(t,e){var i,r,n=[];n=n.concat(e);try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.x,u=s.y,c=s.r,h=t.x-l,d=t.y-u;if(!(h*h+d*d>c*c))return!0}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return!1},draw:function(t,e,i){var r,n,o,a,s,l,u,c,h,d,g,f;r=(r=[]).concat(e),o=void 0===(n=i.style)?"fill":n,s=void 0===(a=i.color)?"currentColor":a,u=void 0===(l=i.borderSize)?1:l,h=void 0===(c=i.borderColor)?"currentColor":c,d=i.borderStyle,g=i.borderDashedValue,(f=("fill"===o||"stroke_fill"===i.style)&&(!p(s)||!j(s)))&&(t.fillStyle=s,r.forEach(function(e){var i=e.x,r=e.y,n=e.r;t.beginPath(),t.arc(i,r,n,0,2*Math.PI),t.closePath(),t.fill()})),("stroke"===o||"stroke_fill"===i.style)&&u>0&&!j(h)&&(t.strokeStyle=h,t.lineWidth=u,"dashed"===(void 0===d?"solid":d)?t.setLineDash(void 0===g?[2,2]:g):t.setLineDash([]),r.forEach(function(e){var i=e.x,r=e.y,n=e.r;(!f||n>u)&&(t.beginPath(),t.arc(i,r,n,0,2*Math.PI),t.closePath(),t.stroke())}))}},{name:"line",checkEventOn:function(t,e){var i,r,n=[];n=n.concat(e);try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var s=a.value.coordinates;if(s.length>1)for(var l=1;l<s.length;l++){var u=s[l-1],c=s[l];if(u.x===c.x){if(Math.abs(u.y-t.y)+Math.abs(c.y-t.y)-Math.abs(u.y-c.y)<4&&2>Math.abs(t.x-u.x))return!0}else{var h=tf(u,c),d=tg(h,t),p=Math.abs(d-t.y);if(Math.abs(u.x-t.x)+Math.abs(c.x-t.x)-Math.abs(u.x-c.x)<4&&p*p/(h[0]*h[0]+1)<4)return!0}}}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return!1},draw:function(t,e,i){var r,n,o,a,s,l,u,c,h;r=(r=[]).concat(e),n=i.style,a=void 0!==(o=i.smooth)&&o,l=void 0===(s=i.size)?1:s,u=i.color,c=i.dashedValue,t.lineWidth=l,t.strokeStyle=void 0===u?"currentColor":u,"dashed"===(void 0===n?"solid":n)?t.setLineDash(void 0===c?[2,2]:c):t.setLineDash([]),h=.5*(l%2==1),r.forEach(function(e){var i=e.coordinates;i.length>1&&(2===i.length&&(i[0].x===i[1].x||i[0].y===i[1].y)?(t.beginPath(),i[0].x===i[1].x?(t.moveTo(i[0].x+h,i[0].y),t.lineTo(i[1].x+h,i[1].y)):(t.moveTo(i[0].x,i[0].y+h),t.lineTo(i[1].x,i[1].y+h)),t.stroke(),t.closePath()):(t.save(),l%2==1&&t.translate(.5,.5),t.beginPath(),t.moveTo(i[0].x,i[0].y),tv(t,i,a),t.stroke(),t.closePath(),t.restore()))})}},{name:"polygon",checkEventOn:function(t,e){var i,r,n=[];n=n.concat(e);try{for(var o=k(n),a=o.next();!a.done;a=o.next()){for(var s=a.value,l=!1,u=s.coordinates,c=0,h=u.length-1;c<u.length;h=c++)u[c].y>t.y!=u[h].y>t.y&&t.x<(u[h].x-u[c].x)*(t.y-u[c].y)/(u[h].y-u[c].y)+u[c].x&&(l=!l);if(l)return!0}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return!1},draw:function(t,e,i){var r,n,o,a,s,l,u,c,h,d,g;r=(r=[]).concat(e),o=void 0===(n=i.style)?"fill":n,s=void 0===(a=i.color)?"currentColor":a,u=void 0===(l=i.borderSize)?1:l,h=void 0===(c=i.borderColor)?"currentColor":c,d=i.borderStyle,g=i.borderDashedValue,"fill"!==o&&"stroke_fill"!==i.style||p(s)&&j(s)||(t.fillStyle=s,r.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var r=1;r<i.length;r++)t.lineTo(i[r].x,i[r].y);t.closePath(),t.fill()})),("stroke"===o||"stroke_fill"===i.style)&&u>0&&!j(h)&&(t.strokeStyle=h,t.lineWidth=u,"dashed"===(void 0===d?"solid":d
1)?t.setLineDash(void 0===g?[2,2]:g):t.setLineDash([]),r.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var r=1;r<i.length;r++)t.lineTo(i[r].x,i[r].y);t.closePath(),t.stroke()}))}},{name:"rect",checkEventOn:tD,draw:function(t,e,i){tA(t,e,i)}},{name:"text",checkEventOn:function(t,e,i){var r,n,o=[];o=o.concat(e);try{for(var a=k(o),s=a.next();!s.done;s=a.next()){var l=s.value,u=tF(l,i),c=u.x,h=u.y,d=u.width,p=u.height;if(t.x>=c&&t.x<=c+d&&t.y>=h&&t.y<=h+p)return!0}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},draw:function(t,e,i){var r,n,o,a,s,l,u,c,h,d,p,g;r=(r=[]).concat(e),n=i.color,o=i.size,a=i.family,s=i.weight,u=void 0===(l=i.paddingLeft)?0:l,h=void 0===(c=i.paddingTop)?0:c,p=void 0===(d=i.paddingRight)?0:d,tA(t,g=r.map(function(t){return tF(t,i)}),T(T({},i),{color:i.backgroundColor})),t.textAlign="left",t.textBaseline="top",t.font=w(void 0===o?12:o,s,a),t.fillStyle=void 0===n?"currentColor":n,r.forEach(function(e,i){var r=g[i];t.fillText(e.text,r.x+u,r.y+h,r.width-u-p)})}},{name:"arc",checkEventOn:function(t,e){var i,r,n=[];n=n.concat(e);try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(2>Math.abs(function(t,e){var i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)}(t,s)-s.r)){var l=s.r,u=s.startAngle,c=s.endAngle,h=l*Math.cos(u)+s.x,d=l*Math.sin(u)+s.y,p=l*Math.cos(c)+s.x,g=l*Math.sin(c)+s.y;if(t.x<=Math.max(h,p)+2&&t.x>=Math.min(h,p)-2&&t.y<=Math.max(d,g)+2&&t.y>=Math.min(d,g)-2)return!0}}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return!1},draw:function(t,e,i){var r,n,o,a,s;r=(r=[]).concat(e),n=i.style,o=i.size,a=i.color,s=i.dashedValue,t.lineWidth=void 0===o?1:o,t.strokeStyle=void 0===a?"currentColor":a,"dashed"===(void 0===n?"solid":n)?t.setLineDash(void 0===s?[2,2]:s):t.setLineDash([]),r.forEach(function(e){var i=e.x,r=e.y,n=e.r,o=e.startAngle,a=e.endAngle;t.beginPath(),t.arc(i,r,n,o,a),t.stroke(),t.closePath()})}},{name:"path",checkEventOn:tD,draw:function(t,e,i){var r,n,o;r=(r=[]).concat(e),n=i.lineWidth,o=i.color,t.lineWidth=void 0===n?1:n,t.strokeStyle=void 0===o?"currentColor":o,t.setLineDash([]),r.forEach(function(e){var r=e.x,n=e.y,o=e.path.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/gi);h(o)&&(t.beginPath(),o.forEach(function(e){var i=0,o=0,a=0,s=0,l=e[0],u=e.slice(1).trim().split(/[\s,]+/).map(Number);switch(l){case"M":i=u[0]+r,o=u[1]+n,t.moveTo(i,o),a=i,s=o;break;case"m":i+=u[0],o+=u[1],t.moveTo(i,o),a=i,s=o;break;case"L":i=u[0]+r,o=u[1]+n,t.lineTo(i,o);break;case"l":i+=u[0],o+=u[1],t.lineTo(i,o);break;case"H":i=u[0]+r,t.lineTo(i,o);break;case"h":i+=u[0],t.lineTo(i,o);break;case"V":o=u[0]+n,t.lineTo(i,o);break;case"v":o+=u[0],t.lineTo(i,o);break;case"C":t.bezierCurveTo(u[0]+r,u[1]+n,u[2]+r,u[3]+n,u[4]+r,u[5]+n),i=u[4]+r,o=u[5]+n;break;case"c":t.bezierCurveTo(i+u[0],o+u[1],i+u[2],o+u[3],i+u[4],o+u[5]),i+=u[4],o+=u[5];break;case"S":t.bezierCurveTo(i,o,u[0]+r,u[1]+n,u[2]+r,u[3]+n),i=u[2]+r,o=u[3]+n;break;case"s":t.bezierCurveTo(i,o,i+u[0],o+u[1],i+u[2],o+u[3]),i+=u[2],o+=u[3];break;case"Q":t.quadraticCurveTo(u[0]+r,u[1]+n,u[2]+r,u[3]+n),i=u[2]+r,o=u[3]+n;break;case"q":t.quadraticCurveTo(i+u[0],o+u[1],i+u[2],o+u[3]),i+=u[2],o+=u[3];break;case"T":t.quadraticCurveTo(i,o,u[0]+r,u[1]+n),i=u[0]+r,o=u[1]+n;break;case"t":t.quadraticCurveTo(i,o,i+u[0],o+u[1]),i+=u[0],o+=u[1];break;case"A":tB(t,i,o,u,r,n,!1),i=u[5]+r,o=u[6]+n;break;case"a":tB(t,i,o,u,r,n,!0),i+=u[5],o+=u[6];break;case"Z":case"z":t.closePath(),i=a,o=s}}),"fill"===i.style?t.fill():t.stroke())})}}].forEach(function(t){tR[t.name]=tp.extend(t)});var tL=function(t){function e(e){var i=t.call(this)||this;return i._widget=e,i}return S(e,t),e.prototype.getWidget=function(){return this._widget},e.prototype.createFigure=function(t,e){var i,r=null!=(i=tR[t.name])?i:null;if(null!==r){var n=new r(t);if(h(e)){for(var o in e)e.hasOwnProperty(o)&&n.registerEvent(o,e[o
1]);this.addChild(n)}return n}return null},e.prototype.draw=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];this.clear(),this.drawImp(t,e)},e.prototype.checkEventOn=function(t){return!0},e}(td),tO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e,i,r=this.getWidget(),n=this.getWidget().getPane(),o=n.getChart(),a=r.getBounding(),s=o.getStyles().grid;if(s.show){t.save(),t.globalCompositeOperation="destination-over";var l=s.horizontal;if(l.show){var u=n.getAxisComponent().getTicks().map(function(t){return{coordinates:[{x:0,y:t.coord},{x:a.width,y:t.coord}]}});null==(e=this.createFigure({name:"line",attrs:u,styles:l}))||e.draw(t)}var c=s.vertical;if(c.show){var u=o.getXAxisPane().getAxisComponent().getTicks().map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:a.height}]}});null==(i=this.createFigure({name:"line",attrs:u,styles:c}))||i.draw(t)}t.restore()}},e}(tL),tW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.eachChildren=function(t){for(var e=this.getWidget().getPane().getChart().getChartStore(),i=e.getVisibleRangeDataList(),r=e.getBarSpace(),n=i.length,o=0;o<n;)t(i[o],r,o),++o},e}(tL),tz=function(t){function e(){var e=t.apply(this,A([],D(arguments),!1))||this;return e._boundCandleBarClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().executeAction("onCandleBarClick",t),!1}},e}return S(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget().getPane(),r=i.getId()===tx,n=i.getChart().getChartStore(),o=this.getCandleBarOptions();if(null!==o){var a=o.type,s=o.styles,l=0,u=0;"ohlc"===o.type&&((l=Math.min(Math.max(Math.round(.2*n.getBarSpace().gapBar),1),8))>2&&l%2==1&&l--,u=Math.floor(l/2));var c=i.getAxisComponent();this.eachChildren(function(i,n){var o,d=i.x,p=i.data,g=p.current,f=p.prev;if(h(g)){var v=g.open,m=g.high,y=g.low,_=g.close,x="current_open"===s.compareRule?v:null!=(o=null==f?void 0:f.close)?o:_,b=[];_>x?(b[0]=s.upColor,b[1]=s.upBorderColor,b[2]=s.upWickColor):_<x?(b[0]=s.downColor,b[1]=s.downBorderColor,b[2]=s.downWickColor):(b[0]=s.noChangeColor,b[1]=s.noChangeBorderColor,b[2]=s.noChangeWickColor);var w=c.convertToPixel(v),C=c.convertToPixel(_),E=[w,C,c.convertToPixel(m),c.convertToPixel(y)];E.sort(function(t,e){return t-e});var S=+(n.gapBar%2==0),T=[];switch(a){case"candle_solid":T=e._createSolidBar(d,E,n,b,S);break;case"candle_stroke":T=e._createStrokeBar(d,E,n,b,S);break;case"candle_up_stroke":T=_>v?e._createStrokeBar(d,E,n,b,S):e._createSolidBar(d,E,n,b,S);break;case"candle_down_stroke":T=v>_?e._createStrokeBar(d,E,n,b,S):e._createSolidBar(d,E,n,b,S);break;case"ohlc":T=[{name:"rect",attrs:[{x:d-u,y:E[0],width:l,height:E[3]-E[0]},{x:d-n.halfGapBar,y:w+l>E[3]?E[3]-l:w,width:n.halfGapBar-u,height:l},{x:d+u,y:C+l>E[3]?E[3]-l:C,width:n.halfGapBar-u,height:l}],styles:{color:b[0]}}]}T.forEach(function(n){var o,a=null;r&&(a={mouseClickEvent:e._boundCandleBarClickEvent(i)}),null==(o=e.createFigure(n,null!=a?a:void 0))||o.draw(t)})}})}},e.prototype.getCandleBarOptions=function(){var t=this.getWidget().getPane().getChart().getStyles().candle;return{type:t.type,styles:t.bar}},e.prototype._createSolidBar=function(t,e,i,r,n){return[{name:"rect",attrs:{x:t,y:e[0],width:1,height:e[3]-e[0]},styles:{color:r[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar+n,height:Math.max(1,e[2]-e[1])},styles:{style:"stroke_fill",color:r[0],borderColor:r[1]}}]},e.prototype._createStrokeBar=function(t,e,i,r,n){return[{name:"rect",attrs:[{x:t,y:e[0],width:1,height:e[1]-e[0]},{x:t,y:e[2],width:1,height:e[3]-e[2]}],styles:{color:r[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar+n,height:Math.max(1,e[2]-e[1])},styles:{style:"stroke",borderColor:r[1]}}]},e}(tW),tV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.getCandleBarOptions=function(){var t,e,i=this.getWidget().getPane();if(!i.getAxisComponent().isInCandle()){var r=i.getChart().getChartStore(),n=r.getIndicatorsByPaneId(i.getId());try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.shouldOhlc&&s.visible){var l=s.styles,u=r.getStyles().indicator,c=v(l,"ohlc.compareRule",u.ohlc.compareRule),h=v(l,"ohlc.upColor",u.ohlc.upColor),d=v(l,"ohlc.downColor",u.ohlc.downColor),p=v(l,"ohlc.noChangeColor",u.ohlc.noChangeColor);return{type:"ohlc",styles:{compareRule:c,upColor:h,downColor:d,noChangeColor:p,upBorderColor:h,downBorderColor:d,noChangeBorderColor:p,upWickColor:h,downWickColor:d,noChangeWickColor:p}}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}return null},e.prototype.drawImp=function(e){var i=this;t.prototype.drawImp.call(this,e);var r=this.getWidget(),n=r.getPane(),o=n.getChart(),a=r.getBounding(),s=o.getXAxisPane().getAxisComponent(),l=n.getAxisComponent(),u=o.getChartStore(),d=u.getIndicatorsByPaneId(n.getId()),p=u.getStyles().indicator;e.save(),d.forEach(function(t){if(t.visible){t.zLevel<0?e.globalCompositeOperation="destination-over":e.globalCompositeOperation="source-over";var r=!1;if(null!==t.draw&&(e.save(),r=t.draw({ctx:e,chart:o,indicator:t,bounding:a,xAxis:s,yAxis:l}
1),e.restore()),!r){var n=t.result,u=[];i.eachChildren(function(r,o){var d,g,f,v=o.halfGapBar,m=r.dataIndex,y=r.x,_=s.convertToPixel(m-1),x=s.convertToPixel(m+1),b=null!=(d=n[m-1])?d:null,w=null!=(g=n[m])?g:null,C=null!=(f=n[m+1])?f:null,E={x:_},S={x:y},T={x:x};t.figures.forEach(function(t){var e=t.key,i=null==b?void 0:b[e];c(i)&&(E[e]=l.convertToPixel(i));var r=null==w?void 0:w[e];c(r)&&(S[e]=l.convertToPixel(r));var n=null==C?void 0:C[e];c(n)&&(T[e]=l.convertToPixel(n))}),tr(t,m,p,function(t,r,n){var d,p,g;if(h(null==w?void 0:w[t.key])){var f=S[t.key],m=null==(d=t.attrs)?void 0:d.call(t,{data:{prev:b,current:w,next:C},coordinate:{prev:E,current:S,next:T},bounding:a,barSpace:o,xAxis:s,yAxis:l});if(!h(m))switch(t.type){case"circle":m={x:y,y:f,r:Math.max(1,v)};break;case"rect":case"bar":var _=null!=(p=t.baseValue)?p:l.getRange().from,x=l.convertToPixel(_),P=Math.abs(x-f);_!==(null==w?void 0:w[t.key])&&(P=Math.max(1,P));m={x:y-v,y:f>x?x:f,width:Math.max(1,2*v),height:P};break;case"line":h(u[n])||(u[n]=[]),c(S[t.key])&&c(T[t.key])&&u[n].push({coordinates:[{x:S.x,y:S[t.key]},{x:T.x,y:T[t.key]}],styles:r})}var M=t.type;h(m)&&"line"!==M&&(null==(g=i.createFigure({name:"bar"===M?"rect":M,attrs:m,styles:r}))||g.draw(e))}})}),u.forEach(function(t){var r,n,o,a;if(t.length>1){for(var s=[{coordinates:[t[0].coordinates[0],t[0].coordinates[1]],styles:t[0].styles}],l=1;l<t.length;l++){var u=s[s.length-1],c=t[l],h=u.coordinates[u.coordinates.length-1];h.x===c.coordinates[0].x&&h.y===c.coordinates[0].y&&u.styles.style===c.styles.style&&u.styles.color===c.styles.color&&u.styles.size===c.styles.size&&u.styles.smooth===c.styles.smooth&&(null==(r=u.styles.dashedValue)?void 0:r[0])===(null==(n=c.styles.dashedValue)?void 0:n[0])&&(null==(o=u.styles.dashedValue)?void 0:o[1])===(null==(a=c.styles.dashedValue)?void 0:a[1])?u.coordinates.push(c.coordinates[1]):s.push({coordinates:[c.coordinates[0],c.coordinates[1]],styles:c.styles})}s.forEach(function(t){var r,n=t.coordinates,o=t.styles;null==(r=i.createFigure({name:"line",attrs:{coordinates:n},styles:o}))||r.draw(e)})}})}}}),e.restore()},e}(tz),tY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),r=e.getBounding(),n=e.getPane().getChart().getChartStore(),o=n.getCrosshair(),a=n.getStyles().crosshair;if(p(o.paneId)&&a.show){if(o.paneId===i.getId()){var s=o.y;this._drawLine(t,[{x:0,y:s},{x:r.width,y:s}],a.horizontal)}var l=o.realX;this._drawLine(t,[{x:l,y:0},{x:l,y:r.height}],a.vertical)}},e.prototype._drawLine=function(t,e,i){var r;if(i.show){var n=i.line;n.show&&(null==(r=this.createFigure({name:"line",attrs:{coordinates:e},styles:n}))||r.draw(t))}},e}(tL),tN=function(t){function e(e){var i=t.call(this,e)||this;return i._activeFeatureInfo=null,i._featureClickEvent=function(t,e){return function(){return i.getWidget().getPane().getChart().getChartStore().executeAction(t,e),!0}},i._featureMouseMoveEvent=function(t){return function(){return i._activeFeatureInfo=t,!0}},i.registerEvent("mouseMoveEvent",function(t){return i._activeFeatureInfo=null,!1}),i}return S(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane().getChart().getChartStore();if(h(i.getCrosshair().kLineData)){var r=e.getBounding(),n=i.getStyles().indicator.tooltip,o=n.offsetLeft,a=n.offsetTop,s=n.offsetRight;this.drawIndicatorTooltip(t,o,a,r.width-s)}},e.prototype.drawIndicatorTooltip=function(t,e,i,r){var n=this,o=this.getWidget().getPane(),a=o.getChart().getChartStore(),s=a.getStyles().indicator.tooltip;if(this.isDrawTooltip(a.getCrosshair(),s)){var l=a.getIndicatorsByPaneId(o.getId()),u=s.title,c=s.legend;l.forEach(function(o){var a=0,s={x:e,y:i},l=n.getIndicatorTooltipData(o),h=l.name,d=l.calcParamsText,p=l.legends,g=l.features,f=h.length>0,v=p.length>0;if(f||v){var m=n.classifyTooltipFeatures(g);
1if(a=n.drawStandardTooltipFeatures(t,m[0],s,o,e,a,r),f){var y=h;d.length>0&&(y="".concat(y).concat(d));var _=u.color;a=n.drawStandardTooltipLegends(t,[{title:{text:"",color:_},value:{text:y,color:_}}],s,e,a,r,u)}a=n.drawStandardTooltipFeatures(t,m[1],s,o,e,a,r),v&&(a=n.drawStandardTooltipLegends(t,p,s,e,a,r,c)),a=n.drawStandardTooltipFeatures(t,m[2],s,o,e,a,r),i=s.y+a}})}return i},e.prototype.drawStandardTooltipFeatures=function(t,e,i,r,n,o,a){var s=this;if(e.length>0){var l=0,u=0;e.forEach(function(e){var i=e.marginLeft,r=e.marginTop,n=e.marginRight,o=e.marginBottom,a=e.paddingLeft,s=e.paddingTop,c=e.paddingRight,h=e.paddingBottom,d=e.size,p=void 0===d?0:d,g=e.type,f=e.content,v=0;"icon_font"===g?(t.font=w(p,"normal",f.family),v=t.measureText(f.code).width):v=p,l+=(void 0===i?0:i)+(void 0===a?0:a)+v+(void 0===c?0:c)+(void 0===n?0:n),u=Math.max(u,(void 0===r?0:r)+(void 0===s?0:s)+p+(void 0===h?0:h)+(void 0===o?0:o))}),i.x+l>a?(i.x=n,i.y+=o,o=u):o=Math.max(o,u);var c=this.getWidget().getPane().getId();e.forEach(function(e){var n,o,a,l,u,d=e.marginLeft,p=void 0===d?0:d,g=e.marginTop,f=void 0===g?0:g,v=e.marginRight,m=e.paddingLeft,y=void 0===m?0:m,_=e.paddingTop,x=void 0===_?0:_,b=e.paddingRight,w=void 0===b?0:b,C=e.paddingBottom,E=void 0===C?0:C,S=e.backgroundColor,T=e.activeBackgroundColor,P=e.borderRadius,M=e.size,I=void 0===M?0:M,k=e.color,D=e.activeColor,A=e.type,F=e.content,B=k,R=S;(null==(n=s._activeFeatureInfo)?void 0:n.paneId)===c&&(null==(o=s._activeFeatureInfo.indicator)?void 0:o.id)===(null==r?void 0:r.id)&&s._activeFeatureInfo.feature.id===e.id&&(B=null!=D?D:k,R=null!=T?T:S);var L="onCandleTooltipFeatureClick",O={paneId:c,feature:e};h(r)&&(L="onIndicatorTooltipFeatureClick",O.indicator=r);var W={mouseDownEvent:s._featureClickEvent(L,O),mouseMoveEvent:s._featureMouseMoveEvent(O)},z=0;"icon_font"===A?(null==(a=s.createFigure({name:"text",attrs:{text:F.code,x:i.x+p,y:i.y+f},styles:{paddingLeft:y,paddingTop:x,paddingRight:w,paddingBottom:E,borderRadius:P,size:I,family:F.family,color:B,backgroundColor:R}},W))||a.draw(t),z=t.measureText(F.code).width):(null==(l=s.createFigure({name:"rect",attrs:{x:i.x+p,y:i.y+f,width:I,height:I},styles:{paddingLeft:y,paddingTop:x,paddingRight:w,paddingBottom:E,color:R}},W))||l.draw(t),null==(u=s.createFigure({name:"path",attrs:{path:F.path,x:i.x+p+y,y:i.y+f+x,width:I,height:I},styles:{style:F.style,lineWidth:F.lineWidth,color:B}}))||u.draw(t),z=I),i.x+=p+y+z+w+(void 0===v?0:v)})}return o},e.prototype.drawStandardTooltipLegends=function(t,e,i,r,n,o,a){var s=this;if(e.length>0){var l=a.marginLeft,u=a.marginTop,c=a.marginRight,h=a.marginBottom,d=a.size,p=a.family,g=a.weight;t.font=w(d,g,p),e.forEach(function(e){var a,f,v=e.title,m=e.value,y=t.measureText(v.text).width,_=y+t.measureText(m.text).width,x=u+d+h;i.x+l+_+c>o?(i.x=r,i.y+=n,n=x):n=Math.max(n,x),v.text.length>0&&(null==(a=s.createFigure({name:"text",attrs:{x:i.x+l,y:i.y+u,text:v.text},styles:{color:v.color,size:d,family:p,weight:g}}))||a.draw(t)),null==(f=s.createFigure({name:"text",attrs:{x:i.x+l+y,y:i.y+u,text:m.text},styles:{color:m.color,size:d,family:p,weight:g}}))||f.draw(t),i.x+=l+_+c})}return n},e.prototype.isDrawTooltip=function(t,e){var i=e.showRule;return"always"===i||"follow_cross"===i&&p(t.paneId)},e.prototype.getIndicatorTooltipData=function(t){var e,i=this.getWidget().getPane().getChart().getChartStore(),r=i.getStyles().indicator,n=r.tooltip,o=n.title,a="",s="";if(o.show&&(o.showName&&(a=t.shortName),o.showParams)){var d=t.calcParams;d.length>0&&(s="(".concat(d.join(","),")"))}var g={name:a,calcParamsText:s,legends:[],features:n.features},f=i.getCrosshair().dataIndex,v=t.result,y=i.getInnerFormatter(),_=i.getDecimalFold(),x=i.getThousandsSeparator(),b=[];if(t.visible){var w=null!=(e=v[f])?e:{},C=n.legend.defaultValue;tr(t,f,r,function(e,i){if(p(e.title)){var r=i.color,n=w[e.key];c(n)&&(n=m(n,t.precision),t.shouldFormatBigNumber&&(n=y.formatBigNumber(n)),n=_.format(x.format(n))),b.pu
1sh({title:{text:e.title,color:r},value:{text:null!=n?n:C,color:r}})}}),g.legends=b}if(l(t.createTooltipDataSource)){var E=this.getWidget(),S=E.getPane(),T=S.getChart(),P=t.createTooltipDataSource({chart:T,indicator:t,crosshair:i.getCrosshair(),bounding:E.getBounding(),xAxis:S.getChart().getXAxisPane().getAxisComponent(),yAxis:S.getAxisComponent()}),M=P.name,I=P.calcParamsText,k=P.legends,D=P.features;if(o.show&&(p(M)&&o.showName&&(g.name=M),p(I)&&o.showParams&&(g.calcParamsText=I)),h(D)&&(g.features=D),h(k)&&t.visible){var A=[],F=r.tooltip.legend.color;k.forEach(function(t){var e={text:"",color:F};u(t.title)?e=t.title:e.text=t.title;var i={text:"",color:F};u(t.value)?i=t.value:i.text=t.value,c(Number(i.text))&&(i.text=_.format(x.format(i.text))),A.push({title:e,value:i})}),g.legends=A}}return g},e.prototype.classifyTooltipFeatures=function(t){var e=[],i=[],r=[];return t.forEach(function(t){switch(t.position){case"left":e.push(t);break;case"middle":i.push(t);break;case"right":r.push(t)}}),[e,i,r]},e}(tL),tH=function(t){function e(e){var i=t.call(this,e)||this;return i._initEvent(),i}return S(e,t),e.prototype._initEvent=function(){var t=this,e=this.getWidget(),i=e.getPane(),r=i.getId(),n=i.getChart(),o=n.getChartStore();this.registerEvent("mouseMoveEvent",function(i){var a,s=o.getProgressOverlayInfo();if(null!==s){var l=s.overlay,u=s.paneId;l.isStart()&&(o.updateProgressOverlayInfo(r),u=r);var c=l.points.length-1;return l.isDrawing()&&u===r&&(l.eventMoveForDrawing(t._coordinateToPoint(l,i)),null==(a=l.onDrawing)||a.call(l,T({chart:n,overlay:l},i))),t._figureMouseMoveEvent(l,"point",c,{key:"".concat(tc,"point_").concat(c),type:"circle",attrs:{}})(i)}return o.setHoverOverlayInfo({paneId:r,overlay:null,figureType:"none",figureIndex:-1,figure:null},function(e,r){return t._processOverlayMouseEnterEvent(e,r,i)},function(e,r){return t._processOverlayMouseLeaveEvent(e,r,i)}),e.setForceCursor(null),!1}).registerEvent("mouseClickEvent",function(e){var i,a,s=o.getProgressOverlayInfo();if(null!==s){var l=s.overlay,u=s.paneId;l.isStart()&&(o.updateProgressOverlayInfo(r,!0),u=r);var c=l.points.length-1;return l.isDrawing()&&u===r&&(l.eventMoveForDrawing(t._coordinateToPoint(l,e)),null==(i=l.onDrawing)||i.call(l,T({chart:n,overlay:l},e)),l.nextStep(),l.isDrawing()||(o.progressOverlayComplete(),null==(a=l.onDrawEnd)||a.call(l,T({chart:n,overlay:l},e)))),t._figureMouseClickEvent(l,"point",c,{key:"".concat(tc,"point_").concat(c),type:"circle",attrs:{}})(e)}return o.setClickOverlayInfo({paneId:r,overlay:null,figureType:"none",figureIndex:-1,figure:null},function(i,r){return t._processOverlaySelectedEvent(i,r,e)},function(i,r){return t._processOverlayDeselectedEvent(i,r,e)}),!1}).registerEvent("mouseDoubleClickEvent",function(e){var i,a=o.getProgressOverlayInfo();if(null!==a){var s=a.overlay,l=a.paneId;s.isDrawing()&&l===r&&(s.forceComplete(),s.isDrawing()||(o.progressOverlayComplete(),null==(i=s.onDrawEnd)||i.call(s,T({chart:n,overlay:s},e))));var u=s.points.length-1;return t._figureMouseClickEvent(s,"point",u,{key:"".concat(tc,"point_").concat(u),type:"circle",attrs:{}})(e)}return!1}).registerEvent("mouseRightClickEvent",function(e){var i=o.getProgressOverlayInfo();if(null!==i){var r=i.overlay;if(r.isDrawing()){var n=r.points.length-1;return t._figureMouseRightClickEvent(r,"point",n,{key:"".concat(tc,"point_").concat(n),type:"circle",attrs:{}})(e)}}return!1}).registerEvent("mouseUpEvent",function(t){var e,i=o.getPressedOverlayInfo(),a=i.overlay,s=i.figure;return null!==a&&tu("onPressedMoveEnd",s)&&(null==(e=a.onPressedMoveEnd)||e.call(a,T({chart:n,overlay:a,figure:null!=s?s:void 0},t))),o.setPressedOverlayInfo({paneId:r,overlay:null,figureType:"none",figureIndex:-1,figure:null}),!1}).registerEvent("pressedMouseMoveEvent",function(e){var i,r=o.getPressedOverlayInfo(),a=r.overlay,s=r.figureType,l=r.figureIndex,u=r.figure;if(null!==a&&tu("onPressedMoving",u)){if(!a.lock){var c=t._coordinateToPoint(a,e);"point"===s?a.eventPressedPointMove(c,l):a.eventPressedOtherMove(c,t.getWidget().getPane().getChart().getChartStore());var h=!1;null==(i=a.onPressedMoving)||i.call(a,T(T({chart:n,overlay:a,figure:null!=u?u:void 0},e),{preventDefault:function(){h=!0}})),h?t.getWidget().setForceCursor(null):t.getWidget().setForceCursor("pointer")}return!0}return t.getWidget().setForceCursor(null),!1})}
1,e.prototype._createFigureEvents=function(t,e,i,r){return t.isDrawing()?null:{mouseMoveEvent:this._figureMouseMoveEvent(t,e,i,r),mouseDownEvent:this._figureMouseDownEvent(t,e,i,r),mouseClickEvent:this._figureMouseClickEvent(t,e,i,r),mouseRightClickEvent:this._figureMouseRightClickEvent(t,e,i,r),mouseDoubleClickEvent:this._figureMouseDoubleClickEvent(t,e,i,r)}},e.prototype._processOverlayMouseEnterEvent=function(t,e,i){return!!(l(t.onMouseEnter)&&tu("onMouseEnter",e))&&(t.onMouseEnter(T({chart:this.getWidget().getPane().getChart(),overlay:t,figure:null!=e?e:void 0},i)),!0)},e.prototype._processOverlayMouseLeaveEvent=function(t,e,i){return!!(l(t.onMouseLeave)&&tu("onMouseLeave",e))&&(t.onMouseLeave(T({chart:this.getWidget().getPane().getChart(),overlay:t,figure:null!=e?e:void 0},i)),!0)},e.prototype._processOverlaySelectedEvent=function(t,e,i){var r;return!!tu("onSelected",e)&&(null==(r=t.onSelected)||r.call(t,T({chart:this.getWidget().getPane().getChart(),overlay:t,figure:null!=e?e:void 0},i)),!0)},e.prototype._processOverlayDeselectedEvent=function(t,e,i){var r;return!!tu("onDeselected",e)&&(null==(r=t.onDeselected)||r.call(t,T({chart:this.getWidget().getPane().getChart(),overlay:t,figure:null!=e?e:void 0},i)),!0)},e.prototype._figureMouseMoveEvent=function(t,e,i,r){var n=this;return function(o){var a,s=n.getWidget().getPane(),l=!t.isDrawing()&&tu("onMouseMove",r);if(l){var u=!1;null==(a=t.onMouseMove)||a.call(t,T(T({chart:s.getChart(),overlay:t,figure:r},o),{preventDefault:function(){u=!0}})),u?n.getWidget().setForceCursor(null):n.getWidget().setForceCursor("pointer")}return s.getChart().getChartStore().setHoverOverlayInfo({paneId:s.getId(),overlay:t,figureType:e,figure:r,figureIndex:i},function(t,e){return n._processOverlayMouseEnterEvent(t,e,o)},function(t,e){return n._processOverlayMouseLeaveEvent(t,e,o)}),l}},e.prototype._figureMouseDownEvent=function(t,e,i,r){var n=this;return function(o){var a,s=n.getWidget().getPane(),l=s.getId();return t.startPressedMove(n._coordinateToPoint(t,o)),!!tu("onPressedMoveStart",r)&&(null==(a=t.onPressedMoveStart)||a.call(t,T({chart:s.getChart(),overlay:t,figure:r},o)),s.getChart().getChartStore().setPressedOverlayInfo({paneId:l,overlay:t,figureType:e,figureIndex:i,figure:r}),!t.isDrawing())}},e.prototype._figureMouseClickEvent=function(t,e,i,r){var n=this;return function(o){var a,s=n.getWidget().getPane(),l=s.getId(),u=!t.isDrawing()&&tu("onClick",r);return u&&(null==(a=t.onClick)||a.call(t,T({chart:n.getWidget().getPane().getChart(),overlay:t,figure:r},o))),s.getChart().getChartStore().setClickOverlayInfo({paneId:l,overlay:t,figureType:e,figureIndex:i,figure:r},function(t,e){return n._processOverlaySelectedEvent(t,e,o)},function(t,e){return n._processOverlayDeselectedEvent(t,e,o)}),u}},e.prototype._figureMouseDoubleClickEvent=function(t,e,i,r){var n=this;return function(e){var i;return!!tu("onDoubleClick",r)&&(null==(i=t.onDoubleClick)||i.call(t,T(T({},e),{chart:n.getWidget().getPane().getChart(),figure:r,overlay:t})),!t.isDrawing())}},e.prototype._figureMouseRightClickEvent=function(t,e,i,r){var n=this;return function(e){var i;if(tu("onRightClick",r)){var o=!1;return null==(i=t.onRightClick)||i.call(t,T(T({chart:n.getWidget().getPane().getChart(),overlay:t,figure:r},e),{preventDefault:function(){o=!0}})),o||n.getWidget().getPane().getChart().getChartStore().removeOverlay(t),!t.isDrawing()}return!1}},e.prototype._coordinateToPoint=function(t,e){var i,r={},n=this.getWidget().getPane(),o=n.getChart(),a=n.getId(),s=o.getChartStore();if(this.coordinateToPointTimestampDataIndexFlag()){var l=o.getXAxisPane().getAxisComponent().convertFromPixel(e.x);r.timestamp=null!=(i=s.dataIndexToTimestamp(l))?i:void 0,r.dataIndex=l}if(this.coordinateToPointValueFlag()){var u=n.getAxisComponent(),h=u.convertFromPixel(e.y);if("normal"!==t.mode&&a===tx&&c(r.dataIndex)){var d=s.getDataByDataIndex(r.dataIndex);if(null!==d){var p=t.modeSensitivity;if(h>d.high)if("weak_magnet"===t.mode){var g=u.convertToPixel(d.high),f=u.convertFromPixel(g-p);h<f&&(h=d.high)}else h=d.high;else if(h<d.low)if("weak_magnet"===t.mode){var v=u.convertToPixel(
1d.low),f=u.convertFromPixel(v-p);h>f&&(h=d.low)}else h=d.low;else{var m=Math.max(d.open,d.close),y=Math.min(d.open,d.close);h=h>m?h-m<d.high-h?m:d.high:h<y?h-d.low<y-h?d.low:y:m-h<h-y?m:y}}}r.value=h}return r},e.prototype.coordinateToPointValueFlag=function(){return!0},e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.dispatchEvent=function(e,i){return this.getWidget().getPane().getChart().getChartStore().isOverlayDrawing()?this.onEvent(e,i):t.prototype.dispatchEvent.call(this,e,i)},e.prototype.drawImp=function(t){var e=this;this.getCompleteOverlays().forEach(function(i){i.visible&&e._drawOverlay(t,i)});var i=this.getProgressOverlay();h(i)&&i.visible&&this._drawOverlay(t,i)},e.prototype._drawOverlay=function(t,e){var i=e.points,r=this.getWidget().getPane(),n=r.getChart(),o=n.getChartStore(),a=r.getAxisComponent(),s=n.getXAxisPane().getAxisComponent(),l=i.map(function(t){var e,i=null;c(t.timestamp)&&(i=o.timestampToDataIndex(t.timestamp));var r={x:0,y:0};return c(i)&&(r.x=s.convertToPixel(i)),c(t.value)&&(r.y=null!=(e=null==a?void 0:a.convertToPixel(t.value))?e:0),r});if(l.length>0){var u=[].concat(this.getFigures(e,l));this.drawFigures(t,e,u)}this.drawDefaultFigures(t,e,l)},e.prototype.drawFigures=function(t,e,i){var r=this,n=this.getWidget().getPane().getChart().getStyles().overlay;i.forEach(function(i,o){var a=i.type,s=i.styles;[].concat(i.attrs).forEach(function(l){var u,c,h=r._createFigureEvents(e,"other",o,i),d=T(T(T({},n[a]),null==(u=e.styles)?void 0:u[a]),s);null==(c=r.createFigure({name:a,attrs:l,styles:d},null!=h?h:void 0))||c.draw(t)})})},e.prototype.getCompleteOverlays=function(){var t=this.getWidget().getPane();return t.getChart().getChartStore().getOverlaysByPaneId(t.getId())},e.prototype.getProgressOverlay=function(){var t=this.getWidget().getPane(),e=t.getChart().getChartStore().getProgressOverlayInfo();return h(e)&&e.paneId===t.getId()?e.overlay:null},e.prototype.getFigures=function(t,e){var i,r,n=this.getWidget(),o=n.getPane(),a=o.getChart(),s=o.getAxisComponent(),l=a.getXAxisPane().getAxisComponent(),u=n.getBounding();return null!=(r=null==(i=t.createPointFigures)?void 0:i.call(t,{chart:a,overlay:t,coordinates:e,bounding:u,xAxis:l,yAxis:s}))?r:[]},e.prototype.drawDefaultFigures=function(t,e,i){var r,n,o=this;if(e.needDefaultPointFigure){var a=this.getWidget().getPane().getChart().getChartStore(),s=a.getHoverOverlayInfo(),l=a.getClickOverlayInfo();if((null==(r=s.overlay)?void 0:r.id)===e.id&&"none"!==s.figureType||(null==(n=l.overlay)?void 0:n.id)===e.id&&"none"!==l.figureType){var u=a.getStyles().overlay,c=e.styles,h=T(T({},u.point),null==c?void 0:c.point);i.forEach(function(i,r){var n,a,l,u,c,d=i.x,p=i.y,g=h.radius,f=h.color,v=h.borderColor,m=h.borderSize;(null==(n=s.overlay)?void 0:n.id)===e.id&&"point"===s.figureType&&(null==(a=s.figure)?void 0:a.key)==="".concat(tc,"point_").concat(r)&&(g=h.activeRadius,f=h.activeColor,v=h.activeBorderColor,m=h.activeBorderSize),null==(u=o.createFigure({name:"circle",attrs:{x:d,y:p,r:g+m},styles:{color:v}},null!=(l=o._createFigureEvents(e,"point",r,{key:"".concat(tc,"point_").concat(r),type:"circle",attrs:{x:d,y:p,r:g+m},styles:{color:v}}))?l:void 0))||u.draw(t),null==(c=o.createFigure({name:"circle",attrs:{x:d,y:p,r:g},styles:{color:f}}))||c.draw(t)})}}},e}(tL),tX=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r._gridView=new tO(r),r._indicatorView=new tV(r),r._crosshairLineView=new tY(r),r._tooltipView=r.createTooltipView(),r._overlayView=new tH(r),r.addChild(r._tooltipView),r.addChild(r._overlayView),r}return S(e,t),e.prototype.getName=function(){return tE},e.prototype.updateMain=function(t){"minimize"!==this.getPane().getOptions().state&&(this.updateMainContent(t),this._indicatorView.draw(t),this._gridView.draw(t))},e.prototype.createTooltipView=function(){return new tN(this)},e.prototype.updateMainContent=function(t){},e.prototype.updateOverlayContent=function(t){},e.prototype.updateOverlay=function(t){"minimize"!==this.getPane().getOptions().state&&(this._overlayView.draw(t),this._crosshairLineView.draw(t),this.updateOverlayContent(t)),this._tooltipView.draw(t)},e}(tk),tZ=function(t){function e(){var e=t.apply(this,A([],D(arguments),!1))||this;return e._ripplePoint=e.createFigure({name:"circle",attrs:{x:0,y:0,r:0},styles:{style:"fill"}}),e._animationFrameTime=0,e._animation=new L({iterationCount:1/0}).doFrame(function(t){e._animationFrameTime=t;var i=e.getWidget().getPane();i.getChart().updatePane(0,i.getId())}),e}return S(e,t),e.prototype.drawImp=function(t){var e,i,r,n=this.getWidget(),o=n.getPane(),a=o.getChart(),l=a.getDataList().length-1,u=n.getBounding(),d=o.getAxisComponent(),p=a.getStyles().candle.area,g=[],f=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,m=null;if(this.eachChildren(function(t){var e=t.x,i=t.data.current,r=null==i?void 0:i[p.value];if(c(r)){var n=d.convertToPixel(r);v===Number.MIN_SAFE_INTEGER&&(v=e),g.push({x:e,y:n}),f=Math.min(f,n),t.dataIndex===l&&(m={x:e,y:n})}}),g.length>0){null==(e=this.createFigure({name:"line",attrs:{coordinates:g},styles:{color:p.lineColor,size:p.lineSize,smooth:p.smooth}}))||e.draw(t);var y=p.backgroundColor,_="";if(s(y)){var x=t.createLinearGradient(0,u.height,0,f);
1try{y.forEach(function(t){var e=t.offset,i=t.color;x.addColorStop(e,i)})}catch(t){}_=x}else _=y;t.fillStyle=_,t.beginPath(),t.moveTo(v,u.height),t.lineTo(g[0].x,g[0].y),tv(t,g,p.smooth),t.lineTo(g[g.length-1].x,u.height),t.closePath(),t.fill()}var b=p.point;if(b.show&&h(m)){null==(i=this.createFigure({name:"circle",attrs:{x:m.x,y:m.y,r:b.radius},styles:{style:"fill",color:b.color}}))||i.draw(t);var w=b.rippleRadius;b.animation&&(w=b.radius+this._animationFrameTime/b.animationDuration*(b.rippleRadius-b.radius),this._animation.setDuration(b.animationDuration).start()),null==(r=this._ripplePoint)||r.setAttrs({x:m.x,y:m.y,r:w}).setStyles({style:"fill",color:b.rippleColor}).draw(t)}else this.stopAnimation()},e.prototype.stopAnimation=function(){this._animation.stop()},e}(tW),tG=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e,i,r=this.getWidget().getPane(),n=r.getChart().getChartStore(),o=n.getStyles().candle.priceMark,a=o.high,s=o.low;if(o.show&&(a.show||s.show)){var l=n.getVisibleRangeHighLowPrice(),u=null!=(i=null==(e=n.getSymbol())?void 0:e.pricePrecision)?i:2,c=r.getAxisComponent(),h=l[0],d=h.price,p=h.x,g=l[1],f=g.price,v=g.x,y=c.convertToPixel(d),_=c.convertToPixel(f),x=n.getDecimalFold(),b=n.getThousandsSeparator();a.show&&d!==Number.MIN_SAFE_INTEGER&&this._drawMark(t,x.format(b.format(m(d,u))),{x:p,y:y},y<_?[-2,-5]:[2,5],a),s.show&&f!==Number.MAX_SAFE_INTEGER&&this._drawMark(t,x.format(b.format(m(f,u))),{x:v,y:_},y<_?[2,5]:[-2,-5],s)}},e.prototype._drawMark=function(t,e,i,r,n){var o,a,s,l=i.x,u=i.y+r[0];null==(o=this.createFigure({name:"line",attrs:{coordinates:[{x:l-2,y:u+r[0]},{x:l,y:u},{x:l+2,y:u+r[0]}]},styles:{color:n.color}}))||o.draw(t);var c=0,h=0,d="left";l>this.getWidget().getBounding().width/2?(h=(c=l-5)-n.textOffset,d="right"):(d="left",h=(c=l+5)+n.textOffset);var p=u+r[1];null==(a=this.createFigure({name:"line",attrs:{coordinates:[{x:l,y:u},{x:l,y:p},{x:c,y:p}]},styles:{color:n.color}}))||a.draw(t),null==(s=this.createFigure({name:"text",attrs:{x:h,y:p,text:e,align:d,baseline:"middle"},styles:{color:n.color,size:n.textSize,family:n.textFamily,weight:n.textWeight}}))||s.draw(t)},e}(tL),tU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e,i,r,n=this.getWidget(),o=n.getPane(),a=n.getBounding(),s=o.getChart().getChartStore(),l=s.getStyles().candle.priceMark,u=l.last,c=u.line;if(l.show&&u.show&&c.show){var d=o.getAxisComponent(),p=s.getDataList(),g=p[p.length-1];if(h(g)){var f=g.close,v=g.open,m="current_open"===u.compareRule?v:null!=(i=null==(e=p[p.length-2])?void 0:e.close)?i:f,y=d.convertToNicePixel(f),_="";_=f>m?u.upColor:f<m?u.downColor:u.noChangeColor,null==(r=this.createFigure({name:"line",attrs:{coordinates:[{x:0,y:y},{x:a.width,y:y}]},styles:{style:c.style,color:_,size:c.size,dashedValue:c.dashedValue}}))||r.draw(t)}}},e}(tL),tq={second:"HH:mm:ss",minute:"HH:mm",hour:"MM-DD HH:mm",day:"YYYY-MM-DD",week:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"},tj={second:"HH:mm:ss",minute:"YYYY-MM-DD HH:mm",hour:"YYYY-MM-DD HH:mm",day:"YYYY-MM-DD",week:"YYYY-MM-DD",month:"YYYY-MM",year:"YYYY"},tQ={"zh-CN":{time:"æ¶é´ï¼",open:"å¼ï¼",high:"é«ï¼",low:"ä½ï¼",close:"æ¶ï¼",volume:"æäº¤éï¼",turnover:"æäº¤é¢ï¼",change:"涨å¹
ï¼",second:"ç§",minute:"",hour:"å°æ¶",day:"天",week:"å¨",month:"æ",year:"å¹´"},"en-US":{time:"Time: ",open:"Open: ",high:"High: ",low:"Low: ",close:"Close: ",volume:"Volume: ",turnover:"Turnover: ",change:"Change: ",second:"S",minute:"",hour:"H",day:"D",week:"W",month:"M",year:"Y"}};function tK(t,e){var i;return null!=(i=tQ[e][t])?i:t}var tJ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane().getChart().getChartStore(),r=i.getCrosshair();if(h(r.kLineData)){var n=e.getBounding(),o=i.getStyles(),a=o.candle,s=o.indicator;if("rect"===a.tooltip.showType&&"rect"===s.tooltip.showType){var l=this.isDrawTooltip(r,a.tooltip),u=this.isDrawTooltip(r,s.tooltip);this._drawRectTooltip(t,l,u,a.tooltip.offsetTop)}else if("standard"===a.tooltip.showType&&"standard"===s.tooltip.showType){var c=a.tooltip,d=c.offsetLeft,p=c.offsetTop,g=c.offsetRight,f=n.width-g,v=this._drawCandleStandardTooltip(t,d,p,f);this.drawIndicatorTooltip(t,d,v,f)}else if("rect"===a.tooltip.showType&&"standard"===s.tooltip.showType){var m=a.tooltip,d=m.offsetLeft,p=m.offsetTop,g=m.offsetRight,f=n.width-g,y=this.drawIndicatorTooltip(t,d,p,f),l=this.isDrawTooltip(r,a.tooltip);this._drawRectTooltip(t,l,!1,y)}else{var _=a.tooltip,d=_.offsetLeft,p=_.offsetTop,g=_.offsetRight,f=n.width-g,x=this._drawCandleStandardTooltip(t,d,p,f),u=this.isDrawTooltip(r,s.tooltip);this._drawRectTooltip(t,!1,u,x)}}}
1,e.prototype._drawCandleStandardTooltip=function(t,e,i,r){var n,o=this.getWidget().getPane().getChart().getChartStore(),a=o.getStyles().candle.tooltip,s=a.legend,l=0,u={x:e,y:i},c=o.getCrosshair();if(this.isDrawTooltip(c,a)){var h=a.title;if(h.show){var d=null!=(n=o.getPeriod())?n:{},p=d.type,g=d.span,f=_(h.template,T(T({},o.getSymbol()),{period:"".concat(void 0===g?"":g).concat(tK(void 0===p?"":p,o.getLocale()))})),v=h.color,m=this.drawStandardTooltipLegends(t,[{title:{text:"",color:v},value:{text:f,color:v}}],{x:e,y:i},e,0,r,h);u.y=u.y+m}var y=this._getCandleTooltipLegends(),x=this.classifyTooltipFeatures(a.features);l=this.drawStandardTooltipFeatures(t,x[0],u,null,e,l,r),l=this.drawStandardTooltipFeatures(t,x[1],u,null,e,l,r),y.length>0&&(l=this.drawStandardTooltipLegends(t,y,u,e,l,r,s)),l=this.drawStandardTooltipFeatures(t,x[2],u,null,e,l,r)}return u.y+l},e.prototype._drawRectTooltip=function(t,e,i,r){var n,o,a=this,s=this.getWidget(),l=s.getPane(),u=l.getChart().getChartStore(),c=u.getStyles(),h=c.candle,d=c.indicator,p=h.tooltip,g=d.tooltip;if(e||i){var f=this._getCandleTooltipLegends(),v=p.offsetLeft,m=p.offsetTop,y=p.offsetRight,_=p.offsetBottom,x=p.legend,b=x.marginLeft,C=x.marginRight,E=x.marginTop,S=x.marginBottom,T=x.size,P=x.weight,M=x.family,I=p.rect,k=I.position,D=I.paddingLeft,A=I.paddingRight,F=I.paddingTop,B=I.paddingBottom,R=I.offsetLeft,L=I.offsetRight,O=I.offsetTop,W=I.offsetBottom,z=I.borderSize,V=I.borderRadius,Y=I.borderColor,N=I.color,H=0,X=0,Z=0;e&&(t.font=w(T,P,M),f.forEach(function(e){var i=e.title,r=e.value,n="".concat(i.text).concat(r.text),o=t.measureText(n).width+b+C;H=Math.max(H,o)}),Z+=(S+E+T)*f.length);var G=g.legend,U=G.marginLeft,q=G.marginRight,j=G.marginTop,Q=G.marginBottom,K=G.size,J=G.weight,$=G.family,tt=[];if(i){var te=u.getIndicatorsByPaneId(l.getId());t.font=w(K,J,$),te.forEach(function(e){var i=a.getIndicatorTooltipData(e).legends;tt.push(i),i.forEach(function(e){var i=e.title,r=e.value,n="".concat(i.text).concat(r.text),o=t.measureText(n).width+U+q;H=Math.max(H,o),Z+=j+Q+K})})}if(0!==(X+=H)&&0!==Z){var ti=u.getCrosshair(),tr=s.getBounding(),tn=l.getYAxisWidget().getBounding();X+=2*z+D+A,Z+=2*z+F+B;var to=tr.width/2,ta="pointer"===k&&ti.paneId===tx,ts=(null!=(n=ti.realX)?n:0)>to,tl=0;
1if(ta){var tu=ti.realX;tl=ts?tu-L-X:tu+R}else{var tc=this.getWidget().getPane().getAxisComponent();ts?(tl=R+v,tc.inside&&"left"===tc.position&&(tl+=tn.width)):(tl=tr.width-L-X-y,tc.inside&&"right"===tc.position&&(tl-=tn.width))}var th=r+O;ta&&((th=ti.y-Z/2)+Z>tr.height-W-_&&(th=tr.height-W-Z-_),th<r+O&&(th=r+O+m)),null==(o=this.createFigure({name:"rect",attrs:{x:tl,y:th,width:X,height:Z},styles:{style:"stroke_fill",color:N,borderColor:Y,borderSize:z,borderRadius:V}}))||o.draw(t);var td=tl+z+D+b,tp=th+z+F;if(e&&f.forEach(function(e){tp+=E;var i,r,n=e.title;null==(i=a.createFigure({name:"text",attrs:{x:td,y:tp,text:n.text},styles:{color:n.color,size:T,family:M,weight:P}}))||i.draw(t);var o=e.value;null==(r=a.createFigure({name:"text",attrs:{x:tl+X-z-C-A,y:tp,text:o.text,align:"right"},styles:{color:o.color,size:T,family:M,weight:P}}))||r.draw(t),tp+=T+S}),i){var tg=tl+z+D+U;tt.forEach(function(e){e.forEach(function(e){tp+=j;var i,r,n=e.title,o=e.value;null==(i=a.createFigure({name:"text",attrs:{x:tg,y:tp,text:n.text},styles:{color:n.color,size:K,family:$,weight:J}}))||i.draw(t),null==(r=a.createFigure({name:"text",attrs:{x:tl+X-z-q-A,y:tp,text:o.text,align:"right"},styles:{color:o.color,size:K,family:$,weight:J}}))||r.draw(t),tp+=K+Q})})}}}},e.prototype._getCandleTooltipLegends=function(){var t,e,i,r,n,o,a,s,c=this.getWidget().getPane().getChart().getChartStore(),d=c.getStyles().candle,p=c.getDataList(),g=c.getInnerFormatter(),f=c.getDecimalFold(),v=c.getThousandsSeparator(),y=c.getLocale(),x=null!=(t=c.getSymbol())?t:{},b=x.pricePrecision,w=void 0===b?2:b,C=x.volumePrecision,E=c.getPeriod(),S=null!=(e=c.getCrosshair().dataIndex)?e:0,P=d.tooltip.legend,M=P.color,I=P.defaultValue,k=P.template,D=null!=(i=p[S-1])?i:null,A=p[S],F=null!=(r=null==D?void 0:D.close)?r:A.close,B=A.close-F,R=T(T({},A),{time:g.formatDate(A.timestamp,tj[null!=(n=null==E?void 0:E.type)?n:"day"],"tooltip"),open:f.format(v.format(m(A.open,w)
1)),high:f.format(v.format(m(A.high,w))),low:f.format(v.format(m(A.low,w))),close:f.format(v.format(m(A.close,w))),volume:f.format(v.format(g.formatBigNumber(m(null!=(o=A.volume)?o:I,void 0===C?0:C)))),turnover:f.format(v.format(m(null!=(a=A.turnover)?a:I,w))),change:0===F?I:"".concat(v.format(m(B/F*100)),"%")});return(l(k)?k({prev:D,current:A,next:null!=(s=p[S+1])?s:null},d):k).map(function(t){var e=t.title,i=t.value,r={text:"",color:M};u(e)?r=T({},e):r.text=e,r.text=tK(r.text,y);var n={text:I,color:M};return u(i)?n=T({},i):n.text=i,h(/{change}/.exec(n.text))&&(n.color=0===B?d.priceMark.last.noChangeColor:B>0?d.priceMark.last.upColor:d.priceMark.last.downColor),n.text=_(n.text,R),{title:r,value:n}})},e}(tN),t$=function(t){function e(e){var i=t.call(this,e)||this;return i._activeFeatureInfo=null,i._featureClickEvent=function(t){return function(){return i.getWidget().getPane().getChart().getChartStore().executeAction("onCrosshairFeatureClick",t),!0}},i._featureMouseMoveEvent=function(t){return function(){return i._activeFeatureInfo=t,i.getWidget().setForceCursor("pointer"),!0}},i.registerEvent("mouseMoveEvent",function(t){return i._activeFeatureInfo=null,i.getWidget().setForceCursor(null),!1}),i}return S(e,t),e.prototype.drawImp=function(t){var e,i,r=this,n=this.getWidget(),o=n.getPane(),a=n.getPane().getChart().getChartStore(),s=a.getCrosshair(),l=this.getWidget(),u=l.getPane().getAxisComponent();if(p(s.paneId)&&s.paneId===o.getId()&&u.isInCandle()){var c=a.getStyles().crosshair,h=c.horizontal.features;if(c.show&&c.horizontal.show&&h.length>0){var d="right"===u.position,g=l.getBounding(),f=0,v=c.horizontal.text;if(u.inside&&v.show){var m=u.convertFromPixel(s.y),y=u.getRange(),_=u.displayValueToText(u.realValueToDisplayValue(u.valueToRealValue(m,{range:y}),{range:y}),null!=(i=null==(e=a.getSymbol())?void 0:e.pricePrecision)?i:2);_=a.getDecimalFold().format(a.getThousandsSeparator().format(_)),f=v.paddingLeft+C(_,v.size,v.weight,v.family)+v.paddingRight}var x=f;d&&(x=g.width-f);var b=s.y;h.forEach(function(e){var i,n,o,a,l=e.marginLeft,u=void 0===l?0:l,c=e.marginTop,h=void 0===c?0:c,p=e.marginRight,g=void 0===p?0:p,f=e.paddingLeft,v=void 0===f?0:f,m=e.paddingTop,y=void 0===m?0:m,_=e.paddingRight,w=void 0===_?0:_,E=e.paddingBottom,S=void 0===E?0:E,T=e.color,P=e.activeColor,M=e.backgroundColor,I=e.activeBackgroundColor,k=e.borderRadius,D=e.size,A=void 0===D?0:D,F=e.type,B=e.content,R=A;if("icon_font"===F){var L=B;R=v+C(L.code,A,"normal",L.family)+w}d?x-=R+g:x+=u;var O=T,W=M;(null==(i=r._activeFeatureInfo)?void 0:i.feature.id)===e.id&&(O=null!=P?P:T,W=null!=I?I:M);var z={mouseDownEvent:r._featureClickEvent({crosshair:s,feature:e}),mouseMoveEvent:r._featureMouseMoveEvent({crosshair:s,feature:e})};if("icon_font"===F){var L=B;null==(n=r.createFigure({name:"text",attrs:{text:L.code,x:x,y:b+h,baseline:"middle"},styles:{paddingLeft:v,paddingTop:y,paddingRight:w,paddingBottom:S,borderRadius:k,size:A,family:L.family,color:O,backgroundColor:W}},z))||n.draw(t)}else null==(o=r.createFigure({name:"rect",attrs:{x:x,y:b+h-A/2,width:A,height:A},styles:{paddingLeft:v,paddingTop:y,paddingRight:w,paddingBottom:S,color:W}},z))||o.draw(t),null==(a=r.createFigure({name:"path",attrs:{path:B.path,x:x,y:b+h+y-A/2,width:A,height:A},styles:{style:B.style,lineWidth:B.lineWidth,color:O}}))||a.draw(t);d?x-=u:x+=R+g})}}},e}(tL),t0=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r._candleBarView=new tz(r),r._candleAreaView=new tZ(r),r._candleHighLowPriceView=new tG(r),r._candleLastPriceLineView=new tU(r),r._crosshairFeatureView=new t$(r),r.addChild(r._candleBarView),r.addChild(r._crosshairFeatureView),r}return S(e,t),e.prototype.updateMainContent=function(t){"area"!==this.getPane().getChart().getStyles().candle.type?(this._candleBarView.draw(t),this._candleHighLowPriceView.draw(t),this._candleAreaView.stopAnimation()):this._candleAreaView.draw(t),this._candleLastPriceLineView.draw(t)},e.prototype.updateOverlayContent=function(t){this._crosshairFeatureView.draw(t)},e.prototype.createTooltipView=function(){return new tJ(this)},e}(tX),t1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t,e){var i,r,n=this,o=this.getWidget(),a=o.getPane(),s=o.getBounding(),l=a.getAxisComponent(),u=this.getAxisStyles(a.getChart().getStyles());if(u.show&&(u.axisLine.show&&(null==(i=this.createFigure({name:"line",attrs:this.createAxisLine(s,u),styles:u.axisLine}))||i.draw(t)),!e[0])){var c=l.getTicks();
1if(u.tickLine.show&&this.createTickLines(c,s,u).forEach(function(e){var i;null==(i=n.createFigure({name:"line",attrs:e,styles:u.tickLine}))||i.draw(t)}),u.tickText.show){var h=this.createTickTexts(c,s,u);null==(r=this.createFigure({name:"text",attrs:h,styles:u.tickText}))||r.draw(t)}}},e}(tL),t2=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.getAxisStyles=function(t){return t.yAxis},e.prototype.createAxisLine=function(t,e){var i=this.getWidget().getPane().getAxisComponent(),r=e.axisLine.size,n=0;return{coordinates:[{x:n=i.isFromZero()?0:t.width-r,y:0},{x:n,y:t.height}]}},e.prototype.createTickLines=function(t,e,i){var r=this.getWidget().getPane().getAxisComponent(),n=i.axisLine,o=i.tickLine,a=0,s=0;return r.isFromZero()?(a=0,n.show&&(a+=n.size),s=a+o.length):(a=e.width,n.show&&(a-=n.size),s=a-o.length),t.map(function(t){return{coordinates:[{x:a,y:t.coord},{x:s,y:t.coord}]}})},e.prototype.createTickTexts=function(t,e,i){var r=this.getWidget().getPane().getAxisComponent(),n=i.axisLine,o=i.tickLine,a=i.tickText,s=0;r.isFromZero()?(s=a.marginStart,n.show&&(s+=n.size),o.show&&(s+=o.length)):(s=e.width-a.marginEnd,n.show&&(s-=n.size),o.show&&(s-=o.length));var l=this.getWidget().getPane().getAxisComponent().isFromZero()?"left":"right";return t.map(function(t){return{x:s,y:t.coord,text:t.text,align:l,baseline:"middle"}})},e}(t1),t3=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e,i,r,n,o=this,a=this.getWidget(),s=a.getPane(),l=a.getBounding(),u=s.getChart().getChartStore(),c=u.getStyles().candle.priceMark,d=c.last,p=d.text;if(c.show&&d.show&&p.show){var g=null!=(i=null==(e=u.getSymbol())?void 0:e.pricePrecision)?i:2,f=s.getAxisComponent(),v=u.getDataList(),m=v[v.length-1];if(h(m)){var y=m.close,_=m.open,x="current_open"===d.compareRule?_:null!=(n=null==(r=v[v.length-2])?void 0:r.close)?n:y,b=f.convertToNicePixel(y),w="";w=y>x?d.upColor:y<x?d.downColor:d.noChangeColor;var E=0,S="left";f.isFromZero()?(E=0,S="left"):(E=l.width,S="right");var P=[],M=f.getRange(),I=f.displayValueToText(f.realValueToDisplayValue(f.valueToRealValue(y,{range:M}),{range:M}),g);I=u.getDecimalFold().format(u.getThousandsSeparator().format(I));var k=p.paddingLeft,D=p.paddingRight,A=p.paddingTop,F=p.paddingBottom,B=p.size,R=p.family,L=k+C(I,B,p.weight,R)+D,O=A+B+F;P.push({name:"text",attrs:{x:E,y:b,width:L,height:O,text:I,align:S,baseline:"middle"},styles:T(T({},p),{backgroundColor:w})});var W=u.getInnerFormatter().formatExtendText,z=B/2,V=b-z-A,Y=b+z+F;d.extendTexts.forEach(function(t,e){var i=W({type:"last_price",data:m,index:e});if(i.length>0&&t.show){var r=t.size/2,n=0;"above_price"===t.position?(V-=t.paddingBottom+r,n=V,V-=r+t.paddingTop):(Y+=t.paddingTop+r,n=Y,Y+=r+t.paddingBottom),L=Math.max(L,t.paddingLeft+C(i,t.size,t.weight,t.family)+t.paddingRight),P.push({name:"text",attrs:{x:E,y:n,width:L,height:t.paddingTop+t.size+t.paddingBottom,text:i,align:S,baseline:"middle"},styles:T(T({},t),{backgroundColor:w})})}}),P.forEach(function(e){var i;e.attrs.width=L,null==(i=o.createFigure(e))||i.draw(t)})}}},e}(tL),t4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),r=i.getPane(),n=i.getBounding(),o=r.getChart().getChartStore(),a=o.getStyles().indicator,s=a.lastValueMark,l=s.text;if(s.show){var u=r.getAxisComponent(),d=u.getRange(),p=o.getDataList().length-1,g=o.getIndicatorsByPaneId(r.getId()),f=o.getInnerFormatter(),v=o.getDecimalFold(),m=o.getThousandsSeparator();g.forEach(function(i){var r,o=null!=(r=i.result[p])?r:{};if(h(o)&&i.visible){var s=i.precision;tr(i,p,a,function(r,a){var h,p=o[r.key];if(c(p)){var g=u.convertToNicePixel(p),y=u.displayValueToText(u.realValueToDisplayValue(u.valueToRealValue(p,{range:d}),{range:d}),s);i.shouldFormatBigNumber&&(y=f.formatBigNumber(y)),y=v.format(m.format(y));var _=0,x="left";u.isFromZero()?(_=0,x="left"):(_=n.width,x="right"),null==(h=e.createFigure({name:"text",attrs:{x:_,y:g,text:y,align:x,baseline:"middle"},styles:T(T({},l),{backgroundColor:a.color})}))||h.draw(t)}})}})}},e}(tL),t5=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!1}
1,e.prototype.drawDefaultFigures=function(t,e,i){this.drawFigures(t,e,this.getDefaultFigures(e,i))},e.prototype.getDefaultFigures=function(t,e){var i,r=this.getWidget(),n=r.getPane(),o=n.getChart().getChartStore(),a=o.getClickOverlayInfo(),s=[];if(t.needDefaultYAxisFigure&&t.id===(null==(i=a.overlay)?void 0:i.id)&&a.paneId===n.getId()){var l=n.getAxisComponent(),u=r.getBounding(),h=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,p=l.isFromZero(),g="left",f=0;p?(g="left",f=0):(g="right",f=u.width);var v=o.getDecimalFold(),y=o.getThousandsSeparator();e.forEach(function(e,i){var r,n,a=t.points[i];if(c(a.value)){h=Math.min(h,e.y),d=Math.max(d,e.y);var l=v.format(y.format(m(a.value,null!=(n=null==(r=o.getSymbol())?void 0:r.pricePrecision)?n:2)));s.push({type:"text",attrs:{x:f,y:e.y,text:l,align:g,baseline:"middle"},ignoreEvent:!0})}}),e.length>1&&s.unshift({type:"rect",attrs:{x:0,y:h,width:u.width,height:d-h},ignoreEvent:!0})}return s},e.prototype.getFigures=function(t,e){var i,r,n=this.getWidget(),o=n.getPane(),a=o.getChart(),s=o.getAxisComponent(),l=a.getXAxisPane().getAxisComponent(),u=n.getBounding();return null!=(r=null==(i=t.createYAxisFigures)?void 0:i.call(t,{chart:a,overlay:t,coordinates:e,bounding:u,xAxis:l,yAxis:s}))?r:[]},e}(tH),t6=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),r=i.getPane(),n=i.getPane().getChart().getChartStore(),o=n.getCrosshair();if(p(o.paneId)&&this.compare(o,r.getId())){var a=n.getStyles().crosshair;if(a.show){var s=this.getDirectionStyles(a),l=s.text;if(s.show&&l.show){var u=i.getBounding(),c=r.getAxisComponent(),h=this.getText(o,n,c);t.font=w(l.size,l.weight,l.family),null==(e=this.createFigure({name:"text",attrs:this.getTextAttrs(h,t.measureText(h).width,o,u,c,l),styles:l}))||e.draw(t)}}}},e.prototype.compare=function(t,e){return t.paneId===e},e.prototype.getDirectionStyles=function(t){return t.horizontal},e.prototype.getText=function(t,e,i){var r,n,o=i.convertFromPixel(t.y),a=0,s=!1;i.isInCandle()?a=null!=(n=null==(r=e.getSymbol())?void 0:r.pricePrecision)?n:2:e.getIndicatorsByPaneId(t.paneId).forEach(function(t){a=Math.max(t.precision,a),s||(s=t.shouldFormatBigNumber)});var l=i.getRange(),u=i.displayValueToText(i.realValueToDisplayValue(i.valueToRealValue(o,{range:l}),{range:l}),a);return s&&(u=e.getInnerFormatter().formatBigNumber(u)),e.getDecimalFold().format(e.getThousandsSeparator().format(u))},e.prototype.getTextAttrs=function(t,e,i,r,n,o){var a=0,s="left";return n.isFromZero()?(a=0,s="left"):(a=r.width,s="right"),{x:a,y:i.y,text:t,align:s,baseline:"middle"}},e}(tL),t8=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r._yAxisView=new t2(r),r._candleLastPriceLabelView=new t3(r),r._indicatorLastValueView=new t4(r),r._overlayYAxisView=new t5(r),r._crosshairHorizontalLabelView=new t6(r),r.setCursor("ns-resize"),r.addChild(r._overlayYAxisView),r}return S(e,t),e.prototype.getName=function(){return tT},e.prototype.updateMain=function(t){var e="minimize"===this.getPane().getOptions().state;this._yAxisView.draw(t,e),e||(this.getPane().getAxisComponent().isInCandle()&&this._candleLastPriceLabelView.draw(t),this._indicatorLastValueView.draw(t))},e.prototype.updateOverlay=function(t){"minimize"!==this.getPane().getOptions().state&&(this._overlayYAxisView.draw(t),this._crosshairHorizontalLabelView.draw(t))},e}(tk);function t9(){return{from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0,displayFrom:0,displayTo:0,displayRange:0}}var t7=function(){function t(t){this.scrollZoomEnabled=!0,this._range=t9(),this._prevRange=t9(),this._ticks=[],this._autoCalcTickFlag=!0,this._parent=t}return t.prototype.getParent=function(){return this._parent},t.prototype.buildTicks=function(t){return this._autoCalcTickFlag&&(this._range=this.createRangeImp()),(this._prevRange.from!==this._range.from||this._prevRange.to!==this._range.to||!!t)&&(this._prevRange=this._range,this._ticks=this.createTicksImp(),!0)},t.prototype.getTicks=function(){return this._ticks}
1,t.prototype.setRange=function(t){this._autoCalcTickFlag=!1,this._range=t},t.prototype.getRange=function(){return this._range},t.prototype.setAutoCalcTickFlag=function(t){this._autoCalcTickFlag=t},t.prototype.getAutoCalcTickFlag=function(){return this._autoCalcTickFlag},t}(),et=function(t){function e(e,i){var r=t.call(this,e)||this;return r.reverse=!1,r.inside=!1,r.position="right",r.gap={top:.2,bottom:.1},r.createRange=function(t){return t.defaultRange},r.minSpan=function(t){return Z(-t)},r.valueToRealValue=function(t){return t},r.realValueToDisplayValue=function(t){return t},r.displayValueToRealValue=function(t){return t},r.realValueToValue=function(t){return t},r.displayValueToText=function(t,e){return m(t,e)},r.override(i),r}return S(e,t),e.prototype.override=function(t){var e=t.name,i=t.gap,r=P(t,["name","gap"]);p(this.name)||(this.name=e),o(this.gap,i),o(this,r)},e.prototype.createRangeImp=function(){var t,e,i=this.getParent(),r=i.getChart(),n=r.getChartStore(),o=i.getId(),a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=!1,u=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,p=Number.MAX_SAFE_INTEGER,g=n.getIndicatorsByPaneId(o);g.forEach(function(t){l||(l=t.shouldOhlc),p=Math.min(p,t.precision),c(t.minValue)&&(u=Math.min(u,t.minValue)),c(t.maxValue)&&(d=Math.max(d,t.maxValue))});var f=4,v=this.isInCandle();if(v){var m=null!=(e=null==(t=n.getSymbol())?void 0:t.pricePrecision)?e:2;f=p!==Number.MAX_SAFE_INTEGER?Math.min(p,m):m}else p!==Number.MAX_SAFE_INTEGER&&(f=p);var y=n.getVisibleRangeDataList(),_=r.getStyles().candle,x="area"===_.type,b=_.area.value,w=v&&!x||!v&&l;y.forEach(function(t){var e=t.dataIndex,i=t.data.current;if(h(i)&&(w&&(a=Math.min(a,i.low),s=Math.max(s,i.high)),v&&x)){var r=i[b];c(r)&&(a=Math.min(a,r),s=Math.max(s,r))}g.forEach(function(t){var i,r=t.result,n=t.figures,o=null!=(i=r[e])?i:{};n.forEach(function(t){var e=o[t.key];c(e)&&(a=Math.min(a,e),s=Math.max(s,e))})})}),a!==Number.MAX_SAFE_INTEGER&&s!==Number.MIN_SAFE_INTEGER?(a=Math.min(u,a),s=Math.max(d,s)):(a=0,s=10);var C=s-a,E={from:a,to:s,range:C,realFrom:a,realTo:s,realRange:C,displayFrom:a,displayTo:s,displayRange:C},S=this.createRange({chart:r,paneId:o,defaultRange:E}),T=S.realFrom,P=S.realTo,M=S.realRange,I=this.minSpan(f);if(T===P||M<I){var k=u===T,D=d===P;T=k?T:D?T-8*I:T-4*I,P=D?P:k?P+8*I:P+4*I}var A=this.getBounding().height,F=this.gap,B=F.top,R=F.bottom,L=B;L>=1&&(L/=A);var O=R;O>=1&&(O/=A),M=P-T,T-=M*O,P+=M*L;var W=this.realValueToValue(T,{range:S}),z=this.realValueToValue(P,{range:S}),V=this.realValueToDisplayValue(T,{range:S}),Y=this.realValueToDisplayValue(P,{range:S});return{from:W,to:z,range:z-W,realFrom:T,realTo:P,realRange:P-T,displayFrom:V,displayTo:Y,displayRange:Y-V}},e.prototype.isInCandle=function(){return this.getParent().getId()===tx},e.prototype.isFromZero=function(){return"left"===this.position&&this.inside||"right"===this.position&&!this.inside},e.prototype.createTicksImp=function(){var t,e,i,r,n=this,o=this.getRange(),a=o.displayFrom,s=o.displayTo,u=o.displayRange,h=[];if(u>=0){var d,p,g,f,v=(g=Z(p=Math.floor(X(d=u/8))),+(d=((f=d/g)<1.5?1:f<2.5?2:f<3.5?3:f<4.5?4:f<5.5?5:f<6.5?6:8)*g).toFixed(Math.abs(p))),m=function(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var r=+e.slice(i+1);return r<0?-r:0}var n=e.indexOf(".");return n<0?0:e.length-1-n}(v),y=N(Math.ceil(a/v)*v,m),_=N(Math.floor(s/v)*v,m),x=0,b=y;if(0!==v)for(;b<=_;){var w=b.toFixed(m);h[x]={text:w,coord:0,value:w},++x,b+=v}}var C=this.getParent(),E=null!=(e=null==(t=C.getYAxisWidget())?void 0:t.getBounding().height)?e:0,S=C.getChart().getChartStore(),T=[],P=S.getIndicatorsByPaneId(C.getId()),M=S.getStyles(),I=0,k=!1;this.isInCandle()?I=null!=(r=null==(i=S.getSymbol())?void 0:i.pricePrecision)?r:2:P.forEach(function(t){I=Math.max(I,t.precision),k||(k=t.shouldFormatBigNumber)});var D=S.getInnerFormatter(),A=S.getThousandsSeparator(),F=S.getDecimalFold(),B=M.xAxis.tickText.size,R=NaN;return(h.forEach(function(t){var e=t.value,i=n.displayValueToText(+e,I),r=n.convertToPixel(n.realValueToValue(n.displayValueToRealValue(+e,{range:o}),{range:o}));k&&(i=D.formatBigNumber(e)),i=F.format(A.format(i));var a=c(R);r>B&&r<E-B&&(a&&Math.abs(R-r)>2*B||!a)&&(T.push({text:i,coord:r,value:e}),R=r)}),l(this.createTicks))?this.createTicks({range:this.getRange(),bounding:this.getBounding(),defaultTicks:T}):T},e.prototype.getAutoSize=function(){var t,e,i=this.getParent(),r=i.getChart().getChartStore(),n=r.getStyles(),o=n.yAxis,a=o.size;if("auto"!==a)return a;var s=0;if(o.show&&(o.axisLine.show&&(s+=o.axisLine.size),o.tickLine.show&&(s+=o.tickLine.length),o.tickText.show)){var l=0;
1this.getTicks().forEach(function(t){l=Math.max(l,C(t.text,o.tickText.size,o.tickText.weight,o.tickText.family))}),s+=o.tickText.marginStart+o.tickText.marginEnd+l}var u=n.candle.priceMark,c=u.show&&u.last.show&&u.last.text.show,d=0,p=n.crosshair,g=p.show&&p.horizontal.show&&p.horizontal.text.show,f=0;if(c||g){var v=null!=(e=null==(t=r.getSymbol())?void 0:t.pricePrecision)?e:2,y=this.getRange().displayTo;if(c){var _=r.getDataList(),x=_[_.length-1];if(h(x)){var b=u.last.text,w=b.paddingLeft,E=b.paddingRight,S=b.size,T=b.family,P=b.weight;d=w+C(m(x.close,v),S,P,T)+E;var M=r.getInnerFormatter().formatExtendText;u.last.extendTexts.forEach(function(t,e){var i=M({type:"last_price",data:x,index:e});i.length>0&&t.show&&(d=Math.max(d,t.paddingLeft+C(i,t.size,t.weight,t.family)+t.paddingRight))})}}if(g){var I=r.getIndicatorsByPaneId(i.getId()),k=0,D=!1;I.forEach(function(t){k=Math.max(t.precision,k),D||(D=t.shouldFormatBigNumber)});var A=2;if(this.isInCandle()){var F=n.indicator.lastValueMark;A=F.show&&F.text.show?Math.max(k,v):v}else A=k;var B=m(y,A);D&&(B=r.getInnerFormatter().formatBigNumber(B)),B=r.getDecimalFold().format(B),f+=p.horizontal.text.paddingLeft+p.horizontal.text.paddingRight+2*p.horizontal.text.borderSize+C(B,p.horizontal.text.size,p.horizontal.text.weight,p.horizontal.text.family)}}return Math.max(s,d,f)},e.prototype.getBounding=function(){return this.getParent().getYAxisWidget().getBounding()},e.prototype.convertFromPixel=function(t){var e=this.getBounding().height,i=this.getRange(),r=i.realFrom,n=i.realRange,o=this.reverse?t/e:1-t/e;return this.realValueToValue(o*n+r,{range:i})},e.prototype.convertToPixel=function(t){var e,i,r=this.getRange(),n=this.valueToRealValue(t,{range:r}),o=null!=(i=null==(e=this.getParent().getYAxisWidget())?void 0:e.getBounding().height)?i:0,a=(n-r.realFrom)/r.realRange;return this.reverse?Math.round(a*o):Math.round((1-a)*o)},e.prototype.convertToNicePixel=function(t){var e,i,r=null!=(i=null==(e=this.getParent().getYAxisWidget())?void 0:e.getBounding().height)?i:0;return Math.round(Math.max(.05*r,Math.min(this.convertToPixel(t),.98*r)))},e.extend=function(t){var i=e;function r(e){return i.call(this,e,t)||this}return S(r,i),r},e}(t7),ee={normal:et.extend({name:"normal"}),percentage:et.extend({name:"percentage",minSpan:function(){return .01},displayValueToText:function(t){return"".concat(m(t,2),"%")},valueToRealValue:function(t,e){var i=e.range;return(t-i.from)/i.range*i.realRange+i.realFrom},realValueToValue:function(t,e){var i=e.range;return(t-i.realFrom)/i.realRange*i.range+i.from},createRange:function(t){var e=t.chart,i=t.defaultRange,r=e.getDataList()[e.getVisibleRange().from];if(h(r)){var n=i.from,o=i.to,a=i.range,s=(i.from-r.close)/r.close*100,l=(i.to-r.close)/r.close*100,u=l-s;return{from:n,to:o,range:a,realFrom:s,realTo:l,realRange:u,displayFrom:s,displayTo:l,displayRange:u}}return i}}),logarithm:et.extend({name:"logarithm",minSpan:function(t){return .05*Z(-t)},valueToRealValue:function(t){return t<0?-X(Math.abs(t)):X(t)},realValueToDisplayValue:function(t){return t<0?-Z(Math.abs(t)):Z(t)},displayValueToRealValue:function(t){return t<0?-X(Math.abs(t)):X(t)},realValueToValue:function(t){return t<0?-Z(Math.abs(t)):Z(t)},createRange:function(t){var e=t.defaultRange,i=e.from,r=e.to,n=e.range,o=i<0?-X(Math.abs(i)):X(i),a=r<0?-X(Math.abs(r)):X(r);return{from:i,to:r,range:n,realFrom:o,realTo:a,realRange:a-o,displayFrom:i,displayTo:r,displayRange:n}}})},ei=function(){function t(t,e){this._bounding=F(),this._originalBounding=F(),this._visible=!0,this._chart=t,this._id=e,this._container=V("div",{width:"100%",margin:"0",padding:"0",position:"relative",overflow:"hidden",boxSizing:"border-box"})}return t.prototype.getContainer=function(){return this._container},t.prototype.setVisible=function(t){this._visible!==t&&(this._container.style.display=t?"block":"none",this._visible=t)},t.prototype.getVisible=function(){return this._visible},t.prototype.getId=function(){return this._id},t.prototype.getChart=function(){return this._chart},t.prototype.getBounding=function(){return this._bounding},t.prototype.setOriginalBounding=function(t){o(this._originalBounding,t)},t.prototype.getOriginalBounding=function(){return this._originalBounding},t.prototype.update=function(t){this._bounding.height!==this._container.clientHeight&&(this._container.style.height="".concat(this._bounding.height,"px")),this.updateImp(null!=t?t:3,this._container,this._bounding)},t}(),er=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;n._yAxisWidget=null,n._options={id:"",minHeight:30,dragEnabled:!0,order:0,height:100,state:"normal",axis:{name:"normal",scrollZoomEnabled:!0}};var o=n.getContainer();return n._mainWidget=n.createMainWidget(o),n._yAxisWidget=n.createYAxisWidget(o),n.setOptions(r),n}return S(e,t),e.prototype.setOptions=function(t){var e,i,r,n,a,s=this.getId();if(s===tx||s===tw){var l=null==(e=t.axis)?void 0:e.name;(!h(this._axis)||h(l)&&this._options.axis.name!==l)&&(this._axis=this.createAxisComponent(null!=l?l:"normal"))}else h(this._axis)||(this._axis=this.createAxisComponent("normal"));
1this._axis instanceof et&&this._axis.setAutoCalcTickFlag(!0),o(this._options,t),this._axis.override(T(T({},this._options.axis),{name:null!=(r=null==(i=t.axis)?void 0:i.name)?r:"normal"}));var u=null,c="default";return this.getId()===tw?(u=this.getMainWidget().getContainer(),c="ew-resize"):(u=this.getYAxisWidget().getContainer(),c="ns-resize"),null==(a=null==(n=t.axis)?void 0:n.scrollZoomEnabled)||a?u.style.cursor=c:u.style.cursor="default",this},e.prototype.getOptions=function(){return this._options},e.prototype.getAxisComponent=function(){return this._axis},e.prototype.setBounding=function(t,e,i,r){o(this.getBounding(),t);var n,a,s,l,u={};h(t.height)&&(u.height=t.height),h(t.top)&&(u.top=t.top),this._mainWidget.setBounding(u);var c=h(e);return c&&this._mainWidget.setBounding(e),h(this._yAxisWidget)&&(this._yAxisWidget.setBounding(u),"left"===this._axis.position?h(i)&&this._yAxisWidget.setBounding(T(T({},i),{left:0})):h(r)&&(this._yAxisWidget.setBounding(r),c&&this._yAxisWidget.setBounding({left:(null!=(n=e.left)?n:0)+(null!=(a=e.width)?a:0)+(null!=(s=e.right)?s:0)-(null!=(l=r.width)?l:0)}))),this},e.prototype.getMainWidget=function(){return this._mainWidget},e.prototype.getYAxisWidget=function(){return this._yAxisWidget},e.prototype.updateImp=function(t){var e;this._mainWidget.update(t),null==(e=this._yAxisWidget)||e.update(t)},e.prototype.destroy=function(){var t;this._mainWidget.destroy(),null==(t=this._yAxisWidget)||t.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,r=e.height,n=V("canvas",{width:"".concat(i,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),o=n.getContext("2d"),a=b(n);n.width=i*a,n.height=r*a,o.scale(a,a);var s=this._mainWidget.getBounding();if(o.drawImage(this._mainWidget.getImage(t),s.left,0,s.width,s.height),null!==this._yAxisWidget){var l=this._yAxisWidget.getBounding();o.drawImage(this._yAxisWidget.getImage(t),l.left,0,l.width,l.height)}return n},e.prototype.createYAxisWidget=function(t){return null},e}(ei),en=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.createAxisComponent=function(t){var e;return new(null!=(e=ee[null!=t?t:"default"])?e:ee.normal)(this)},e.prototype.createMainWidget=function(t){return new tX(t,this)},e.prototype.createYAxisWidget=function(t){return new t8(t,this)},e}(er),eo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.createMainWidget=function(t){return new t0(t,this)},e}(en),ea=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.getAxisStyles=function(t){return t.xAxis},e.prototype.createAxisLine=function(t){return{coordinates:[{x:0,y:0},{x:t.width,y:0}]}},e.prototype.createTickLines=function(t,e,i){var r=i.tickLine,n=i.axisLine.size;return t.map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:n+r.length}]}})},e.prototype.createTickTexts=function(t,e,i){var r=i.tickText,n=i.axisLine.size,o=i.tickLine.length;return t.map(function(t){return{x:t.coord,y:n+o+r.marginStart,text:t.text,align:"center",baseline:"top"}})},e}(t1),es=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.coordinateToPointValueFlag=function(){return!1},e.prototype.getCompleteOverlays=function(){return this.getWidget().getPane().getChart().getChartStore().getOverlaysByPaneId()},e.prototype.getProgressOverlay=function(){var t,e;return null!=(e=null==(t=this.getWidget().getPane().getChart().getChartStore().getProgressOverlayInfo())?void 0:t.overlay)?e:null},e.prototype.getDefaultFigures=function(t,e){var i,r=[],n=this.getWidget(),o=n.getPane().getChart().getChartStore(),a=o.getClickOverlayInfo();if(t.needDefaultXAxisFigure&&t.id===(null==(i=a.overlay)?void 0:i.id)){var s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;e.forEach(function(e,i){s=Math.min(s,e.x),l=Math.max(l,e.x);var n=t.points[i];if(c(n.timestamp)){var a=o.getInnerFormatter().formatDate(n.timestamp,"YYYY-MM-DD HH:mm","crosshair");r.push({type:"text",attrs:{x:e.x,y:0,text:a,align:"center"},ignoreEvent:!0})}}),e.length>1&&r.unshift({type:"rect",attrs:{x:s,y:0,width:l-s,height:n.getBounding().height},ignoreEvent:!0})}return r},e.prototype.getFigures=function(t,e){var i,r,n=this.getWidget(),o=n.getPane(),a=o.getChart(),s=o.getAxisComponent(),l=a.getXAxisPane().getAxisComponent(),u=n.getBounding();return null!=(r=null==(i=t.createXAxisFigures)?void 0:i.call(t,{chart:a,overlay:t,coordinates:e,bounding:u,xAxis:l,yAxis:s}))?r:[]},e}(t5),el=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.compare=function(t){return h(t.timestamp)},e.prototype.getDirectionStyles=function(t){return t.vertical},e.prototype.getText=function(t,e){var i,r,n=t.timestamp;return e.getInnerFormatter().formatDate(n,tj[null!=(r=null==(i=e.getPeriod())?void 0:i.type)?r:"day"],"crosshair")}
1,e.prototype.getTextAttrs=function(t,e,i,r,n,o){var a=i.realX,s=0,l="center";return a-e/2-o.paddingLeft<0?(s=0,l="left"):a+e/2+o.paddingRight>r.width?(s=r.width,l="right"):s=a,{x:s,y:0,text:t,align:l,baseline:"top"}},e}(t6),eu=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r._xAxisView=new ea(r),r._overlayXAxisView=new es(r),r._crosshairVerticalLabelView=new el(r),r.setCursor("ew-resize"),r.addChild(r._overlayXAxisView),r}return S(e,t),e.prototype.getName=function(){return tS},e.prototype.updateMain=function(t){this._xAxisView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayXAxisView.draw(t),this._crosshairVerticalLabelView.draw(t)},e}(tk),ec={normal:(function(t){function e(e,i){var r=t.call(this,e)||this;return r.override(i),r}return S(e,t),e.prototype.override=function(t){var e=t.name,i=t.scrollZoomEnabled,r=t.createTicks;p(this.name)||(this.name=e),this.scrollZoomEnabled=null!=i?i:this.scrollZoomEnabled,this.createTicks=null!=r?r:this.createTicks},e.prototype.createRangeImp=function(){var t=this.getParent().getChart().getChartStore().getVisibleRange(),e=t.realFrom,i=t.realTo,r=i-e+1;return{from:e,to:i,range:r,realFrom:e,realTo:i,realRange:r,displayFrom:e,displayTo:i,displayRange:r}},e.prototype.createTicksImp=function(){var t,e=this.getRange(),i=e.realFrom,r=e.realTo,n=e.from,o=this.getParent().getChart().getChartStore(),a=o.getInnerFormatter().formatDate,s=o.getPeriod(),u=[],h=o.getBarSpace().bar,d=o.getStyles().xAxis.tickText,p=Math.ceil(Math.max(C("YYYY-MM-DD HH:mm:ss",d.size,d.weight,d.family),this.getBounding().width/8)/h);p%2!=0&&(p+=1);for(var g=Math.max(0,Math.floor(i/p)*p),f=g;f<r;f+=p)if(f>=n){var v=o.dataIndexToTimestamp(f);c(v)&&u.push({coord:this.convertToPixel(f),value:v,text:a(v,tq[null!=(t=null==s?void 0:s.type)?t:"day"],"xAxis")})}return l(this.createTicks)?this.createTicks({range:this.getRange(),bounding:this.getBounding(),defaultTicks:u}):u},e.prototype.getAutoSize=function(){var t=this.getParent().getChart().getStyles(),e=t.xAxis,i=e.size;if("auto"!==i)return i;var r=t.crosshair,n=0;e.show&&(e.axisLine.show&&(n+=e.axisLine.size),e.tickLine.show&&(n+=e.tickLine.length),e.tickText.show&&(n+=e.tickText.marginStart+e.tickText.marginEnd+e.tickText.size));var o=0;return r.show&&r.vertical.show&&r.vertical.text.show&&(o+=r.vertical.text.paddingTop+r.vertical.text.paddingBottom+2*r.vertical.text.borderSize+r.vertical.text.size),Math.max(n,o)},e.prototype.getBounding=function(){return this.getParent().getMainWidget().getBounding()},e.prototype.convertTimestampFromPixel=function(t){var e=this.getParent().getChart().getChartStore(),i=e.coordinateToDataIndex(t);return e.dataIndexToTimestamp(i)},e.prototype.convertTimestampToPixel=function(t){var e=this.getParent().getChart().getChartStore(),i=e.timestampToDataIndex(t);return e.dataIndexToCoordinate(i)},e.prototype.convertFromPixel=function(t){return this.getParent().getChart().getChartStore().coordinateToDataIndex(t)},e.prototype.convertToPixel=function(t){return this.getParent().getChart().getChartStore().dataIndexToCoordinate(t)},e.extend=function(t){var i=e;function r(e){return i.call(this,e,t)||this}return S(r,i),r},e})(t7).extend({name:"normal"})},eh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.createAxisComponent=function(t){var e;return new(null!=(e=ec[t])?e:ec.normal)(this)},e.prototype.createMainWidget=function(t){return new eu(t,this)},e}(er),ed=function(t){function e(e,i){var r,n,o=t.call(this,e,i)||this;return o._dragFlag=!1,o._dragStartY=0,o._topPaneHeight=0,o._bottomPaneHeight=0,o._topPane=null,o._bottomPane=null,r=o._pressedTouchMouseMoveEvent,n=0,o._pressedMouseMoveEvent=function(){var t=Date.now();t-n>20&&(r.apply(this,arguments),n=t)},o.registerEvent("touchStartEvent",o._mouseDownEvent.bind(o)).registerEvent("touchMoveEvent",o._pressedMouseMoveEvent.bind(o)).registerEvent("touchEndEvent",o._mouseUpEvent.bind(o)).registerEvent("mouseDownEvent",o._mouseDownEvent.bind(o)).registerEvent("mouseUpEvent",o._mouseUpEvent.bind(o)).registerEvent("pressedMouseMoveEvent",o._pressedMouseMoveEvent.bind(o)).registerEvent("mouseEnterEvent",o._mouseEnterEvent.bind(o)).registerEvent("mouseLeaveEvent",o._mouseLeaveEvent.bind(o)),o}return S(e,t),e.prototype.getName=function(){return tP},e.prototype._mouseDownEvent=function(t){var e=this;this._dragFlag=!0,this._dragStartY=t.pageY;var i=this.getPane(),r=i.getChart();this._topPane=i.getTopPane(),this._bottomPane=i.getBottomPane();var n=r.getDrawPanes();if("minimize"===this._topPane.getOptions().state)for(var o=n.findIndex(function(t){var i;return t.getId()===(null==(i=e._topPane)?void 0:i.getId())}),a=o-1;a>-1;a--){var s=n[a];if("minimize"!==s.getOptions().state){this._topPane=s;break}}if("minimize"===this._bottomPane.getOptions().state)for(var o=n.findIndex(function(t){var i;return t.getId()===(null==(i=e._bottomPane)?void 0:i.getId())}),a=o+1;a<n.length;a++){var l=n[a];if("minimize"!==l.getOptions().state){this._bottomPane=l;break}}return this._topPaneHeight=this._topPane.getBounding().height,this._bottomPaneHeight=this._bottomPane.getBounding().height,!0},e.prototype._mouseUpEvent=function(){return this._dragFlag=!1,this._topPane=null,this._bottomPane=null,this._topPaneHeight=0,this._bottomPaneHeight=0,this._mouseLeaveEvent()},e.prototype._pressedTouchMouseMoveEvent=function(t){var e=t.pageY-this._dragStartY,i=e<0;if(h(this._topPane)&&h(this._bottomPane)){var r=this._bottomPane.getOptions();if("minimize"!==this._topPane.getOptions().state&&"minimize"!==r.state&&r.dragEnabled){var n=null,o=null,a=0,s=0;i?(n=this._topPane,o=this._bottomPane,a=this._topPaneHeight,s=this._bottomPaneHeight):(n=this._bottomPane,o=this._topPane,a=this._bottomPaneHeight,s=this._topPaneHeight);var l=n.getOptions().minHeight;if(a>l){var u=Math.max(a-Math.abs(e),l),c=a-u;n.setBounding({height:u}),o.setBounding({height:s+c}
1);var d=this.getPane(),p=d.getChart();p.getChartStore().executeAction("onPaneDrag",{paneId:d.getId()}),p.layout({measureHeight:!0,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0})}}}return!0},e.prototype._mouseEnterEvent=function(){var t=this.getPane();if(t.getBottomPane().getOptions().dragEnabled){var e=t.getChart().getStyles().separator;return this.getContainer().style.background=e.activeBackgroundColor,!0}return!1},e.prototype._mouseLeaveEvent=function(){return!this._dragFlag&&(this.getContainer().style.background="transparent",!0)},e.prototype.createContainer=function(){return V("div",{width:"100%",height:"".concat(7,"px"),margin:"0",padding:"0",position:"absolute",top:"-3px",zIndex:"20",boxSizing:"border-box",cursor:"ns-resize"})},e.prototype.updateImp=function(t,e,i){if(4===i||2===i){var r=this.getPane().getChart().getStyles().separator;t.style.top="".concat(-Math.floor((7-r.size)/2),"px"),t.style.height="".concat(7,"px")}},e}(tI),ep=function(t){function e(e,i,r,n){var o=t.call(this,e,i)||this;return o.getContainer().style.overflow="",o._topPane=r,o._bottomPane=n,o._separatorWidget=new ed(o.getContainer(),o),o}return S(e,t),e.prototype.setBounding=function(t){return o(this.getBounding(),t),this},e.prototype.getTopPane=function(){return this._topPane},e.prototype.setTopPane=function(t){return this._topPane=t,this},e.prototype.getBottomPane=function(){return this._bottomPane},e.prototype.setBottomPane=function(t){return this._bottomPane=t,this},e.prototype.getWidget=function(){return this._separatorWidget},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,r=e.height,n=this.getChart().getStyles().separator,o=V("canvas",{width:"".concat(i,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),a=o.getContext("2d"),s=b(o);return o.width=i*s,o.height=r*s,a.scale(s,s),a.fillStyle=n.color,a.fillRect(0,0,i,r),o},e.prototype.updateImp=function(t,e,i){if(4===t||2===t){var r=this.getChart().getStyles().separator;e.style.backgroundColor=r.color,e.style.height="".concat(i.height,"px"),e.style.marginLeft="".concat(i.left,"px"),e.style.width="".concat(i.width,"px"),this._separatorWidget.update(t)}},e}(ei);function eg(){return"undefined"!=typeof window&&window.navigator.userAgent.toLowerCase().includes("firefox")}function ef(){return"undefined"!=typeof window&&/iPhone|iPad|iPod|iOS/.test(window.navigator.userAgent)}var ev=function(){function t(t,e,i){var r=this;this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:-1/0,y:1/0},this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:-1/0,y:1/0},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartCoordinate=null,this._touchMoveStartCoordinate=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeMouseWheel=null,this._unsubscribeContextMenu=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null,this._startPinchMiddleCoordinate=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!ef(),this._onFirefoxOutsideMouseUp=function(t){r._mouseUpHandler(t)},this._onMobileSafariDoubleClick=function(t){if(r._firesTouchEvents(t)){if(++r._tapCount,null!==r._tapTimeoutId&&r._tapCount>1){var e=r._mouseTouchMoveWithDownInfo(r._getCoordinate(t),r._tapCoordinate).manhattanDistance;e<30&&!r._cancelTap&&r._processEvent(r._makeCompatEvent(t),r._handler.doubleTapEvent),r._resetTapTimeout()}}else if(++r._clickCount,null!==r._clickTimeoutId&&r._clickCount>1){var e=r._mouseTouchMoveWithDownInfo(r._getCoordinate(t),r._clickCoordinate).manhattanDistance;e<5&&!r._cancelClick&&r._processEvent(r._makeCompatEvent(t),r._handler.mouseDoubleClickEvent),r._resetClickTimeout()}},this._target=t,this._handler=e,this._options=i,this._init()}return t.prototype.destroy=function(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeMouseWheel&&(this._unsubscribeMouseWheel(),this._unsubscribeMouseWheel=null),null!==this._unsubscribeContextMenu&&(this._unsubscribeContextMenu(),this._unsubscribeContextMenu=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()},t.prototype._mouseEnterHandler=function(t){var e,i,r,n=this;null==(e=this._unsubscribeMousemove)||e.call(this),null==(i=this._unsubscribeMouseWheel)||i.call(this),null==(r=this._unsubscribeContextMenu)||r.call(this);var o=this._mouseMoveHandler.bind(this);this._unsubscribeMousemove=function(){n._target.removeEventListener("mousemove",o)},this._target.addEventListener("mousemove",o);var a=this._mouseWheelHandler.bind(this);this._unsubscribeMouseWheel=function(){n._target.removeEventListener("wheel",a)},this._target.addEventListener("wheel",a,{passive:!1});var s=this._contextMenuHandler.bind(this);this._unsubscribeContextMenu=function(){n._target.removeEventListener("contextmenu",s)},this._target.addEventListener("contextmenu",s,{passive:!1}),this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseEnterEvent),this._acceptMouseLeave=!0)},t.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:-1/0,y:1/0}},t.prototype._resetTapTimeout=function(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:-1/0,y:1/0}},t.prototype._mouseMoveHandler=function(t){this._mousePressed||null!==this._touchMoveStartCoordinate||this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseMoveEvent),this._acceptMouseLeave=!0)},t.prototype._mouseWheelHandler=function(t){if(Math.abs(t.deltaX)>Math.abs(t.deltaY))h(this._handler.mouseWheelHortEvent)&&(this._preventDefault(t),0!==Math.abs(t.deltaX)&&this._handler.mouseWheelHortEvent(this._makeCompatEvent(t),-t.deltaX));else{if(!h(this._handler.mouseWheelVertEvent))return;var e=-(t.deltaY/100);if(0===e)return;switch(this._preventDefault(t),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._handler.mouseWheelVertEvent(this._makeCompatEvent(t),i)}}},t.prototype._contextMenuHandler=function(t){this._preventDefault(t)},t.prototype._touchMoveHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null!==e){if(this._lastTouchEventTimeStamp=this._eventTimeStamp(t),null===this._startPinchMiddleCoordinate&&!this._preventTouchDragProcess){this._pinchPrevented=!0;var i=this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._touchMoveStartCoordinate),r=i.xOffset,n=i.yOffset,o=i.manhattanDistance;if(this._touchMoveExceededManhattanDistance||!(o<5)){if(!this._touchMoveExceededManhattanDistance){var a=.5*r,s=n>
1=a&&!this._options.treatVertDragAsPageScroll(),l=a>n&&!this._options.treatHorzDragAsPageScroll();s||l||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}this._preventTouchDragProcess||this._processEvent(this._makeCompatEvent(t,e),this._handler.touchMoveEvent)}}}},t.prototype._mouseMoveWithDownHandler=function(t){0===t.button&&(this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._mouseMoveStartCoordinate).manhattanDistance>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick&&this._processEvent(this._makeCompatEvent(t),this._handler.pressedMouseMoveEvent))},t.prototype._mouseTouchMoveWithDownInfo=function(t,e){var i=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return{xOffset:i,yOffset:r,manhattanDistance:i+r}},t.prototype._touchEndHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null===e&&0===t.touches.length&&(e=t.changedTouches[0]),null!==e){this._activeTouchId=null,this._lastTouchEventTimeStamp=this._eventTimeStamp(t),this._clearLongTapTimeout(),this._touchMoveStartCoordinate=null,null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var i=this._makeCompatEvent(t,e);this._processEvent(i,this._handler.touchEndEvent),++this._tapCount,null!==this._tapTimeoutId&&this._tapCount>1?(this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._tapCoordinate).manhattanDistance<30&&!this._cancelTap&&this._processEvent(i,this._handler.doubleTapEvent),this._resetTapTimeout()):!this._cancelTap&&(this._processEvent(i,this._handler.tapEvent),h(this._handler.tapEvent)&&this._preventDefault(t)),0===this._tapCount&&this._preventDefault(t),0===t.touches.length&&this._longTapActive&&(this._longTapActive=!1,this._preventDefault(t))}},t.prototype._mouseUpHandler=function(t){if(0===t.button){var e=this._makeCompatEvent(t);this._mouseMoveStartCoordinate=null,this._mousePressed=!1,null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),eg()&&this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp),!this._firesTouchEvents(t)&&(this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,null!==this._clickTimeoutId&&this._clickCount>1?(this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._clickCoordinate).manhattanDistance<5&&!this._cancelClick&&this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent))}},t.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},t.prototype._touchStartHandler=function(t){if(null===this._activeTouchId){var e=t.changedTouches[0];this._activeTouchId=e.identifier,this._lastTouchEventTimeStamp=this._eventTimeStamp(t);var i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartCoordinate=this._getCoordinate(e),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var r=this._touchMoveHandler.bind(this),n=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=function(){i.removeEventListener("touchmove",r),i.removeEventListener("touchend",n)},i.addEventListener("touchmove",r,{passive:!1}),i.addEventListener("touchend",n,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),500),this._processEvent(this._makeCompatEvent(t,e),this._handler.touchStartEvent),null===this._tapTimeoutId&&(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapCoordinate=this._getCoordinate(e))}},t.prototype._mouseDownHandler=function(t){if(2===t.button){this._preventDefault(t),this._processEvent(this._makeCompatEvent(t),this._handler.mouseRightClickEvent);return}if(0===t.button){var e=this._target.ownerDocument.documentElement;eg()&&e.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartCoordinate=this._getCoordinate(t),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);var i=this._mouseMoveWithDownHandler.bind(this),r=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=function(){e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",r)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",r),this._mousePressed=!0,this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseDownEvent),null===this._clickTimeoutId&&(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickCoordinate=this._getCoordinate(t)))}},t.prototype._init=function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e=this._target.ownerDocument,i=function(e){null==t._handler.mouseDownOutsideEvent||e.composed&&t._target.contains(e.composedPath()[0])||null!==e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent({x:0,y:0,pageX:0,pageY:0})};this._unsubscribeOutsideTouchEvents=function(){e.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=function(){e.removeEventListener("mousedown",i)},e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),ef()&&(this._unsubscribeMobileSafariEvents=function(){t._target.removeEventListener("dblclick",t._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),this._target.addEventListener("mousedown",function(t){if(1===t.button)return t.preventDefault(),!1}),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",function(){},{passive:!1})},t.prototype._initPinch=function(){var t=this;(h(this._handler.pinchStartEvent)||h(this._handler.pinchEvent)||h(this._handler.pinchEndEvent))&&(this._target.addEventListener("touchstart",function(e){t._checkPinchState(e.touches)},{passive:!0}),this._target.addEventListener("touchmove",function(e){if(2===e.touches.length&&null!==t._startPinchMiddleCoordinate&&h(t._handler.pinchEvent)){var i=t._getTouchDistance(e.touches[0],e.touches[1])/t._startPinchDistance;t._handler.pinchEvent(T(T({},t._startPinchMiddleCoordinate),{pageX:0,pageY:0}),i),t._preventDefault(e)}},{passive:!1}),this._target.addEventListener("touchend",function(e){t._checkPinchState(e.touches)}))},t.prototype._checkPinchState=function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)},t.prototype._startPinch=function(t){var e=this._target.getBoundingClientRect();this._startPinchMiddleCoordinate={x:(t[0].clientX-e.left+(t[1].clientX-e.left))/2,y:(t[0].clientY-e.top+(t[1].clientY-e.top))/2},this._startPinchDistance=this._getTouchDistance(t[0],t[1]),h(this._handler.pinchStartEvent)&&this._handler.pinchStartEvent({x:0,y:0,pageX:0,pageY:0}),this._clearLongTapTimeout()},t.prototype._stopPinch=function(){null!==this._startPinchMiddleCoordinate&&(this._startPinchMiddleCoordinate=null,h(this._handler.pinchEndEvent)&&this._handler.pinchEndEvent({x:0,y:0,pageX:0,pageY:0}))},t.prototype._mouseLeaveHandler=function(t){var e,i,r;null==(e=this._unsubscribeMousemove)||e.call(this),null==(i=this._unsubscribeMouseWheel)||i.call(this),null==(r=this._unsubscribeContextMenu)||r.call(this),this._firesTouchEvents(t)||this._acceptMouseLeave&&(this._processEvent(this._makeCompatEvent(t),this._handler.mouseLeaveEvent),this._acceptMouseLeave=!ef())},t.prototype._longTapHandler=function(t){var e=this._touchWithId(t.touches,this._activeTouchId);null!==e&&(this._processEvent(this._makeCompatEvent(t,e),this._handler.longTapEvent),this._cancelTap=!0,this._longTapActive=!0)},t.prototype._firesTouchEvents=function(t){var e;return h(null==(e=t.sourceCapabilities)?void 0:e.firesTouchEvents)?t.sourceCapabilities.firesTouchEvents:this._eventTimeStamp(t)<this._lastTouchEventTimeStamp+500},t.prototype._processEvent=function(t,e){null==e||e.call(this._handler,t)},t.prototype._makeCompatEvent=function(t,e){var i=this,r=null!=e?e:t,n=this._target.getBoundingClientRect();return{x:r.clientX-n.left,y:r.clientY-n.top,pageX:r.pageX,pageY:r.pageY,isTouch:!t.type.startsWith("mouse")&&"contextmenu"!==t.type&&"click"!==t.type&&"wheel"!==t.type,preventDefault:function(){"touchstart"!==t.type&&i._preventDefault(t)}}},t.prototype._getTouchDistance=function(t,e){var i=t.clientX-e.clientX,r=t.clientY-e.clientY;return Math.sqrt(i*i+r*r)},t.prototype._preventDefault=function(t){t.cancelable&&t.preventDefault()},t.prototype._getCoordinate=function(t){return{x:t.pageX,y:t.pageY}},t.prototype._eventTimeStamp=function(t){var e;return null!=(e=t.timeStamp)?e:performance.now()},t.prototype._touchWithId=function(t,e){for(var i=0;i<t.length;++i)if(t[i].identifier===e)return t[i];return null},t}(),em=function(){function t(t,e){var i=this;this._flingStartTime=new Date().getTime(),this._flingScrollRequestId=null,this._startScrollC
1oordinate=null,this._touchCoordinate=null,this._touchCancelCrosshair=!1,this._touchZoomed=!1,this._pinchScale=1,this._mouseDownWidget=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,this._mouseMoveTriggerWidgetInfo={pane:null,widget:null},this._boundKeyBoardDownEvent=function(t){if(t.shiftKey)switch(t.code){case"Equal":i._chart.getChartStore().zoom(.5,null,"main");break;case"Minus":i._chart.getChartStore().zoom(-.5,null,"main");break;case"ArrowLeft":var e=i._chart.getChartStore();e.startScroll(),e.scroll(-3*e.getBarSpace().bar);break;case"ArrowRight":var e=i._chart.getChartStore();e.startScroll(),e.scroll(3*e.getBarSpace().bar)}},this._container=t,this._chart=e,this._event=new ev(t,this,{treatVertDragAsPageScroll:function(){return!1},treatHorzDragAsPageScroll:function(){return!1}}),t.addEventListener("keydown",this._boundKeyBoardDownEvent)}return t.prototype.pinchStartEvent=function(){return this._touchZoomed=!0,this._pinchScale=1,!0},t.prototype.pinchEvent=function(t,e){var i=this._findWidgetByEvent(t),r=i.pane,n=i.widget;if((null==r?void 0:r.getId())!==tw&&(null==n?void 0:n.getName())===tE){var o=this._makeWidgetEvent(t,n),a=(e-this._pinchScale)*5;return this._pinchScale=e,this._chart.getChartStore().zoom(a,{x:o.x,y:o.y},"main"),!0}return!1},t.prototype.mouseWheelHortEvent=function(t,e){var i=this._chart.getChartStore();return i.startScroll(),i.scroll(e),!0},t.prototype.mouseWheelVertEvent=function(t,e){var i=this._findWidgetByEvent(t).widget,r=this._makeWidgetEvent(t,i);return(null==i?void 0:i.getName())===tE&&(this._chart.getChartStore().zoom(e,{x:r.x,y:r.y},"main"),!0)},t.prototype.mouseDownEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,r=e.widget;if(this._mouseDownWidget=r,null!==r){var n=this._makeWidgetEvent(t,r);switch(r.getName()){case tP:return r.dispatchEvent("mouseDownEvent",n);case tE:var o=i.getAxisComponent();if(!o.getAutoCalcTickFlag()){var a=o.getRange();this._prevYAxisRange=T({},a)}return this._startScrollCoordinate={x:n.x,y:n.y},this._chart.getChartStore().startScroll(),r.dispatchEvent("mouseDownEvent",n);case tS:return this._processXAxisScrollStartEvent(r,n);case tT:return this._processYAxisScaleStartEvent(r,n)}}return!1},t.prototype.mouseMoveEvent=function(t){var e,i,r,n=this._findWidgetByEvent(t),o=n.pane,a=n.widget,s=this._makeWidgetEvent(t,a);if(((null==(e=this._mouseMoveTriggerWidgetInfo.pane)?void 0:e.getId())!==(null==o?void 0:o.getId())||(null==(i=this._mouseMoveTriggerWidgetInfo.widget)?void 0:i.getName())!==(null==a?void 0:a.getName()))&&(null==a||a.dispatchEvent("mouseEnterEvent",s),null==(r=this._mouseMoveTriggerWidgetInfo.widget)||r.dispatchEvent("mouseLeaveEvent",s),this._mouseMoveTriggerWidgetInfo={pane:o,widget:a}),null!==a)switch(a.getName()){case tE:var l=a.dispatchEvent("mouseMoveEvent",s),u={x:s.x,y:s.y,paneId:null==o?void 0:o.getId()};return l?("pointer"!==a.getForceCursor()&&(u=void 0),a.setCursor("pointer")):a.setCursor("crosshair"),this._chart.getChartStore().setCrosshair(u),l;case tP:case tS:case tT:var l=a.dispatchEvent("mouseMoveEvent",s);return this._chart.getChartStore().setCrosshair(),l}return!1},t.prototype.pressedMouseMoveEvent=function(t){if(null!==this._mouseDownWidget&&this._mouseDownWidget.getName()===tP)return this._mouseDownWidget.dispatchEvent("pressedMouseMoveEvent",t);var e,i,r=this._findWidgetByEvent(t),n=r.pane,o=r.widget;if(null!==o&&(null==(e=this._mouseDownWidget)?void 0:e.getPane().getId())===(null==n?void 0:n.getId())&&(null==(i=this._mouseDownWidget)?void 0:i.getName())===o.getName()){var a=this._makeWidgetEvent(t,o);switch(o.getName()){case tE:var s=void 0,l=o.dispatchEvent("pressedMouseMoveEvent",a);return l||this._processMainScrollingEvent(o,a),l&&"pointer"!==o.getForceCursor()||(s={x:a.x,y:a.y,paneId:null==n?void 0:n.getId()}),this._chart.getChartStore().setCrosshair(s,{forceInvalidate:!0}),l;case tS:return this._processXAxisScrollingEvent(o,a);case tT:return this._processYAxisScalingEvent(o,a)}}return!1},t.prototype.mouseUpEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var r=this._makeWidgetEvent(t,e);switch(e.getName()){case tE:case tP:case tS:case tT:i=e.dispatchEvent("mouseUpEvent",r)}i&&this._chart.updatePane(1)}
1return this._mouseDownWidget=null,this._startScrollCoordinate=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,i},t.prototype.mouseClickEvent=function(t){var e=this._findWidgetByEvent(t).widget;if(null!==e){var i=this._makeWidgetEvent(t,e);return e.dispatchEvent("mouseClickEvent",i)}return!1},t.prototype.mouseRightClickEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var r=this._makeWidgetEvent(t,e);switch(e.getName()){case tE:case tS:case tT:i=e.dispatchEvent("mouseRightClickEvent",r)}i&&this._chart.updatePane(1)}return!1},t.prototype.mouseDoubleClickEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,r=e.widget;if(null!==r)switch(r.getName()){case tE:var n=this._makeWidgetEvent(t,r);return r.dispatchEvent("mouseDoubleClickEvent",n);case tT:var o=i.getAxisComponent();if(!o.getAutoCalcTickFlag())return o.setAutoCalcTickFlag(!0),this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0}),!0}return!1},t.prototype.mouseLeaveEvent=function(){return this._chart.getChartStore().setCrosshair(),!0},t.prototype.touchStartEvent=function(t){var e,i=this._findWidgetByEvent(t),r=i.pane,n=i.widget;if(null!==n){var o=this._makeWidgetEvent(t,n);switch(null==(e=o.preventDefault)||e.call(o),n.getName()){case tE:var a=this._chart.getChartStore();if(n.dispatchEvent("mouseDownEvent",o))return this._touchCancelCrosshair=!0,this._touchCoordinate=null,a.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;null!==this._flingScrollRequestId&&(R(this._flingScrollRequestId),this._flingScrollRequestId=null),this._flingStartTime=new Date().getTime();var s=r.getAxisComponent();if(!s.getAutoCalcTickFlag()){var l=s.getRange();this._prevYAxisRange=T({},l)}if(this._startScrollCoordinate={x:o.x,y:o.y},a.startScroll(),this._touchZoomed=!1,null!==this._touchCoordinate){var u=o.x-this._touchCoordinate.x,c=o.y-this._touchCoordinate.y;10>Math.sqrt(u*u+c*c)?(this._touchCoordinate={x:o.x,y:o.y},a.setCrosshair({x:o.x,y:o.y,paneId:null==r?void 0:r.getId()})):(this._touchCoordinate=null,this._touchCancelCrosshair=!0,a.setCrosshair())}return!0;case tS:return this._processXAxisScrollStartEvent(n,o);case tT:return this._processYAxisScaleStartEvent(n,o)}}return!1},t.prototype.touchMoveEvent=function(t){var e,i,r,n=this._findWidgetByEvent(t),o=n.pane,a=n.widget;if(null!==a){var s=this._makeWidgetEvent(t,a),l=a.getName(),u=this._chart.getChartStore();switch(l){case tE:if(a.dispatchEvent("pressedMouseMoveEvent",s))return null==(e=s.preventDefault)||e.call(s),u.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;return null!==this._touchCoordinate?(null==(i=s.preventDefault)||i.call(s),u.setCrosshair({x:s.x,y:s.y,paneId:null==o?void 0:o.getId()})):this._processMainScrollingEvent(a,s),!0;case tS:return null==(r=s.preventDefault)||r.call(s),this._processXAxisScrollingEvent(a,s);case tT:return this._processYAxisScalingEvent(a,s)}}return!1},t.prototype.touchEndEvent=function(t){var e=this,i=this._findWidgetByEvent(t).widget;if(null!==i){var r=this._makeWidgetEvent(t,i);switch(i.getName()){case tE:if(i.dispatchEvent("mouseUpEvent",r),null!==this._startScrollCoordinate){var n=new Date().getTime()-this._flingStartTime,o=(r.x-this._startScrollCoordinate.x)/(n>
10?n:1)*20;if(n<200&&Math.abs(o)>0){var a=this._chart.getChartStore(),s=function(){e._flingScrollRequestId=B(function(){a.startScroll(),a.scroll(o),1>Math.abs(o*=.975)?null!==e._flingScrollRequestId&&(R(e._flingScrollRequestId),e._flingScrollRequestId=null):s()})};s()}}return!0;case tS:case tT:i.dispatchEvent("mouseUpEvent",r)&&this._chart.updatePane(1)}this._startScrollCoordinate=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0}return!1},t.prototype.tapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,r=e.widget,n=!1;if(null!==r){var o=this._makeWidgetEvent(t,r),a=r.dispatchEvent("mouseClickEvent",o);if(r.getName()===tE){var s=this._makeWidgetEvent(t,r),l=this._chart.getChartStore();a?(this._touchCancelCrosshair=!0,this._touchCoordinate=null,l.setCrosshair(void 0,{notInvalidate:!0}),n=!0):(this._touchCancelCrosshair||this._touchZoomed||(this._touchCoordinate={x:s.x,y:s.y},l.setCrosshair({x:s.x,y:s.y,paneId:null==i?void 0:i.getId()},{notInvalidate:!0}),n=!0),this._touchCancelCrosshair=!1)}(n||a)&&this._chart.updatePane(1)}return n},t.prototype.doubleTapEvent=function(t){return this.mouseDoubleClickEvent(t)},t.prototype.longTapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,r=e.widget;if(null!==r&&r.getName()===tE){var n=this._makeWidgetEvent(t,r);return this._touchCoordinate={x:n.x,y:n.y},this._chart.getChartStore().setCrosshair({x:n.x,y:n.y,paneId:null==i?void 0:i.getId()}),!0}return!1},t.prototype._processMainScrollingEvent=function(t,e){var i;if(null!==this._startScrollCoordinate){var r=t.getPane().getAxisComponent();if(null!==this._prevYAxisRange&&!r.getAutoCalcTickFlag()&&r.scrollZoomEnabled){null==(i=e.preventDefault)||i.call(e);var n=this._prevYAxisRange,o=n.from,a=n.to,s=n.range,l=s*((r.reverse?this._startScrollCoordinate.y-e.y:e.y-this._startScrollCoordinate.y)/t.getBounding().height),u=o+l,c=a+l,h=r.valueToRealValue(u,{range:this._prevYAxisRange}),d=r.valueToRealValue(c,{range:this._prevYAxisRange}),p=r.realValueToDisplayValue(h,{range:this._prevYAxisRange}),g=r.realValueToDisplayValue(d,{range:this._prevYAxisRange});r.setRange({from:u,to:c,range:c-u,realFrom:h,realTo:d,realRange:d-h,displayFrom:p,displayTo:g,displayRange:g-p})}var f=e.x-this._startScrollCoordinate.x;this._chart.getChartStore().scroll(f)}},t.prototype._processXAxisScrollStartEvent=function(t,e){var i=t.dispatchEvent("mouseDownEvent",e);return i&&this._chart.updatePane(1),this._xAxisStartScaleCoordinate={x:e.x,y:e.y},this._xAxisStartScaleDistance=e.pageX,i},t.prototype._processXAxisScrollingEvent=function(t,e){var i=t.dispatchEvent("pressedMouseMoveEvent",e);if(i)this._chart.updatePane(1);else if(t.getPane().getAxisComponent().scrollZoomEnabled&&0!==this._xAxisStartScaleDistance){var r=this._xAxisStartScaleDistance/e.pageX;if(Number.isFinite(r)){var n=(r-this._xAxisScale)*10;this._xAxisScale=r,this._chart.getChartStore().zoom(n,this._xAxisStartScaleCoordinate,"xAxis")}}return i},t.prototype._processYAxisScaleStartEvent=function(t,e){var i=t.dispatchEvent("mouseDownEvent",e);i&&this._chart.updatePane(1);var r=t.getPane().getAxisComponent().getRange();return this._prevYAxisRange=T({},r),this._yAxisStartScaleDistance=e.pageY,i},t.prototype._processYAxisScalingEvent=function(t,e){var i,r=t.dispatchEvent("pressedMouseMoveEvent",e);if(r)this._chart.updatePane(1);else{var n=t.getPane().getAxisComponent();if(null!==this._prevYAxisRange&&n.scrollZoomEnabled&&0!==this._yAxisStartScaleDistance){null==(i=e.preventDefault)||i.call(e);var o=this._prevYAxisRange,a=o.from,s=o.to,l=o.range,u=l*(e.pageY/this._yAxisStartScaleDistance),c=(u-l)/2,h=a-c,d=s+c,p=n.valueToRealValue(h,{range:this._prevYAxisRange}),g=n.valueToRealValue(d,{range:this._prevYAxisRange}),f=n.realValueToDisplayValue(p,{range:this._prevYAxisRange}),v=n.realValueToDisplayValue(g,{range:this._prevYAxisRange});n.setRange({from:h,to:d,range:u,realFrom:p,realTo:g,realRange:g-p,displayFrom:f,displayTo:v,displayRange:v-f}),this._chart.layout({measureWidth:!0,update:!0,buildYAxisTick:!0})}}return r},t.prototype._findWidgetByEvent=function(t){var e,i,r,n,o=t.x,a=t.y,s=this._chart.getSeparatorPanes(),l=this._chart.getStyles().separator.size;try{for(var u=k(s),c=u.next();!c.done;c=u.next()){var d=c.value[1],p=d.getBounding(),g=p.top-Math.round((7-l)/2);if(o>=p.left&&o<=p.left+p.width&&a>=g&&a<=g+7)return{pane:d,widget:d.getWidget()}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}var f=this._chart.getDrawPanes(),v=null;try{for(var m=k(f),y=m.next();!y.done;y=m.next()){var _=y.value,p=_.getBounding();if(o>=p.left&&o<=p.left+p.width&&a>=p.top&&a<=p.top+p.height){v=_;break}}}catch(t){r={error:t}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}var x=null;if(null!==v){if(!h(x)){var b=v.getMainWidget(),w=b.getBounding();o>=w.left&&o<=w.left+w.width&&a>=w.top&&a<=w.top+w.height&&(x=b)}if(!h(x)){var C=v.getYAxisWidget();if(null!==C){var E=C.getBounding();o>=E.left&&o<=E.left+E.width&&a>=E.top&&a<=E.top+E.height&&(x=C)}}}return{pane:v,widget:x}},t.prototype._makeWidgetEvent=function(t,e){var i,r,n,o=null!=(i=null==e?void 0:e.getBounding())?i:null;return T(T({},t),{x:t.x-(null!=(r=null==o?void 0:o.left)?r:0),y:t.y-(null!=(n=null==o?void 0:o.top)?n:0)})},t.prototype.destroy=function(){this._container.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._event.destroy()},t}(),ey=function(){function t(t,e){this._chartBounding=F(),this._drawPanes=[],this._separatorPanes=new Map,this._layoutOptions={sort:!0,measureHeight:!0,measureWidth:!0,update:!0,buildYAxisTick:!1,cacheYAxisWidth:!1,forceBuildYAxisTick:!1},this._layoutPending=!1,this._cacheYAxisWidth={left:0,right:0}
1,this._initContainer(t),this._chartEvent=new em(this._chartContainer,this),this._chartStore=new tC(this,e),this._initPanes(e),this._layout()}return t.prototype._initContainer=function(t){this._container=t,this._chartContainer=V("div",{position:"relative",width:"100%",height:"100%",outline:"none",borderStyle:"none",cursor:"crosshair",boxSizing:"border-box",userSelect:"none",webkitUserSelect:"none",overflow:"hidden",msUserSelect:"none",MozUserSelect:"none",webkitTapHighlightColor:"transparent"}),this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer),this._cacheChartBounding()},t.prototype._cacheChartBounding=function(){this._chartBounding.width=Math.floor(this._chartContainer.clientWidth),this._chartBounding.height=Math.floor(this._chartContainer.clientHeight)},t.prototype._initPanes=function(t){var e,i=this,r=null!=(e=null==t?void 0:t.layout)?e:[{type:"candle"}],n=function(t){var e,r;if(!h(i._candlePane)){var n=null!=(e=t.options)?e:{};o(n,{id:tx}),i._candlePane=i._createPane(eo,tx,n),(null!=(r=t.content)?r:[]).forEach(function(t){i.createIndicator(t,!0,n)})}},a=function(t){if(!h(i._xAxisPane)){var e=i._createPane(eh,tw,null!=t?t:{});i._xAxisPane=e}};r.forEach(function(t){var e,r,o;switch(t.type){case"candle":n(t);break;case"indicator":var s=null!=(e=t.content)?e:[];if(s.length>0){var l=null!=(o=null==(r=t.options)?void 0:r.id)?o:null;h(l)&&(l=z(tb));var u=T(T({},t.options),{id:l});s.forEach(function(t){i.createIndicator(t,!0,u)})}break;case"xAxis":a(t.options)}}),n({}),a({order:Number.MAX_SAFE_INTEGER})},t.prototype._createPane=function(t,e,i){var r=new t(this,e,null!=i?i:{});return this._drawPanes.push(r),r},t.prototype._recalculatePaneHeight=function(t,e,i){if(0===i)return!1;var r=this._drawPanes.filter(function(e){var i=e.getId();return"normal"===e.getOptions().state&&i!==t.getId()&&i!==tw}),n=r.length;if(0===n)return!1;if(t.getId()!==tx&&h(this._candlePane)&&"normal"===this._candlePane.getOptions().state){var o=this._candlePane.getBounding().height;if(o>0){var a=this._candlePane.getOptions().minHeight,s=o+i;s<a&&(e-=o+i-(s=a)),this._candlePane.setBounding({height:s})}}else{var l=i,u=Math.floor(i/n);r.forEach(function(t,e){var i=t.getBounding().height,r=0;(r=e===n-1?i+l:i+u)<t.getOptions().minHeight&&(r=t.getOptions().minHeight),t.setBounding({height:r}),l-=r-i}),Math.abs(l)>0&&(e-=l)}return t.setBounding({height:e}),!0},t.prototype.getDrawPaneById=function(t){if(t===tx)return this._candlePane;if(t===tw)return this._xAxisPane;var e=this._drawPanes.find(function(e){return e.getId()===t});return null!=e?e:null},t.prototype.getContainer=function(){return this._container},t.prototype.getChartStore=function(){return this._chartStore},t.prototype.getXAxisPane=function(){return this._xAxisPane},t.prototype.getDrawPanes=function(){return this._drawPanes},t.prototype.getSeparatorPanes=function(){return this._separatorPanes},t.prototype.layout=function(t){var e,i,r,n,o,a,s,l=this;null!=(e=t.sort)&&e&&(this._layoutOptions.sort=t.sort),null!=(i=t.measureHeight)&&i&&(this._layoutOptions.measureHeight=t.measureHeight),null!=(r=t.measureWidth)&&r&&(this._layoutOptions.measureWidth=t.measureWidth),null!=(n=t.update)&&n&&(this._layoutOptions.update=t.update),null!=(o=t.buildYAxisTick)&&o&&(this._layoutOptions.buildYAxisTick=t.buildYAxisTick),null!=(a=t.cacheYAxisWidth)&&a&&(this._layoutOptions.cacheYAxisWidth=t.cacheYAxisWidth),null!=(s=t.buildYAxisTick)&&s&&(this._layoutOptions.forceBuildYAxisTick=t.forceBuildYAxisTick),this._layoutPending||(this._layoutPending=!0,Promise.resolve().then(function(t){l._layout(),l._layoutPending=!1}).catch(function(t){}))},t.prototype._layout=function(){var t=this,e=this._layoutOptions,i=e.sort,r=e.measureHeight,n=e.measureWidth,o=e.update,a=e.buildYAxisTick,s=e.cacheYAxisWidth,l=e.forceBuildYAxisTick;if(i){for(;h(this._chartContainer.firstChild);)this._chartContainer.removeChild(this._chartContainer.firstChild);this._separatorPanes.clear(),this._drawPanes.sort(function(t,e){return t.getOptions().order-e.getOptions().order});var u=null;this._drawPanes.forEach(function(e){if(e.getId()!==tw){if(h(u)){var i=new ep(t,"",u,e);t._chartContainer.appendChild(i.getContainer()),t._separatorPanes.set(e,i)}u=e}t._chartContainer.appendChild(e.getContainer())})}if(r){var c=this._chartBounding.height,d=this.getStyles().separator.size,p=this._xAxisPane.getAxisComponent().getAutoSize(),g=c-p;
1g<0&&(g=0),this._drawPanes.forEach(function(e){var i=e.getId();if(h(t._separatorPanes.get(e))&&(g-=d),i!==tw&&i!==tx&&e.getVisible()){var r=e.getBounding().height;r>g?(r=g,g=0):g-=r,e.setBounding({height:r})}}),this._candlePane.setBounding({height:Math.max(g,0)}),this._xAxisPane.setBounding({height:p});var f=0;this._drawPanes.forEach(function(e){var i=t._separatorPanes.get(e);h(i)&&(i.setBounding({height:d,top:f}),f+=d),e.setBounding({top:f}),f+=e.getBounding().height})}var v=n;if((a||l)&&this._drawPanes.forEach(function(t){var e=t.getAxisComponent().buildTicks(l);v||(v=e)}),v){var m=this._chartBounding.width,y=this.getStyles(),_=0,x=!0,b=0,w=!0;this._drawPanes.forEach(function(t){if(t.getId()!==tw){var e=t.getAxisComponent(),i=e.inside,r=e.getAutoSize();"left"===e.position?(_=Math.max(_,r),i&&(x=!1)):(b=Math.max(b,r),i&&(w=!1))}}),s&&(_=Math.max(this._cacheYAxisWidth.left,_),b=Math.max(this._cacheYAxisWidth.right,b)),this._cacheYAxisWidth.left=_,this._cacheYAxisWidth.right=b;var C=m,E=0,S=0;x&&(C-=_,E=_),w&&(C-=b,S=b),this._chartStore.setTotalBarSpace(C);var T={width:m},P={width:C,left:E,right:S},M={width:_},I={width:b},k=y.separator.fill,D={};D=k?T:P,this._drawPanes.forEach(function(e){var i;null==(i=t._separatorPanes.get(e))||i.setBounding(D),e.setBounding(T,P,M,I)})}o&&(this._xAxisPane.getAxisComponent().buildTicks(!0),this.updatePane(4)),this._layoutOptions={sort:!1,measureHeight:!1,measureWidth:!1,update:!1,buildYAxisTick:!1,cacheYAxisWidth:!1,forceBuildYAxisTick:!1}},t.prototype.updatePane=function(t,e){var i=this;if(h(e)){var r=this.getDrawPaneById(e);null==r||r.update(t)}else this._drawPanes.forEach(function(e){var r;e.update(t),null==(r=i._separatorPanes.get(e))||r.update(t)})},t.prototype.getDom=function(t,e){if(!h(t))return this._chartContainer;var i,r,n=this.getDrawPaneById(t);if(h(n))switch(null!=e?e:"root"){case"root":return n.getContainer();case"main":return n.getMainWidget().getContainer();case"yAxis":return null!=(r=null==(i=n.getYAxisWidget())?void 0:i.getContainer())?r:null}return null},t.prototype.getSize=function(t,e){if(!h(t))return this._chartBounding;var i,r,n=this.getDrawPaneById(t);if(h(n))switch(null!=e?e:"root"){case"root":return n.getBounding();case"main":return n.getMainWidget().getBounding();case"yAxis":return null!=(r=null==(i=n.getYAxisWidget())?void 0:i.getBounding())?r:null}return null},t.prototype._resetYAxisAutoCalcTickFlag=function(){this._drawPanes.forEach(function(t){t.getAxisComponent().setAutoCalcTickFlag(!0)})},t.prototype.setSymbol=function(t){t!==this.getSymbol()&&(this._resetYAxisAutoCalcTickFlag(),this._chartStore.setSymbol(t))},t.prototype.getSymbol=function(){return this._chartStore.getSymbol()},t.prototype.setPeriod=function(t){t!==this.getPeriod()&&(this._resetYAxisAutoCalcTickFlag(),this._chartStore.setPeriod(t))},t.prototype.getPeriod=function(){return this._chartStore.getPeriod()},t.prototype.setStyles=function(t){var e=this;this._setOptions(function(){e._chartStore.setStyles(t)})},t.prototype.getStyles=function(){return this._chartStore.getStyles()},t.prototype.setFormatter=function(t){var e=this;this._setOptions(function(){e._chartStore.setFormatter(t)})},t.prototype.getFormatter=function(){return this._chartStore.getFormatter()},t.prototype.setLocale=function(t){var e=this;this._setOptions(function(){e._chartStore.setLocale(t)})},t.prototype.getLocale=function(){return this._chartStore.getLocale()},t.prototype.setTimezone=function(t){var e=this;this._setOptions(function(){e._chartStore.setTimezone(t)})},t.prototype.getTimezone=function(){return this._chartStore.getTimezone()},t.prototype.setThousandsSeparator=function(t){var e=this;this._setOptions(function(){e._chartStore.setThousandsSeparator(t)})},t.prototype.getThousandsSeparator=function(){return this._chartStore.getThousandsSeparator()},t.prototype.setDecimalFold=function(t){var e=this;this._setOptions(function(){e._chartStore.setDecimalFold(t)})},t.prototype.getDecimalFold=function(){return this._chartStore.getDecimalFold()},t.prototype._setOptions=function(t){t(),this.layout({measureHeight:!0,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0})},t.prototype.setOffsetRightDistance=function(t){this._chartStore.setOffsetRightDistance(t,!0)},t.prototype.getOffsetRightDistance=function(){return this._chartStore.getOffsetRightDistance()}
1,t.prototype.setMaxOffsetLeftDistance=function(t){t<0?n("setMaxOffsetLeftDistance","distance","distance must greater than zero!!!"):this._chartStore.setMaxOffsetLeftDistance(t)},t.prototype.setMaxOffsetRightDistance=function(t){t<0?n("setMaxOffsetRightDistance","distance","distance must greater than zero!!!"):this._chartStore.setMaxOffsetRightDistance(t)},t.prototype.setLeftMinVisibleBarCount=function(t){t<0?n("setLeftMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.setLeftMinVisibleBarCount(Math.ceil(t))},t.prototype.setRightMinVisibleBarCount=function(t){t<0?n("setRightMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.setRightMinVisibleBarCount(Math.ceil(t))},t.prototype.setBarSpace=function(t){this._chartStore.setBarSpace(t)},t.prototype.getBarSpace=function(){return this._chartStore.getBarSpace()},t.prototype.getVisibleRange=function(){return this._chartStore.getVisibleRange()},t.prototype.resetData=function(){this._chartStore.resetData()},t.prototype.getDataList=function(){return this._chartStore.getDataList()},t.prototype.setDataLoader=function(t){this._resetYAxisAutoCalcTickFlag(),this._chartStore.setDataLoader(t)},t.prototype.createIndicator=function(t,e,i){var r=p(t)?{name:t}:t;if(null===tl(r.name))return n("createIndicator","value","indicator not supported, you may need to use registerIndicator to add one!!!"),null;var o=null!=i?i:{};if(p(o.id)||(o.id=z(tb)),p(r.id)||(r.id=z(r.name)),this._chartStore.addIndicator(r,o.id,null!=e&&e)){var a=!1;return h(this.getDrawPaneById(o.id))||(this._createPane(en,o.id,o),null!=o.height||(o.height=100),a=!0),this.setPaneOptions(o),this.layout({sort:a,measureHeight:!0,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0}),r.id}return null},t.prototype.overrideIndicator=function(t){return this._chartStore.overrideIndicator(t)},t.prototype.getIndicators=function(t){return this._chartStore.getIndicatorsByFilter(null!=t?t:{})},t.prototype.removeIndicator=function(t){var e=this,i=this._chartStore.removeIndicator(null!=t?t:{});if(i){var r=!1,n=[];this._drawPanes.forEach(function(t){var e=t.getId();e!==tx&&e!==tw&&n.push(e)}),n.forEach(function(t){if(!e._chartStore.hasIndicators(t)){var i=e._drawPanes.findIndex(function(e){return e.getId()===t}),n=e._drawPanes[i];h(n)&&(r=!0,e._recalculatePaneHeight(n,0,n.getBounding().height),e._drawPanes.splice(i,1),n.destroy())}}),2===this._drawPanes.length&&(this._candlePane.setVisible(!0),this._candlePane.setBounding({height:this._chartBounding.height-this._xAxisPane.getBounding().height})),this.layout({sort:r,measureHeight:r,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0})}return i},t.prototype.createOverlay=function(t){var e=this,i=[],r=[],n=function(t){h(t.paneId)&&null!==e.getDrawPaneById(t.paneId)?r.push(!0):(t.paneId=tx,r.push(!1)),i.push(t)};p(t)?n({name:t}):s(t)?t.forEach(function(t){n(p(t)?{name:t}:t)}):n(t);var o=this._chartStore.addOverlays(i,r);return s(t)?o:o[0]},t.prototype.getOverlays=function(t){return this._chartStore.getOverlaysByFilter(null!=t?t:{})},t.prototype.overrideOverlay=function(t){return this._chartStore.overrideOverlay(t)},t.prototype.removeOverlay=function(t){return this._chartStore.removeOverlay(null!=t?t:{})},t.prototype.setPaneOptions=function(t){var e,i,r,n=this,o=!1,a=!1,s=h(t.id),l=this;try{for(var u=k(this._drawPanes),d=u.next();!d.done;d=u.next()){var p=d.value,g=function(e){var i=e.getId();if(s&&t.id===i||!s){if(i!==tw){if(c(t.height)&&t.height>0){var u=Math.max(Math.max(null!=(r=t.minHeight)?r:e.getOptions().minHeight,0),t.height);a=!0,o=!0,e.setOriginalBounding({height:u}),l._recalculatePaneHeight(e,u,-u)}if(h(t.state)&&e.getOptions().state!==t.state){o=!0,a=!0;var d=t.state;switch(d){case"maximize":if(!h(l._drawPanes.find(function(t){var e=t.getId();return"maximize"===t.getOptions().state&&e!==tw}))){"normal"===e.getOptions().state&&e.setOriginalBounding({height:e.getBounding().height}),e.setOptions({state:d});var p=l._chartBounding.height;e.setBounding({height:p-l._xAxisPane.getBounding().height}
1),l._drawPanes.forEach(function(t){var e;t.getId()!==tw&&t.getId()!==i&&(t.setBounding({height:t.getOriginalBounding().height}),t.setVisible(!1),null==(e=n._separatorPanes.get(t))||e.setVisible(!1))})}break;case"minimize":var u=e.getBounding().height,g=e.getOptions().state,f=u-30;"maximize"===g&&(f=e.getOriginalBounding().height-30),l._recalculatePaneHeight(e,30,f)&&("normal"===g&&e.setOriginalBounding({height:u}),e.setOptions({state:d})),l._drawPanes.forEach(function(t){var e;t.getId()!==tw&&(t.setVisible(!0),null==(e=n._separatorPanes.get(t))||e.setVisible(!0))});break;default:var u=e.getOriginalBounding().height;l._recalculatePaneHeight(e,u,e.getBounding().height-u)&&e.setOptions({state:d}),l._drawPanes.forEach(function(t){var e;t.getId()!==tw&&(t.setVisible(!0),null==(e=n._separatorPanes.get(t))||e.setVisible(!0))})}}}h(t.axis)&&(a=!0);var v=T({},t);if(delete v.state,e.setOptions(v),i===t.id)return"break"}}(p);if("break"===g)break}}catch(t){e={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}a&&this.layout({measureHeight:o,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0})},t.prototype.getPaneOptions=function(t){var e;if(h(t)){var i=this.getDrawPaneById(t);return null!=(e=null==i?void 0:i.getOptions())?e:null}return this._drawPanes.map(function(t){return t.getOptions()})},t.prototype.setZoomEnabled=function(t){this._chartStore.setZoomEnabled(t)},t.prototype.isZoomEnabled=function(){return this._chartStore.isZoomEnabled()},t.prototype.setZoomAnchor=function(t){this._chartStore.setZoomAnchor(t)},t.prototype.getZoomAnchor=function(){return this._chartStore.getZoomAnchor()},t.prototype.setScrollEnabled=function(t){this._chartStore.setScrollEnabled(t)},t.prototype.isScrollEnabled=function(){return this._chartStore.isScrollEnabled()},t.prototype.scrollByDistance=function(t,e){var i=this,r=c(e)&&e>0?e:0;if(this._chartStore.startScroll(),r>0){var n=new L({duration:r});n.doFrame(function(e){i._chartStore.scroll(e/r*t)}),n.start()}else this._chartStore.scroll(t)},t.prototype.scrollToRealTime=function(t){var e=this._chartStore.getBarSpace().bar,i=this._chartStore.getLastBarRightSideDiffBarCount()-this._chartStore.getInitialOffsetRightDistance()/e;this.scrollByDistance(i*e,t)},t.prototype.scrollToDataIndex=function(t,e){var i=(this._chartStore.getLastBarRightSideDiffBarCount()+(this.getDataList().length-1-t))*this._chartStore.getBarSpace().bar;this.scrollByDistance(i,e)},t.prototype.scrollToTimestamp=function(t,e){var i=Y(this.getDataList(),"timestamp",t);this.scrollToDataIndex(i,e)},t.prototype.zoomAtCoordinate=function(t,e,i){var r=this,n=c(i)&&i>0?i:0,o=this._chartStore.getBarSpace().bar,a=o*t-o;if(n>0){var s=0,l=new L({duration:n});l.doFrame(function(t){var i=t/n*a,o=(i-s)/r._chartStore.getBarSpace().bar*10;r._chartStore.zoom(o,null!=e?e:null,"main"),s=i}),l.start()}else this._chartStore.zoom(a/o*10,null!=e?e:null,"main")},t.prototype.zoomAtDataIndex=function(t,e,i){var r=this._chartStore.dataIndexToCoordinate(e);this.zoomAtCoordinate(t,{x:r,y:0},i)},t.prototype.zoomAtTimestamp=function(t,e,i){var r=Y(this.getDataList(),"timestamp",e);this.zoomAtDataIndex(t,r,i)},t.prototype.convertToPixel=function(t,e){var i,r=this,n=null!=e?e:{},o=n.paneId,a=void 0===o?tx:o,l=n.absolute,u=void 0!==l&&l,h=[];if(a!==tw){var d=this.getDrawPaneById(a);if(null!==d){var p=d.getBounding(),g=[].concat(t),f=this._xAxisPane.getAxisComponent(),v=d.getAxisComponent();h=g.map(function(t){var e={},i=t.dataIndex;if(c(t.timestamp)&&(i=r._chartStore.timestampToDataIndex(t.timestamp)),c(i)&&(e.x=f.convertToPixel(i)),c(t.value)){var n=v.convertToPixel(t.value);e.y=u?p.top+n:n}return e})}}return s(t)?h:null!=(i=h[0])?i:{}},t.prototype.convertFromPixel=function(t,e){var i,r=this,n=null!=e?e:{},o=n.paneId,a=void 0===o?tx:o,l=n.absolute,u=void 0!==l&&l,h=[];if(a!==tw){var d=this.getDrawPaneById(a);if(null!==d){var p=d.getBounding(),g=[].concat(t),f=this._xAxisPane.getAxisComponent(),v=d.getAxisComponent();h=g.map(function(t){var e,i={};if(c(t.x)){var n=f.convertFromPixel(t.x);i.dataIndex=n,i.timestamp=null!=(e=r._chartStore.dataIndexToTimestamp(n))?e:void 0}if(c(t.y)){var o=u?t.y-p.top:t.y;i.value=v.convertFromPixel(o)}return i})}}return s(t)?h:null!=(i=h[0])?i:{}},t.prototype.executeAction=function(t,e){if("onCrosshairChange"===t){var i=T({},e);null!=i.paneId||(i.paneId=tx),this._chartStore.setCrosshair(i,{notExecuteAction:!0}
1)}},t.prototype.subscribeAction=function(t,e){this._chartStore.subscribeAction(t,e)},t.prototype.unsubscribeAction=function(t,e){this._chartStore.unsubscribeAction(t,e)},t.prototype.getConvertPictureUrl=function(t,e,i){var r=this,n=this._chartBounding,o=n.width,a=n.height,s=V("canvas",{width:"".concat(o,"px"),height:"".concat(a,"px"),boxSizing:"border-box"}),l=s.getContext("2d"),u=b(s);s.width=o*u,s.height=a*u,l.scale(u,u),l.fillStyle=null!=i?i:"#FFFFFF",l.fillRect(0,0,o,a);var c=null!=t&&t;return this._drawPanes.forEach(function(t){var e=r._separatorPanes.get(t);if(h(e)){var i=e.getBounding();l.drawImage(e.getImage(c),i.left,i.top,i.width,i.height)}var n=t.getBounding();l.drawImage(t.getImage(c),0,n.top,o,n.height)}),s.toDataURL("image/".concat(null!=e?e:"jpeg"))},t.prototype.resize=function(){this._cacheChartBounding(),this.layout({measureHeight:!0,measureWidth:!0,update:!0,buildYAxisTick:!0,forceBuildYAxisTick:!0})},t.prototype.destroy=function(){this._chartEvent.destroy(),this._drawPanes.forEach(function(t){t.destroy()}),this._drawPanes=[],this._separatorPanes.clear(),this._chartStore.destroy(),this._container.removeChild(this._chartContainer)},t}(),e_=new Map,ex=1;function eb(t,e){r("%câ¤ï¸ Welcome to klinecharts. Version is 10.0.0-beta1","border-radius:4px;border:dashed 1px #1677FF;line-height:70px;padding:0 20px;margin:16px 0;font-size:14px;color:#1677FF;","","","","");var i=null;if(null===(i=p(t)?document.getElementById(t):t))return r("%c\uD83D\uDE1F klinecharts error%c %s%s%s","padding:3px 4px;border-radius:2px;color:#ffffff;background-color:#F92855;","color:#F92855;","","","The chart cannot be initialized correctly. Please check the parameters. The chart container cannot be null and child elements need to be added!!!"),null;var o=e_.get(i.id);if(h(o))return n("","","The chart has been initialized on the domï¼ï¼ï¼"),o;var a="k_line_chart_".concat(ex++);return(o=new ey(i,e)).id=a,i.setAttribute("k-line-chart-id",a),e_.set(a,o),o}function ew(t){var e,i,r=null;if(t instanceof ey)r=t.id;else{var n=null;r=null!=(e=null==(n=p(t)?document.getElementById(t):t)?void 0:n.getAttribute("k-line-chart-id"))?e:null}null!==r&&(null==(i=e_.get(r))||i.destroy(),e_.delete(r))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.