7 lines
20 KiB
JavaScript
7 lines
20 KiB
JavaScript
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1758],{72674:(e,t,i)=>{i.d(t,{createLineStyleDefinition:()=>S});var n=i(91599),r=i(72769),o=i(73405),s=i(42897);const l=new r.TranslatedString("change {toolName} line visibility",n.t(null,void 0,i(68915))),a=new r.TranslatedString("change {toolName} line width",n.t(null,void 0,i(16362))),d=new r.TranslatedString("change {toolName} line style",n.t(null,void 0,i(99523))),c=new r.TranslatedString("change {toolName} line color",n.t(null,void 0,i(66711))),h=new r.TranslatedString("change {toolName} line extending left",n.t(null,void 0,i(18067))),u=new r.TranslatedString("change {toolName} line left end",n.t(null,void 0,i(72185))),p=new r.TranslatedString("change {toolName} line extending right",n.t(null,void 0,i(38958))),_=new r.TranslatedString("change {toolName} line right end",n.t(null,void 0,i(51470))),g=n.t(null,void 0,i(27912)),f=n.t(null,void 0,i(32389)),P=n.t(null,void 0,i(74573));function S(e,t,i,n,r){const S={},y={id:`${(0,s.removeSpaces)(i.originalText())}${n}`,title:r&&r.line||g};return void 0!==t.showLine&&(S.checked=(0,o.convertToDefinitionProperty)(e,t.showLine,l.format({toolName:i}))),void 0!==t.lineWidth&&(S.width=(0,o.convertToDefinitionProperty)(e,t.lineWidth,a.format({toolName:i}))),void 0!==t.lineStyle&&(S.style=(0,o.convertToDefinitionProperty)(e,t.lineStyle,d.format({toolName:i}))),void 0!==t.lineColor&&(S.color=(0,o.getColorDefinitionProperty)(e,t.lineColor,null,c.format({toolName:i}))),void 0!==t.extendLeft&&(S.extendLeft=(0,o.convertToDefinitionProperty)(e,t.extendLeft,h.format({toolName:i})),y.extendLeftTitle=r&&r.extendLeftTitle||f),void 0!==t.leftEnd&&(S.leftEnd=(0,o.convertToDefinitionProperty)(e,t.leftEnd,u.format({toolName:i}))),void 0!==t.extendRight&&(S.extendRight=(0,o.convertToDefinitionProperty)(e,t.extendRight,p.format({toolName:i})),y.extendRightTitle=r&&r.extendRightTitle||P),void 0!==t.rightEnd&&(S.rightEnd=(0,o.convertToDefinitionProperty)(e,t.rightEnd,_.format({toolName:i}))),(0,o.createLinePropertyDefinition)(S,y)}},32635:(e,t,i)=>{i.r(t),i.d(t,{CyclicAndSineLinesPatternDefinitionsViewModel:()=>a});var n=i(91599),r=i(72769),o=i(72674),s=i(44907);const l=n.t(null,void 0,i(99758));class a extends s.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){const e=this._source.properties().childs();return{definitions:[(0,o.createLineStyleDefinition)(this._propertyApplier,{lineColor:e.linecolor,lineWidth:e.linewidth,lineStyle:e.linestyle},new r.TranslatedString(this._source.name(),this._source.translatedType()),"Line",{line:l})]}}}},44907:(e,t,i)=>{i.r(t),i.d(t,{LineDataSourceDefinitionsViewModel:()=>m,LineDataSourceTabTypes:()=>n,pointPriceBarTitle:()=>y});var n,r=i(85842),o=i(91599),s=i(72769),l=(i(53225),i(73405)),a=i(18632),d=i(89659),c=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 _=o.t(null,void 0,i(87733)),g=o.t(null,void 0,i(18817)),f=o.t(null,void 0,i(31992)),P=o.t(null,void 0,i(79115)),S=o.t(null,void 0,i(2931)),y=o.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,r.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,l.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 r=this._createVisibilitiesPropertyPage();this._propertyPages.push(r)}_createVisibilitiesPropertyPage(){const e=this._source.properties().childs().intervalsVisibilities.childs();return(0,a.createPropertyPage)((0,c.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,a.createPropertyPage)(e,"coordinates",g)):null}_getYCoordinateStepWV(){return null===this._yCoordinateStepWV&&(this._yCoordinateStepWV=new d.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,r.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,r)=>{const o=t[r].childs();o&&i.push((0,h.getCoordinatesPropertiesDefinitions)(this._propertyApplier,o,e,n,y.format({count:(r+1).toString()}),this._source.name()))})),{definitions:i}}_createStylePropertyPage(){const e=this._stylePropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"style",f):null}_stylePropertyDefinitions(){return null}_createTextPropertyPage(){
|
|
const e=this._textPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"text",P):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",S):null}_inputsPropertyDefinitions(){return null}_updateYCoordinateStep(){const e=this._ownerSource.priceStep();this._getYCoordinateStepWV().setValue(e||1)}_updateCoordinatesPropertyDefinitons(){const e=this._coordinatesPropertyDefinitions();if(null!==e){(0,r.ensureDefined)(this._propertyPages.find((e=>"coordinates"===e.id))).definitions.setValue(e.definitions),this._source.points().length===this._source.pointsCount()&&this._source.pointAdded().unsubscribeAll(this)}}}},73728:(e,t,i)=>{i.r(t),i.d(t,{LineToolCyclicLines:()=>R});var n=i(82014),r=i(57415),o=i(99680),s=i(68459),l=i(6353),a=i(41928),d=i(17068),c=i(8165),h=i(83077),u=i(80140);class p extends a.LineSourcePaneView{constructor(){super(...arguments),this._coordinates=[],this._trendRenderer=new l.TrendLineRenderer,this._renderer=new o.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._source.points().length<2)return;const t=this._model.timeScale(),i=this._source.priceScale();if(!i||i.isEmpty()||t.isEmpty())return;const n=this._source.points()[0],o=this._source.points()[1],l=o?o.index-n.index:1;if(this._coordinates=[],0===l)return;const a=t.visibleBarsStrictRange();if(null===a)return;if(l>0){for(let e=n.index;e<=a.lastBar();e+=l)this._coordinates.push(t.indexToCoordinate(e))}else{for(let e=n.index;e>=a.firstBar();e+=l)this._coordinates.push(t.indexToCoordinate(e))}if(this._points.length<2)return;const p=this._source.properties().childs(),_={points:this._points,color:"#808080",linewidth:1,linestyle:u.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:s.LineEnd.Normal,rightend:s.LineEnd.Normal};this._trendRenderer.setData(_),this._renderer.append(this._trendRenderer);for(let e=0;e<this._coordinates.length;e++){const t={x:this._coordinates[e],color:p.linecolor.value(),linewidth:p.linewidth.value(),linestyle:p.linestyle.value()},i=new d.VerticalLineRenderer;i.setData(t),this._renderer.append(i)}if(2===this._source.points().length){const e=this._points.map((e=>({point:e,pointIndex:e.pointIndex})));this._renderer.append(this.createLineAnchor({points:e},0))}else this._renderer.append(this.createLineAnchor({points:[(0,c.lineSourcePaneViewPointToLineAnchorPoint)(new r.Point(this._points[0].x,i.height()/2),void 0,void 0,void 0,h.HitTarget.MovePoint)]},1))}}var _=i(32635),g=i(85842),f=i(47097),P=i(88483),S=i(25432),y=i(93445),m=i(17567),v=i(86371),T=i(33993);const w={intervalsVisibilities:{...P.intervalsVisibilitiesDefaults},linewidth:2,linestyle:u.LINESTYLE_SOLID},b={linecolor:"#80ccdb"},x=new Map([[f.StdTheme.Light,b],[f.StdTheme.Dark,b]]),D=(0,y.extractThemedColors)((0,g.ensureDefined)(x.get(f.StdTheme.Light)),(0,g.ensureDefined)(x.get(f.StdTheme.Dark))),C=(0,y.extractAllPropertiesKeys)((0,
|
|
g.ensureDefined)(x.get(f.StdTheme.Light))),I=(0,y.extractAllPropertiesKeys)(w),L=[...new Set([...C,...I,...S.commonLineToolPropertiesStateKeys])];class A extends v.LineDataSourceProperty{constructor(e){super(e),this.addChild("linesColors",new T.LineToolColorsProperty([(0,g.ensureDefined)(this.child("linecolor"))])),this.addChild("linesWidths",new T.LineToolWidthsProperty([(0,g.ensureDefined)(this.child("linewidth"))]))}static create(e,t){return new this({defaultName:"linetoolcirclelines",factoryDefaultsSupplier:()=>(0,m.factoryDefaultsForCurrentTheme)(w,x),nonThemedDefaultsKeys:I,themedDefaultsKeys:C,allStateKeys:L,themedColors:D,replaceThemedColorsOnThemeChange:!0,state:t,theme:e})}}class R extends n.LineDataSource{constructor(e,t,i,n){super(e,t??R.createProperties(e.backgroundTheme().spawnOwnership()),i,n),this._setPaneViews([new p(this,e)])}pointsCount(){return 2}name(){return"Cyclic Lines"}template(){return this._properties.template()}static createProperties(e,t){const i=A.create(e,t);return this._configureProperties(i),i}async _getPropertyDefinitionsViewModelClass(){return _.CyclicAndSineLinesPatternDefinitionsViewModel}static _addCollectedProperties(e){}}},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 r,o,s;!function(e){e[e.NotShared=0]="NotShared",e[e.SharedInLayout=1]="SharedInLayout",e[e.GloballyShared=2]="GloballyShared"}(r||(r={})),function(e){e.BeforeAllAction="BeforeAll",e.CustomAction="CustomAction"}(o||(o={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(s||(s={}))},41928:(e,t,i)=>{i.d(t,{LineSourcePaneView:()=>f,anchorResizeCursorType:()=>_,createLineSourcePaneViewPoint:()=>g});var n=i(11284),r=i(85842),o=i(29968),s=i(83077),l=i(71367),a=i(8165),d=i(28031),c=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 d.PaneCursorType.Default;let o=Math.atan2(n,i);return o<0&&(o+=2*Math.PI),
|
|
o>=p.deg337_5||o<p.deg22_5||o>=p.deg157_5&&o<p.deg202_5?d.PaneCursorType.HorizontalResize:o>=p.deg22_5&&o<p.deg67_5||o>=p.deg202_5&&o<p.deg247_5?d.PaneCursorType.DiagonalNwSeResize:o>=p.deg67_5&&o<p.deg112_5||o>=p.deg247_5&&o<p.deg292_5?d.PaneCursorType.VerticalResize:o>=p.deg112_5&&o<p.deg157_5||o>=p.deg292_5&&o<p.deg337_5?d.PaneCursorType.DiagonalNeSwResize:void(0,r.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 f{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(),r=i.map(((e,t)=>{const i=n[t],r=(0,a.lineSourcePaneViewPointToLineAnchorPoint)(e);return i&&(r.snappingPrice=i.price,r.snappingIndex=i.index),r}));e.append(this.createLineAnchor({...t,points:r},0))}createLineAnchor(e,t){const i=e.points.map((e=>e.point)),n=this._getOwnerSource();if(this.isLocked()){const r=this._getSelectionRenderer(t);return r.setData({bgColors:this._lineAnchorColors(i),points:e.points,visible:this.areAnchorsVisible(),hittestResult:s.HitTarget.Regular,ownerSourceId:n?.id(),barSpacing:this._model.timeScale().barSpacing()}),r}const r=(0,o.lastMouseOrTouchEventInfo)().isTouch,l=this._getLineAnchorRenderer(t),a=this.isHoveredSource()?this._model.lastHittestData()?.pointIndex??null:null;return l.setData({...e,color:this.anchorColor(),backgroundColors:this._lineAnchorColors(i),hoveredPointIndex:a,linePointBeingEdited:this.isBeingEdited()?this._model.linePointBeingEdited():null,radius:this._anchorRadius(),
|
|
strokeWidth:r?u.TouchStrokeWidth:u.RegularStrokeWidth,selected:this.isSelectedSource(),selectedStrokeWidth:r?u.TouchSelectedStrokeWidth:u.RegularSelectedStrokeWidth,visible:this.areAnchorsVisible(),clickHandler:e.clickHandler,ownerSourceId:n?.id()}),l}_getOwnerSource(){return this._ownerSource??this._source.ownerSource()}_anchorRadius(){return(0,o.lastMouseOrTouchEventInfo)().isTouch?u.TouchAnchorRadius:u.RegularAnchorRadius}_lineAnchorColors(e){const t=(0,r.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,c.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 l.SelectionRenderer);return this._selectionRenderers[e]}_getLineAnchorRenderer(e){for(;this._lineAnchorRenderers.length<=e;)this._lineAnchorRenderers.push(new a.LineAnchorRenderer);return this._lineAnchorRenderers[e]}}},86371:(e,t,i)=>{i.d(t,{LineDataSourceProperty:()=>a});var n=i(57600),r=i(35558),o=i(85842),s=i(93445),l=i(47895);class a extends s.DefaultProperty{constructor({templateKeys:e,factoryDefaultsSupplier:t,...i}){let n=t;t&&(n=()=>{const e=t();return(0,l.applyDefaultsOverrides)(e,void 0,void 0,i.defaultName),e}),super({saveNonDefaultUserPreferencesOnly:!0,factoryDefaultsSupplier:n,...i}),this._templateKeys=(0,o.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,s.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,r.default)((0,n.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},8165:(e,t,i)=>{i.d(t,{LineAnchorRenderer:()=>P,lineSourcePaneViewPointToLineAnchorPoint:()=>S,lineSourcePaneViewPointToLineAnchorPoint2:()=>y,mapLineSourcePaneViewPointToLineAnchorPoint:()=>m});var n=i(57415),r=i(91069),o=i(85842),s=i(51946),l=i(7321),a=i(83077),d=i(28031),c=i(72244),h=i(57507);function u(e,t,i,n){const{point:r}=t,o=i+n/2;(0,s.drawRoundRect)(e,r.x-o,r.y-o,2*o,2*o,(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:r}=t;e.globalAlpha=.2,e.beginPath(),e.arc(r.x,r.y,i+n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.stroke(),e.globalAlpha=1}function f(e,t,i,n){const{point:r}=t;e.beginPath(),e.arc(r.x,r.y,i-n/2,0,2*Math.PI,!0),e.closePath(),e.lineWidth=n,e.fill(),e.stroke()}class P 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,c.interactionTolerance)().anchor;for(const t of i){if(t.point.subtract(e).length()<=n)return new a.HitTestResult(t.hitTarget??a.HitTarget.ChangePoint,{areaName:a.AreaName.AnchorPoint,pointIndex:t.pointIndex,cursorType:t.cursorType??d.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,r.pointInBox)(t.point,e)))}_drawImpl(e){if(null===this._data||!this._data.visible)return;const t=[],i=[],n=[],r=[];for(let e=0;e<this._data.points.length;++e){const o=this._data.points[e],s=this._data.backgroundColors[e];o.square?(t.push(o),i.push(s)):(n.push(o),r.push(s))}t.length&&this._drawPoints(e,t,i,_,p),n.length&&this._drawPoints(e,n,r,f,g)}_drawPoints(e,t,i,r,s){const{context:a,horizontalPixelRatio:d,verticalPixelRatio:c}=e,h=(0,o.ensureNotNull)(this._data),u=h.radius;let p=Math.max(1,Math.floor((h.strokeWidth||2)*d));h.selected&&(p+=Math.max(1,Math.floor(d/2)));const _=Math.max(1,Math.floor(d));let g=Math.round(u*d*2);g%2!=_%2&&(g+=1);const f=_%2/2;a.strokeStyle=h.color;for(let e=0;e<t.length;++e){const o=t[e];if(!((0,l.isInteger)(o.pointIndex)&&h.linePointBeingEdited===o.pointIndex)){a.fillStyle=i[e];if(r(a,{...o,point:new n.Point(Math.round(o.point.x*d)+f,Math.round(o.point.y*c)+f)},g/2,p),!h.disableInteractions){if(null!==h.hoveredPointIndex&&o.pointIndex===h.hoveredPointIndex){const e=Math.max(1,Math.floor(h.selectedStrokeWidth*d));let t=Math.round(u*d*2);t%2!=_%2&&(t+=1);s(a,{...o,point:new n.Point(Math.round(o.point.x*d)+f,Math.round(o.point.y*c)+f)},t/2,e)}}}}}}function S(e,t=e.pointIndex,i,n,r,o,s,l,a,d){return{point:e,pointIndex:t,cursorType:i,square:n,hitTarget:r,snappingPrice:o,snappingIndex:s,nonDiscreteIndex:l,activeItem:a,possibleMovingDirections:d}}function y(e){return S(e.point,e.pointIndex,e.cursorType,e.square,e.hitTarget,e.snappingPrice,e.snappingIndex,e.nonDiscreteIndex,e.activeItem,e.possibleMovingDirections)}function m(e){return S(e)}},17567:(e,t,i)=>{i.d(t,{factoryDefaultsForCurrentTheme:()=>a});var n=i(35558),r=i(57600),o=i(85842),s=i(49841),l=i(47097);function a(e,t){const i=s.watchedTheme.value()??l.StdTheme.Light,a=(0,r.default)(e);return(0,n.default)(a,(0,o.ensureDefined)(t.get(i))),a}}}]); |