"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[95011],{323109:(e,t,i)=>{i.d(t,{containsBackgroundTimePointIndexes:()=>r,dematerializeBackground:()=>a,isBackgroundInBarsRange:()=>d,materializeBackground:()=>l});var n=i(650151),s=i(732149);if(46485!=i.j)var o=i(387963);const r=!0;function l(e,t){if(e.start>=t.length||e.stop>=t.length)return null;const i=t[e.start],o=t[e.stop];return o===s.INVALID_TIME_POINT_INDEX?null:((0,n.assert)(i===s.INVALID_TIME_POINT_INDEX||i<=o,"start should not exceed stop"),{start:i===s.INVALID_TIME_POINT_INDEX?null:i,stop:o})}function a(e,t,i){return{id:t,start:(0,o.ensureTimePointIndexIndex)(i.indexOf(null!==e.start?e.start:s.INVALID_TIME_POINT_INDEX)),stop:(0,o.ensureTimePointIndexIndex)(i.indexOf(e.stop))}}function d(e,t){if(null===e.start)return t.firstBar()<=e.stop;const i=Math.min(e.start,e.stop),n=Math.max(e.start,e.stop);return t.contains(i)||t.contains(n)||it.lastBar()}},206395:(e,t,i)=>{i.d(t,{DwgBoxFontType:()=>l,DwgBoxStyle:()=>o,containsDwgBoxTimePointIndexes:()=>d,dematerializeDwgBox:()=>h,isDwgBoxInBarsRange:()=>p,materializeDwgBox:()=>c});var n=i(732149);if(46485!=i.j)var s=i(387963);var o,r,l,a=i(92245);!function(e){e.Solid="sol",e.Dotted="dot",e.Dashed="dsh",e.LeftArrow="al",e.RightArrow="ar",e.BothArrow="ab"}(o||(o={})),function(e){e.Top="top",e.Center="center",e.Bottom="bottom"}(r||(r={})),function(e){e.Monospace="monospace"}(l||(l={}));const d=!0;function c(e,t){var i,s;if(e.x1>=t.length||e.x2>=t.length||null===e.y1||null===e.y2)return null;let o=t[e.x1],r=t[e.x2];return o===n.INVALID_TIME_POINT_INDEX&&(o=null),r===n.INVALID_TIME_POINT_INDEX&&(r=null),{left:o,right:r,top:e.y1,bottom:e.y2,borderColorIndex:e.c,backgroundColorIndex:e.bc,extend:e.ex,borderStyle:e.st,borderWidth:e.w,text:e.t,wordWrap:e.tw,horizontalTextAlignment:e.tha,verticalTextAlignment:e.tva,fontSize:e.ts,textColorIndex:null!==(i=e.tc)&&void 0!==i?i:null,fontType:null!==(s=e.tf)&&void 0!==s?s:null}}function h(e,t,i){var o,r,l;return{id:t,x1:(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(o=e.left)&&void 0!==o?o:n.INVALID_TIME_POINT_INDEX)),x2:(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(r=e.right)&&void 0!==r?r:n.INVALID_TIME_POINT_INDEX)),y1:e.top,y2:e.bottom,c:e.borderColorIndex,bc:e.backgroundColorIndex,ex:e.extend,st:e.borderStyle,w:e.borderWidth,t:e.text,tw:e.wordWrap,tha:e.horizontalTextAlignment,tva:e.verticalTextAlignment,ts:e.fontSize,tf:null!==(l=e.fontType)&&void 0!==l?l:void 0,tc:e.textColorIndex}}function p(e,t){const i=e.extend;if(i===a.DwgExtend.Both)return null===e.left||null===e.right;if(null===e.left||null===e.right)return null!==e.right?e.right<=t.lastBar()&&i===a.DwgExtend.Right:null!==e.left&&(e.left>=t.firstBar()&&i===a.DwgExtend.Left);const n=Math.min(e.left,e.right),s=Math.max(e.left,e.right);if(t.contains(n)||t.contains(s)||nt.lastBar())return!0;const o=e.leftt.lastBar()&&o}},294024:(e,t,i)=>{i.d(t,{DwgLabelStyle:()=>o,DwgLabelTextAlign:()=>n,DwgLabelYloc:()=>s,containsDwgLabelTimePointIndexes:()=>d,dematerializeDwgLabel:()=>h,isDwgLabelInBarsRange:()=>p,materializeDwgLabel:()=>c});var n,s,o,r,l=i(732149);if(46485!=i.j)var a=i(387963);!function(e){e.Left="left",e.Center="center",e.Right="right"}(n||(n={})),function(e){e.AboveBar="ab",e.BelowBar="bl",e.Price="pr",e.Auto="auto"}(s||(s={})),function(e){e.Xcross="xcr",e.Cross="cr",e.Triangleup="tup",e.Triangledown="tdn",e.Flag="flg",e.Circle="cir",e.Arrowup="aup",e.Arrowdown="adn",e.LabelUp="lup",e.LabelDown="ldn",e.LabelLeft="llf",e.LabelRight="lrg",e.LabelCenter="lcn",e.LabelLeftUp="luplf",e.LabelLeftDown="llwlf",e.LabelRightUp="luprg",e.LabelRightDown="llwrg",e.Square="sq",e.Diamond="dia",e.TextOutline="to",e.None="n"}(o||(o={})),function(e){e.Monospace="monospace"}(r||(r={}));const d=!0;function c(e,t){var i;if(e.x>=t.length)return null;const s=t[e.x];return s===l.INVALID_TIME_POINT_INDEX?null:{x:s,y:e.y,yloc:e.yl,text:e.t,style:e.st,size:e.sz,colorIndex:e.ci,textColorIndex:e.tci,textAlign:e.ta||n.Center,tooltip:e.tt||"",fontType:null!==(i=e.tf)&&void 0!==i?i:null}}function h(e,t,i){var n;return{id:t,x:(0,a.ensureTimePointIndexIndex)(i.indexOf(e.x)),y:e.y,yl:e.yloc,t:e.text,st:e.style,sz:e.size,ci:e.colorIndex,tci:e.textColorIndex,ta:e.textAlign,tt:e.tooltip,tf:null!==(n=e.fontType)&&void 0!==n?n:void 0}}function p(e,t){return t.contains(e.x)}},934393:(e,t,i)=>{i.d(t,{containsDwgLineFillTimePointIndexes:()=>n,dematerializeDwgLineFill:()=>o,materializeDwgLineFill:()=>s});const n=!1;function s(e){return{id:e.id,line1:e.line1,line2:e.line2,colorIndex:e.ci}}function o(e,t){return{id:t,line1:e.line1,line2:e.line2,ci:e.colorIndex}}},258940:(e,t,i)=>{i.d(t,{DwgLineStyle:()=>o,containsDwgLineTimePointIndexes:()=>l,dematerializeDwgLine:()=>d,isDwgLineInBarsRange:()=>c,materializeDwgLine:()=>a});var n=i(732149);if(46485!=i.j)var s=i(387963);var o,r=i(92245);!function(e){e.Solid="sol",e.Dotted="dot",e.Dashed="dsh",e.LeftArrow="al",e.RightArrow="ar",e.BothArrow="ab"}(o||(o={}));const l=!0;function a(e,t){if(e.x1>=t.length||e.x2>=t.length||null===e.y1||null===e.y2)return null;let i=t[e.x1],s=t[e.x2];return i===n.INVALID_TIME_POINT_INDEX&&(i=null),s===n.INVALID_TIME_POINT_INDEX&&(s=null),null!==i&&null!==s||e.y1===e.y2?{id:e.id,x1:i,y1:e.y1,x2:s,y2:e.y2,style:e.st,extend:e.ex,width:e.w,colorIndex:e.ci}:null}function d(e,t,i){var o,r;const l=(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(o=e.x1)&&void 0!==o?o:n.INVALID_TIME_POINT_INDEX)),a=(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(r=e.x2)&&void 0!==r?r:n.INVALID_TIME_POINT_INDEX));return{id:t,x1:l,y1:e.y1,x2:a,y2:e.y2,st:e.style,ex:e.extend,w:e.width,ci:e.colorIndex}}function c(e,t){const i=e.extend;if(i===r.DwgExtend.Both)return!0;if(null===e.x1||null===e.x2)return null!==e.x2?e.x2<=t.lastBar()&&i===r.DwgExtend.Right:null!==e.x1&&(e.x1>=t.firstBar()&&i===r.DwgExtend.Left);const n=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2) ;if(t.contains(n)||t.contains(s)||nt.lastBar())return!0;const o=e.x1t.lastBar()&&o}},640073:(e,t,i)=>{if(i.d(t,{DwgPolylineStyle:()=>r,containsDwgPolylineTimePointIndexes:()=>o,dematerializeDwgPolyline:()=>a,isDwgPolylineInBarsRange:()=>d,materializeDwgPolyline:()=>l}),46485!=i.j)var n=i(387963);var s=i(732149);const o=!0;var r;function l(e,t){const i=[];for(const n of e.points){if(n.x>=t.length)continue;const e=t[n.x];e!==s.INVALID_TIME_POINT_INDEX&&i.push({x:e,y:n.y})}return 0===i.length?null:{id:e.id,points:i,width:e.w,curved:e.crv,closed:e.cls,color:e.c,fillColor:e.fc,style:e.st}}function a(e,t,i){return{id:t,points:e.points.map((e=>{var t;return{x:(0,n.ensureTimePointIndexIndex)(i.indexOf(null!==(t=e.x)&&void 0!==t?t:s.INVALID_TIME_POINT_INDEX)),y:e.y}})),w:e.width,crv:e.curved,cls:e.closed,c:e.color,fc:e.fillColor,st:e.style}}function d(e,t){if(0===e.points.length)return!1;const i=t.firstBar(),n=t.lastBar();let s=!1,o=!1;for(const r of e.points){if(t.contains(r.x))return!0;if(r.xn&&(o=!0),s&&o)return!0}return!1}!function(e){e.Solid="sol",e.Dotted="dot",e.Dashed="dsh",e.ArrowLeft="al",e.ArrowRight="ar",e.ArrowBoth="ab"}(r||(r={}))},590836:(e,t,i)=>{var n,s;i.d(t,{DwgTableCellFontType:()=>s,containsDwgTableCellTimePointIndexes:()=>a,containsDwgTableTimePointIndexes:()=>o,dematerializeDwgTable:()=>l,dematerializeDwgTableCell:()=>c,materializeDwgTable:()=>r,materializeDwgTableCell:()=>d}),function(e){e.Top="top",e.Center="center",e.Bottom="bottom"}(n||(n={})),function(e){e.Monospace="monospace"}(s||(s={}));const o=!1;function r(e,t){return{id:e.id,position:e.pos,rows:e.rows,columns:e.cols,backgroundColorIndex:e.bgc,frameColorIndex:e.frmc,frameWidth:e.frmw,borderColorIndex:e.brdc,borderWidth:e.brdw}}function l(e,t,i){return{id:t,pos:e.position,rows:e.rows,cols:e.columns,bgc:e.backgroundColorIndex,frmc:e.frameColorIndex,frmw:e.frameWidth,brdc:e.borderColorIndex,brdw:e.borderWidth}}const a=!1;function d(e,t){var i,n,s;return{tableId:e.tid,row:e.row,column:e.col,widthInPercentsOfPaneWidth:e.w,heightInPercentOfPaneHeight:e.h,text:e.t,textColorIndex:e.tc,horizontalTextAlignment:e.tha,verticalTextAlignment:e.tva,fontSize:e.ts,backgroundColorIndex:e.bgc,colSpan:null!==(i=e.colspan)&&void 0!==i?i:1,rowSpan:null!==(n=e.rowspan)&&void 0!==n?n:1,tooltip:e.tt,fontType:null!==(s=e.tf)&&void 0!==s?s:null}}function c(e,t,i){var n;return{id:t,tid:e.tableId,row:e.row,col:e.column,w:e.widthInPercentsOfPaneWidth,h:e.heightInPercentOfPaneHeight,t:e.text,tc:e.textColorIndex,tha:e.horizontalTextAlignment,tva:e.verticalTextAlignment,ts:e.fontSize,bgc:e.backgroundColorIndex,colspan:e.colSpan,rowspan:e.rowSpan,tt:e.tooltip,tf:null!==(n=e.fontType)&&void 0!==n?n:void 0}}},396372:(e,t,i)=>{i.d(t,{HHistDirection:()=>n,HHistLocation:()=>s,HHistVolumeMode:()=>o,containsHHistTimePointIndexes:()=>d,dematerializeHHist:()=>h,isHHistInBarsRange:()=>p, materializeHHist:()=>c});var n,s,o,r=i(650151),l=i(732149);if(46485!=i.j)var a=i(387963);!function(e){e.LeftToRight="left_to_right",e.RightToLeft="right_to_left"}(n||(n={})),function(e){e.Relative="relative",e.Absolute="absolute"}(s||(s={})),function(e){e.UpDown="Up/Down",e.Total="Total",e.Delta="Delta"}(o||(o={}));const d=!0;function c(e,t){if(e.firstBarTime>=t.length||e.lastBarTime>=t.length)return null;const i=t[e.firstBarTime],n=t[e.lastBarTime];return i===l.INVALID_TIME_POINT_INDEX||n===l.INVALID_TIME_POINT_INDEX?null:((0,r.assert)(i<=n,"firstBarTime should not exceed lastBarTime"),(0,r.assert)(e.priceLow<=e.priceHigh,"priceLow should not exceed priceHigh"),{firstBarTime:i,lastBarTime:n,rate:e.rate,priceHigh:e.priceHigh,priceLow:e.priceLow})}function h(e,t,i){const n=(0,a.ensureTimePointIndexIndex)(i.indexOf(e.firstBarTime)),s=(0,a.ensureTimePointIndexIndex)(i.indexOf(e.lastBarTime));return{id:t,...e,firstBarTime:n,lastBarTime:s}}function p(e,t){const i=Math.min(e.firstBarTime,e.lastBarTime),n=Math.max(e.firstBarTime,e.lastBarTime);return t.contains(i)||t.contains(n)||it.lastBar()}},921124:(e,t,i)=>{i.d(t,{containsHorizLineTimePointIndexes:()=>r,dematerializeHorizLine:()=>a,isHorizLineInBarsRange:()=>d,materializeHorizLine:()=>l});var n=i(650151),s=i(732149);if(46485!=i.j)var o=i(387963);const r=!0;function l(e,t){if(e.startIndex>=t.length||e.endIndex>=t.length)return null;const i=t[e.startIndex],o=t[e.endIndex];return i===s.INVALID_TIME_POINT_INDEX||o===s.INVALID_TIME_POINT_INDEX?null:((0,n.assert)(i<=o,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:o,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function a(e,t,i){const n=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),s=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return{id:t,...e,startIndex:n,endIndex:s}}function d(e,t){const i=Math.min(e.startIndex,e.endIndex),n=Math.max(e.startIndex,e.endIndex);if(t.contains(i)||t.contains(n)||it.lastBar())return!0;const s=e.startIndext.lastBar()&&s}},276636:(e,t,i)=>{var n;i.d(t,{TextPos:()=>n,containsLevelTimePointIndexes:()=>s,dematerializeLevel:()=>r,materializeLevel:()=>o}),function(e){e[e.TopLeft=0]="TopLeft",e[e.TopCenter=1]="TopCenter",e[e.TopRight=2]="TopRight",e[e.MiddleLeft=3]="MiddleLeft",e[e.MiddleCenter=4]="MiddleCenter",e[e.MiddleRight=5]="MiddleRight",e[e.BottomLeft=6]="BottomLeft",e[e.BottomCenter=7]="BottomCenter",e[e.BottomRight=8]="BottomRight"}(n||(n={}));const s=!1;function o(e){return{level:e.level,text:e.text}}function r(e,t,i){return{id:t,...e}}},573947:(e,t,i)=>{i.d(t,{containsLineTimePointIndexes:()=>r,dematerializeLine:()=>a,isLineInBarsRange:()=>d,materializeLine:()=>l});var n=i(650151),s=i(732149);if(46485!=i.j)var o=i(387963);const r=!0;function l(e,t){if(e.startIndex>=t.length||e.endIndex>=t.length)return null;const i=t[e.startIndex],o=t[e.endIndex] ;return i===s.INVALID_TIME_POINT_INDEX||o===s.INVALID_TIME_POINT_INDEX?null:((0,n.assert)(i<=o,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:o,startOffset:e.startOffset,endOffset:e.endOffset,startPrice:e.startPrice,endPrice:e.endPrice})}function a(e,t,i){const n=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),s=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return{id:t,...e,startIndex:n,endIndex:s}}function d(e,t){var i,n;const s=e.startIndex+(null!==(i=e.startOffset)&&void 0!==i?i:0),o=e.endIndex+(null!==(n=e.endOffset)&&void 0!==n?n:0),r=Math.min(s,o),l=Math.max(s,o);return t.contains(s)||t.contains(o)||rt.lastBar()}},700534:(e,t,i)=>{i.d(t,{LiveStudyGraphics:()=>N});var n=i(650151),s=i(707957),o=i(396372),r=i(921124),l=i(329081),a=i(878475),d=i(323109),c=i(294024),h=i(258940),p=i(640073),m=i(206395),x=i(276636),u=i(573947),I=i(14721),f=i(593885),g=i(180857),_=i(590836),w=i(934393),v=i(755470),T=i(952499),b=i(583884),y=i(686242),B=i(130551);function L(e){const t=JSON.parse(e.pp);var i;return(0,n.assert)("s"in(i=t)&&(0,B.isObject)(i.s)&&"l"in i.s&&"c"in i.s&&"e"in i&&(0,B.isObject)(i.e)&&"l"in i.e&&"c"in i.e,"unexpected log source"),{barTime:e.t,time:e.tms,level:e.ll,source:{start:{line:t.s.l,column:t.s.c},end:{line:t.e.l,column:t.e.c}},message:e.m}}function P(e){return{lines:e.l,time:e.t,invocations:e.c}}function D(e){return{total:e.total,profile:e.profile.map(P)}}var k=i(138839),z=i(214798),E=i(590713),C=i(2605),M=i(735758);class N{constructor(e={}){this._indexes=[],this._hhistsByTimePointIndex=new Map,this._primitivesCollection=function(e){const t={};for(const i of E.primitiveNames){t[i]=new Map;const n=e[i];if(void 0!==n)for(const e in n)if(n.hasOwnProperty(e))switch(i){case"horizlines":t[i].set(e,new V(r.materializeHorizLine,r.containsHorizLineTimePointIndexes));break;case"vertlines":t[i].set(e,new V(l.materializeVertLine,l.containsVertLineTimePointIndexes));break;case"lines":t[i].set(e,new V(u.materializeLine,u.containsLineTimePointIndexes));break;case"hlines":t[i].set(e,new V(x.materializeLevel,x.containsLevelTimePointIndexes));break;case"textmarks":t[i].set(e,new V(f.materializeTextMark,f.containsTextMarkTimePointIndexes));break;case"shapemarks":t[i].set(e,new V(I.materializeShapeMark,I.containsShapeMarkTimePointIndexes));break;case"backgrounds":t[i].set(e,new V(d.materializeBackground,d.containsBackgroundTimePointIndexes));break;case"polygons":t[i].set(e,new V(a.materializePolygon,a.containsPolygonTimePointIndexes));break;case"trendchannels":t[i].set(e,new V(g.materializeTrendChannel,g.containsTrendChannelTimePointIndexes));break;case"hhists":t[i].set(e,new V(o.materializeHHist,o.containsHHistTimePointIndexes));break;case"dwglabels":t[i].set(e,new V(c.materializeDwgLabel,c.containsDwgLabelTimePointIndexes));break;case"dwglines":t[i].set(e,new V(h.materializeDwgLine,h.containsDwgLineTimePointIndexes));break;case"dwgpolylines":t[i].set(e,new V(p.materializeDwgPolyline,p.containsDwgPolylineTimePointIndexes));break;case"dwgboxes": t[i].set(e,new V(m.materializeDwgBox,m.containsDwgBoxTimePointIndexes));break;case"dwgtables":t[i].set(e,new V(_.materializeDwgTable,_.containsDwgTableTimePointIndexes));break;case"dwgtablecells":t[i].set(e,new V(_.materializeDwgTableCell,_.containsDwgTableCellTimePointIndexes));break;case"dwglinefills":t[i].set(e,new V(w.materializeDwgLineFill,w.containsDwgLineFillTimePointIndexes));break;case"tpos":t[i].set(e,new V(v.materializeTpo,v.containsTpoTimePointIndexes));break;case"tpoBlockSets":t[i].set(e,new V(T.materializeTpoBlockSet,T.containsTpoBlockSetTimePointIndexes));break;case"tpoLevels":t[i].set(e,new V(b.materializeTpoLevelGroup,b.containsTpoLevelGroupTimePointIndexes));break;case"tpoVolumeRows":t[i].set(e,new V(y.materializeTpoVolumeRow,y.containsTpoVolumeRowTimePointIndexes));break;case"logs":t[i].set(e,new V(L,false));break;case"footprints":t[i].set(e,new V(k.materializeVolumeFootprint,k.containsFootprintTimePointIndexes));break;case"footprintLevels":t[i].set(e,new V(z.materializeVolumeFootprintPriceLevel,z.containsFootprintPriceLevelTimePointIndexes))}}t.performance.set("performance",new V(D,false));return t}(e),this._tpoBlockSetsByStyleIdAndTpoId=(0,M.setsByStyleIdAndKey)(this._primitivesCollection.tpoBlockSets,(e=>e.tpoId)),this._tpoVolumeRowsByStyleIdAndTpoId=(0,M.setsByStyleIdAndKey)(this._primitivesCollection.tpoVolumeRows,(e=>e.tpoId))}horizlines(){return this._primitivesCollection.horizlines}vertlines(){return this._primitivesCollection.vertlines}lines(){return this._primitivesCollection.lines}hlines(){return this._primitivesCollection.hlines}textmarks(){return this._primitivesCollection.textmarks}shapemarks(){return this._primitivesCollection.shapemarks}backgrounds(){return this._primitivesCollection.backgrounds}polygons(){return this._primitivesCollection.polygons}trendchannels(){return this._primitivesCollection.trendchannels}hhists(){return this._primitivesCollection.hhists}dwglabels(){return this._primitivesCollection.dwglabels}dwglines(){return this._primitivesCollection.dwglines}dwgpolylines(){return this._primitivesCollection.dwgpolylines}dwgboxes(){return this._primitivesCollection.dwgboxes}dwgtables(){return this._primitivesCollection.dwgtables}dwgtablecells(){return this._primitivesCollection.dwgtablecells}dwglinefills(){return this._primitivesCollection.dwglinefills}tpos(){return this._primitivesCollection.tpos}tpoBlockSets(){return this._primitivesCollection.tpoBlockSets}tpoBlockSetsByStyleAndTpoId(e,t){return this._tpoBlockSetsByStyleIdAndTpoId.get(e,t)}tpoLevels(){return this._primitivesCollection.tpoLevels}tpoVolumeRows(){return this._primitivesCollection.tpoVolumeRows}tpoVolumeRowByStyleAndTpoId(e,t){return this._tpoVolumeRowsByStyleIdAndTpoId.get(e,t)}logs(){return this._primitivesCollection.logs}observableLogs(){return this._primitivesCollection.logs}performance(){return this._primitivesCollection.performance}observablePerformance(){return this._primitivesCollection.performance}footprints(){return this._primitivesCollection.footprints}footprintLevels(){ return this._primitivesCollection.footprintLevels}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}clear(){this._indexes=[];for(const e of E.primitiveNames)this._primitivesCollection[e].forEach((e=>e.clear()));this._hhistsByTimePointIndex=new Map}extract(){const e=e=>e.extract(),t={indexes:this._indexes,horizlines:S(this._primitivesCollection.horizlines,e),vertlines:S(this._primitivesCollection.vertlines,e),lines:S(this._primitivesCollection.lines,e),hlines:S(this._primitivesCollection.hlines,e),textmarks:S(this._primitivesCollection.textmarks,e),shapemarks:S(this._primitivesCollection.shapemarks,e),backgrounds:S(this._primitivesCollection.backgrounds,e),polygons:S(this._primitivesCollection.polygons,e),trendchannels:S(this._primitivesCollection.trendchannels,e),hhists:S(this._primitivesCollection.hhists,e),dwglabels:S(this._primitivesCollection.dwglabels,e),dwglines:S(this._primitivesCollection.dwglines,e),dwgpolylines:S(this._primitivesCollection.dwgpolylines,e),dwgboxes:S(this._primitivesCollection.dwgboxes,e),dwgtables:S(this._primitivesCollection.dwgtables,e),dwgtablecells:S(this._primitivesCollection.dwgtablecells,e),dwglinefills:S(this._primitivesCollection.dwglinefills,e),tpos:S(this._primitivesCollection.tpos,e),tpoBlockSets:S(this._primitivesCollection.tpoBlockSets,e),tpoLevels:S(this._primitivesCollection.tpoLevels,e),tpoVolumeRows:S(this._primitivesCollection.tpoVolumeRows,e),logs:new Map,performance:new Map,footprints:S(this._primitivesCollection.footprints,e),footprintLevels:S(this._primitivesCollection.footprintLevels,e)};return this._hhistsByTimePointIndex=new Map,new C.StaticStudyGraphics("data",t)}replaceIndexesTo(e){this._indexes=e;const t=e=>e.replaceIndexesTo(this._indexes);for(const e of E.primitiveNames)this._primitivesCollection[e].forEach(t);this._hhistsByTimePointIndex=(0,E.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}processCommands(e){void 0!==e.erase&&this._processEraseCommands(e.erase),void 0!==e.create&&this._processCreateCommands(e.create)}_processCreateCommands(e){for(const t in e){if(!e.hasOwnProperty(t))continue;const i=t;switch(i){case"horizlines":R(this._indexes,this._primitivesCollection.horizlines,e[i]);break;case"vertlines":R(this._indexes,this._primitivesCollection.vertlines,e[i]);break;case"lines":R(this._indexes,this._primitivesCollection.lines,e[i]);break;case"hlines":R(this._indexes,this._primitivesCollection.hlines,e[i]);break;case"textmarks":R(this._indexes,this._primitivesCollection.textmarks,e[i]);break;case"shapemarks":R(this._indexes,this._primitivesCollection.shapemarks,e[i]);break;case"backgrounds":R(this._indexes,this._primitivesCollection.backgrounds,e[i]);break;case"polygons":R(this._indexes,this._primitivesCollection.polygons,e[i]);break;case"trendchannels":R(this._indexes,this._primitivesCollection.trendchannels,e[i]);break;case"hhists":R(this._indexes,this._primitivesCollection.hhists,e[i]);break;case"dwglabels":R(this._indexes,this._primitivesCollection.dwglabels,e[i]);break;case"dwglines": R(this._indexes,this._primitivesCollection.dwglines,e[i]);break;case"dwgpolylines":R(this._indexes,this._primitivesCollection.dwgpolylines,e[i]);break;case"dwgboxes":R(this._indexes,this._primitivesCollection.dwgboxes,e[i]);break;case"dwgtables":R(this._indexes,this._primitivesCollection.dwgtables,e[i]);break;case"dwgtablecells":R(this._indexes,this._primitivesCollection.dwgtablecells,e[i]);break;case"dwglinefills":R(this._indexes,this._primitivesCollection.dwglinefills,e[i]);break;case"tpos":R(this._indexes,this._primitivesCollection.tpos,e[i]);break;case"tpoBlockSets":R(this._indexes,this._primitivesCollection.tpoBlockSets,e[i]);break;case"tpoLevels":R(this._indexes,this._primitivesCollection.tpoLevels,e[i]);break;case"tpoVolumeRows":R(this._indexes,this._primitivesCollection.tpoVolumeRows,e[i]);break;case"logs":R(this._indexes,this._primitivesCollection.logs,e[i]);break;case"performance":R(this._indexes,this._primitivesCollection.performance,e[i]);break;case"footprints":R(this._indexes,this._primitivesCollection.footprints,e[i]);break;case"footprintLevels":R(this._indexes,this._primitivesCollection.footprintLevels,e[i])}}this._hhistsByTimePointIndex=(0,E.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}_processEraseCommands(e){for(const t of e)if("all"===t.action)for(const e of E.primitiveNames)this._primitivesCollection[e].forEach((e=>e.clearPrimitives()));else{const e=e=>e.deleteById(t.id);this._primitivesCollection[t.type].forEach(e)}this._hhistsByTimePointIndex=(0,E.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}}class V{constructor(e,t){this._primitivesDataById=new Map,this._primitiveById=new Map,this._changed=new s.Delegate,this._cleared=new s.Delegate,this._materializePrimitive=e,this._isRematerializationRequiredWithNewIndexes=t}changed(){return this._changed}cleared(){return this._cleared}forEach(e,t){this._primitiveById.forEach((i=>{e.call(t,i,i,this)}))}has(e){let t=!1;return this._primitiveById.forEach((i=>{t=t||i===e})),t}get size(){return this._primitiveById.size}[Symbol.iterator](){return this._primitiveById.values()}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}values(){return this._primitiveById.values()}hasId(e){return this._primitiveById.has(e)}addData(e,t){const i=[];e.forEach((e=>{this._primitivesDataById.set(e.id,e);const n=this._tryMaterialize(t,e);null!==n&&i.push(n)})),i.length>0&&this._changed.fire({created:i,removed:[]})}deleteById(e){const t=this._primitiveById.get(e);t&&(this._primitiveById.delete(e),this._primitivesDataById.delete(e),this._changed.fire({created:[],removed:[t]}))}clear(){this.clearPrimitives()}clearPrimitives(){this._primitivesDataById.clear(),this._primitiveById.clear(),this._cleared.fire()}replaceIndexesTo(e){if(!this._isRematerializationRequiredWithNewIndexes)return;const t=Array.from(this._primitiveById.values());this._primitiveById.clear(),this._primitivesDataById.forEach(this._tryMaterialize.bind(this,e),this);const i=Array.from(this._primitiveById.values());this._changed.fire({created:i, removed:t})}extract(){const e=new Set(this._primitivesDataById.values());return this.clearPrimitives(),e}_tryMaterialize(e,t){const i=this._materializePrimitive(t,e);return null!==i&&((0,n.assert)(!this._primitiveById.has(t.id),"primitive with specified id should not exist"),this._primitiveById.set(t.id,i)),i}}function S(e,t){const i=new Map;return e.forEach(((e,n)=>i.set(n,t(e)))),i}function R(e,t,i=[]){for(const s of i){const i=s.styleId,o=t.get(i);(0,n.assert)(void 0!==o,"Every style used by graphics primitive should be declared in study metainfo"),o.addData(s.data,e)}}},878475:(e,t,i)=>{i.d(t,{containsPolygonTimePointIndexes:()=>o,dematerializePolygon:()=>l,isPolygonInBarsRange:()=>a,materializePolygon:()=>r});var n=i(732149);if(46485!=i.j)var s=i(387963);const o=!0;function r(e,t){for(const i of e.points){if(i.index>=t.length)return null;if(t[i.index]===n.INVALID_TIME_POINT_INDEX)return null}return{points:e.points.map((e=>({index:t[e.index],offset:e.offset,level:e.level})))}}function l(e,t,i){return{id:t,points:e.points.map((e=>({...e,index:(0,s.ensureTimePointIndexIndex)(i.indexOf(e.index))})))}}function a(e,t){var i;if(e.points.some((e=>{var i;return t.contains(e.index+(null!==(i=e.offset)&&void 0!==i?i:0))})))return!0;let n=!1,s=!1;const o=t.firstBar();for(const t of e.points)t.index+(null!==(i=t.offset)&&void 0!==i?i:0){i.d(t,{containsShapeMarkTimePointIndexes:()=>r,dematerializeShapeMark:()=>a,isShapeMarkInBarsRange:()=>d,materializeShapeMark:()=>l});var n,s=i(732149);if(46485!=i.j)var o=i(387963);!function(e){e.Circle="circle",e.ArrowUp="arrowUp",e.ArrowDown="arrowDown",e.ArrowRight="arrowRight",e.ArrowLeft="arrowLeft",e.Square="square"}(n||(n={}));const r=!0;function l(e,t){if(e.time>=t.length)return null;const i=t[e.time];return i===s.INVALID_TIME_POINT_INDEX?null:{time:i,price:e.price}}function a(e,t,i){const n=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.time));return{id:t,...e,time:n}}function d(e,t){return t.contains(e.time)}},2605:(e,t,i)=>{if(i.d(t,{StaticStudyGraphics:()=>D,emptyStudyGraphics:()=>C,loadStudyGraphics:()=>M,saveStudyGraphics:()=>V}),46485!=i.j)var n=i(732149);var s=i(921124),o=i(329081),r=i(396372),l=i(878475),a=i(323109),d=i(276636),c=i(573947),h=i(14721),p=i(593885),m=i(180857),x=i(294024),u=i(258940),I=i(640073),f=i(206395),g=i(590836),_=i(934393),w=i(755470),v=i(952499),T=i(583884),b=i(686242),y=i(138839),B=i(214798),L=i(590713),P=i(735758);class D{constructor(e,t){if(this._indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._dwglabels=new Map,this._dwglines=new Map,this._dwgpolylines=new Map,this._dwgboxes=new Map,this._dwgtables=new Map,this._dwgtablecells=new Map,this._dwglinefills=new Map,this._tpos=new Map,this._tpoBlockSets=new Map,this._tpoLevelGroups=new Map,this._tpoVolumeRows=new Map,this._logs=new Map,this._performance=new Map, this._footprints=new Map,this._footprintLevels=new Map,"data"===e){const e=t;this._indexes=e.indexes,this._vertlines=k(e.vertlines,this._indexes,o.materializeVertLine),this._horizlines=k(e.horizlines,this._indexes,s.materializeHorizLine),this._polygons=k(e.polygons,this._indexes,l.materializePolygon),this._hhists=k(e.hhists,this._indexes,r.materializeHHist),this._backgrounds=k(e.backgrounds,this._indexes,a.materializeBackground),this._lines=k(e.lines,this._indexes,c.materializeLine),this._hlines=k(e.hlines,this._indexes,d.materializeLevel),this._textmarks=k(e.textmarks,this._indexes,p.materializeTextMark),this._shapemarks=k(e.shapemarks,this._indexes,h.materializeShapeMark),this._trendchannels=k(e.trendchannels,this._indexes,m.materializeTrendChannel),this._dwglabels=k(e.dwglabels,this._indexes,x.materializeDwgLabel),this._dwglines=k(e.dwglines,this._indexes,u.materializeDwgLine),this._dwgpolylines=k(e.dwgpolylines,this._indexes,I.materializeDwgPolyline),this._dwgboxes=k(e.dwgboxes,this._indexes,f.materializeDwgBox),this._dwgtables=k(e.dwgtables,this._indexes,g.materializeDwgTable),this._dwgtablecells=k(e.dwgtablecells,this._indexes,g.materializeDwgTableCell),this._dwglinefills=k(e.dwglinefills,this._indexes,_.materializeDwgLineFill),this._tpos=k(e.tpos,this._indexes,w.materializeTpo),this._tpoBlockSets=k(e.tpoBlockSets,this._indexes,v.materializeTpoBlockSet),this._tpoBlockSetsByStyleIdAndTpoId=(0,P.setsByStyleIdAndKey)(this._tpoBlockSets,(e=>e.tpoId)),this._tpoVolumeRowsByStyleIdAndTpoId=(0,P.setsByStyleIdAndKey)(this._tpoVolumeRows,(e=>e.tpoId)),this._tpoLevelGroups=k(e.tpoLevels,this._indexes,T.materializeTpoLevelGroup),this._tpoVolumeRows=k(e.tpoVolumeRows,this._indexes,b.materializeTpoVolumeRow),this._footprints=k(e.footprints,this._indexes,y.materializeVolumeFootprint),this._footprintLevels=k(e.footprintLevels,this._indexes,B.materializeVolumeFootprintPriceLevel)}else if("state"===e){const e=t;this._indexes=e.indexes||[],this._vertlines=z(e.vertlines,this._indexes,o.materializeVertLine),this._horizlines=z(e.horizlines,this._indexes,s.materializeHorizLine),this._polygons=z(e.polygons,this._indexes,l.materializePolygon),this._hhists=z(e.hhists,this._indexes,r.materializeHHist),this._backgrounds=z(e.backgrounds,this._indexes,a.materializeBackground),this._lines=z(e.lines,this._indexes,c.materializeLine),this._hlines=z(e.hlines,this._indexes,d.materializeLevel),this._textmarks=z(e.textmarks,this._indexes,p.materializeTextMark),this._shapemarks=z(e.shapemarks,this._indexes,h.materializeShapeMark),this._trendchannels=z(e.trendchannels,this._indexes,m.materializeTrendChannel),this._dwglabels=z(e.dwglabels,this._indexes,x.materializeDwgLabel),this._dwglines=z(e.dwglines,this._indexes,u.materializeDwgLine),this._dwgpolylines=z(e.dwgpolylines,this._indexes,I.materializeDwgPolyline),this._dwgboxes=z(e.dwgboxes,this._indexes,f.materializeDwgBox),this._dwgtables=z(e.dwgtables,this._indexes,g.materializeDwgTable),this._dwgtablecells=z(e.dwgtablecells,this._indexes,g.materializeDwgTableCell), this._dwglinefills=z(e.dwglinefills,this._indexes,_.materializeDwgLineFill),this._tpos=z(e.tpos,this._indexes,w.materializeTpo),this._tpoBlockSets=z(e.tpoBlockSets,this._indexes,v.materializeTpoBlockSet),this._tpoLevelGroups=z(e.tpoLevels,this._indexes,T.materializeTpoLevelGroup),this._tpoVolumeRows=z(e.tpoVolumeRows,this._indexes,b.materializeTpoVolumeRow)}this._hhistsByTimePointIndex=(0,L.splitHHistsByTimePointIndex)(this._hhists)}horizlines(){return this._horizlines}vertlines(){return this._vertlines}lines(){return this._lines}hlines(){return this._hlines}textmarks(){return this._textmarks}shapemarks(){return this._shapemarks}backgrounds(){return this._backgrounds}polygons(){return this._polygons}trendchannels(){return this._trendchannels}hhists(){return this._hhists}dwglabels(){return this._dwglabels}dwglines(){return this._dwglines}dwgpolylines(){return this._dwgpolylines}dwgboxes(){return this._dwgboxes}dwgtables(){return this._dwgtables}dwgtablecells(){return this._dwgtablecells}dwglinefills(){return this._dwglinefills}tpos(){return this._tpos}tpoBlockSets(){return this._tpoBlockSets}tpoLevels(){return this._tpoLevelGroups}tpoBlockSetsByStyleAndTpoId(e,t){var i;return null===(i=this._tpoBlockSetsByStyleIdAndTpoId)||void 0===i?void 0:i.get(e,t)}tpoVolumeRows(){return this._tpoVolumeRows}tpoVolumeRowByStyleAndTpoId(e,t){var i;return null===(i=this._tpoVolumeRowsByStyleIdAndTpoId)||void 0===i?void 0:i.get(e,t)}logs(){return this._logs}performance(){return this._performance}footprints(){return this._footprints}footprintLevels(){return this._footprintLevels}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}}function k(e,t,i){const n=new Map;return e.forEach(((e,s)=>{const o=n.get(s)||new Set;e.forEach((e=>{const n=i(e,t);null!==n&&o.add(n)})),n.set(s,o)})),n}function z(e,t,i){const n=new Map;if(void 0===e)return n;for(const s of e){const e=s.styleId,o=n.get(e)||new Set;s.data.forEach((e=>{const n=i(e,t);null!==n&&o.add(n)})),n.set(e,o)}return n}function E(e,t,i,n,s,o){const r=[];return e.forEach(((e,l)=>{e.forEach((e=>{(null===s||n(e,s))&&function(e,t,i){let n=null;for(const i of e)i.styleId===t&&(n=i);null===n&&(n={styleId:t,data:[]},e.push(n)),n.data.push(i)}(r,l,o(e,t(e),i))}))})),r.length>0?r:void 0}function C(){return new D}function M(e){return new D("state",e)}function N(e,t){return!0}function V(e,t){const i=function(e){const t=new Set;e.horizlines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex),t.add(e.endIndex)}))})),e.vertlines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.index)}))})),e.lines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex),t.add(e.endIndex)}))})),e.textmarks().forEach(((e,i)=>{e.forEach((e=>{t.add(e.time)}))})),e.shapemarks().forEach(((e,i)=>{e.forEach((e=>{t.add(e.time)}))})),e.backgrounds().forEach(((e,i)=>{e.forEach((e=>{t.add(null!==e.start?e.start:n.INVALID_TIME_POINT_INDEX),t.add(e.stop)}))})),e.polygons().forEach(((e,i)=>{e.forEach((e=>{e.points.forEach((e=>{t.add(e.index)}))}))})),e.trendchannels().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex), t.add(e.endIndex)}))})),e.hhists().forEach(((e,i)=>{e.forEach((e=>{t.add(e.firstBarTime),t.add(e.lastBarTime)}))})),e.dwglabels().forEach(((e,i)=>{e.forEach((e=>{t.add(e.x)}))})),e.dwglines().forEach(((e,i)=>{e.forEach((e=>{var i,s;t.add(null!==(i=e.x1)&&void 0!==i?i:n.INVALID_TIME_POINT_INDEX),t.add(null!==(s=e.x2)&&void 0!==s?s:n.INVALID_TIME_POINT_INDEX)}))})),e.dwgpolylines().forEach(((e,i)=>{e.forEach((e=>{var i;for(const s of e.points)t.add(null!==(i=s.x)&&void 0!==i?i:n.INVALID_TIME_POINT_INDEX)}))})),e.dwgboxes().forEach(((e,i)=>{e.forEach((e=>{var i,s;t.add(null!==(i=e.left)&&void 0!==i?i:n.INVALID_TIME_POINT_INDEX),t.add(null!==(s=e.right)&&void 0!==s?s:n.INVALID_TIME_POINT_INDEX)}))})),e.tpos().forEach(((e,i)=>{e.forEach((e=>{t.add(e.firstBarTime),t.add(e.lastBarTime)}))})),e.footprints().forEach((e=>{e.forEach((e=>{t.add(e.index)}))})),e.footprintLevels().forEach((e=>{e.forEach((e=>{t.add(e.startIndex),null!==e.extendTo&&t.add(e.extendTo)}))}));const i=Array.from(t);return i.sort(((e,t)=>e-t)),i}(e),L={indexes:i};let P=0;const D=()=>++P,k=e=>e.id;return L.vertlines=E(e.vertlines(),D,i,o.isVertLineInBarsRange,t,o.dematerializeVertLine),L.horizlines=E(e.horizlines(),D,i,s.isHorizLineInBarsRange,t,s.dematerializeHorizLine),L.polygons=E(e.polygons(),D,i,l.isPolygonInBarsRange,t,l.dematerializePolygon),L.hhists=E(e.hhists(),D,i,r.isHHistInBarsRange,t,r.dematerializeHHist),L.backgrounds=E(e.backgrounds(),D,i,a.isBackgroundInBarsRange,t,a.dematerializeBackground),L.lines=E(e.lines(),D,i,c.isLineInBarsRange,t,c.dematerializeLine),L.hlines=E(e.hlines(),D,i,N,t,d.dematerializeLevel),L.textmarks=E(e.textmarks(),D,i,p.isTextMarkInBarsRange,t,p.dematerializeTextMark),L.shapemarks=E(e.shapemarks(),D,i,h.isShapeMarkInBarsRange,t,h.dematerializeShapeMark),L.trendchannels=E(e.trendchannels(),D,i,m.isTrendChannelInBarsRange,t,m.dematerializeTrendChannel),L.dwglabels=E(e.dwglabels(),D,i,x.isDwgLabelInBarsRange,t,x.dematerializeDwgLabel),L.dwglines=E(e.dwglines(),k,i,u.isDwgLineInBarsRange,t,u.dematerializeDwgLine),L.dwgpolylines=E(e.dwgpolylines(),k,i,I.isDwgPolylineInBarsRange,t,I.dematerializeDwgPolyline),L.dwgboxes=E(e.dwgboxes(),D,i,f.isDwgBoxInBarsRange,t,f.dematerializeDwgBox),L.dwgtables=E(e.dwgtables(),k,i,N,t,g.dematerializeDwgTable),L.dwgtablecells=E(e.dwgtablecells(),D,i,N,t,g.dematerializeDwgTableCell),L.dwglinefills=E(e.dwglinefills(),D,i,N,t,_.dematerializeDwgLineFill),L.tpos=E(e.tpos(),k,i,N,t,w.dematerializeTpo),L.tpoBlockSets=E(e.tpoBlockSets(),D,i,N,t,v.dematerializeTpoBlockSet),L.tpoLevels=E(e.tpoLevels(),D,i,N,t,T.dematerializeTpoLevelGroup),L.tpoVolumeRows=E(e.tpoVolumeRows(),D,i,N,t,b.dematerializeTpoVolumeRow),L.footprints=E(e.footprints(),D,i,N,t,y.dematerializeVolumeFootprint),L.footprintLevels=E(e.footprintLevels(),D,i,N,t,B.dematerializeVolumeFootprintPriceLevel),L}},735758:(e,t,i)=>{function n(e,t){return new s(e,t)}i.d(t,{setsByStyleIdAndKey:()=>n});class s{constructor(e,t){this._setsByStyleIdAndKey=new Map,this._observableCollections=e,this._keyGetter=t}get(e,t){ const i=this._observableCollections.get(e);if(!i)return;let n=this._setsByStyleIdAndKey.get(e);if(!n){n=new Map,this._setsByStyleIdAndKey.set(e,n);for(const e of i)this._addPrimitiveToSet(n,e);"cleared"in i&&(i.cleared().subscribe(this,this._clearSetsByKey.bind(this,n)),i.changed().subscribe(this,this._handleCollectionChanges.bind(this,n)))}return n.get(t)}_addPrimitiveToSet(e,t){const i=this._keyGetter(t);let n=e.get(i);n||(n=new Set,e.set(i,n)),n.add(t)}_clearSetsByKey(e){e.clear()}_handleCollectionChanges(e,t){var i;for(const n of t.removed)null===(i=e.get(this._keyGetter(n)))||void 0===i||i.delete(n);for(const i of t.created)this._addPrimitiveToSet(e,i)}}},590713:(e,t,i)=>{i.d(t,{isStudyGraphicsEmpty:()=>o,primitiveNames:()=>n,primitivesZOrders:()=>s,splitHHistsByTimePointIndex:()=>r});const n=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists","dwglabels","dwglines","dwgpolylines","dwgboxes","dwgtables","dwgtablecells","dwglinefills","tpos","tpoBlockSets","tpoLevels","tpoVolumeRows","logs","performance","footprints","footprintLevels"],s=new Map([["logs",-4],["performance",-4],["polygons",-4],["trendchannels",-3],["textmarks",-2],["shapemarks",-2],["backgrounds",-1],["footprints",1],["footprintLevels",1],["hlines",1],["horizlines",1],["hhists",1],["dwglinefills",2],["vertlines",3],["lines",3],["dwglines",3],["dwgpolylines",3],["dwgboxes",4],["dwglabels",5],["dwgtables",6],["dwgtablecells",6],["tpos",7],["tpoBlockSets",7],["tpoLevels",7],["tpoVolumeRows",7]]);function o(e){return!n.some((t=>{const i=e[t]();for(const[,e]of i)if(e.size>0)return!0;return!1}))}function r(e){const t=new Map;return e.forEach(((e,i)=>{e.forEach((e=>{const n={...e,styleId:i},s=e.firstBarTime;let o=t.get(s);void 0===o&&(o=new Set,t.set(s,o)),o.add(n)}))})),t}},593885:(e,t,i)=>{i.d(t,{TextMarkType:()=>n,containsTextMarkTimePointIndexes:()=>l,dematerializeTextMark:()=>d,isTextMarkInBarsRange:()=>c,materializeTextMark:()=>a});var n,s,o=i(732149);if(46485!=i.j)var r=i(387963);!function(e){e.Triangle="triangle",e.Rectangle="rectangle"}(n||(n={})),function(e){e.Verdana="Verdana",e.CourierNew="Courier New",e.TimesNewRoman="Times New Roman",e.Arial="Arial"}(s||(s={}));const l=!0;function a(e,t){if(e.time>=t.length)return null;const i=t[e.time];return i===o.INVALID_TIME_POINT_INDEX?null:{time:i,offset:e.offset,text:e.text,price:e.price}}function d(e,t,i){const n=(0,r.ensureTimePointIndexIndex)(i.indexOf(e.time));return{id:t,...e,time:n}}function c(e,t){var i;return t.contains(e.time+(null!==(i=e.offset)&&void 0!==i?i:0))}},952499:(e,t,i)=>{i.d(t,{containsTpoBlockSetTimePointIndexes:()=>n,dematerializeTpoBlockSet:()=>o,materializeTpoBlockSet:()=>s});const n=!1;function s(e,t){return{tpoId:e.tpoId,blocks:e.blocks,rowIndex:e.rowIndex}}function o(e,t,i){return{id:t,tpoId:e.tpoId,blocks:e.blocks,rowIndex:e.rowIndex}}},583884:(e,t,i)=>{if(i.d(t,{containsTpoLevelGroupTimePointIndexes:()=>s,dematerializeTpoLevelGroup:()=>a,materializeTpoLevelGroup:()=>r}),46485!=i.j)var n=i(387963) ;const s=!0;function o(e,t){return null==e?e:t[e]}function r(e,t){var i;return{tpoId:e.tpoId,tpoPocIndex:e.tpoPocIndex,tpoPocExtendTo:o(e.tpoPocExtendTo,t),tpoValIndex:e.tpoValIndex,tpoVahIndex:e.tpoVahIndex,tpoMidpointIndex:e.tpoMidpointIndex,volumePocIndex:e.volumePocIndex,volumeValIndex:e.volumeValIndex,volumeVahIndex:e.volumeVahIndex,poorHighIndex:e.poorHighIndex,poorHighExtendTo:o(e.poorHighExtendTo,t),poorLowIndex:e.poorLowIndex,poorLowExtendTo:o(e.poorLowExtendTo,t),singleprints:null===(i=e.singleprints)||void 0===i?void 0:i.map((e=>function(e,t){return{index:e.index,extendTo:o(e.extendTo,t)}}(e,t)))}}function l(e,t){return null==e?e:(0,n.ensureTimePointIndexIndex)(t.indexOf(e))}function a(e,t,i){var n;return{id:t,tpoId:e.tpoId,tpoPocIndex:e.tpoPocIndex,tpoPocExtendTo:l(e.tpoPocExtendTo,i),tpoValIndex:e.tpoValIndex,tpoVahIndex:e.tpoVahIndex,tpoMidpointIndex:e.tpoMidpointIndex,volumePocIndex:e.volumePocIndex,volumeValIndex:e.volumeValIndex,volumeVahIndex:e.volumeVahIndex,poorHighIndex:e.poorHighIndex,poorHighExtendTo:l(e.poorHighExtendTo,i),poorLowIndex:e.poorLowIndex,poorLowExtendTo:l(e.poorLowExtendTo,i),singleprints:null===(n=e.singleprints)||void 0===n?void 0:n.map((e=>function(e,t){return{index:e.index,extendTo:l(e.extendTo,t)}}(e,i)))}}},686242:(e,t,i)=>{i.d(t,{containsTpoVolumeRowTimePointIndexes:()=>n,dematerializeTpoVolumeRow:()=>o,materializeTpoVolumeRow:()=>s});const n=!1;function s(e,t){return{tpoId:e.tpoId,rowIndex:e.rowIndex,volume:e.volume}}function o(e,t,i){return{id:t,tpoId:e.tpoId,rowIndex:e.rowIndex,volume:e.volume}}},755470:(e,t,i)=>{i.d(t,{containsTpoTimePointIndexes:()=>r,dematerializeTpo:()=>a,materializeTpo:()=>l});var n=i(650151),s=i(732149);if(46485!=i.j)var o=i(387963);const r=!0;function l(e,t){if(e.firstBarTime>=t.length||e.lastBarTime>=t.length)return null;const i=t[e.firstBarTime],o=t[e.lastBarTime];return i===s.INVALID_TIME_POINT_INDEX||o===s.INVALID_TIME_POINT_INDEX?null:((0,n.assert)(i<=o,"firstBarTime should not exceed lastBarTime"),{id:e.id,firstBarTime:i,lastBarTime:o,priceRange:e.priceRange,times:e.times})}function a(e,t,i){return{id:t,firstBarTime:(0,o.ensureTimePointIndexIndex)(i.indexOf(e.firstBarTime)),lastBarTime:(0,o.ensureTimePointIndexIndex)(i.indexOf(e.lastBarTime)),priceRange:e.priceRange,times:e.times}}},180857:(e,t,i)=>{i.d(t,{containsTrendChannelTimePointIndexes:()=>r,dematerializeTrendChannel:()=>a,isTrendChannelInBarsRange:()=>d,materializeTrendChannel:()=>l});var n=i(650151),s=i(732149);if(46485!=i.j)var o=i(387963);const r=!0;function l(e,t){if(e.startIndex>=t.length||e.endIndex>=t.length)return null;const i=t[e.startIndex],o=t[e.endIndex];return i===s.INVALID_TIME_POINT_INDEX||o===s.INVALID_TIME_POINT_INDEX?null:((0,n.assert)(i<=o,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:o,extendLeft:e.extendLeft,extendRight:e.extendRight,startHighPrice:e.startHighPrice,startLowPrice:e.startLowPrice,endHighPrice:e.endHighPrice,transparency:e.transparency})}function a(e,t,i){const n=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),s=(0, o.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return{id:t,...e,startIndex:n,endIndex:s}}function d(e,t){const i=Math.min(e.startIndex,e.endIndex),n=Math.max(e.startIndex,e.endIndex);if(t.contains(i)||t.contains(n)||it.lastBar())return!0;const s=e.startIndext.lastBar()&&s}},329081:(e,t,i)=>{i.d(t,{containsVertLineTimePointIndexes:()=>o,dematerializeVertLine:()=>l,isVertLineInBarsRange:()=>a,materializeVertLine:()=>r});var n=i(732149);if(46485!=i.j)var s=i(387963);const o=!0;function r(e,t){if(e.index>=t.length)return null;const i=t[e.index];return i===n.INVALID_TIME_POINT_INDEX?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function l(e,t,i){const n=(0,s.ensureTimePointIndexIndex)(i.indexOf(e.index));return{id:t,...e,index:n}}function a(e,t){return t.contains(e.index)}},214798:(e,t,i)=>{i.d(t,{containsFootprintPriceLevelTimePointIndexes:()=>o,dematerializeVolumeFootprintPriceLevel:()=>l,materializeVolumeFootprintPriceLevel:()=>r});var n=i(732149);if(46485!=i.j)var s=i(387963);const o=!0;function r(e,t){if(e.startIndex>=t.length)return null;const i=t[e.startIndex],s=null===e.extendTo?null:t[e.extendTo];return i===n.INVALID_TIME_POINT_INDEX||s===n.INVALID_TIME_POINT_INDEX?null:{id:e.id,price:e.price,type:e.type,startIndex:i,extendTo:s}}function l(e,t,i){var o,r;const l=(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(o=e.startIndex)&&void 0!==o?o:n.INVALID_TIME_POINT_INDEX)),a=null===e.extendTo?null:(0,s.ensureTimePointIndexIndex)(i.indexOf(null!==(r=e.extendTo)&&void 0!==r?r:n.INVALID_TIME_POINT_INDEX));return{id:t,price:e.price,type:e.type,startIndex:l,extendTo:a}}},989709:(e,t,i)=>{function n(e){const t=new Map;return e.plots.forEach(((e,i)=>{t.set(e.id,(e=>e[i+1]))})),t}function s(e,t){return null==e[t]}i.d(t,{studyEmptyPlotValuePredicate:()=>s,studyPlotFunctionMap:()=>n})}}]);