(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3248],{91445:(e,t,o)=>{"use strict";o.d(t,{createTextStyleDefinition:()=>w});var i=o(11542),r=o(95804),n=o(95338),s=o(91682);const l=new r.TranslatedString("change {toolName} text visibility",i.t(null,void 0,o(56634))),a=new r.TranslatedString("change {toolName} text color",i.t(null,void 0,o(64500))),d=new r.TranslatedString("change {toolName} text font size",i.t(null,void 0,o(21781))),c=new r.TranslatedString("change {toolName} text font bold",i.t(null,void 0,o(24701))),h=new r.TranslatedString("change {toolName} text font italic",i.t(null,void 0,o(42694))),u=new r.TranslatedString("change {toolName} text",i.t(null,void 0,o(66668))),p=new r.TranslatedString("change {toolName} labels alignment vertical",i.t(null,void 0,o(31689))),g=new r.TranslatedString("change {toolName} labels alignment horizontal",i.t(null,void 0,o(88277))),f=new r.TranslatedString("change {toolName} labels direction",i.t(null,void 0,o(61160))),b=new r.TranslatedString("change {toolName} text background visibility",i.t(null,void 0,o(31133))),m=new r.TranslatedString("change {toolName} text background color",i.t(null,void 0,o(22231))),T=new r.TranslatedString("change {toolName} text border visibility",i.t(null,void 0,o(58704))),y=new r.TranslatedString("change {toolName} text border width",i.t(null,void 0,o(35423))),_=new r.TranslatedString("change {toolName} text border color",i.t(null,void 0,o(36666))),v=new r.TranslatedString("change {toolName} text wrap",i.t(null,void 0,o(39587))),x=i.t(null,void 0,o(79468)),C=i.t(null,void 0,o(38408)),P=i.t(null,void 0,o(7560)),S=i.t(null,void 0,o(6060));function w(e,t,o,i){const r={},w={id:`${(0,s.removeSpaces)(o.originalText())}Text`,title:i.customTitles&&i.customTitles.text||"",placeholder:i.placeholder??S};if(void 0===t.showText||i.hideTextCheckbox||(r.checked=(0,n.convertToDefinitionProperty)(e,t.showText,l.format({toolName:o}))),void 0!==t.textColor&&(r.color=(0,n.getColorDefinitionProperty)(e,t.textColor,t.transparency||null,a.format({toolName:o}))),void 0!==t.fontSize&&(r.size=(0,n.convertToDefinitionProperty)(e,t.fontSize,d.format({toolName:o}))),void 0!==t.bold&&(r.bold=(0,n.convertToDefinitionProperty)(e,t.bold,c.format({toolName:o}))),void 0!==t.italic&&(r.italic=(0,n.convertToDefinitionProperty)(e,t.italic,h.format({toolName:o}))),void 0!==t.text){const s=u.format({toolName:o});r.text=(0,n.convertToDefinitionProperty)(e,t.text,s,void 0),w.isEditable=Boolean(i.isEditable),w.isMultiLine=Boolean(i.isMultiLine)}if(void 0!==t.vertLabelsAlign&&(r.alignmentVertical=(0,n.convertToDefinitionProperty)(e,t.vertLabelsAlign,p.format({toolName:o})),w.alignmentVerticalItems=i.alignmentVerticalItems),void 0!==t.horzLabelsAlign&&(r.alignmentHorizontal=(0,n.convertToDefinitionProperty)(e,t.horzLabelsAlign,g.format({toolName:o})),w.alignmentHorizontalItems=i.alignmentHorizontalItems),void 0!==t.textOrientation&&(r.orientation=(0,n.convertToDefinitionProperty)(e,t.textOrientation,f.format({toolName:o}))),
void 0!==t.backgroundVisible&&(r.backgroundVisible=(0,n.convertToDefinitionProperty)(e,t.backgroundVisible,b.format({toolName:o}))),void 0!==t.backgroundColor){let i=null;void 0!==t.backgroundTransparency&&(i=t.backgroundTransparency),r.backgroundColor=(0,n.getColorDefinitionProperty)(e,t.backgroundColor,i,m.format({toolName:o}))}return void 0===t.backgroundVisible&&void 0===t.backgroundColor||(w.backgroundTitle=i.customTitles&&i.customTitles.backgroundTitle||x),void 0!==t.borderVisible&&(r.borderVisible=(0,n.convertToDefinitionProperty)(e,t.borderVisible,T.format({toolName:o}))),void 0!==t.borderWidth&&(r.borderWidth=(0,n.convertToDefinitionProperty)(e,t.borderWidth,y.format({toolName:o}))),void 0!==t.borderColor&&(r.borderColor=(0,n.getColorDefinitionProperty)(e,t.borderColor,null,_.format({toolName:o}))),void 0===t.borderVisible&&void 0===t.borderColor&&void 0===t.borderWidth||(w.borderTitle=i.customTitles&&i.customTitles.borderTitle||C),void 0!==t.wrap&&(r.wrap=(0,n.convertToDefinitionProperty)(e,t.wrap,v.format({toolName:o})),w.wrapTitle=i.customTitles&&i.customTitles.wrapTitle||P),(0,n.createTextPropertyDefinition)(r,w)}},14472:(e,t,o)=>{"use strict";o.r(t),o.d(t,{LineDataSourceDefinitionsViewModel:()=>_,LineDataSourceTabTypes:()=>i,pointPriceBarTitle:()=>y});var i,r=o(50151),n=o(11542),s=o(95804),l=(o(40167),o(95338)),a=o(60567),d=o(22613),c=o(73863),h=o(97578),u=o(81634),p=o(36313);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(i||(i={}));const g=n.t(null,void 0,o(40091)),f=n.t(null,void 0,o(78930)),b=n.t(null,void 0,o(92516)),m=n.t(null,void 0,o(70320)),T=n.t(null,void 0,o(21429)),y=n.t(null,{context:"linetool point"},o(80166));class _{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 o=this._createTextPropertyPage();null!==o&&this._propertyPages.push(o);const i=this._createCoordinatesPropertyPage();null!==i&&(i.visible=this._source.hasEditableCoordinates(),this._propertyPages.push(i));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",g)}_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",f)):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,o=[],i=this._getYCoordinateStepWV();return e.forEach(((e,r)=>{const n=t[r].childs();n&&o.push((0,h.getCoordinatesPropertiesDefinitions)(this._propertyApplier,n,e,i,y.format({count:(r+1).toString()}),this._source.name()))})),{definitions:o}}_createStylePropertyPage(){const e=this._stylePropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"style",b):null}_stylePropertyDefinitions(){return null}_createTextPropertyPage(){const e=this._textPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"text",m):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",T):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)}}}},31558:(e,t,o)=>{"use strict";o.d(t,{commonLineToolPropertiesStateKeys:()=>i})
;const i=["symbolStateVersion","zOrderVersion","frozen","title","interval","symbol","currencyId","unitId","visible","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,n,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"}(n||(n={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(s||(s={}))},88636:(e,t,o)=>{"use strict";o.d(t,{LineDataSourceProperty:()=>l});var i=o(90054),r=o(16738),n=o(50151),s=o(78176);class l extends s.DefaultProperty{constructor({templateKeys:e,...t}){super({ignoreAllowSavingDefaults:!0,saveNonDefaultUserPreferencesOnly:!0,...t}),this._templateKeys=(0,n.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,s.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,r.default)((0,i.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},77977:(e,t,o)=>{"use strict";o.r(t),o.d(t,{LineToolNote:()=>se,LineToolNoteAbsolute:()=>le});var i=o(3156),r=o(11542),n=o(95804),s=o(91445),l=o(14472),a=o(95338),d=o(91682);const c=new n.TranslatedString("change {title} background color",r.t(null,void 0,o(49765))),h=r.t(null,void 0,o(74872));class u extends l.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){const e=this._source.properties().childs(),t=this._source.name(),o=new n.TranslatedString(t,this._source.translatedType());return{definitions:[(0,a.createColorPropertyDefinition)({color:(0,a.getColorDefinitionProperty)(this._propertyApplier,e.markerColor,null,c.format({title:o}))},{id:(0,d.removeSpaces)(`${t}LabelColor`),title:h})]}}_textPropertyDefinitions(){const e=this._source.properties().childs();return{definitions:[(0,s.createTextStyleDefinition)(this._propertyApplier,{textColor:e.textColor,fontSize:e.fontSize,bold:e.bold,italic:e.italic,text:e.text,backgroundVisible:e.drawBackground,backgroundColor:e.backgroundColor,backgroundTransparency:e.backgroundTransparency,borderVisible:e.drawBorder,borderColor:e.borderColor},new n.TranslatedString(this._source.name(),this._source.translatedType()),{isEditable:!0,isMultiLine:!0})]}}}var p,g,f=o(50151),b=o(58978),m=o(52859),T=o(49251),y=o(94602),_=o(45801),v=o(2383),x=o(84617),C=o(4753),P=o(57658),S=o(73914),w=o(2268),D=o(10555),V=o(6453),k=o(24640),N=o(33350),A=o(33065),M=o(87347),L=o(73041),B=o(12038)
;function I(e){const{ctx:t,renderingInfo:o,left:i,top:r,width:n,height:s,point:l,caretPos:a,mode:d}=e,{horizontalPixelRatio:c,verticalPixelRatio:h}=o,u=Math.max(1,Math.floor(c))%2/2,p=Math.round(l.x*c)+u,g=0===d?Math.max(1,1*Math.floor(c)):0,f=Math.round(i*c)+g/2,b=Math.round(r*h)+g/2,m=Math.round(s*h)-g,T=Math.round(n*c)-g,y=Math.round(12*c),_=Math.round(10*h),v=p-y/2,x=p+y/2,C=Math.atan(10/6),P=4*Math.cos(C),S=4*Math.sin(C),w=4*c;if(t.beginPath(),t.moveTo(f,b+w),t.arcTo(f,b,f+w,b,w),"top"===a){const e=b,o=b-_;t.lineTo(v-w,e),t.arcTo(v,e,v+P,e-S,w),t.lineTo(p-1.2*P,o+1.2*S),t.arcTo(p,o,p+1.2*P,o+1.2*S,1.2*P),t.lineTo(x-P,e-S),t.arcTo(x,e,x+w,e,w)}if(t.lineTo(f+T-w,b),t.arcTo(f+T,b,f+T,b+w,w),t.lineTo(f+T,b+m-w),t.arcTo(f+T,b+m,f+T-w,b+m,w),"bottom"===a){const e=b+m,o=e+_;t.lineTo(x+w,e),t.arcTo(x,e,x-P,e+S,w),t.lineTo(p+1.2*P,o-1.2*S),t.arcTo(p,o,p-1.2*P,o-1.2*S,1.2*P),t.lineTo(v+P,e+S),t.arcTo(v,e,v-w,e,w)}t.lineTo(f+w,b+m),t.arcTo(f,b+m,f,b+m-w,w),t.closePath()}!function(e){e[e.MinTooltipWidth=20]="MinTooltipWidth",e[e.TooltipMinWidth=236]="TooltipMinWidth",e[e.TooltipVertMargin=13]="TooltipVertMargin",e[e.TooltipHorzPadding=12]="TooltipHorzPadding",e[e.TooltipVertPadding=12]="TooltipVertPadding",e[e.TooltipLineSpacing=5]="TooltipLineSpacing",e[e.TooltipBorderLineWidth=1]="TooltipBorderLineWidth",e[e.TooltipBorderRadius=4]="TooltipBorderRadius",e[e.TooltipApexBorderRadiusCoeff=1.2]="TooltipApexBorderRadiusCoeff",e[e.CorrectPositionYDistance=10]="CorrectPositionYDistance",e[e.CorrectPositionXDistance=10]="CorrectPositionXDistance",e[e.CaretWidth=12]="CaretWidth",e[e.CaretHeight=10]="CaretHeight",e[e.NoCaretEdgeXDistance=24]="NoCaretEdgeXDistance",e[e.ShadowBlur=4]="ShadowBlur",e[e.ShadowOffsetX=0]="ShadowOffsetX",e[e.ShadowOffsetY=2]="ShadowOffsetY",e[e.SpaceBetweenMarkerAndTooltipTolerance=8]="SpaceBetweenMarkerAndTooltipTolerance"}(p||(p={})),function(e){e[e.Stroke=0]="Stroke",e[e.Fill=1]="Fill"}(g||(g={}));const W=(0,M.svgRenderer)(B);class R{constructor(e){this._data=null,this._tooltipHitTest=new v.HitTestResult(v.HitTarget.MovePoint,{...e,areaName:v.AreaName.Text})}setData(e){this._data=e}setCursorType(e){this._tooltipHitTest.mergeData({cursorType:e})}draw(e,t){if(null===this._data)return;const{horizontalPixelRatio:o,verticalPixelRatio:i}=t,r=Math.max(1,Math.floor(o))%2/2,n=Math.max(1,Math.floor(i))%2/2,{point:s,markerColor:l}=this._data,a=Math.round(s.x*o)+r,d=Math.round(s.y*i)+n,c=W.viewBox();e.fillStyle=l,W.render(e,{targetViewBox:{x:a-o*c.width/2,y:d-o*c.height,width:o*c.width,height:o*c.height},doNotApplyColors:!0}),this._data.tooltipVisible&&this._drawTooltipOn(e,t)}hitTest(e,t){if(null!==this._data){const{point:t,left:o,top:i,width:r,height:n,tooltipVisible:s}=this._data,l=t.x,a=t.y,d=W.viewBox(),c=(0,D.box)((0,D.point)(l-d.width/2,a-d.height),(0,D.point)(l+d.width/2,a));if((0,V.pointInBox)(e,c))return new v.HitTestResult(v.HitTarget.MovePoint);if(s){const t=(0,D.box)((0,D.point)(o,i),(0,D.point)(o+r,i+n));if((0,V.pointInBox)(e,t))return this._tooltipHitTest
;const s=t.min.y<c.min.y?t.max.y:c.max.y,l=t.min.y<c.min.y?c.min.y:t.min.y,a=(0,D.box)((0,D.point)(c.min.x-8,s),(0,D.point)(c.max.x+8,l));if((0,V.pointInBox)(e,a))return new v.HitTestResult(v.HitTarget.MovePoint)}}return null}getTextInfo(){const{font:e,fontSize:t,width:o,left:i,top:r,height:n,lineSpacing:s}=(0,f.ensureNotNull)(this._data);return{font:e,fontSize:t,lineHeight:t,lineSpacing:s,textTop:r+12,textBottom:r+n-12,textLeft:i+12,textRight:i+o-12,textAlign:(0,k.isRtl)()?"right":"left"}}positionToCoordinate(e,t){const o=(0,f.ensureNotNull)(this._data),i=this.getTextInfo(),{x:r,y:n,lineNumber:s}=(0,L.getSymbolCoordinatesInfo)({symbolPosition:t,textWidth:i.textRight-i.textLeft,textByLines:o.linesIncludingHidden,lineHeight:o.fontSize,lineSpacing:o.lineSpacing,font:o.font,textAlign:i.textAlign});return{x:r+i.textLeft,y:n+i.textTop,lineNumber:s}}_drawTooltipOn(e,t){e.save();const o=(0,f.ensureNotNull)(this._data),{point:i,textColor:r,font:n,fontSize:s,backgroundColor:l,borderColor:a,boxShadowColor:d,width:c,textWidth:h,left:u,top:p,height:g,lineSpacing:b,caretPos:m,lines:T,selectionHighlight:y}=o;e.font=n;const{horizontalPixelRatio:_,verticalPixelRatio:v}=t;if(l){e.fillStyle=l;let o=!1;d&&(e.save(),e.shadowColor=d,e.shadowBlur=4,e.shadowOffsetX=0,e.shadowOffsetY=2,o=!0),I({ctx:e,renderingInfo:t,left:u,top:p,width:c,height:g,point:i,caretPos:m,mode:1}),e.fill(),o&&e.restore()}a&&(e.lineWidth=Math.max(1,1*Math.floor(_)),e.strokeStyle=a,I({ctx:e,renderingInfo:t,left:u,top:p,width:c,height:g,point:i,caretPos:m,mode:0}),e.stroke()),e.textBaseline="middle",e.fillStyle=r,e.textAlign=(0,k.isRtl)()?"right":"left";const x=u+12+(0,N.calcTextHorizontalShift)(e,h);let C=p+12+s/2;(0,N.drawScaled)(e,_,v,(()=>{if(y){const t=this.positionToCoordinate(!1,y.start),i=this.positionToCoordinate(!1,y.end),r=this.getTextInfo();(0,L.drawSelection)(e,A.dpr1PixelRatioInfo,{lines:o.linesIncludingHidden,selectionStart:t,selectionEnd:i,left:r.textLeft,right:r.textRight,color:y.color,font:n,lineHeight:s,lineSpacing:b})}for(const t of T)e.fillText(t,x,C),C+=s+b})),e.restore()}}const z=(0,m.generateColor)((0,b.getHexColorByName)("color-black"),80),H=(0,m.generateColor)((0,b.getHexColorByName)("color-black"),60);class F extends w.InplaceTextLineSourcePaneView{constructor(e,t,o,i){super(e,t,o,i),this._renderer=null,this._textWidthCache=new P.TextWidthCache,this._noteRenderer=new R((0,w.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._noteRenderer.getTextInfo()})),this._noteRenderer.positionToCoordinate.bind(this._noteRenderer,!0))}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._getSource();if(!this._points||this._source.isFixed()&&void 0===t.fixedPoint())return;const o=this._source.isFixed()?[(0,f.ensureDefined)(t.fixedPoint())]:this._points;if(o.length<1)return
;const i=new y.CompositeRenderer,r=this.isLabelVisible(),n=this._source.properties().childs(),s=(0,T.makeFont)(n.fontSize.value(),x.CHART_FONT_FAMILY,n.italic.value()?"italic":void 0,n.bold.value()?"bold":void 0);let l,a;n.drawBackground.value()&&(l=(0,m.generateColor)(n.backgroundColor.value(),n.backgroundTransparency.value()),a=this._model.dark().value()?H:z);const d=Math.min(236,e.mediaSize.width),c=d-24,h=o[0],{mediaSize:u}=e,p=(0,C.wordWrap)(this._textData(),s,this._textWidthCache,!1,c),g=p.filter((e=>!e.hidden)).map((e=>e.text)),b=n.fontSize.value();let P=g.length*b+24;g.length>1&&(P+=5*(g.length-1));let w=Math.round(h.x-d/2);const D=W.viewBox();let V=Math.round(h.y-D.height-P-13);const k=h.x<24||h.x+24>u.width;let N=k?null:"top";V<10?V=h.y+13:k||(N="bottom"),w<10?w=10:w+d+10>u.width&&(w=u.width-d-10),this._noteRenderer.setData({linesIncludingHidden:p,lines:g,font:s,fontSize:b,backgroundColor:l,boxShadowColor:a,borderColor:n.drawBorder.value()?n.borderColor.value():void 0,textColor:this._textColor(),markerColor:n.markerColor.value(),point:h,tooltipVisible:r,width:d,height:P,left:w,top:V,caretPos:N,lineSpacing:5,textWidth:c,...this._inplaceTextHighlight()}),this._noteRenderer.setCursorType(this._textCursorType()),this._updateInplaceText(this._noteRenderer.getTextInfo()),i.append(this._noteRenderer),i.append(new _.SelectionRenderer({points:o.map(S.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(o),visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:v.HitTarget.MovePoint})),this._renderer=i}}var O=o(18712),E=o(70548),K=o(48943),Y=o(63117),X=o(24633),$=o(43337),G=o(78176),Z=o(70031),U=o(31558),j=o(88636);const q={intervalsVisibilities:{...o(37293).intervalsVisibilitiesDefaults},fontSize:14,bold:!1,italic:!1,drawBackground:!0,drawBorder:!1},J=new Map([[X.StdTheme.Light,{textColor:b.colorsPalette["color-cold-gray-900"],backgroundColor:b.colorsPalette["color-white"],backgroundTransparency:0,borderColor:b.colorsPalette["color-cold-gray-150"],markerColor:b.colorsPalette["color-tv-blue-500"]}],[X.StdTheme.Dark,{textColor:b.colorsPalette["color-cold-gray-200"],backgroundColor:b.colorsPalette["color-cold-gray-800"],backgroundTransparency:0,borderColor:b.colorsPalette["color-cold-gray-700"],markerColor:b.colorsPalette["color-tv-blue-500"]}]]),Q=(0,G.extractThemedColors)((0,f.ensureDefined)(J.get(X.StdTheme.Light)),(0,f.ensureDefined)(J.get(X.StdTheme.Dark))),ee=(0,G.extractAllPropertiesKeys)((0,f.ensureDefined)(J.get(X.StdTheme.Light))),te=(0,G.extractAllPropertiesKeys)(q),oe=[...new Set([...ee,...te,...U.commonLineToolPropertiesStateKeys,"text","anchored"])],ie=[...new Set([...ee,...te,"text"])];class re extends j.LineDataSourceProperty{constructor(e,t){super(t),this.hasChild("text")||this.addProperty("text",""),t.state?.anchored||this.addChild("anchored",new $.Property(e))}static create(e,t,o,i){return new this(t,{defaultName:e,factoryDefaultsSupplier:()=>(0,Z.factoryDefaultsForCurrentTheme)(q,J),nonThemedDefaultsKeys:te,themedDefaultsKeys:ee,
allStateKeys:oe,themedColors:Q,templateKeys:ie,replaceThemedColorsOnThemeChange:!0,state:i,theme:o})}}var ne;!function(e){e[e.Version=1]="Version"}(ne||(ne={}));class se extends Y.InplaceTextLineDataSource{constructor(e,t,o,i){const r=t??se.createProperties(e.backgroundTheme().spawnOwnership());super(e,r,o,i),this.version=1,this._setPaneViews([new F(this,this._model,this._openTextEditor.bind(this),this._closeTextEditor.bind(this))]),r.childs().anchored.subscribe(this,this._onAnchoredChange.bind(this)),this._hasEditableCoordinates=(0,K.combine)((e=>!e),(0,E.createWVFromProperty)(this.properties().childs().anchored).ownership())}destroy(){this._hasEditableCoordinates.destroy(),super.destroy()}pointsCount(){return 1}name(){return"Pin"}isFixed(){return this._properties.childs().anchored.value()}anchorable(){return!0}template(){return this._properties.template()}activateEditingOnCreation(){return!0}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.textColor}}static createProperties(e,t){null!=t&&void 0!==t.markerColor&&void 0===t.borderColor&&(t.borderColor=t.markerColor);const o=re.create(this._defaultsKey(),this._anchoredDefaultValue(),e,t);return this._configureProperties(o),o}_normalizePoint(e,t){return super._normalizePointWithoutOffset(e)??super._normalizePoint(e,t)}async _getPropertyDefinitionsViewModelClass(){return u}_createDataSourceBackgroundColorWV(){const e=(0,i.generateColorCached)(),{backgroundColor:t,backgroundTransparency:o}=this.properties().childs();return(0,K.combine)(((t,o)=>e(t,o)),(0,O.convertPropertyToWatchedValue)(t).ownership(),(0,O.convertPropertyToWatchedValue)(o).ownership()).ownership()}static _defaultsKey(){return"linetoolnote"}static _anchoredDefaultValue(){return!1}}class le extends se{constructor(e,t,o,i){super(e,t??le.createProperties(e.backgroundTheme().spawnOwnership()),o,i)}name(){return"Anchored Note"}static _defaultsKey(){return"linetoolnoteabsolute"}static _anchoredDefaultValue(){return!0}}},70031:(e,t,o)=>{"use strict";o.d(t,{factoryDefaultsForCurrentTheme:()=>a});var i=o(16738),r=o(90054),n=o(50151),s=o(45345),l=o(24633);function a(e,t){const o=s.watchedTheme.value()??l.StdTheme.Light,a=(0,r.default)(e);return(0,i.default)(a,(0,n.ensureDefined)(t.get(o))),a}},3156:(e,t,o)=>{"use strict";o.d(t,{generateColorCached:()=>s});var i=o(59332),r=o(52859),n=o(16659);function s(e=1e3){const t=i.default.Cache;i.default.Cache=n.CircularCacheBuffer.bind(n.CircularCacheBuffer,e);const o=(0,i.default)(r.generateColor,((e,t,o)=>`${e}_${t}_${o}`));return i.default.Cache=t,o}},12038:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 30" width="24" height="30"><path fill="#2962FF" fill-rule="evenodd" d="m12 30 .88-.77C20.25 22.73 24 17.07 24 12.09 24 5.04 18.54 0 12 0S0 5.04 0 12.1c0 4.97 3.75 10.64 11.12 17.13L12 30Zm0-13a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z"/></svg>'}}]);