").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}(t,"tv-linetool-properties-toolbar__icon--line-props")}var l,d,c,p,u,h,g,_,v,f,b,y,w,m,C,x=o("DxCR"),W=x.PropertyPage,L=x.ColorBinding,T=o("mMWL"),P=o("bR4N").bindPopupMenu,S=o("Ocx9").DefaultProperty,E=o("my99").GroupButtonFloatingToolbar,k=o("a7Ha").LineEnd,B=o("VNzU").isMultipleLayout,z=o("yMne"),V=o("CW80"),A=V.createLineToolProperties,F=V.isLineTool,M=o("PC8g").trackEvent;o("m/4m"),o("nSyy"),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSources=function(){return this._chartWidgetCollection.selectedSources.value()},n.prototype._init=function(){this._floatingToolbar=new E({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:z.HEADER_TOOLBAR_HEIGHT_EXPANDED+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSources||e.isVisibleForSources(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){T.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSources.subscribe(this.onSourceChanged.bind(this)),this._chartWidgetCollection.layout.subscribe(this._updateCloneButtonTitle.bind(this))},n.prototype._updateCloneButtonTitle=function(){this._setButtonTitle(this._cloneButton,this._cloneButtonTitle())},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){e=e instanceof S?e:A(t);this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),
this._updateVisibility()}else this.selectedSources()?this.onSourceChanged(this.selectedSources()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,o,i;for(e=0;e
0}},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t,e=this.activeChartWidget().model(),o=this.selectedSources(),i=[],n=o.filter(function(t){return t.cloneable()});return n.length>0&&i.push({name:"clone",title:window.t("Clone"),action:function(){e.cloneLineTools(n)}}),(t=o.filter(function(t){return t.copiable()})).length>0&&i.push({name:"copy",title:window.t("Copy"),shortcut:"Ctrl-C",action:function(){e.copySourcesToClip(t)}}),B(this._chartWidgetCollection.layout.value())?(o.filter(function(t){return!!t.linkKey}).length?i.push({name:"stop-sync",title:$.t("Stop syncing"),action:function(){e.unlinkLines(o)}}):i.push({name:"sync",title:$.t("Sync to all charts"),action:function(){e.copyToOtherCharts(o)}}),i):i},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSources(),o=this.activeChartWidget().model(),i={name:"bring-to-front",title:$.t("Bring to Front"),action:function(){o.bringToFront(e)}},n={name:"send-to-back",title:$.t("Send to Back"),action:function(){o.sendToBack(e)}},r={name:"bring-forward",title:$.t("Bring Forward"),action:function(){o.bringForward(e)}},s={name:"send-backward",title:$.t("Send Backward"),action:function(){o.sendBackward(e)}
},a=o.paneForSource(e[0]),l=a.getZOrderMinMax();return 1===e.length&&e[0].zorder()===l.minZOrder&&(n.disabled=!0,s.disabled=!0),1===e.length&&e[0].zorder()===l.maxZOrder&&(r.disabled=!0,i.disabled=!0),t.push(i,n,r,s),t},n.prototype._getPossibleProperty=function(t){var e,o,i=[],r=this._defaultToolProperties();for(e=0;e=0;--n)if(l=e[(a=o[n]).name],"function"!=typeof(d=a.showIf)||d(l,e)){if(!l)continue;if(this._propertiesVisible=!0,c=[],"combobox"!==a.inputType){p=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(p[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(p);continue}a.simple?a.comboboxOptions.forEach(r.bind(null,c)):a.comboboxOptions.forEach(s.bind(null,c)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),i[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:c,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=i}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){this._currentProperties&&(this._clearPropertiesOnHideTimeoutId&&(clearTimeout(this._clearPropertiesOnHideTimeoutId),this._clearPropertiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t[0]),t.remove()},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearPropertiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._clearPropertiesOnHideTimeoutId&&(clearTimeout(this._clearPropertiesOnHideTimeoutId),this._clearPropertiesOnHideTimeoutId=null),this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSources())},n.prototype._setupToggleLockButton=function(t){
t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},n.prototype.clearBindings=function(t){for(var e=this._bindings.length;e--;)this._bindings[e].destroy();this._bindings.length=0},n.prototype.colorPropertyControl=function(t,e,o){var i,r,s=W.prototype.createColorPicker({addClass:"tv-linetool-properties-toolbar__color-picker apply-common-tooltip",direction:this._bindPopupMenuDirection.bind(this)});return s.attr("title",e.title),i=s.find("input"),(r=$(e.iconSvgCode)).on("click",function(t){i.data("tvcolorpicker")||i.focus()}),$(document).on("click",function(t){i.data("tvcolorpicker")?i.addClass("i-active"):i.removeClass("i-active")}),i.after(r),this.bindControl(new L(s,t,!0,this.activeChartWidget().model(),null,n.getTransparency(e,o))),"string"==typeof e.addClass&&s.addClass(e.addClass),s},n.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},n.prototype.createLineEndPropertyProxy=function(t,e){return function(o,r){var s,a;return s=o[e]&&o[e].value()?n.LINE_EXTEND:o[t].value(),(a=new i(s)).subscribe(this,function(i){var n=i.value();n<2?(r.beginUndoMacro(""),o[t].setValue(n),o[e]&&o[e].setValue(!1),r.endUndoMacro()):(r.beginUndoMacro(""),o[t].setValue(k.Normal),o[e]&&o[e].setValue(!0),r.endUndoMacro())}),a}},n.LINE_EXTEND=42,l=a(o("wLZl")),d=a(o("XqDt")),c=a(o("znEV")),p=a(o("NDCK")),u=a(o("9On3")),h=a(o("Nz7V")),g=a(o("dhuF")),_=a(o("n2Ch")),v=a(o("eHtW")),f=a(o("BiGZ")),b=a(o("fUH/")),y=a(o("BsMi")),w=o("HKvk"),m=o("2JFs"),C=o("Kjbl"),n.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,title:$.t("Background Color"),transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:l},{value:1,iconSvgCode:u},{value:2,iconSvgCode:h}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:g},{value:k.Arrow,iconSvgCode:_},{value:n.LINE_EXTEND,iconSvgCode:v}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:f},{value:k.Arrow,iconSvgCode:b},{value:n.LINE_EXTEND,iconSvgCode:y}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},
n.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:m,transparency:!0,transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:m,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:w}]},n.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}]},n.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:"Width"}]},n.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:m,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:w},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:w},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:w},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:C},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:m,transparency:!0,showIf:function(t,e){return e.fillBackground.value()},title:$.t("Background Color")},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}],title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:g},{value:k.Arrow,iconSvgCode:_}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:k.Normal,iconSvgCode:f},{value:k.Arrow,iconSvgCode:b}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},
n.prototype._oneColorForAllLines=function(){return[{name:"collectibleColors",inputType:"colorPicker",iconSvgCode:w,title:$.t("One color for all lines")}]},n.prototype._trackContextAction=function(t){M("GUI","Context action on drawings",t)},n.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:n.prototype._oneColorForAllLines(),LineToolFibTimeZone:n.prototype._oneColorForAllLines(),LineToolBrush:n.prototype._brushPropertiesExceptionCases(),LineToolPolyline:n.prototype._brushPropertiesExceptionCases(),LineToolText:n.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:n.prototype._textPropertiesExceptionCases(),LineToolBalloon:n.prototype._textPropertiesExceptionCases(),LineToolCallout:n.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:n.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolElliottCircle:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolDateRange:n.prototype._rangeExceptionCases(),LineToolPriceRange:n.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:n.prototype._rangeExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:m}],LineToolNote:n.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:n.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:w}],LineToolRiskRewardLong:n.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:n.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:m}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:m,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:m,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:l},{value:2,iconSvgCode:d},{value:3,iconSvgCode:c},{value:4,iconSvgCode:p}]}],LineToolFibCircles:n.prototype._oneColorForAllLines(),LineToolFibChannel:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceArcs:n.prototype._oneColorForAllLines(),LineToolFibRetracement:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceFan:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibTime:n.prototype._oneColorForAllLines(),LineToolFibWedge:n.prototype._oneColorForAllLines(),LineToolGannComplex:n.prototype._oneColorForAllLines(),LineToolGannFixed:n.prototype._oneColorForAllLines(),LineToolGannFan:n.prototype._oneColorForAllLines(),LineToolPitchfan:n.prototype._oneColorForAllLines(),
LineToolPitchfork:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork2:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork:n.prototype._oneColorForAllLines(),LineToolInsidePitchfork:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibExtension:n.prototype._oneColorForAllLines()}},t.exports=n}).call(this,o("Kxc7"),o("tc+8"))},tzjn:function(t,e){t.exports=''},wLZl:function(t,e){t.exports=''},yB98:function(t,e){t.exports=''},znEV:function(t,e){t.exports=''}}]);