Release v31.0.0 (from 028f81fbf6fef55e9694e5df4bd5106cc04c188a)

This commit is contained in:
jenkins
2026-03-05 21:03:46 +00:00
committed by Edward Dewhurst
parent 6fe5436603
commit c8eebb69a4
3622 changed files with 7663 additions and 6956 deletions

View File

@@ -0,0 +1,9 @@
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[243],{84131:(e,t,i)=>{t.rotationMatrix=function(e){const t=Math.cos(e),i=Math.sin(e);return[[t,-i,0],[i,t,0],[0,0,1]]},t.scalingMatrix=function(e,t){return[[e,0,0],[0,t,0],[0,0,1]]},t.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},t.transformPoint=function(e,t){const i=[t.x,t.y,1],o=[0,0,0];for(let t=0;t<3;t++)for(let n=0;n<3;n++)o[t]+=i[n]*e[t][n];return new n.Point(o[0],o[1])};const n=i(57415)},72674:(e,t,i)=>{i.d(t,{createLineStyleDefinition:()=>y});var n=i(91599),o=i(72769),r=i(73405),s=i(42897);const a=new o.TranslatedString("change {toolName} line visibility",n.t(null,void 0,i(68915))),l=new o.TranslatedString("change {toolName} line width",n.t(null,void 0,i(16362))),c=new o.TranslatedString("change {toolName} line style",n.t(null,void 0,i(99523))),d=new o.TranslatedString("change {toolName} line color",n.t(null,void 0,i(66711))),h=new o.TranslatedString("change {toolName} line extending left",n.t(null,void 0,i(18067))),u=new o.TranslatedString("change {toolName} line left end",n.t(null,void 0,i(72185))),p=new o.TranslatedString("change {toolName} line extending right",n.t(null,void 0,i(38958))),_=new o.TranslatedString("change {toolName} line right end",n.t(null,void 0,i(51470))),g=n.t(null,void 0,i(27912)),P=n.t(null,void 0,i(32389)),f=n.t(null,void 0,i(74573));function y(e,t,i,n,o){const y={},S={id:`${(0,s.removeSpaces)(i.originalText())}${n}`,title:o&&o.line||g};return void 0!==t.showLine&&(y.checked=(0,r.convertToDefinitionProperty)(e,t.showLine,a.format({toolName:i}))),void 0!==t.lineWidth&&(y.width=(0,r.convertToDefinitionProperty)(e,t.lineWidth,l.format({toolName:i}))),void 0!==t.lineStyle&&(y.style=(0,r.convertToDefinitionProperty)(e,t.lineStyle,c.format({toolName:i}))),void 0!==t.lineColor&&(y.color=(0,r.getColorDefinitionProperty)(e,t.lineColor,null,d.format({toolName:i}))),void 0!==t.extendLeft&&(y.extendLeft=(0,r.convertToDefinitionProperty)(e,t.extendLeft,h.format({toolName:i})),S.extendLeftTitle=o&&o.extendLeftTitle||P),void 0!==t.leftEnd&&(y.leftEnd=(0,r.convertToDefinitionProperty)(e,t.leftEnd,u.format({toolName:i}))),void 0!==t.extendRight&&(y.extendRight=(0,r.convertToDefinitionProperty)(e,t.extendRight,p.format({toolName:i})),S.extendRightTitle=o&&o.extendRightTitle||f),void 0!==t.rightEnd&&(y.rightEnd=(0,r.convertToDefinitionProperty)(e,t.rightEnd,_.format({toolName:i}))),(0,r.createLinePropertyDefinition)(y,S)}},40488:(e,t,i)=>{i.r(t),i.d(t,{GeneralFiguresDefinitionsViewModel:()=>_,GeneralFiguresDefinitionsViewModelBase:()=>p});var n=i(91599),o=i(72769),r=i(72674),s=i(44907),a=i(73405),l=i(42897);const c=new o.TranslatedString("change {title} background visibility",n.t(null,void 0,i(19514))),d=new o.TranslatedString("change {title} background color",n.t(null,void 0,i(77582))),h=n.t(null,void 0,i(69407)),u=n.t(null,void 0,i(36926));class p extends s.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){
const e=this._source.properties().childs(),t=this._source.name(),i=new o.TranslatedString(t,this._source.translatedType()),n=(0,r.createLineStyleDefinition)(this._propertyApplier,{lineColor:e.color,lineWidth:e.linewidth,lineStyle:e.linestyle},i,"Line",{line:h}),s="transparency"in e?e.transparency:null;return{definitions:[n,(0,a.createColorPropertyDefinition)({checked:(0,a.convertToDefinitionProperty)(this._propertyApplier,e.fillBackground,c.format({title:i})),color:(0,a.getColorDefinitionProperty)(this._propertyApplier,e.backgroundColor,s,d.format({title:i}))},{id:(0,l.removeSpaces)(`${t}BackgroundColor`),title:u})]}}}class _ extends p{}},44907:(e,t,i)=>{i.r(t),i.d(t,{LineDataSourceDefinitionsViewModel:()=>m,LineDataSourceTabTypes:()=>n,pointPriceBarTitle:()=>S});var n,o=i(85842),r=i(91599),s=i(72769),a=(i(53225),i(73405)),l=i(18632),c=i(89659),d=i(5258),h=i(14405),u=i(78379),p=i(65366);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(n||(n={}));const _=r.t(null,void 0,i(87733)),g=r.t(null,void 0,i(18817)),P=r.t(null,void 0,i(31992)),f=r.t(null,void 0,i(79115)),y=r.t(null,void 0,i(2931)),S=r.t(null,{context:"linetool point"},i(59712));class m{constructor(e,t){this._yCoordinateStepWV=null,this._propertyPages=[],this._source=t,this._undoModel=e,this._ownerSource=(0,o.ensureNotNull)(this._source.ownerSource()),this._propertyApplier=new u.PropertyApplierWithoutSavingChart((()=>e)),this._createPropertyRages()}destroy(){null!==this._yCoordinateStepWV&&(this._source.ownerSourceChanged().unsubscribeAll(this),this._ownerSource.priceStepChanged().unsubscribeAll(this)),this._source.pointAdded().unsubscribeAll(this),this._propertyPages.forEach((e=>{(0,a.destroyDefinitions)(e.definitions.value())}))}propertyPages(){return Promise.resolve(this._propertyPages)}_createPropertyRages(){this._propertyPages=[];const e=this._createInputsPropertyPage();null!==e&&this._propertyPages.push(e);const t=this._createStylePropertyPage();null!==t&&this._propertyPages.push(t);const i=this._createTextPropertyPage();null!==i&&this._propertyPages.push(i);const n=this._createCoordinatesPropertyPage();null!==n&&(n.visible=this._source.hasEditableCoordinates(),this._propertyPages.push(n));const o=this._createVisibilitiesPropertyPage();this._propertyPages.push(o)}_createVisibilitiesPropertyPage(){const e=this._source.properties().childs().intervalsVisibilities.childs();return(0,l.createPropertyPage)((0,d.getIntervalsVisibilitiesPropertiesDefinitions)(this._propertyApplier,e,new s.TranslatedString(this._source.name(),this._source.title(p.TitleDisplayTarget.StatusLine,!0))),"visibility",_)}_createCoordinatesPropertyPage(){const e=this._coordinatesPropertyDefinitions();return null!==e?(e.definitions.length<this._source.pointsCount()&&this._source.pointAdded().subscribe(this,this._updateCoordinatesPropertyDefinitons),(0,l.createPropertyPage)(e,"coordinates",g)):null}_getYCoordinateStepWV(){return null===this._yCoordinateStepWV&&(this._yCoordinateStepWV=new c.WatchedValue(function(e){
if(null!==e){const t=e.priceStep();if(null!==t)return t}return 1}(this._source.ownerSource())),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep())),this._source.ownerSourceChanged().subscribe(this,(()=>{this._ownerSource.priceStepChanged().unsubscribeAll(this),this._ownerSource=(0,o.ensureNotNull)(this._source.ownerSource()),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep()))}))),this._yCoordinateStepWV}_coordinatesPropertyDefinitions(){const e=this._source.points(),t=this._source.pointsProperty().childs().points,i=[],n=this._getYCoordinateStepWV();return e.forEach(((e,o)=>{const r=t[o].childs();r&&i.push((0,h.getCoordinatesPropertiesDefinitions)(this._propertyApplier,r,e,n,S.format({count:(o+1).toString()}),this._source.name()))})),{definitions:i}}_createStylePropertyPage(){const e=this._stylePropertyDefinitions();return null!==e?(0,l.createPropertyPage)(e,"style",P):null}_stylePropertyDefinitions(){return null}_createTextPropertyPage(){const e=this._textPropertyDefinitions();return null!==e?(0,l.createPropertyPage)(e,"text",f):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,l.createPropertyPage)(e,"inputs",y):null}_inputsPropertyDefinitions(){return null}_updateYCoordinateStep(){const e=this._ownerSource.priceStep();this._getYCoordinateStepWV().setValue(e||1)}_updateCoordinatesPropertyDefinitons(){const e=this._coordinatesPropertyDefinitions();if(null!==e){(0,o.ensureDefined)(this._propertyPages.find((e=>"coordinates"===e.id))).definitions.setValue(e.definitions),this._source.points().length===this._source.pointsCount()&&this._source.pointAdded().unsubscribeAll(this)}}}},3107:(e,t,i)=>{i.r(t),i.d(t,{LineToolArc:()=>B});var n=i(85842),o=i(17086),r=i(57415),s=i(84131),a=i(40488),l=i(82014),c=i(89659),d=i(47097),h=i(86684),u=i(17567),p=i(93445),_=i(88483),g=i(5829),P=i(25432),f=i(86371),y=i(33993);const S={intervalsVisibilities:{..._.intervalsVisibilitiesDefaults},linewidth:g.DEFAULT_LINE_TOOL_LINE_WIDTH,fillBackground:!0},m={color:h.colors.colorBerryPink500,backgroundColor:h.colors.colorBerryPink500Alpha20,transparency:80},v=new Map([[d.StdTheme.Light,m],[d.StdTheme.Dark,m]]),T=(0,p.extractThemedColors)((0,n.ensureDefined)(v.get(d.StdTheme.Light)),(0,n.ensureDefined)(v.get(d.StdTheme.Dark))),w=(0,p.extractAllPropertiesKeys)((0,n.ensureDefined)(v.get(d.StdTheme.Light))),b=(0,p.extractAllPropertiesKeys)(S),x=[...w,...b],D=[...new Set([...x,...P.commonLineToolPropertiesStateKeys])];class C extends f.LineDataSourceProperty{constructor(e){super(e),this.addChild("linesColors",new y.LineToolColorsProperty([this.childs().color]))}static create(e,t){return new this({defaultName:"linetoolarc",factoryDefaultsSupplier:()=>(0,u.factoryDefaultsForCurrentTheme)(S,v),nonThemedDefaultsKeys:b,themedDefaultsKeys:w,allStateKeys:D,themedColors:T,templateKeys:x,replaceThemedColorsOnThemeChange:!0,state:t,theme:e})}}
var M,k=i(99680),A=i(8165),I=i(41928),L=i(82347),V=i(83077),N=i(56568),R=i(72244);class W extends N.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data={...e,angleFrom:0,angleTo:Math.PI,clockwise:!1}}hitTest(e){if(null===this._data||this._data.points.length<3)return null;const t=(0,R.interactionTolerance)().curve,i=this._data.points[0],n=this._data.points[1];let a=this._data.points[2],l=(0,o.distanceToLine)(i,n,a).distance;if(l<1)return l=(0,o.distanceToLine)(i,n,e).distance,l<t?new V.HitTestResult(V.HitTarget.MovePoint):null;const c=n.subtract(i),d=c.length(),h=i.add(n).scaled(.5);let u=a.subtract(h).normalized();a=h.add(u.scaled(l));const p=c.x/d,_=c.y/d;let g=Math.acos(p);_<0&&(g=-g);let P=(0,s.translationMatrix)(-i.x,-i.y);e=(0,s.transformPoint)(P,e),P=(0,s.rotationMatrix)(-g),e=(0,s.transformPoint)(P,e),u=(0,s.transformPoint)(P,u);const f=1-Math.sqrt(3)/2;if(P=(0,s.scalingMatrix)(1,d*f/l),e=(0,s.transformPoint)(P,e),u=(0,s.transformPoint)(P,u),e.y*u.y<0)return null;let y;y=e.y<0?new r.Point(.5*d,d*Math.sqrt(3)/2):new r.Point(.5*d,-d*Math.sqrt(3)/2);const S=e.subtract(y).length();return Math.abs(S-d)<=t?new V.HitTestResult(V.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=e.context,i=this._data.points[0],n=this._data.points[1];if(this._data.points.length<3)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),void t.stroke();let a=this._data.points[2];const l=(0,o.distanceToLine)(i,n,a).distance;if(l<1)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),void t.stroke();const c=n.subtract(i),d=i.add(n).scaled(.5),h=new r.Point(-c.y,c.x).normalized();a=d.add(h.scaled(l)),t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth;const u=c.length(),p=c.x/u,_=c.y/u;let g=Math.acos(p);_<0&&(g=-g);let P=this._data.points[2],f=(0,s.translationMatrix)(-d.x,-d.y);P=(0,s.transformPoint)(f,P),f=(0,s.rotationMatrix)(-g),P=(0,s.transformPoint)(f,P),f=(0,s.scalingMatrix)(1,u/(2*l)),P=(0,s.transformPoint)(f,P),P.y<0?this._data.clockwise=!0:this._data.clockwise=!1,t.save(),t.beginPath(),t.translate(i.x,i.y),t.rotate(g);const y=1-Math.sqrt(3)/2;t.scale(1,l/(u*y)),this._data.clockwise?t.arc(.5*u,u*Math.sqrt(3)/2,u,-2*Math.PI/3,-Math.PI/3,!1):t.arc(.5*u,-u*Math.sqrt(3)/2,u,Math.PI/3,2*Math.PI/3,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=(0,L.generateColor)(this._data.backcolor,this._data.transparency),t.fill())}}class E extends I.LineSourcePaneView{constructor(){super(...arguments),this._arcRenderer=new W,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,0===this._points.length)return;const t=this._source.properties().childs(),i={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),
fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};this._arcRenderer.setData(i);const n=new k.CompositeRenderer;if(this._renderer=n,n.append(this._arcRenderer),1===i.points.length)return;const a=[],l=i.points[0],c=(0,A.lineSourcePaneViewPointToLineAnchorPoint)(l,0);a.push(c);const d=i.points[1],h=(0,A.lineSourcePaneViewPointToLineAnchorPoint)(d,1);if(2===i.points.length)return void this.addAnchors(n);a.push(h);let u=i.points[2];const p=(0,o.distanceToLine)(l,d,u).distance,_=d.subtract(l),g=l.add(d).scaled(.5),P=new r.Point(-_.y,_.x).normalized();u=g.add(P.scaled(p));const f=g.add(P.scaled(-p)),y=_.length(),S=_.x/y,m=_.y/y;let v=Math.acos(S);m<0&&(v=-v);let T=i.points[2],w=(0,s.translationMatrix)(-g.x,-g.y);T=(0,s.transformPoint)(w,T),w=(0,s.rotationMatrix)(-v),T=(0,s.transformPoint)(w,T),w=(0,s.scalingMatrix)(1,y/(2*p)),T=(0,s.transformPoint)(w,T);const b=(0,A.lineSourcePaneViewPointToLineAnchorPoint)(T.y>=0?u:f,2,(0,I.anchorResizeCursorType)(u,f));a.push(b),n.append(this.createLineAnchor({points:a},0))}}!function(e){e[e.ArcWithTwoPoints=1]="ArcWithTwoPoints",e[e.ArcWithTheePoints=2]="ArcWithTheePoints",e[e.TheLatest=2]="TheLatest"}(M||(M={}));class B extends l.LineDataSource{constructor(e,t,i,n){super(e,t??B.createProperties(e.backgroundTheme().spawnOwnership()),i,n),this._hasEditableCoordinates=new c.WatchedValue(!1),this.version=2,this._dist=null,this._setPaneViews([new E(this,e)])}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){const e=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),t=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[1])),i=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[2]));this._dist=(0,o.distanceToLine)(e,t,i).distance;const s=t.subtract(e),a=new r.Point(-s.y,s.x),l=e.add(t).scaled(.5);i.subtract(l).dotProduct(a)<0&&(this._dist=-this._dist)}}endChanging(e,t){return this._dist=null,super.endChanging(e,t)}pointsCount(){return 3}name(){return"Arc"}setPoint(e,t){const i={...t},a=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),l=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[1])),c=this._model.mainSeries().interval();switch(e){case 0:{const e=(0,n.ensureNotNull)(this._dist),t=(0,n.ensureNotNull)(this.pointToScreenPoint(i)),o=l.subtract(t),s=t.add(l).scaled(.5);let a=new r.Point(-o.y,o.x);a=a.normalized();const d=s.add(a.scaled(e));this._points[0]={...i,interval:c},this._points[2]={...(0,n.ensureNotNull)(this.screenPointToPoint(d)),interval:c};break}case 1:{const e=(0,n.ensureNotNull)(this._dist),t=(0,n.ensureNotNull)(this.pointToScreenPoint(i)),o=t.subtract(a),s=a.add(t).scaled(.5),l=new r.Point(-o.y,o.x).normalized(),d=s.add(l.scaled(e));this._points[1]={...i,interval:c},this._points[2]={...(0,n.ensureNotNull)(this.screenPointToPoint(d)),interval:c};break}case 2:{let e=(0,n.ensureNotNull)(this.pointToScreenPoint(i));const t=(0,o.distanceToLine)(a,l,e).distance,d=l.subtract(a),h=a.add(l).scaled(.5),u=new r.Point(-d.y,d.x).normalized(),p=h.add(u.scaled(t)),_=h.add(u.scaled(-t)),g=d.length(),P=d.x/g,f=d.y/g
;let y=Math.acos(P);f<0&&(y=-y);let S=(0,s.translationMatrix)(-h.x,-h.y);e=(0,s.transformPoint)(S,e);let m=(0,s.transformPoint)(S,p);S=(0,s.rotationMatrix)(-y),e=(0,s.transformPoint)(S,e),m=(0,s.transformPoint)(S,m),S=(0,s.scalingMatrix)(1,g/(2*t)),e=(0,s.transformPoint)(S,e),m=(0,s.transformPoint)(S,m);const v=e.y*m.y>=0?new r.Point(p.x,p.y):new r.Point(_.x,_.y);this._points[2]={...(0,n.ensureNotNull)(this.screenPointToPoint(v)),interval:c};break}}this._normalizePoints()}migrateVersion(e,t,i){if(1===e&&2===this._points.length){const e=this._model.mainSeries().interval(),t=(2*this._points[0].price+3*this._points[1].price)/5;this._points.push({price:t,index:this._points[1].index,interval:e})}if(1===e&&2===this._timePoint.length){const e={price:(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t,interval:this._properties.childs().interval.value()};this._timePoint.push(e)}}static createProperties(e,t){const i=C.create(e,t);return this._configureProperties(i),i}async _getPropertyDefinitionsViewModelClass(){return a.GeneralFiguresDefinitionsViewModelBase}}},25432:(e,t,i)=>{i.d(t,{commonLineToolPropertiesStateKeys:()=>n});const n=["symbolStateVersion","zOrderVersion","frozen","title","interval","symbol","currencyId","unitId","metricId","visible","adjustedToSplitTime","intervalsVisibilities.ticks","intervalsVisibilities.seconds","intervalsVisibilities.secondsFrom","intervalsVisibilities.secondsTo","intervalsVisibilities.minutes","intervalsVisibilities.minutesFrom","intervalsVisibilities.minutesTo","intervalsVisibilities.hours","intervalsVisibilities.hoursFrom","intervalsVisibilities.hoursTo","intervalsVisibilities.days","intervalsVisibilities.daysFrom","intervalsVisibilities.daysTo","intervalsVisibilities.weeks","intervalsVisibilities.weeksFrom","intervalsVisibilities.weeksTo","intervalsVisibilities.months","intervalsVisibilities.monthsFrom","intervalsVisibilities.monthsTo","intervalsVisibilities.ranges"];var o,r,s;!function(e){e[e.NotShared=0]="NotShared",e[e.SharedInLayout=1]="SharedInLayout",e[e.GloballyShared=2]="GloballyShared"}(o||(o={})),function(e){e.BeforeAllAction="BeforeAll",e.CustomAction="CustomAction"}(r||(r={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(s||(s={}))},41928:(e,t,i)=>{i.d(t,{LineSourcePaneView:()=>P,anchorResizeCursorType:()=>_,createLineSourcePaneViewPoint:()=>g});var n=i(11284),o=i(85842),r=i(29968),s=i(83077),a=i(71367),l=i(8165),c=i(28031),d=i(61208);const h=n.colorsPalette["color-tv-blue-600"];var u,p;function _(e,t){const i=e.x-t.x,n=e.y-t.y;if(!Number.isFinite(i)||!Number.isFinite(n)||0===i&&0===n)return c.PaneCursorType.Default;let r=Math.atan2(n,i);return r<0&&(r+=2*Math.PI),
r>=p.deg337_5||r<p.deg22_5||r>=p.deg157_5&&r<p.deg202_5?c.PaneCursorType.HorizontalResize:r>=p.deg22_5&&r<p.deg67_5||r>=p.deg202_5&&r<p.deg247_5?c.PaneCursorType.DiagonalNwSeResize:r>=p.deg67_5&&r<p.deg112_5||r>=p.deg247_5&&r<p.deg292_5?c.PaneCursorType.VerticalResize:r>=p.deg112_5&&r<p.deg157_5||r>=p.deg292_5&&r<p.deg337_5?c.PaneCursorType.DiagonalNeSwResize:void(0,o.assert)(!1,"unexpected angle")}function g(e,t){return e.pointIndex=t,e}!function(e){e[e.RegularAnchorRadius=6]="RegularAnchorRadius",e[e.TouchAnchorRadius=13]="TouchAnchorRadius",e[e.RegularStrokeWidth=1]="RegularStrokeWidth",e[e.TouchStrokeWidth=3]="TouchStrokeWidth",e[e.RegularSelectedStrokeWidth=3]="RegularSelectedStrokeWidth",e[e.TouchSelectedStrokeWidth=0]="TouchSelectedStrokeWidth"}(u||(u={})),function(e){e[e.deg22_5=Math.PI/8]="deg22_5",e[e.deg67_5=3*Math.PI/8]="deg67_5",e[e.deg112_5=5*Math.PI/8]="deg112_5",e[e.deg157_5=7*Math.PI/8]="deg157_5",e[e.deg202_5=9*Math.PI/8]="deg202_5",e[e.deg247_5=11*Math.PI/8]="deg247_5",e[e.deg292_5=13*Math.PI/8]="deg292_5",e[e.deg337_5=15*Math.PI/8]="deg337_5"}(p||(p={}));class P{constructor(e,t,i){this._invalidated=!0,this._points=[],this._middlePoint=null,this._selectionRenderers=[],this._lineAnchorRenderers=[],this._source=e,this._model=t,this._ownerSource=i??null}priceToCoordinate(e){const t=this._getOwnerSource(),i=t?.priceScale();if(null==i)return null;const n=null!==t?t.firstValue():null;return null===n?null:i.priceToCoordinate(e,n)}anchorColor(){return h}isHoveredSource(){return this._source===this._model.hoveredSource()}isSelectedSource(){return this._model.selection().isSelected(this._source)}isBeingEdited(){return this._model.lineBeingEdited()===this._source}isEditMode(){return!this._model.isSnapshot()}areAnchorsVisible(){return(this.isHoveredSource()&&!this.isLocked()||this.isSelectedSource())&&this.isEditMode()}update(){this._invalidated=!0}isLocked(){return Boolean(this._source.isLocked&&this._source.isLocked())}addAnchors(e,t={}){let i=this._getPoints();this._model.lineBeingCreated()===this._source&&(i=i.slice(0,-1));const n=this._source.points(),o=i.map(((e,t)=>{const i=n[t],o=(0,l.lineSourcePaneViewPointToLineAnchorPoint)(e);return i&&(o.snappingPrice=i.price,o.snappingIndex=i.index),o}));e.append(this.createLineAnchor({...t,points:o},0))}createLineAnchor(e,t){const i=e.points.map((e=>e.point)),n=this._getOwnerSource();if(this.isLocked()){const o=this._getSelectionRenderer(t);return o.setData({bgColors:this._lineAnchorColors(i),points:e.points,visible:this.areAnchorsVisible(),hittestResult:s.HitTarget.Regular,ownerSourceId:n?.id(),barSpacing:this._model.timeScale().barSpacing()}),o}const o=(0,r.lastMouseOrTouchEventInfo)().isTouch,a=this._getLineAnchorRenderer(t),l=this.isHoveredSource()?this._model.lastHittestData()?.pointIndex??null:null;return a.setData({...e,color:this.anchorColor(),backgroundColors:this._lineAnchorColors(i),hoveredPointIndex:l,linePointBeingEdited:this.isBeingEdited()?this._model.linePointBeingEdited():null,radius:this._anchorRadius(),
strokeWidth:o?u.TouchStrokeWidth:u.RegularStrokeWidth,selected:this.isSelectedSource(),selectedStrokeWidth:o?u.TouchSelectedStrokeWidth:u.RegularSelectedStrokeWidth,visible:this.areAnchorsVisible(),clickHandler:e.clickHandler,ownerSourceId:n?.id()}),a}_getOwnerSource(){return this._ownerSource??this._source.ownerSource()}_anchorRadius(){return(0,r.lastMouseOrTouchEventInfo)().isTouch?u.TouchAnchorRadius:u.RegularAnchorRadius}_lineAnchorColors(e){const t=(0,o.ensureNotNull)(this._model.paneForSource(this._source)).height();return e.map((e=>this._model.backgroundColorAtYPercentFromTop(e.y/t)))}_updateImpl(e){this._points=[];this._model.timeScale().isEmpty()||this._validatePriceScale()&&(this._source.points().forEach(((e,t)=>{const i=this._source.pointToScreenPoint(e,this._ownerSource??void 0);i&&this._points.push(g(i,t))})),2===this._points.length&&(this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._points[1])),this._invalidated=!1)}_validatePriceScale(){const e=this._getOwnerSource()?.priceScale();return null!=e&&!e.isEmpty()}_getSource(){return this._source}_getPoints(){return this._points}_getModel(){return this._model}_height(){const e=this._getOwnerSource()?.priceScale();return null!=e?e.height():0}_width(){return this._model.timeScale().width()}_needLabelExclusionPath(e,t){const i=this._source.properties().childs();return"middle"===(t??i.vertLabelsAlign.value())&&(0,d.needTextExclusionPath)(e)}_addAlertRenderer(e,t,i=this._source.properties().linecolor.value()){}_getAlertRenderer(e){return null}_getSelectionRenderer(e){for(;this._selectionRenderers.length<=e;)this._selectionRenderers.push(new a.SelectionRenderer);return this._selectionRenderers[e]}_getLineAnchorRenderer(e){for(;this._lineAnchorRenderers.length<=e;)this._lineAnchorRenderers.push(new l.LineAnchorRenderer);return this._lineAnchorRenderers[e]}}},86371:(e,t,i)=>{i.d(t,{LineDataSourceProperty:()=>l});var n=i(57600),o=i(35558),r=i(85842),s=i(93445),a=i(47895);class l extends s.DefaultProperty{constructor({templateKeys:e,factoryDefaultsSupplier:t,...i}){let n=t;t&&(n=()=>{const e=t();return(0,a.applyDefaultsOverrides)(e,void 0,void 0,i.defaultName),e}),super({saveNonDefaultUserPreferencesOnly:!0,factoryDefaultsSupplier:n,...i}),this._templateKeys=(0,r.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,s.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,o.default)((0,n.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},8165:(e,t,i)=>{i.d(t,{LineAnchorRenderer:()=>f,lineSourcePaneViewPointToLineAnchorPoint:()=>y,lineSourcePaneViewPointToLineAnchorPoint2:()=>S,mapLineSourcePaneViewPointToLineAnchorPoint:()=>m});var n=i(57415),o=i(91069),r=i(85842),s=i(51946),a=i(7321),l=i(83077),c=i(28031),d=i(72244),h=i(57507);function u(e,t,i,n){const{point:o}=t,r=i+n/2;(0,s.drawRoundRect)(e,o.x-r,o.y-r,2*r,2*r,(i+n)/2),e.closePath(),e.lineWidth=n}function p(e,t,i,n){e.globalAlpha=.2,u(e,t,i,n),e.stroke(),e.globalAlpha=1}function _(e,t,i,n){u(e,t,i-n,n),e.fill(),
e.stroke()}function g(e,t,i,n){const{point:o}=t;e.globalAlpha=.2,e.beginPath(),e.arc(o.x,o.y,i+n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.stroke(),e.globalAlpha=1}function P(e,t,i,n){const{point:o}=t;e.beginPath(),e.arc(o.x,o.y,i-n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.fill(),e.stroke()}class f extends h.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e??null}setData(e){this._data=e}hitTest(e){if(null===this._data||this._data.disableInteractions)return null;const{radius:t,points:i}=this._data,n=t+(0,d.interactionTolerance)().anchor;for(const t of i){if(t.point.subtract(e).length()<=n)return new l.HitTestResult(t.hitTarget??l.HitTarget.ChangePoint,{areaName:l.AreaName.AnchorPoint,pointIndex:t.pointIndex,cursorType:t.cursorType??c.PaneCursorType.Default,activeItem:t.activeItem,snappingPrice:t.snappingPrice,snappingIndex:t.snappingIndex,nonDiscreteIndex:t.nonDiscreteIndex,possibleMovingDirections:t.possibleMovingDirections,clickHandler:this._data.clickHandler,tapHandler:this._data.clickHandler,ownerSourceId:this._data.ownerSourceId})}return null}doesIntersectWithBox(e){return null!==this._data&&this._data.points.some((t=>(0,o.pointInBox)(t.point,e)))}_drawImpl(e){if(null===this._data||!this._data.visible)return;const t=[],i=[],n=[],o=[];for(let e=0;e<this._data.points.length;++e){const r=this._data.points[e],s=this._data.backgroundColors[e];r.square?(t.push(r),i.push(s)):(n.push(r),o.push(s))}t.length&&this._drawPoints(e,t,i,_,p),n.length&&this._drawPoints(e,n,o,P,g)}_drawPoints(e,t,i,o,s){const{context:l,horizontalPixelRatio:c,verticalPixelRatio:d}=e,h=(0,r.ensureNotNull)(this._data),u=h.radius;let p=Math.max(1,Math.floor((h.strokeWidth||2)*c));h.selected&&(p+=Math.max(1,Math.floor(c/2)));const _=Math.max(1,Math.floor(c));let g=Math.round(u*c*2);g%2!=_%2&&(g+=1);const P=_%2/2;l.strokeStyle=h.color;for(let e=0;e<t.length;++e){const r=t[e];if(!((0,a.isInteger)(r.pointIndex)&&h.linePointBeingEdited===r.pointIndex)){l.fillStyle=i[e];if(o(l,{...r,point:new n.Point(Math.round(r.point.x*c)+P,Math.round(r.point.y*d)+P)},g/2,p),!h.disableInteractions){if(null!==h.hoveredPointIndex&&r.pointIndex===h.hoveredPointIndex){const e=Math.max(1,Math.floor(h.selectedStrokeWidth*c));let t=Math.round(u*c*2);t%2!=_%2&&(t+=1);s(l,{...r,point:new n.Point(Math.round(r.point.x*c)+P,Math.round(r.point.y*d)+P)},t/2,e)}}}}}}function y(e,t=e.pointIndex,i,n,o,r,s,a,l,c){return{point:e,pointIndex:t,cursorType:i,square:n,hitTarget:o,snappingPrice:r,snappingIndex:s,nonDiscreteIndex:a,activeItem:l,possibleMovingDirections:c}}function S(e){return y(e.point,e.pointIndex,e.cursorType,e.square,e.hitTarget,e.snappingPrice,e.snappingIndex,e.nonDiscreteIndex,e.activeItem,e.possibleMovingDirections)}function m(e){return y(e)}},17567:(e,t,i)=>{i.d(t,{factoryDefaultsForCurrentTheme:()=>l});var n=i(35558),o=i(57600),r=i(85842),s=i(49841),a=i(47097);function l(e,t){const i=s.watchedTheme.value()??a.StdTheme.Light,l=(0,o.default)(e);return(0,n.default)(l,(0,r.ensureDefined)(t.get(i))),l}}}]);