"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6748],{17333:(e,t,r)=>{r.r(t),r.d(t,{LineToolCircle:()=>a});var o=r(12988),i=r(32679),s=r(88960),l=r(42752),n=r(73305),d=r(10568);class a extends d.InplaceTextLineDataSource{constructor(e,t,o,i){super(e,t??a.createProperties(e.backgroundTheme().spawnOwnership()),o,i),Promise.all([r.e(2870),r.e(2211),r.e(1583)]).then(r.bind(r,50398)).then((({CirclePaneView:t})=>{const r=[new t(this,e,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),this.onSelectionChange.bind(this))];this._setPaneViews(r)}))}pointsCount(){return 2}name(){return"Circle"}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}snapTo45DegreesAvailable(){return!0}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.textColor,textVisible:e.showLabel}}static createProperties(e,t){const r=new i.DefaultProperty({defaultName:"linetoolcircle",state:t,theme:e});return this._configureProperties(r),r}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([r.e(3401),r.e(3889),r.e(8009),r.e(6204),r.e(1963),r.e(8537)]).then(r.bind(r,99458))).EllipseCircleDefinitionsViewModel}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_createDataSourceBackgroundColorWV(){const{fillBackground:e,backgroundColor:t}=this.properties().childs();return(0,s.combine)((()=>e.value()?t.value():null),(0,l.convertPropertyToWatchedValue)(e).ownership(),(0,l.convertPropertyToWatchedValue)(t).ownership()).ownership()}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.Property("")),e.addChild("linesColors",new n.LineToolColorsProperty([e.childs().color])),e.addChild("linesWidths",new n.LineToolWidthsProperty([e.childs().linewidth])),e.addChild("backgroundsColors",new n.LineToolColorsProperty([e.childs().backgroundColor])),e.addChild("textsColors",new n.LineToolColorsProperty([e.childs().textColor],e.childs().showLabel)),e.addExcludedKey("linesColors",3),e.addExcludedKey("linesWidths",3),e.addExcludedKey("backgroundsColors",3),e.addExcludedKey("textsColors",3),e.addExcludedKey("text",1)}}}}]);