"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[8823],{67725:(e,t,i)=>{i.d(t,{createLineStyleDefinition:()=>P});var r=i(11542),n=i(95804),o=i(95338),s=i(91682);const l=new n.TranslatedString("change {toolName} line visibility",r.t(null,void 0,i(24550))),a=new n.TranslatedString("change {toolName} line width",r.t(null,void 0,i(19541))),p=new n.TranslatedString("change {toolName} line style",r.t(null,void 0,i(66429))),c=new n.TranslatedString("change {toolName} line color",r.t(null,void 0,i(24059))),u=new n.TranslatedString("change {toolName} line extending left",r.t(null,void 0,i(18773))),h=new n.TranslatedString("change {toolName} line left end",r.t(null,void 0,i(21474))),d=new n.TranslatedString("change {toolName} line extending right",r.t(null,void 0,i(43823))),y=new n.TranslatedString("change {toolName} line right end",r.t(null,void 0,i(54827))),_=r.t(null,void 0,i(3554)),f=r.t(null,void 0,i(61856)),g=r.t(null,void 0,i(87430));function P(e,t,i,r,n){const P={},v={id:`${(0,s.removeSpaces)(i.originalText())}${r}`,title:n&&n.line||_};return void 0!==t.showLine&&(P.checked=(0,o.convertToDefinitionProperty)(e,t.showLine,l.format({toolName:i}))),void 0!==t.lineWidth&&(P.width=(0,o.convertToDefinitionProperty)(e,t.lineWidth,a.format({toolName:i}))),void 0!==t.lineStyle&&(P.style=(0,o.convertToDefinitionProperty)(e,t.lineStyle,p.format({toolName:i}))),void 0!==t.lineColor&&(P.color=(0,o.getColorDefinitionProperty)(e,t.lineColor,null,c.format({toolName:i}))),void 0!==t.extendLeft&&(P.extendLeft=(0,o.convertToDefinitionProperty)(e,t.extendLeft,u.format({toolName:i})),v.extendLeftTitle=n&&n.extendLeftTitle||f),void 0!==t.leftEnd&&(P.leftEnd=(0,o.convertToDefinitionProperty)(e,t.leftEnd,h.format({toolName:i}))),void 0!==t.extendRight&&(P.extendRight=(0,o.convertToDefinitionProperty)(e,t.extendRight,d.format({toolName:i})),v.extendRightTitle=n&&n.extendRightTitle||g),void 0!==t.rightEnd&&(P.rightEnd=(0,o.convertToDefinitionProperty)(e,t.rightEnd,y.format({toolName:i}))),(0,o.createLinePropertyDefinition)(P,v)}},14472:(e,t,i)=>{i.r(t),i.d(t,{LineDataSourceDefinitionsViewModel:()=>b,LineDataSourceTabTypes:()=>r,pointPriceBarTitle:()=>v});var r,n=i(50151),o=i(11542),s=i(95804),l=(i(40167),i(95338)),a=i(60567),p=i(22613),c=i(73863),u=i(97578),h=i(81634),d=i(36313);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(r||(r={}));const y=o.t(null,void 0,i(40091)),_=o.t(null,void 0,i(78930)),f=o.t(null,void 0,i(92516)),g=o.t(null,void 0,i(70320)),P=o.t(null,void 0,i(21429)),v=o.t(null,{context:"linetool point"},i(80166));class b{constructor(e,t){this._yCoordinateStepWV=null,this._propertyPages=[],this._source=t,this._undoModel=e,this._ownerSource=(0,n.ensureNotNull)(this._source.ownerSource()),this._propertyApplier=new h.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 r=this._createCoordinatesPropertyPage();null!==r&&(r.visible=this._source.hasEditableCoordinates(),this._propertyPages.push(r));const n=this._createVisibilitiesPropertyPage();this._propertyPages.push(n)}_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(d.TitleDisplayTarget.StatusLine,!0))),"visibility",y)}_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",_)):null}_getYCoordinateStepWV(){return null===this._yCoordinateStepWV&&(this._yCoordinateStepWV=new p.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,n.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=[],r=this._getYCoordinateStepWV();return e.forEach(((e,n)=>{const o=t[n].childs();o&&i.push((0,u.getCoordinatesPropertiesDefinitions)(this._propertyApplier,o,e,r,v.format({count:(n+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",g):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",P):null}_inputsPropertyDefinitions(){return null}_updateYCoordinateStep(){const e=this._ownerSource.priceStep();this._getYCoordinateStepWV().setValue(e||1)}_updateCoordinatesPropertyDefinitons(){const e=this._coordinatesPropertyDefinitions();if(null!==e){(0,
n.ensureDefined)(this._propertyPages.find((e=>"coordinates"===e.id))).definitions.setValue(e.definitions),this._source.points().length===this._source.pointsCount()&&this._source.pointAdded().unsubscribeAll(this)}}}},87997:(e,t,i)=>{i.d(t,{PitchBaseDefinitionsViewModel:()=>T});var r=i(50151),n=i(11542),o=i(95804),s=i(67725),l=i(14472),a=i(95338),p=i(91682),c=i(44005);const u=new o.TranslatedString("change {title} extend lines",n.t(null,void 0,i(76295))),h=new o.TranslatedString("change {title} level {index} line visibility",n.t(null,void 0,i(51403))),d=new o.TranslatedString("change {title} level {index} line color",n.t(null,void 0,i(664))),y=new o.TranslatedString("change {title} level {index} line width",n.t(null,void 0,i(97870))),_=new o.TranslatedString("change {title} level {index} line style",n.t(null,void 0,i(64707))),f=new o.TranslatedString("change {title} level {index} line coeff",n.t(null,void 0,i(27154))),g=new o.TranslatedString("change {title} all lines color",n.t(null,void 0,i(59577))),P=new o.TranslatedString("change {title} background visibility",n.t(null,void 0,i(30839))),v=new o.TranslatedString("change {title} background transparency",n.t(null,void 0,i(13783))),b=n.t(null,{context:"study"},i(29291)),S=n.t(null,void 0,i(28683)),m=n.t(null,void 0,i(79468)),D=n.t(null,void 0,i(819));class T extends l.LineDataSourceDefinitionsViewModel{_stylePropertyDefinitions(){const e=[],t=this._source.properties(),i=t.childs(),n=this._source.name(),l=(0,p.removeSpaces)(n),T=new o.TranslatedString(n,this._source.translatedType());t.hasChild("extendLines")&&e.push((0,a.createCheckablePropertyDefinition)({checked:(0,a.convertToDefinitionProperty)(this._propertyApplier,i.extendLines,u.format({title:T}))},{id:`${l}ExtendLines`,title:D}));const w=i.median.childs(),x=(0,s.createLineStyleDefinition)(this._propertyApplier,{lineColor:w.color,lineStyle:w.linestyle,lineWidth:w.linewidth},T,"Median",{line:b});e.push(x);const C=this._source.levelsCount();for(let t=0;t<=C;t++){const r=i[`level${t}`].childs(),n=(0,a.createLeveledLinePropertyDefinition)({checked:(0,a.convertToDefinitionProperty)(this._propertyApplier,r.visible,h.format({title:T,index:t+1})),color:(0,a.getColorDefinitionProperty)(this._propertyApplier,r.color,null,d.format({title:T,index:t+1})),width:(0,a.convertToDefinitionProperty)(this._propertyApplier,r.linewidth,y.format({title:T,index:t+1})),style:(0,a.convertToDefinitionProperty)(this._propertyApplier,r.linestyle,_.format({title:T,index:t+1})),level:(0,a.convertToDefinitionProperty)(this._propertyApplier,r.coeff,f.format({title:T,index:t+1}))},{id:`${l}LineLevel${t+1}`});e.push(n)}const A=(0,a.createColorPropertyDefinition)({color:(0,a.getColorDefinitionProperty)(this._propertyApplier,new c.CollectibleColorPropertyUndoWrapper((0,r.ensureNotNull)(this._source.lineColorsProperty()),this._propertyApplier,null),null,g.format({title:T}),!0)},{id:`${l}AllLineColor`,title:S});e.push(A);const V=(0,a.createTransparencyPropertyDefinition)({checked:(0,
a.convertToDefinitionProperty)(this._propertyApplier,i.fillBackground,P.format({title:T})),transparency:(0,a.convertToDefinitionProperty)(this._propertyApplier,i.transparency,v.format({title:T}))},{id:`${l}Background`,title:m});return e.push(V),{definitions:e}}}},40226:(e,t,i)=>{i.d(t,{LevelsProperty:()=>_});var r=i(90054),n=i(16738),o=i(87465),s=i(78176),l=i(60973);const a={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:()=>Object(),unpack:()=>[]}};function p(e,t,i,r){return r.push(i[t]),r}function c(e,t,i,r){return r[t]=i[e],r}function u(){return[]}function h(){return{}}function d(e,t,i){return i.prefixes.forEach((r=>{const n=r+"level";for(let r=i.range[0];r<=i.range[1];r++)if(e[n+r]&&(0,o.isSameType)(e[n+r],t.typecheck())){let o=t.tpl();i.names.forEach(((i,s)=>{o=t.fill(""+s,i,e[n+r],o)})),e[n+r]=o}})),e}function y(e,t,i){return i(e,{tpl:h,fill:c,typecheck:t.typecheck.unpack},t)}class _ extends s.DefaultProperty{constructor(e){const{levelsIterator:t=d,map:i={},...r}=e,n={...a,...i};r.state&&(r.state=y(r.state,n,t)),super(r),this._map=n,this._levelsIterator=t}state(e,t,i){const r=super.state(e,t);return i?r:(n=r,o=this._map,(0,this._levelsIterator)(n,{tpl:u,fill:p,typecheck:o.typecheck.pack},o));var n,o}preferences(){return(0,s.extractState)(this.state(this._excludedDefaultsKeys,void 0,!0),this._allDefaultsKeys)}applyTemplate(e,t){this.mergeAndFire((0,s.extractState)((0,n.default)((0,r.default)(t),y(e,this._map,this._levelsIterator)),this._allStateKeys,this._excludedTemplateKeys))}saveDefaults(){this._useUserPreferences&&(0,l.saveDefaults)(this._defaultName,this.preferences())}clone(){return new _(this._options())}merge(e,t){return super.merge(this._map?y(e,this._map,this._levelsIterator):e,t)}_options(){return{...super._options(),map:{...this._map},levelsIterator:this._levelsIterator}}}},44005:(e,t,i)=>{i.d(t,{CollectibleColorPropertyDirectWrapper:()=>l,CollectibleColorPropertyUndoWrapper:()=>s});var r=i(50151),n=i(43337);class o extends n.Property{constructor(e){super(),this._listenersMappers=[],this._isProcess=!1,this._baseProperty=e}destroy(){this._baseProperty.destroy(),super.destroy()}value(){const e=this._baseProperty.value();return"mixed"===e?"":e}visible(){return this._baseProperty.visible()}setValue(e){this._isProcess=!0,this._baseProperty.setValue(""===e?"mixed":e,void 0,{applyValue:this._applyValue.bind(this)}),this._isProcess=!1,this._listenersMappers.forEach((e=>{e.method.call(e.obj,this,"")}))}subscribe(e,t){const i=i=>{this._isProcess||t.call(e,this,"")},r={obj:e,method:t,callback:i};this._listenersMappers.push(r),this._baseProperty.subscribe(e,i)}unsubscribe(e,t){const i=(0,r.ensureDefined)(this._listenersMappers.find((i=>i.obj===e&&i.method===t))?.callback);this._baseProperty.unsubscribe(e,i)}unsubscribeAll(e){this._baseProperty.unsubscribeAll(e)}}class s extends o{constructor(e,t,i){super(e),this._propertyApplier=t,this._undoText=i}_applyValue(e,t){this._propertyApplier.setProperty(e,t,this._undoText)}}class l extends o{_applyValue(e,t){
e.setValue(t)}}}}]);