| 12 |
- webpackJsonp([18],{"2lDe":function(t,e){},"30KW":function(t,e,i){var n=i("kM2E"),o=i("7KvD").isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},AMV0:function(t,e,i){t.exports={default:i("k2Ib"),__esModule:!0}},OhnE:function(t,e,i){"use strict";(function(t){i.d(e,"a",function(){return Ci}),i.d(e,"b",function(){return xi});var n=function(t,e){return(n=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 o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var r,a,s,l,c,u,h,d,p,v=function(){return(v=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function g(t,e,i,n){return new(i||(i=Promise))(function(o,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,s)}l((n=n.apply(t,e||[])).next())})}function f(t,e){var i,n,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[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){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(r=0)),r;)try{if(i=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,n=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=(o=r.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t],n=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function m(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,r=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return a}function y(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,function(t){t.Dashed="dashed",t.Solid="solid"}(r||(r={})),function(t){t.Stroke="stroke",t.Fill="fill",t.StrokeFill="stroke_fill"}(a||(a={})),function(t){t.Always="always",t.FollowCross="follow_cross",t.None="none"}(s||(s={})),function(t){t.Standard="standard",t.Rect="rect"}(l||(l={})),function(t){t.Left="left",t.Middle="middle",t.Right="right"}(c||(c={})),function(t){t.Fixed="fixed",t.Pointer="pointer"}(u||(u={})),function(t){t.CandleSolid="candle_solid",t.CandleStroke="candle_stroke",t.CandleUpStroke="candle_up_stroke",t.CandleDownStroke="candle_down_stroke",t.Ohlc="ohlc",t.Area="area"}(h||(h={})),function(t){t.Left="left",t.Right="right"}(d||(d={})),function(t){t.Normal="normal",t.Percentage="percentage",t.Log="log"}(p||(p={}));var x="#F92855",C="rgba(249, 40, 85, .7)",b="#2DC08E",S="rgba(45, 192, 142, .7)",w="#888888",E="#FFFFFF",T="#1677FF",I="#76808F",P="#DDDDDD";function k(t){return"rgba(22, 119, 255, ".concat(t,")")}function D(){return{show:!0,size:"auto",axisLine:{show:!0,color:P,size:1},tickText:{show:!0,color:I,size:12,family:"Helvetica Neue",weight:"normal",marginStart:4,marginEnd:4},tickLine:{show:!0,size:1,length:3,color:P}}}function M(){return{grid:function(){function t(){return{show:!0,size:1,color:"#EDEDED",style:r.Dashed,dashedValue:[2,2]}}return{show:!0,horizontal:t(),vertical:t()}}(),candle:(i={show:!0,color:I,textOffset:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"},{type:h.CandleSolid,bar:{upColor:b,downColor:x,noChangeColor:w,upBorderColor:b,downBorderColor:x,noChangeBorderColor:w,upWickColor:b,downWickColor:x,noChangeWickColor:w},area:{lineSize:2,lineColor:T,smooth:!1,value:"close",backgroundColor:[{offset:0,color:k(.01)},{offset:1,color:k(.2)}],point:{show:!0,color:T,radius:4,rippleColor:k(.3),rippleRadius:8,animation:!0,animationDuration:1e3}},priceMark:{show:!0,high:v({},i),low:v({},i),last:{show:!0,upColor:b,downColor:x,noChangeColor:w,line:{show:!0,style:r.Dashed,dashedValue:[4,4],size:1},text:{show:!0,style:a.Fill,size:12,paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderColor:"transparent",borderStyle:r.Solid,borderSize:0,borderDashedValue:[2,2],color:E,family:"Helvetica Neue",weight:"normal",borderRadius:2}}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:s.Always,showType:l.Standard,custom:[{title:"time",value:"{time}"},{title:"open",value:"{open}"},{title:"high",value:"{high}"},{title:"low",value:"{low}"},{title:"close",value:"{close}"},{title:"volume",value:"{volume}"}],defaultValue:"n/a",rect:{position:u.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"},text:{size:12,family:"Helvetica Neue",weight:"normal",color:I,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}),indicator:(e=["#FF9600","#935EBD",T,"#E11D74","#01C5C4"].map(function(t){return{style:r.Solid,smooth:!1,size:1,dashedValue:[2,2],color:t}}),{ohlc:{upColor:S,downColor:C,noChangeColor:w},bars:[{style:a.Fill,borderStyle:r.Solid,borderSize:1,borderDashedValue:[2,2],upColor:S,downColor:C,noChangeColor:w}],lines:e,circles:[{style:a.Fill,borderStyle:r.Solid,borderSize:1,borderDashedValue:[2,2],upColor:S,downColor:C,noChangeColor:w}],lastValueMark:{show:!1,text:{show:!1,style:a.Fill,color:E,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:r.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:s.Always,showType:l.Standard,showName:!0,showParams:!0,defaultValue:"n/a",text:{size:12,family:"Helvetica Neue",weight:"normal",color:I,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}),xAxis:D(),yAxis:(t=D(),t.type=p.Normal,t.position=d.Right,t.inside=!1,t.reverse=!1,t),separator:{size:1,color:P,fill:!0,activeBackgroundColor:k(.08)},crosshair:function(){function t(){return{show:!0,line:{show:!0,style:r.Dashed,dashedValue:[4,2],size:1,color:I},text:{show:!0,style:a.Fill,color:E,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:r.Solid,borderDashedValue:[2,2],borderSize:1,borderColor:I,borderRadius:2,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:I}}}return{show:!0,horizontal:t(),vertical:t()}}(),overlay:function(){var t=k(.35),e=k(.25);function i(){return{style:a.Fill,color:E,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:r.Solid,borderDashedValue:[2,2],borderSize:1,borderRadius:2,borderColor:T,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:T}}return{point:{color:T,borderColor:t,borderSize:1,radius:5,activeColor:T,activeBorderColor:t,activeBorderSize:3,activeRadius:5},line:{style:r.Solid,smooth:!1,color:T,size:1,dashedValue:[2,2]},rect:{style:a.Fill,color:e,borderColor:T,borderSize:1,borderRadius:0,borderStyle:r.Solid,borderDashedValue:[2,2]},polygon:{style:a.Fill,color:T,borderColor:T,borderSize:1,borderStyle:r.Solid,borderDashedValue:[2,2]},circle:{style:a.Fill,color:e,borderColor:T,borderSize:1,borderStyle:r.Solid,borderDashedValue:[2,2]},arc:{style:r.Solid,color:T,size:1,dashedValue:[2,2]},text:i(),rectText:i()}}()};var t,e,i}var A="development"===t.env.NODE_ENV;function L(t,e,i,n,o,r){if(A){var a=""!==n?"Call api `".concat(n,"`").concat(""!==o||""!==r?", ":"."):"",s=""!==o?"invalid parameter `".concat(o,"`").concat(""!==r?", ":"."):"",l=""!==r?r:"";console.log(t,e,i,a,s,l)}}function F(t,e,i){L("%c😑 klinecharts warning%c %s%s%s","padding:3px 4px;border-radius:2px;color:#ffffff;background-color:#FF9600","color:#FF9600",t,e,null!==i&&void 0!==i?i:"")}function R(t,e){if(V(t)||V(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=t[i],o=e[i];V(o)&&V(n)?R(n,o):z(e[i])&&(t[i]=B(e[i]))}}function B(t){if(!V(t))return t;var e;for(var i in e=O(t)?[]:{},t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];V(n)?e[i]=B(n):e[i]=n}return e}function O(t){return"[object Array]"===Object.prototype.toString.call(t)}function N(t){return"function"==typeof t}function V(t){return"object"==typeof t&&z(t)}function W(t){return"number"==typeof t&&!isNaN(t)}function z(t){return null!==t&&void 0!==t}function Y(t){return"boolean"==typeof t}function K(t){return"string"==typeof t}var H,X,$=/\\(\\)?/g,G=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");function j(t,e,i){if(z(t)){var n=[];e.replace(G,function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=t;return z(e[1])?o=e[2].replace($,"$1"):z(e[0])&&(o=e[0].trim()),n.push(o),""});for(var o=t,r=0,a=n.length;z(o)&&r<a;)o=null===o||void 0===o?void 0:o[n[r++]];return z(o)?o:null!==i&&void 0!==i?i:"--"}return null!==i&&void 0!==i?i:"--"}function q(t,e,i){var n={};return t.formatToParts(new Date(e)).forEach(function(t){var e=t.type,i=t.value;switch(e){case"year":n.YYYY=i;break;case"month":n.MM=i;break;case"day":n.DD=i;break;case"hour":n.HH="24"===i?"00":i;break;case"minute":n.mm=i;break;case"second":n.ss=i}}),i.replace(/YYYY|MM|DD|HH|mm|ss/g,function(t){return n[t]})}function Z(t,e){var i=+t;return W(i)?i.toFixed(null!==e&&void 0!==e?e:2):"".concat(t)}function U(t){var e=+t;if(W(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 Q(t,e){var i="".concat(t);if(0===e.length)return i;if(i.includes(".")){var n=i.split(".");return"".concat(n[0].replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)}),".").concat(n[1])}return i.replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)})}function J(t,e){var i="".concat(t);if(new RegExp("\\.0{"+e+",}[1-9][0-9]*$").test(i)){var n=i.split("."),o=n[n.length-1],r=o.match(/0*/);if(z(r)){var a=r[0].length;return n[n.length-1]=o.replace(/0*/,"0{".concat(a,"}")),n.join(".")}}return i}function tt(t){var e,i,n;return null!==(n=null===(i=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===i?void 0:i.devicePixelRatio)&&void 0!==n?n:1}function et(t,e,i){return"".concat(null!==e&&void 0!==e?e:"normal"," ").concat(null!==t&&void 0!==t?t:12,"px ").concat(null!==i&&void 0!==i?i:"Helvetica Neue")}function it(t,e,i,n){if(!z(H)){var o=document.createElement("canvas"),r=tt(o);(H=o.getContext("2d")).scale(r,r)}return H.font=et(e,i,n),Math.round(H.measureText(t).width)}!function(t){t.OnDataReady="onDataReady",t.OnZoom="onZoom",t.OnScroll="onScroll",t.OnVisibleRangeChange="onVisibleRangeChange",t.OnTooltipIconClick="onTooltipIconClick",t.OnCrosshairChange="onCrosshairChange",t.OnCandleBarClick="onCandleBarClick",t.OnPaneDrag="onPaneDrag"}(X||(X={}));var nt,ot,rt=function(){function t(){this._callbacks=[]}return t.prototype.subscribe=function(t){var e;(null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1)<0&&this._callbacks.push(t)},t.prototype.unsubscribe=function(t){var e;if(N(t)){var i=null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1;i>-1&&this._callbacks.splice(i,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 at(t,e,i,n,o){var r,a=e.result,s=e.figures,l=e.styles,c=j(l,"circles",n.circles),u=c.length,h=j(l,"bars",n.bars),d=h.length,p=j(l,"lines",n.lines),g=p.length,f=0,m=0,_=0,y=0;s.forEach(function(s){var l;switch(s.type){case"circle":y=f;var x=c[f%u];r=v(v({},x),{color:x.noChangeColor}),f++;break;case"bar":y=m;var C=h[m%d];r=v(v({},C),{color:C.noChangeColor}),m++;break;case"line":y=_,r=p[_%g],_++}if(z(r)){var b={prev:{kLineData:t[i-1],indicatorData:a[i-1]},current:{kLineData:t[i],indicatorData:a[i]},next:{kLineData:t[i+1],indicatorData:a[i+1]}},S=null===(l=s.styles)||void 0===l?void 0:l.call(s,b,e,n);o(s,v(v({},r),S),y)}})}!function(t){t.Init="init",t.Forward="forward",t.Backward="backward"}(nt||(nt={})),function(t){t.Normal="normal",t.Price="price",t.Volume="volume"}(ot||(ot={}));var st,lt=function(){function t(t){this.result=[],this._precisionFlag=!1;var e=t.name,i=t.shortName,n=t.series,o=t.calcParams,r=t.figures,a=t.precision,s=t.shouldOhlc,l=t.shouldFormatBigNumber,c=t.visible,u=t.zLevel,h=t.minValue,d=t.maxValue,p=t.styles,v=t.extendData,g=t.regenerateFigures,f=t.createTooltipDataSource,m=t.draw;this.name=e,this.shortName=null!==i&&void 0!==i?i:e,this.series=null!==n&&void 0!==n?n:ot.Normal,this.precision=null!==a&&void 0!==a?a:4,this.calcParams=null!==o&&void 0!==o?o:[],this.figures=null!==r&&void 0!==r?r:[],this.shouldOhlc=null!==s&&void 0!==s&&s,this.shouldFormatBigNumber=null!==l&&void 0!==l&&l,this.visible=null===c||void 0===c||c,this.zLevel=null!==u&&void 0!==u?u:0,this.minValue=null!==h&&void 0!==h?h:null,this.maxValue=null!==d&&void 0!==d?d:null,this.styles=B(null!==p&&void 0!==p?p:{}),this.extendData=v,this.regenerateFigures=null!==g&&void 0!==g?g:null,this.createTooltipDataSource=null!==f&&void 0!==f?f:null,this.draw=null!==m&&void 0!==m?m:null}return t.prototype.setShortName=function(t){return this.shortName!==t&&(this.shortName=t,!0)},t.prototype.setSeries=function(t){return this.series!==t&&(this.series=t,!0)},t.prototype.setPrecision=function(t,e){var i=null!==e&&void 0!==e&&e,n=Math.floor(t);return!(!(n!==this.precision&&t>=0)||i&&(!i||this._precisionFlag))&&(this.precision=n,i||(this._precisionFlag=!0),!0)},t.prototype.setCalcParams=function(t){var e,i;return this.calcParams=t,this.figures=null!==(i=null===(e=this.regenerateFigures)||void 0===e?void 0:e.call(this,t))&&void 0!==i?i:this.figures,!0},t.prototype.setShouldOhlc=function(t){return this.shouldOhlc!==t&&(this.shouldOhlc=t,!0)},t.prototype.setShouldFormatBigNumber=function(t){return this.shouldFormatBigNumber!==t&&(this.shouldFormatBigNumber=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setStyles=function(t){return R(this.styles,t),!0},t.prototype.setExtendData=function(t){return this.extendData!==t&&(this.extendData=t,!0)},t.prototype.setFigures=function(t){return this.figures!==t&&(this.figures=t,!0)},t.prototype.setMinValue=function(t){return this.minValue!==t&&(this.minValue=t,!0)},t.prototype.setMaxValue=function(t){return this.maxValue!==t&&(this.maxValue=t,!0)},t.prototype.setRegenerateFigures=function(t){return this.regenerateFigures!==t&&(this.regenerateFigures=t,!0)},t.prototype.setCreateTooltipDataSource=function(t){return this.createTooltipDataSource!==t&&(this.createTooltipDataSource=t,!0)},t.prototype.setDraw=function(t){return this.draw!==t&&(this.draw=t,!0)},t.prototype.calcIndicator=function(t){return g(this,void 0,void 0,function(){var e;return f(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){return function(t){function i(){return t.call(this,e)||this}return o(i,t),i.prototype.calc=function(t,i){return e.calc(t,i)},i}(t)},t}();!function(t){t.Normal="normal",t.WeakMagnet="weak_magnet",t.StrongMagnet="strong_magnet"}(st||(st={}));var ct,ut=1,ht=function(){function t(t){this.currentStep=ut,this.points=[],this._prevPressedPoint=null,this._prevPressedPoints=[];var e=t.mode,i=t.modeSensitivity,n=t.extendData,o=t.styles,r=t.name,a=t.totalStep,s=t.lock,l=t.visible,c=t.zLevel,u=t.needDefaultPointFigure,h=t.needDefaultXAxisFigure,d=t.needDefaultYAxisFigure,p=t.createPointFigures,v=t.createXAxisFigures,g=t.createYAxisFigures,f=t.performEventPressedMove,m=t.performEventMoveForDrawing,_=t.onDrawStart,y=t.onDrawing,x=t.onDrawEnd,C=t.onClick,b=t.onDoubleClick,S=t.onRightClick,w=t.onPressedMoveStart,E=t.onPressedMoving,T=t.onPressedMoveEnd,I=t.onMouseEnter,P=t.onMouseLeave,k=t.onRemoved,D=t.onSelected,M=t.onDeselected;this.name=r,this.totalStep=!W(a)||a<2?1:a,this.lock=null!==s&&void 0!==s&&s,this.visible=null===l||void 0===l||l,this.zLevel=null!==c&&void 0!==c?c:0,this.needDefaultPointFigure=null!==u&&void 0!==u&&u,this.needDefaultXAxisFigure=null!==h&&void 0!==h&&h,this.needDefaultYAxisFigure=null!==d&&void 0!==d&&d,this.mode=null!==e&&void 0!==e?e:st.Normal,this.modeSensitivity=null!==i&&void 0!==i?i:8,this.extendData=n,this.styles=B(null!==o&&void 0!==o?o:{}),this.createPointFigures=null!==p&&void 0!==p?p:null,this.createXAxisFigures=null!==v&&void 0!==v?v:null,this.createYAxisFigures=null!==g&&void 0!==g?g:null,this.performEventPressedMove=null!==f&&void 0!==f?f:null,this.performEventMoveForDrawing=null!==m&&void 0!==m?m:null,this.onDrawStart=null!==_&&void 0!==_?_:null,this.onDrawing=null!==y&&void 0!==y?y:null,this.onDrawEnd=null!==x&&void 0!==x?x:null,this.onClick=null!==C&&void 0!==C?C:null,this.onDoubleClick=null!==b&&void 0!==b?b:null,this.onRightClick=null!==S&&void 0!==S?S:null,this.onPressedMoveStart=null!==w&&void 0!==w?w:null,this.onPressedMoving=null!==E&&void 0!==E?E:null,this.onPressedMoveEnd=null!==T&&void 0!==T?T:null,this.onMouseEnter=null!==I&&void 0!==I?I:null,this.onMouseLeave=null!==P&&void 0!==P?P:null,this.onRemoved=null!==k&&void 0!==k?k:null,this.onSelected=null!==D&&void 0!==D?D:null,this.onDeselected=null!==M&&void 0!==M?M:null}return t.prototype.setId=function(t){return!K(this.id)&&(this.id=t,!0)},t.prototype.setGroupId=function(t){return!K(this.groupId)&&(this.groupId=t,!0)},t.prototype.setPaneId=function(t){this.paneId=t},t.prototype.setExtendData=function(t){return t!==this.extendData&&(this.extendData=t,!0)},t.prototype.setStyles=function(t){return R(this.styles,t),!0},t.prototype.setPoints=function(t){if(t.length>0){var e=void 0;if(this.points=y([],_(t),!1),t.length>=this.totalStep-1?(this.currentStep=-1,e=this.totalStep-1):(this.currentStep=t.length+1,e=t.length),null!==this.performEventMoveForDrawing)for(var i=0;i<e;i++)this.performEventMoveForDrawing({currentStep:i+2,mode:this.mode,points:this.points,performPointIndex:i,performPoint:this.points[i]});return-1===this.currentStep&&null!==this.performEventPressedMove&&this.performEventPressedMove({currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:this.points.length-1,performPoint:this.points[this.points.length-1]}),!0}return!1},t.prototype.setLock=function(t){return this.lock!==t&&(this.lock=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setMode=function(t){return this.mode!==t&&(this.mode=t,!0)},t.prototype.setModeSensitivity=function(t){return this.modeSensitivity!==t&&(this.modeSensitivity=t,!0)},t.prototype.setOnDrawStartCallback=function(t){return this.onDrawStart!==t&&(this.onDrawStart=t,!0)},t.prototype.setOnDrawingCallback=function(t){return this.onDrawing!==t&&(this.onDrawing=t,!0)},t.prototype.setOnDrawEndCallback=function(t){return this.onDrawEnd!==t&&(this.onDrawEnd=t,!0)},t.prototype.setOnClickCallback=function(t){return this.onClick!==t&&(this.onClick=t,!0)},t.prototype.setOnDoubleClickCallback=function(t){return this.onDoubleClick!==t&&(this.onDoubleClick=t,!0)},t.prototype.setOnRightClickCallback=function(t){return this.onRightClick!==t&&(this.onRightClick=t,!0)},t.prototype.setOnPressedMoveStartCallback=function(t){return this.onPressedMoveStart!==t&&(this.onPressedMoveStart=t,!0)},t.prototype.setOnPressedMovingCallback=function(t){return this.onPressedMoving!==t&&(this.onPressedMoving=t,!0)},t.prototype.setOnPressedMoveEndCallback=function(t){return this.onPressedMoveEnd!==t&&(this.onPressedMoveEnd=t,!0)},t.prototype.setOnMouseEnterCallback=function(t){return this.onMouseEnter!==t&&(this.onMouseEnter=t,!0)},t.prototype.setOnMouseLeaveCallback=function(t){return this.onMouseLeave!==t&&(this.onMouseLeave=t,!0)},t.prototype.setOnRemovedCallback=function(t){return this.onRemoved!==t&&(this.onRemoved=t,!0)},t.prototype.setOnSelectedCallback=function(t){return this.onSelected!==t&&(this.onSelected=t,!0)},t.prototype.setOnDeselectedCallback=function(t){return this.onDeselected!==t&&(this.onDeselected=t,!0)},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 this.currentStep===ut},t.prototype.eventMoveForDrawing=function(t){var e,i=this.currentStep-1,n={};W(t.timestamp)&&(n.timestamp=t.timestamp),W(t.dataIndex)&&(n.dataIndex=t.dataIndex),W(t.value)&&(n.value=t.value),this.points[i]=n,null===(e=this.performEventMoveForDrawing)||void 0===e||e.call(this,{currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:i,performPoint:n})},t.prototype.eventPressedPointMove=function(t,e){var i;W(t.dataIndex)&&(this.points[e].dataIndex=t.dataIndex,this.points[e].timestamp=t.timestamp),W(t.value)&&(this.points[e].value=t.value),null===(i=this.performEventPressedMove)||void 0===i||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=v({},t),this._prevPressedPoints=B(this.points)},t.prototype.eventPressedOtherMove=function(t,e){var i,n;null!==this._prevPressedPoint&&(W(t.dataIndex)&&W(this._prevPressedPoint.dataIndex)&&(i=t.dataIndex-this._prevPressedPoint.dataIndex),W(t.value)&&W(this._prevPressedPoint.value)&&(n=t.value-this._prevPressedPoint.value),this.points=this._prevPressedPoints.map(function(t){var o;W(t.timestamp)&&(t.dataIndex=e.timestampToDataIndex(t.timestamp));var r=v({},t);return W(i)&&W(t.dataIndex)&&(r.dataIndex=t.dataIndex+i,r.timestamp=null!==(o=e.dataIndexToTimestamp(r.dataIndex))&&void 0!==o?o:void 0),W(n)&&W(t.value)&&(r.value=t.value+n),r}))},t.extend=function(e){return function(t){function i(){return t.call(this,e)||this}return o(i,t),i}(t)},t}();!function(t){t[t.Tooltip=0]="Tooltip",t[t.Crosshair=1]="Crosshair",t[t.XAxis=2]="XAxis"}(ct||(ct={}));var dt="en-US",pt=-1;function vt(t){return N(window.requestAnimationFrame)?window.requestAnimationFrame(t):window.setTimeout(t,20)}function gt(t){N(window.cancelAnimationFrame)?window.cancelAnimationFrame(t):window.clearTimeout(t)}var ft=function(){function t(t){this._options={duration:500,iterationCount:1},this._currentIterationCount=0,this._running=!1,this._time=0,R(this._options,t)}return t.prototype._loop=function(){var t=this;this._running=!0;var e=function(){var i;if(t._running){var n=(new Date).getTime()-t._time;n<t._options.duration?(null===(i=t._doFrameCallback)||void 0===i||i.call(t,n),vt(e)):(t.stop(),t._currentIterationCount++,t._currentIterationCount<t._options.iterationCount&&t.start())}};vt(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)||void 0===t||t.call(this,this._options.duration)),this._running=!1},t}(),mt=1,_t=(new Date).getTime();function yt(t){var e=(new Date).getTime();return e===_t?++mt:mt=1,_t=e,"".concat(null!==t&&void 0!==t?t:"").concat(e,"_").concat(mt)}function xt(t,e){var i,n=document.createElement(t),o=null!==e&&void 0!==e?e:{};for(var r in o)n.style[r]=null!==(i=o[r])&&void 0!==i?i:"";return n}function Ct(t,e,i){var n=0,o=0;for(o=t.length-1;n!==o;){var r=Math.floor((o+n)/2),a=o-n,s=t[r][e];if(i===t[n][e])return n;if(i===t[o][e])return o;if(i===s)return r;if(i>s?n=r:o=r,a<=2)break}return n}function bt(t,e){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),+(+t).toFixed(e)}function St(t,e,i){var n=[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER];return t.forEach(function(t){var o,r;n[0]=Math.max(null!==(o=t[e])&&void 0!==o?o:t,n[0]),n[1]=Math.min(null!==(r=t[i])&&void 0!==r?r:t,n[1])}),n}function wt(t){return Math.log(t)/Math.log(10)}function Et(t){return Math.pow(10,t)}var Tt=1,It=50,Pt=8,kt=80,Dt=function(){function t(t){this._dateTimeFormat=this._buildDateTimeFormat(),this._zoomEnabled=!0,this._scrollEnabled=!0,this._totalBarSpace=0,this._barSpace=Pt,this._offsetRightDistance=kt,this._startLastBarRightSideDiffBarCount=0,this._scrollLimitRole=0,this._minVisibleBarCount={left:2,right:2},this._maxOffsetDistance={left:50,right:50},this._visibleRange={from:0,to:0,realFrom:0,realTo:0},this._chartStore=t,this._gapBarSpace=this._calcGapBarSpace(),this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace}return t.prototype._calcGapBarSpace=function(){var t;return this._barSpace>3?t=Math.floor(.88*this._barSpace):(t=Math.floor(this._barSpace))===this._barSpace&&t--,t%2==0&&t--,t=Math.max(1,t)},t.prototype.adjustVisibleRange=function(){var t,e,i,n,o=this._chartStore.getDataList(),r=o.length,a=this._totalBarSpace/this._barSpace;1===this._scrollLimitRole?(i=(this._totalBarSpace-this._maxOffsetDistance.right)/this._barSpace,n=(this._totalBarSpace-this._maxOffsetDistance.left)/this._barSpace):(i=this._minVisibleBarCount.left,n=this._minVisibleBarCount.right),i=Math.max(0,i),n=Math.max(0,n);var s=a-Math.min(i,r);this._lastBarRightSideDiffBarCount>s&&(this._lastBarRightSideDiffBarCount=s);var l=-r+Math.min(n,r);this._lastBarRightSideDiffBarCount<l&&(this._lastBarRightSideDiffBarCount=l);var c=Math.round(this._lastBarRightSideDiffBarCount+r+.5),u=c;c>r&&(c=r);var h=Math.round(c-a)-1;h<0&&(h=0);var d=this._lastBarRightSideDiffBarCount>0?Math.round(r+this._lastBarRightSideDiffBarCount-a)-1:h;if(this._visibleRange={from:h,to:c,realFrom:d,realTo:u},this._chartStore.getActionStore().execute(X.OnVisibleRangeChange,this._visibleRange),this._chartStore.adjustVisibleDataList(),0===h){var p=o[0];this._chartStore.executeLoadMoreCallback(null!==(t=null===p||void 0===p?void 0:p.timestamp)&&void 0!==t?t:null),this._chartStore.executeLoadDataCallback({type:nt.Forward,data:null!==p&&void 0!==p?p:null})}c===r&&this._chartStore.executeLoadDataCallback({type:nt.Backward,data:null!==(e=o[r-1])&&void 0!==e?e:null})},t.prototype.getDateTimeFormat=function(){return this._dateTimeFormat},t.prototype._buildDateTimeFormat=function(t){var e={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};K(t)&&(e.timeZone=t);var i=null;try{i=new Intl.DateTimeFormat("en",e)}catch(t){F("","","Timezone is error!!!")}return i},t.prototype.setTimezone=function(t){var e=this._buildDateTimeFormat(t);null!==e&&(this._dateTimeFormat=e)},t.prototype.getTimezone=function(){return this._dateTimeFormat.resolvedOptions().timeZone},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<Tt||t>It||this._barSpace===t||(this._barSpace=t,this._gapBarSpace=this._calcGapBarSpace(),null===e||void 0===e||e(),this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0))},t.prototype.setTotalBarSpace=function(t){return this._totalBarSpace!==t&&(this._totalBarSpace=t,this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0)),this},t.prototype.setOffsetRightDistance=function(t,e){return this._offsetRightDistance=1===this._scrollLimitRole?Math.min(this._maxOffsetDistance.right,t):t,this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace,null!==e&&void 0!==e&&e&&(this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0)),this},t.prototype.resetOffsetRightDistance=function(){this.setOffsetRightDistance(this._offsetRightDistance)},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){return this._lastBarRightSideDiffBarCount=t,this},t.prototype.setMaxOffsetLeftDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.left=t,this},t.prototype.setMaxOffsetRightDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.right=t,this},t.prototype.setLeftMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.left=t,this},t.prototype.setRightMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.right=t,this},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._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0);var n=Math.round(i-this._lastBarRightSideDiffBarCount*this._barSpace);0!==n&&this._chartStore.getActionStore().execute(X.OnScroll,{distance:n})}},t.prototype.getDataByDataIndex=function(t){var e;return null!==(e=this._chartStore.getDataList()[t])&&void 0!==e?e:null},t.prototype.coordinateToFloatIndex=function(t){var e=this._chartStore.getDataList().length,i=(this._totalBarSpace-t)/this._barSpace,n=e+this._lastBarRightSideDiffBarCount-i;return Math.round(1e6*n)/1e6},t.prototype.dataIndexToTimestamp=function(t){var e,i=this.getDataByDataIndex(t);return null!==(e=null===i||void 0===i?void 0:i.timestamp)&&void 0!==e?e:null},t.prototype.timestampToDataIndex=function(t){var e=this._chartStore.getDataList();return 0===e.length?0:Ct(e,"timestamp",t)},t.prototype.dataIndexToCoordinate=function(t){var e=this._chartStore.getDataList().length+this._lastBarRightSideDiffBarCount-t;return Math.floor(this._totalBarSpace-(e-.5)*this._barSpace)},t.prototype.coordinateToDataIndex=function(t){return Math.ceil(this.coordinateToFloatIndex(t))-1},t.prototype.zoom=function(t,e){var i,n=this;if(this._zoomEnabled){var o=null!==e&&void 0!==e?e:null;if(!W(null===o||void 0===o?void 0:o.x)){var r=this._chartStore.getTooltipStore().getCrosshair();o={x:null!==(i=null===r||void 0===r?void 0:r.x)&&void 0!==i?i:this._totalBarSpace/2}}var a=o.x,s=this.coordinateToFloatIndex(a),l=this._barSpace,c=this._barSpace+t*(this._barSpace/10);this.setBarSpace(c,function(){n._lastBarRightSideDiffBarCount+=s-n.coordinateToFloatIndex(a)});var u=this._barSpace/l;1!==u&&this._chartStore.getActionStore().execute(X.OnZoom,{scale:u})}},t.prototype.setZoomEnabled=function(t){return this._zoomEnabled=t,this},t.prototype.getZoomEnabled=function(){return this._zoomEnabled},t.prototype.setScrollEnabled=function(t){return this._scrollEnabled=t,this},t.prototype.getScrollEnabled=function(){return this._scrollEnabled},t.prototype.clear=function(){this._visibleRange={from:0,to:0,realFrom:0,realTo:0}},t}();function Mt(){return{key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,styles:function(t,e,i){var n=t.current.kLineData,o=j(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor);return z(n)&&(n.close>n.open?o=j(e.styles,"bars[0].upColor",i.bars[0].upColor):n.close<n.open&&(o=j(e.styles,"bars[0].downColor",i.bars[0].downColor))),{color:o}}}}var At={};function Lt(t){var e;return null!==(e=At[t])&&void 0!==e?e:null}[{name:"AVP",shortName:"AVP",series:ot.Price,precision:2,figures:[{key:"avp",title:"AVP: ",type:"line"}],calc:function(t){var e=0,i=0;return t.map(function(t){var n,o,r={},a=null!==(n=null===t||void 0===t?void 0:t.turnover)&&void 0!==n?n:0,s=null!==(o=null===t||void 0===t?void 0:t.volume)&&void 0!==o?o:0;return e+=a,0!==(i+=s)&&(r.avp=e/i),r})}},{name:"AO",shortName:"AO",calcParams:[5,34],figures:[{key:"ao",title:"AO: ",type:"bar",baseValue:0,styles:function(t,e,i){var n,o,r,s,l,c=t.prev,u=t.current,h=null!==(o=null===(n=c.indicatorData)||void 0===n?void 0:n.ao)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,d=null!==(s=null===(r=u.indicatorData)||void 0===r?void 0:r.ao)&&void 0!==s?s:Number.MIN_SAFE_INTEGER;return{color:l=d>h?j(e.styles,"bars[0].upColor",i.bars[0].upColor):j(e.styles,"bars[0].downColor",i.bars[0].downColor),style:d>h?a.Stroke:a.Fill,borderColor:l}}}],calc:function(t,e){var i=e.calcParams,n=Math.max(i[0],i[1]),o=0,r=0,a=0,s=0;return t.map(function(e,l){var c={},u=(e.low+e.high)/2;if(o+=u,r+=u,l>=i[0]-1){a=o/i[0];var h=t[l-(i[0]-1)];o-=(h.low+h.high)/2}if(l>=i[1]-1){s=r/i[1];h=t[l-(i[1]-1)];r-=(h.low+h.high)/2}return l>=n-1&&(c.ao=a-s),c})}},{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,n=e.figures,o=[];return t.map(function(e,r){var a={},s=e.close;return i.forEach(function(e,l){var c;if(o[l]=(null!==(c=o[l])&&void 0!==c?c:0)+s,r>=e-1){var u=o[l]/i[l];a[n[l].key]=(s-u)/u*100,o[l]-=t[r-(e-1)].close}}),a})}},{name:"BOLL",shortName:"BOLL",series:ot.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,n=i[0]-1,o=0;return t.map(function(e,r){var a=e.close,s={};if(o+=a,r>=n){s.mid=o/i[0];var l=function(t,e){var i=t.length,n=0;return t.forEach(function(t){var i=t.close-e;n+=i*i}),n=Math.abs(n),Math.sqrt(n/i)}(t.slice(r-n,r+1),s.mid);s.up=s.mid+i[1]*l,s.dn=s.mid-i[1]*l,o-=t[r-n].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,n=0,o=0,r=0,a=0;return t.map(function(e,s){var l,c,u={},h=e.high,d=e.low,p=e.open,v=(null!==(l=t[s-1])&&void 0!==l?l:e).close;if(r+=h-p,a+=p-d,n+=h-v,o+=v-d,s>=i[0]-1){u.ar=0!==a?r/a*100:0,u.br=0!==o?n/o*100:0;var g=t[s-(i[0]-1)],f=g.high,m=g.low,_=g.open,y=(null!==(c=t[s-i[0]])&&void 0!==c?c:t[s-(i[0]-1)]).close;n-=f-y,o-=y-m,r-=f-_,a-=_-m}return u})}},{name:"BBI",shortName:"BBI",series:ot.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,n=Math.max.apply(Math,y([],_(i),!1)),o=[],r=[];return t.map(function(e,a){var s={},l=e.close;if(i.forEach(function(e,i){var n;o[i]=(null!==(n=o[i])&&void 0!==n?n:0)+l,a>=e-1&&(r[i]=o[i]/e,o[i]-=t[a-(e-1)].close)}),a>=n-1){var c=0;r.forEach(function(t){c+=t}),s.bbi=c/4}return s})}},{name:"CCI",shortName:"CCI",calcParams:[20],figures:[{key:"cci",title:"CCI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=i[0]-1,o=0,r=[];return t.map(function(e,a){var s={},l=(e.high+e.low+e.close)/3;if(o+=l,r.push(l),a>=n){var c=o/i[0],u=0;r.slice(a-n,a+1).forEach(function(t){u+=Math.abs(t-c)});var h=u/i[0];s.cci=0!==h?(l-c)/h/.015:0;var d=(t[a-n].high+t[a-n].low+t[a-n].close)/3;o-=d}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,n=Math.ceil(i[1]/2.5+1),o=Math.ceil(i[2]/2.5+1),r=Math.ceil(i[3]/2.5+1),a=Math.ceil(i[4]/2.5+1),s=0,l=[],c=0,u=[],h=0,d=[],p=0,v=[],g=[];return t.forEach(function(e,f){var m,_,y,x,C,b={},S=null!==(m=t[f-1])&&void 0!==m?m:e,w=(S.high+S.close+S.low+S.open)/4,E=Math.max(0,e.high-w),T=Math.max(0,w-e.low);f>=i[0]-1&&(b.cr=0!==T?E/T*100:0,s+=b.cr,c+=b.cr,h+=b.cr,p+=b.cr,f>=i[0]+i[1]-2&&(l.push(s/i[1]),f>=i[0]+i[1]+n-3&&(b.ma1=l[l.length-1-n]),s-=null!==(_=g[f-(i[1]-1)].cr)&&void 0!==_?_:0),f>=i[0]+i[2]-2&&(u.push(c/i[2]),f>=i[0]+i[2]+o-3&&(b.ma2=u[u.length-1-o]),c-=null!==(y=g[f-(i[2]-1)].cr)&&void 0!==y?y:0),f>=i[0]+i[3]-2&&(d.push(h/i[3]),f>=i[0]+i[3]+r-3&&(b.ma3=d[d.length-1-r]),h-=null!==(x=g[f-(i[3]-1)].cr)&&void 0!==x?x:0),f>=i[0]+i[4]-2&&(v.push(p/i[4]),f>=i[0]+i[4]+a-3&&(b.ma4=v[v.length-1-a]),p-=null!==(C=g[f-(i[4]-1)].cr)&&void 0!==C?C:0)),g.push(b)}),g}},{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,n=Math.max(i[0],i[1]),o=0,r=0,a=0,s=[];return t.forEach(function(e,l){var c,u={},h=e.close;o+=h,r+=h;var d=0,p=0;if(l>=i[0]-1&&(d=o/i[0],o-=t[l-(i[0]-1)].close),l>=i[1]-1&&(p=r/i[1],r-=t[l-(i[1]-1)].close),l>=n-1){var v=d-p;u.dma=v,a+=v,l>=n+i[2]-2&&(u.ama=a/i[2],a-=null!==(c=s[l-(i[2]-1)].dma)&&void 0!==c?c:0)}s.push(u)}),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,n=0,o=0,r=0,a=0,s=0,l=0,c=0,u=0,h=[];return t.forEach(function(e,d){var p,v,g={},f=null!==(p=t[d-1])&&void 0!==p?p:e,m=f.close,_=e.high,y=e.low,x=_-y,C=Math.abs(_-m),b=Math.abs(m-y),S=_-f.high,w=f.low-y,E=Math.max(Math.max(x,C),b),T=S>0&&S>w?S:0,I=w>0&&w>S?w:0;if(n+=E,o+=T,r+=I,d>=i[0]-1){d>i[0]-1?(a=a-a/i[0]+E,s=s-s/i[0]+T,l=l-l/i[0]+I):(a=n,s=o,l=r);var P=0,k=0;0!==a&&(P=100*s/a,k=100*l/a),g.pdi=P,g.mdi=k;var D=0;k+P!==0&&(D=Math.abs(k-P)/(k+P)*100),c+=D,d>=2*i[0]-2&&(u=d>2*i[0]-2?(u*(i[0]-1)+D)/i[0]:c/i[0],g.adx=u,d>=2*i[0]+i[1]-3&&(g.adxr=((null!==(v=h[d-(i[1]-1)].adx)&&void 0!==v?v:0)+u)/2))}h.push(g)}),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,n=0,o=[];return t.map(function(e,r){var a,s={};if(r>0){var l=t[r-1],c=e.high,u=e.low,h=null!==(a=e.volume)&&void 0!==a?a:0,d=(c+u)/2-(l.high+l.low)/2;if(0===h||c-u==0)s.emv=0;else{var p=h/1e8/(c-u);s.emv=d/p}n+=s.emv,o.push(s.emv),r>=i[0]&&(s.maEmv=n/i[0],n-=o[r-i[0]])}return s})}},{name:"EMA",shortName:"EMA",series:ot.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,n=e.figures,o=0,r=[];return t.map(function(t,e){var a={},s=t.close;return o+=s,i.forEach(function(t,i){e>=t-1&&(r[i]=e>t-1?(2*s+(t-1)*r[i])/(t+1):o/t,a[n[i].key]=r[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,n=0,o=[];return t.forEach(function(e,r){var a,s={};if(r>=i[0]){var l=e.close,c=t[r-i[0]].close;s.mtm=l-c,n+=s.mtm,r>=i[0]+i[1]-1&&(s.maMtm=n/i[1],n-=null!==(a=o[r-(i[1]-1)].mtm)&&void 0!==a?a:0)}o.push(s)}),o}},{name:"MA",shortName:"MA",series:ot.Price,calcParams:[5,10,30,60],precision:2,shouldOhlc:!0,figures:[{key:"ma5",title:"MA5: ",type:"line"},{key:"ma10",title:"MA10: ",type:"line"},{key:"ma30",title:"MA30: ",type:"line"},{key:"ma60",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,n=e.figures,o=[];return t.map(function(e,r){var a={},s=e.close;return i.forEach(function(e,i){var l;o[i]=(null!==(l=o[i])&&void 0!==l?l:0)+s,r>=e-1&&(a[n[i].key]=o[i]/e,o[i]-=t[r-(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,e,i){var n,o,r,s,l,c=t.prev,u=t.current,h=null!==(o=null===(n=c.indicatorData)||void 0===n?void 0:n.macd)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,d=null!==(s=null===(r=u.indicatorData)||void 0===r?void 0:r.macd)&&void 0!==s?s:Number.MIN_SAFE_INTEGER;return l=d>0?j(e.styles,"bars[0].upColor",i.bars[0].upColor):d<0?j(e.styles,"bars[0].downColor",i.bars[0].downColor):j(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor),{style:h<d?a.Stroke:a.Fill,color:l,borderColor:l}}}],calc:function(t,e){var i,n,o=e.calcParams,r=0,a=0,s=0,l=0,c=Math.max(o[0],o[1]);return t.map(function(t,e){var u={},h=t.close;return r+=h,e>=o[0]-1&&(i=e>o[0]-1?(2*h+(o[0]-1)*i)/(o[0]+1):r/o[0]),e>=o[1]-1&&(n=e>o[1]-1?(2*h+(o[1]-1)*n)/(o[1]+1):r/o[1]),e>=c-1&&(a=i-n,u.dif=a,s+=a,e>=c+o[2]-2&&(l=e>c+o[2]-2?(2*a+l*(o[2]-1))/(o[2]+1):s/o[2],u.macd=2*(a-l),u.dea=l)),u})}},{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,n=0,o=0,r=[];return t.forEach(function(e,a){var s,l,c,u,h=null!==(s=t[a-1])&&void 0!==s?s:e;e.close<h.close?o-=null!==(l=e.volume)&&void 0!==l?l:0:e.close>h.close&&(o+=null!==(c=e.volume)&&void 0!==c?c:0);var d={obv:o};n+=o,a>=i[0]-1&&(d.maObv=n/i[0],n-=null!==(u=r[a-(i[0]-1)].obv)&&void 0!==u?u:0),r.push(d)}),r}},{name:"PVT",shortName:"PVT",figures:[{key:"pvt",title:"PVT: ",type:"line"}],calc:function(t){var e=0;return t.map(function(i,n){var o,r,a={},s=i.close,l=null!==(o=i.volume)&&void 0!==o?o:1,c=(null!==(r=t[n-1])&&void 0!==r?r:i).close,u=0,h=c*l;return 0!==h&&(u=(s-c)/h),e+=u,a.pvt=e,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,n=0,o=0,r=[],a=[];return t.forEach(function(e,s){var l,c,u={},h=(null!==(l=t[s-1])&&void 0!==l?l:e).close,d=e.close-h>0?1:0;r.push(d),n+=d,s>=i[0]-1&&(u.psy=n/i[0]*100,o+=u.psy,s>=i[0]+i[1]-2&&(u.maPsy=o/i[1],o-=null!==(c=a[s-(i[1]-1)].psy)&&void 0!==c?c:0),n-=r[s-(i[0]-1)]),a.push(u)}),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,n=[],o=0;return t.forEach(function(e,r){var a,s,l={};if(r>=i[0]-1){var c=e.close,u=(null!==(a=t[r-i[0]])&&void 0!==a?a:t[r-(i[0]-1)]).close;l.roc=0!==u?(c-u)/u*100:0,o+=l.roc,r>=i[0]-1+i[1]-1&&(l.maRoc=o/i[1],o-=null!==(s=n[r-(i[1]-1)].roc)&&void 0!==s?s:0)}n.push(l)}),n}},{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,n=e.figures,o=[],r=[];return t.map(function(e,a){var s,l={},c=(null!==(s=t[a-1])&&void 0!==s?s:e).close,u=e.close-c;return i.forEach(function(e,i){var s,c,h;if(u>0?o[i]=(null!==(s=o[i])&&void 0!==s?s:0)+u:r[i]=(null!==(c=r[i])&&void 0!==c?c:0)+Math.abs(u),a>=e-1){0!==r[i]?l[n[i].key]=100-100/(1+o[i]/r[i]):l[n[i].key]=0;var d=t[a-(e-1)],p=null!==(h=t[a-e])&&void 0!==h?h:d,v=d.close-p.close;v>0?o[i]-=v:r[i]-=Math.abs(v)}}),l})}},{name:"SMA",shortName:"SMA",series:ot.Price,calcParams:[12,2],precision:2,figures:[{key:"sma",title:"SMA: ",type:"line"}],shouldOhlc:!0,calc:function(t,e){var i=e.calcParams,n=0,o=0;return t.map(function(t,e){var r={},a=t.close;return n+=a,e>=i[0]-1&&(o=e>i[0]-1?(a*i[1]+o*(i[0]-i[1]+1))/(i[0]+1):n/i[0],r.sma=o),r})}},{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,n=[];return t.forEach(function(e,o){var r,a,s,l,c={},u=e.close;if(o>=i[0]-1){var h=St(t.slice(o-(i[0]-1),o+1),"high","low"),d=h[0],p=h[1],v=d-p,g=(u-p)/(0===v?1:v)*100;c.k=((i[1]-1)*(null!==(a=null===(r=n[o-1])||void 0===r?void 0:r.k)&&void 0!==a?a:50)+g)/i[1],c.d=((i[2]-1)*(null!==(l=null===(s=n[o-1])||void 0===s?void 0:s.d)&&void 0!==l?l:50)+c.k)/i[2],c.j=3*c.k-2*c.d}n.push(c)}),n}},{name:"SAR",shortName:"SAR",series:ot.Price,calcParams:[2,2,20],precision:2,shouldOhlc:!0,figures:[{key:"sar",title:"SAR: ",type:"circle",styles:function(t,e,i){var n,o,r=t.current,a=null!==(o=null===(n=r.indicatorData)||void 0===n?void 0:n.sar)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,s=r.kLineData;return{color:a<((null===s||void 0===s?void 0:s.high)+(null===s||void 0===s?void 0:s.low))/2?j(e.styles,"circles[0].upColor",i.circles[0].upColor):j(e.styles,"circles[0].downColor",i.circles[0].downColor)}}}],calc:function(t,e){var i=e.calcParams,n=i[0]/100,o=i[1]/100,r=i[2]/100,a=n,s=-100,l=!1,c=0;return t.map(function(e,i){var u=c,h=e.high,d=e.low;if(l){(-100===s||s<h)&&(s=h,a=Math.min(a+o,r)),c=u+a*(s-u);var p=Math.min(t[Math.max(1,i)-1].low,d);c>e.low?(c=s,a=n,s=-100,l=!l):c>p&&(c=p)}else{(-100===s||s>d)&&(s=d,a=Math.min(a+o,r)),c=u+a*(s-u);var v=Math.max(t[Math.max(1,i)-1].high,h);c<e.high?(c=s,a=0,s=-100,l=!l):c<v&&(c=v)}return{sar:c}})}},{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,n,o,r=e.calcParams,a=0,s=0,l=0,c=0,u=[];return t.forEach(function(t,e){var h,d={},p=t.close;if(a+=p,e>=r[0]-1&&(i=e>r[0]-1?(2*p+(r[0]-1)*i)/(r[0]+1):a/r[0],s+=i,e>=2*r[0]-2&&(n=e>2*r[0]-2?(2*i+(r[0]-1)*n)/(r[0]+1):s/r[0],l+=n,e>=3*r[0]-3))){var v=void 0,g=0;e>3*r[0]-3?g=((v=(2*n+(r[0]-1)*o)/(r[0]+1))-o)/o*100:v=l/r[0],o=v,d.trix=g,c+=g,e>=3*r[0]+r[1]-4&&(d.maTrix=c/r[1],c-=null!==(h=u[e-(r[1]-1)].trix)&&void 0!==h?h:0)}u.push(d)}),u}},{name:"VOL",shortName:"VOL",series:ot.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"},Mt()],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(Mt()),e},calc:function(t,e){var i=e.calcParams,n=e.figures,o=[];return t.map(function(e,r){var a,s=null!==(a=e.volume)&&void 0!==a?a:0,l={volume:s};return i.forEach(function(e,i){var a,c;o[i]=(null!==(a=o[i])&&void 0!==a?a:0)+s,r>=e-1&&(l[n[i].key]=o[i]/e,o[i]-=null!==(c=t[r-(e-1)].volume)&&void 0!==c?c:0)}),l})}},{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,n=0,o=0,r=0,a=0,s=[];return t.forEach(function(e,l){var c,u,h,d,p,v={},g=e.close,f=(null!==(c=t[l-1])&&void 0!==c?c:e).close,m=null!==(u=e.volume)&&void 0!==u?u:0;if(g>f?n+=m:g<f?o+=m:r+=m,l>=i[0]-1){var _=r/2;v.vr=o+_===0?0:(n+_)/(o+_)*100,a+=v.vr,l>=i[0]+i[1]-2&&(v.maVr=a/i[1],a-=null!==(h=s[l-(i[1]-1)].vr)&&void 0!==h?h:0);var y=t[l-(i[0]-1)],x=null!==(d=t[l-i[0]])&&void 0!==d?d:y,C=y.close,b=null!==(p=y.volume)&&void 0!==p?p:0;C>x.close?n-=b:C<x.close?o-=b:r-=b}s.push(v)}),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,n=e.figures;return t.map(function(e,o){var r={},a=e.close;return i.forEach(function(e,i){var s=e-1;if(o>=s){var l=St(t.slice(o-s,o+1),"high","low"),c=l[0],u=c-l[1];r[n[i].key]=0===u?0:(a-c)/u*100}}),r})}}].forEach(function(t){At[t.name]=lt.extend(t)});var Ft=function(){function t(t){this._instances=new Map,this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.shortName,n=e.series,o=e.calcParams,r=e.precision,a=e.figures,s=e.minValue,l=e.maxValue,c=e.shouldOhlc,u=e.shouldFormatBigNumber,h=e.visible,d=e.zLevel,p=e.styles,v=e.extendData,g=e.regenerateFigures,f=e.createTooltipDataSource,m=e.draw,_=e.calc,y=!1;K(i)&&t.setShortName(i)&&(y=!0),z(n)&&t.setSeries(n)&&(y=!0);var x=!1;O(o)&&t.setCalcParams(o)&&(y=!0,x=!0),O(a)&&t.setFigures(a)&&(y=!0,x=!0),void 0!==s&&t.setMinValue(s)&&(y=!0),void 0!==l&&t.setMinValue(l)&&(y=!0),W(r)&&t.setPrecision(r)&&(y=!0),Y(c)&&t.setShouldOhlc(c)&&(y=!0),Y(u)&&t.setShouldFormatBigNumber(u)&&(y=!0),Y(h)&&t.setVisible(h)&&(y=!0);var C=!1;return W(d)&&t.setZLevel(d)&&(y=!0,C=!0),z(p)&&t.setStyles(p)&&(y=!0),void 0!==v&&t.setExtendData(v)&&(y=!0,x=!0),void 0!==g&&t.setRegenerateFigures(g)&&(y=!0),void 0!==f&&t.setCreateTooltipDataSource(f)&&(y=!0),void 0!==m&&t.setDraw(m)&&(y=!0),N(_)&&(t.calc=_,x=!0),[y,x,C]},t.prototype._sort=function(t){var e;K(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstance=function(t,e,i){return g(this,void 0,void 0,function(){var n,o,r,a;return f(this,function(s){switch(s.label){case 0:return n=t.name,z(o=this._instances.get(e))?z(o.find(function(t){return t.name===n}))?[4,Promise.reject(new Error("Duplicate indicators."))]:[3,2]:[3,2];case 1:return[2,s.sent()];case 2:return z(o)||(o=[]),r=Lt(n),a=new r,this.synchronizeSeriesPrecision(a),this._overrideInstance(a,t),i||(o=[]),o.push(a),this._instances.set(e,o),this._sort(e),[4,a.calcIndicator(this._chartStore.getDataList())];case 3:return[2,s.sent()]}})})},t.prototype.getInstances=function(t){var e;return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.removeInstance=function(t,e){var i,n=!1,o=this._instances.get(t);if(z(o)){if(K(e)){var r=o.findIndex(function(t){return t.name===e});r>-1&&(o.splice(r,1),n=!0)}else this._instances.set(t,[]),n=!0;0===(null===(i=this._instances.get(t))||void 0===i?void 0:i.length)&&this._instances.delete(t)}return n},t.prototype.hasInstances=function(t){return this._instances.has(t)},t.prototype.calcInstance=function(t,e){return g(this,void 0,void 0,function(){var i,n,o,r=this;return f(this,function(a){switch(a.label){case 0:return i=[],K(t)?K(e)?z(n=this._instances.get(e))&&z(o=n.find(function(e){return e.name===t}))&&i.push(o.calcIndicator(this._chartStore.getDataList())):this._instances.forEach(function(e){var n=e.find(function(e){return e.name===t});z(n)&&i.push(n.calcIndicator(r._chartStore.getDataList()))}):this._instances.forEach(function(t){t.forEach(function(t){i.push(t.calcIndicator(r._chartStore.getDataList()))})}),[4,Promise.all(i)];case 1:return[2,a.sent().includes(!0)]}})})},t.prototype.getInstanceByPaneId=function(t,e){var i,n,o=function(t){var e=new Map;return t.forEach(function(t){e.set(t.name,t)}),e};if(K(t)){var r=null!==(i=this._instances.get(t))&&void 0!==i?i:[];return K(e)?null!==(n=null===r||void 0===r?void 0:r.find(function(t){return t.name===e}))&&void 0!==n?n:null:o(r)}var a=new Map;return this._instances.forEach(function(t,e){a.set(e,o(t))}),a},t.prototype.synchronizeSeriesPrecision=function(t){var e=this._chartStore.getPrecision(),i=e.price,n=e.volume,o=function(t){switch(t.series){case ot.Price:t.setPrecision(i,!0);break;case ot.Volume:t.setPrecision(n,!0)}};z(t)?o(t):this._instances.forEach(function(t){t.forEach(function(t){o(t)})})},t.prototype.override=function(t,e){return g(this,void 0,void 0,function(){var i,n,o,r,a,s,l,c=this;return f(this,function(u){switch(u.label){case 0:return i=t.name,n=new Map,null!==e?z(o=this._instances.get(e))&&n.set(e,o):n=this._instances,r=!1,a=[],s=!1,n.forEach(function(e){var n=e.find(function(t){return t.name===i});if(z(n)){var o=c._overrideInstance(n,t);o[2]&&(s=!0),o[1]?a.push(n.calcIndicator(c._chartStore.getDataList())):o[0]&&(r=!0)}}),s&&this._sort(),[4,Promise.all(a)];case 1:return l=u.sent(),[2,[r,l.includes(!0)]]}})})},t}(),Rt=function(){function t(t){this._crosshair={},this._activeIcon=null,this._chartStore=t}return t.prototype.setCrosshair=function(t,e){var i,n,o=null!==e&&void 0!==e?e:{},r=o.notInvalidate,a=o.notExecuteAction,s=this._chartStore.getDataList(),l=null!==t&&void 0!==t?t:{},c=s[n=W(l.x)?(i=this._chartStore.getTimeScaleStore().coordinateToDataIndex(l.x))<0?0:i>s.length-1?s.length-1:i:i=s.length-1],u=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(i),h=this._crosshair.x,d=this._crosshair.y,p=this._crosshair.paneId;this._crosshair=v(v({},l),{realX:u,kLineData:c,realDataIndex:i,dataIndex:n}),h===l.x&&d===l.y&&p===l.paneId||(null===c||null!==a&&void 0!==a&&a||this._chartStore.getChart().crosshairChange(this._crosshair),null!==r&&void 0!==r&&r||this._chartStore.getChart().updatePane(1))},t.prototype.recalculateCrosshair=function(t){this.setCrosshair(this._crosshair,{notInvalidate:t})},t.prototype.getCrosshair=function(){return this._crosshair},t.prototype.setActiveIcon=function(t){this._activeIcon=null!==t&&void 0!==t?t:null},t.prototype.getActiveIcon=function(){return this._activeIcon},t.prototype.clear=function(){this.setCrosshair({},{notInvalidate:!0}),this.setActiveIcon()},t}(),Bt={name:"fibonacciLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,o=t.overlay,r=t.precision,a=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=o.points;if(i.length>0){var u=null===(e=null===l||void 0===l?void 0:l.isInCandle())||void 0===e||e?r.price:r.excludePriceVolumeMax,h=[],d=[],p=n.width;if(i.length>1&&W(c[0].value)&&W(c[1].value)){var v=i[0].y-i[1].y,g=c[0].value-c[1].value;[1,.786,.618,.5,.382,.236,0].forEach(function(t){var e,n=i[1].y+v*t,o=J(Q(((null!==(e=c[1].value)&&void 0!==e?e:0)+g*t).toFixed(u),a),s);h.push({coordinates:[{x:0,y:n},{x:p,y:n}]}),d.push({x:0,y:n,text:"".concat(o," (").concat((100*t).toFixed(1),"%)"),baseline:"bottom"})})}return[{type:"line",attrs:h},{type:"text",isCheckEvent:!1,attrs:d}]}return[]}},Ot={name:"horizontalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding,n={x:0,y:e[0].y};return z(e[1])&&e[0].x<e[1].x&&(n.x=i.width),[{type:"line",attrs:{coordinates:[e[0],n]}}]},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,n=t.performPoint;2===e&&(i[0].value=n.value)}},Nt=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,i){var n=this._callbacks.get(t);return!(!z(n)||!this.checkEventOn(e))&&n(e,i)},t.prototype.checkEventOn=function(t){var e,i;try{for(var n=m(this._children),o=n.next();!o.done;o=n.next()){if(o.value.checkEventOn(t))return!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return!1},t.prototype.dispatchEvent=function(t,e,i){var n=this._children.length-1;if(n>-1)for(var o=n;o>-1;o--)if(this._children[o].dispatchEvent(t,e,i))return!0;return this.onEvent(t,e,i)},t.prototype.addChild=function(t){return this._children.push(t),this},t.prototype.clear=function(){this._children=[]},t}(),Vt=2,Wt=function(t){function e(e){var i=t.call(this)||this;return i.attrs=e.attrs,i.styles=e.styles,i}return o(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){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return o(i,e),i.prototype.checkEventOnImp=function(e,i,n){return t.checkEventOn(e,i,n)},i.prototype.drawImp=function(e,i,n){t.draw(e,i,n)},i}(e)},e}(Nt);function zt(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n].coordinates;if(o.length>1)for(var r=1;r<o.length;r++){var a=o[r-1],s=o[r];if(a.x===s.x){if(Math.abs(a.y-t.y)+Math.abs(s.y-t.y)-Math.abs(a.y-s.y)<Vt+Vt&&Math.abs(t.x-a.x)<Vt)return!0}else{var l=Ht(a,s),c=Yt(l,t),u=Math.abs(c-t.y);if(Math.abs(a.x-t.x)+Math.abs(s.x-t.x)-Math.abs(a.x-s.x)<Vt+Vt&&u*u/(l[0]*l[0]+1)<Vt*Vt)return!0}}}return!1}function Yt(t,e){return null!==t?e.x*t[0]+t[1]:e.y}function Kt(t,e,i){return Yt(Ht(t,e),i)}function Ht(t,e){var i=t.x-e.x;if(0!==i){var n=(t.y-e.y)/i;return[n,t.y-n*t.x]}return null}function Xt(t,e,i){var n=e.length,o=W(i)?i>0&&i<1?i:0:i?.5:0;if(o>0&&n>2){for(var r=e[0].x,a=e[0].y,s=1;s<n-1;s++){var l=e[s-1],c=e[s],u=e[s+1],h=c.x-l.x,d=c.y-l.y,p=u.x-c.x,v=u.y-c.y,g=u.x-l.x,f=u.y-l.y,m=Math.sqrt(h*h+d*d),_=Math.sqrt(p*p+v*v),y=_/(_+m),x=c.x+g*o*y,C=c.y+f*o*y;x=Math.min(x,Math.max(u.x,c.x)),C=Math.min(C,Math.max(u.y,c.y)),x=Math.max(x,Math.min(u.x,c.x)),C=Math.max(C,Math.min(u.y,c.y)),g=x-c.x,f=C-c.y;var b=c.x-g*m/_,S=c.y-f*m/_;b=Math.min(b,Math.max(l.x,c.x)),S=Math.min(S,Math.max(l.y,c.y)),b=Math.max(b,Math.min(l.x,c.x)),S=Math.max(S,Math.min(l.y,c.y)),g=c.x-b,f=c.y-S,x=c.x+g*_/m,C=c.y+f*_/m,t.bezierCurveTo(r,a,b,S,c.x,c.y),r=x,a=C}var w=e[n-1];t.bezierCurveTo(r,a,w.x,w.y,w.x,w.y)}else for(s=1;s<n;s++)t.lineTo(e[s].x,e[s].y)}function $t(t,e,i){var n=[];n=n.concat(e);var o=i.style,a=void 0===o?r.Solid:o,s=i.smooth,l=void 0!==s&&s,c=i.size,u=void 0===c?1:c,h=i.color,d=void 0===h?"currentColor":h,p=i.dashedValue,v=void 0===p?[2,2]:p;t.lineWidth=u,t.strokeStyle=d,a===r.Dashed?t.setLineDash(v):t.setLineDash([]);var g=u%2==1?.5:0;n.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.save(),u%2==1&&t.translate(.5,.5),t.beginPath(),t.moveTo(i[0].x,i[0].y),Xt(t,i,l),t.stroke(),t.closePath(),t.restore()):(t.beginPath(),i[0].x===i[1].x?(t.moveTo(i[0].x+g,i[0].y),t.lineTo(i[1].x+g,i[1].y)):(t.moveTo(i[0].x,i[0].y+g),t.lineTo(i[1].x,i[1].y+g)),t.stroke(),t.closePath()))})}var Gt={name:"line",checkEventOn:zt,draw:function(t,e,i){$t(t,e,i)}};function jt(t,e,i){var n=null!==i&&void 0!==i?i:0,o=[];if(t.length>1)if(t[0].x===t[1].x){var r=e.height;if(o.push({coordinates:[{x:t[0].x,y:0},{x:t[0].x,y:r}]}),t.length>2){o.push({coordinates:[{x:t[2].x,y:0},{x:t[2].x,y:r}]});for(var a=t[0].x-t[2].x,s=0;s<n;s++){var l=a*(s+1);o.push({coordinates:[{x:t[0].x+l,y:0},{x:t[0].x+l,y:r}]})}}}else{var c=e.width,u=Ht(t[0],t[1]),h=u[0],d=u[1];if(o.push({coordinates:[{x:0,y:0*h+d},{x:c,y:c*h+d}]}),t.length>2){var p=t[2].y-h*t[2].x;o.push({coordinates:[{x:0,y:0*h+p},{x:c,y:c*h+p}]});for(a=d-p,s=0;s<n;s++){var v=d+a*(s+1);o.push({coordinates:[{x:0,y:0*h+v},{x:c,y:c*h+v}]})}}}return o}var qt={};function Zt(t){var e;return null!==(e=qt[t])&&void 0!==e?e:null}[Bt,Ot,{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,n=t.performPoint;2===e&&(i[0].value=n.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:jt(t.coordinates,t.bounding)}]}},{name:"priceChannelLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:jt(t.coordinates,t.bounding,1)}]}},{name:"priceLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,o=t.precision,r=t.overlay,a=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=r.points[0].value,u=void 0===c?0:c,h=null===(e=null===l||void 0===l?void 0:l.isInCandle())||void 0===e||e?o.price:o.excludePriceVolumeMax;return[{type:"line",attrs:{coordinates:[i[0],{x:n.width,y:i[0].y}]}},{type:"text",ignoreEvent:!0,attrs:{x:i[0].x,y:i[0].y,text:J(Q(u.toFixed(h),a),s),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=void 0;return i=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:Kt(t[0],t[1],{x:0,y:t[0].y})}:{x:e.width,y:Kt(t[0],t[1],{x:e.width,y:t[0].y})},{coordinates:[t[0],i]}}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=t.coordinates,i=t.bounding;return 2===e.length?e[0].x===e[1].x?[{type:"line",attrs:{coordinates:[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]}}]:[{type:"line",attrs:{coordinates:[{x:0,y:Kt(e[0],e[1],{x:0,y:e[0].y})},{x:i.width,y:Kt(e[0],e[1],{x:i.width,y:e[0].y})}]}}]:[]}},{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 n={x:e[0].x,y:0};return e[0].y<e[1].y&&(n.y=i.height),[{type:"line",attrs:{coordinates:[e[0],n]}}]}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,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.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,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.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:r.Dashed}},createPointFigures:function(t){var e,i,n=t.overlay,o=t.coordinates;z(n.extendData)&&(i=N(n.extendData)?n.extendData(n):null!==(e=n.extendData)&&void 0!==e?e:"");var r=o[0].x,a=o[0].y-6,s=a-50,l=s-5;return[{type:"line",attrs:{coordinates:[{x:r,y:a},{x:r,y:s}]},ignoreEvent:!0},{type:"polygon",attrs:{coordinates:[{x:r,y:s},{x:r-4,y:l},{x:r+4,y:l}]},ignoreEvent:!0},{type:"text",attrs:{x:r,y:l,text:null!==i&&void 0!==i?i:"",align:"center",baseline:"bottom"},ignoreEvent:!0}]}},{name:"simpleTag",totalStep:2,styles:{line:{style:r.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,n,o,r,a=t.overlay,s=t.coordinates,l=t.bounding,c=t.yAxis,u=t.precision;return null!==(e=null===c||void 0===c?void 0:c.isFromZero())&&void 0!==e&&e?(n="left",o=0):(n="right",o=l.width),z(a.extendData)&&(r=N(a.extendData)?a.extendData(a):null!==(i=a.extendData)&&void 0!==i?i:""),!z(r)&&W(a.points[0].value)&&(r=Z(a.points[0].value,u.price)),{type:"text",attrs:{x:o,y:s[0].y,text:null!==r&&void 0!==r?r:"",align:n,baseline:"middle"}}}}].forEach(function(t){qt[t.name]=ht.extend(t)});var Ut=30,Qt="candle_pane",Jt="indicator_pane_",te="x_axis_pane",ee=function(){function t(t){this._instances=new Map,this._progressInstanceInfo=null,this._pressedInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._hoverInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._clickInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.id,n=e.groupId,o=e.points,r=e.styles,a=e.lock,s=e.visible,l=e.zLevel,c=e.mode,u=e.modeSensitivity,h=e.extendData,d=e.onDrawStart,p=e.onDrawing,v=e.onDrawEnd,g=e.onClick,f=e.onDoubleClick,m=e.onRightClick,_=e.onPressedMoveStart,y=e.onPressedMoving,x=e.onPressedMoveEnd,C=e.onMouseEnter,b=e.onMouseLeave,S=e.onRemoved,w=e.onSelected,E=e.onDeselected,T=!1,I=!1;return K(i)&&t.setId(i),K(n)&&t.setGroupId(n),O(o)&&t.setPoints(o)&&(T=!0),z(r)&&t.setStyles(r)&&(T=!0),Y(a)&&t.setLock(a),Y(s)&&t.setVisible(s)&&(T=!0),W(l)&&t.setZLevel(l)&&(T=!0,I=!0),z(c)&&t.setMode(c),W(u)&&t.setModeSensitivity(u),void 0!==h&&t.setExtendData(h)&&(T=!0),void 0!==d&&t.setOnDrawStartCallback(d),void 0!==p&&t.setOnDrawingCallback(p),void 0!==v&&t.setOnDrawEndCallback(v),void 0!==g&&t.setOnClickCallback(g),void 0!==f&&t.setOnDoubleClickCallback(f),void 0!==m&&t.setOnRightClickCallback(m),void 0!==_&&t.setOnPressedMoveStartCallback(_),void 0!==y&&t.setOnPressedMovingCallback(y),void 0!==x&&t.setOnPressedMoveEndCallback(x),void 0!==C&&t.setOnMouseEnterCallback(C),void 0!==b&&t.setOnMouseLeaveCallback(b),void 0!==S&&t.setOnRemovedCallback(S),void 0!==w&&t.setOnSelectedCallback(w),void 0!==E&&t.setOnDeselectedCallback(E),[T,I]},t.prototype.getInstanceById=function(t){var e,i;try{for(var n=m(this._instances),o=n.next();!o.done;o=n.next()){var r=o.value[1].find(function(e){return e.id===t});if(z(r))return r}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return null!==this._progressInstanceInfo&&this._progressInstanceInfo.instance.id===t?this._progressInstanceInfo.instance:null},t.prototype._sort=function(t){var e;K(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstances=function(t,e,i){var n=this,o=t.map(function(t){var o,r,a,s,l=null!==(o=t.id)&&void 0!==o?o:yt("overlay_");if(null===n.getInstanceById(l)){var c=Zt(t.name);if(null!==c){var u=new c;u.setPaneId(e);var h=null!==(r=t.groupId)&&void 0!==r?r:l;return t.id=l,t.groupId=h,n._overrideInstance(u,t),u.isDrawing()?n._progressInstanceInfo={paneId:e,instance:u,appointPaneFlag:i}:(n._instances.has(e)||n._instances.set(e,[]),null===(a=n._instances.get(e))||void 0===a||a.push(u)),u.isStart()&&(null===(s=u.onDrawStart)||void 0===s||s.call(u,{overlay:u})),l}}return null});if(o.some(function(t){return null!==t})){this._sort();var r=this._chartStore.getChart();r.updatePane(1,e),r.updatePane(1,te)}return o},t.prototype.getProgressInstanceInfo=function(){return this._progressInstanceInfo},t.prototype.progressInstanceComplete=function(){var t;if(null!==this._progressInstanceInfo){var e=this._progressInstanceInfo,i=e.instance,n=e.paneId;i.isDrawing()||(this._instances.has(n)||this._instances.set(n,[]),null===(t=this._instances.get(n))||void 0===t||t.push(i),this._sort(n),this._progressInstanceInfo=null)}},t.prototype.updateProgressInstanceInfo=function(t,e){null!==this._progressInstanceInfo&&(Y(e)&&e&&(this._progressInstanceInfo.appointPaneFlag=e),this._progressInstanceInfo.paneId=t,this._progressInstanceInfo.instance.setPaneId(t))},t.prototype.getInstances=function(t){var e;if(!K(t)){var i=[];return this._instances.forEach(function(t){i=i.concat(t)}),i}return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.override=function(t){var e=this,i=t.id,n=t.groupId,o=t.name,r=!1,a=!1,s=function(i){var n=e._overrideInstance(i,t);n[0]&&(r=!0),n[1]&&(a=!0)};if(K(i)){var l=this.getInstanceById(i);null!==l&&s(l)}else{var c=K(o),u=K(n);if(this._instances.forEach(function(t){t.forEach(function(t){(c&&t.name===o||u&&t.groupId===n||!c&&!u)&&s(t)})}),null!==this._progressInstanceInfo){var h=this._progressInstanceInfo.instance;(c&&h.name===o||u&&h.groupId===n||!c&&!u)&&s(h)}}a&&this._sort(),r&&this._chartStore.getChart().updatePane(1)},t.prototype.removeInstance=function(t){var e,i,n,o=function(t,e){if(K(t.id)){if(e.id!==t.id)return!1}else if(K(t.groupId)){if(e.groupId!==t.groupId)return!1}else if(K(t.name)&&e.name!==t.name)return!1;return!0},r=[],a=z(t);if(null!==this._progressInstanceInfo){var s=this._progressInstanceInfo.instance;(!a||a&&o(t,s))&&(r.push(this._progressInstanceInfo.paneId),null===(n=s.onRemoved)||void 0===n||n.call(s,{overlay:s}),this._progressInstanceInfo=null)}if(a){var l=new Map,c=function(e){var i=e[1].filter(function(i){var n;return!o(t,i)||(r.includes(e[0])||r.push(e[0]),null===(n=i.onRemoved)||void 0===n||n.call(i,{overlay:i}),!1)});i.length>0&&l.set(e[0],i)};try{for(var u=m(this._instances),h=u.next();!h.done;h=u.next()){c(h.value)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}this._instances=l}else this._instances.forEach(function(t,e){r.push(e),t.forEach(function(t){var e;null===(e=t.onRemoved)||void 0===e||e.call(t,{overlay:t})})}),this._instances.clear();if(r.length>0){var d=this._chartStore.getChart();r.forEach(function(t){d.updatePane(1,t)}),d.updatePane(1,te)}},t.prototype.setPressedInstanceInfo=function(t){this._pressedInstanceInfo=t},t.prototype.getPressedInstanceInfo=function(){return this._pressedInstanceInfo},t.prototype.updatePointPosition=function(t,e){if(t>0){var i=this._chartStore.getDataList();this._instances.forEach(function(n){n.forEach(function(n){n.points.forEach(function(n){if(!z(n.timestamp)&&z(n.dataIndex)){e===nt.Forward&&(n.dataIndex=n.dataIndex+t);var o=i[n.dataIndex];n.timestamp=null===o||void 0===o?void 0:o.timestamp}})})})}},t.prototype.setHoverInstanceInfo=function(t,e){var i,n,o=this._hoverInstanceInfo,r=o.instance,a=o.figureType,s=o.figureKey,l=o.figureIndex;if(((null===r||void 0===r?void 0:r.id)!==(null===(i=t.instance)||void 0===i?void 0:i.id)||a!==t.figureType||l!==t.figureIndex)&&(this._hoverInstanceInfo=t,(null===r||void 0===r?void 0:r.id)!==(null===(n=t.instance)||void 0===n?void 0:n.id))){var c=!1,u=!1;null!==r&&(u=!0,N(r.onMouseLeave)&&(r.onMouseLeave(v({overlay:r,figureKey:s,figureIndex:l},e)),c=!0)),null!==t.instance&&(u=!0,N(t.instance.onMouseEnter)&&(t.instance.onMouseEnter(v({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),c=!0)),u&&this._sort(),c||this._chartStore.getChart().updatePane(1)}},t.prototype.getHoverInstanceInfo=function(){return this._hoverInstanceInfo},t.prototype.setClickInstanceInfo=function(t,e){var i,n,o,r,a,s,l,c,u,h=this._clickInstanceInfo,d=h.paneId,p=h.instance,g=h.figureType,f=h.figureKey,m=h.figureIndex;if(null!==(n=null===(i=t.instance)||void 0===i?void 0:i.isDrawing())&&void 0!==n&&n||null===(r=null===(o=t.instance)||void 0===o?void 0:o.onClick)||void 0===r||r.call(o,v({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),((null===p||void 0===p?void 0:p.id)!==(null===(a=t.instance)||void 0===a?void 0:a.id)||g!==t.figureType||m!==t.figureIndex)&&(this._clickInstanceInfo=t,(null===p||void 0===p?void 0:p.id)!==(null===(s=t.instance)||void 0===s?void 0:s.id))){null===(l=null===p||void 0===p?void 0:p.onDeselected)||void 0===l||l.call(p,v({overlay:p,figureKey:f,figureIndex:m},e)),null===(u=null===(c=t.instance)||void 0===c?void 0:c.onSelected)||void 0===u||u.call(c,v({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e));var _=this._chartStore.getChart();_.updatePane(1,t.paneId),d!==t.paneId&&_.updatePane(1,d),_.updatePane(1,te)}},t.prototype.getClickInstanceInfo=function(){return this._clickInstanceInfo},t.prototype.isEmpty=function(){return 0===this._instances.size&&null===this._progressInstanceInfo},t.prototype.isDrawing=function(){var t,e;return null!==this._progressInstanceInfo&&null!==(e=null===(t=this._progressInstanceInfo)||void 0===t?void 0:t.instance.isDrawing())&&void 0!==e&&e},t}(),ie=function(){function t(){this._actions=new Map}return t.prototype.execute=function(t,e){var i;null===(i=this._actions.get(t))||void 0===i||i.execute(e)},t.prototype.subscribe=function(t,e){var i;this._actions.has(t)||this._actions.set(t,new rt),null===(i=this._actions.get(t))||void 0===i||i.subscribe(e)},t.prototype.unsubscribe=function(t,e){var i=this._actions.get(t);z(i)&&(i.unsubscribe(e),i.isEmpty()&&this._actions.delete(t))},t.prototype.has=function(t){var e=this._actions.get(t);return z(e)&&!e.isEmpty()},t}(),ne={light:{grid:{horizontal:{color:"#EDEDED"},vertical:{color:"#EDEDED"}},candle:{priceMark:{high:{color:"#76808F"},low:{color:"#76808F"}},tooltip:{rect:{color:"#FEFEFE",borderColor:"#F2F3F5"},text:{color:"#76808F"}}},indicator:{tooltip:{text:{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)"},text:{color:"#929AA5"}}},indicator:{tooltip:{text:{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"}}}}};function oe(t){var e;return null!==(e=ne[t])&&void 0!==e?e:null}var re=function(){function t(t,e){this._styles=M(),this._customApi={formatDate:q,formatBigNumber:U},this._locale=dt,this._precision={price:2,volume:0},this._thousandsSeparator=",",this._decimalFoldThreshold=3,this._dataList=[],this._loadMoreCallback=null,this._loadDataCallback=null,this._loading=!0,this._forwardMore=!0,this._backwardMore=!0,this._timeScaleStore=new Dt(this),this._indicatorStore=new Ft(this),this._overlayStore=new ee(this),this._tooltipStore=new Rt(this),this._actionStore=new ie,this._visibleDataList=[],this._chart=t,this.setOptions(e)}return t.prototype.adjustVisibleDataList=function(){this._visibleDataList=[];for(var t=this._timeScaleStore.getVisibleRange(),e=t.realFrom,i=t.realTo,n=e;n<i;n++){var o=this._dataList[n],r=this._timeScaleStore.dataIndexToCoordinate(n);this._visibleDataList.push({dataIndex:n,x:r,data:o})}},t.prototype.setOptions=function(t){var e,i,n,o;if(z(t)){var r=t.locale,a=t.timezone,s=t.styles,l=t.customApi,c=t.thousandsSeparator,u=t.decimalFoldThreshold;if(K(r)&&(this._locale=r),K(a)&&this._timeScaleStore.setTimezone(a),z(s)){var h=null;h=K(s)?oe(s):s,R(this._styles,h),O(null===(i=null===(e=null===h||void 0===h?void 0:h.candle)||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.custom)&&(this._styles.candle.tooltip.custom=null===(o=null===(n=null===h||void 0===h?void 0:h.candle)||void 0===n?void 0:n.tooltip)||void 0===o?void 0:o.custom)}z(l)&&R(this._customApi,l),K(c)&&(this._thousandsSeparator=c),W(u)&&u>0&&(this._decimalFoldThreshold=u)}return this},t.prototype.getStyles=function(){return this._styles},t.prototype.getLocale=function(){return this._locale},t.prototype.getCustomApi=function(){return this._customApi},t.prototype.getThousandsSeparator=function(){return this._thousandsSeparator},t.prototype.getDecimalFoldThreshold=function(){return this._decimalFoldThreshold},t.prototype.getPrecision=function(){return this._precision},t.prototype.setPrecision=function(t){return this._precision=t,this._indicatorStore.synchronizeSeriesPrecision(),this},t.prototype.getDataList=function(){return this._dataList},t.prototype.getVisibleFirstData=function(){var t,e=this._timeScaleStore.getVisibleRange().from;return null!==(t=this._dataList[e])&&void 0!==t?t:null},t.prototype.getVisibleDataList=function(){return this._visibleDataList},t.prototype.addData=function(t,e,i){return g(this,void 0,void 0,function(){var n,o,r,a,s,l,c;return f(this,function(u){switch(u.label){case 0:if(n=!1,o=!1,r=0,O(t)){switch(r=t.length,e){case nt.Init:this.clear(),this._dataList=t,this._forwardMore=null===i||void 0===i||i,this._timeScaleStore.resetOffsetRightDistance(),o=!0;break;case nt.Backward:this._dataList=this._dataList.concat(t),this._backwardMore=null!==i&&void 0!==i&&i,o=r>0;break;case nt.Forward:this._dataList=t.concat(this._dataList),this._forwardMore=null!==i&&void 0!==i&&i,o=r>0}this._loading=!1,n=!0}else a=this._dataList.length,s=t.timestamp,l=j(this._dataList[a-1],"timestamp",0),s>l?(this._dataList.push(t),(c=this._timeScaleStore.getLastBarRightSideDiffBarCount())<0&&this._timeScaleStore.setLastBarRightSideDiffBarCount(--c),r=1,n=!0,o=!0):s===l&&(this._dataList[a-1]=t,n=!0,o=!0);if(!n)return[3,5];u.label=1;case 1:return u.trys.push([1,4,,5]),this._overlayStore.updatePointPosition(r,e),o?(this._timeScaleStore.adjustVisibleRange(),this._tooltipStore.recalculateCrosshair(!0),[4,this._indicatorStore.calcInstance()]):[3,3];case 2:u.sent(),this._chart.adjustPaneViewport(!1,!0,!0,!0),u.label=3;case 3:return this._actionStore.execute(X.OnDataReady),[3,5];case 4:return u.sent(),[3,5];case 5:return[2]}})})},t.prototype.setLoadMoreCallback=function(t){this._loadMoreCallback=t},t.prototype.executeLoadMoreCallback=function(t){this._forwardMore&&!this._loading&&z(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(t))},t.prototype.setLoadDataCallback=function(t){this._loadDataCallback=t},t.prototype.executeLoadDataCallback=function(t){var e=this;if(!this._loading&&z(this._loadDataCallback)&&(this._forwardMore&&t.type===nt.Forward||this._backwardMore&&t.type===nt.Backward)){this._loading=!0,this._loadDataCallback(v(v({},t),{callback:function(i,n){e.addData(i,t.type,n).then(function(){}).catch(function(){})}}))}},t.prototype.clear=function(){this._forwardMore=!0,this._backwardMore=!0,this._loading=!0,this._dataList=[],this._visibleDataList=[],this._timeScaleStore.clear(),this._tooltipStore.clear()},t.prototype.getTimeScaleStore=function(){return this._timeScaleStore},t.prototype.getIndicatorStore=function(){return this._indicatorStore},t.prototype.getOverlayStore=function(){return this._overlayStore},t.prototype.getTooltipStore=function(){return this._tooltipStore},t.prototype.getActionStore=function(){return this._actionStore},t.prototype.getChart=function(){return this._chart},t}(),ae="main",se="xAxis",le="yAxis",ce="separator";var ue=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=pt,this._mediaQueryListener=function(){var t=tt(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=xt("canvas",t),this._ctx=this._element.getContext("2d",{willReadFrequently:!0}),function(){return g(this,void 0,void 0,function(){return f(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,n=t.find(function(t){return t.target===i._element}),o=null===(e=null===n||void 0===n?void 0:n.devicePixelContentBoxSize)||void 0===e?void 0:e[0];z(o)&&(i._nextPixelWidth=o.inlineSize,i._nextPixelHeight=o.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(tt(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,n=t._nextPixelWidth/e,o=t._nextPixelHeight/i;t._width=e,t._height=i,t._pixelWidth=t._nextPixelWidth,t._pixelHeight=t._nextPixelHeight,t._element.width=t._nextPixelWidth,t._element.height=t._nextPixelHeight,t._ctx.scale(n,o)})},t.prototype._executeListener=function(t){var e=this;this._requestAnimationId===pt&&(this._requestAnimationId=vt(function(){e._ctx.clearRect(0,0,e._width,e._height),null===t||void 0===t||t(),e._listener(),e._requestAnimationId=pt}))},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=tt(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(){z(this._resizeObserver)&&this._resizeObserver.unobserve(this._element),z(this._mediaQueryList)&&this._mediaQueryList.removeListener(this._mediaQueryListener)},t}();function he(t){var e={width:0,height:0,left:0,right:0,top:0,bottom:0};return z(t)&&R(e,t),e}var de=function(t){function e(e,i){var n=t.call(this)||this;return n._bounding=he(),n._pane=i,n._rootContainer=e,n._container=n.createContainer(),e.appendChild(n._container),n}return o(e,t),e.prototype.setBounding=function(t){return R(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.update=function(t){this.updateImp(this._container,this._bounding,null!==t&&void 0!==t?t:3)},e.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},e}(Nt),pe=function(t){function e(e,i){var n=t.call(this,e,i)||this;n._mainCanvas=new ue({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){n.updateMain(n._mainCanvas.getContext())}),n._overlayCanvas=new ue({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){n.updateOverlay(n._overlayCanvas.getContext())});var o=n.getContainer();return o.appendChild(n._mainCanvas.getElement()),o.appendChild(n._overlayCanvas.getElement()),n}return o(e,t),e.prototype.createContainer=function(){return xt("div",{margin:"0",padding:"0",position:"absolute",top:"0",overflow:"hidden",boxSizing:"border-box",zIndex:"1"})},e.prototype.updateImp=function(t,e,i){var n=e.width,o=e.height,r=e.left;t.style.left="".concat(r,"px");var a=i,s=t.clientWidth,l=t.clientHeight;switch(n===s&&o===l||(t.style.width="".concat(n,"px"),t.style.height="".concat(o,"px"),a=3),a){case 0:this._mainCanvas.update(n,o);break;case 1:this._overlayCanvas.update(n,o);break;case 3:case 4:this._mainCanvas.update(n,o),this._overlayCanvas.update(n,o)}},e.prototype.destroy=function(){this._mainCanvas.destroy(),this._overlayCanvas.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,o=xt("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=o.getContext("2d"),a=tt(o);return o.width=i*a,o.height=n*a,r.scale(a,a),r.drawImage(this._mainCanvas.getElement(),0,0,i,n),t&&r.drawImage(this._overlayCanvas.getElement(),0,0,i,n),o},e}(de);function ve(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 ge(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n],r=o.x,a=o.y,s=o.r,l=t.x-r,c=t.y-a;if(!(l*l+c*c>s*s))return!0}return!1}function fe(t,e,i){var n=[];n=n.concat(e);var o=i.style,s=void 0===o?a.Fill:o,l=i.color,c=void 0===l?"currentColor":l,u=i.borderSize,h=void 0===u?1:u,d=i.borderColor,p=void 0===d?"currentColor":d,v=i.borderStyle,g=void 0===v?r.Solid:v,f=i.borderDashedValue,m=void 0===f?[2,2]:f,_=!(s!==a.Fill&&i.style!==a.StrokeFill||K(c)&&ve(c));_&&(t.fillStyle=c,n.forEach(function(e){var i=e.x,n=e.y,o=e.r;t.beginPath(),t.arc(i,n,o,0,2*Math.PI),t.closePath(),t.fill()})),(s===a.Stroke||i.style===a.StrokeFill)&&h>0&&!ve(p)&&(t.strokeStyle=p,t.lineWidth=h,g===r.Dashed?t.setLineDash(m):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,o=e.r;(!_||o>h)&&(t.beginPath(),t.arc(i,n,o,0,2*Math.PI),t.closePath(),t.stroke())}))}function me(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){for(var o=!1,r=i[n].coordinates,a=0,s=r.length-1;a<r.length;s=a++)r[a].y>t.y!=r[s].y>t.y&&t.x<(r[s].x-r[a].x)*(t.y-r[a].y)/(r[s].y-r[a].y)+r[a].x&&(o=!o);if(o)return!0}return!1}function _e(t,e,i){var n=[];n=n.concat(e);var o=i.style,s=void 0===o?a.Fill:o,l=i.color,c=void 0===l?"currentColor":l,u=i.borderSize,h=void 0===u?1:u,d=i.borderColor,p=void 0===d?"currentColor":d,v=i.borderStyle,g=void 0===v?r.Solid:v,f=i.borderDashedValue,m=void 0===f?[2,2]:f;s!==a.Fill&&i.style!==a.StrokeFill||K(c)&&ve(c)||(t.fillStyle=c,n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.fill()})),(s===a.Stroke||i.style===a.StrokeFill)&&h>0&&!ve(p)&&(t.strokeStyle=p,t.lineWidth=h,g===r.Dashed?t.setLineDash(m):t.setLineDash([]),n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.stroke()}))}function ye(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n],r=o.x,a=o.width;a<2*Vt&&(r-=Vt,a=2*Vt);var s=o.y,l=o.height;if(l<2*Vt&&(s-=Vt,l=2*Vt),t.x>=r&&t.x<=r+a&&t.y>=s&&t.y<=s+l)return!0}return!1}function xe(t,e,i){var n,o=[];o=o.concat(e);var s=i.style,l=void 0===s?a.Fill:s,c=i.color,u=void 0===c?"transparent":c,h=i.borderSize,d=void 0===h?1:h,p=i.borderColor,v=void 0===p?"transparent":p,g=i.borderStyle,f=void 0===g?r.Solid:g,m=i.borderRadius,_=void 0===m?0:m,y=i.borderDashedValue,x=void 0===y?[2,2]:y,C=null!==(n=t.roundRect)&&void 0!==n?n:t.rect,b=!(l!==a.Fill&&i.style!==a.StrokeFill||K(u)&&ve(u));if(b&&(t.fillStyle=u,o.forEach(function(e){var i=e.x,n=e.y,o=e.width,r=e.height;t.beginPath(),C.call(t,i,n,o,r,_),t.closePath(),t.fill()})),(l===a.Stroke||i.style===a.StrokeFill)&&d>0&&!ve(v)){t.strokeStyle=v,t.fillStyle=v,t.lineWidth=d,f===r.Dashed?t.setLineDash(x):t.setLineDash([]);var S=d%2==1?.5:0,w=Math.round(2*S);o.forEach(function(e){var i=e.x,n=e.y,o=e.width,r=e.height;o>2*d&&r>2*d?(t.beginPath(),C.call(t,i+S,n+S,o-w,r-w,_),t.closePath(),t.stroke()):b||t.fillRect(i,n,o,r)})}}function Ce(t,e){var i,n,o=e.size,r=void 0===o?12:o,a=e.paddingLeft,s=void 0===a?0:a,l=e.paddingTop,c=void 0===l?0:l,u=e.paddingRight,h=void 0===u?0:u,d=e.paddingBottom,p=void 0===d?0:d,v=e.weight,g=void 0===v?"normal":v,f=e.family,m=t.x,_=t.y,y=t.text,x=t.align,C=void 0===x?"left":x,b=t.baseline,S=void 0===b?"top":b,w=t.width,E=t.height,T=null!==w&&void 0!==w?w:s+it(y,r,g,f)+h,I=null!==E&&void 0!==E?E:c+r+p;switch(C){case"left":case"start":i=m;break;case"right":case"end":i=m-T;break;default:i=m-T/2}switch(S){case"top":case"hanging":n=_;break;case"bottom":case"ideographic":case"alphabetic":n=_-I;break;default:n=_-I/2}return{x:i,y:n,width:T,height:I}}function be(t,e,i){var n=[];n=n.concat(e);for(var o=0;o<n.length;o++){var r=Ce(n[o],i),a=r.x,s=r.y,l=r.width,c=r.height;if(t.x>=a&&t.x<=a+l&&t.y>=s&&t.y<=s+c)return!0}return!1}function Se(t,e,i){var n=[];n=n.concat(e);var o=i.color,r=void 0===o?"currentColor":o,a=i.size,s=void 0===a?12:a,l=i.family,c=i.weight,u=i.paddingLeft,h=void 0===u?0:u,d=i.paddingTop,p=void 0===d?0:d,g=i.paddingRight,f=void 0===g?0:g,m=n.map(function(t){return Ce(t,i)});xe(t,m,v(v({},i),{color:i.backgroundColor})),t.textAlign="left",t.textBaseline="top",t.font=et(s,c,l),t.fillStyle=r,n.forEach(function(e,i){var n=m[i];t.fillText(e.text,n.x+h,n.y+p,n.width-h-f)})}var we={name:"text",checkEventOn:be,draw:function(t,e,i){Se(t,e,i)}};function Ee(t,e){var i,n,o,r,a=[];a=a.concat(e);for(var s=0;s<a.length;s++){var l=a[s];if(Math.abs((n=l,void 0,void 0,o=(i=t).x-n.x,r=i.y-n.y,Math.sqrt(o*o+r*r)-l.r))<Vt){var c=l.r,u=l.startAngle,h=l.endAngle,d=c*Math.cos(u)+l.x,p=c*Math.sin(u)+l.y,v=c*Math.cos(h)+l.x,g=c*Math.sin(h)+l.y;if(t.x<=Math.max(d,v)+Vt&&t.x>=Math.min(d,v)-Vt&&t.y<=Math.max(p,g)+Vt&&t.y>=Math.min(p,g)-Vt)return!0}}return!1}function Te(t,e,i){var n=[];n=n.concat(e);var o=i.style,a=void 0===o?r.Solid:o,s=i.size,l=void 0===s?1:s,c=i.color,u=void 0===c?"currentColor":c,h=i.dashedValue,d=void 0===h?[2,2]:h;t.lineWidth=l,t.strokeStyle=u,a===r.Dashed?t.setLineDash(d):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,o=e.r,r=e.startAngle,a=e.endAngle;t.beginPath(),t.arc(i,n,o,r,a),t.stroke(),t.closePath()})}var Ie={};[{name:"circle",checkEventOn:ge,draw:function(t,e,i){fe(t,e,i)}},Gt,{name:"polygon",checkEventOn:me,draw:function(t,e,i){_e(t,e,i)}},{name:"rect",checkEventOn:ye,draw:function(t,e,i){xe(t,e,i)}},we,we,{name:"arc",checkEventOn:Ee,draw:function(t,e,i){Te(t,e,i)}}].forEach(function(t){Ie[t.name]=Wt.extend(t)});var Pe=function(t){function e(e){var i=t.call(this)||this;return i._widget=e,i}return o(e,t),e.prototype.getWidget=function(){return this._widget},e.prototype.createFigure=function(t,e){var i,n,o=(i=t.name,null!==(n=Ie[i])&&void 0!==n?n:null);if(null!==o){var r=new o(t);if(z(e)){for(var a in e)e.hasOwnProperty(a)&&r.registerEvent(a,e[a]);this.addChild(r)}return r}return null},e.prototype.draw=function(t){this.clear(),this.drawImp(t)},e}(Nt),ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e,i,n=this.getWidget(),o=this.getWidget().getPane(),r=o.getChart(),a=n.getBounding(),s=r.getStyles().grid;if(s.show){t.save(),t.globalCompositeOperation="destination-over";var l=s.horizontal;if(l.show){var c=o.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:c,styles:l}))||void 0===e||e.draw(t)}var u=s.vertical;if(u.show){c=r.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:c,styles:u}))||void 0===i||i.draw(t)}t.restore()}},e}(Pe),De=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.eachChildren=function(t){var e=this.getWidget().getPane().getChart().getChartStore(),i=e.getVisibleDataList(),n=e.getTimeScaleStore().getBarSpace();i.forEach(function(e,i){t(e,n,i)})},e}(Pe),Me=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundCandleBarClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getActionStore().execute(X.OnCandleBarClick,t),!1}},e}return o(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget().getPane(),n=i.getId()===Qt,o=i.getChart().getChartStore(),r=this.getCandleBarOptions(o);if(null!==r){var a=0,s=0;if(r.type===h.Ohlc){var l=o.getTimeScaleStore().getBarSpace().gapBar;(a=Math.min(Math.max(Math.round(.2*l),1),8))>2&&a%2==1&&a--,s=Math.floor(s/2)}var c=i.getAxisComponent();this.eachChildren(function(i,o){var l=i.data,u=i.x;if(z(l)){var d=l.open,p=l.high,v=l.low,g=l.close,f=r.type,m=r.styles,_=[];g>d?(_[0]=m.upColor,_[1]=m.upBorderColor,_[2]=m.upWickColor):g<d?(_[0]=m.downColor,_[1]=m.downBorderColor,_[2]=m.downWickColor):(_[0]=m.noChangeColor,_[1]=m.noChangeBorderColor,_[2]=m.noChangeWickColor);var y=c.convertToPixel(d),x=c.convertToPixel(g),C=[y,x,c.convertToPixel(p),c.convertToPixel(v)];C.sort(function(t,e){return t-e});var b=[];switch(f){case h.CandleSolid:b=e._createSolidBar(u,C,o,_);break;case h.CandleStroke:b=e._createStrokeBar(u,C,o,_);break;case h.CandleUpStroke:b=g>d?e._createStrokeBar(u,C,o,_):e._createSolidBar(u,C,o,_);break;case h.CandleDownStroke:b=d>g?e._createStrokeBar(u,C,o,_):e._createSolidBar(u,C,o,_);break;case h.Ohlc:b=[{name:"rect",attrs:[{x:u-s,y:C[0],width:a,height:C[3]-C[0]},{x:u-o.halfGapBar,y:y+a>C[3]?C[3]-a:y,width:o.halfGapBar,height:a},{x:u+s,y:x+a>C[3]?C[3]-a:x,width:o.halfGapBar-s,height:a}],styles:{color:_[0]}}]}b.forEach(function(o){var r,a;n&&(a={mouseClickEvent:e._boundCandleBarClickEvent(i)}),null===(r=e.createFigure(o,a))||void 0===r||r.draw(t)})}})}},e.prototype.getCandleBarOptions=function(t){var e=t.getStyles().candle;return{type:e.type,styles:e.bar}},e.prototype._createSolidBar=function(t,e,i,n){return[{name:"rect",attrs:{x:t,y:e[0],width:1,height:e[3]-e[0]},styles:{color:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:a.StrokeFill,color:n[0],borderColor:n[1]}}]},e.prototype._createStrokeBar=function(t,e,i,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:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:a.Stroke,borderColor:n[1]}}]},e}(De),Ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.getCandleBarOptions=function(t){var e,i,n=this.getWidget().getPane();if(!n.getAxisComponent().isInCandle()){var o=t.getIndicatorStore().getInstances(n.getId());try{for(var r=m(o),a=r.next();!a.done;a=r.next()){var s=a.value;if(s.shouldOhlc&&s.visible){var l=s.styles,c=t.getStyles().indicator,u=j(l,"ohlc.upColor",c.ohlc.upColor),d=j(l,"ohlc.downColor",c.ohlc.downColor),p=j(l,"ohlc.noChangeColor",c.ohlc.noChangeColor);return{type:h.Ohlc,styles:{upColor:u,downColor:d,noChangeColor:p,upBorderColor:u,downBorderColor:d,noChangeBorderColor:p,upWickColor:u,downWickColor:d,noChangeWickColor:p}}}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return null},e.prototype.drawImp=function(e){var i=this;t.prototype.drawImp.call(this,e);var n=this.getWidget(),o=n.getPane(),r=o.getChart(),a=n.getBounding(),s=r.getXAxisPane().getAxisComponent(),l=o.getAxisComponent(),c=r.getChartStore(),u=c.getDataList(),h=c.getTimeScaleStore(),d=h.getVisibleRange(),p=c.getIndicatorStore().getInstances(o.getId()),v=c.getStyles().indicator;e.save(),p.forEach(function(t){var n;if(t.visible){t.zLevel<0?e.globalCompositeOperation="destination-over":e.globalCompositeOperation="source-over";var o=!1;if(null!==t.draw&&(e.save(),o=null!==(n=t.draw({ctx:e,kLineDataList:u,indicator:t,visibleRange:d,bounding:a,barSpace:h.getBarSpace(),defaultStyles:v,xAxis:s,yAxis:l}))&&void 0!==n&&n,e.restore()),!o){var r=t.result,c=[];i.eachChildren(function(n,o){var h,d,p,g=o.halfGapBar,f=n.dataIndex,m=n.x,_=s.convertToPixel(f-1),y=s.convertToPixel(f+1),x=null!==(h=r[f-1])&&void 0!==h?h:null,C=null!==(d=r[f])&&void 0!==d?d:null,b=null!==(p=r[f+1])&&void 0!==p?p:null,S={x:_},w={x:m},E={x:y};t.figures.forEach(function(t){var e=t.key,i=null===x||void 0===x?void 0:x[e];W(i)&&(S[e]=l.convertToPixel(i));var n=null===C||void 0===C?void 0:C[e];W(n)&&(w[e]=l.convertToPixel(n));var o=null===b||void 0===b?void 0:b[e];W(o)&&(E[e]=l.convertToPixel(o))}),at(u,t,f,v,function(t,n,r){var u,h,d;if(z(null===C||void 0===C?void 0:C[t.key])){var p=w[t.key],v=null===(u=t.attrs)||void 0===u?void 0:u.call(t,{data:{prev:x,current:C,next:b},coordinate:{prev:S,current:w,next:E},bounding:a,barSpace:o,xAxis:s,yAxis:l});if(!z(v))switch(t.type){case"circle":v={x:m,y:p,r:Math.max(1,g)};break;case"rect":case"bar":var f=null!==(h=t.baseValue)&&void 0!==h?h:l.getRange().from,_=l.convertToPixel(f),y=Math.abs(_-p);f!==(null===C||void 0===C?void 0:C[t.key])&&(y=Math.max(1,y));v={x:m-g,y:p>_?_:p,width:Math.max(1,2*g),height:y};break;case"line":z(c[r])||(c[r]=[]),W(w[t.key])&&W(E[t.key])&&c[r].push({coordinates:[{x:w.x,y:w[t.key]},{x:E.x,y:E[t.key]}],styles:n})}var T=t.type;z(v)&&"line"!==T&&(null===(d=i.createFigure({name:"bar"===T?"rect":T,attrs:v,styles:n}))||void 0===d||d.draw(e))}})}),c.forEach(function(t){if(t.length>1){for(var n=[{coordinates:[t[0].coordinates[0],t[0].coordinates[1]],styles:t[0].styles}],o=1;o<t.length;o++){var r=n[n.length-1],a=t[o],s=r.coordinates[r.coordinates.length-1];s.x===a.coordinates[0].x&&s.y===a.coordinates[0].y&&r.styles.style===a.styles.style&&r.styles.color===a.styles.color&&r.styles.size===a.styles.size&&r.styles.smooth===a.styles.smooth&&r.styles.dashedValue[0]===a.styles.dashedValue[0]&&r.styles.dashedValue[1]===a.styles.dashedValue[1]?r.coordinates.push(a.coordinates[1]):n.push({coordinates:[a.coordinates[0],a.coordinates[1]],styles:a.styles})}n.forEach(function(t){var n,o=t.coordinates,r=t.styles;null===(n=i.createFigure({name:"line",attrs:{coordinates:o},styles:r}))||void 0===n||n.draw(e)})}})}}}),e.restore()},e}(Me),Le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=e.getBounding(),o=e.getPane().getChart().getChartStore(),r=o.getTooltipStore().getCrosshair(),a=o.getStyles().crosshair;if(K(r.paneId)&&a.show){if(r.paneId===i.getId()){var s=r.y;this._drawLine(t,[{x:0,y:s},{x:n.width,y:s}],a.horizontal)}var l=r.realX;this._drawLine(t,[{x:l,y:0},{x:l,y:n.height}],a.vertical)}},e.prototype._drawLine=function(t,e,i){var n;if(i.show){var o=i.line;o.show&&(null===(n=this.createFigure({name:"line",attrs:{coordinates:e},styles:o}))||void 0===n||n.draw(t))}},e}(Pe),Fe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundIconClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getActionStore().execute(X.OnTooltipIconClick,v({},t)),!0}},e._boundIconMouseMoveEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getTooltipStore().setActiveIcon(v({},t)),!0}},e}return o(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getChart().getChartStore(),o=n.getTooltipStore().getCrosshair();if(z(o.kLineData)){var r=e.getBounding(),a=n.getCustomApi(),s=n.getThousandsSeparator(),l=n.getDecimalFoldThreshold(),c=n.getIndicatorStore().getInstances(i.getId()),u=n.getTooltipStore().getActiveIcon(),h=n.getStyles().indicator,d=h.tooltip,p=d.offsetLeft,v=d.offsetTop,g=d.offsetRight;this.drawIndicatorTooltip(t,i.getId(),n.getDataList(),o,u,c,a,s,l,p,v,r.width-g,h)}},e.prototype.drawIndicatorTooltip=function(t,e,i,n,o,r,a,s,l,c,u,h,d){var p=this,v=d.tooltip;if(this.isDrawTooltip(n,v)){var g=v.text;r.forEach(function(r){var f=0,m={x:c,y:u},y=p.getIndicatorTooltipData(i,n,r,a,s,l,d),x=y.name,C=y.calcParamsText,b=y.values,S=y.icons,w=x.length>0,E=b.length>0;if(w||E){var T=_(p.classifyTooltipIcons(S),3),I=T[0],P=T[1],k=T[2];if(f=p.drawStandardTooltipIcons(t,o,I,m,e,r.name,c,f,h),w){var D=x;C.length>0&&(D="".concat(D).concat(C)),f=p.drawStandardTooltipLegends(t,[{title:{text:"",color:g.color},value:{text:D,color:g.color}}],m,c,f,h,g)}f=p.drawStandardTooltipIcons(t,o,P,m,e,r.name,c,f,h),E&&(f=p.drawStandardTooltipLegends(t,b,m,c,f,h,v.text)),f=p.drawStandardTooltipIcons(t,o,k,m,e,r.name,c,f,h),u=m.y+f}})}return u},e.prototype.drawStandardTooltipIcons=function(t,e,i,n,o,r,a,s,l){var c=this;if(i.length>0){var u=0,h=0;i.forEach(function(e){var i=e.marginLeft,n=void 0===i?0:i,o=e.marginTop,r=void 0===o?0:o,a=e.marginRight,s=void 0===a?0:a,l=e.marginBottom,c=void 0===l?0:l,d=e.paddingLeft,p=void 0===d?0:d,v=e.paddingTop,g=void 0===v?0:v,f=e.paddingRight,m=void 0===f?0:f,_=e.paddingBottom,y=void 0===_?0:_,x=e.size,C=e.fontFamily,b=e.icon;t.font=et(x,"normal",C),u+=n+p+t.measureText(b).width+m+s,h=Math.max(h,r+g+x+y+c)}),n.x+u>l?(n.x=a,n.y+=s,s=h):s=Math.max(s,h),i.forEach(function(i){var a,s=i.marginLeft,l=void 0===s?0:s,u=i.marginTop,h=void 0===u?0:u,d=i.marginRight,p=void 0===d?0:d,v=i.paddingLeft,g=void 0===v?0:v,f=i.paddingTop,m=void 0===f?0:f,_=i.paddingRight,y=void 0===_?0:_,x=i.paddingBottom,C=void 0===x?0:x,b=i.color,S=i.activeColor,w=i.size,E=i.fontFamily,T=i.icon,I=i.backgroundColor,P=i.activeBackgroundColor,k=(null===e||void 0===e?void 0:e.paneId)===o&&(null===e||void 0===e?void 0:e.indicatorName)===r&&(null===e||void 0===e?void 0:e.iconId)===i.id;null===(a=c.createFigure({name:"text",attrs:{text:T,x:n.x+l,y:n.y+h},styles:{paddingLeft:g,paddingTop:m,paddingRight:y,paddingBottom:C,color:k?S:b,size:w,family:E,backgroundColor:k?P:I}},{mouseClickEvent:c._boundIconClickEvent({paneId:o,indicatorName:r,iconId:i.id}),mouseMoveEvent:c._boundIconMouseMoveEvent({paneId:o,indicatorName:r,iconId:i.id})}))||void 0===a||a.draw(t),n.x+=l+g+t.measureText(T).width+y+p})}return s},e.prototype.drawStandardTooltipLegends=function(t,e,i,n,o,r,a){var s=this;if(e.length>0){var l=a.marginLeft,c=a.marginTop,u=a.marginRight,h=a.marginBottom,d=a.size,p=a.family,v=a.weight;t.font=et(d,v,p),e.forEach(function(e){var a,g,f=e.title,m=e.value,_=t.measureText(f.text).width,y=_+t.measureText(m.text).width,x=c+d+h;i.x+l+y+u>r?(i.x=n,i.y+=o,o=x):o=Math.max(o,x),f.text.length>0&&(null===(a=s.createFigure({name:"text",attrs:{x:i.x+l,y:i.y+c,text:f.text},styles:{color:f.color,size:d,family:p,weight:v}}))||void 0===a||a.draw(t)),null===(g=s.createFigure({name:"text",attrs:{x:i.x+l+_,y:i.y+c,text:m.text},styles:{color:m.color,size:d,family:p,weight:v}}))||void 0===g||g.draw(t),i.x+=l+y+u})}return o},e.prototype.isDrawTooltip=function(t,e){var i=e.showRule;return i===s.Always||i===s.FollowCross&&K(t.paneId)},e.prototype.getIndicatorTooltipData=function(t,e,i,n,o,r,a){var s,l,c=a.tooltip,u=c.showName?i.shortName:"",h="",d=i.calcParams;d.length>0&&c.showParams&&(h="(".concat(d.join(","),")"));var p={name:u,calcParamsText:h,values:[],icons:c.icons},v=e.dataIndex,g=null!==(s=i.result)&&void 0!==s?s:[],f=[];if(i.visible){var m=null!==(l=g[v])&&void 0!==l?l:{};at(t,i,v,a,function(t,e){var a;if(K(t.title)){var s=e.color,l=null!==(a=m[t.key])&&void 0!==a?a:c.defaultValue;W(l)&&(l=Z(l,i.precision),i.shouldFormatBigNumber&&(l=n.formatBigNumber(l)),l=J(Q(l,o),r)),f.push({title:{text:t.title,color:s},value:{text:l,color:s}})}}),p.values=f}if(null!==i.createTooltipDataSource){var _=this.getWidget(),y=_.getPane(),x=y.getChart().getChartStore(),C=i.createTooltipDataSource({kLineDataList:t,indicator:i,visibleRange:x.getTimeScaleStore().getVisibleRange(),bounding:_.getBounding(),crosshair:e,defaultStyles:a,xAxis:y.getChart().getXAxisPane().getAxisComponent(),yAxis:y.getAxisComponent()}),b=C.name,S=C.calcParamsText,w=C.values,E=C.icons;if(K(b)&&c.showName&&(p.name=b),K(S)&&c.showParams&&(p.calcParamsText=S),z(E)&&(p.icons=E),z(w)&&i.visible){var T=[],I=a.tooltip.text.color;w.forEach(function(t){var e,a={text:"",color:I};V(t.title)?a=t.title:a.text=t.title;var s={text:"",color:I};if(V(t.value)?s=t.value:s.text=null!==(e=t.value)&&void 0!==e?e:c.defaultValue,W(s.text)){var l=Z(s.text,i.precision);i.shouldFormatBigNumber&&(l=n.formatBigNumber(l)),l=J(Q(l,o),r),s.text=l}T.push({title:a,value:s})}),p.values=T}}return p},e.prototype.classifyTooltipIcons=function(t){var e=[],i=[],n=[];return t.forEach(function(t){switch(t.position){case c.Left:e.push(t);break;case c.Middle:i.push(t);break;case c.Right:n.push(t)}}),[e,i,n]},e}(Pe),Re=function(t){function e(e){var i=t.call(this,e)||this;return i._initEvent(),i}return o(e,t),e.prototype._initEvent=function(){var t=this,e=this.getWidget().getPane(),i=e.getId(),n=e.getChart().getChartStore().getOverlayStore();this.registerEvent("mouseMoveEvent",function(e){var o,r=n.getProgressInstanceInfo();if(null!==r){var a=r.instance,s=r.paneId;a.isStart()&&(n.updateProgressInstanceInfo(i),s=i);var l=a.points.length-1,c="".concat("overlay_figure_","point_").concat(l);return a.isDrawing()&&s===i&&(a.eventMoveForDrawing(t._coordinateToPoint(r.instance,e)),null===(o=a.onDrawing)||void 0===o||o.call(a,v({overlay:a,figureKey:c,figureIndex:l},e))),t._figureMouseMoveEvent(a,1,c,l,0)(e)}return n.setHoverInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseClickEvent",function(e){var o,r,a=n.getProgressInstanceInfo();if(null!==a){var s=a.instance,l=a.paneId;s.isStart()&&(n.updateProgressInstanceInfo(i,!0),l=i);var c=s.points.length-1,u="".concat("overlay_figure_","point_").concat(c);return s.isDrawing()&&l===i&&(s.eventMoveForDrawing(t._coordinateToPoint(s,e)),null===(o=s.onDrawing)||void 0===o||o.call(s,v({overlay:s,figureKey:u,figureIndex:c},e)),s.nextStep(),s.isDrawing()||(n.progressInstanceComplete(),null===(r=s.onDrawEnd)||void 0===r||r.call(s,v({overlay:s,figureKey:u,figureIndex:c},e)))),t._figureMouseClickEvent(s,1,u,c,0)(e)}return n.setClickInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseDoubleClickEvent",function(e){var o,r=n.getProgressInstanceInfo();if(null!==r){var a=r.instance,s=r.paneId;if(a.isDrawing()&&s===i&&(a.forceComplete(),!a.isDrawing())){n.progressInstanceComplete();var l=a.points.length-1,c="".concat("overlay_figure_","point_").concat(l);null===(o=a.onDrawEnd)||void 0===o||o.call(a,v({overlay:a,figureKey:c,figureIndex:l},e))}var u=a.points.length-1;return t._figureMouseClickEvent(a,1,"".concat("overlay_figure_","point_").concat(u),u,0)(e)}return!1}).registerEvent("mouseRightClickEvent",function(e){var i=n.getProgressInstanceInfo();if(null!==i){var o=i.instance;if(o.isDrawing()){var r=o.points.length-1;return t._figureMouseRightClickEvent(o,1,"".concat("overlay_figure_","point_").concat(r),r,0)(e)}}return!1}).registerEvent("mouseUpEvent",function(t){var e,o=n.getPressedInstanceInfo(),r=o.instance,a=o.figureIndex,s=o.figureKey;return null!==r&&(null===(e=r.onPressedMoveEnd)||void 0===e||e.call(r,v({overlay:r,figureKey:s,figureIndex:a},t))),n.setPressedInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1}),!1}).registerEvent("pressedMouseMoveEvent",function(e){var i,o,r=n.getPressedInstanceInfo(),a=r.instance,s=r.figureType,l=r.figureIndex,c=r.figureKey;if(null!==a){if(!(a.lock||null!==(o=null===(i=a.onPressedMoving)||void 0===i?void 0:i.call(a,v({overlay:a,figureIndex:l,figureKey:c},e)))&&void 0!==o&&o)){var u=t._coordinateToPoint(a,e);1===s?a.eventPressedPointMove(u,l):a.eventPressedOtherMove(u,t.getWidget().getPane().getChart().getChartStore().getTimeScaleStore())}return!0}return!1})},e.prototype._createFigureEvents=function(t,e,i,n,o,r){var a;if(!t.isDrawing()){var s=[];if(z(r)&&(Y(r)?r&&(s=["mouseClickEvent","mouseDoubleClickEvent","mouseRightClickEvent","tapEvent","doubleTapEvent","mouseDownEvent","touchStartEvent","mouseMoveEvent","touchMoveEvent"]):s=r),0===s.length)return{mouseMoveEvent:this._figureMouseMoveEvent(t,e,i,n,o),mouseDownEvent:this._figureMouseDownEvent(t,e,i,n,o),mouseClickEvent:this._figureMouseClickEvent(t,e,i,n,o),mouseRightClickEvent:this._figureMouseRightClickEvent(t,e,i,n,o),mouseDoubleClickEvent:this._figureMouseDoubleClickEvent(t,e,i,n,o)};a={},s.includes("mouseMoveEvent")||s.includes("touchMoveEvent")||(a.mouseMoveEvent=this._figureMouseMoveEvent(t,e,i,n,o)),s.includes("mouseDownEvent")||s.includes("touchStartEvent")||(a.mouseDownEvent=this._figureMouseDownEvent(t,e,i,n,o)),s.includes("mouseClickEvent")||s.includes("tapEvent")||(a.mouseClickEvent=this._figureMouseClickEvent(t,e,i,n,o)),s.includes("mouseDoubleClickEvent")||s.includes("doubleTapEvent")||(a.mouseDoubleClickEvent=this._figureMouseDoubleClickEvent(t,e,i,n,o)),s.includes("mouseRightClickEvent")||(a.mouseRightClickEvent=this._figureMouseRightClickEvent(t,e,i,n,o))}return a},e.prototype._figureMouseMoveEvent=function(t,e,i,n,o){var r=this;return function(a){var s=r.getWidget().getPane();return s.getChart().getChartStore().getOverlayStore().setHoverInstanceInfo({paneId:s.getId(),instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o},a),!0}},e.prototype._figureMouseDownEvent=function(t,e,i,n,o){var r=this;return function(a){var s,l=r.getWidget().getPane(),c=l.getId(),u=l.getChart().getChartStore().getOverlayStore();return t.startPressedMove(r._coordinateToPoint(t,a)),null===(s=t.onPressedMoveStart)||void 0===s||s.call(t,v({overlay:t,figureIndex:n,figureKey:i},a)),u.setPressedInstanceInfo({paneId:c,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o}),!0}},e.prototype._figureMouseClickEvent=function(t,e,i,n,o){var r=this;return function(a){var s=r.getWidget().getPane(),l=s.getId();return s.getChart().getChartStore().getOverlayStore().setClickInstanceInfo({paneId:l,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o},a),!0}},e.prototype._figureMouseDoubleClickEvent=function(t,e,i,n,o){return function(e){var o;return null===(o=t.onDoubleClick)||void 0===o||o.call(t,v(v({},e),{figureIndex:n,figureKey:i,overlay:t})),!0}},e.prototype._figureMouseRightClickEvent=function(t,e,i,n,o){var r=this;return function(e){var o,a;null!==(a=null===(o=t.onRightClick)||void 0===o?void 0:o.call(t,v({overlay:t,figureIndex:n,figureKey:i},e)))&&void 0!==a&&a||r.getWidget().getPane().getChart().getChartStore().getOverlayStore().removeInstance(t);return!0}},e.prototype._coordinateToPoint=function(t,e){var i,n={},o=this.getWidget().getPane(),r=o.getChart(),a=o.getId(),s=r.getChartStore().getTimeScaleStore();if(this.coordinateToPointTimestampDataIndexFlag()){var l=r.getXAxisPane().getAxisComponent().convertFromPixel(e.x),c=null!==(i=s.dataIndexToTimestamp(l))&&void 0!==i?i:void 0;n.dataIndex=l,n.timestamp=c}if(this.coordinateToPointValueFlag()){var u=o.getAxisComponent(),h=u.convertFromPixel(e.y);if(t.mode!==st.Normal&&a===Qt&&W(n.dataIndex)){var d=s.getDataByDataIndex(n.dataIndex);if(null!==d){var p=t.modeSensitivity;if(h>d.high)if(t.mode===st.WeakMagnet){var v=u.convertToPixel(d.high);h<u.convertFromPixel(v-p)&&(h=d.high)}else h=d.high;else if(h<d.low)if(t.mode===st.WeakMagnet){var g=u.convertToPixel(d.low);h>u.convertFromPixel(g-p)&&(h=d.low)}else h=d.low;else{var f=Math.max(d.open,d.close),m=Math.min(d.open,d.close);h=h>f?h-f<d.high-h?f:d.high:h<m?h-d.low<m-h?d.low:m:f-h<h-m?f:m}}}n.value=h}return n},e.prototype.coordinateToPointValueFlag=function(){return!0},e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.dispatchEvent=function(e,i,n){return this.getWidget().getPane().getChart().getChartStore().getOverlayStore().isDrawing()?this.onEvent(e,i,n):t.prototype.dispatchEvent.call(this,e,i,n)},e.prototype.checkEventOn=function(){return!0},e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),o=n.getId(),r=n.getChart(),a=n.getAxisComponent(),s=r.getXAxisPane().getAxisComponent(),l=i.getBounding(),c=r.getChartStore(),u=c.getCustomApi(),h=c.getThousandsSeparator(),d=c.getDecimalFoldThreshold(),p=c.getTimeScaleStore(),g=p.getDateTimeFormat(),f=p.getBarSpace(),m=c.getPrecision(),_=c.getStyles().overlay,y=c.getOverlayStore(),x=y.getHoverInstanceInfo(),C=y.getClickInstanceInfo(),b=this.getCompleteOverlays(y,o),S=c.getIndicatorStore().getInstances(o).reduce(function(t,e){var i=e.precision;return t[e.name]=i,t.max=Math.max(t.max,i),t.min=Math.min(t.min,i),t.excludePriceVolumeMax=Math.max(t.excludePriceVolumeMax,i),t.excludePriceVolumeMin=Math.min(t.excludePriceVolumeMin,i),t},v(v({},m),{max:Math.max(m.price,m.volume),min:Math.min(m.price,m.volume),excludePriceVolumeMax:Number.MIN_SAFE_INTEGER,excludePriceVolumeMin:Number.MAX_SAFE_INTEGER}));b.forEach(function(i){i.visible&&e._drawOverlay(t,i,l,f,S,g,u,h,d,_,s,a,x,C,p)});var w=y.getProgressInstanceInfo();if(null!==w){var E=this.getProgressOverlay(w,o);null!==E&&E.visible&&this._drawOverlay(t,E,l,f,S,g,u,h,d,_,s,a,x,C,p)}},e.prototype._drawOverlay=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p,v){var g=e.points.map(function(t){var e,i,n=t.dataIndex;W(t.timestamp)&&(n=v.timestampToDataIndex(t.timestamp));var o={x:0,y:0};return W(n)&&(o.x=null!==(e=null===u||void 0===u?void 0:u.convertToPixel(n))&&void 0!==e?e:0),W(t.value)&&(o.y=null!==(i=null===h||void 0===h?void 0:h.convertToPixel(t.value))&&void 0!==i?i:0),o});if(g.length>0){var f=(new Array).concat(this.getFigures(e,g,i,n,o,s,l,r,c,u,h));this.drawFigures(t,e,f,c)}this.drawDefaultFigures(t,e,g,i,o,r,a,s,l,c,u,h,d,p)},e.prototype.drawFigures=function(t,e,i,n){var o=this;i.forEach(function(i,r){var a=i.type,s=i.styles,l=i.attrs,c=i.ignoreEvent;[].concat(l).forEach(function(l,u){var h,d,p,g=o._createFigureEvents(e,2,null!==(h=i.key)&&void 0!==h?h:"",r,u,c),f=v(v(v({},n[a]),null===(d=e.styles)||void 0===d?void 0:d[a]),s);null===(p=o.createFigure({name:a,attrs:l,styles:f},g))||void 0===p||p.draw(t)})})},e.prototype.getCompleteOverlays=function(t,e){return t.getInstances(e)},e.prototype.getProgressOverlay=function(t,e){return t.paneId===e?t.instance:null},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createPointFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e.prototype.drawDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p){var g,f,m=this;if(e.needDefaultPointFigure&&((null===(g=d.instance)||void 0===g?void 0:g.id)===e.id&&0!==d.figureType||(null===(f=p.instance)||void 0===f?void 0:f.id)===e.id&&0!==p.figureType)){var _=e.styles,y=v(v({},c.point),null===_||void 0===_?void 0:_.point);i.forEach(function(i,n){var o,r,a,s=i.x,l=i.y,c=y.radius,u=y.color,h=y.borderColor,p=y.borderSize;(null===(o=d.instance)||void 0===o?void 0:o.id)===e.id&&1===d.figureType&&d.figureIndex===n&&(c=y.activeRadius,u=y.activeColor,h=y.activeBorderColor,p=y.activeBorderSize),null===(r=m.createFigure({name:"circle",attrs:{x:s,y:l,r:c+p},styles:{color:h}},m._createFigureEvents(e,1,"".concat("overlay_figure_","point_").concat(n),n,0)))||void 0===r||r.draw(t),null===(a=m.createFigure({name:"circle",attrs:{x:s,y:l,r:c},styles:{color:u}}))||void 0===a||a.draw(t)})}},e}(Pe),Be=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._gridView=new ke(n),n._indicatorView=new Ae(n),n._crosshairLineView=new Le(n),n._tooltipView=n.createTooltipView(),n._overlayView=new Re(n),n.addChild(n._tooltipView),n.addChild(n._overlayView),n.getContainer().style.cursor="crosshair",n.registerEvent("mouseMoveEvent",function(){return i.getChart().getChartStore().getTooltipStore().setActiveIcon(),!1}),n}return o(e,t),e.prototype.getName=function(){return ae},e.prototype.updateMain=function(t){this.updateMainContent(t),this._indicatorView.draw(t),this._gridView.draw(t)},e.prototype.createTooltipView=function(){return new Fe(this)},e.prototype.updateMainContent=function(t){},e.prototype.updateOverlay=function(t){this._overlayView.draw(t),this._crosshairLineView.draw(t),this._tooltipView.draw(t)},e}(pe),Oe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._ripplePoint=e.createFigure({name:"circle",attrs:{x:0,y:0,r:0},styles:{style:"fill"}}),e._animationFrameTime=0,e._animation=new ft({iterationCount:1/0}).doFrame(function(t){e._animationFrameTime=t;var i=e.getWidget().getPane();i.getChart().updatePane(0,i.getId())}),e}return o(e,t),e.prototype.drawImp=function(t){var e,i,n,o=this.getWidget(),r=o.getPane(),a=r.getChart(),s=a.getDataList().length-1,l=o.getBounding(),c=r.getAxisComponent(),u=a.getStyles().candle.area,h=[],d=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,v=null;if(this.eachChildren(function(t){var e=t.data,i=t.x,n=null===e||void 0===e?void 0:e[u.value];if(W(n)){var o=c.convertToPixel(n);p===Number.MIN_SAFE_INTEGER&&(p=i),h.push({x:i,y:o}),d=Math.min(d,o),t.dataIndex===s&&(v={x:i,y:o})}}),h.length>0){null===(e=this.createFigure({name:"line",attrs:{coordinates:h},styles:{color:u.lineColor,size:u.lineSize,smooth:u.smooth}}))||void 0===e||e.draw(t);var g=u.backgroundColor,f=void 0;if(O(g)){var m=t.createLinearGradient(0,l.height,0,d);try{g.forEach(function(t){var e=t.offset,i=t.color;m.addColorStop(e,i)})}catch(t){}f=m}else f=g;t.fillStyle=f,t.beginPath(),t.moveTo(p,l.height),t.lineTo(h[0].x,h[0].y),Xt(t,h,u.smooth),t.lineTo(h[h.length-1].x,l.height),t.closePath(),t.fill()}var _=u.point;if(_.show&&z(v)){null===(i=this.createFigure({name:"circle",attrs:{x:v.x,y:v.y,r:_.radius},styles:{style:"fill",color:_.color}}))||void 0===i||i.draw(t);var y=_.rippleRadius;_.animation&&(y=_.radius+this._animationFrameTime/_.animationDuration*(_.rippleRadius-_.radius),this._animation.setDuration(_.animationDuration).start()),null===(n=this._ripplePoint)||void 0===n||n.setAttrs({x:v.x,y:v.y,r:y}).setStyles({style:"fill",color:_.rippleColor}).draw(t)}else this.stopAnimation()},e.prototype.stopAnimation=function(){this._animation.stop()},e}(De),Ne=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e=this.getWidget().getPane(),i=e.getChart().getChartStore(),n=i.getStyles().candle.priceMark,o=n.high,r=n.low;if(n.show&&(o.show||r.show)){var a=i.getThousandsSeparator(),s=i.getDecimalFoldThreshold(),l=i.getPrecision(),c=e.getAxisComponent(),u=Number.MIN_SAFE_INTEGER,h=0,d=Number.MAX_SAFE_INTEGER,p=0;this.eachChildren(function(t){var e=t.data,i=t.x;z(e)&&(u<e.high&&(u=e.high,h=i),d>e.low&&(d=e.low,p=i))});var v=c.convertToPixel(u),g=c.convertToPixel(d);o.show&&u!==Number.MIN_SAFE_INTEGER&&this._drawMark(t,J(Q(Z(u,l.price),a),s),{x:h,y:v},v<g?[-2,-5]:[2,5],o),r.show&&d!==Number.MAX_SAFE_INTEGER&&this._drawMark(t,J(Q(Z(d,l.price),a),s),{x:p,y:g},v<g?[2,5]:[-2,-5],r)}},e.prototype._drawMark=function(t,e,i,n,o){var r,a,s,l,c,u,h=i.x,d=i.y+n[0];null===(r=this.createFigure({name:"line",attrs:{coordinates:[{x:h-2,y:d+n[0]},{x:h,y:d},{x:h+2,y:d+n[0]}]},styles:{color:o.color}}))||void 0===r||r.draw(t),h>this.getWidget().getBounding().width/2?(c=(l=h-5)-o.textOffset,u="right"):(u="left",c=(l=h+5)+o.textOffset);var p=d+n[1];null===(a=this.createFigure({name:"line",attrs:{coordinates:[{x:h,y:d},{x:h,y:p},{x:l,y:p}]},styles:{color:o.color}}))||void 0===a||a.draw(t),null===(s=this.createFigure({name:"text",attrs:{x:c,y:p,text:e,align:u,baseline:"middle"},styles:{color:o.color,size:o.textSize,family:o.textFamily,weight:o.textWeight}}))||void 0===s||s.draw(t)},e}(De),Ve=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getStyles().candle.priceMark,s=a.last,l=s.line;if(a.show&&s.show&&l.show){var c=n.getAxisComponent(),u=r.getDataList(),h=u[u.length-1];if(null!=h){var d=h.close,p=h.open,v=c.convertToNicePixel(d),g=void 0;g=d>p?s.upColor:d<p?s.downColor:s.noChangeColor,null===(e=this.createFigure({name:"line",attrs:{coordinates:[{x:0,y:v},{x:o.width,y:v}]},styles:{style:l.style,color:g,size:l.size,dashedValue:l.dashedValue}}))||void 0===e||e.draw(t)}}},e}(Pe),We={"zh-CN":{time:"时间:",open:"开:",high:"高:",low:"低:",close:"收:",volume:"成交量:",turnover:"成交额:",change:"涨幅:"},"en-US":{time:"Time: ",open:"Open: ",high:"High: ",low:"Low: ",close:"Close: ",volume:"Volume: ",turnover:"Turnover: ",change:"Change: "}};var ze=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getId(),o=i.getChart().getChartStore(),r=o.getTooltipStore().getCrosshair();if(z(r.kLineData)){var a=e.getBounding(),s=i.getYAxisWidget().getBounding(),c=o.getDataList(),u=o.getPrecision(),h=o.getLocale(),d=o.getCustomApi(),p=o.getThousandsSeparator(),v=o.getDecimalFoldThreshold(),g=o.getTooltipStore().getActiveIcon(),f=o.getIndicatorStore().getInstances(i.getId()),m=o.getTimeScaleStore().getDateTimeFormat(),_=o.getStyles(),y=_.candle,x=_.indicator;if(y.tooltip.showType===l.Rect&&x.tooltip.showType===l.Rect){var C=this.isDrawTooltip(r,y.tooltip),b=this.isDrawTooltip(r,x.tooltip);this._drawRectTooltip(t,c,f,a,s,r,u,m,h,d,p,v,C,b,y.tooltip.offsetTop,_)}else if(y.tooltip.showType===l.Standard&&x.tooltip.showType===l.Standard){var S=y.tooltip,w=S.offsetLeft,E=S.offsetTop,T=S.offsetRight,I=a.width-T,P=this._drawCandleStandardTooltip(t,c,n,r,g,u,m,h,d,p,v,w,E,I,y);this.drawIndicatorTooltip(t,n,c,r,g,f,d,p,v,w,P,I,x)}else if(y.tooltip.showType===l.Rect&&x.tooltip.showType===l.Standard){var k=y.tooltip,D=(w=k.offsetLeft,E=k.offsetTop,T=k.offsetRight,I=a.width-T,this.drawIndicatorTooltip(t,n,c,r,g,f,d,p,v,w,E,I,x));C=this.isDrawTooltip(r,y.tooltip);this._drawRectTooltip(t,c,f,a,s,r,u,m,h,d,p,v,C,!1,D,_)}else{var M=y.tooltip,A=(w=M.offsetLeft,E=M.offsetTop,T=M.offsetRight,I=a.width-T,this._drawCandleStandardTooltip(t,c,n,r,g,u,m,h,d,p,v,w,E,I,y));b=this.isDrawTooltip(r,x.tooltip);this._drawRectTooltip(t,c,f,a,s,r,u,m,h,d,p,v,!1,b,A,_)}}},e.prototype._drawCandleStandardTooltip=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p,v){var g,f,m,y=v.tooltip,x=y.text,C=0,b={x:h,y:d};if(this.isDrawTooltip(n,y)){var S=null!==(g=n.dataIndex)&&void 0!==g?g:0,w=this._getCandleTooltipLegends({prev:null!==(f=e[S-1])&&void 0!==f?f:null,current:n.kLineData,next:null!==(m=e[S+1])&&void 0!==m?m:null},r,a,s,l,c,u,v),E=_(this.classifyTooltipIcons(y.icons),3),T=E[0],I=E[1],P=E[2];C=this.drawStandardTooltipIcons(t,o,T,b,i,"",h,C,p),C=this.drawStandardTooltipIcons(t,o,I,b,i,"",h,C,p),w.length>0&&(C=this.drawStandardTooltipLegends(t,w,b,h,C,p,x)),C=this.drawStandardTooltipIcons(t,o,P,b,i,"",h,C,p)}return b.y+C},e.prototype._drawRectTooltip=function(t,e,i,n,o,r,s,l,c,h,p,v,g,f,m,_){var y,x,C,b,S,w=this,E=_.candle,T=_.indicator,I=E.tooltip,P=T.tooltip;if(g||f){var k=null!==(y=r.dataIndex)&&void 0!==y?y:0,D=this._getCandleTooltipLegends({prev:null!==(x=e[k-1])&&void 0!==x?x:null,current:r.kLineData,next:null!==(C=e[k+1])&&void 0!==C?C:null},s,l,c,h,p,v,E),M=I.offsetLeft,A=I.offsetTop,L=I.offsetRight,F=I.offsetBottom,R=I.text,B=R.marginLeft,O=R.marginRight,N=R.marginTop,V=R.marginBottom,W=R.size,z=R.weight,Y=R.family,K=I.rect,H=K.position,X=K.paddingLeft,$=K.paddingRight,G=K.paddingTop,j=K.paddingBottom,q=K.offsetLeft,Z=K.offsetRight,U=K.offsetTop,Q=K.offsetBottom,J=K.borderSize,tt=K.borderRadius,it=K.borderColor,nt=K.color,ot=0,rt=0,at=0;g&&(t.font=et(W,z,Y),D.forEach(function(e){var i=e.title,n=e.value,o="".concat(i.text).concat(n.text),r=t.measureText(o).width+B+O;ot=Math.max(ot,r)}),at+=(V+N+W)*D.length);var st=P.text,lt=st.marginLeft,ct=st.marginRight,ut=st.marginTop,ht=st.marginBottom,dt=st.size,pt=st.weight,vt=st.family,gt=[];if(f&&(t.font=et(dt,pt,vt),i.forEach(function(i){var n,o=null!==(n=w.getIndicatorTooltipData(e,r,i,h,p,v,T).values)&&void 0!==n?n:[];gt.push(o),o.forEach(function(e){var i=e.title,n=e.value,o="".concat(i.text).concat(n.text),r=t.measureText(o).width+lt+ct;ot=Math.max(ot,r),at+=ut+ht+dt})})),0!==(rt+=ot)&&0!==at){rt+=2*J+X+$,at+=2*J+G+j;var ft=n.width/2,mt=H===u.Pointer&&r.paneId===Qt,_t=(null!==(b=r.realX)&&void 0!==b?b:0)>ft,yt=0;if(mt){var xt=r.realX;yt=_t?xt-Z-rt:xt+q}else _t?(yt=q+M,_.yAxis.inside&&_.yAxis.position===d.Left&&(yt+=o.width)):(yt=n.width-Z-rt-L,_.yAxis.inside&&_.yAxis.position===d.Right&&(yt-=o.width));var Ct=m+U;if(mt)(Ct=r.y-at/2)+at>n.height-Q-F&&(Ct=n.height-Q-at-F),Ct<m+U&&(Ct=m+U+A);null===(S=this.createFigure({name:"rect",attrs:{x:yt,y:Ct,width:rt,height:at},styles:{style:a.StrokeFill,color:nt,borderColor:it,borderSize:J,borderRadius:tt}}))||void 0===S||S.draw(t);var bt=yt+J+X+B,St=Ct+J+G;if(g&&D.forEach(function(e){var i,n;St+=N;var o=e.title;null===(i=w.createFigure({name:"text",attrs:{x:bt,y:St,text:o.text},styles:{color:o.color,size:W,family:Y,weight:z}}))||void 0===i||i.draw(t);var r=e.value;null===(n=w.createFigure({name:"text",attrs:{x:yt+rt-J-O-$,y:St,text:r.text,align:"right"},styles:{color:r.color,size:W,family:Y,weight:z}}))||void 0===n||n.draw(t),St+=W+V}),f){var wt=yt+J+X+lt;gt.forEach(function(e){e.forEach(function(e){var i,n;St+=ut;var o=e.title,r=e.value;null===(i=w.createFigure({name:"text",attrs:{x:wt,y:St,text:o.text},styles:{color:o.color,size:dt,family:vt,weight:pt}}))||void 0===i||i.draw(t),null===(n=w.createFigure({name:"text",attrs:{x:yt+rt-J-ct-$,y:St,text:r.text,align:"right"},styles:{color:r.color,size:dt,family:vt,weight:pt}}))||void 0===n||n.draw(t),St+=dt+ht})})}}}},e.prototype._getCandleTooltipLegends=function(t,e,i,n,o,r,a,s){var l,c,u,h,d,p=s.tooltip,g=p.text.color,f=t.current,m=null!==(c=null===(l=t.prev)||void 0===l?void 0:l.close)&&void 0!==c?c:f.close,_=f.close-m,y=e.price,x=e.volume,C={"{time}":o.formatDate(i,f.timestamp,"YYYY-MM-DD HH:mm",ct.Tooltip),"{open}":J(Q(Z(f.open,y),r),a),"{high}":J(Q(Z(f.high,y),r),a),"{low}":J(Q(Z(f.low,y),r),a),"{close}":J(Q(Z(f.close,y),r),a),"{volume}":J(Q(o.formatBigNumber(Z(null!==(u=f.volume)&&void 0!==u?u:p.defaultValue,x)),r),a),"{turnover}":J(Q(Z(null!==(h=f.turnover)&&void 0!==h?h:p.defaultValue,y),r),a),"{change}":0===m?p.defaultValue:"".concat(Q(Z(_/m*100),r),"%")};return(null!==(d=N(p.custom)?p.custom(t,s):p.custom)&&void 0!==d?d:[]).map(function(t){var e,i=t.title,o=t.value,r={text:"",color:""};V(i)?r=v({},i):(r.text=i,r.color=g),r.text=function(t,e){var i,n;return null!==(n=null===(i=We[e])||void 0===i?void 0:i[t])&&void 0!==n?n:t}(r.text,n);var a={text:p.defaultValue,color:""};V(o)?a=v({},o):(a.text=o,a.color=g);var l=a.text.match(/{(\S*)}/);if(null!==l&&l.length>1){var c="{".concat(l[1],"}");a.text=a.text.replace(c,null!==(e=C[c])&&void 0!==e?e:p.defaultValue),"{change}"===c&&(a.color=0===_?s.priceMark.last.noChangeColor:_>0?s.priceMark.last.upColor:s.priceMark.last.downColor)}return{title:r,value:a}})},e}(Fe),Ye=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._candleBarView=new Me(n),n._candleAreaView=new Oe(n),n._candleHighLowPriceView=new Ne(n),n._candleLastPriceLineView=new Ve(n),n.addChild(n._candleBarView),n}return o(e,t),e.prototype.updateMainContent=function(t){this.getPane().getChart().getStyles().candle.type!==h.Area?(this._candleBarView.draw(t),this._candleHighLowPriceView.draw(t),this._candleAreaView.stopAnimation()):this._candleAreaView.draw(t),this._candleLastPriceLineView.draw(t)},e.prototype.createTooltipView=function(){return new ze(this)},e}(Be),Ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e,i,n=this,o=this.getWidget(),r=o.getPane(),a=o.getBounding(),s=r.getAxisComponent(),l=this.getAxisStyles(r.getChart().getStyles());if(l.show){l.axisLine.show&&(null===(e=this.createFigure({name:"line",attrs:this.createAxisLine(a,l),styles:l.axisLine}))||void 0===e||e.draw(t));var c=s.getTicks();if(l.tickLine.show)this.createTickLines(c,a,l).forEach(function(e){var i;null===(i=n.createFigure({name:"line",attrs:e,styles:l.tickLine}))||void 0===i||i.draw(t)});if(l.tickText.show){var u=this.createTickTexts(c,a,l);null===(i=this.createFigure({name:"text",attrs:u,styles:l.tickText}))||void 0===i||i.draw(t)}}},e}(Pe),He=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.getAxisStyles=function(t){return t.yAxis},e.prototype.createAxisLine=function(t,e){var i,n=this.getWidget().getPane().getAxisComponent(),o=e.axisLine.size;return{coordinates:[{x:i=n.isFromZero()?0:t.width-o,y:0},{x:i,y:t.height}]}},e.prototype.createTickLines=function(t,e,i){var n=this.getWidget().getPane().getAxisComponent(),o=i.axisLine,r=i.tickLine,a=0,s=0;return n.isFromZero()?(a=0,o.show&&(a+=o.size),s=a+r.length):(a=e.width,o.show&&(a-=o.size),s=a-r.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 n=this.getWidget().getPane().getAxisComponent(),o=i.axisLine,r=i.tickLine,a=i.tickText,s=0;n.isFromZero()?(s=a.marginStart,o.show&&(s+=o.size),r.show&&(s+=r.length)):(s=e.width-a.marginEnd,o.show&&(s-=o.size),r.show&&(s-=r.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}(Ke),Xe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getStyles().candle.priceMark,s=a.last,l=s.text;if(a.show&&s.show&&l.show){var c=r.getPrecision(),u=n.getAxisComponent(),h=r.getDataList(),d=h[h.length-1];if(z(d)){var g=d.close,f=d.open,m=u.convertToNicePixel(g),_=void 0;_=g>f?s.upColor:g<f?s.downColor:s.noChangeColor;var y=void 0;if(u.getType()===p.Percentage){var x=r.getVisibleFirstData().close;y="".concat(((g-x)/x*100).toFixed(2),"%")}else y=Z(g,c.price);y=J(Q(y,r.getThousandsSeparator()),r.getDecimalFoldThreshold());var C=void 0,b=void 0;u.isFromZero()?(C=0,b="left"):(C=o.width,b="right"),null===(e=this.createFigure({name:"text",attrs:{x:C,y:m,text:y,align:b,baseline:"middle"},styles:v(v({},l),{backgroundColor:_})}))||void 0===e||e.draw(t)}}},e}(Pe),$e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getCustomApi(),s=r.getStyles().indicator,l=s.lastValueMark,c=l.text;if(l.show){var u=n.getAxisComponent(),h=r.getDataList(),d=h.length-1,p=r.getIndicatorStore().getInstances(n.getId()),g=r.getThousandsSeparator(),f=r.getDecimalFoldThreshold();p.forEach(function(i){var n=i.result[d];if(z(n)&&i.visible){var r=i.precision;at(h,i,d,s,function(s,l){var h,d=n[s.key];if(W(d)){var p=u.convertToNicePixel(d),m=Z(d,r);i.shouldFormatBigNumber&&(m=a.formatBigNumber(m)),m=J(Q(m,g),f);var _=void 0,y=void 0;u.isFromZero()?(_=0,y="left"):(_=o.width,y="right"),null===(h=e.createFigure({name:"text",attrs:{x:_,y:p,text:m,align:y,baseline:"middle"},styles:v(v({},c),{backgroundColor:l.color})}))||void 0===h||h.draw(t)}})}})}},e}(Pe),Ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!1},e.prototype.drawDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p){this.drawFigures(t,e,this.getDefaultFigures(e,i,n,o,r,a,s,l,u,h,p),c)},e.prototype.getDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d,p=[];if(t.needDefaultYAxisFigure&&t.id===(null===(h=u.instance)||void 0===h?void 0:h.id)&&u.paneId===this.getWidget().getPane().getId()){var v,g,f=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;null!==(d=null===c||void 0===c?void 0:c.isFromZero())&&void 0!==d&&d?(v="left",g=0):(v="right",g=i.width),e.forEach(function(e,i){var o=t.points[i];if(W(o.value)){f=Math.min(f,e.y),m=Math.max(m,e.y);var r=J(Q(Z(o.value,n.price),a),s);p.push({type:"text",attrs:{x:g,y:e.y,text:r,align:v,baseline:"middle"},ignoreEvent:!0})}}),e.length>1&&p.unshift({type:"rect",attrs:{x:0,y:f,width:i.width,height:m-f},ignoreEvent:!0})}return p},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createYAxisFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e}(Re),je=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=i.getPane().getChart().getChartStore(),a=r.getTooltipStore().getCrosshair(),s=r.getStyles().crosshair;if(K(a.paneId)&&this.compare(a,n.getId())&&s.show){var l=this.getDirectionStyles(s),c=l.text;if(l.show&&c.show){var u=n.getAxisComponent(),h=this.getText(a,r,u);t.font=et(c.size,c.weight,c.family),null===(e=this.createFigure({name:"text",attrs:this.getTextAttrs(h,t.measureText(h).width,a,o,u,c),styles:c}))||void 0===e||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 n,o=i,r=i.convertFromPixel(t.y);if(o.getType()===p.Percentage){var a=e.getVisibleFirstData();n="".concat(((r-a.close)/a.close*100).toFixed(2),"%")}else{var s=e.getIndicatorStore().getInstances(t.paneId),l=0,c=!1;o.isInCandle()?l=e.getPrecision().price:s.forEach(function(t){l=Math.max(t.precision,l),c||(c=t.shouldFormatBigNumber)}),n=Z(r,l),c&&(n=e.getCustomApi().formatBigNumber(n))}return J(Q(n,e.getThousandsSeparator()),e.getDecimalFoldThreshold())},e.prototype.getTextAttrs=function(t,e,i,n,o,r){var a,s;return o.isFromZero()?(a=0,s="left"):(a=n.width,s="right"),{x:a,y:i.y,text:t,align:s,baseline:"middle"}},e}(Pe),qe=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._yAxisView=new He(n),n._candleLastPriceLabelView=new Xe(n),n._indicatorLastValueView=new $e(n),n._overlayYAxisView=new Ge(n),n._crosshairHorizontalLabelView=new je(n),n.getContainer().style.cursor="ns-resize",n.addChild(n._overlayYAxisView),n}return o(e,t),e.prototype.getName=function(){return le},e.prototype.updateMain=function(t){this._yAxisView.draw(t),this.getPane().getAxisComponent().isInCandle()&&this._candleLastPriceLabelView.draw(t),this._indicatorLastValueView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayYAxisView.draw(t),this._crosshairHorizontalLabelView.draw(t)},e}(pe),Ze=function(){function t(t){this._range={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._prevRange={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._ticks=[],this._autoCalcTickFlag=!0,this._parent=t}return t.prototype.getParent=function(){return this._parent},t.prototype.buildTicks=function(t){if(this._autoCalcTickFlag&&(this._range=this.calcRange()),this._prevRange.from!==this._range.from||this._prevRange.to!==this._range.to||t){this._prevRange=this._range;var e=this.optimalTicks(this._calcTicks());return this._ticks=this.createTicks({range:this._range,bounding:this.getSelfBounding(),defaultTicks:e}),!0}return!1},t.prototype.getTicks=function(){return this._ticks},t.prototype.getScrollZoomEnabled=function(){var t;return null===(t=this.getParent().getOptions().axisOptions.scrollZoomEnabled)||void 0===t||t},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.prototype._calcTicks=function(){var t=this._range,e=t.realFrom,i=t.realTo,n=t.realRange,o=[];if(n>=0){var r=_(this._calcTickInterval(n),2),a=r[0],s=r[1],l=bt(Math.ceil(e/a)*a,s),c=bt(Math.floor(i/a)*a,s),u=0,h=l;if(0!==a)for(;h<=c;){var d=h.toFixed(s);o[u]={text:d,coord:0,value:d},++u,h+=a}}return o},t.prototype._calcTickInterval=function(t){var e,i,n,o,r=(e=t/8,i=Math.floor(wt(e)),n=Et(i),e=((o=e/n)<1.5?1:o<2.5?2:o<3.5?3:o<4.5?4:o<5.5?5:o<6.5?6:8)*n,i>=-20?+e.toFixed(i<0?-i:0):e);return[r,function(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}(r)]},t}(),Ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.calcRange=function(){var t,e,i,n,o=this.getParent(),r=o.getChart(),a=r.getChartStore(),s=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,c=[],u=!1,d=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER;a.getIndicatorStore().getInstances(o.getId()).forEach(function(t){var e,i,n;u||(u=null!==(e=t.shouldOhlc)&&void 0!==e&&e),g=Math.min(g,t.precision),W(t.minValue)&&(d=Math.min(d,t.minValue)),W(t.maxValue)&&(v=Math.max(v,t.maxValue)),c.push({figures:null!==(i=t.figures)&&void 0!==i?i:[],result:null!==(n=t.result)&&void 0!==n?n:[]})});var f=4,m=this.isInCandle();if(m){var _=a.getPrecision().price;f=g!==Number.MAX_SAFE_INTEGER?Math.min(g,_):_}else g!==Number.MAX_SAFE_INTEGER&&(f=g);var y=a.getVisibleDataList(),x=r.getStyles().candle,C=x.type===h.Area,b=x.area.value,S=m&&!C||!m&&u;y.forEach(function(t){var e=t.dataIndex,i=t.data;if(z(i)&&(S&&(s=Math.min(s,i.low),l=Math.max(l,i.high)),m&&C)){var n=i[b];W(n)&&(s=Math.min(s,n),l=Math.max(l,n))}c.forEach(function(t){var i,n=t.figures,o=null!==(i=t.result[e])&&void 0!==i?i:{};n.forEach(function(t){var e=o[t.key];W(e)&&(s=Math.min(s,e),l=Math.max(l,e))})})}),s!==Number.MAX_SAFE_INTEGER&&l!==Number.MIN_SAFE_INTEGER?(s=Math.min(d,s),l=Math.max(v,l)):(s=0,l=10);var w,E=this.getType();switch(E){case p.Percentage:var T=a.getVisibleFirstData();z(T)&&W(T.close)&&(s=(s-T.close)/T.close*100,l=(l-T.close)/T.close*100),w=Math.pow(10,-2);break;case p.Log:s=wt(s),l=wt(l),w=.05*Et(-f);break;default:w=Et(-f)}if(s===l||Math.abs(s-l)<w){var I=d===s,P=v===l;s=I?s:P?s-8*w:s-4*w,l=P?l:I?l+8*w:l+4*w}var k=null!==(e=null===(t=this.getParent().getYAxisWidget())||void 0===t?void 0:t.getBounding().height)&&void 0!==e?e:0,D=o.getOptions().gap,M=null!==(i=null===D||void 0===D?void 0:D.top)&&void 0!==i?i:.2;M>=1&&(M/=k);var A=null!==(n=null===D||void 0===D?void 0:D.bottom)&&void 0!==n?n:.1;A>=1&&(A/=k);var L,F,R,B=Math.abs(l-s);return s-=B*A,l+=B*M,B=Math.abs(l-s),E===p.Log?(L=Et(s),F=Et(l),R=Math.abs(F-L)):(L=s,F=l,R=B),{from:s,to:l,range:B,realFrom:L,realTo:F,realRange:R}},e.prototype._innerConvertToPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=this.getRange(),r=(t-o.from)/o.range;return this.isReverse()?Math.round(r*n):Math.round((1-r)*n)},e.prototype.isInCandle=function(){return this.getParent().getId()===Qt},e.prototype.getType=function(){return this.isInCandle()?this.getParent().getChart().getStyles().yAxis.type:p.Normal},e.prototype.getPosition=function(){return this.getParent().getChart().getStyles().yAxis.position},e.prototype.isReverse=function(){return!!this.isInCandle()&&this.getParent().getChart().getStyles().yAxis.reverse},e.prototype.isFromZero=function(){var t=this.getParent().getChart().getStyles().yAxis,e=t.inside;return t.position===d.Left&&e||t.position===d.Right&&!e},e.prototype.optimalTicks=function(t){var e,i,n=this,o=this.getParent(),r=null!==(i=null===(e=o.getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,a=o.getChart().getChartStore(),s=a.getCustomApi(),l=[],c=this.getType(),u=a.getIndicatorStore().getInstances(o.getId()),h=a.getThousandsSeparator(),d=a.getDecimalFoldThreshold(),v=0,g=!1;this.isInCandle()?v=a.getPrecision().price:u.forEach(function(t){v=Math.max(v,t.precision),g||(g=t.shouldFormatBigNumber)});var f,m=a.getStyles().xAxis.tickText.size;return t.forEach(function(t){var e,i=t.value,o=n._innerConvertToPixel(+i);switch(c){case p.Percentage:e="".concat(Z(i,2),"%");break;case p.Log:o=n._innerConvertToPixel(wt(+i)),e=Z(i,v);break;default:e=Z(i,v),g&&(e=s.formatBigNumber(i))}e=J(Q(e,h),d);var a=W(f);o>m&&o<r-m&&(a&&Math.abs(f-o)>2*m||!a)&&(l.push({text:e,coord:o,value:i}),f=o)}),l},e.prototype.getAutoSize=function(){var t=this.getParent(),e=t.getChart(),i=e.getStyles(),n=i.yAxis,o=n.size;if("auto"!==o)return o;var r=e.getChartStore(),a=r.getCustomApi(),s=0;if(n.show&&(n.axisLine.show&&(s+=n.axisLine.size),n.tickLine.show&&(s+=n.tickLine.length),n.tickText.show)){var l=0;this.getTicks().forEach(function(t){l=Math.max(l,it(t.text,n.tickText.size,n.tickText.weight,n.tickText.family))}),s+=n.tickText.marginStart+n.tickText.marginEnd+l}var c=i.crosshair,u=0;if(c.show&&c.horizontal.show&&c.horizontal.text.show){var h=0,d=!1;r.getIndicatorStore().getInstances(t.getId()).forEach(function(t){h=Math.max(t.precision,h),d||(d=t.shouldFormatBigNumber)});var v=2;if(this.getType()!==p.Percentage)if(this.isInCandle()){var g=r.getPrecision().price,f=i.indicator.lastValueMark;v=f.show&&f.text.show?Math.max(h,g):g}else v=h;var m=Z(this.getRange().to,v);d&&(m=a.formatBigNumber(m)),m=J(m,r.getDecimalFoldThreshold()),u+=c.horizontal.text.paddingLeft+c.horizontal.text.paddingRight+2*c.horizontal.text.borderSize+it(m,c.horizontal.text.size,c.horizontal.text.weight,c.horizontal.text.family)}return Math.max(s,u)},e.prototype.getSelfBounding=function(){return this.getParent().getYAxisWidget().getBounding()},e.prototype.convertFromPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=this.getRange(),r=o.from,a=o.range,s=(this.isReverse()?t/n:1-t/n)*a+r;switch(this.getType()){case p.Percentage:var l=this.getParent().getChart().getChartStore().getVisibleFirstData();return z(l)&&W(l.close)?l.close*s/100+l.close:0;case p.Log:return Et(s);default:return s}},e.prototype.convertToRealValue=function(t){var e=t;return this.getType()===p.Log&&(e=Et(t)),e},e.prototype.convertToPixel=function(t){var e=t;switch(this.getType()){case p.Percentage:var i=this.getParent().getChart().getChartStore().getVisibleFirstData();z(i)&&W(i.close)&&(e=(t-i.close)/i.close*100);break;case p.Log:e=wt(t);break;default:e=t}return this._innerConvertToPixel(e)},e.prototype.convertToNicePixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=this.convertToPixel(t);return Math.round(Math.max(.05*n,Math.min(o,.98*n)))},e.extend=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return o(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e)},e}(Ze),Qe={default:Ue.extend({name:"default",createTicks:function(t){return t.defaultTicks}})};var Je=function(){function t(t,e,i,n){this._bounding=he(),this._chart=i,this._id=n,this._init(t,e)}return t.prototype._init=function(t,e){this._rootContainer=t,this._container=xt("div",{width:"100%",margin:"0",padding:"0",position:"relative",overflow:"hidden",boxSizing:"border-box"}),null!==e?t.insertBefore(this._container,e):t.appendChild(this._container)},t.prototype.getContainer=function(){return this._container},t.prototype.getId=function(){return this._id},t.prototype.getChart=function(){return this._chart},t.prototype.getBounding=function(){return this._bounding},t.prototype.update=function(t){this._bounding.height!==this._container.clientHeight&&(this._container.style.height="".concat(this._bounding.height,"px")),this.updateImp(null!==t&&void 0!==t?t:3,this._container,this._bounding)},t.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},t}(),ti=function(t){function e(e,i,n,o,r){var a=t.call(this,e,i,n,o)||this;a._yAxisWidget=null,a._options={minHeight:Ut,dragEnabled:!0,gap:{top:.2,bottom:.1},axisOptions:{name:"default",scrollZoomEnabled:!0}};var s=a.getContainer();return a._mainWidget=a.createMainWidget(s),a._yAxisWidget=a.createYAxisWidget(s),a.setOptions(r),a}return o(e,t),e.prototype.setOptions=function(t){var e,i,n,o,r,a=null===(e=t.axisOptions)||void 0===e?void 0:e.name;return(this._options.axisOptions.name!==a&&K(a)||!z(this._axis))&&(this._axis=this.createAxisComponent(null!==a&&void 0!==a?a:"default")),R(this._options,t),this.getId()===te?(o=this.getMainWidget().getContainer(),r="ew-resize"):(o=this.getYAxisWidget().getContainer(),r="ns-resize"),null===(n=null===(i=t.axisOptions)||void 0===i?void 0:i.scrollZoomEnabled)||void 0===n||n?o.style.cursor=r:o.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){var n,o;R(this.getBounding(),t);var r={};return z(t.height)&&(r.height=t.height),z(t.top)&&(r.top=t.top),this._mainWidget.setBounding(r),null===(n=this._yAxisWidget)||void 0===n||n.setBounding(r),z(e)&&this._mainWidget.setBounding(e),z(i)&&(null===(o=this._yAxisWidget)||void 0===o||o.setBounding(i)),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)||void 0===e||e.update(t)},e.prototype.destroy=function(){var e;t.prototype.destroy.call(this),this._mainWidget.destroy(),null===(e=this._yAxisWidget)||void 0===e||e.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,o=xt("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=o.getContext("2d"),a=tt(o);o.width=i*a,o.height=n*a,r.scale(a,a);var s=this._mainWidget.getBounding();if(r.drawImage(this._mainWidget.getImage(t),s.left,0,s.width,s.height),null!==this._yAxisWidget){var l=this._yAxisWidget.getBounding();r.drawImage(this._yAxisWidget.getImage(t),l.left,0,l.width,l.height)}return o},e.prototype.createYAxisWidget=function(t){return null},e}(Je),ei=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.createAxisComponent=function(t){return new(function(t){var e;return null!==(e=Qe[t])&&void 0!==e?e:Qe.default}(null!==t&&void 0!==t?t:"default"))(this)},e.prototype.createMainWidget=function(t){return new Be(t,this)},e.prototype.createYAxisWidget=function(t){return new qe(t,this)},e}(ti),ii=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.createMainWidget=function(t){return new Ye(t,this)},e}(ei),ni=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(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 n=i.tickLine,o=i.axisLine.size;return t.map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:o+n.length}]}})},e.prototype.createTickTexts=function(t,e,i){var n=i.tickText,o=i.axisLine.size,r=i.tickLine.length;return t.map(function(t){return{x:t.coord,y:o+r+n.marginStart,text:t.text,align:"center",baseline:"top"}})},e}(Ke),oi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.coordinateToPointValueFlag=function(){return!1},e.prototype.getCompleteOverlays=function(t){return t.getInstances()},e.prototype.getProgressOverlay=function(t){return t.instance},e.prototype.getDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d=[];if(t.needDefaultXAxisFigure&&t.id===(null===(h=u.instance)||void 0===h?void 0:h.id)){var p=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER;e.forEach(function(e,i){p=Math.min(p,e.x),v=Math.max(v,e.x);var n=t.points[i];if(W(n.timestamp)){var a=r.formatDate(o,n.timestamp,"YYYY-MM-DD HH:mm",ct.Crosshair);d.push({type:"text",attrs:{x:e.x,y:0,text:a,align:"center"},ignoreEvent:!0})}}),e.length>1&&d.unshift({type:"rect",attrs:{x:p,y:0,width:v-p,height:i.height},ignoreEvent:!0})}return d},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createXAxisFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e}(Ge),ri=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.compare=function(t){return z(t.kLineData)&&t.dataIndex===t.realDataIndex},e.prototype.getDirectionStyles=function(t){return t.vertical},e.prototype.getText=function(t,e){var i,n=null===(i=t.kLineData)||void 0===i?void 0:i.timestamp;return e.getCustomApi().formatDate(e.getTimeScaleStore().getDateTimeFormat(),n,"YYYY-MM-DD HH:mm",ct.Crosshair)},e.prototype.getTextAttrs=function(t,e,i,n,o,r){var a,s=i.realX,l="center";return s-e/2-r.paddingLeft<0?(a=0,l="left"):s+e/2+r.paddingRight>n.width?(a=n.width,l="right"):a=s,{x:a,y:0,text:t,align:l,baseline:"top"}},e}(je),ai=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._xAxisView=new ni(n),n._overlayXAxisView=new oi(n),n._crosshairVerticalLabelView=new ri(n),n.getContainer().style.cursor="ew-resize",n.addChild(n._overlayXAxisView),n}return o(e,t),e.prototype.getName=function(){return se},e.prototype.updateMain=function(t){this._xAxisView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayXAxisView.draw(t),this._crosshairVerticalLabelView.draw(t)},e}(pe),si=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.calcRange=function(){var t=this.getParent().getChart().getChartStore().getTimeScaleStore().getVisibleRange(),e=t.from,i=t.to,n=i-1,o=i-e;return{from:e,to:n,range:o,realFrom:e,realTo:n,realRange:o}},e.prototype.optimalTicks=function(t){var e,i,n=this.getParent().getChart(),o=n.getChartStore(),r=o.getCustomApi().formatDate,a=[],s=t.length,l=o.getDataList();if(s>0){var c=o.getTimeScaleStore().getDateTimeFormat(),u=n.getStyles().xAxis.tickText,h=it("00-00 00:00",u.size,u.weight,u.family),d=parseInt(t[0].value,10),p=this.convertToPixel(d),v=1;if(s>1){var g=parseInt(t[1].value,10),f=this.convertToPixel(g),m=Math.abs(f-p);m<h&&(v=Math.ceil(h/m))}for(var _=0;_<s;_+=v){var y=parseInt(t[_].value,10),x=l[y].timestamp,C=r(c,x,"HH:mm",ct.XAxis);if(0!==_){var b=l[parseInt(t[_-v].value,10)].timestamp;C=null!==(e=this._optimalTickLabel(r,c,x,b))&&void 0!==e?e:C}var S=this.convertToPixel(y);a.push({text:C,coord:S,value:x})}if(1===a.length)a[0].text=r(c,a[0].value,"YYYY-MM-DD HH:mm",ct.XAxis);else{var w=a[0].value,E=a[1].value;if(z(a[2])){var T=a[2].text;/^[0-9]{2}-[0-9]{2}$/.test(T)?a[0].text=r(c,w,"MM-DD",ct.XAxis):/^[0-9]{4}-[0-9]{2}$/.test(T)?a[0].text=r(c,w,"YYYY-MM",ct.XAxis):/^[0-9]{4}$/.test(T)&&(a[0].text=r(c,w,"YYYY",ct.XAxis))}else a[0].text=null!==(i=this._optimalTickLabel(r,c,w,E))&&void 0!==i?i:a[0].text}}return a},e.prototype._optimalTickLabel=function(t,e,i,n){var o=t(e,i,"YYYY",ct.XAxis),r=t(e,i,"YYYY-MM",ct.XAxis),a=t(e,i,"MM-DD",ct.XAxis);return o!==t(e,n,"YYYY",ct.XAxis)?o:r!==t(e,n,"YYYY-MM",ct.XAxis)?r:a!==t(e,n,"MM-DD",ct.XAxis)?a:null},e.prototype.getAutoSize=function(){var t=this.getParent().getChart().getStyles(),e=t.xAxis,i=e.size;if("auto"!==i)return i;var n=t.crosshair,o=0;e.show&&(e.axisLine.show&&(o+=e.axisLine.size),e.tickLine.show&&(o+=e.tickLine.length),e.tickText.show&&(o+=e.tickText.marginStart+e.tickText.marginEnd+e.tickText.size));var r=0;return n.show&&n.vertical.show&&n.vertical.text.show&&(r+=n.vertical.text.paddingTop+n.vertical.text.paddingBottom+2*n.vertical.text.borderSize+n.vertical.text.size),Math.max(o,r)},e.prototype.getSelfBounding=function(){return this.getParent().getMainWidget().getBounding()},e.prototype.convertTimestampFromPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.coordinateToDataIndex(t);return e.dataIndexToTimestamp(i)},e.prototype.convertTimestampToPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.timestampToDataIndex(t);return e.dataIndexToCoordinate(i)},e.prototype.convertFromPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().coordinateToDataIndex(t)},e.prototype.convertToPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().dataIndexToCoordinate(t)},e.extend=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return o(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e)},e}(Ze),li={default:si.extend({name:"default",createTicks:function(t){return t.defaultTicks}})};var ci=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.createAxisComponent=function(t){return new(function(t){var e;return null!==(e=li[t])&&void 0!==e?e:li.default}(t))(this)},e.prototype.createMainWidget=function(t){return new ai(t,this)},e}(ti);var ui=function(t){function e(e,i){var n,o,r,a=t.call(this,e,i)||this;return a._dragFlag=!1,a._dragStartY=0,a._topPaneHeight=0,a._bottomPaneHeight=0,a._pressedMouseMoveEvent=(n=a._pressedTouchMouseMoveEvent,o=20,r=0,function(){var t=Date.now();t-r>o&&(n.apply(this,arguments),r=t)}),a.registerEvent("touchStartEvent",a._mouseDownEvent.bind(a)).registerEvent("touchMoveEvent",a._pressedMouseMoveEvent.bind(a)).registerEvent("touchEndEvent",a._mouseUpEvent.bind(a)).registerEvent("mouseDownEvent",a._mouseDownEvent.bind(a)).registerEvent("mouseUpEvent",a._mouseUpEvent.bind(a)).registerEvent("pressedMouseMoveEvent",a._pressedMouseMoveEvent.bind(a)).registerEvent("mouseEnterEvent",a._mouseEnterEvent.bind(a)).registerEvent("mouseLeaveEvent",a._mouseLeaveEvent.bind(a)),a}return o(e,t),e.prototype.getName=function(){return ce},e.prototype.checkEventOn=function(){return!0},e.prototype._mouseDownEvent=function(t){this._dragFlag=!0,this._dragStartY=t.pageY;var e=this.getPane();return this._topPaneHeight=e.getTopPane().getBounding().height,this._bottomPaneHeight=e.getBottomPane().getBounding().height,!0},e.prototype._mouseUpEvent=function(){return this._dragFlag=!1,this._mouseLeaveEvent()},e.prototype._pressedTouchMouseMoveEvent=function(t){var e=t.pageY-this._dragStartY,i=this.getPane(),n=i.getTopPane(),o=i.getBottomPane(),r=e<0;if(null!==n&&(null===o||void 0===o?void 0:o.getOptions().dragEnabled)){var a=void 0,s=void 0,l=void 0,c=void 0;r?(a=n,s=o,l=this._topPaneHeight,c=this._bottomPaneHeight):(a=o,s=n,l=this._bottomPaneHeight,c=this._topPaneHeight);var u=a.getOptions().minHeight;if(l>u){var h=Math.max(l-Math.abs(e),u),d=l-h;a.setBounding({height:h}),s.setBounding({height:c+d});var p=i.getChart();p.getChartStore().getActionStore().execute(X.OnPaneDrag,{paneId:i.getId()}),p.adjustPaneViewport(!0,!0,!0,!0,!0)}}return!0},e.prototype._mouseEnterEvent=function(){var t,e=this.getPane(),i=e.getBottomPane();if(null!==(t=null===i||void 0===i?void 0:i.getOptions().dragEnabled)&&void 0!==t&&t){var n=e.getChart().getStyles().separator;return this.getContainer().style.background=n.activeBackgroundColor,!0}return!1},e.prototype._mouseLeaveEvent=function(){return!this._dragFlag&&(this.getContainer().style.background="",!0)},e.prototype.createContainer=function(){return xt("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 n=this.getPane().getChart().getStyles().separator;t.style.top="".concat(-Math.floor((7-n.size)/2),"px"),t.style.height="".concat(7,"px")}},e}(de),hi=function(t){function e(e,i,n,o,r,a){var s=t.call(this,e,i,n,o)||this;return s.getContainer().style.overflow="",s._topPane=r,s._bottomPane=a,s._separatorWidget=new ui(s.getContainer(),s),s}return o(e,t),e.prototype.setBounding=function(t){return R(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,n=e.height,o=this.getChart().getStyles().separator,r=xt("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),a=r.getContext("2d"),s=tt(r);return r.width=i*s,r.height=n*s,a.scale(s,s),a.fillStyle=o.color,a.fillRect(0,0,i,n),r},e.prototype.updateImp=function(t,e,i){if(4===t||2===t){var n=this.getChart().getStyles().separator;e.style.backgroundColor=n.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}(Je);function di(){var t;return"undefined"!=typeof window&&(null!==(t=window.navigator.userAgent.toLowerCase().indexOf("firefox"))&&void 0!==t?t:-1)>-1}function pi(){return"undefined"!=typeof window&&/iPhone|iPad|iPod/.test(window.navigator.platform)}var vi,gi=function(){function t(t,e,i){var n=this;this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},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=!pi(),this._onFirefoxOutsideMouseUp=function(t){n._mouseUpHandler(t)},this._onMobileSafariDoubleClick=function(t){n._firesTouchEvents(t)?(++n._tapCount,null!==n._tapTimeoutId&&n._tapCount>1&&(n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._tapCoordinate).manhattanDistance<30&&!n._cancelTap&&n._processEvent(n._makeCompatEvent(t),n._handler.doubleTapEvent),n._resetTapTimeout())):(++n._clickCount,null!==n._clickTimeoutId&&n._clickCount>1&&(n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._clickCoordinate).manhattanDistance<5&&!n._cancelClick&&n._processEvent(n._makeCompatEvent(t),n._handler.mouseDoubleClickEvent),n._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,n,o=this;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this);var r=this._mouseMoveHandler.bind(this);this._unsubscribeMousemove=function(){o._target.removeEventListener("mousemove",r)},this._target.addEventListener("mousemove",r);var a=this._mouseWheelHandler.bind(this);this._unsubscribeMouseWheel=function(){o._target.removeEventListener("wheel",a)},this._target.addEventListener("wheel",a,{passive:!1});var s=this._contextMenuHandler.bind(this);this._unsubscribeContextMenu=function(){o._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:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},t.prototype._resetTapTimeout=function(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},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)){if(!z(this._handler.mouseWheelHortEvent))return;if(this._preventDefault(t),0===Math.abs(t.deltaX))return;this._handler.mouseWheelHortEvent(this._makeCompatEvent(t),-t.deltaX)}else{if(!z(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&&(this._lastTouchEventTimeStamp=this._eventTimeStamp(t),null===this._startPinchMiddleCoordinate&&!this._preventTouchDragProcess)){this._pinchPrevented=!0;var i=this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._touchMoveStartCoordinate),n=i.xOffset,o=i.yOffset,r=i.manhattanDistance;if(this._touchMoveExceededManhattanDistance||!(r<5)){if(!this._touchMoveExceededManhattanDistance){var a=.5*n,s=o>=a&&!this._options.treatVertDragAsPageScroll(),l=a>o&&!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),n=Math.abs(e.y-t.y);return{xOffset:i,yOffset:n,manhattanDistance:i+n}},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);if(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();else this._cancelTap||(this._processEvent(i,this._handler.tapEvent),z(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);if(this._mouseMoveStartCoordinate=null,this._mousePressed=!1,null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),di())this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp);if(!this._firesTouchEvents(t))if(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();else 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 n=this._touchMoveHandler.bind(this),o=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=function(){i.removeEventListener("touchmove",n),i.removeEventListener("touchend",o)},i.addEventListener("touchmove",n,{passive:!1}),i.addEventListener("touchend",o,{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)return this._preventDefault(t),void this._processEvent(this._makeCompatEvent(t),this._handler.mouseRightClickEvent);if(0===t.button){var e=this._target.ownerDocument.documentElement;di()&&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),n=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=function(){e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",n)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",n),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}),pi()&&(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;(z(this._handler.pinchStartEvent)||z(this._handler.pinchEvent)||z(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&&z(t._handler.pinchEvent)){var i=t._getTouchDistance(e.touches[0],e.touches[1])/t._startPinchDistance;t._handler.pinchEvent(v(v({},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,i=null!==(e=this._target.getBoundingClientRect())&&void 0!==e?e:{left:0,top:0};this._startPinchMiddleCoordinate={x:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,y:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this._startPinchDistance=this._getTouchDistance(t[0],t[1]),z(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,z(this._handler.pinchEndEvent)&&this._handler.pinchEndEvent({x:0,y:0,pageX:0,pageY:0}))},t.prototype._mouseLeaveHandler=function(t){var e,i,n;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this),this._firesTouchEvents(t)||this._acceptMouseLeave&&(this._processEvent(this._makeCompatEvent(t),this._handler.mouseLeaveEvent),this._acceptMouseLeave=!pi())},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 z(null===(e=t.sourceCapabilities)||void 0===e?void 0:e.firesTouchEvents)?t.sourceCapabilities.firesTouchEvents:this._eventTimeStamp(t)<this._lastTouchEventTimeStamp+500},t.prototype._processEvent=function(t,e){null===e||void 0===e||e.call(this._handler,t)},t.prototype._makeCompatEvent=function(t,e){var i,n=this,o=null!==e&&void 0!==e?e:t,r=null!==(i=this._target.getBoundingClientRect())&&void 0!==i?i:{left:0,top:0};return{x:o.clientX-r.left,y:o.clientY-r.top,pageX:o.pageX,pageY:o.pageY,isTouch:!t.type.startsWith("mouse")&&"contextmenu"!==t.type&&"click"!==t.type&&"wheel"!==t.type,preventDefault:function(){"touchstart"!==t.type&&n._preventDefault(t)}}},t.prototype._getTouchDistance=function(t,e){var i=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(i*i+n*n)},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)&&void 0!==e?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}(),fi=function(){function t(t,e){var i=this;this._flingStartTime=(new Date).getTime(),this._flingScrollRequestId=null,this._startScrollCoordinate=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().getTimeScaleStore().zoom(.5);break;case"Minus":i._chart.getChartStore().getTimeScaleStore().zoom(-.5);break;case"ArrowLeft":(e=i._chart.getChartStore().getTimeScaleStore()).startScroll(),e.scroll(-3*e.getBarSpace().bar);break;case"ArrowRight":var e;(e=i._chart.getChartStore().getTimeScaleStore()).startScroll(),e.scroll(3*e.getBarSpace().bar)}},this._container=t,this._chart=e,this._event=new gi(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),n=i.pane,o=i.widget;if((null===n||void 0===n?void 0:n.getId())!==te&&(null===o||void 0===o?void 0:o.getName())===ae){var r=this._makeWidgetEvent(t,o),a=5*(e-this._pinchScale);return this._pinchScale=e,this._chart.getChartStore().getTimeScaleStore().zoom(a,{x:r.x,y:r.y}),!0}return!1},t.prototype.mouseWheelHortEvent=function(t,e){var i=this._chart.getChartStore().getTimeScaleStore();return i.startScroll(),i.scroll(e),!0},t.prototype.mouseWheelVertEvent=function(t,e){var i=this._findWidgetByEvent(t).widget,n=this._makeWidgetEvent(t,i);return(null===i||void 0===i?void 0:i.getName())===ae&&(this._chart.getChartStore().getTimeScaleStore().zoom(e,{x:n.x,y:n.y}),!0)},t.prototype.mouseDownEvent=function(t){var e,i,n=this._findWidgetByEvent(t),o=n.pane,r=n.widget;if(this._mouseDownWidget=r,null!==r){var a=this._makeWidgetEvent(t,r);switch(r.getName()){case ce:return r.dispatchEvent("mouseDownEvent",a);case ae:var s=null!==(e=o.getAxisComponent().getRange())&&void 0!==e?e:null;return this._prevYAxisRange=null===s?s:v({},s),this._startScrollCoordinate={x:a.x,y:a.y},this._chart.getChartStore().getTimeScaleStore().startScroll(),r.dispatchEvent("mouseDownEvent",a);case se:return(l=r.dispatchEvent("mouseDownEvent",a))&&this._chart.updatePane(1),this._xAxisStartScaleCoordinate={x:a.x,y:a.y},this._xAxisStartScaleDistance=a.pageX,l;case le:var l;(l=r.dispatchEvent("mouseDownEvent",a))&&this._chart.updatePane(1);s=null!==(i=o.getAxisComponent().getRange())&&void 0!==i?i:null;return this._prevYAxisRange=null===s?s:v({},s),this._yAxisStartScaleDistance=a.pageY,l}}return!1},t.prototype.mouseMoveEvent=function(t){var e,i,n,o=this._findWidgetByEvent(t),r=o.pane,a=o.widget,s=this._makeWidgetEvent(t,a);if((null===(e=this._mouseMoveTriggerWidgetInfo.pane)||void 0===e?void 0:e.getId())===(null===r||void 0===r?void 0:r.getId())&&(null===(i=this._mouseMoveTriggerWidgetInfo.widget)||void 0===i?void 0:i.getName())===(null===a||void 0===a?void 0:a.getName())||(null===a||void 0===a||a.dispatchEvent("mouseEnterEvent",s),null===(n=this._mouseMoveTriggerWidgetInfo.widget)||void 0===n||n.dispatchEvent("mouseLeaveEvent",s),this._mouseMoveTriggerWidgetInfo={pane:r,widget:a}),null!==a)switch(a.getName()){case ae:var l=a.dispatchEvent("mouseMoveEvent",s),c=this._chart.getChartStore(),u={x:s.x,y:s.y,paneId:null===r||void 0===r?void 0:r.getId()};return l&&null!==c.getTooltipStore().getActiveIcon()&&(u=void 0,null!==a&&(a.getContainer().style.cursor="pointer")),this._chart.getChartStore().getTooltipStore().setCrosshair(u),l;case ce:case se:case le:l=a.dispatchEvent("mouseMoveEvent",s);return this._chart.getChartStore().getTooltipStore().setCrosshair(),l}return!1},t.prototype.pressedMouseMoveEvent=function(t){var e,i,n,o,r;if(null!==this._mouseDownWidget&&this._mouseDownWidget.getName()===ce)return this._mouseDownWidget.dispatchEvent("pressedMouseMoveEvent",t);var a=this._findWidgetByEvent(t),s=a.pane,l=a.widget;if(null!==l&&(null===(e=this._mouseDownWidget)||void 0===e?void 0:e.getPane().getId())===(null===s||void 0===s?void 0:s.getId())&&(null===(i=this._mouseDownWidget)||void 0===i?void 0:i.getName())===l.getName()){var c=this._makeWidgetEvent(t,l);switch(l.getName()){case ae:var u=l.getBounding();if(!(S=l.dispatchEvent("pressedMouseMoveEvent",c))&&null!==this._startScrollCoordinate){var h=s.getAxisComponent();if(null!==this._prevYAxisRange&&!h.getAutoCalcTickFlag()&&h.getScrollZoomEnabled()){var d=this._prevYAxisRange,p=d.from,v=d.to,g=p+(E=(w=d.range)*(C=(null!==(n=null===h||void 0===h?void 0:h.isReverse())&&void 0!==n&&n?this._startScrollCoordinate.y-c.y:c.y-this._startScrollCoordinate.y)/u.height)),f=v+E,m=h.convertToRealValue(g),_=h.convertToRealValue(f);h.setRange({from:g,to:f,range:f-g,realFrom:m,realTo:_,realRange:_-m})}var y=c.x-this._startScrollCoordinate.x;this._chart.getChartStore().getTimeScaleStore().scroll(y)}return this._chart.getChartStore().getTooltipStore().setCrosshair({x:c.x,y:c.y,paneId:null===s||void 0===s?void 0:s.getId()}),S;case se:if(S=l.dispatchEvent("pressedMouseMoveEvent",c))this._chart.updatePane(1);else{var x=s.getAxisComponent();if(null===(o=null===x||void 0===x?void 0:x.getScrollZoomEnabled())||void 0===o||o){var C=this._xAxisStartScaleDistance/c.pageX;if(Number.isFinite(C)){var b=10*(C-this._xAxisScale);this._xAxisScale=C,this._chart.getChartStore().getTimeScaleStore().zoom(b,null!==(r=this._xAxisStartScaleCoordinate)&&void 0!==r?r:void 0)}}}return S;case le:var S;if(S=l.dispatchEvent("pressedMouseMoveEvent",c))this._chart.updatePane(1);else{h=s.getAxisComponent();if(null!==this._prevYAxisRange&&h.getScrollZoomEnabled()){var w,E,T=this._prevYAxisRange,I=(p=T.from,v=T.to,(w=T.range)*(C=c.pageY/this._yAxisStartScaleDistance));g=p-(E=(I-w)/2),f=v+E,m=h.convertToRealValue(g),_=h.convertToRealValue(f);h.setRange({from:g,to:f,range:I,realFrom:m,realTo:_,realRange:_-m}),this._chart.adjustPaneViewport(!1,!0,!0,!0)}}return S}}return!1},t.prototype.mouseUpEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var n=this._makeWidgetEvent(t,e);switch(e.getName()){case ae:case ce:case se:case le:i=e.dispatchEvent("mouseUpEvent",n)}i&&this._chart.updatePane(1)}return 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 n=this._makeWidgetEvent(t,e);switch(e.getName()){case ae:case se:case le:i=e.dispatchEvent("mouseRightClickEvent",n)}i&&this._chart.updatePane(1)}return!1},t.prototype.mouseDoubleClickEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n)switch(n.getName()){case ae:var o=this._makeWidgetEvent(t,n);return n.dispatchEvent("mouseDoubleClickEvent",o);case le:var r=i.getAxisComponent();if(!r.getAutoCalcTickFlag())return r.setAutoCalcTickFlag(!0),this._chart.adjustPaneViewport(!1,!0,!0,!0),!0}return!1},t.prototype.mouseLeaveEvent=function(){return this._chart.getChartStore().getTooltipStore().setCrosshair(),!0},t.prototype.touchStartEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n){var o=this._makeWidgetEvent(t,n);switch(n.getName()){case ae:var r=this._chart.getChartStore(),a=r.getTooltipStore();if(n.dispatchEvent("mouseDownEvent",o))return this._touchCancelCrosshair=!0,this._touchCoordinate=null,a.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;if(null!==this._flingScrollRequestId&&(gt(this._flingScrollRequestId),this._flingScrollRequestId=null),this._flingStartTime=(new Date).getTime(),this._startScrollCoordinate={x:o.x,y:o.y},r.getTimeScaleStore().startScroll(),this._touchZoomed=!1,null!==this._touchCoordinate){var s=o.x-this._touchCoordinate.x,l=o.y-this._touchCoordinate.y;Math.sqrt(s*s+l*l)<10?(this._touchCoordinate={x:o.x,y:o.y},a.setCrosshair({x:o.x,y:o.y,paneId:null===i||void 0===i?void 0:i.getId()})):(this._touchCoordinate=null,this._touchCancelCrosshair=!0,a.setCrosshair())}return!0;case se:case le:var c=n.dispatchEvent("mouseDownEvent",o);return c&&this._chart.updatePane(1),c}}return!1},t.prototype.touchMoveEvent=function(t){var e,i,n,o=this._findWidgetByEvent(t),r=o.pane,a=o.widget;if(null!==a){var s=this._makeWidgetEvent(t,a),l=a.getName(),c=this._chart.getChartStore(),u=c.getTooltipStore();switch(l){case ae:if(a.dispatchEvent("pressedMouseMoveEvent",s))return null===(e=s.preventDefault)||void 0===e||e.call(s),u.setCrosshair(void 0,{notInvalidate:!0}),this._chart.updatePane(1),!0;if(null!==this._touchCoordinate)null===(i=s.preventDefault)||void 0===i||i.call(s),u.setCrosshair({x:s.x,y:s.y,paneId:null===r||void 0===r?void 0:r.getId()});else if(null!==this._startScrollCoordinate&&Math.abs(this._startScrollCoordinate.x-s.x)>this._startScrollCoordinate.y-s.y){var h=s.x-this._startScrollCoordinate.x;c.getTimeScaleStore().scroll(h)}return!0;case se:case le:var d=a.dispatchEvent("pressedMouseMoveEvent",s);return d&&(null===(n=s.preventDefault)||void 0===n||n.call(s),this._chart.updatePane(1)),d}}return!1},t.prototype.touchEndEvent=function(t){var e=this,i=this._findWidgetByEvent(t).widget;if(null!==i){var n=this._makeWidgetEvent(t,i);switch(i.getName()){case ae:if(i.dispatchEvent("mouseUpEvent",n),null!==this._startScrollCoordinate){var o=(new Date).getTime()-this._flingStartTime,r=(n.x-this._startScrollCoordinate.x)/(o>0?o:1)*20;if(o<200&&Math.abs(r)>0){var a=this._chart.getChartStore().getTimeScaleStore(),s=function(){e._flingScrollRequestId=vt(function(){a.startScroll(),a.scroll(r),r*=.975,Math.abs(r)<1?null!==e._flingScrollRequestId&&(gt(e._flingScrollRequestId),e._flingScrollRequestId=null):s()})};s()}}return!0;case se:case le:i.dispatchEvent("mouseUpEvent",n)&&this._chart.updatePane(1)}}return!1},t.prototype.tapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget,o=!1;if(null!==n){var r=this._makeWidgetEvent(t,n),a=n.dispatchEvent("mouseClickEvent",r);if(n.getName()===ae){var s=this._makeWidgetEvent(t,n),l=this._chart.getChartStore().getTooltipStore();a?(this._touchCancelCrosshair=!0,this._touchCoordinate=null,l.setCrosshair(void 0,{notInvalidate:!0}),o=!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?void 0:i.getId()},{notInvalidate:!0}),o=!0),this._touchCancelCrosshair=!1)}(o||a)&&this._chart.updatePane(1)}return o},t.prototype.doubleTapEvent=function(t){return this.mouseDoubleClickEvent(t)},t.prototype.longTapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n&&n.getName()===ae){var o=this._makeWidgetEvent(t,n);return this._touchCoordinate={x:o.x,y:o.y},this._chart.getChartStore().getTooltipStore().setCrosshair({x:o.x,y:o.y,paneId:null===i||void 0===i?void 0:i.getId()}),!0}return!1},t.prototype._findWidgetByEvent=function(t){var e,i,n,o,r=t.x,a=t.y,s=this._chart.getAllSeparatorPanes(),l=this._chart.getChartStore().getStyles().separator.size;try{for(var c=m(s),u=c.next();!u.done;u=c.next()){var h=_(u.value,2)[1],d=(y=h.getBounding()).top-Math.round((7-l)/2);if(r>=y.left&&r<=y.left+y.width&&a>=d&&a<=d+7)return{pane:h,widget:h.getWidget()}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}var p=this._chart.getAllDrawPanes(),v=null;try{for(var g=m(p),f=g.next();!f.done;f=g.next()){var y,x=f.value;if(r>=(y=x.getBounding()).left&&r<=y.left+y.width&&a>=y.top&&a<=y.top+y.height){v=x;break}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(o=g.return)&&o.call(g)}finally{if(n)throw n.error}}var C=null;if(null!==v){if(null===C){var b=v.getMainWidget(),S=b.getBounding();r>=S.left&&r<=S.left+S.width&&a>=S.top&&a<=S.top+S.height&&(C=b)}if(null===C){var w=v.getYAxisWidget();if(null!==w){var E=w.getBounding();r>=E.left&&r<=E.left+E.width&&a>=E.top&&a<=E.top+E.height&&(C=w)}}}return{pane:v,widget:C}},t.prototype._makeWidgetEvent=function(t,e){var i,n,o,r=null!==(i=null===e||void 0===e?void 0:e.getBounding())&&void 0!==i?i:null;return v(v({},t),{x:t.x-(null!==(n=null===r||void 0===r?void 0:r.left)&&void 0!==n?n:0),y:t.y-(null!==(o=null===r||void 0===r?void 0:r.top)&&void 0!==o?o:0)})},t.prototype.destroy=function(){this._container.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._event.destroy()},t}();!function(t){t.Root="root",t.Main="main",t.YAxis="yAxis"}(vi||(vi={}));var mi=function(){function t(t,e){this._drawPanes=[],this._separatorPanes=new Map,this._initContainer(t),this._chartEvent=new fi(this._chartContainer,this),this._chartStore=new re(this,e),this._initPanes(e),this.adjustPaneViewport(!0,!0,!0)}return t.prototype._initContainer=function(t){this._container=t,this._chartContainer=xt("div",{position:"relative",width:"100%",outline:"none",borderStyle:"none",cursor:"crosshair",boxSizing:"border-box",userSelect:"none",webkitUserSelect:"none",msUserSelect:"none",MozUserSelect:"none",webkitTapHighlightColor:"transparent"}),this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)},t.prototype._initPanes=function(t){var e,i=this,n=!1,o=!1,r=function(t){if(!o){var e=i._createPane(ci,te,null!==t&&void 0!==t?t:{});i._xAxisPane=e,o=!0}};(null!==(e=null===t||void 0===t?void 0:t.layout)&&void 0!==e?e:[{type:"candle"}]).forEach(function(t){var e,o,a;switch(t.type){case"candle":if(!n){var s=null!==(e=t.options)&&void 0!==e?e:{};R(s,{id:Qt}),i._candlePane=i._createPane(ii,Qt,s),(l=null!==(o=t.content)&&void 0!==o?o:[]).forEach(function(t){i.createIndicator(t,!0,s)}),n=!0}break;case"indicator":var l,c;if((l=null!==(a=t.content)&&void 0!==a?a:[]).length>0)l.forEach(function(e){z(c)?i.createIndicator(e,!0,{id:c}):c=i.createIndicator(e,!0,t.options)});break;case"xAxis":r(t.options)}}),r({position:"bottom"})},t.prototype._createPane=function(t,e,i){var n,o=null,r=null;switch(null===i||void 0===i?void 0:i.position){case"top":var a=this._drawPanes[0];z(a)&&(r=new t(this._chartContainer,a.getContainer(),this,e,null!==i&&void 0!==i?i:{}),o=0);break;case"bottom":break;default:for(var s=this._drawPanes.length-1;s>-1;s--){var l=this._drawPanes[s],c=this._drawPanes[s-1];if("bottom"===(null===l||void 0===l?void 0:l.getOptions().position)&&"bottom"!==(null===c||void 0===c?void 0:c.getOptions().position)){r=new t(this._chartContainer,l.getContainer(),this,e,null!==i&&void 0!==i?i:{}),o=s;break}}}if(z(r)||(r=new t(this._chartContainer,null,this,e,null!==i&&void 0!==i?i:{})),W(o)?(this._drawPanes.splice(o,0,r),n=o):(this._drawPanes.push(r),n=this._drawPanes.length-1),r.getId()!==te){var u=this._drawPanes[n+1];if(z(u)&&u.getId()===te&&(u=this._drawPanes[n+2]),z(u))z(d=this._separatorPanes.get(u))?d.setTopPane(r):(d=new hi(this._chartContainer,u.getContainer(),this,"",r,u),this._separatorPanes.set(u,d));var h=this._drawPanes[n-1];if(z(h)&&h.getId()===te&&(h=this._drawPanes[n-2]),z(h)){var d=new hi(this._chartContainer,r.getContainer(),this,"",h,r);this._separatorPanes.set(r,d)}}return r},t.prototype._measurePaneHeight=function(){var t,e=this,i=Math.floor(this._container.clientHeight),n=this._chartStore.getStyles().separator.size,o=this._xAxisPane.getAxisComponent().getAutoSize(),r=i-o-this._separatorPanes.size*n;r<0&&(r=0);var a=0;this._drawPanes.forEach(function(t){if(t.getId()!==Qt&&t.getId()!==te){var e=t.getBounding().height,i=t.getOptions().minHeight;e<i&&(e=i),a+e>r?(a=r,e=Math.max(r-a,0)):a+=e,t.setBounding({height:e})}});var s=r-a;null===(t=this._candlePane)||void 0===t||t.setBounding({height:s}),this._xAxisPane.setBounding({height:o});var l=0;this._drawPanes.forEach(function(t){var i=e._separatorPanes.get(t);z(i)&&(i.setBounding({height:n,top:l}),l+=n),t.setBounding({top:l}),l+=t.getBounding().height})},t.prototype._measurePaneWidth=function(){var t=this,e=Math.floor(this._container.clientWidth),i=this._chartStore.getStyles(),n=i.yAxis,o=n.position===d.Left,r=!n.inside,a=0,s=0,l=0,c=0;this._drawPanes.forEach(function(t){t.getId()!==te&&(s=Math.max(s,t.getAxisComponent().getAutoSize()))}),s>e&&(s=e),r?(a=e-s,o?(l=0,c=s):(l=e-s,c=0)):(a=e,c=0,l=o?0:e-s),this._chartStore.getTimeScaleStore().setTotalBarSpace(a);var u,h={width:e},p={width:a,left:c},v={width:s,left:l},g=i.separator.fill;u=r&&!g?p:h,this._drawPanes.forEach(function(e){var i;null===(i=t._separatorPanes.get(e))||void 0===i||i.setBounding(u),e.setBounding(h,p,v)})},t.prototype._setPaneOptions=function(t,e){var i,n;if(K(t.id)){var o=this.getDrawPaneById(t.id),r=!1;if(null!==o){var a=e;if(t.id!==Qt&&W(t.height)&&t.height>0){var s=Math.max(null!==(i=t.minHeight)&&void 0!==i?i:o.getOptions().minHeight,0),l=Math.max(s,t.height);o.setBounding({height:l}),a=!0,r=!0}(K(null===(n=t.axisOptions)||void 0===n?void 0:n.name)||z(t.gap))&&(a=!0),o.setOptions(t),a&&this.adjustPaneViewport(r,!0,!0,!0,!0)}}},t.prototype.getDrawPaneById=function(t){if(t===Qt)return this._candlePane;if(t===te)return this._xAxisPane;var e=this._drawPanes.find(function(e){return e.getId()===t});return null!==e&&void 0!==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.getAllDrawPanes=function(){return this._drawPanes},t.prototype.getAllSeparatorPanes=function(){return this._separatorPanes},t.prototype.adjustPaneViewport=function(t,e,i,n,o){t&&this._measurePaneHeight();var r=e,a=null!==o&&void 0!==o&&o;(null!==n&&void 0!==n&&n||a)&&this._drawPanes.forEach(function(t){var e=t.getAxisComponent().buildTicks(a);r||(r=e)}),r&&this._measurePaneWidth(),null!==i&&void 0!==i&&i&&(this._xAxisPane.getAxisComponent().buildTicks(!0),this.updatePane(4))},t.prototype.updatePane=function(t,e){if(z(e)){var i=this.getDrawPaneById(e);null===i||void 0===i||i.update(t)}else this._separatorPanes.forEach(function(e){e.update(t)}),this._drawPanes.forEach(function(e){e.update(t)})},t.prototype.crosshairChange=function(t){var e=this,i=this._chartStore.getActionStore();if(i.has(X.OnCrosshairChange)){var n={};this._drawPanes.forEach(function(i){var o=i.getId(),r={};e._chartStore.getIndicatorStore().getInstances(o).forEach(function(e){var i,n=e.result;r[e.name]=n[null!==(i=t.dataIndex)&&void 0!==i?i:n.length-1]}),n[o]=r}),K(t.paneId)&&i.execute(X.OnCrosshairChange,v(v({},t),{indicatorData:n}))}},t.prototype.getDom=function(t,e){var i,n;if(!K(t))return this._chartContainer;var o=this.getDrawPaneById(t);if(null!==o)switch(null!==e&&void 0!==e?e:vi.Root){case vi.Root:return o.getContainer();case vi.Main:return o.getMainWidget().getContainer();case vi.YAxis:return null!==(n=null===(i=o.getYAxisWidget())||void 0===i?void 0:i.getContainer())&&void 0!==n?n:null}return null},t.prototype.getSize=function(t,e){var i,n;if(!z(t))return{width:Math.floor(this._chartContainer.clientWidth),height:Math.floor(this._chartContainer.clientHeight),left:0,top:0,right:0,bottom:0};var o=this.getDrawPaneById(t);if(null!==o)switch(null!==e&&void 0!==e?e:vi.Root){case vi.Root:return o.getBounding();case vi.Main:return o.getMainWidget().getBounding();case vi.YAxis:return null!==(n=null===(i=o.getYAxisWidget())||void 0===i?void 0:i.getBounding())&&void 0!==n?n:null}return null},t.prototype.setStyles=function(t){var e,i,n;this._chartStore.setOptions({styles:t}),z(null===(e=null===(n=K(t)?oe(t):t)||void 0===n?void 0:n.yAxis)||void 0===e?void 0:e.type)&&(null===(i=this._candlePane)||void 0===i||i.getAxisComponent().setAutoCalcTickFlag(!0)),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getStyles=function(){return this._chartStore.getStyles()},t.prototype.setLocale=function(t){this._chartStore.setOptions({locale:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getLocale=function(){return this._chartStore.getLocale()},t.prototype.setCustomApi=function(t){this._chartStore.setOptions({customApi:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.setPriceVolumePrecision=function(t,e){this._chartStore.setPrecision({price:t,volume:e})},t.prototype.getPriceVolumePrecision=function(){return this._chartStore.getPrecision()},t.prototype.setTimezone=function(t){this._chartStore.setOptions({timezone:t}),this._xAxisPane.getAxisComponent().buildTicks(!0),this._xAxisPane.update(3)},t.prototype.getTimezone=function(){return this._chartStore.getTimeScaleStore().getTimezone()},t.prototype.setOffsetRightDistance=function(t){this._chartStore.getTimeScaleStore().setOffsetRightDistance(t,!0)},t.prototype.getOffsetRightDistance=function(){return this._chartStore.getTimeScaleStore().getOffsetRightDistance()},t.prototype.setMaxOffsetLeftDistance=function(t){t<0?F("setMaxOffsetLeftDistance","distance","distance must greater than zero!!!"):this._chartStore.getTimeScaleStore().setMaxOffsetLeftDistance(t)},t.prototype.setMaxOffsetRightDistance=function(t){t<0?F("setMaxOffsetRightDistance","distance","distance must greater than zero!!!"):this._chartStore.getTimeScaleStore().setMaxOffsetRightDistance(t)},t.prototype.setLeftMinVisibleBarCount=function(t){t<0?F("setLeftMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.getTimeScaleStore().setLeftMinVisibleBarCount(Math.ceil(t))},t.prototype.setRightMinVisibleBarCount=function(t){t<0?F("setRightMinVisibleBarCount","barCount","barCount must greater than zero!!!"):this._chartStore.getTimeScaleStore().setRightMinVisibleBarCount(Math.ceil(t))},t.prototype.setBarSpace=function(t){this._chartStore.getTimeScaleStore().setBarSpace(t)},t.prototype.getBarSpace=function(){return this._chartStore.getTimeScaleStore().getBarSpace().bar},t.prototype.getVisibleRange=function(){return this._chartStore.getTimeScaleStore().getVisibleRange()},t.prototype.clearData=function(){this._chartStore.clear()},t.prototype.getDataList=function(){return this._chartStore.getDataList()},t.prototype.applyNewData=function(t,e,i){z(i)&&F("applyNewData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t,nt.Init,e).then(function(){}).catch(function(){}).finally(function(){null===i||void 0===i||i()})},t.prototype.applyMoreData=function(t,e,i){F("","","Api `applyMoreData` has been deprecated since version 9.8.0."),this._chartStore.addData(t,nt.Forward,null===e||void 0===e||e).then(function(){}).catch(function(){}).finally(function(){null===i||void 0===i||i()})},t.prototype.updateData=function(t,e){z(e)&&F("updateData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t).then(function(){}).catch(function(){}).finally(function(){null===e||void 0===e||e()})},t.prototype.loadMore=function(t){F("","","Api `loadMore` has been deprecated since version 9.8.0, use `setLoadDataCallback` instead."),this._chartStore.setLoadMoreCallback(t)},t.prototype.setLoadDataCallback=function(t){this._chartStore.setLoadDataCallback(t)},t.prototype.createIndicator=function(t,e,i,n){var o,r=this,a=K(t)?{name:t}:t;if(null===Lt(a.name))return F("createIndicator","value","indicator not supported, you may need to use registerIndicator to add one!!!"),null;var s=null===i||void 0===i?void 0:i.id,l=this.getDrawPaneById(null!==s&&void 0!==s?s:"");if(null!==l)this._chartStore.getIndicatorStore().addInstance(a,null!==s&&void 0!==s?s:"",null!==e&&void 0!==e&&e).then(function(t){var e;r._setPaneOptions(null!==i&&void 0!==i?i:{},null!==(e=l.getAxisComponent().buildTicks(!0))&&void 0!==e&&e)}).catch(function(t){});else{null!==s&&void 0!==s||(s=yt(Jt));var c=this._createPane(ei,s,null!==i&&void 0!==i?i:{}),u=null!==(o=null===i||void 0===i?void 0:i.height)&&void 0!==o?o:100;c.setBounding({height:u}),this._chartStore.getIndicatorStore().addInstance(a,s,null!==e&&void 0!==e&&e).finally(function(){r.adjustPaneViewport(!0,!0,!0,!0,!0),null===n||void 0===n||n()})}return null!==s&&void 0!==s?s:null},t.prototype.overrideIndicator=function(t,e,i){var n=this;this._chartStore.getIndicatorStore().override(t,null!==e&&void 0!==e?e:null).then(function(t){var e=_(t,2),o=e[0],r=e[1];(o||r)&&(n.adjustPaneViewport(!1,r,!0,r),null===i||void 0===i||i())}).catch(function(){})},t.prototype.getIndicatorByPaneId=function(t,e){return this._chartStore.getIndicatorStore().getInstanceByPaneId(t,e)},t.prototype.removeIndicator=function(t,e){var i,n,o,r=this._chartStore.getIndicatorStore();if(r.removeInstance(t,e)){var a=!1;if(t!==Qt&&!r.hasInstances(t)){var s=this.getDrawPaneById(t),l=this._drawPanes.findIndex(function(e){return e.getId()===t});if(null!==s){a=!0;var c=this._separatorPanes.get(s);if(z(c)){var u=null===c||void 0===c?void 0:c.getTopPane();try{for(var h=m(this._separatorPanes),d=h.next();!d.done;d=h.next()){var p=d.value;if(p[1].getTopPane().getId()===s.getId()){p[1].setTopPane(u);break}}}catch(t){i={error:t}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}c.destroy(),this._separatorPanes.delete(s)}this._drawPanes.splice(l,1),s.destroy();var v=this._drawPanes[0];z(v)&&v.getId()===te&&(v=this._drawPanes[1]),null===(o=this._separatorPanes.get(v))||void 0===o||o.destroy(),this._separatorPanes.delete(v)}}this.adjustPaneViewport(a,!0,!0,!0,!0)}},t.prototype.createOverlay=function(t,e){var i=[];if(K(t))i=[{name:t}];else if(O(t))i=t.map(function(t){return K(t)?{name:t}:t});else{i=[t]}var n=!0;z(e)&&null!==this.getDrawPaneById(e)||(e=Qt,n=!1);var o=this._chartStore.getOverlayStore().addInstances(i,e,n);return O(t)?o:o[0]},t.prototype.getOverlayById=function(t){return this._chartStore.getOverlayStore().getInstanceById(t)},t.prototype.overrideOverlay=function(t){this._chartStore.getOverlayStore().override(t)},t.prototype.removeOverlay=function(t){var e;z(t)&&(e=K(t)?{id:t}:t),this._chartStore.getOverlayStore().removeInstance(e)},t.prototype.setPaneOptions=function(t){this._setPaneOptions(t,!1)},t.prototype.setZoomEnabled=function(t){this._chartStore.getTimeScaleStore().setZoomEnabled(t)},t.prototype.isZoomEnabled=function(){return this._chartStore.getTimeScaleStore().getZoomEnabled()},t.prototype.setScrollEnabled=function(t){this._chartStore.getTimeScaleStore().setScrollEnabled(t)},t.prototype.isScrollEnabled=function(){return this._chartStore.getTimeScaleStore().getScrollEnabled()},t.prototype.scrollByDistance=function(t,e){var i=W(e)&&e>0?e:0,n=this._chartStore.getTimeScaleStore();if(n.startScroll(),i>0){var o=new ft({duration:i});o.doFrame(function(e){var o=t*(e/i);n.scroll(o)}),o.start()}else n.scroll(t)},t.prototype.scrollToRealTime=function(t){var e=this._chartStore.getTimeScaleStore(),i=e.getBarSpace().bar,n=(e.getLastBarRightSideDiffBarCount()-e.getInitialOffsetRightDistance()/i)*i;this.scrollByDistance(n,t)},t.prototype.scrollToDataIndex=function(t,e){var i=this._chartStore.getTimeScaleStore(),n=(i.getLastBarRightSideDiffBarCount()+(this.getDataList().length-1-t))*i.getBarSpace().bar;this.scrollByDistance(n,e)},t.prototype.scrollToTimestamp=function(t,e){var i=Ct(this.getDataList(),"timestamp",t);this.scrollToDataIndex(i,e)},t.prototype.zoomAtCoordinate=function(t,e,i){var n=W(i)&&i>0?i:0,o=this._chartStore.getTimeScaleStore(),r=o.getBarSpace().bar,a=r*t-r;if(n>0){var s=0,l=new ft({duration:n});l.doFrame(function(t){var i=a*(t/n),r=(i-s)/o.getBarSpace().bar*10;o.zoom(r,e),s=i}),l.start()}else o.zoom(a/r*10,e)},t.prototype.zoomAtDataIndex=function(t,e,i){var n=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(e);this.zoomAtCoordinate(t,{x:n,y:0},i)},t.prototype.zoomAtTimestamp=function(t,e,i){var n=Ct(this.getDataList(),"timestamp",e);this.zoomAtDataIndex(t,n,i)},t.prototype.convertToPixel=function(t,e){var i,n=e.paneId,o=void 0===n?Qt:n,r=e.absolute,a=void 0!==r&&r,s=[];if(o!==te){var l=this.getDrawPaneById(o);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),h=(new Array).concat(t),d=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=h.map(function(t){var e={},i=t.dataIndex;if(W(t.timestamp)&&(i=c.timestampToDataIndex(t.timestamp)),W(i)&&(e.x=null===d||void 0===d?void 0:d.convertToPixel(i)),W(t.value)){var n=null===p||void 0===p?void 0:p.convertToPixel(t.value);e.y=a?u.top+n:n}return e})}}return O(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.convertFromPixel=function(t,e){var i,n=e.paneId,o=void 0===n?Qt:n,r=e.absolute,a=void 0!==r&&r,s=[];if(o!==te){var l=this.getDrawPaneById(o);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),h=(new Array).concat(t),d=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=h.map(function(t){var e,i,n={};if(W(t.x)){var o=null!==(e=null===d||void 0===d?void 0:d.convertFromPixel(t.x))&&void 0!==e?e:-1;n.dataIndex=o,n.timestamp=null!==(i=c.dataIndexToTimestamp(o))&&void 0!==i?i:void 0}if(W(t.y)){var r=a?t.y-u.top:t.y;n.value=p.convertFromPixel(r)}return n})}}return O(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.executeAction=function(t,e){var i;switch(t){case X.OnCrosshairChange:var n=v({},e);n.paneId=null!==(i=n.paneId)&&void 0!==i?i:Qt,this._chartStore.getTooltipStore().setCrosshair(n,{notExecuteAction:!0})}},t.prototype.subscribeAction=function(t,e){this._chartStore.getActionStore().subscribe(t,e)},t.prototype.unsubscribeAction=function(t,e){this._chartStore.getActionStore().unsubscribe(t,e)},t.prototype.getConvertPictureUrl=function(t,e,i){var n=this,o=this._chartContainer.clientWidth,r=this._chartContainer.clientHeight,a=xt("canvas",{width:"".concat(o,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),s=a.getContext("2d"),l=tt(a);a.width=o*l,a.height=r*l,s.scale(l,l),s.fillStyle=null!==i&&void 0!==i?i:"#FFFFFF",s.fillRect(0,0,o,r);var c=null!==t&&void 0!==t&&t;return this._drawPanes.forEach(function(t){var e=n._separatorPanes.get(t);if(z(e)){var i=e.getBounding();s.drawImage(e.getImage(c),i.left,i.top,i.width,i.height)}var r=t.getBounding();s.drawImage(t.getImage(c),0,r.top,o,r.height)}),a.toDataURL("image/".concat(null!==e&&void 0!==e?e:"jpeg"))},t.prototype.resize=function(){this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.destroy=function(){this._chartEvent.destroy(),this._drawPanes.forEach(function(t){t.destroy()}),this._drawPanes=[],this._separatorPanes.forEach(function(t){t.destroy()}),this._separatorPanes.clear(),this._container.removeChild(this._chartContainer)},t}(),_i=new Map,yi=1;function xi(t,e){var i;if(L("%c❤️ Welcome to klinecharts. Version is 9.8.12","border-radius:4px;border:dashed 1px #1677FF;line-height:70px;padding:0 20px;margin:16px 0;font-size:14px;color:#1677FF;","","","",""),null===(i=K(t)?document.getElementById(t):t))return L("%c😟 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 n=_i.get(i.id);if(z(n))return F("","","The chart has been initialized on the dom!!!"),n;var o="k_line_chart_".concat(yi++);return(n=new mi(i,e)).id=o,i.setAttribute("k-line-chart-id",o),_i.set(o,n),n}function Ci(t){var e,i,n;if(t instanceof mi)n=t.id;else{var o=void 0;n=null!==(e=null===(o=K(t)?document.getElementById(t):t)||void 0===o?void 0:o.getAttribute("k-line-chart-id"))&&void 0!==e?e:null}null!==n&&(null===(i=_i.get(n))||void 0===i||i.destroy(),_i.delete(n))}}).call(e,i("W2nU"))},k2Ib:function(t,e,i){i("30KW"),t.exports=i("FeBl").Number.isFinite},yWBo:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i("Dd8w"),o=i.n(n),r=i("AMV0"),a=i.n(r),s=i("mvHQ"),l=i.n(s),c=i("OhnE"),u=i("wQWh"),h={name:"KLine",data:function(){return{RISE_COLOR:"#09C164",FALL_COLOR:"#FF3046",theme:localStorage.getItem("theme")?localStorage.getItem("theme"):"dark",fromTab:"",currentWsRoom:"",headername:{},header:{last:0,change_percentage:0,high_24h:0,volume_24h_base:0,low_24h:0,volume_24h_settle:0},candleData:[],candleVolData:[],activeProductTab:"perp",curTime:"1h",interval:"1h",limit:200,time:["1m","5m","30m","1h","4h","8h","1d","1w","30d"],TimeList:[{name:"1分"},{name:"5分"},{name:"30分"},{name:"1小时"},{name:"4小时"},{name:"8小时"},{name:"1天"},{name:"1周"},{name:"1月"}],inter:null,widith:0,collect:!1,kLineChart:null,chartData:[],activeMainIndicator:"MA",activeSubIndicator:"VOL",indicatorTabs:[{id:"MA",text:"MA",group:"main"},{id:"EMA",text:"EMA",group:"main"},{id:"BOLL",text:"BOLL",group:"main"},{id:"VOL",text:"VOL",group:"sub"},{id:"MACD",text:"MACD",group:"sub"},{id:"KDJ",text:"KDJ",group:"sub"},{id:"RSI",text:"RSI",group:"sub"}],activeBottomTab:"entrust",bottomTabs:[{id:"entrust",text:"委托订单"}],buyRows:[],sellRows:[],chartWheelEl:null,chartWheelHandler:null}},computed:{getWsMsg:function(){return this.$store.state.orderWebSocketMsg},visibleIndicatorTabs:function(){return"fx"===this.fromTab?this.indicatorTabs.filter(function(t){return t&&"main"===t.group}):this.indicatorTabs}},watch:{getWsMsg:function(t){var e=t&&t.data;if(e){var i=null;try{i=JSON.parse(e)}catch(t){i=null}if(i)if("fx"!==this.fromTab){if("futures"===i.class&&"currencyPrice"===i.action){var n=i.data&&Array.isArray(i.data.bids)?i.data.bids:[],o=i.data&&Array.isArray(i.data.asks)?i.data.asks:[];this.updateOrderBookRows(n,o)}"futures"===i.class&&"trend"===i.action&&i.data&&this.headername&&i.data.from_coin==this.headername.from_coin&&(this.header=i.data)}else{if((i&&i.room)===this.currentWsRoom){var r=i&&i.data?i.data:{};this.applyFxWsData(r)}}}},"header.last":function(){var t=this;this.$nextTick(function(){t.syncChartLastPrice()})}},activated:function(){this.resetScrollToTop()},mounted:function(){var t=this;this.resetScrollToTop();var e=this.$route&&this.$route.query?this.$route.query:{};this.fromTab=e&&e.fromTab?String(e.fromTab):"";var i=this.$route&&this.$route.query?this.$route.query.itemDetails:"";if(i){console.log(JSON.parse(i));try{this.headername=JSON.parse(i)}catch(t){this.headername={}}}"fx"===this.fromTab?(this.currentWsRoom=this.headername.coin,u.e.room=this.headername.coin,this.socketApi&&this.socketApi.wsConnectionOrder&&(null==this.socketApi.wsConnectionOrder.$wsOrder?this.socketApi.wsConnectionOrder.initWebSocket():this.socketApi.wsConnectionOrder.wsSend())):(this.headername&&!this.headername.from_coin&&this.headername.coin&&(this.headername.from_coin=this.headername.coin),this.headername&&!this.headername.to_coin&&(this.headername.to_coin="USDT"),this.headername&&this.headername.from_coin&&(u.e.room=this.headername.from_coin+"_USDT",this.socketApi&&this.socketApi.wsConnectionOrder&&(null==this.socketApi.wsConnectionOrder.$wsOrder?this.socketApi.wsConnectionOrder.initWebSocket():this.socketApi.wsConnectionOrder.wsSend())));var n=0;n=window.innerWidth>750?750:window.innerWidth,this.widith=n,this.installadd1(),this.$nextTick(function(){t.resetScrollToTop(),t.bindChartWheel()}),this.tickers(),setTimeout(function(){t.setIntervalInstall()},500)},beforeDestroy:function(){this.inter&&(clearInterval(this.inter),this.inter=null),this.unbindChartWheel(),"fx"!==this.fromTab&&this.socketApi&&this.socketApi.wsConnectionOrder&&(u.e.room="",this.socketApi.wsConnectionOrder.wsSend()),this.chartData=[],this.kLineChart=null,Object(c.a)("technical-indicator-k-line")},methods:{resetScrollToTop:function(){this.$nextTick(function(){try{if("undefined"!=typeof window&&window.scrollTo&&window.scrollTo(0,0),"undefined"!=typeof document){var t=document.documentElement,e=document.body;t&&(t.scrollTop=0),e&&(e.scrollTop=0)}}catch(t){}})},goOptions:function(){var t=(this.$route&&this.$route.query?this.$route.query.itemDetails:"")||l()(this.headername||{});this.$router.push({name:"options",query:{itemDetails:t}})},syncChartLastPrice:function(){if(this.kLineChart&&"function"==typeof this.kLineChart.updateData){var t=this.header&&void 0!==this.header.last&&null!==this.header.last?this.header.last:"",e=Number(String(t).replace(/,/g,""));if(a()(e)){var i=Array.isArray(this.chartData)?this.chartData:[],n=i.length?i.length-1:-1,r=n>=0?i[n]:null;if(r&&void 0!==r.timestamp&&null!==r.timestamp){var s=Number(r.high),l=Number(r.low),c=o()({},r,{close:e,high:a()(s)?Math.max(s,e):e,low:a()(l)?Math.min(l,e):e});this.kLineChart.updateData(c),n>=0&&this.chartData.splice(n,1,c)}}}},applyFxWsData:function(t){var e=t&&void 0!==t.price&&null!==t.price?t.price:t&&void 0!==t.now_price&&null!==t.now_price?t.now_price:"",i=t&&void 0!==t.change_percentage&&null!==t.change_percentage?t.change_percentage:t&&void 0!==t.rate&&null!==t.rate?t.rate:0;""!==e&&(this.header.last=e),this.header.change_percentage=i,this.header.high_24h=t&&void 0!==t.high_price?t.high_price:this.header.high_24h,this.header.low_24h=t&&void 0!==t.low_price?t.low_price:this.header.low_24h,this.header.volume_24h_base=t&&void 0!==t.volume_24h_base?t.volume_24h_base:this.header.volume_24h_base,this.header.volume_24h_settle=t&&void 0!==t.volume_24h_settle?t.volume_24h_settle:this.header.volume_24h_settle;var n=t&&t.depth?t.depth:null,o=n&&Array.isArray(n.bids)?n.bids:[],r=n&&Array.isArray(n.asks)?n.asks:[];if(r.length>0||o.length>0){var a=this.normalizeFxDepthRows(o),s=this.normalizeFxDepthRows(r);this.updateOrderBookRows(this.fillFxDepthTo8(a,-1),this.fillFxDepthTo8(s,1))}},normalizeFxDepthRows:function(t){return(Array.isArray(t)?t:[]).map(function(t){return{p:t&&void 0!==t.p&&null!==t.p?t.p:t&&void 0!==t.price&&null!==t.price?t.price:"",s:t&&void 0!==t.s&&null!==t.s?t.s:t&&void 0!==t.volume&&null!==t.volume?t.volume:""}})},fillFxDepthTo8:function(t,e){var i=(Array.isArray(t)?t:[]).slice(0,8);if(i.length>=8)return i;for(var n=i[0]&&void 0!==i[0].p&&null!==i[0].p?i[0].p:this.header&&void 0!==this.header.last&&null!==this.header.last?this.header.last:"",o=i.length;o<8;o++)i.push({p:this.stepFxDepthPrice(n,o*e),s:this.randomFxDepthQty()});return i},stepFxDepthPrice:function(t,e){var i=String(void 0===t||null===t?"":t).replace(/,/g,""),n=Number(i);if(!a()(n))return i;var o=i.split("."),r=o.length>1?o[1].length:0,s=r>0?Math.pow(10,-r):1,l=n+Number(e)*s;return r>0?l.toFixed(r):String(Math.round(l))},randomFxDepthQty:function(){return(1e5*Math.random()).toFixed(2)},getFxApiInterval:function(){var t=String(this.interval||"");return{"1m":"1","5m":"2","30m":"4","1h":"5","2h":"6","4h":"6","8h":"6","1d":"8","1w":"9","30d":"10"}[t]||t},updateOrderBookRows:function(t,e){var i=t.slice(0,10),n=i.map(function(t){return Number(t&&t.s)}),o=Math.max.apply(null,n.filter(function(t){return a()(t)&&t>0})),r=i.map(function(t){var e=t&&void 0!==t.s&&null!==t.s?t.s:"--",i=Number(e),n=a()(i)&&i>0&&a()(o)&&o>0?i/o*100:0;return{price:t&&void 0!==t.p&&null!==t.p?t.p:"--",amount:e,percentage:Math.max(0,Math.min(100,n))}}),s=e.slice(0,10),l=s.map(function(t){return Number(t&&t.s)}),c=Math.max.apply(null,l.filter(function(t){return a()(t)&&t>0})),u=s.map(function(t){var e=t&&void 0!==t.s&&null!==t.s?t.s:"--",i=Number(e),n=a()(i)&&i>0&&a()(c)&&c>0?i/c*100:0;return{price:t&&void 0!==t.p&&null!==t.p?t.p:"--",amount:e,percentage:Math.max(0,Math.min(100,n))}});this.buyRows=r,this.sellRows=u},isIndicatorActive:function(t){return!!t&&("main"===t.group?this.activeMainIndicator===t.id:this.activeSubIndicator===t.id)},switchIndicator:function(t){var e=this;if(t){if("main"===t.group){if(this.activeMainIndicator===t.id)return;this.activeMainIndicator=t.id}else{if(this.activeSubIndicator===t.id)return;this.activeSubIndicator=t.id}this.$nextTick(function(){e.rebuildKLineChart()})}},rebuildKLineChart:function(){Object(c.a)("technical-indicator-k-line"),this.kLineChart=null,this.createKLineChart(),this.kLineChart&&Array.isArray(this.chartData)&&this.chartData.length&&this.kLineChart.applyNewData(this.chartData)},getCssVar:function(t,e){return(getComputedStyle(document.documentElement).getPropertyValue(t)||"").trim()||e},getChartTheme:function(){return{bgColor:this.getCssVar("--bgColor","#111111"),textColor:this.getCssVar("--textColor","#ffffff"),divTextColor:this.getCssVar("--divtextColor","#6e86a8"),gridColor:this.getCssVar("--chartGridColor","#2b2b2b")}},getLanguageOptions:function(){return{candle:{tooltip:{text:{size:12,family:"Helvetica Neue",weight:"normal",marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},custom:[{title:"open",value:"{open}"},{title:"high",value:"{high}"},{title:"low",value:"{low}"},{title:"close",value:"{close}"}]}}}},getChangeClass:function(t){return Number(t)>=0?"rise":"fall"},getMarkPrice:function(){var t=this.headername&&this.headername.mark_price;return""!==t&&null!==t&&void 0!==t?t:this.header.last},applyKLineTheme:function(){var t=this.getChartTheme();this.kLineChart&&(this.kLineChart.setStyles(this.getLanguageOptions()),this.kLineChart.setStyles({candle:{bar:{upColor:this.RISE_COLOR,downColor:this.FALL_COLOR,upBorderColor:this.RISE_COLOR,downBorderColor:this.FALL_COLOR,upWickColor:this.RISE_COLOR,downWickColor:this.FALL_COLOR},priceMark:{last:{upColor:this.RISE_COLOR,downColor:this.FALL_COLOR}}},indicator:{ohlc:{upColor:this.RISE_COLOR,downColor:this.FALL_COLOR},bars:[{upColor:this.RISE_COLOR,downColor:this.FALL_COLOR}]},grid:{show:!1,horizontal:{show:!1},vertical:{show:!1}},xAxis:{axisLine:{color:t.bgColor},tickText:{color:t.divTextColor}},yAxis:{axisLine:{color:t.bgColor},tickText:{color:t.divTextColor}},separator:{color:t.bgColor}}))},setIntervalInstall:function(){var t=this;this.install(),this.tickers(),this.inter&&clearInterval(this.inter),this.inter=setInterval(function(){t.install(),t.tickers()},3e3)},tickers:function(){var t=this;if("fx"!==this.fromTab){var e=this.headername&&this.headername.from_coin;e&&this.$api&&this.$api.quotation&&this.$api.quotation.tickers&&this.$api.quotation.tickers({currency:e}).then(function(e){var i=e&&e.data;Array.isArray(i)&&i[0]&&(t.header=i[0],t.collect=!!i[0].is_like,t.headername=o()({},t.headername,{is_like:i[0].is_like}))})}},install:function(){var t=this;if("fx"!==this.fromTab){var e=this.headername&&this.headername.from_coin;if(e&&this.$api&&this.$api.quotation&&this.$api.quotation.candlesticks){var i={currency:e,interval:this.interval,limit:this.limit};this.$api.quotation.candlesticks(i).then(function(e){var i=[],n=[],o=[];(e&&e.data||[]).forEach(function(t){var e=[],r={},a=new Date(t.t).getTime();a+=288e5,e.time=a/1e3,e.open=Number(t.o),e.high=Number(t.h),e.low=Number(t.l),e.close=Number(t.c),r.time=a/1e3,r.value=Number(t.v),r.color=e.close>=e.open?"rgba(9, 193, 100, 0.8)":"rgba(255, 48, 70, 0.8)",n.push(r),i.push(e),o.push({timestamp:a,open:Number(t.o),high:Number(t.h),low:Number(t.l),close:Number(t.c),volume:Number(t.v)})}),t.candleData=i,t.candleVolData=n,t.chartData=o,t.kLineChart&&(t.kLineChart.applyNewData(o),t.syncChartLastPrice())})}}else{var n=this.headername.coin;if(!this.$api||!this.$api.quotation||!this.$api.quotation.forex)return;var o={symbol:n,interval:this.getFxApiInterval(),limit:this.limit};this.$api.quotation.forex(o).then(function(e){var i=[],n=[],o=[];(e&&e.data&&Array.isArray(e.data.kline_list)?e.data.kline_list:[]).forEach(function(t){var e=[],r={},s=1e3*Number(t&&t.timestamp);a()(s)||(s=0),s+=288e5,e.time=s/1e3,e.open=Number(t&&t.open_price),e.high=Number(t&&t.high_price),e.low=Number(t&&t.low_price),e.close=Number(t&&t.close_price),r.time=s/1e3,r.value=Number(t&&t.volume),r.color=e.close>=e.open?"rgba(9, 193, 100, 0.8)":"rgba(255, 48, 70, 0.8)",n.push(r),i.push(e),o.push({timestamp:s,open:Number(t&&t.open_price),high:Number(t&&t.high_price),low:Number(t&&t.low_price),close:Number(t&&t.close_price),volume:Number(t&&t.volume)})}),t.candleData=i,t.candleVolData=n,t.chartData=o,t.kLineChart&&(t.kLineChart.applyNewData(o),t.syncChartLastPrice())})}},clTime:function(t,e){var i=this;this.time.forEach(function(t,n){n===e&&(i.interval=t)}),this.curTime=t.name,this.setIntervalInstall()},installadd1:function(){this.kLineChart?this.applyKLineTheme():this.createKLineChart()},createKLineChart:function(){var t=this.getChartTheme(),e={locale:"en-US",grid:{show:!1,horizontal:{show:!1,color:t.bgColor},vertical:{show:!1,color:t.bgColor}},xAxis:{show:!0,size:"auto",axisLine:{show:!0,color:t.bgColor,size:1},tickText:{show:!0,color:t.divTextColor,family:"Helvetica Neue",weight:"normal",size:11,marginStrat:4,marginBottom:4},tickLine:{show:!1,size:1,length:3,color:t.gridColor}},yAxis:{show:!0,size:"auto",position:"right",type:"normal",inside:!1,reverse:!1,axisLine:{show:!0,color:t.bgColor,size:1},tickText:{show:!0,color:t.divTextColor,family:"Helvetica Neue",weight:"normal",size:11,marginStrat:4,marginBottom:4},tickLine:{show:!1,size:1,length:3,color:t.gridColor}},separator:{size:1,color:t.bgColor,fill:!0,activeBackgroundColor:"rgba(230, 230, 230, .15)"},candle:{priceMark:{show:!0,high:{show:!0,color:this.RISE_COLOR},low:{show:!0,color:this.FALL_COLOR}}}};this.kLineChart=Object(c.b)("technical-indicator-k-line",e),this.kLineChart.createIndicator(this.activeMainIndicator,!1,{id:"candle_pane"}),"fx"!==this.fromTab&&this.kLineChart.createIndicator(this.activeSubIndicator,!1),this.kLineChart.setOffsetRightDistance(0),this.kLineChart.setPriceVolumePrecision(3,2),this.applyKLineTheme()},enshrine:function(){var t=this,e=this.headername&&this.headername.from_coin;e&&this.$api&&this.$api.home&&this.$api.home.coinLike&&this.$api.home.coinLike({coin:e}).then(function(){t.collect=!0})},abolish:function(){var t=this,e=void 0;(e="fx"===this.fromTab?this.headername.symbol:this.headername&&this.headername.from_coin)&&this.$api&&this.$api.home&&this.$api.home.coindislike&&this.$api.home.coindislike({coin:e}).then(function(){t.collect=!1})},bindChartWheel:function(){var t=this,e=document.getElementById("technical-indicator-k-line");e&&(this.chartWheelEl===e&&this.chartWheelHandler||(this.unbindChartWheel(),this.chartWheelEl=e,this.chartWheelHandler=function(e){if(t.kLineChart&&t.chartWheelEl&&(e&&"function"==typeof e.preventDefault&&e.preventDefault(),(!!(navigator&&navigator.maxTouchPoints>0)||!(!window.matchMedia||!window.matchMedia("(pointer: coarse)").matches))&&t.kLineChart&&"function"==typeof t.kLineChart.zoomAtCoordinate)){var i=e&&void 0!==e.deltaY?e.deltaY:e&&void 0!==e.wheelDelta?-e.wheelDelta:0;if(i){var n=t.chartWheelEl.getBoundingClientRect(),o=(e.clientX||0)-n.left,r=(e.clientY||0)-n.top,a={x:Math.max(0,Math.min(n.width,o)),y:Math.max(0,Math.min(n.height,r))},s=i>0?.9:1.1;t.kLineChart.zoomAtCoordinate(s,a,0)}}},e.addEventListener("wheel",this.chartWheelHandler,{passive:!1,capture:!0}),e.addEventListener("mousewheel",this.chartWheelHandler,{passive:!1,capture:!0})))},unbindChartWheel:function(){this.chartWheelEl&&this.chartWheelHandler&&(this.chartWheelEl.removeEventListener("wheel",this.chartWheelHandler,!0),this.chartWheelEl.removeEventListener("mousewheel",this.chartWheelHandler,!0)),this.chartWheelEl=null,this.chartWheelHandler=null}}},d={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"KLinePage"},[i("app-nav",{staticStyle:{border:"none"},attrs:{back:!0}},[i("div",{staticClass:"KLinePage__title"},[i("div",{staticClass:"KLinePage__titleRow"},["fx"!==t.fromTab?i("span",{staticClass:"KLinePage__titleText"},[t._v(t._s(t.headername.from_coin)+"/"+t._s(t.headername.to_coin))]):i("span",{staticClass:"KLinePage__titleText"},[t._v(t._s(t.headername.coin))]),t._v(" "),i("div",{staticClass:"KLinePage__titleChange",class:t.getChangeClass(t.header.change_percentage)},[t._v(t._s(t.header.change_percentage)+"%")])])]),t._v(" "),"fx"!==t.fromTab?i("template",{attrs:{slot:"recharge"},slot:"recharge"},[i("div",{staticClass:"KLinePage__navRight"},[t.collect?i("p",{on:{click:t.abolish}},[i("van-icon",{staticClass:"KLinePage__collectIcon active",attrs:{name:"star"}})],1):i("p",{on:{click:t.enshrine}},[i("van-icon",{staticClass:"KLinePage__collectIcon",attrs:{name:"star-o"}})],1)])]):i("template",{attrs:{slot:"recharge"},slot:"recharge"},[i("div",{staticClass:"KLinePage__navRight"},[t.headername.is_like?i("p",{on:{click:t.abolish}},[i("van-icon",{staticClass:"KLinePage__collectIcon active",attrs:{name:"star"}})],1):i("p",{on:{click:t.enshrine}},[i("van-icon",{staticClass:"KLinePage__collectIcon",attrs:{name:"star-o"}})],1)])])],2),t._v(" "),i("div",{staticClass:"KLinePage__header"},[i("div",{staticClass:"KLinePage__headerTop"},[i("div",{staticClass:"KLinePage__headerLeft"},[i("div",{staticClass:"KLinePage__price",class:t.getChangeClass(t.header.last)},[t._v(t._s(t.header.last))]),t._v(" "),i("div",{staticClass:"KLinePage__subText"},[t._v("\n ≈$"+t._s(t.header.last)+"\n "),i("span",{staticClass:"KLinePage__rate",class:t.getChangeClass(t.header.change_percentage)},[t._v(t._s(t.header.change_percentage)+"%")])]),t._v(" "),i("div",{staticClass:"KLinePage__markText"},[t._v(t._s(t.$t("标记价格"))+" "+t._s(t.getMarkPrice()))])]),t._v(" "),i("div",{staticClass:"KLinePage__headerRight"},[i("div",{staticClass:"KLinePage__stat"},[i("div",{staticClass:"KLinePage__statName"},[t._v(t._s(t.$t("24h最高价")))]),t._v(" "),i("div",{staticClass:"KLinePage__statVal"},[t._v(t._s(t.header.high_24h))])]),t._v(" "),"fx"!==t.fromTab?i("div",{staticClass:"KLinePage__stat"},[i("div",{staticClass:"KLinePage__statName"},[t._v(t._s(t.$t("24h成交量"))+"("+t._s(t.headername.from_coin)+")")]),t._v(" "),i("div",{staticClass:"KLinePage__statVal"},[t._v(t._s(t.header.volume_24h_base))])]):t._e(),t._v(" "),i("div",{staticClass:"KLinePage__stat"},[i("div",{staticClass:"KLinePage__statName"},[t._v(t._s(t.$t("24h最低价")))]),t._v(" "),i("div",{staticClass:"KLinePage__statVal"},[t._v(t._s(t.header.low_24h))])]),t._v(" "),"fx"!==t.fromTab?i("div",{staticClass:"KLinePage__stat"},[i("div",{staticClass:"KLinePage__statName"},[t._v(t._s(t.$t("24h成交额"))+"("+t._s(t.headername.to_coin)+")")]),t._v(" "),i("div",{staticClass:"KLinePage__statVal"},[t._v(t._s(t.header.volume_24h_settle))])]):t._e()])])]),t._v(" "),i("div",{staticClass:"KLinePage__timeBar"},t._l(t.TimeList,function(e,n){return i("div",{key:e.name+"_"+n,staticClass:"KLinePage__timeItem",class:{active:t.interval===t.time[n]},on:{click:function(i){t.clTime(e,n)}}},[t._v("\n "+t._s(e.name)+"\n ")])})),t._v(" "),i("div",{staticClass:"KLinePage__kline",style:{width:"100%",height:"10rem"},attrs:{id:"technical-indicator-k-line"}}),t._v(" "),i("div",{staticClass:"KLinePage__indicatorTabs"},t._l(t.visibleIndicatorTabs,function(e){return i("div",{key:e.id,staticClass:"KLinePage__indicatorTab",class:{active:t.isIndicatorActive(e)},on:{click:function(i){t.switchIndicator(e)}}},[t._v("\n "+t._s(e.text)+"\n ")])})),t._v(" "),i("div",{staticClass:"KLinePage__bottom"},[i("div",{directives:[{name:"show",rawName:"v-show",value:"entrust"===t.activeBottomTab,expression:"activeBottomTab === 'entrust'"}],staticClass:"KLinePage__entrust"},[i("div",{staticClass:"KLinePage__orderBook"},[i("div",{staticClass:"KLinePage__orderCol"},[i("div",{staticClass:"KLinePage__orderColTitle"},[t._v(t._s(t.$t("买入")))]),t._v(" "),i("div",{staticClass:"KLinePage__orderHead"},[i("div",{staticClass:"KLinePage__orderHeadItem"},[t._v(t._s(t.$t("价格(USDT)")))]),t._v(" "),i("div",{staticClass:"KLinePage__orderHeadItem"},[t._v(t._s(t.$t("数量(ETH)")))])]),t._v(" "),t._l(t.buyRows,function(e,n){return i("div",{key:"buy_"+n,staticClass:"KLinePage__orderRow"},[i("div",{staticClass:"KLinePage__orderRowBg KLinePage__orderRowBg--buy",style:{width:(e.percentage||0)+"%"}}),t._v(" "),i("div",{staticClass:"KLinePage__orderPrice"},[t._v(t._s(e.price))]),t._v(" "),i("div",{staticClass:"KLinePage__orderAmount KLinePage__orderAmount--buy"},[t._v(t._s(e.amount))])])})],2),t._v(" "),i("div",{staticClass:"KLinePage__orderCol KLinePage__orderCol--sell"},[i("div",{staticClass:"KLinePage__orderColTitle"},[t._v(t._s(t.$t("卖出")))]),t._v(" "),i("div",{staticClass:"KLinePage__orderHead"},[i("div",{staticClass:"KLinePage__orderHeadItem"},[t._v(t._s(t.$t("价格(USDT)")))]),t._v(" "),i("div",{staticClass:"KLinePage__orderHeadItem"},[t._v(t._s(t.$t("数量(ETH)")))])]),t._v(" "),t._l(t.sellRows,function(e,n){return i("div",{key:"sell_"+n,staticClass:"KLinePage__orderRow"},[i("div",{staticClass:"KLinePage__orderRowBg KLinePage__orderRowBg--sell",style:{width:(e.percentage||0)+"%"}}),t._v(" "),i("div",{staticClass:"KLinePage__orderPrice"},[t._v(t._s(e.price))]),t._v(" "),i("div",{staticClass:"KLinePage__orderAmount KLinePage__orderAmount--sell"},[t._v(t._s(e.amount))])])})],2)]),t._v(" "),i("div",{staticClass:"KLinePage__actionBtns"},[i("div",{staticClass:"KLinePage__actionBtn KLinePage__actionBtn--up",on:{click:t.goOptions}},[t._v(t._s(t.$t("看涨")))]),t._v(" "),i("div",{staticClass:"KLinePage__actionBtn KLinePage__actionBtn--down",on:{click:t.goOptions}},[t._v(t._s(t.$t("看空")))])])]),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"lastTrade"===t.activeBottomTab,expression:"activeBottomTab === 'lastTrade'"}],staticClass:"KLinePage__placeholder"}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:"depth"===t.activeBottomTab,expression:"activeBottomTab === 'depth'"}],staticClass:"KLinePage__placeholder"})])],1)},staticRenderFns:[]};var p=i("VU/8")(h,d,!1,function(t){i("2lDe")},"data-v-59d7995f",null);e.default=p.exports}});
- //# sourceMappingURL=18.9f1d239005c00af2c39b.js.map
|