u&&t.lineTo(d+.5,l.y);t.stroke()}}},l.prototype.hitTest=function(t){var e,i,o,n=.5*this.barSpacing+this.lineWidth,s=t.x-n,r=t.x+n,a=this.items;for(e=a.length;e--;)if((i=a[e].x)>=s&&i<=r&&(o=a[e].y,t.y>=Math.min(o,this.histogramBase)&&t.y<=Math.max(o,this.histogramBase)))return new F(F.REGULAR);return null},h.prototype.draw=function(t){t.lineCap="square",t.lineJoin=this.withMarkers?"round":"miter",t.strokeStyle=this.lineColor,t.fillStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,this._simpleMode?this._drawSimpleMode(t):this._drawLines(t)},h.prototype._drawSimpleMode=function(t){var e,i,o,n;if(t.beginPath(),this.walkLine(t,this.items),t.stroke(),this.withMarkers){for(e=this.lineWidth+2,i=2*Math.PI,t.beginPath(),n=this.items.length;n--;)(o=this.items[n])&&(t.moveTo(o.x,o.y),t.arc(o.x,o.y,e,0,i));t.fill()}},h.prototype.walkLine=function(t,e,i,o){var n,s,r,a,l,h,c,d,p,u,_;if(e){for(n=.25*this.barSpacing,c=N.paneRendererCoordinateIsValid,d=0,p=e.length;d2;)r=Math.round((d+c)/2),a=this.items[r],a.x<=t.x?c=r:d=r;for(c=Math.max(1,c-1),d=Math.min(this.items.length-1,d+1),l=c;l<=d;++l)if(e=this.items[l-1],i=this.items[l],o=e.x,n=i.x,s=R.distanceToSegment(new R.Point(o,e.y),new R.Point(n,i.y),new R.Point(t.x,t.y)),s.distance<=h)return this.hittest?this.hittest:new F(F.REGULAR);return null},inherit(c,h),c.prototype.draw=function(t){var e,i,o,n,s,r,a,l,c,d,p,u;if(0!==this.items.length){for(t.lineCap="square",t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,t.lineWidth=1,e=0;e=0&&!N.paneRendererCoordinateIsValid(this.items[i].y);)i--;if(!(e>=i)){for(t.translate(.5,.5),o={},n=this.items,s=e;s<=i;s++)r=n[s],a=r.style?r.style.color:this.lineColor,s0;)d=f[c],t.moveTo(d.time,d.low),t.lineTo(d.time,d.high);t.stroke()}for(t.lineWidth=1,p="",u=!1,t.beginPath(),c=f.length;c-- >0;)d=f[c],h=d.time,p!==d.color&&(u&&(t.stroke(),t.beginPath(),u=!1),t.strokeStyle=d.color,p=d.color),t.moveTo(d.time,d.open),t.lineTo(d.time,d.close),u=!0;u&&t.stroke()}else{if(f=f.slice().sort(function(t,e){return t.color>e.color?-1:t.colors[s.length-1].time+r)return null;for(e=null,i=0;i0?"top":"bottom")},m.prototype.hitTest=function(t,e){var i,o,n,s,r,a,l,h,c,d,p,u,_,f=Math.max(this.height,this.width),m=this._vertOffset,g=this._textVertOffset;for(e=e||F.REGULAR,o=0;o0?0:-this._textImageHeight,l=m>0?this._textImageHeight:0,h=t.x,c=t.y,d=n.x-s,p=r+a,u=n.x+s,_=r+l,h>d&&hp&&c<_))return new F(e,{})}return null},inherit(g,m),g.prototype.drawShape=function(t){var e,i,o,n,s,r,a=this._vertOffset>0?1:-1;for(e=0,i=this.items.length;e0?"middle":"bottom")},g.prototype.hitTest=function(t){var e,i,o,n=this._vertOffset,s=N.selectionTolerance(this.height);for(e=0;ep&&c<_&&d>u&&de.x+h||(i=this._items[l],o="lower"===i.pos,n=this._orderArrow.height+this._exitLineWidth,o||(n=-n),s=e.y+(o?this._orderArrow.vMargin:-this._orderArrow.vMargin),r=Math.min(s,s+n),a=Math.max(s,s+n),t.ya)))return!0;return!1},D.prototype._testText=function(t){for(var e,i,o,n,s,r,a,l,h,c,d,p=0;pl||(h=e.label&&e.qty?o&&t.ys-this._text.fontSize?e.label:e.qty:e.label||e.qty,c=this._textWidths[h],d=c&&c/2,!c||t.xi.x+d)))return!0;return!1},D.prototype.hitTest=function(t){var e=this._testOrderArrows(t),i=!e&&this._text&&this._testText(t);if(e||i)return new F(F.REGULAR)},O.prototype.draw=function(t){var e,i,o,n,s,r=this.data.vertLinesVisible,a=this.data.horzLinesVisible;(r||a)&&this.data&&(t.lineStyle=this.data.lineStyle,t.lineWidth=this.data.lineWidth,t.strokeStyle=this.data.color,e=this.data.lineWidth%2==0?.5:0,i=this.data.x+1+e,o=this.data.y+e,n=this.data.w,s=this.data.h,r&&i>=0&&CanvasEx.drawLine(t,i,0,i,s),a&&o>=0&&CanvasEx.drawLine(t,0,o,n,o),this.data.drawCenter&&(t.beginPath(),t.arc(i,o,3,0,2*Math.PI,!0),t.fillStyle=this.data.color,t.fill()))},B.prototype._drawShackle=function(t){var e=this._data.width-3,i=e/2,o=this._data.height-this._data.bodyHeight;t.moveTo(1.5,i),t.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),o>i&&(t.moveTo(1.5,i),t.lineTo(1.5,o),t.moveTo(this._data.width-1.5,i),t.lineTo(this._data.width-1.5,o))},B.prototype.draw=function(t){var e,i,o,n;t.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),e="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",o="#777",n="rgba(255,255,255,.7)",t.strokeStyle=e,t.lineWidth=2,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.strokeStyle=i,t.lineWidth=1,t.beginPath(),t.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),t.closePath(),t.stroke(),t.translate(0,-1),t.strokeStyle=o,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.fillStyle=n,t.beginPath(),t.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),t.fill(),t.beginPath(),t.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),t.stroke(),t.closePath(),t.fillStyle=o,t.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},e.PaneRendererBars=TradingView.PaneRendererBars=o,e.PaneRendererRenkoPB=TradingView.PaneRendererRenkoPB=n,e.PaneRendererKagi=TradingView.PaneRendererKagi=s,e.PaneRendererPnF=TradingView.PaneRendererPnF=r,e.PaneRendererHistogram=TradingView.PaneRendererHistogram=a,e.PaneRendererColumns=TradingView.PaneRendererColumns=l,e.PaneRendererLine=TradingView.PaneRendererLine=h,e.PaneRendererArea=TradingView.PaneRendererArea=c,e.PaneRendererCandles=TradingView.PaneRendererCandles=d,e.PaneRendererCross=TradingView.PaneRendererCross=p,e.PaneRendererCircles=TradingView.PaneRendererCircles=u,e.PaneRendererCrossShape=TradingView.PaneRendererCrossShape=T,e.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=O,e.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=B,e.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=_,e.PaneRendererArrowsUpDown=TradingView.PaneRendererArrowsUpDown=f,e.PaneRendererAbstractShape=TradingView.PaneRendererAbstractShape=m,e.PaneRendererUnicodeChar=TradingView.PaneRendererUnicodeChar=g,e.PaneRendererXCross=TradingView.PaneRendererXCross=v,e.PaneRendererTriangleApexUp=TradingView.PaneRendererTriangleApexUp=y,e.PaneRendererTriangleApexDown=TradingView.PaneRendererTriangleApexDown=b,e.PaneRendererTriangleApexLeft=TradingView.PaneRendererTriangleApexLeft=w,e.PaneRendererFlagShape=TradingView.PaneRendererFlagShape=S,e.PaneRendererCircleShape=TradingView.PaneRendererCircleShape=C,e.PaneRendererArrowsBase=TradingView.PaneRendererArrowsBase=x,e.PaneRendererArrowUp=TradingView.PaneRendererArrowUp=P,e.PaneRendererArrowDown=TradingView.PaneRendererArrowDown=L,e.PaneRendererLabelsBase=TradingView.PaneRendererLabelsBase=k,e.PaneRendererLabelUp=TradingView.PaneRendererLabelUp=I,e.PaneRendererLabelDown=TradingView.PaneRendererLabelDown=E,e.PaneRendererSquare=TradingView.PaneRendererSquare=A,e.PaneRendererDiamond=TradingView.PaneRendererDiamond=V,e.PaneRendererBackground=TradingView.PaneRendererBackground=M,e.PaneRendererClockIcon=TradingView.PaneRendererClockIcon=$,e.PaneRendererStudyStrategyOrders=TradingView.PaneRendererStudyStrategyOrders=D},function(t,e){"use strict";e.optimalBarWidth=function(t){return.3*t},e.selectionTolerance=function(t){return 2+.5*t},e.paneRendererCoordinateIsValid=function(t){return null!==t&&void 0!==t&&!TradingView.isNaN(t)}},function(t,e){"use strict";function i(t,e,i,o,n){var s,r,a,l,h;for(this._canvasesMap={},this._lines=t.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=this._fontStyle(e,i,o,n),this._fontSize=n,s=$("