(function(t){function e(e){for(var o,r,a=e[0],c=e[1],l=e[2],d=0,h=[];d0?e("div",{class:"list-item-menu__icon list-item-menu__icon_".concat(t.theme)},[e("svgIcon",{attrs:{name:t.iconName}})],1):t._e(),e("div",{staticClass:"list-item-menu__text"},[t._t("default")],2)]),e("span",{staticClass:"list-item-menu__right"},[t.itemData?e("span",{staticClass:"list-item-menu__data"},[t._v(t._s(t.itemData))]):t._e(),t.right?e("span",{class:"list-item-menu__icon list-item-menu__icon_".concat(t.theme),on:{click:function(e){return e.stopPropagation(),t.clickIcon.apply(null,arguments)}}},[e("svgIcon",{attrs:{name:t.rightIcon}})],1):t._e()])])},at=[],ct={props:{iconName:{type:String,required:!1,default:""},last:{type:Boolean,required:!1,default:!1},right:{type:Boolean},isActive:{type:Boolean},theme:{type:String,default:"light"},itemData:{type:[String,Number]},rightIcon:{type:String,default:"Arrow-expand-right"},modifier:{type:[Array,String]}},computed:{mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"list-item-menu--"+t})).join(" "),o):""}},methods:{clickItem:function(t){this.$emit("click",t)},clickIcon:function(){this.$emit("clickIcon")}}},lt=ct,ut=(i("3c4c"),Object(C["a"])(lt,rt,at,!1,null,"92005994",null)),dt=ut.exports,ht=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"show",rawName:"v-show",value:this.isOpen,expression:"this.isOpen"}],staticClass:"dropdown-menu",class:[{"dropdown-menu--open":this.isOpen},t.mod],style:t.styleWidth,on:{click:t.onClick,mouseleave:t.onMouseLeave,mouseenter:t.onMouseEnter}},[t._t("header"),t._t("body"),e("ul",{staticClass:"dropdown-list"},[t._t("default")],2),t._t("footer")],2)},pt=[],gt={props:{isOpen:{type:Boolean,default:!1},width:{type:String,required:!1,default:"auto"},rigth:{type:String,required:!1},top:{type:String,required:!1},modifier:{type:String}},computed:{styleWidth:function(){return"width: ".concat(this.width,"px; ").concat(this.rigth?"margin-left:"+this.rigth+"px":"","; ").concat(this.top?"margin-top:"+this.top+"px":"")},mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"dropdown-menu--"+t})).join(" "),o):""}},methods:{onMouseLeave:function(){this.$emit("mouseleave")},onMouseEnter:function(){this.$emit("mouseenter")},onClick:function(){this.$emit("click")}}},ft=gt,mt=(i("266f"),Object(C["a"])(ft,ht,pt,!1,null,null,null)),vt=mt.exports,yt={components:{ButtonLabel:Z,ButtonNewIcon:st,DropdownMenu:vt,ListItemMenu:dt,ButtonVariableMode:G},props:{arr:{type:Array,default:function(){return[{iconName:"0",btnText:"0"}]}},selected:{default:0}},data:function(){return{isOpen:!1,activeIndex:1,activeRoute:""}},watch:{$route:function(t){this.setActiveRoute(t)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveModeButtons:"headerSettings/getActiveModeButtons"})),{},{getSelected:function(){return this.selected},getWidthItemTab:function(){return"text"===this.getActiveModeButtons?115:43},styleSize:function(){return{width:"".concat(this.getWidthItemTab,"px")}},getCurrentRouteUrl:function(){return this.activeRoute},getListItemsMenu:function(){var t=this;return this.arr.filter((function(e){return e.btnText!==t.selected}))}}),methods:{select:function(t){this.$emit("selectedScreen",t),this.isOpen=!1},setActiveRoute:function(t){var e;"/profile"!==t.path&&"/quotes"!==t.path||(null===(e=this.defaultAccount)||void 0===e?void 0:e.owner)===t.query.userId?this.activeRoute=t.path:this.activeRoute=""},toggleDropdown:function(){this.isOpen=!this.isOpen},clickOutside:function(t){this.$el.contains(t.target)&&27!==t.keyCode||(this.isOpen=!1)}},created:function(){var t=this;document.addEventListener("click",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("click",t.clickOutside)})),document.addEventListener("keydown",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("keydown",t.clickOutside)}))}},Ct=yt,bt=(i("9e0c"),Object(C["a"])(Ct,q,z,!1,null,null,null)),St=bt.exports,Pt=i("4344"),Tt=i.n(Pt),xt={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getColorIcon:function(){return"dark"===this.getActiveTheme?"#8FA8C1":"#8C8C8C"},getIconData:function(){var t=this;return function(e){return{name:e,color:t.getColorIcon}}}})},Ot={mixins:[xt],components:{DxTooltip:Pt["DxTooltip"]},data:function(){return{hintText:"",tooltipVisible:!1,selector:null}},computed:{positionTooltip:function(){return{my:"top right",at:"bottom right"}},positionTooltipLeftTop:function(){return{my:"bottom right",at:"top left"}},positionTooltipRigthBottom:function(){return{my:"top left",at:"bottom left"}},positionTopCenter:function(){return{my:"bottom center",at:"top center"}},positionBottomCenter:function(){return{my:"top center",at:"bottom center"}},positionLeftCenter:function(){return{my:"left center",at:"right center"}},animationConfig:function(){return{show:{type:"pop",from:{scale:.8,opacity:0},to:{scale:1,opacity:1}},hide:{type:"pop",from:{scale:1,opacity:1},to:{scale:.8,opacity:0}}}},wrapperAttr:function(){return{class:"vp_tooltipCustomStyle ".concat(this.darkClass.dark?"dark":"")}}},methods:{viewTooltip:function(t){this.selector=t.target,this.tooltipVisible=!0},hideTooltip:function(){this.tooltipVisible=!1,this.hintText="",this.selector=null}}},wt=i("9fc8"),_t={components:{ButtonVariableMode:G,MenuSelect:St,DxTooltip:wt["DxTooltip"]},mixins:[Ot],data:function(){return{activeSelected:0,activeRoute:"",windowWidth:0,textTooltip:"",modalAcceptedChangeTab:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({defaultAccount:"subscribeOrders/getDefaultAccount",getHeaderBtns:"headerSettings/getHeaderBtns",getActiveScreen:"headerSettings/getActiveScreen",getActiveButtonForScreen:"headerSettings/getActiveButtonForScreen",getActiveModeButtons:"headerSettings/getActiveModeButtons",getSession:"auth/getSession",getUserSettings:"userSettings/getUserSettings"})),{},{getCurrentRouteUrl:function(){return this.activeRoute},getWidthItemTab:function(){return"text"===this.getActiveModeButtons?95:43},getModeForButtons:function(){var t=this;if(!this.getActiveButtonForScreen||this.getActiveScreen)return"text";this.getActiveButtonForScreen[0].screens.find((function(e){return e.number===t.getActiveScreen})).mode},getInactiveHeaderBtns:function(){if(this.getHeaderBtns)return this.setInactiveButtonArray(this.getHeaderBtns,this.getActiveScreen)},getTabsAndSelectItems:function(){if(this.getActiveButtonForScreen&&this.windowWidth){var t,e={},i=Math.trunc((this.windowWidth-this.getLogoWidth()-this.getUserBlockWidth()-32-24)/this.getWidthItemTab);return i&&i>0?(t=this.getActiveButtonForScreen.length-i,e.tabsArray=this.getActiveButtonForScreen.slice(0,i)):(e.tabsArray=this.getActiveButtonForScreen.slice(0,1),t=this.getActiveButtonForScreen.length-1),t>0&&(e.selectArray=this.getActiveButtonForScreen.slice(-t),this.activeSelected=e.selectArray[0].btnText),e}},styleSize:function(){return{width:"".concat(this.getWidthItemTab,"px")}}}),watch:{$route:function(t){this.setActiveRoute(t)},defaultAccount:function(){this.setActiveRoute(this.$router.currentRoute)},getSession:function(t){t||this.$store.commit("headerSettings/setDefaultSettingsForScreens")}},methods:{closeConfigModal:function(){this.$store.dispatch("modal/switchSettingsHeaderMenuModal")},viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},setInactiveButtonArray:function(t,e){return t.filter((function(t){return!t.screens.some((function(t){return t.number===e}))}))},windowResize:function(){window.innerWidth&&(this.windowWidth=window.innerWidth)},setActiveRoute:function(t){var e;"/user-profile"===t.path&&(null===(e=this.defaultAccount)||void 0===e?void 0:e.owner)!==t.query.userId?this.activeRoute="":this.activeRoute=t.path},isMTLink:function(t){return"btnsLibraryA"===t},goToRoute:function(t){if(this.$router.currentRoute.path!==t.url||"/user-profile"===t.url){var e=localStorage.getItem("acceptedRedirectFromPersonalArea");if("/personal-area"===this.$router.currentRoute.path&&!this.isAcceptRedirect&&e){var i=JSON.parse(e);this.checkAcceptedRedirect(i,t)}else if("/user-profile"===t.url&&this.getSession){var o,n;if("/user-profile"===this.$router.currentRoute.path&&null!==(o=this.$router.currentRoute.query)&&void 0!==o&&o.accountId&&this.$router.currentRoute.query.accountId===this.defaultAccount.id)return;("/user-profile"===this.$router.currentRoute.path&&null!==(n=this.$router.currentRoute.query)&&void 0!==n&&n.accountId&&this.$router.currentRoute.query.accountId!==this.defaultAccount.id||"/user-profile"!==this.$router.currentRoute.path)&&this.$router.push({path:t.url,query:{accountId:this.defaultAccount.id,userId:this.defaultAccount.owner}})}else("/user-profile"!==t.url||this.getSession)&&("/investing"!==t.url||this.getSession)?"/academy"===t.url?window.open("https://numbersinvestclub.com/academy","_blank"):this.$router.push(t.url):this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})}},checkAcceptedRedirect:function(t,e){if(t.accept)return this.isAcceptRedirect=!0,localStorage.removeItem("acceptedRedirectFromPersonalArea"),this.goToRoute(this.dataToRedirect),void(this.dataToRedirect=null);this.modalAcceptedChangeTab={description:"ModalAcceptRedirectDescription",information:!1,maxWidth:"270px",isOpen:!0,position:{left:"".concat(t.pos.x-280,"px"),top:"".concat(t.pos.y-130,"px")}},this.dataToRedirect=e},acceptModalChangeTab:function(){this.isAcceptRedirect=!0,this.closeModalsChangeTab(),localStorage.removeItem("acceptedRedirectFromPersonalArea"),this.goToRoute(this.dataToRedirect),this.isAcceptRedirect=!1,this.dataToRedirect=null},closeModalsChangeTab:function(){this.modalAcceptedChangeTab=null},tabSelected:function(t){this.activeSelected=t,this.goToRoute(this.getHeaderBtns.find((function(e){return e.btnText===t})))},getLogoWidth:function(){return window.innerWidth<=1366?54:172},getUserBlockWidth:function(){return!this.getSession&&window.innerWidth<=1366?110:!this.getSession&&window.innerWidth>1366?230:this.getSession&&window.innerWidth>1920?625:this.getSession&&window.innerWidth<=1920?560:this.getSession&&window.innerWidth<=1366?435:this.getSession&&window.innerWidth<=1074?345:void 0}},mounted:function(){this.setActiveRoute(this.$router.currentRoute),this.windowWidth=window.innerWidth},created:function(){window.addEventListener("resize",this.windowResize)},destroyed:function(){window.removeEventListener("resize",this.windowResize)}},At=_t,Dt=(i("b77f"),Object(C["a"])(At,O,w,!1,null,null,null)),kt=Dt.exports,It=function(){var t=this,e=t._self._c;return e("Modal",{staticClass:"modal-menu-settings",attrs:{isOpen:t.isOpen,title:t.$t("menu_setup")},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"settingsHeader-tabs"},[t._l(t.tabs,(function(i,o){return e("div",{key:o,class:o===t.activeTab?"settingsHeader-tab settingsHeader-tab_".concat(t.getActiveTheme," settingsHeader-tab_isActive"):"settingsHeader-tab settingsHeader-tab_".concat(t.getActiveTheme),on:{click:function(e){return t.setActiveTab(o)}}},[t._v(t._s(t.$t(i.text))),o===t.activeTab?e("div",{staticClass:"settingsHeader-tabContent",class:o?"settingsHeader-tabContent_isActive settingsHeader-tabContent_isActive-".concat(t.getActiveTheme," settingsHeader-tabContent_isActive-last-").concat(t.getActiveTheme):"settingsHeader-tabContent_isActive settingsHeader-tabContent_isActive-".concat(t.getActiveTheme," settingsHeader-tabContent_isActive-first-").concat(t.getActiveTheme),style:{borderRadius:o?"0 0.4rem 0 0":"0.4rem 0 0 0"}},[t._v(t._s(t.$t(i.text)))]):t._e()])})),e("div",{staticClass:"settingsHeader-empty",class:"settingsHeader-empty_".concat(t.getActiveTheme)})],2),e("div",{staticClass:"settingsHeader-content"},[e(t.tabs[t.activeTab].component,{tag:"component",attrs:{inActiveBtnArr:t.inActiveBtnArr}})],1)]},proxy:!0}])})},Bt=[],Mt=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"modal"}},[t.isOpen?e("div",{staticClass:"modal",class:[t.modifier,t.getActiveTheme],style:{zIndex:t.zIndex}},[t.isWithoutMask?t._e():e("div",{staticClass:"modal__mask"}),e("DxDraggable",{attrs:{handle:"#zone-drag-modal"}},[e("div",{ref:"content",staticClass:"modal__container",class:{"modal__container--aside":t.$slots["modal-left"]},style:{width:t.modalWidth,marginTop:t.marginTop+"px"}},[t.$slots["modal-left"]?e("div",{staticClass:"modal__left"},[t._t("modal-left")],2):t._e(),t.customHeader?t._e():e("div",{staticClass:"modal__header",attrs:{id:t.isDraggble?"zone-drag-modal":"disabled-draggable"}},[e("div",{staticClass:"modal-bar",staticStyle:{background:"transparent","box-shadow":"none"}},[e("div",{staticClass:"buttons-group",staticStyle:{background:"transparent","box-shadow":"none",border:"none"}},[t.isDraggble?e("svgIcon",{style:{color:"dark"===t.getActiveTheme?"#8FA8C1":"#B2B2B2",marginBottom:"-2px"},attrs:{name:"Drag"}}):t._e(),e("div",{staticClass:"modal__header-title"},[t._v(t._s(t.title))]),e("div",{staticClass:"spacer spacer--right spacer--subheader"}),e("div",{staticClass:"modal-bar__tools"},[t._t("modal-header")],2),e("div",{staticClass:"modal__close",class:t.getActiveTheme,on:{click:t.close}},[e("Button",{attrs:{icon:"Close"}})],1)],1)])]),t.customHeader?e("div",{staticClass:"modal__header"},[t._t("modal-header")],2):t._e(),t.$slots["modal-subheader"]?e("div",{staticClass:"modal__subheader"},[t._t("modal-subheader")],2):t._e(),t.scroll?e("VuePerfectScrollbar",{staticClass:"scroll-area",attrs:{settings:t.settings}},[e("div",{staticClass:"modal__body"},[t._t("modal-body")],2)]):e("div",{staticClass:"modal__body"},[t._t("modal-body")],2),t.$slots["modal-footer"]?e("div",{staticClass:"modal__footer"},[t._t("modal-footer")],2):t._e()],1)])],1):t._e()])},$t=[],Lt=function(){var t=this,e=t._self._c;return e("button",{staticClass:"button button-icon",class:[{"button-icon--active ":t.isActive},t.mod],attrs:{type:"button",disabled:t.disable},on:{click:function(e){return t.toggle(e,t.isActive)},mouseover:t.onMouseOver}},[e("span",{staticClass:"button__icon button-icon__icon",style:{color:t.color}},[e("SvgIcon",{attrs:{name:t.iconName}})],1),e("span",{staticClass:"button__text button-icon__text"},[t._t("default")],2)])},Ft=[],jt={components:{SvgIcon:L},data:function(){return{classList:""}},props:{isActive:{type:Boolean,default:!1},iconName:{type:String,required:!1,default:"Close"},disable:{type:Boolean,required:!1,default:!1},modifier:{type:[Array,String]},color:{type:String,default:""}},computed:{isDisabled:function(){return!this.disable},mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"button-icon--"+t})).join(" "),o):""}},methods:{toggle:function(t){this.$emit("toggle",t.target),this.$emit("click",t)},onMouseOver:function(){this.$emit("mouseover")}}},Rt=jt,Wt=(i("442f"),Object(C["a"])(Rt,Lt,Ft,!1,null,null,null)),Nt=Wt.exports,Et=function(){var t=this,e=t._self._c;return e("div",{staticClass:"new-button",class:t.getClasses,on:{click:function(){return!t.disabled&&t.$emit("click")}}},[t.icon?e("svgIcon",{style:t.getStyleForIcon,attrs:{name:t.icon,size:t.label?20:24}}):t._e(),t.label?e("span",{style:t.getStyleForIcon},[t._v(t._s(t.$t(t.label)))]):t._e(),t.isLoad?e("div",{staticClass:"loader"}):t._e()],1)},Ut=[],Vt=i("ade3"),Ht={props:["label","icon","isLoad","disabled","activated","withoutBorder"],components:{svgIcon:L},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStyleForIcon:function(){return{color:this.activated?"white":""}},getClasses:function(){var t,e=(t={disabled:this.disabled},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,"without-icon",!this.icon),Object(Vt["a"])(t,"activated-button",this.activated),Object(Vt["a"])(t,"without-border",this.withoutBorder),t);return e}}),mounted:function(){},destroyed:function(){}},Gt=Ht,qt=(i("7115"),Object(C["a"])(Gt,Et,Ut,!1,null,"3e3928cd",null)),zt=qt.exports,Yt=i("9d63"),Xt=i.n(Yt),Qt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"buttons-group",class:t.arr.length>2?"buttons-group--profit":""},[t.title?e("button",{staticClass:"button button-counter button-counter--group buttons-group__title",attrs:{type:"button",disabled:""}},[e("span",{staticClass:"button-counter__text"}),t._t("default",(function(){return[t._v(t._s(t.title))]}))],2):t._e(),t.arr.length>2?e("div",{staticClass:"buttons-group__btn"},t._l(t.arr,(function(i,o){return e("Button-counter",{key:i.index,attrs:{index:o,btnCount:i.btnCount,isActive:o===t.activeIndex,modifier:"group"},on:{tab:function(e){return t.onSelectItem(o,t.item)}}},[t._v(t._s(i.btnText))])})),1):t._l(t.arr,(function(i,o){return e("Button-counter",{key:i.index,attrs:{index:o,btnCount:i.btnCount,isActive:o===t.activeIndex,modifier:"group"},on:{tab:function(e){return t.onSelectItem(o,i)}}},[t._v(t._s(i.btnText))])})),t.arr.length>2?e("div",{staticClass:"buttons-group__selector"},[e("Button-counter",{attrs:{modifier:"group",btnCount:t.selectedProfit.btnCount,isActive:""}},[t._v(" "+t._s(t.selectedProfit.btnText)+" ")]),e("Button-icon",{attrs:{iconName:t.isOpen?"Arrow-dropdown-top":"Arrow-dropdown-bottom",modifier:"group subheader",isActive:t.isOpen},on:{toggle:function(e){t.isOpen=!t.isOpen}}}),e("Dropdown-menu",{staticClass:"dropdown-menu--profit",attrs:{isOpen:t.isOpen,width:"160"}},t._l(t.filteredProfit,(function(i,o){return e("List-item",{key:i.index,attrs:{index:o,text:i.btnText},on:{clickListItem:function(e){return t.onSelectItem(i)}}},[t._v(t._s(i.btnCount))])})),1)],1):t._e()],2)},Jt=[],Kt=function(){var t=this,e=t._self._c;return e("button",{staticClass:"button button-counter",class:[t.btnMod,t.mod,{"button-label--updated":t.updated}],attrs:{type:"button"},on:{click:t.clickHandler}},[t.iconName?e("span",{staticClass:"button__icon button-counter__icon"},[e("SvgIcon",{attrs:{name:t.iconName}})],1):t._e(),e("span",{staticClass:"button__text button-counter__text"},[t._t("default")],2),t.btnCount?e("span",{staticClass:"button__counter button-counter__counter"},[t._v(t._s(t.btnCount))]):t._e()])},Zt=[],te={components:{SvgIcon:L},data:function(){return{activeLiIndex:null}},props:{btnCount:{required:!0,default:0},iconName:{type:String,required:!1},isActive:{type:Boolean,required:!1,default:!1},index:{type:Number,required:!1,default:null},headerArea:{type:Boolean,required:!1,default:!1},modifier:{type:String},updated:{type:Boolean}},computed:{btnMod:function(){var t=null,e=null;return t=this.iconName&&!this.headerArea?"button--icon":this.iconName&&this.headerArea?"button--icon button-counter--header":!this.iconName&&this.headerArea?"button-counter--header":"",e=this.isActive?" button-counter--active":"",t+e},mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"button-counter--"+t})).join(" "),o):""}},methods:{clickHandler:function(){this.$emit("tab",this.index)}}},ee=te,ie=(i("71bb"),Object(C["a"])(ee,Kt,Zt,!1,null,null,null)),oe=ie.exports,ne=function(){var t=this,e=t._self._c;return e("li",{staticClass:"dropdown-list__item list-item",class:t.mod,style:t.styleModifier,attrs:{draggable:t.draggable},on:{click:t.clickListItem}},[t._t("before"),t.draggable?e("span",{staticClass:"list-item__icon"},[e("SvgIcon",{attrs:{name:"Drag"}})],1):t._e(),t._t("beforeDraggble"),t.iconName.length>0?e("span",{staticClass:"list-item__icon"},[e("SvgIcon",{attrs:{name:t.iconName}})],1):t._e(),t.text?e("span",{staticClass:"list-item__text"},[t._v(t._s(t.text))]):t._e(),this.$slots.default?e("div",{staticClass:"list-item__content"},[t._t("default")],2):t._e(),e("div",{staticClass:"list-item__after"},[t._t("after")],2)],2)},se=[],re={components:{SvgIcon:L},props:{iconName:{type:String,required:!1,default:""},draggable:{type:Boolean,required:!1,default:!1},text:{default:""},styleModifier:{type:Object,default:function(){return{}}},modifier:{type:[Array,String,Object]}},computed:{mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"list-item--"+t})).join(" "),o):"list-item--".concat(this.modifier)}},methods:{clickListItem:function(){this.$emit("clickListItem")}}},ae=re,ce=(i("bc94"),Object(C["a"])(ae,ne,se,!1,null,null,null)),le=ce.exports,ue={components:{ButtonCounter:oe,DropdownMenu:vt,ListItem:le,ButtonIcon:Nt},data:function(){return{activeIndex:0,isOpen:!1}},props:{arr:{type:Array,default:function(){return[{index:"0",btnCount:"350",btnText:"все",isActive:!1},{index:"1",btnCount:"120",btnText:"Профитные",isActive:!1}]}},title:{type:String,required:!1}},computed:{list:function(){return this.arr},selectedProfit:function(){return this.arr[this.activeIndex]},filteredProfit:function(){var t=this;return this.list.filter((function(e){return e.index!==t.activeIndex}))}},methods:{onSelectItem:function(t,e){this.activeIndex=t,this.isOpen=!1,this.$emit("selectButton",e)}}},de=ue,he=(i("4100"),Object(C["a"])(de,Qt,Jt,!1,null,null,null)),pe=he.exports,ge=function(){var t=this,e=t._self._c;return e("div",{staticClass:"label-bar",class:t.mod},[e("div",{staticClass:"label-bar__text"},[t._t("default")],2),e("div",{staticClass:"label-bar__content"},[t._t("content")],2)])},fe=[],me={props:{modifier:{type:String}},computed:{mod:function(){var t="",e=Object(D["a"])(t,2),i=e[0],o=e[1];return this.modifier?(i=this.modifier.split(" "),o=i.map((function(t){return"label-bar--"+t})).join(" "),o):""}}},ve=me,ye=(i("6dc8"),Object(C["a"])(ve,ge,fe,!1,null,null,null)),Ce=ye.exports,be=i("839e"),Se=i.n(be),Pe={name:"Modal",components:{ButtonIcon:Nt,DxDraggable:Se.a,svgIcon:L,Button:zt,VuePerfectScrollbar:Xt.a,GroupButtons:pe,LabelBar:Ce},data:function(){return{settings:{maxScrollbarLength:60,wheelSpeed:.5}}},props:{marginTop:{type:Number,default:0},title:{type:String},isOpen:!0,modifier:"",iconClose:{default:"Close"},scroll:!0,width:{type:String},zIndex:{default:1047},customHeader:{type:Boolean,default:!1},isWithoutMask:{type:Boolean,default:!1},isDraggble:{type:Boolean,default:!1}},methods:{close:function(){this.$emit("close")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{hasSlot:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return!!this.$slots[t]||!!this.$scopedSlots[t]},modalWidth:function(){return"".concat(this.width,"px")}})},Te=Pe,xe=(i("ee93"),Object(C["a"])(Te,Mt,$t,!1,null,null,null)),Oe=xe.exports,we=function(){var t=this,e=t._self._c;return e("div",{staticClass:"settingsBtnHeader-wrapper"},[e("div",{staticClass:"settingsBtnHeader-screensTabs"},[t._l(t.getCountScreens,(function(i,o){return e("div",{key:o,staticClass:"settingsBtnHeader-screenGroup",class:o===t.getActiveScreen?"settingsBtnHeader-screenGroup_".concat(t.getActiveTheme," settingsBtnHeader-screenGroup_isActive_").concat(t.getActiveTheme):"settingsBtnHeader-screenGroup_".concat(t.getActiveTheme),attrs:{id:o+"group"}},[e("div",{staticClass:"settingsBtnHeader-screen",class:"settingsBtnHeader-screen_".concat(t.getActiveTheme),on:{click:function(e){return t.toggleScreen(o)}}},[t._v("# "+t._s(i+1)+" ")]),t.getCountScreens.length>1?e("div",{staticClass:"settingsBtnHeader-screenDelete",style:{color:t.getRedColor.color},on:{click:function(e){return t.toggleAlert(o)}}},[e("svgIcon",{attrs:{name:"Close"}})],1):t._e()])})),t.getCountScreens.length<=4?e("ButtonIconFlat",{attrs:{icon:{name:"Add",color:t.getBlueColor.color},modifier:{class:["settingsBtnHeader-addScreen","settingsBtnHeader-addScreen_".concat(t.getActiveTheme)]}},on:{click:t.addScreen}},[e("span",[t._v(t._s(t.$t("new_group")))])]):t._e()],2),e("div",{staticClass:"settingsBtnHeader-titles",class:"settingsBtnHeader-titles_".concat(t.getActiveTheme)},[e("div",{staticClass:"left-side"},[e("div",{staticClass:"side-title"},[t._v(t._s(t.$t("section")))])]),e("div",{staticClass:"right-side"},[e("div",{staticClass:"side-title"},[t._v(t._s(t.$t("display_by")))]),e("div",{staticClass:"settingsBtnHeader-selectType",class:"settingsBtnHeader-selectType_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{height:"100%",width:"105px",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1,items:t.modes,"item-template":"itemList",value:t.$t(t.modes.find((function(e){return e.mode===t.getActiveModeButtons})).textList),displayExpr:t.getModeItem,onItemClick:t.select,dropDownOptions:{container:".settingsBtnHeader-selectType"}},scopedSlots:t._u([{key:"itemList",fn:function(e){var i=e.data;return[t._v(t._s(t.$t(i.textList)))]}}])})],1)])]),e("div",{ref:"menuSettingsList",staticClass:"settingsBtnHeader-buttonLists"},[e("div",{staticClass:"settingsBtnHeader-activeButtonList"},[e("DxSortable",{attrs:{data:t.getActiveButtonForScreen},on:{reorder:function(e){return t.onTaskDrop(e)}}},t._l(t.getActiveButtonForScreen,(function(i,o){return e("div",{key:o+"_active",staticClass:"settingsBtnHeader-activeButton",class:"settingsBtnHeader-activeButton_".concat(t.getActiveTheme)},[e("div",{staticClass:"settingsBtnHeader-activeButton_dargIcon",style:{color:t.getGrayColor.color}},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"settingsBtnHeader-activeButton_checkIcon",style:{color:t.getBlueColor.color},on:{click:function(e){return t.removeButtonOnScreen(i)}}},[e("svgIcon",{attrs:{name:"Favorite-on"}})],1),e("div",{staticClass:"settingsBtnHeader-activeButton_buttonName",class:"settingsBtnHeader-activeButton_buttonName-".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.btnText)))]),"text"===t.getActiveModeButtons?e("div",{staticClass:"settingsBtnHeader-activeButton_textMode",style:{color:t.getGrayColor.color}},[t._v("Text ")]):t._e(),"color"===t.getActiveModeButtons?e("div",{staticClass:"settingsBtnHeader-activeButton_colorMode"},[e("NewColorPicker",{attrs:{color:i.color,right:"45px"},on:{changeColor:function(e){return t.setButtonColor({data:e,param:"color",btn:i.key})}}})],1):t._e(),"icon"===t.getActiveModeButtons?e("div",{staticClass:"settingsBtnHeader-activeButton_iconMode"},[e("NewColorPicker",{attrs:{color:i.icon.color,right:"60px",top:"".concat(30*o,"px")},on:{changeColor:function(e){return t.setIconColor({data:{color:e,name:i.icon.name},param:"icon",btn:i.key})}}}),e("div",{style:{color:i.icon.color},on:{click:function(e){return t.openSetIcon(i)}}},[e("svgIcon",{attrs:{name:i.icon.name}})],1)],1):t._e(),"avatar"===t.getActiveModeButtons?e("div",{staticClass:"settingsBtnHeader-activeButton_avatarMode",style:{width:i.avatarSrc?"5rem":"3.2rem"}},[e("div",[i.avatarSrc?e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("Avatar",{attrs:{size:"3",src:i.avatarSrc,theme:t.getActiveTheme}}),e("div",{style:{color:t.getRedColor.color},on:{click:function(e){return t.removeAvatar(i.key)}}},[e("svgIcon",{attrs:{name:"Close"}})],1)],1):e("div",{staticStyle:{width:"3.2rem",height:"3.2rem",overflow:"hidden"}},[e("File-uploader",{attrs:{formats:t.formats,size:t.sizeKB},on:{input:function(e){return t.onInputCover(e,i.key)}}})],1)])]):t._e()])})),0)],1),t.getInactiveBtn.length?e("div",{staticClass:"settingsBtnHeader-dividerList",class:"settingsBtnHeader-dividerList_".concat(t.getActiveTheme)}):t._e(),e("div",{staticClass:"settingsBtnHeader-inactiveButtonList"},t._l(t.getInactiveBtn,(function(i,o){return e("div",{key:o+"inactive",staticClass:"settingsBtnHeader-inactiveButton",class:"settingsBtnHeader-inactiveButton_".concat(t.getActiveTheme)},[e("div",{staticClass:"settingsBtnHeader-inactiveButton_checkIcon",style:{color:t.getBlueColor.color},on:{click:function(e){return t.addButtonOnScreen(i)}}},[e("svgIcon",{attrs:{name:"Favorite-off"}})],1),e("div",{staticClass:"settingsBtnHeader-inactiveButton_buttonName",class:"settingsBtnHeader-inactiveButton_buttonName-".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.btnText)))])])})),0)]),e("div",{staticClass:"settingsBtnHeader-defaultSettings",class:"settingsBtnHeader-defaultSettings_".concat(t.getActiveTheme)},[e("ButtonIconFlat",{attrs:{icon:{name:"Reset",color:"light"===t.getActiveTheme?"#2462db":"#00b9fc"},modifier:{class:["settingsBtnHeader-addScreen","settingsBtnHeader-addScreen_".concat(t.getActiveTheme)]}},on:{click:t.setDefaultSettings}},[t._v(t._s(t.$t("reset_settings")))]),e("div",{staticClass:"settingsBtnHeader-backgroundSetting"},[e("div",{staticClass:"settingsBtnHeader-backgroundSetting-title",class:"settingsBtnHeader-backgroundSetting-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("background_buttons")))]),e("NewColorPicker",{key:t.getBackground,attrs:{color:t.getBackground,right:"45px",top:"210px"},on:{changeColor:t.setButtonBackgroundColor}})],1)],1),e("Alert",{attrs:{enabled:t.alert,leftPosition:t.alertLeft,leftTrianglePosition:t.alertTriangleLeft}},[e("div",{staticClass:"form-label alert__text"},[t._v(t._s(t.$t("delete_the_group"))+" №"+t._s(t.alertProp)+"?")]),e("div",{staticClass:"alert__controls"},[e("Button-icon",{attrs:{modifier:"header gray",typeBtn:"cancel",iconName:"Close"},on:{click:function(e){t.alert=!1}}},[e("span",[t._v(t._s(t.$t("cancel")))])]),e("Button-icon",{attrs:{modifier:"header red",typeBtn:"cancel",iconName:"del-ok"},on:{click:function(e){return t.deleteScreen(t.alertProp)}}},[e("span",[t._v(t._s(t.$t("delete")))])])],1)]),t.statusSetIcon?e("DxPopup",{attrs:{visible:t.statusSetIcon,shading:!1,width:"auto",height:"auto",showTitle:!1}},[e("HeaderSetIcons",{attrs:{btn:t.activeBtn},on:{closeModal:t.closeSetIcon,setIcon:t.setIcon}})],1):t._e()],1)},_e=[],Ae=function(){var t=this,e=t._self._c;return e("div",{staticClass:"file-uploader"},[e("ButtonIconFlat",{attrs:{icon:{name:"Photo"},modifier:{class:["buttonFlat-icon","buttonFlat-icon__standartButton","buttonFlat-icon__standartButton--32","buttonFlat-icon__standartButton_".concat(t.getActiveTheme)]}},on:{toggle:t.triggerUpload}}),e("input",{ref:"upload",staticClass:"file-uploader__control",attrs:{accept:t.formatsString,type:"file"},on:{change:t.handleFileChange}})],1)},De=[],ke=function(){var t=this,e=t._self._c;return e("button",{staticClass:"buttonFlat-icon",class:[{"buttonFlat-icon--active ":t.isActive},t.modifierClass],style:t.modifier.style,attrs:{type:"button",id:t.modifier.id,disabled:t.disable},on:{click:function(e){return e.stopPropagation(),t.toggle(e,t.isActive)},mouseenter:t.onMouseEnter,mouseleave:t.onMouseLeave,mouseover:t.onMouseOver,mouseout:t.onMouseOut}},[t.icon.name&&!t.process?e("span",{staticClass:"buttonFlat__icon buttonFlat-icon__icon",style:t.isActive?{color:t.icon.colorActive}:{color:t.icon.color}},[e("SvgIcon",{attrs:{name:t.icon.name}})],1):t._e(),t.process?e("div",{staticClass:"buttonFlat-icon__loader"},[e("span"),e("span"),e("span")]):t._e(),t.process?t._e():e("span",{staticClass:"buttonFlat__text buttonFlat-icon__text"},[t._t("default")],2)])},Ie=[],Be={components:{SvgIcon:L},data:function(){return{classList:""}},props:{isActive:{type:Boolean,default:!1},process:{type:Boolean,default:!1},icon:{type:Object,default:function(){return{name:"",color:"#8c8c8c",colorHover:"blue",colorActive:"green"}}},disable:{type:Boolean,required:!1,default:!1},modifier:{type:Object,default:function(){return{class:"",id:"",style:{}}}},color:{type:String,default:""}},computed:{isDisabled:function(){return!this.disable},modifierClass:function(){var t;if(null!==(t=this.modifier)&&void 0!==t&&t.class)return this.modifier.class.join(" ")}},methods:{toggle:function(t){this.$emit("toggle",t.target),this.$emit("click",t)},onMouseLeave:function(t){this.$emit("mouseleave",t)},onMouseEnter:function(t){this.$emit("mouseenter",t)},onMouseOver:function(){this.$emit("mouseover")},onMouseOut:function(){this.$emit("mouseout")}}},Me=Be,$e=(i("0cbf"),Object(C["a"])(Me,ke,Ie,!1,null,null,null)),Le=$e.exports,Fe={components:{ButtonIconFlat:Le},props:{value:Blob,formats:Array,size:Number,group:Boolean},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{formatsString:{get:function(){return this.formats?this.formats.join(", "):"*"}},getModifier:function(){return this.group?"flat square group":"flat square"}}),methods:{triggerUpload:function(){this.$refs.upload.click()},handleFileChange:function(t){var e=t.target.files[0];e&&this.beforeFileUpload(e)?this.$emit("input",e):this.$emit("input",null)},beforeFileUpload:function(t){var e=t.type,i=t.size/1024,o=this.formats.some((function(t){return e===t})),n=i100?this.positionPoint=100:this.positionPoint<0&&(this.positionPoint=0),this.positionPoint>91&&(this.positionPoint=91),this.procent=this.positionPoint/91*100)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{className:function(){return this.atoms1?"".concat(this.atoms1," ").concat(this.getActiveTheme):"".concat(this.getActiveTheme)},styleForPicker:function(){return this.byRightSide?{top:"25px",right:"-210px",zIndex:2}:{top:this.top,right:this.right,zIndex:2}}}),watch:{procent:function(t){if(t>100)return this.procent=100;this.positionPoint=91*t/100,this.newColor=this.changeAlfa(this.newColor,this.procent/100),this.$emit("changeColor",this.newColor)}},mounted:function(){this.id=this._uid,this.newColor=this.color,this.currentDisabled=this.disabled},destroyed:function(){},data:function(){return{atomsClasses:this.atoms1,id:void 0,showColorPicker:!1,newColor:void 0,movePoint:!1,positionPoint:91,procent:100,stop:!1,parentColors:ji,whiteList:Ri,tealList:Wi,darkslateblueList:Ni,darkPurpleList:Ei,purpleList:Ui,lightPurpleList:Vi,firebrick:Hi,orangered:Gi,yellowList:qi,darkGreenList:zi,salatList:Yi}}},Qi=Xi,Ji=(i("743e"),Object(C["a"])(Qi,ze,Ye,!1,null,"41328187",null)),Ki=Ji.exports,Zi=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderSetIcons",class:"HeaderSetIcons_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderSetIcons-title"},[e("div",{staticClass:"HeaderSetIcons-titleText",class:"HeaderSetIcons-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(t.btn.btnText)))]),e("div",{staticClass:"HeaderSetIcons-close",style:{color:t.getRedColor.color},on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"HeaderSetIcons-icons"},t._l(t.setIcons,(function(i,o){return e("div",{key:o,staticClass:"HeaderSetIcons-iconRow"},t._l(i,(function(i,o){return e("div",{key:"".concat(o,"_").concat(i),staticClass:"HeaderSetIcons-IconItem",class:t.btn.icon.name===i?"HeaderSetIcons-IconItem_isActive_".concat(t.getActiveTheme):"HeaderSetIcons-IconItem_".concat(t.getActiveTheme),on:{click:function(e){return t.setIcon(i)}}},[e("svgIcon",{attrs:{name:i}})],1)})),0)})),0)])},to=[],eo={props:{btn:{type:Object}},mixins:[qe],data:function(){return{setIcons:[["Home","businessman1","businesswoman1","user1","user2"],["GR_Chart_candle-2","bull-market1","bear-market1","money-bag1","stock-market1"],["Tops2","chess1","brainstorming1","outsorsing1","game-strategy-sketch1"],["RegPartner","pie-chart1","pie-chart2","growth1","investment1"],["report","MySubscribers","Academy"]]}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{closeModal:function(){this.$emit("closeModal")},setIcon:function(t){this.$emit("setIcon",t)}}},io=eo,oo=(i("10e3"),Object(C["a"])(io,Zi,to,!1,null,"10a8c3e4",null)),no=oo.exports,so={components:{Avatar:E,HeaderSetIcons:no,NewColorPicker:Ki,DxSelectBox:wt["DxSelectBox"],DxPopup:wt["DxPopup"],DxSortable:wt["DxSortable"],Alert:Ge,ButtonIcon:Nt,FileUploader:We},props:{inActiveBtnArr:{type:Array}},mixins:[qe],data:function(){return{statusSetIcon:!1,activeBtn:null,modes:[{textList:"text",mode:"text"},{textList:"color",mode:"color"},{textList:"icon",mode:"icon"},{textList:"avatar",mode:"avatar"}],formats:["image/jpg","image/jpeg","image/png"],sizeKB:7e4,size:null,alert:!1,alertProp:null,alertTriangleLeft:{},alertLeft:{}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getHeaderBtns:"headerSettings/getHeaderBtns",getActiveScreen:"headerSettings/getActiveScreen",getActiveTheme:"headerSettings/getActiveTheme",getBackgroundNavButtons:"headerSettings/getBackgroundNavButtons",getActiveButtonForScreen:"headerSettings/getActiveButtonForScreen",getActiveModeButtons:"headerSettings/getActiveModeButtons",getSession:"auth/getSession"})),{},{getCountScreens:function(){return this.getHeaderBtns?Object(x["a"])(new Set(Array.from(this.getArrayScreen(this.getHeaderBtns)))):void 0},getInactiveBtn:function(){var t=this;if(this.getHeaderBtns)return this.getHeaderBtns.filter((function(e){return!e.screens.some((function(e){return e.number===t.getActiveScreen}))}))},getBackground:function(){return this.getBackgroundNavButtons?this.getBackgroundNavButtons:"dark"===this.getActiveTheme?"#314456":"#fff"}}),methods:{openSetIcon:function(t){this.statusSetIcon=!0,this.activeBtn=t},setButtonBackgroundColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setBackgroundNavigationMenu",data:t})},setDefaultSettings:function(){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setDefaultNavigationMenu",data:null})},closeSetIcon:function(){this.statusSetIcon=!1,this.activeBtn=null},fixAlertPosition:function(t){switch(t){case 0:this.alertTriangleLeft={left:"18px"},this.alertLeft={left:"15px"};break;case 1:this.alertTriangleLeft={left:"96px"},this.alertLeft={left:"15px"};break;case 2:this.alertTriangleLeft={left:"18px"},this.alertLeft={left:"170px"};break;case 3:this.alertTriangleLeft={left:"96px"},this.alertLeft={left:"170px"};break}},onInputCover:function(t,e){if(t){var i=URL.createObjectURL(t);this.$store.dispatch("modal/switchUploadImageModal",{mode:"header-button",src:i,cropFactor:{width:80,height:80},ratio:1,format:t.type,nameParam:"headerBtn-".concat(e),nameBtn:e})}},getArrayScreen:function(t){var e=t.map((function(t){return t.screens.map((function(t){return t.number}))}));return e.flat()},setButtonColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:t})},setIconColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:t})},setIcon:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:{data:{color:this.activeBtn.icon.color,name:t},param:"icon",btn:this.activeBtn.key}})},getModeItem:function(t){var e=this;return t?this.$t(t.textList):this.$t(this.modes.find((function(t){return t.mode===e.getActiveModeButtons})).textList)},select:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setModeButtonsForScreen",data:t.itemData.mode})},toggleAlert:function(t){this.alert=!0,this.fixAlertPosition(t),this.alertProp=t+1},addScreen:function(){this.$store.dispatch("headerSettings/redactSettings",{mutation:"addNewScreen",data:{btn:"profile",screen:this.getCountScreens.length}}),this.$store.dispatch("headerSettings/redactSettings",{mutation:"changeActiveScreen",data:this.getCountScreens.length-1})},deleteScreen:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"deleteScreen",data:t}),this.alert=!this.alert},removeAvatar:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:{btn:t,param:"avatarSrc",data:""}})},removeButtonOnScreen:function(t){1!==this.getActiveButtonForScreen.length&&this.$store.dispatch("headerSettings/redactSettings",{mutation:"setRemoveButtonOnScreen",data:t.key})},addButtonOnScreen:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setAddButtonOnScreen",data:t.key})},onTaskDrop:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"reorderButtonsOnScreen",data:t})},toggleScreen:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"changeActiveScreen",data:t})},sideScroll:function(t,e,i,o){var n=document.querySelector("#groupBtnScroll"),s=0,r=setInterval((function(){"left"===t?n.scrollLeft-=o:n.scrollLeft+=o,s+=o,s>=i&&window.clearInterval(r)}),e)}}},ro=so,ao=(i("fb65"),Object(C["a"])(ro,we,_e,!1,null,"2d340ba2",null)),co=ao.exports,lo=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderConfigLogo"},[e("div",{staticClass:"HeaderConfigLogo-title"},[e("div",{staticClass:"HeaderConfigLogo-titleText",class:"HeaderConfigLogo-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("iith")))]),t.getActiveTypeLogo&&t.getLogo?e("div",{staticClass:"HeaderConfigLogo-selectType",class:"HeaderConfigLogo-selectType_".concat(t.getActiveTheme)},[e("DxSelectBox",{key:"".concat(t.getActiveTypeLogo.data,"_").concat(t.getActiveTypeLogo.color,"_").concat(t.getActiveTypeLogo.background),attrs:{height:"100%",width:"180px",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1,items:t.getLogo,"item-template":"itemList","field-template":"field",value:t.getActiveTypeLogo,displayExpr:"textList",dropDownOptions:{container:".HeaderConfigLogo-selectType"},onItemClick:t.setNewMode},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("DxTextBox",{attrs:{hoverStateEnabled:!1,focusStateEnabled:!1,value:t.$t(o.textList),activeStateEnabled:!1,disabled:!0,"element-attr":{class:"HeaderConfigLogo-textInput"}}})]}},{key:"itemList",fn:function(e){var i=e.data;return[t._v(t._s(t.$t(i.textList)))]}}],null,!1,606417924)})],1):t._e()]),e("div",{staticClass:"HeaderConfigLogo-content",class:"HeaderConfigLogo-content_".concat(t.getActiveTheme)},["fullTT"===t.getActiveTypeLogo.mode&&"light"===t.getActiveTheme?e("div",{staticClass:"HeaderConfigLogo-fullLogo"},[e("img",{attrs:{src:t.getLgLogo}})]):t._e(),"fullTT"===t.getActiveTypeLogo.mode&&"dark"===t.getActiveTheme?e("div",{staticClass:"HeaderConfigLogo-fullLogo"},[e("img",{attrs:{src:t.getDarkLogo}})]):t._e(),"cropTT"===t.getActiveTypeLogo.mode?e("div",{staticClass:"HeaderConfigLogo-cropLogo"},[e("img",{attrs:{src:t.getMinLogoSrc}})]):t._e(),"customText"===t.getActiveTypeLogo.mode?e("div",{staticClass:"HeaderConfigLogo-customText",class:"HeaderConfigLogo-customText_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConfigLogo-customTextInput"},[e("input",{style:{color:t.getActiveTypeLogo.color,background:t.getBackgroundForLogo},domProps:{value:t.getActiveTypeLogo.data},on:{input:function(e){return t.setCustomText(e.target.value)}}})]),e("div",{staticClass:"HeaderConfigLogo-customTextOptions"},[e("div",{staticClass:"HeaderConfigLogo-customTextOptions-label",class:"HeaderConfigLogo-customTextOptions-label_".concat(t.getActiveTheme)},[t._v("Цвет текста")]),e("div",{staticClass:"HeaderConfigLogo-customTextOptions-colorPicker"},[e("NewColorPicker",{attrs:{color:t.getActiveTypeLogo.color,top:"25px",right:"45px"},on:{changeColor:t.setTextColor}})],1)]),e("div",{staticClass:"HeaderConfigLogo-customTextOptions"},[e("div",{staticClass:"HeaderConfigLogo-customTextOptions-label",class:"HeaderConfigLogo-customTextOptions-label_".concat(t.getActiveTheme)},[t._v("Цвет фона")]),e("div",{staticClass:"HeaderConfigLogo-customTextOptions-colorPicker"},[e("NewColorPicker",{attrs:{color:t.getBackgroundForLogo,top:"50px",right:"45px"},on:{changeColor:t.setBackgroundColor}})],1)])]):t._e(),"image"===t.getActiveTypeLogo.mode?e("div",{staticClass:"HeaderConfigLogo-imageLogo"},[t.getActiveTypeLogo.data?t._e():e("div",{staticClass:"HeaderConfigLogo-imageLogoUpload"},[e("div",{staticClass:"HeaderConfigLogo-imageLogoUpload-text",style:{color:t.getGrayColor.color}},[t._v("Загрузить изображение")]),e("div",{staticClass:"HeaderConfigLogo-imageLogoUpload-uploader"},[e("FileUploader",{attrs:{formats:t.formats,size:t.sizeKB},on:{input:function(e){return t.onInputCover(e)}}})],1)]),t.getActiveTypeLogo.data?e("div",{staticClass:"HeaderConfigLogo-imageLogoLoad"},[e("div",{staticClass:"HeaderConfigLogo-imageLogoLoad-uploader"},[e("img",{attrs:{src:t.getActiveTypeLogo.data}})]),e("div",{staticClass:"HeaderConfigLogo-imageLogoLoad-delete",style:{color:t.getRedColor.color},on:{click:t.deleteImageLogo}},[e("svgIcon",{attrs:{name:"Close"}})],1)]):t._e()]):t._e()])])},uo=[],ho="min-logo",po="lg-logo",go="dark-logo",fo={components:{DxSelectBox:wt["DxSelectBox"],DxTextBox:wt["DxTextBox"],FileUploader:We,NewColorPicker:Ki},mixins:[qe],data:function(){return{formats:["image/jpg","image/jpeg","image/png"],sizeKB:7e4}},watch:{getActiveTypeLogo:function(t){"customText"===t.mode&&null===t.data&&this.setCustomText(this.getSession?"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName):"TOP TRADER")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserProfile:"user/getUserProfile",getLogo:"headerSettings/getLogo",getUserDetail:"user/getUserDetail",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getDarkLogo:function(){return i("f57b")("./".concat(go,".svg"))},getLgLogo:function(){return i("f57b")("./".concat(po,".svg"))},getMinLogoSrc:function(){return i("f57b")("./".concat(ho,".svg"))},getBackgroundForLogo:function(){if(this.getActiveTypeLogo)return this.getActiveTypeLogo.background?this.getActiveTypeLogo.background:"dark"===this.getActiveTheme?"#23313f":"#fafafa"},getColorText:function(){var t,e,i="dark"===this.getActiveTheme?"#BBCEE0":"#333";return null!==(null===(t=this.getLogo)||void 0===t?void 0:t.data)&&null!==(e=this.getLogo)&&void 0!==e&&e.color?this.getLogo.color:i},getTextForCustomLogo:function(){return null!==this.getActiveTypeLogo.data?this.getActiveTypeLogo.data:this.getSession?"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName):"TOP TRADER"},getActiveTypeLogo:function(){return this.getLogo.find((function(t){return t.active}))}}),methods:{onInputCover:function(t){if(t){var e=URL.createObjectURL(t);this.$store.dispatch("modal/switchUploadImageModal",{mode:"logo",src:e,cropFactor:{width:180,height:40},ratio:5,format:t.type})}},setTextColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setLogoMode",data:{index:2,data:{mode:"customText",data:this.getActiveTypeLogo.data,color:t,background:this.getBackgroundForLogo,active:!0,textList:"my_text"}}})},setBackgroundColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setLogoMode",data:{index:2,data:{mode:"customText",data:this.getActiveTypeLogo.data,color:this.getActiveTypeLogo.color,background:t,active:!0,textList:"my_text"}}})},setNewMode:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setActiveLogoMode",data:t.itemData.mode})},setCustomText:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setLogoMode",data:{index:2,data:{mode:"customText",data:t,color:this.getActiveTypeLogo.color,background:this.getBackgroundForLogo,active:!0,textList:"my_text"}}})},deleteImageLogo:function(){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setLogoMode",data:{index:3,data:{mode:"image",data:null,active:!0,textList:"my_logo"}}})}}},mo=fo,vo=(i("3b73"),Object(C["a"])(mo,lo,uo,!1,null,"901b06aa",null)),yo=vo.exports,Co={components:{Modal:Oe,HeaderConfigNavigation:co,HeaderConfigLogo:yo,DxTabs:wt["DxTabs"]},data:function(){return{tabs:[{id:0,text:"menu_setup",component:"HeaderConfigNavigation"},{id:1,text:"logo_customization",component:"HeaderConfigLogo"}],activeTab:0}},props:{isOpen:{type:Boolean,default:!1},inActiveBtnArr:{type:Array},groupSettingsScroll:{suppressScrollY:!0}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{close:function(){this.$emit("close")},setActiveTab:function(t){this.activeTab=t}}},bo=Co,So=(i("ee88"),Object(C["a"])(bo,It,Bt,!1,null,"16f434d0",null)),Po=So.exports,To=i("d736"),xo=i.n(To),Oo={name:"HeaderNavigationMenu",components:{ModalSettings:Po,Menu:kt,DxPopup:xo.a},mixins:[qe],data:function(){return{statusConfigModal:!1,isOpenVariableModeMenu:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getHeaderBtns:"headerSettings/getHeaderBtns",getActiveScreen:"headerSettings/getActiveScreen",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCountScreens:function(){var t=this;if(this.getHeaderBtns){var e=Object(x["a"])(new Set(Array.from(this.getArrayScreen(this.getHeaderBtns)))),i=e.findIndex((function(e){return e===t.getActiveScreen}));return e.splice(i,1),e.unshift(this.getActiveScreen),e}}}),methods:{getArrayScreen:function(t){var e=t.map((function(t){return t.screens.map((function(t){return t.number}))}));return e.flat()},setActiveScreen:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"changeActiveScreen",data:t})},openConfigModal:function(){this.statusConfigModal=!0},closeConfigModal:function(){this.statusConfigModal=!1}}};Array.prototype.move=function(t,e){return this.splice(e,0,this.splice(t,1)[0]),this};var wo=Oo,_o=(i("a703"),Object(C["a"])(wo,P,T,!1,null,null,null)),Ao=_o.exports,Do=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderAccountMenu",on:{mouseenter:t.visibleAccounts,mouseleave:t.visibleAccounts}},[t.getSelectAccount?e("div",{staticClass:"HeaderAccountMenu-defaultAccount"},[e("Avatar",{attrs:{src:t.getSelectAccount.logo,theme:t.getActiveTheme,size:"2.4"}}),t.getSelectAccount.isProvider?e("div",{staticClass:"HeaderAccountMenu-listAccounts_provider",style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Provider"}})],1):t._e(),e("div",{staticClass:"HeaderAccountMenu-defaultAccount_data"},[e("div",{staticClass:"HeaderAccountMenu-defaultAccount_group",style:{color:t.getSelectAccount.color}},[t._v(t._s(t.getSelectAccount.group))]),e("div",{staticClass:"HeaderAccountMenu-defaultAccount_text",class:"HeaderAccountMenu-defaultAccount_text-".concat(t.getActiveTheme)},[t._v(t._s(t.getSelectAccount.text))])])],1):t._e(),e("DxPopup",{attrs:{visible:t.accountsPopup,showTitle:!1,shading:!1,position:{my:"top center",at:"bottom centet",of:".HeaderAccountMenu"},container:".HeaderAccountMenu",width:"auto",maxHeight:"70vh",height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("VuePerfectScrollbar",{class:"HeaderAccountMenu-accounts HeaderAccountMenu-accounts_".concat(t.getActiveTheme)},t._l(t.getListAccounts,(function(i,o){return e("div",{staticClass:"HeaderAccountMenu-accountsItem"},[e("div",{staticClass:"HeaderAccountMenu-listAccounts",class:"HeaderAccountMenu-listAccounts_".concat(t.getActiveTheme),on:{click:function(e){return t.resetDefaultAccount(i.id)}}},[e("Avatar",{attrs:{src:i.logo,theme:t.getActiveTheme,size:"2.4"}}),i.isProvider?e("div",{staticClass:"HeaderAccountMenu-listAccounts_provider",style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Provider"}})],1):t._e(),e("div",{staticClass:"HeaderAccountMenu-listAccounts_data"},[e("div",{staticClass:"HeaderAccountMenu-listAccounts_group",style:{color:i.color}},[t._v(t._s(i.group))]),e("div",{staticClass:"HeaderAccountMenu-listAccounts_text",class:"HeaderAccountMenu-listAccounts_text-".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])],1)])})),0)]},proxy:!0}])})],1)},ko=[],Io=(i("4e82"),i("049d")),Bo=i.n(Io),Mo={components:{DxSelectBox:Io["DxSelectBox"],VuePerfectScrollbar:Xt.a,DxPopup:To["DxPopup"],Avatar:E},mixins:[qe],data:function(){return{accountsPopup:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme",getApiUrl:"api/api",getSession:"auth/getSession"})),{},{getSelectAccount:function(){if(this.getProfileSequenceIds){var t=this.getProfileSequenceIds.find((function(t){return t.default}));return t||this.getProfileSequenceIds[0]}},getListAccounts:function(){if(this.getProfileSequenceIds)return this.getProfileSequenceIds.filter((function(t){return!t.default}))},getProfileSequenceIds:function(){var t=this;if(this.getProfileAccount.length){var e=this.getProfileAccount.map((function(e){return{text:e.sequenceId,logo:e.brokerId?"broker-sample.png":"tt_broker.png",color:"Demo"===e.accountGroupCode?t.getRedColor.color:"Real"===e.accountGroupCode?t.getGreenColor.color:t.getRedColor.color,id:e.id,brokerId:e.brokerId,group:e.accountGroupCode,default:e.isDefault,isProvider:!!e.source.length}}));return e=e.sort((function(t,e){return e.isProvider-t.isProvider})),e}}}),methods:{visibleAccounts:function(){this.accountsPopup=!this.accountsPopup},resetDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.setDefaultAccount(t);case 2:"/user-profile"===e.$router.currentRoute.path&&null!==(o=e.$router.currentRoute.query)&&void 0!==o&&o.userId&&e.$router.currentRoute.query.userId===e.getDefaultAccount.owner&&(e.$router.push({path:"/user-profile",query:{accountId:e.getDefaultAccount.id,userId:e.getDefaultAccount.owner}}),location.reload());case 3:case"end":return i.stop()}}),i)})))()},setDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.$store.commit("subscribeOrders/resetDefaultAccount",t),e.$store.dispatch("subscribeOrders/setSubscribe"),o=JSON.stringify({accountId:t,isDefault:!0}),i.next=5,e.$workKeys.signMessage(o,e.getSession.sk);case 5:return n=i.sent,i.next=8,e.$http.post(e.getApiUrl+"EditAccountCustomData",o,{headers:{"Content-Type":"application/json","X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n}}).catch((function(t){window.console.error({error:t})}));case 8:case"end":return i.stop()}}),i)})))()}}},$o=Mo,Lo=(i("06c5b"),Object(C["a"])($o,Do,ko,!1,null,null,null)),Fo=Lo.exports,jo=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderControls"},[e("div",{staticClass:"HeaderControls_wrap"},[e("div",{staticClass:"HeaderControls_visibleStatus",style:{color:t.getGrayColor.color},attrs:{size:27},on:{click:t.hideData}},[e("svgIcon",{attrs:{name:t.visibleData?"Show":"Hidden"}})],1),e("div",{staticClass:"HeaderControls_nightTheme",style:{color:t.getBlueColor.color},attrs:{size:27},on:{click:t.changeTheme}},[e("svgIcon",{attrs:{name:"flat-moon"}})],1),e("HeaderWsStatusWidget"),e("div",{staticClass:"HeaderControls_noti"},[t.getUnreadNotification?e("div",{staticClass:"HeaderControls_countNoti",class:"HeaderControls_countNoti_".concat(t.getActiveTheme),attrs:{title:t.getUnreadNotification},on:{click:function(e){return t.toggleNotifications("order")}}},[e("span",[t._v(t._s(t.getUnreadNotification))])]):t._e(),t.isLoading?e("div",[e("DxLoadIndicator")],1):e("div",{class:"HeaderControls_notiBell_".concat(t.getActiveTheme),on:{click:function(e){return t.toggleNotifications("order")}}},[e("svgIcon",{attrs:{name:"new-bell",size:28}})],1)]),e("div",{staticClass:"HeaderControls_avatar",on:{click:t.goToPersonalArea}},[e("Avatar",{key:t.getAvatatUrl,attrs:{src:t.getAvatatUrl,theme:t.getActiveTheme}})],1),e("div",{staticClass:"HeaderControls_dropdownBtn",class:"HeaderControls_dropdownBtn_".concat(t.getActiveTheme),on:{click:function(e){return t.toggle("isOpenUserMenu")}}},[e("svgIcon",{attrs:{name:"Menu-dot"}}),t.isOpenUserMenu?e("div",{staticClass:"HeaderControls_dropdown"},[e("DxPopup",{attrs:{visible:t.isOpenUserMenu,shading:!1,showTitle:!1,width:"180px",height:"auto",container:".HeaderControls",position:{my:"top right",at:"bottom right",of:".HeaderControls"},closeOnOutsideClick:t.setStatusUserMenu}},[e("HeaderUserMenu",{on:{clickOutside:function(e){return t.toggle("isOpenUserMenu")}}})],1)],1):t._e()],1)],1)])},Ro=[],Wo=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderUserMenu",class:"HeaderUserMenu_".concat(t.getActiveTheme)},[t._l(t.getItemsProfileMenu,(function(i,o){return e("div",{key:o,staticClass:"HeaderUserMenu-item",class:"HeaderUserMenu-item_".concat(t.getActiveTheme),on:{click:function(e){return t.setHendler(i.hendler)}}},[e("div",{staticClass:"HeaderUserMenu-itemIcon",class:"HeaderUserMenu-itemIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:i.iconName}})],1),e("div",{staticClass:"HeaderUserMenu-itemText",class:"HeaderUserMenu-itemText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.btnText)))]),i.checkbox?e("Toggle",{attrs:{value:i.value},on:{toggle:function(e){return t.setHendler(i.hendler)}}}):t._e()],1)})),t.langSwitch?e("div",{staticClass:"HeaderUserMenu-langChecker"},[e("div",{staticClass:"HeaderUserMenu-item",class:"HeaderUserMenu-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderUserMenu-itemIcon"},[e("svgIcon",{attrs:{name:"flag-".concat(this.getActiveLangCode)}})],1),e("div",{staticClass:"HeaderUserMenu-itemText",class:"HeaderUserMenu-itemText_".concat(t.getActiveTheme)},[t._v(t._s(t.getActiveLang))]),t.getItemsLang?e("div",{staticClass:"HeaderUserMenu-ddLang",class:"HeaderUserMenu-ddLang_".concat(t.getActiveTheme),on:{click:t.openLangCheck}},[e("svgIcon",{attrs:{name:"Arrow-dropdown-bottom"}})],1):t._e()])]):t._e(),e("DxPopup",{attrs:{visible:t.statusLangCheck,container:".HeaderControls",position:{my:"top right",at:"bottom right",of:".HeaderUserMenu"},shading:!1,showTitle:!1,width:"140px",height:"auto",closeOnOutsideClick:t.setStatusUserMenu}},t._l(t.getItemsLang,(function(i,o){return e("div",{key:o,staticClass:"HeaderUserMenu-item",class:"HeaderUserMenu-item_".concat(t.getActiveTheme),on:{click:function(e){return t.selectLang(i)}}},[e("div",{staticClass:"HeaderUserMenu-itemIcon"},[e("svgIcon",{attrs:{name:"flag-".concat(i.code)}})],1),e("div",{staticClass:"HeaderUserMenu-itemText",class:"HeaderUserMenu-itemText_".concat(t.getActiveTheme)},[t._v(t._s(i.name))])])})),0)],2)},No=[],Eo=function(){var t=this,e=t._self._c;return e("div",{staticClass:"toggle",class:t.classes,attrs:{role:"checkbox",tabindex:"0","aria-checked":t.toggled},on:{keydown:t.toggle,click:function(e){return e.stopPropagation(),t.toggle.apply(null,arguments)}}},[e("div",{staticClass:"toggle__slide",class:t.getActiveTheme},[e("div",{staticClass:"toggle__switcher",class:t.getActiveTheme})]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.showLabels,expression:"showLabels"}],staticClass:"toggle__label",domProps:{innerHTML:t._s(t.label)}},[t._t("default")],2)])},Uo=[],Vo={data:function(){return{toggled:this.value}},props:{value:{type:Boolean,default:!1},typeToggle:{type:String,required:!1,default:"primary"},disabled:{type:Boolean,default:!1},showLabels:{type:Boolean,default:!1},labelChecked:{type:String,default:""},labelUnchecked:{type:String,default:""}},watch:{value:function(t){this.toggled=!this.toggled,this.toggled=t}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{classes:function(){return"dark"===this.getActiveTheme?{"toggle--checked toggle--primary ":this.toggled&&"primary"===this.typeToggle,"toggle--unchecked toggle--primary ":!this.toggled&&"primary"===this.typeToggle,"toggle--checked toggle--secondary ":this.toggled&&"secondary"===this.typeToggle,"toggle--unchecked toggle--secondary ":!this.toggled&&"secondary"===this.typeToggle,disabled:this.disabled}:{"toggle--checked toggle--primary":this.toggled&&"primary"===this.typeToggle,"toggle--unchecked toggle--primary":!this.toggled&&"primary"===this.typeToggle,"toggle--checked toggle--secondary":this.toggled&&"secondary"===this.typeToggle,"toggle--unchecked toggle--secondary":!this.toggled&&"secondary"===this.typeToggle,disabled:this.disabled}},label:function(){return this.toggled&&this.showLabels?this.labelChecked:this.labelUnchecked}}),methods:{toggle:function(t){this.disabled||t.keyCode,this.toggled=!this.toggled,this.$emit("toggle",this.toggled)}}},Ho=Vo,Go=(i("2348"),Object(C["a"])(Ho,Eo,Uo,!1,null,null,null)),qo=Go.exports,zo=[{name:"Русский",code:"ru"},{name:"English",code:"en"}],Yo="false",Xo={components:{Toggle:qo,DxPopup:wt["DxPopup"]},data:function(){return{statusLangCheck:!1,langSwitch:+Yo}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme",getChatAuth:"chat/getChatAuth",getApiChatUrl:"api/apiChat"})),{},{getItemsLang:function(){var t=this;if(this.getActiveLangCode)return zo.filter((function(e){return e.code!==t.getActiveLangCode}))},getActiveLang:function(){if(this.getUserSettings){var t=this.getUserSettings.lang?this.getUserSettings.lang.name:"Русский";return t}},getActiveLangCode:function(){if(this.getUserSettings){var t=this.getUserSettings.lang?this.getUserSettings.lang.code:"ru";return t}},getStatusSignalNotification:function(){if(this.getUserSettings)return void 0===this.getUserSettings.notiSignal||this.getUserSettings.notiSignal},getItemsProfileMenu:function(){return[{btnText:"personal_area",iconName:"my-profile-flat",checkbox:!1,method:"personalArea",hendler:"goToPersonalArea"},{btnText:"about_the_project",iconName:"cursive-i",checkbox:!1,hendler:"goToAbout"},{btnText:"exit",iconName:"flat-exit",checkbox:!1,hendler:"logout"},{btnText:"sound_on_off",iconName:"flat-sound",checkbox:!0,hendler:"setSignalNoti",value:this.getStatusSignalNotification},{btnText:"night_mode",iconName:"flat-moon",checkbox:!0,hendler:"changeTheme",value:"dark"===this.getActiveTheme}]}}),methods:{setSignalNoti:function(){this.$store.commit("userSettings/redactSettings",{widget:"notiSignal",data:!this.getStatusSignalNotification})},openLangCheck:function(){this.statusLangCheck=!this.statusLangCheck},setStatusUserMenu:function(t){var e=t.originalEvent.target.closest(".HeaderControls");e||(this.isOpenUserMenu=!1,this.$emit("clickOutside"))},logoutChat:function(){this.$http.post(this.getApiChatUrl+"logout",{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-Type":"application/json"}})},logout:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$workStorage.removeSession();case 2:localStorage.clear(),sessionStorage.clear(),t.$store.dispatch("auth/exitAuth"),t.$store.dispatch("chat/authChatForGuest"),t.logoutChat(),"Trading"!==t.$router.currentRoute.name&&t.$router.push({name:"Trading"}),t.$router.go(t.$router.currentRoute);case 9:case"end":return e.stop()}}),e)})))()},selectLang:function(t){this.$store.commit("userSettings/redactSettings",{widget:"lang",data:{name:t.name,code:t.code}}),this.$i18n.locale=t.code},goToPersonalArea:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalMyData"}}).catch((function(t){return t}))},changeTheme:function(){this.$store.dispatch("headerSettings/redactSettings",{mutation:"changeActiveTheme",data:"dark"===this.getActiveTheme?"light":"dark"})},goToAbout:function(){window.open("https://about.toptrader.ru","_blank")},setHendler:function(t){this[t]()}}},Qo=Xo,Jo=(i("7254"),Object(C["a"])(Qo,Wo,No,!1,null,"6b2171f4",null)),Ko=Jo.exports,Zo=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderConnectionStatusWidget",class:"HeaderConnectionStatusWidget_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConnectionStatusWidget-item",class:"HeaderConnectionStatusWidget-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConnectionStatusWidget-icon",style:{color:t.getStatusServer?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:"Devices"}})],1),e("div",{staticClass:"HeaderConnectionStatusWidget-name",class:"HeaderConnectionStatusWidget-name_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("server_connection")))]),e("div",{staticClass:"HeaderConnectionStatusWidget-status",style:{color:t.getStatusServer?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:t.getStatusServer?"Check":"Close"}})],1)]),e("div",{staticClass:"HeaderConnectionStatusWidget-item",class:"HeaderConnectionStatusWidget-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConnectionStatusWidget-icon",style:{color:t.getChatStatus?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:"Chat"}})],1),e("div",{staticClass:"HeaderConnectionStatusWidget-name",class:"HeaderConnectionStatusWidget-name_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chat_connection")))]),e("div",{staticClass:"HeaderConnectionStatusWidget-status",style:{color:t.getChatStatus?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:t.getChatStatus?"Check":"Close"}})],1)]),e("div",{staticClass:"HeaderConnectionStatusWidget-item",class:"HeaderConnectionStatusWidget-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConnectionStatusWidget-icon",style:{color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"VideoOn"}})],1),e("div",{staticClass:"HeaderConnectionStatusWidget-name",class:"HeaderConnectionStatusWidget-name_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("streaming")))]),e("div",{staticClass:"HeaderConnectionStatusWidget-status",style:{color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Check"}})],1)]),e("div",{staticClass:"HeaderConnectionStatusWidget-item",class:"HeaderConnectionStatusWidget-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderConnectionStatusWidget-icon",style:{color:t.getOrangeColor.color}},[e("svgIcon",{attrs:{name:"Webinar"}})],1),e("div",{staticClass:"HeaderConnectionStatusWidget-name",class:"HeaderConnectionStatusWidget-name_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("vcac")))]),e("div",{staticClass:"HeaderConnectionStatusWidget-status",style:{color:t.getOrangeColor.color}},[e("svgIcon",{attrs:{name:"Alarm"}})],1)])])},tn=[],en={mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatusWs:"connectionStatus/getStatusWs",getConnections:"connectionStatus/getConnections",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatusServer:function(){if(this.getConnections){var t=["apiWS","apiWS_NOTI","apiWS3","apiWS2"],e=this.getConnections.filter((function(e){return"connect"===e.status&&t.some((function(t){return t===e.ws}))}));return t.length===e.length}},getChatStatus:function(){if(this.getConnections){var t=this.getConnections.find((function(t){return"chatWS"===t.ws}));return!!t&&"connect"===t.status}}})},on=en,nn=(i("24b1"),Object(C["a"])(on,Zo,tn,!1,null,"bfdec478",null)),sn=nn.exports,rn=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderWsStatusWidget_statusWsConnect",on:{mouseenter:t.showStatus,mouseleave:t.showStatus}},[t.getStatusWs?e("div",{staticClass:"HeaderWsStatusWidget_statusWsConnect-on",style:{color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Connection_ON",size:27}})],1):e("div",{staticClass:"HeaderWsStatusWidget_statusWsConnect-off",style:{color:t.getRedColor.color},attrs:{size:27}},[e("svgIcon",{attrs:{name:"Connection_OFF"}})],1),e("DxPopup",{attrs:{visible:t.statusConnection,shading:!1,showTitle:!1,width:"170px",height:"auto",container:".HeaderControls",position:{my:"top right",at:"bottom right",of:".HeaderWsStatusWidget_statusWsConnect"}}},[e("HeaderConnectionStatusWidget")],1)],1)},an=[],cn={name:"HeaderWsStatusWidget",components:{HeaderConnectionStatusWidget:sn,DxPopup:wt["DxPopup"]},mixins:[qe],data:function(){return{statusConnection:!1}},computed:Object(c["a"])({},Object(p["c"])({getStatusWs:"connectionStatus/getStatusWs"})),methods:{showStatus:function(){this.statusConnection=!this.statusConnection}}},ln=cn,un=(i("92eb"),Object(C["a"])(ln,rn,an,!1,null,"4f68bba8",null)),dn=un.exports,hn={name:"HeaderControls",components:{HeaderWsStatusWidget:dn,Avatar:E,DxTooltip:wt["DxTooltip"],DxPopup:wt["DxPopup"],DxLoadIndicator:wt["DxLoadIndicator"],HeaderUserMenu:Ko,HeaderConnectionStatusWidget:sn},mixins:[qe],data:function(){return{isOpenUserMenu:!1}},props:{visibleData:{type:Boolean,default:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({userDetails:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme",unreadNotificationsCount:"notifications/unreadNotificationsCount",getUnreadNotification:"notifications/getUnreadNotification",isLoading:"notifications/isLoading"})),{},{getTooltip:function(){return this.$t("btnsLibrary0")},getAvatatUrl:function(){var t;return null===(t=this.userDetails)||void 0===t?void 0:t.avatarURL}}),methods:{setStatusUserMenu:function(t){var e=t.originalEvent.target.closest(".HeaderControls");e||(this.isOpenUserMenu=!1)},hideData:function(){this.$emit("hideData",!this.visibleData)},changeTheme:function(){this.$store.dispatch("headerSettings/redactSettings",{mutation:"changeActiveTheme",data:"dark"===this.getActiveTheme?"light":"dark"})},goToPersonalArea:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalMyData"}}).catch((function(t){return t}))},toggle:function(t){this[t]=!this[t]},toggleNotifications:function(t){this.$store.dispatch("modal/switchNotifications",t)}}},pn=hn,gn=(i("fa6b"),Object(C["a"])(pn,jo,Ro,!1,null,null,null)),fn=gn.exports,mn=function(){var t=this,e=t._self._c;return e("div",{ref:"setWrap",class:t.getStatusAllSetWidgetsWidth?"HeaderWidgetsSet":"HeaderWidgetsSet HeaderWidgetsSet-hidden"},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__fadeIn","leave-active-class":"animate__animated animate__fadeOut"}},[t.getStatusAllSetWidgetsWidth?t._e():e("div",{staticClass:"HeaderWidgetsSet-shadow",class:"HeaderWidgetsSet-shadow_".concat(t.getActiveTheme)})]),e("div",{key:t.getCountVisibleWidgets,staticClass:"HeaderWidgetsSet-wrapper",on:{mouseenter:t.moveWidgetPopup,mouseleave:t.moveHideWidgetPopup,click:t.clickWidgetPopup}},[t.getListVisibleWidgets&&t.getListVisibleWidgets.length?t._e():e("div",{staticClass:"HeaderWidgetsSet-shadow",class:"HeaderWidgetsSet-shadow_".concat(t.getActiveTheme)}),t._l(t.setWidget,(function(i,o){return t.getListVisibleWidgets&&t.getListVisibleWidgets.length?t._e():e("div",{key:o,staticClass:"HeaderWidgetSetItem",class:"HeaderWidgetSetItem_".concat(t.getActiveTheme)},[e(i.component,{tag:"component",attrs:{title:t.$t(i.title),authStatus:t.authStatus,data:i.data},on:{setWidthWidget:function(e){return t.setWidthWidget(e,o)}}})],1)})),t._l(t.getListVisibleWidgets,(function(i,o){return t.getListVisibleWidgets&&t.getListVisibleWidgets.length?e("div",{key:"".concat(o,"_list_").concat(t.visibleData),staticClass:"HeaderWidgetSetItem",class:"HeaderWidgetSetItem_".concat(t.getActiveTheme)},[e(i.component,{tag:"component",attrs:{visibleData:t.visibleData,authStatus:t.authStatus,title:t.$t(i.title),data:i.data},on:{setWidthWidget:function(e){return t.setWidthWidget(e,o)}}})],1):t._e()}))],2),t.widgetPopup?e("DxPopup",{attrs:{visible:t.widgetPopup,showTitle:!1,shading:!1,container:".HeaderWidgetsSet-wrapper",position:{my:"top center",at:"bottom center",of:".HeaderWidgetsSet",offset:{y:0}},width:"auto",maxHeight:"70vh",height:"auto"}},[e("HeaderStatModal",{attrs:{authStatus:t.authStatus},on:{openConfigModal:t.openConfigModal,clickOutSide:t.hideWidgetPopup}})],1):t._e(),t.configModal?e("DxPopup",{attrs:{visible:t.configModal,showTitle:!1,width:"360px",shadingColor:"rgba(0,0,0,0.2)",shading:!1,position:{my:"top center",at:"bottom center",of:".HeaderWidgetsSet",offset:{y:0}},maxHeight:"70vh",height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("HeaderConfigModal",{attrs:{authStatus:t.authStatus},on:{close:t.closeConfigMenu}})]},proxy:!0}],null,!1,191599457)}):t._e()],1)},vn=[],yn=(i("13d5"),i("159b"),{data:function(){return{observerElem:null,resizeObserver:null}},watch:{observerElem:function(t){t&&this.initObserver()}},methods:{initObserver:function(){var t=new ResizeObserver(this.onResize);t.observe(this.observerElem),this.resizeObserver=t}},beforeDestroy:function(){this.resizeObserver&&this.resizeObserver.unobserve(this.observerElem)}}),Cn=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getBalance?t.getBalance.length:t.getBalance,attrs:{title:"balance",data:t.getBalance,visibleData:t.visibleData,colors:[t.getBlueColor.color]},on:{setWidthWidget:t.setWidthWidget}})},bn=[],Sn=function(){var t=this,e=t._self._c;return e("div",{ref:"widgetWrap",staticClass:"HeaderWidgetTemplate"},[e("div",{staticClass:"HeaderWidgetTemplate-title",class:"HeaderWidgetTemplate-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(t.title)))]),t.data?e("div",{class:t.visibleData?"HeaderWidgetTemplate-data":"HeaderWidgetTemplate-data HeaderWidgetTemplate-data_hidden"},t._l(t.data,(function(i,o){return e("span",{key:o,style:{color:t.colors[o]}},[t._v(" "+t._s(i))])})),0):t._e()])},Pn=[],Tn={props:{data:{default:null},visibleData:{type:Boolean,default:!0},title:{type:String,default:""},colors:{type:Array}},data:function(){return{widgetWidth:null}},mixins:[yn],computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{onResize:function(t){null!==this.data&&(this.widgetWidth=t[0].borderBoxSize?t[0].borderBoxSize[0].inlineSize:t[0].contentRect.width+8,this.$emit("setWidthWidget",this.widgetWidth))}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.widgetWrap}))}},xn=Tn,On=(i("5afa"),Object(C["a"])(xn,Sn,Pn,!1,null,"a1bcbeda",null)),wn=On.exports,_n={props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},components:{HeaderWidgetTemplate:wn},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getBalance:function(){if(!this.authStatus)return["$".concat(this.$moneyf(1e5,0))];if(this.getDataForWidgets){var t=this.getDefaultAccount.currencyChar,e=this.getDataForWidgets.balance;return["".concat(t).concat(this.$moneyf(e,2))]}},getBalanceColor:function(){return[this.getBlueColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},An=_n,Dn=(i("8bf4"),Object(C["a"])(An,Cn,bn,!1,null,"0d24e702",null)),kn=Dn.exports,In=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderStatModal",class:"HeaderStatModal_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderStatModal-wrapper"},[e("div",{staticClass:"HeaderStatModal-column"},t._l(t.getFirstColumnWidgets,(function(i,o){return e("div",{key:o,staticClass:"HeaderStatModal-row"},[e("div",{staticClass:"HeaderStatModal-rowTitle",class:"HeaderStatModal-rowTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.title)))]),e("div",{staticClass:"HeaderStatModal-rowData",style:{color:t.getWidgetColor(i.color)}},t._l(t.getWidgetData(i.data),(function(o,n){return e("span",{key:n,style:{color:t.getWidgetColor(i.color)[n]}},[t._v(" "+t._s(o))])})),0)])})),0),e("div",{staticClass:"HeaderStatModal-column"},t._l(t.getSecondColumnWidgets,(function(i,o){return e("div",{key:o,staticClass:"HeaderStatModal-row"},[e("div",{staticClass:"HeaderStatModal-rowTitle",class:"HeaderStatModal-rowTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.title)))]),e("div",{staticClass:"HeaderStatModal-rowData"},t._l(t.getWidgetData(i.data),(function(o,n){return e("span",{key:n,style:{color:t.getWidgetColor(i.color)[n]}},[t._v(" "+t._s(o))])})),0)])})),0),t.orders?e("div",{staticClass:"HeaderStatModal-column"},[e("div",{staticClass:"HeaderStatModal-columnTitle",class:"HeaderStatModal-columnTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("ibot")))]),e("VuePerfectScrollbar",{staticClass:"HeaderStatModal-rowWrap"},t._l(t.getDataOrders,(function(i,o){return e("div",{key:o,staticClass:"HeaderStatModal-rowContract"},[e("div",{staticClass:"HeaderStatModal-rowTitle",class:"HeaderStatModal-rowTitle_".concat(t.getActiveTheme)},[t._v(t._s(i.contract))]),e("div",{staticClass:"HeaderStatModal-rowContractData",style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(i.count))]),e("div",{staticClass:"HeaderStatModal-rowContractData",style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},[i.volumeClear?e("div",[t._v(t._s("".concat(i.volume)))]):e("DxLoadIndicator",{attrs:{width:"15px",height:"15px"}})],1),e("div",{staticClass:"HeaderStatModal-rowContractData",style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profit,2))))])])})),0),e("div",{staticClass:"HeaderStatModal-columnCalc",class:"HeaderStatModal-columnCalc_".concat(t.getActiveTheme),style:{color:t.getCalcProfitByOpenorders.profit<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"HeaderStatModal-columnCalc-directIcon"},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directionOpenOrders,"_direct"),size:14}})],1),e("div",{staticClass:"HeaderStatModal-columnCalc-data"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCalcProfitByOpenorders.profit),"/").concat(t.$moneyf(t.getCalcProfitByOpenorders.percent,Math.abs(t.getCalcProfitByOpenorders.percent)<.01?5:2),"%")))]),e("div",{staticClass:"HeaderStatModal-columnCalc-title"},[e("div",{staticClass:"HeaderStatModal-columnCalc-titleText",class:"HeaderStatModal-columnCalc-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("PLbot")))])])])],1):t._e(),t.getListInvestPortfolios?e("div",{staticClass:"HeaderStatModal-column"},[e("div",{staticClass:"HeaderStatModal-columnTitle",class:"HeaderStatModal-columnTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("income_from_investments")))]),e("VuePerfectScrollbar",{staticClass:"HeaderStatModal-rowWrap"},t._l(t.getListInvestPortfolios,(function(i,o){return e("div",{key:o,staticClass:"HeaderStatModal-row"},[e("div",{staticClass:"HeaderStatModal-rowWithAvatar"},[i.avatar?e("div",{staticStyle:{"margin-right":"0.4rem"}},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"1.9"}})],1):t._e(),e("div",{staticClass:"HeaderStatModal-rowTitle",class:"HeaderStatModal-rowTitle_".concat(t.getActiveTheme)},[t._v(t._s(i.name))])]),e("div",{staticClass:"HeaderStatModal-rowData",style:{color:i.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profitAbs,2),"/").concat(i.percent,"%")))])])})),0),e("div",{staticClass:"HeaderStatModal-columnCalc",class:"HeaderStatModal-columnCalc_".concat(t.getActiveTheme),style:{color:t.getCalcProfitByInvesting.profit<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"HeaderStatModal-columnCalc-directIcon"},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directionProfitProtfolios,"_direct"),size:14}})],1),e("div",{staticClass:"HeaderStatModal-columnCalc-data"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCalcProfitByInvesting.profit),"/").concat(t.$moneyf(t.getCalcProfitByInvesting.percent,Math.abs(t.getCalcProfitByInvesting.percent)<.01?5:2),"%")))]),e("div",{staticClass:"HeaderStatModal-columnCalc-title"},[e("div",{staticClass:"HeaderStatModal-columnCalc-titleText",class:"HeaderStatModal-columnCalc-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("current_income")))])])])],1):t._e()]),t.authStatus?e("div",{staticClass:"HeaderStatModal-footer",class:"HeaderStatModal-footer_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderStatModal-footerIcon",style:{color:t.getBlueColor.color},on:{click:t.openConfigModal}},[e("svgIcon",{attrs:{name:"Settings"}})],1),e("div",{staticClass:"HeaderStatModal-footerTitle"},[t._v(t._s(t.$t("sodiitots")))]),e("div",{staticClass:"HeaderStatModal-clickConfig",class:"HeaderStatModal-clickConfig_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderStatModal-clickConfig_text"},[t._v(t._s(t.$t("display")))]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.viewMethod,expression:"viewMethod"}],attrs:{type:"radio",value:"move"},domProps:{checked:t._q(t.viewMethod,"move")},on:{change:function(e){t.viewMethod="move"}}}),e("span",{staticClass:"pseudo",class:"pseudo_".concat(t.getActiveTheme)}),e("span",{staticClass:"textRadio",class:"textRadio_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("on_hover")))])]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.viewMethod,expression:"viewMethod"}],attrs:{type:"radio",value:"click"},domProps:{checked:t._q(t.viewMethod,"click")},on:{change:function(e){t.viewMethod="click"}}}),e("span",{staticClass:"pseudo",class:"pseudo_".concat(t.getActiveTheme)}),e("span",{staticClass:"textRadio",class:"textRadio_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("by_click")))])])])]):t._e()])},Bn=[],Mn=[{component:null,title:"account_creation_date",data:"getRegistrationDate",color:"getRegistrationDateColor",status:!1,auth:!0},{component:null,title:"tbsd",data:"getTradersDay",color:"getTradersDayColor",status:!1,auth:!0},{component:null,title:"replenishments_withdrawals",data:"getDepositsAndWithdraws",color:"getDepositsAndWithdrawsColor",status:!1,auth:!1},{component:"BalanceHeaderWidget",title:"balance",data:"getBalance",color:"getBalanceColor",status:!0,auth:!1},{component:"EquityHeaderWidget",title:"equity",data:"getEquity",color:"getEquityColor",status:!0,auth:!1},{component:"PLHeaderWidget",title:"pl",data:"getPL",color:"getPLColor",status:!0,auth:!1},{component:"CurrentDDHeaderWidget",title:"current_drawdown",data:"getCurrentDD",color:"getCurrentDD",status:!0,auth:!1},{component:"MarginHeaderWidget",title:"margin_occupied",data:"getMargin",color:"getMarginColor",status:!0,auth:!1},{component:"FreeMarginHeaderWidget",title:"margin_available",data:"getFreeMargin",color:"getFreeMarginColor",status:!0,auth:!1},{component:"MaxLeverageHeaderWidget",title:"leverage",data:"getLeverage",color:"getLeverageColor",status:!0,auth:!1},{component:"MaxDDHeaderWidget",title:"max_drawdown",data:"getMaxDD",color:"getMaxDDColor",status:!0,auth:!1},{component:"ClearProfitHeaderWidget",title:"net_profit",data:"getClearProfit",color:"getClearProfitColor",status:!0,auth:!1},{component:"PercentProfitHeaderWidget",title:"successful_trades",data:"getPercentProfit",color:"getPercentProfitColor",status:!0,auth:!1},{component:"ProfitFactorHeaderWidget",title:"profit_factor",data:"getProfitFactor",color:"getProfitFactorColor",status:!0,auth:!1},{component:"RecoveryFactorHeaderWidget",title:"recovery_factor",data:"getRecoveryFactor",color:"getRecoveryFactorColor",status:!0,auth:!1},{component:"SharpHeaderWidget",title:"sharpe_ratio",data:"getSharp",color:"getSharpColor",status:!0,auth:!1},{component:"SubsCountHeaderWidget",title:"copying",data:"getSubsCount",color:"getSubsCountColor",status:!0,auth:!0},{component:"InvestMoneyHeaderWidget",title:"funds_under_management",data:"getInvestMoney",color:"getInvestMoneyColor",status:!0,auth:!0},{component:"SubscribeHeaderWidget",title:"tt_subscription",data:"getSubscribe",color:"getSubscribeColor",status:!0,auth:!0},{component:null,title:"closed_trades",data:"getCountClosedOrders",color:"getCountClosedOrdersColor",status:!1,auth:!1},{component:null,title:"profitable_closed_trades",data:"getCountProfitOrders",color:"getCountProfitOrdersColor",status:!1,auth:!1},{component:null,title:"unprofitable_closed_trades",data:"getCountNoProfitOrders",color:"getCountNoProfitOrdersColor",status:!1,auth:!1},{component:null,title:"apptd",data:"getAvgProfitByOrder",color:"getAvgProfitByOrderColor",status:!1,auth:!1},{component:null,title:"apptp",data:"getAvgProfitPipByOrder",color:"getAvgProfitPipByOrderColor",status:!1,auth:!1}],$n={data:function(){return{serviceName:"Site Plus",serviceNameDemo:"Site Free"}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserPaymentServices:"paymentService/getUserPaymentServices",getPaymentReference:"paymentService/getPaymentReference",getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime"})),{},{payPeriod:function(){var t,e=this;if(null===(t=this.getUserPaymentServices)||void 0===t||!t.length)return!1;var i=this.getPaymentReference.services.find((function(t){return t.name===e.serviceName})),o=this.getUserPaymentServices.filter((function(t){var o=t.serviceId===i.id,n=t.accountId===e.getDefaultAccount.id,s=t.startDateTime,r=!t.stopDateTime||new Date(e.getServerTime.now).getTime()new Date(s.startDateTime).getTime()&&(s=t)}));var r=new Date(s.stopDateTime).getTime(),a=new Date(this.getServerTime.now).getTime(),c=r-a,l=Math.floor(c/1e3/60/60/24),u=Math.floor(c/1e3/60/60)%24;return{days:l,hours:u}}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getInvoiceByFilter:"paymentService/getInvoiceByFilter",getPaymentService:"paymentService/getPaymentService",setPendingStatus:"modalPay/setPendingStatus"})),{},{needPay:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.demoPeriod){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,t.getPaymentService({id:t.getDefaultAccount.id,isUserId:!1});case 4:return e.abrupt("return",!t.payPeriod);case 5:case"end":return e.stop()}}),e)})))()},pendingStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getInvoiceByFilter();case 2:o=i.sent,n=o.find((function(e){return e.userServiceId===t})),e.setPendingStatus("InProgrss"===(null===n||void 0===n?void 0:n.status));case 5:case"end":return i.stop()}}),i)})))()}})},Ln={data:function(){return{percentMargin:0,percentFreeMargin:0,percent:0,moscowTime:null,tokyoTime:null,sydneyTime:null,frankfurtTime:null,londonTime:null,newYorkTime:null,timeInterval:null,pl:0}},mixins:[qe,$n],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount",getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getCurrencyChar:function(){return this.getDefaultAccount?this.getDefaultAccount.currencyChar:""},getSubscribe:function(){var t,e;if(!this.demoPeriod&&!this.payPeriod)return["Закончился"];var i=null===(t=this.remainedTime)||void 0===t?void 0:t.days,o=null===(e=this.remainedTime)||void 0===e?void 0:e.hours;return"number"===typeof i?["".concat(i).concat(this.$t("d")," ").concat(o).concat(this.$t("h"))]:[""]},getSubscribeColor:function(){return[this.getGreenColor.color]},getBalance:function(){if(!this.authStatus)return["$".concat(this.$moneyf(1e5,0))];if(this.getDataForWidgets){var t=this.getDataForWidgets.balance;return["".concat(this.getCurrencyChar).concat(this.$moneyf(t,2))]}},getBalanceColor:function(){return[this.getBlueColor.color]},getMaxDD:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.$moneyf(this.getDataForWidgets.maxDDBalance,2),"%")]:void 0:["".concat(this.$moneyf(0,2),"%")]},getEquity:function(){if(!this.authStatus)return["$".concat(this.$moneyf(1e5,0))];if(this.getDataForWidgets){var t=this.getDataForWidgets.equity;return["".concat(this.getCurrencyChar).concat(this.$moneyf(t,2))]}},getEquityColor:function(){return[this.getGreenColor.color]},getRegistrationDate:function(){return this.authStatus?this.getDefaultAccount?[new Date(this.getDefaultAccount.registrationDate).toLocaleDateString("ru")]:void 0:[(new Date).toLocaleDateString("ru")]},getTradersDay:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.tradesDays]:void 0:[1]},getTradersDayColor:function(){return[this.getBlueColor.color]},getDepositsAndWithdraws:function(){if(!this.authStatus)return[this.$moneyf(1e4,0),"/",this.$moneyf(0,0)];if(this.getDataForWidgets){var t=this.getDataForWidgets.deposits.reduce((function(t,e){return t+e[1]}),0),e=this.getDataForWidgets.withdraws.reduce((function(t,e){return t+e[1]}),0);return[this.$moneyf(t,0),"/",this.$moneyf(e,0)]}},getCountClosedOrders:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.ordersCount?this.getDataForWidgets.ordersCount:0]:void 0:[0]},getCountProfitOrders:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.getDataForWidgets.positiveOrdersCount?this.getDataForWidgets.positiveOrdersCount:0,"(").concat(this.$moneyf(this.getDataForWidgets.procPosOrders,2),"%)")]:void 0:[0]},getCountNoProfitOrders:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.getDataForWidgets.ordersCount-this.getDataForWidgets.positiveOrdersCount,"(").concat(this.$moneyf(100-this.getDataForWidgets.procPosOrders,2),"%)")]:void 0:["".concat(0,"(",this.$moneyf(0,2),"%)")]},getAvgProfitByOrder:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.avgProfit,2)]:void 0:[this.$moneyf(0,2)]},getAvgProfitPipByOrder:function(){return this.authStatus?this.getDataForWidgets?[Math.round(this.getDataForWidgets.avgPipByOrders,2)]:void 0:[this.$moneyf(0,2)]},getAvgProfitPipByOrderColor:function(){return this.authStatus?this.getDataForWidgets?[this.getAvgProfitPipByOrder<0?this.getRedColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getAvgProfitByOrderColor:function(){return this.authStatus?this.getDataForWidgets?[this.getAvgProfitByOrder<0?this.getRedColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getCountClosedOrdersColor:function(){return[this.getBlueColor.color]},getCountNoProfitOrdersColor:function(){return[this.getRedColor.color]},getCountProfitOrdersColor:function(){return[this.getPercentProfitColor]},getDepositsAndWithdrawsColor:function(){return[this.getGreenColor.color,this.getGrayColor.color,this.getRedColor.color]},getRegistrationDateColor:function(){return[this.getBlueColor.color]},getPL:function(){if(!this.authStatus)return this.pl=0,["$".concat(this.$moneyf(this.pl,2))];if(this.getDataForWidgets){var t=this.getDataForWidgets.equity,e=this.getDataForWidgets.balance;return this.pl=t-e,["".concat(this.getCurrencyChar).concat(this.$moneyf(this.pl,Math.abs(this.pl)>=1e4?0:2))]}},getPLColor:function(){return[this.pl<0?this.getRedColor.color:this.getGreenColor.color]},getFreeMargin:function(){if(!this.authStatus)return this.percentFreeMargin=100,["$".concat(this.$moneyf(1e5,0)),"(","".concat("".concat(this.$moneyf(100,0),"%")),")"];if(this.getDataForWidgets){var t=this.getDataForWidgets.marging,e=this.getDataForWidgets.equity,i=e-t;return this.percentFreeMargin=100*i/e,["".concat(this.getCurrencyChar).concat(this.$moneyf(i,i>=1e4?0:2)),"(","".concat("".concat(this.$moneyf(this.percentFreeMargin,2),"%")),")"]}},getMargin:function(){if(!this.authStatus)return this.percentMargin=0,["$".concat(this.$moneyf(0,0)),"(","".concat("".concat(this.$moneyf(0,0),"%")),")"];if(this.getDataForWidgets){var t=this.getDataForWidgets.marging,e=this.getDataForWidgets.equity;return this.percentMargin=100*t/e,["".concat(this.getCurrencyChar).concat(this.$moneyf(t,t>=1e4?0:2)),"(","".concat("".concat(this.$moneyf(this.percentMargin,2),"%")),")"]}},getLeverage:function(){if(!this.authStatus)return[0];if(this.getDefaultAccount&&this.getDataForWidgets){var t=this.getDataForWidgets.leverage,e=this.getDefaultAccount.maxLeverage;return this.percent=t?100*t/e:0,["".concat(t)]}},getSubsCount:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.subsCount,0)]:void 0:[0]},getInvestMoney:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.getCurrencyChar).concat(this.$moneyf(this.getDataForWidgets.investMoney,this.getDataForWidgets.investMoney>=1e4?0:2))]:void 0:["$0"]},getClearProfit:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.getCurrencyChar).concat(this.$moneyf(this.getDataForWidgets.profit,2))]:void 0:["$0"]},getPercentProfit:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.$moneyf(this.getDataForWidgets.procPosOrders,2),"%")]:void 0:["0%"]},getProfitFactor:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.profitFactor,2)]:void 0:[0]},getSharp:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.sharp,2)]:void 0:[0]},getSharpColor:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.sharp<1?this.getRedColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getProfitFactorColor:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.profitFactor<0?this.getRedColor.color:this.getDataForWidgets.profitFactor>=0&&this.getDataForWidgets.profitFactor<=1.5?this.getOrangeColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getRecoveryFactor:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.recoveryFactor,2)]:void 0:[0]},getRecoveryFactorColor:function(){return this.authStatus?this.getDataForWidgets?[this.getBlueColor.color]:void 0:[this.getGreenColor.color]},getPercentProfitColor:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.procPosOrders<=30?this.getRedColor.color:this.getDataForWidgets.procPosOrders>30&&this.getDataForWidgets.procPosOrders<=65?this.getOrangeColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getClearProfitColor:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.profit<0?this.getRedColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]},getMarginColor:function(){var t=this.percentMargin<=30?this.getGreenColor.color:this.percentMargin>30&&this.percentMargin<65?this.getOrangeColor.color:this.getRedColor.color;return[this.getPinkColor.color,this.getGrayColor.color,t,this.getGrayColor.color]},getFreeMarginColor:function(){var t=this.percentFreeMargin<=30?this.getRedColor.color:this.percentFreeMargin>30&&this.percentFreeMargin<65?this.getOrangeColor.color:this.getGreenColor.color;return[this.getPinkColor.color,this.getGrayColor.color,t,this.getGrayColor.color]},getLeverageColor:function(){var t=this.percent<=30?this.getGreenColor.color:this.percent>30&&this.percent<=30?this.getOrangeColor.color:this.getRedColor.color;return[t]},getMaxDDColor:function(){return[this.getRedColor.color]},getSubsCountColor:function(){return[this.getBlueColor.color]},getInvestMoneyColor:function(){return[this.getGreenColor.color]}})};function Fn(t,e){if(t<1e3&&t>=0)return t;if(t>-1e3&&t<0)return t;var i=t;(i>1e3||i<-1e3&&i<0)&&(i=Math.round(i));var o=(""+(i<0?-1*i:i)).length,n=Math.pow;return e=n(10,e),o-=o%3,Math.round(i*e/n(10,o))/e+" kMBTPE"[o/3]}var jn=Mn.filter((function(t){return"TimeHeaderWidget"!==t.component})),Rn={name:"HeaderStatModal",components:{Avatar:E,DxLoadIndicator:wt["DxLoadIndicator"],VuePerfectScrollbar:Xt.a},props:{authStatus:{type:Boolean}},mixins:[Ln,qe],data:function(){return{setWidgets:jn,orders:null,directionOpenOrders:"up",directionProfitProtfolios:"up",investPortolios:null,viewMethod:"moveMethod"}},watch:{getCalcProfitByOpenorders:function(t,e){void 0!==t&&void 0!==e&&(this.directionOpenOrders=t=1e4?0:2))]}},getColor:function(){return this.pl<0?this.getRedColor.color:this.getGreenColor.color}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},ss=ns,rs=(i("ceaf"),Object(C["a"])(ss,is,os,!1,null,"2384a39e",null)),as=rs.exports,cs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getMargin?t.getMargin.length:t.getMargin,attrs:{title:"margin_occupied",data:t.getMargin,visibleData:t.visibleData,colors:[t.getPinkColor.color,t.getGrayColor.color,t.getColorPercent,t.getGrayColor.color]},on:{setWidthWidget:t.setWidthWidget}})},ls=[],us={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],data:function(){return{percentMargin:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getColorPercent:function(){return this.percentMargin<=30?this.getGreenColor.color:this.percentMargin>30&&this.percentMargin<65?this.getOrangeColor.color:this.getRedColor.color},getMargin:function(){if(!this.authStatus)return this.percentMargin=0,["$0","(","0%",")"];if(this.getDataForWidgets){var t=this.getDataForWidgets.marging,e=this.getDataForWidgets.equity,i=this.getDefaultAccount.currencyChar;return this.percentMargin=100*t/e,["".concat(i).concat(this.$moneyf(t,t>=1e4?0:2)),"(","".concat("".concat(this.$moneyf(this.percentMargin,2),"%")),")"]}}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},ds=us,hs=(i("1ecb"),Object(C["a"])(ds,cs,ls,!1,null,"83fde3c2",null)),ps=hs.exports,gs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getFreeMargin?t.getFreeMargin.length:t.getFreeMargin,attrs:{title:"margin_available",visibleData:t.visibleData,data:t.getFreeMargin,colors:[t.getPinkColor.color,t.getGrayColor.color,t.getColorPercent,t.getGrayColor.color]},on:{setWidthWidget:t.setWidthWidget}})},fs=[],ms={props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},components:{HeaderWidgetTemplate:wn},mixins:[qe],data:function(){return{percentFreeMargin:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getColorPercent:function(){return this.percentFreeMargin<=30?this.getRedColor.color:this.percentFreeMargin>30&&this.percentFreeMargin<65?this.getOrangeColor.color:this.getGreenColor.color},getFreeMargin:function(){if(!this.authStatus)return this.percentFreeMargin=100,["$".concat(this.$moneyf(1e5,0)),"(","".concat("".concat(this.$moneyf(100),"%")),")"];if(this.getDataForWidgets){var t=this.getDataForWidgets.marging,e=this.getDataForWidgets.equity,i=this.getDefaultAccount.currencyChar,o=e-t;return this.percentFreeMargin=100*o/e,["".concat(i).concat(this.$moneyf(o,o>=1e4?0:2)),"(","".concat("".concat(this.$moneyf(this.percentFreeMargin,2),"%")),")"]}}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},vs=ms,ys=(i("585c"),Object(C["a"])(vs,gs,fs,!1,null,"a48404da",null)),Cs=ys.exports,bs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.percent,attrs:{title:"leverage",data:t.getLeverage,visibleData:t.visibleData,colors:[t.getColorPercent]},on:{setWidthWidget:t.setWidthWidget}})},Ss=[],Ps={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},data:function(){return{percent:null}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getLeverage:function(){if(!this.authStatus)return this.percent=0,["0"];if(this.getDefaultAccount&&this.getDataForWidgets){var t=this.getDataForWidgets.leverage,e=this.getDefaultAccount.maxLeverage;return this.percent=t?100*t/e:0,["".concat(t)]}},getColorPercent:function(){return this.percent<=30?this.getGreenColor.color:this.percent>30&&this.percent<=30?this.getOrangeColor.color:this.getRedColor.color}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Ts=Ps,xs=(i("6284"),Object(C["a"])(Ts,bs,Ss,!1,null,"c69f547c",null)),Os=xs.exports,ws=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getMaxDD?t.getMaxDD.length:t.getMaxDD,attrs:{title:"max_drawdown",data:t.getMaxDD,visibleData:t.visibleData,colors:[t.getMaxDDColor]},on:{setWidthWidget:t.setWidthWidget}})},_s=[],As={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getMaxDD:function(){return this.authStatus?this.getDataForWidgets?["".concat(this.$moneyf(this.getDataForWidgets.maxDDBalance,2),"%")]:void 0:["".concat(this.$moneyf(0,2),"%")]},getMaxDDColor:function(){return[this.getRedColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Ds=As,ks=(i("b200"),Object(C["a"])(Ds,ws,_s,!1,null,"2398b137",null)),Is=ks.exports,Bs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getCurrentDD?t.getCurrentDD.length:t.getCurrentDD,attrs:{title:"current_drawdown",data:t.getCurrentDD,visibleData:t.visibleData,colors:[t.getCurrentDDColor]},on:{setWidthWidget:t.setWidthWidget}})},Ms=[],$s={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getCurrentDD:function(){if(!this.authStatus)return["".concat(this.$moneyf(0,2),"%")];if(this.getDataForWidgets){var t=this.getDataForWidgets.equity-this.getDataForWidgets.balance,e=t>=0?0:100*t/this.getDataForWidgets.balance;return["".concat(this.$moneyf(Math.abs(e),Math.abs(e)<.01?3:1),"%")]}},getCurrentDDColor:function(){return[this.getRedColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Ls=$s,Fs=(i("c899"),Object(C["a"])(Ls,Bs,Ms,!1,null,"3fde9a82",null)),js=Fs.exports,Rs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getClearProfit?t.getClearProfit.length:t.getClearProfit,attrs:{title:"net_profit",data:t.getClearProfit,visibleData:t.visibleData,colors:t.getClearProfitColor},on:{setWidthWidget:t.setWidthWidget}})},Ws=[],Ns={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getClearProfit:function(){if(!this.authStatus)return["$".concat(this.$moneyf(0,2))];if(this.getDataForWidgets){var t=this.getDataForWidgets.profit,e=this.getDefaultAccount.currencyChar;return["".concat(e).concat(this.$moneyf(t,2))]}},getClearProfitColor:function(){if(!this.authStatus)return[this.getGreenColor.color];if(this.getDataForWidgets){var t=this.authStatus?this.getDataForWidgets.profit:0;return[t<0?this.getRedColor.color:this.getGreenColor.color]}}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Es=Ns,Us=(i("d094"),Object(C["a"])(Es,Rs,Ws,!1,null,"64d9e08a",null)),Vs=Us.exports,Hs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getPercentProfit?t.getPercentProfit.length:t.getPercentProfit,attrs:{title:"successful_trades",data:t.getPercentProfit,visibleData:t.visibleData,colors:t.getPercentProfitColor},on:{setWidthWidget:t.setWidthWidget}})},Gs=[],qs={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getPercentProfit:function(){if(!this.authStatus)return["0%"];if(this.getDataForWidgets){var t=this.getDataForWidgets.procPosOrders;return["".concat(this.$moneyf(t,2),"%")]}},getPercentProfitColor:function(){if(!this.authStatus)return[this.getGreenColor.color];if(this.getDataForWidgets){var t=this.authStatus?this.getDataForWidgets.procPosOrders:0;return[t<=30?this.getRedColor.color:this.getDataForWidgets.procPosOrders>30&&this.getDataForWidgets.procPosOrders<=65?this.getOrangeColor.color:this.getGreenColor.color]}}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},zs=qs,Ys=(i("db4f"),Object(C["a"])(zs,Hs,Gs,!1,null,"2e4afc5c",null)),Xs=Ys.exports,Qs=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getProfitFactor?t.getProfitFactor.length:t.getProfitFactor,attrs:{title:"profit_factor",data:t.getProfitFactor,visibleData:t.visibleData,colors:t.getProfitFactorColor},on:{setWidthWidget:t.setWidthWidget}})},Js=[],Ks={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getProfitFactor:function(){if(!this.authStatus)return["0"];if(this.getDataForWidgets){var t=this.getDataForWidgets.profitFactor;return[this.$moneyf(t,2)]}},getProfitFactorColor:function(){if(!this.authStatus)return[this.getGreenColor.color];if(this.getDataForWidgets){var t=this.getDataForWidgets.profitFactor;return[t<0?this.getRedColor.color:t>=0&&t<=1.5?this.getOrangeColor.color:this.getGreenColor.color]}}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Zs=Ks,tr=(i("ec8b"),Object(C["a"])(Zs,Qs,Js,!1,null,"4b0a09fa",null)),er=tr.exports,ir=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getRecoveryFactor?t.getRecoveryFactor.length:t.getRecoveryFactor,attrs:{title:"recovery_factor",data:t.getRecoveryFactor,visibleData:t.visibleData,colors:t.getRecoveryFactorColor},on:{setWidthWidget:t.setWidthWidget}})},or=[],nr={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getRecoveryFactor:function(){if(!this.authStatus)return["0"];if(this.getDataForWidgets){var t=this.getDataForWidgets.recoveryFactor;return[this.$moneyf(t,2)]}},getRecoveryFactorColor:function(){return[this.getBlueColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},sr=nr,rr=(i("7b4f"),Object(C["a"])(sr,ir,or,!1,null,"57cd1a49",null)),ar=rr.exports,cr=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getSharp?t.getSharp.length:t.getSharp,attrs:{title:"sharpe_ratio",data:t.getSharp,visibleData:t.visibleData,colors:t.getSharpColor},on:{setWidthWidget:t.setWidthWidget}})},lr=[],ur={components:{HeaderWidgetTemplate:wn},props:{visibleData:{type:Boolean,default:!0},authStatus:{type:Boolean}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getSharp:function(){return this.authStatus?this.getDataForWidgets?[this.$moneyf(this.getDataForWidgets.sharp,2)]:void 0:[this.$moneyf(0,2)]},getSharpColor:function(){return this.authStatus?this.getDataForWidgets?[this.getDataForWidgets.sharp<1?this.getRedColor.color:this.getGreenColor.color]:void 0:[this.getGreenColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},dr=ur,hr=(i("947a"),Object(C["a"])(dr,cr,lr,!1,null,"6d3f44f1",null)),pr=hr.exports,gr=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getTimeMoscow?t.getTimeMoscow.length:t.getTimeMoscow,attrs:{title:t.title,data:t.getData(t.data),visibleData:t.visibleData,colors:t.getTimeColor},on:{setWidthWidget:t.setWidthWidget}})},fr=[],mr={data:function(){return{moscowTime:null,tokyoTime:null,sydneyTime:null,frankfurtTime:null,londonTime:null,newYorkTime:null,timeInterval:null}},computed:{getTimeMoscow:function(){if(this.moscowTime)return[this.moscowTime]},getTimeTokyo:function(){if(this.tokyoTime)return[this.tokyoTime]},getTimeSydney:function(){if(this.sydneyTime)return[this.sydneyTime]},getTimeLondon:function(){if(this.londonTime)return[this.londonTime]},getTimeNewYork:function(){if(this.newYorkTime)return[this.newYorkTime]},getTimeFrankfurt:function(){if(this.frankfurtTime)return[this.frankfurtTime]},getTimeColor:function(){return[this.getBlueColor.color]}},methods:{setTime:function(){var t=this;this.timeInterval=setInterval((function(){t.moscowTime=(new Date).toLocaleTimeString("ru",{timeZone:"Europe/Moscow"}),t.tokyoTime=(new Date).toLocaleTimeString("ru",{timeZone:"Asia/Tokyo"}),t.sydneyTime=(new Date).toLocaleTimeString("ru",{timeZone:"Australia/Sydney"}),t.frankfurtTime=(new Date).toLocaleTimeString("ru",{timeZone:"Europe/Paris"}),t.londonTime=(new Date).toLocaleTimeString("ru",{timeZone:"Europe/London"}),t.newYorkTime=(new Date).toLocaleTimeString("ru",{timeZone:"America/New_York"})}))}},mounted:function(){this.setTime()},destroyed:function(){this.timeInterval=null}},vr={props:{visibleData:{type:Boolean,default:!0},data:{},title:{type:String}},components:{HeaderWidgetTemplate:wn},mixins:[qe,mr],methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)},getData:function(t){return this[t]}}},yr=vr,Cr=(i("ae12"),Object(C["a"])(yr,gr,fr,!1,null,"d25153c0",null)),br=Cr.exports,Sr=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getSubsCount?t.getSubsCount.length:t.getSubsCount,attrs:{title:"copying",data:t.getSubsCount,visibleData:t.visibleData,colors:[t.getSubsCountColor]},on:{setWidthWidget:t.setWidthWidget}})},Pr=[],Tr={props:{visibleData:{type:Boolean,default:!0}},components:{HeaderWidgetTemplate:wn},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets"})),{},{getSubsCount:function(){if(this.getDataForWidgets)return[this.$moneyf(this.getDataForWidgets.subsCount,0)]},getSubsCountColor:function(){return[this.getBlueColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},xr=Tr,Or=(i("ecb8"),Object(C["a"])(xr,Sr,Pr,!1,null,"6c66b2ff",null)),wr=Or.exports,_r=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:t.getInvestMoney?t.getInvestMoney.length:t.getInvestMoney,attrs:{title:"funds_under_management",data:t.getInvestMoney,visibleData:t.visibleData,colors:[t.getInvestMoneyColor]},on:{setWidthWidget:t.setWidthWidget}})},Ar=[],Dr={props:{visibleData:{type:Boolean,default:!0}},components:{HeaderWidgetTemplate:wn},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getInvestMoney:function(){if(this.getDataForWidgets){var t=this.getDefaultAccount.currencyChar;return["".concat(t).concat(this.$moneyf(this.getDataForWidgets.investMoney,this.getDataForWidgets.investMoney>=1e4?0:2))]}},getInvestMoneyColor:function(){return[this.getGreenColor.color]}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},kr=Dr,Ir=(i("12e0"),Object(C["a"])(kr,_r,Ar,!1,null,"aaac2220",null)),Br=Ir.exports,Mr=function(){var t=this,e=t._self._c;return e("HeaderWidgetTemplate",{key:JSON.stringify(t.getSubscribe),attrs:{title:t.getTitle,data:t.getSubscribe,visibleData:t.visibleData,colors:t.getSubscribeColor},on:{setWidthWidget:t.setWidthWidget}})},$r=[],Lr={props:{visibleData:{type:Boolean,default:!0}},data:function(){return{serviceName:"Site Plus"}},components:{HeaderWidgetTemplate:wn},mixins:[qe,$n],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserPaymentServices:"paymentService/getUserPaymentServices",getDataForWidgets:"headerSettings/getDataForWidgets",getPaymentReference:"paymentService/getPaymentReference",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getEndSubscribe:function(){var t,e;if(!this.demoPeriod&&!this.payPeriod)return["Закончился"];var i=null===(t=this.remainedTime)||void 0===t?void 0:t.days,o=null===(e=this.remainedTime)||void 0===e?void 0:e.hours;return"number"===typeof i?["".concat(i).concat(this.$t("d")," ").concat(o).concat(this.$t("h"))]:[""]},getSubscribeColor:function(){var t;if(!this.demoPeriod&&!this.payPeriod)return[this.getRedColor.color];var e=null===(t=this.remainedTime)||void 0===t?void 0:t.days;return e<=2?[this.getRedColor.color]:e<=3?[this.getOrangeColor.color]:[this.getGreenColor.color]},getSubscribe:function(){return this.getEndSubscribe},getTitle:function(){return this.demoPeriodPlusPayPeriod||!this.demoPeriod&&(this.demoPeriod||this.payPeriod)||this.getEndedPeriod?"tt_subscription":"Пробный период"}}),methods:{setWidthWidget:function(t){this.$emit("setWidthWidget",t)}}},Fr=Lr,jr=(i("1219"),Object(C["a"])(Fr,Mr,$r,!1,null,"24c35011",null)),Rr=jr.exports,Wr={props:{visibleData:{type:Boolean},authStatus:{type:Boolean}},components:{DxPopup:To["DxPopup"],HeaderStatModal:En,SubscribeHeaderWidget:Rr,MaxDDHeaderWidget:Is,HeaderConfigModal:Xn,BalanceHeaderWidget:kn,EquityHeaderWidget:es,PLHeaderWidget:as,MarginHeaderWidget:ps,FreeMarginHeaderWidget:Cs,MaxLeverageHeaderWidget:Os,CurrentDDHeaderWidget:js,ClearProfitHeaderWidget:Vs,PercentProfitHeaderWidget:Xs,ProfitFactorHeaderWidget:er,RecoveryFactorHeaderWidget:ar,SharpHeaderWidget:pr,TimeHeaderWidget:br,SubsCountHeaderWidget:wr,InvestMoneyHeaderWidget:Br},mixins:[yn],data:function(){return{setWidth:0,widgetPopup:!1,configModal:!1,setWidget:null,widthAllWidgets:[]}},watch:{getCountVisibleWidgets:function(t){t&&(this.authStatus?this.setWidget=JSON.parse(JSON.stringify(this.getVisibleListWidgets)):this.setWidget=Mn.filter((function(t){return!t.auth})))},getVisibleListWidgets:function(t){t&&(this.authStatus?this.setWidget=JSON.parse(JSON.stringify(this.getVisibleListWidgets)):this.setWidget=Mn.filter((function(t){return!t.auth})))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatViewMethod:"headerSettings/getStatViewMethod",getListWidgets:"headerSettings/getListWidgets",getVisibleListWidgets:"headerSettings/getVisibleListWidgets"})),{},{getCountVisibleWidgets:function(){if(this.getVisibleListWidgets)return this.getVisibleListWidgets.length},getStatusAllSetWidgetsWidth:function(){if(this.setWidget)return this.setWidget.every((function(t){return null===t||void 0===t?void 0:t.width}))},getWidthAllWidgets:function(){return this.widthAllWidgets.length?this.widthAllWidgets.reduce((function(t,e){return t+e}),0):0},getListVisibleWidgets:function(){var t=this;if(!this.getStatusAllSetWidgetsWidth)return[];var e=0,i=[];return this.setWidget.forEach((function(o){e+=o.width,e0&&!t.regStatus?e("DxButton",{key:"prevStep",attrs:{width:"100%",height:"48",text:t.$t("back"),elementAttr:{class:"backButton"}},on:{click:t.prevStep}}):t._e(),t.currentStep+1 Income consists of a fixed fee and a percentage (SF) of subscribers' funds.",sfsrtiittsp:"SF - success rate.
This indicator is the trading signals provider's income from managing or copying on your trading account",scys:"Subscribers copying Your strategy",aomtswraaci:"Amount of money that subscribers with real accounts are currently investing in copying",cpfys:"Consolidated profit from your strategy",ynifcticoaf:"Your net income from copying. This income consists of a fixed fee and a percentage of successful trades",turnover_of_capital:"Turnover of capital",profit_from_copying:"Profit from copying",income_table:"Income table",my_profit:"My profit",order_number:"Order number",opening_time:"Opening time",closing_time:"Closing time",price:"Price",swap:"Swap",closing_price:"Closing price",yabc:"You are being copied",vofi:"Volume of funds invested",your_income:"Your income",copied:"Copied",ctota:"Closed trades on trading account",csdpostfct:"Closed successful deals.
Percentage of successful trades from closed trades",voctota:"Volume of closed trades on trading account",cfrocpip:"Current financial result of closed positions in pips",cfrocpi:"Current financial result of closed positions in percent",cfrocpiudni:"Current financial result of closed positions in US dollars. Net income less commissions.",ypftmotbots:"Your profit from trades made on the basis of trading signals",atpfcs:"Amount to pay for copying signals",tiowthbm:"Trading instruments on which trades have been made",tvofiict:"The volume of funds involved in closed trades",tvofiiot:"The volume of funds involved in open trades",pfytip:"Profit from your trades in PIP",pfyti:"Profit from your trades in percent",pfyti$:"Profit from your trades in $",noswcys:"Number of subscribers who copy your signals",spfys:"Subscribers profit from your signals",ypfcys:"Your profit from copying your signals",spfr:"SF 30% pay for result",tvofiit:"The volume of funds involved in trades",aysywtdtp:"Are you sure you want to delete this portfolio?",aystywtsi:"Are you sure that you want to stop investing?",tanotitp:[function(t){return"There are ".concat(t," open trades in the portfolio!")}," If you stop investing, you will receive a loss:"],yes:"Yes",no:"No",of:"of",today:"Today",event_name:"Event name",event_description:"Event description",copy_event:"Copy event",edit_event:"Edit event",add_event:"Add event",no_events:"No events",you:"You",ctcos:[function(t){return"Canceled the copying of “".concat(t,"“ signals")}],content:"Content",incys:"is now copying your signals",nyacs:[function(t){return"Now you are copying “".concat(t,"“ signals")}],ctcoys:"canceled the copying of your signals",ctsocys:"Changed the settings of copying Your signals",ctsocsf:[function(t){return"Changed the settings of copying signals from “".concat(t,"”")}],stys:"Subscribed to your signals",subscribed_to_signals:[function(t){return"subscribed to “".concat(t,"” signals")}],ufys:"Unsubscribed from your signals",unsubscribed_from_signals:[function(t){return"Unsubscribed from “".concat(t,"“ signals")}],ptif:[function(t){return"Paid the invoice for $ ".concat(t,"")}],ptiffcys:[function(t){return"Paid the invoice for $ ".concat(t," for copying your signals")}],user:"User",expiration:"Expiration",conten_rates:"Content rates",ml5s:"My last 5 subscribers",invested_capital:"Invested capital",my_net_income:"My net income",number:"Number",income_from_copying:"Income from copying",tifct:"Total income from closed trades",assets_under_management:"Assets under management",average_profit_per_trade:"Average profit per trade",yaactpiotaa:"You are already copying this provider. In order to add a provider in your portfolio You need to wait until the end of the copying period or stop copying now in your personal cabinet, but in this case money for the paid period will not be returned",yhsupfytsy:"You haven't set up prices for Your trading signals yet",configure:"Configure",tsba:"Trading signals by account",yhsupfcy:"You haven't set up prices for content yet",user_content:"User content",ltysn:"Links to your social networks",save:"Save",iipt:"Average income per trade",iutct:"Income under the contract",tanot:"There are no open trades",nedfs:"Not enough data for statistics",comparison_by_instruments:"Comparison by instruments",mtsir:"Move the SL when it reaches",at_the_level:"At the level",timeframe:"Timeframe",open:"Open",instruments_catalog:"Instruments catalog",nothing_here_yet:"Nothing here yet!",stdif:"Select the desired instrument from the instruments catalog.",section_in_development:"Section in development",academy:"Academy",tsdas:"This section displays all statistics and analytics on your trades and the trades of trading signals providers. You can also perform trading operations here.",stmaiy:"Select the markets and instruments you are interested in, and the system will build charts and provide relevant information on open and closed positions.",uasofg:"Use a set of graphical tools for analysis, follow the latest news and macroeconomic indicators, streams and video conferences directly on the chart.",otssb:"Observe themarket sentiment set by trading signal providers. Choose the best of them, copy and add them to your portfolios.",market_section:"Market Section",dsam:"Don't show any more",ucee:"Unexpected code execution error.",invalid_operation:" Invalid operation.",npoaes:"No processing of an error situation",ifitatpto:"Insufficient funds in the account to perform the operation",uina:"User is not authorized",nerteto:"Not enough rights to execute the operation",sufdtae:"Service update failed due to an error",tfcasc:"Timeout for completing all service cases",sttaf:"Saving the trading account failed",command_processing_error:"Command processing error",nmowf:"No matching object was found",tinntpaa:"There is no need to perform an action",not_implemented:"Not implemented",tbcip:"Trading by contract is prohibited",no_price:"No price",tpiwtr:"The price is worse than requested",ndtptr:"No dealer to process the request",dealer_disconnected:"Dealer disconnected",tvbmav:"Transaction volume below minimum allowable value",tvgtmva:"Transaction volume greater than maximum value allowed",tvinabs:"Transaction volume is not aligned by step",sotcnf:"Specifications of traded contract not found",sitcttm:"SL is too close to the market",titctm:"TP is too close to market",rpirf:"Request processing is redirected further",non_trade_hours:"Non-trade hours",tddnato:"The dealer did not accept the order",tspotpolinv:"The specified period of the pending order life is not valid",ecooiidtpg:"Execution (closing) of order is impossible due to price gap",tpiotc:"The price is off the charts",qinf:"Quotation is not found",ecosowpe:"Execution (closing) of several orders was partially executed",ttraroass:"Trying to run a request on a stopped Shard",eosdafmtdhb:"Error of simultaneous data access from multiple threads. Data has been changed and is not up to date",trtawnfits:"The requested trading account was not found in the system",trewwnf:"The request exchange wallet was not found",roipftcgc:"Running operation is prohibited for this contract group category",trifi:"The request is formed incorrectly",tmrpm:"Too many requests per minute",too_many_orders:"Too many orders",sms_confirmation_required:"SMS confirmation required",csinc:"Confirmation SMS is not correct",taiaaaa:"The account is already activated and assigned",ahtbltea:"Account have to be linked to existing account",toibplacbma:"The order is being processed, locked and cannot be modified at this time",tmoo:"Too many open orders",tmpo:"Too many pending orders",nbwtiwf:"No broker with this ID was found",nuftbaawf:"No user for this broker and account was found",tcphbattps:"The created portfolio has been added to the “Portfolios“ section.",oo:"out of",lbt:"Limits by trades",tscia:"This section contains information about you and your strategy, detailed trading statistics and analytics for each of your accounts, data on your subscriptions and subscribers, and reports.",apgit:"All Providers get into the Tops subsection - a platform for selling trading signals. Here other users can find and copy trading signals of a provider, as well as add providers to a portfolio and create individual investment solutions based on their area of interest in financial markets.",tbpft:"The best providers form Tops - ready-made solutions for the set of trading signals of one or several providers, which the system forms based on the specified parameters on the instruments and on the % of successful trades.",tscds:"This section contains detailed statistics and analytics on all trading signals portfolios of providers that you create, as well as information on ready-made solutions - Tops",ycsup:"You can set up the test version of the portfolio by selected providers, capital, set up money management and risks, as well as manage active portfolios.",portfolio_section:"Portfolio section",tops_section:"Tops section",profile_section:"Profile section",trscd:"The 'Report' section contains detailed information on each user account for the selected period by day, week or month",sota:"Statistics on the account",hotoo:"History of trading operations on closed and open user positions",iastt:"Information about subscriptions to trading signals of providers, both by instruments and as a part of portfolios",iotus:"Information on the user's subscribers and income from subscriptions",feoua:"For ease of use, all information is presented in a table and graphs with appropriate tips",report_section:"Report section",oropa:"Open trades of providers and the limit of the number of trades available to open on the portfolio",anopaetaa10:"Allowed number of password attempts exceeded. Try again after 10 minutes.",btit:"Broadcast trades in Telegram",cltta:"Channel linked to the account",account_for_broadcasting:"Account for broadcasting",channel_name:"Channel name",tsubo:"To set up broadcasting of reports on your trades to your Telegram channel/group, you need to create a channel/group and add the ",tetno:'Then enter the name of the created group in the field above and click "Connect".',ycact:"You can always change the settings in your ",personal_cabinet:"Personal cabinet",detailed_instruction:"Detailed instruction",connect:"Connect",tcial:"The channel is already linked to another account",btinf:"Bot ttPlatformBot is not found in the channel, or the channel does not exist",top:"Top",available_funds:"Available funds",reserved_amount:"Reserved amount",wpofdyptiit:"What percentage of funds do you plan to invest in the Portfolio?",wpofdyptiii:"What percentage of funds do you plan to invest in the instruments?",iail:"Investment amount including leverage",afpdap:"Allocated funds proportionally distributed among providers",afpdai:"Allocated funds proportionally distributed among instruments",total_contracts:"Total contracts",instruments_for_copying:"Instruments for copying",sisotep:"Select instruments separately or the entire portfolio:",fitf:"Fill in the field",wptbd:'We`ve prepared the best deals for you to invest in. Drag and drop your Top, Portfolio or Provider card here and click "Copy".',iatbo:"In addition, the best offers you will always find in the right side of the site.",start_earning:"Start earning!",yanii:'You are not investing in Tops, Portfolios or Providers yet. Get started by clicking the "Copy" button in the offers that interest you.',details_by_portfolios:"Details by portfolios",start_trading:"Start Trading!",tinedt:"There is not enough data to make a chart. Start making trades and in this section you will see trading analytics",comparison_by_account:"Comparison by account",subscribed_to_groups:"Subscribed to groups",my_groups:"My Groups",groups_archive:"Groups archive",favorites:"Favorites",contacts:"Contacts",black_list:"Black list",support:"Support",agbi:"Analytics groups by instrument",tools:"Tools",tanuw:"There are no users with the specified parameters",sfagoc:"Search for a group or contact",groups:"Groups",hjtg:"has joined the group",added_to_group:"added to group",removed_from_group:"removed from group",left_the_group:"left the group",taat:"The admin has added tags",acga:"Admin changed group avatar",acgnt:"Admin changed group name to",blocked:"blocked",owner:"(Owner)",delete_message:"Delete message",reply:"Reply",write:"Write",remove_from_group:"Remove from group",complain:"Complain",typing:"typing...",was_online:"was online",settings:"Settings",from_favorite:"From Favorite",add_to_favorites:"Add To Favorites",unblock:"Unblock",block:"Block",remove_from_list:"Remove from list",add_Members:"Add Members",group_members:"Group Members",conference:"Conference",leave_group:"Leave group",about_the_group:"About the group",archive:"Archive",delete_group:"Delete group",unzip:"Unzip",mute_sound:"Mute sound",post_a_chat:"Post a chat",hide_chat:"Hide chat",you_cannot_write:"You cannot write",tuhly:"The user has locked you",yhbtu:"You have blocked the user",sttc:"Subscribe to the channel",take_photo_video:"Take Photo/Video",record_audio:"Record Audio",attach_file:"Attach File",save_on_computer:"Save on computer",select_a_file:"Select a file",or_drag_file:"or drag file",send_file:"Send file",photo_video_message:"Photo/Video message",nattc:"No access to the camera! Check camera permissions and hardware",ybdns:"Your browser does not support this technology. Try to update the software to the latest version or use a different browser",come_back:"Come back",add_description:"Add description",send:"Send",to_take_a_photo:"To take a photo",record_video:"Record video",audio_message:"Audio message",start_recording:"Start Recording",stop_recording:"Stop Recording",aptf:"Add provider to favorites",ctpt:"Copy the provider's trades",aapttcatit:"Add a provider to the chart and track its trades",rpff:"Remove provider from favorites",pltv:"Paste link to view",invalid_link:"Invalid link",search:"Search",not_found:"Not found",allStreams:"All Streams",myStreams:"My Streams",streamName:"Stream title",enterTheTitle:"Enter the title",description:"Description",enterTheDescription:"Enter the description",fieldIsRequired:"This field is required",dateOfTheBroadcast:"You must specify the date.js of the broadcast",startYourStream:"Start your stream",startedStream:"Start stream",deleteStream:"Delete stream",warnTooltipDeleteStream:"Are you sure you want to delete the stream?",ownerStreamFilter:"My streams",allStreamFilter:"All streams",freeAccess:"Free access",bySubscription:"By subscription",dateOfBeginning:"The date of the beginning",timeOfBeginning:"The time of the beginning",scheduledDateMust:"Scheduled date must not be earlier than current date",startnNow:"Start now",schedule:"To schedule",started:"Started",resolution:"Resolution",streamOnlySubscribers:"Stream only for subscribers",streamLogo:"Stream logo",createStream:"Create stream",publicationPageGo:"Go to the publication page",warnFillFields:"To create a broadcast, you must fill in all the fields. Editing the broadcast is possible in the settings window, at the next step",AddToFavorits:"Add to favorites",tagsContracts:"Contract tags",selectContract:"Select Contract",uploadYourPhoto:"Upload your photo",tradingToolsConfigToolsList_quote:"Quote",tradingToolsConfigToolsList_averPrice:"Average open price",tradingToolsConfigToolsList_compact:"Compact View",portfolio_launched:"Portfolio launched",portfolio_stopped:"Portfolio stopped",portfolio_did_not_launch:"Portfolio did not launch",daily_report:"Daily report",weekly_report:"Weekly report",monthly_report:"Monthly report",daily_gain:"daily gain",weekly_growth:"weekly growth",growth_per_month:"growth per month",notifications:"Notifications",wmdyp:"What market do you prefer to trade on? We will create a demo account for you in advance. Later you can add a demo account on any market.",common:{successStatus:"Success",Deposit:"Deposit",Leverage:"Leverage",PayAttention:"Pay attention!","mon.":"mon.","d.":"d.","h.":"h.",Cancel:"Cancel",Confirm:"Confirm","Confirm?":"Confirm?",select:{Placeholder:"Select...",PlaceholderCountry:"Select country...",ChooseTheCountry:"Choose the country",noData:"No data to display",Followers:"Number of your followers"},Pay:"Pay",PayNow:"Pay now",Account:"Account",Country:"Country",SendRequest:"Send Request",Watch:"Watch",Stop:"Stop",Start:"Start",Understand:"Understand",RussianRuble:"₽ - Russian Rubles",Continue:"Продолжить"},personalArea:{PersonalAccount:"Personal Account",ProfileCreated:"Profile Created",sidebar:{MyData:"Personal Data",TelegramReports:"Telegram Reports",TradingAccounts:"Trading accounts",Signals:"Trading signals setup",Partner:"Partner program",Payments:"Payments",Verification:"Verification",Devices:"Devices",Documents:"Documents"},personalMyData:{public:{PublicInformation:"Public Information",PersonalName:"Personal Name",FirstName:"First Name",Surname:"Surname",Avatar:"Avatar",AboutMe:"About Me",AboutPlaceholder:"Write something",Country:"Country",City:"City",Timezone:"Timezone",WebSite:"Website"},auth:{Auth:"Auth",Login:"Login",MobilePhone:"Mobile Phone",Email:"E-mail",ChangePassword:"Change Password",CurrentPassword:"Current Password",CheckPassword:"Check Password",NewPass:"New Password",AcceptNewPass:"Accept",TooManyTries:"Too many tries, try later.",WrongPassword:"Wrong password.",Setup:"Setup",TurnOff:"Turn Off 2FA",TwoFA:"Two-factor authentication:",GoogleAuth:"Google Authenticator",GoogleAuthSuccess:"Google Authenticator two-factor authentication is successfully configured",GoogleAuthRemoved:"Google Authenticator two-factor authentication is disabled"},currency:{Currency:"Currency",CurrencyDisclaimer:"Select the type of currency to pay for your services:"}},personalTradingAccounts:{ConnectMT5:"Connect MT5",ConnectAccount:"Connect account",NewDemoAccount:"New DEMO-account",CreateDemoAccount:"Create DEMO-account",DemoAccountCreated:"Demo-account created!",ToNewAccount:"Go to new account",CreateMore:"Create more",DeleteDemoAccount:"Delete demo account",CaptionHedging:"Account type - “Hedging” (Simultaneous trading in long and short directions)",CaptionPeriod:"After creating Demo-account you will have a period of free usage - 1 month.",CaptionPayment:"Upon completion of which payment will be required - 500 ₽/month.",GetPaidMore:"How to earn more?",CaptionPaidMore:["If you want to make money by selling your trading signals or content, you need to pass","verification","and become a trading signal provider."],PassVerification:"Complete Verification",CaptionHourglassPeriod:"There is a trial period for this account",CaptionHourglassPayment:"At the end of the trial period, you must pay for the subscription using this invoice",AccountCurrency:"Account currency",AmountToTopUp:"Amount to top up",TopUpAccountBalance:"Top up account balance",TopUpBalance:"Top up balance",BalanceReplenishedSuccessfully:"Balance replenished successfully",SetAsDefaultAccount:"Set as default account",DeletedSuccessfully:"Deleted successfully",CannotDeleteWhilePublished:"Cannot delete account while it has signal sources."},personalPayments:{tscstt:"Total amount: copying fee + TT subscription",TTSubscriptionPayment:"TT subscription Payment",TotalSum:"Total",TimeInterval:"TimeInterval",PaymentPurpose:"Payment purpose",PortfolioTopProvider:"Portfolio / Top / Provider",PortfolioWorkingPeriod:"Portfolio Working Period",NetIncome:"Net Income",YouDoNotInvest:"You do not invest!",ydnhip:"You do not have investments in portfolios, tops or providers yet. Start investing in the “Tops” or “Investments” section",PaymentsHistory:"Payments history",Payment:"Payment",YouSave:"You save",CopyingFee:"Copying fee",iypflp:"If you pay for a longer period you will receive a discount",Endless:"Endless",Ended:"Ended",Nosub:"No subscription",noHistoryAccount:"No history for this account",payedPeriodTill:"Payed period till:",AccountNotSelected:"Account is not selected",noDataAccount:"No data for this account",months:{Month:"1 Month","3 Month":"3 Months","6 Month":"6 Months","9 Month":"9 Months","12 Month":"12 Months","24 Month":"24 Months"}},personalVerification:{fullName:"Full name",Broker:"Broker",Experience:"Experience",Followers:"Followers",Markets:"Markets",AccountType:"Account type",Passport:"Passport",PhotoPage:"Page with photo",vaass:"Verification as a service seller",tualay:"Tell us a little about yourself, describe your experience in trading markets.",MarkedFieldsRequired:["Fields marked","are required"],matiy:"Mark the areas that interest you. What are you interested in doing on the TopTrader platform?",rbsgafAnalyst:"Run blogs, streams and groups about finance (Analyst)",tmmmstProvider:"Trade in the markets and make money by selling trading signals (Provider)"},personalSignals:{FixedPaymentPM:"Fixed payment per month (MF), $",PercentOfSuccess:"% of success (SF)",InvestWarning:"You invest in this account. You cannot become a signal provider with active portfolios. Stop all running portfolios.",DeleteWarning:"You cannot delete signals while you have active subscriptions. Number of subscriptions:",TradesWarning50:"To add instruments to the cost setting, you must make at least 50 transactions on the new instrument in the “Market” section",VideoInstruction:"Video instruction",PublishTradeSignals:" publish trade signals",NotAProviderAnymore:" is no longer a provider",RemoveAccountProviderStatus:"Are you sure you want to remove the “account-provider” status from account ",PopupCaption1:"Please note that when using an account provider, the feature of investing in other providers is not available.",PopupCaption2:"To assign prices for trading signals for an instrument, you must have completed at least 50 transactions.",PopupCaption3:"Using TopTrader with this account will be free.",PopupCaption4:"Are you sure you want to make the account a trading signal provider account?",NoAccounts:"You don't have any accounts yet",OpenAccount:"Create account"},personalPartner:{tnbr:"There are no boundaries or restrictions!",iyftt:"Invite your friends to the platform - and earn money!",dywtri:"Do you want to receive income from attracting your friends and acquaintances to TopTrader, instantly receive up to 50% of the closed transactions of the attracted user?",gurlqi:"Generate a unique referral link (or qrcode). Invite new users using this link - and withdraw money to your account!",anawvc:"A new account will be created to receive all commissions. The reward is accrued once a day based on the results of each day. At any time you can withdraw funds to any bank or transfer them to a trading account within the platform.",anawvcpd:"A new account will be created to receive all commissions. Rewards are credited once a day.",aatycwf:"At any time you can withdraw funds or transfer them to a trading account within the platform.",yhctpi:"You have ceased to participate in the Affiliate Program and will no longer receive affiliate rewards.",ycartt:"You can always return to the program, just click the “Become a partner” button",ReferralLink:"Referral link",Generate:"Сгенерировать",YourLink:"Your link",BecomeToptraderPartner:"Become a TopTrader partner!",BecomePartner:"Become a partner",PaidToPartners:"Paid to partners",Referrals:"Number of referrals",ReferralPercent:"Referral percent",CommissionRate:"Commission Rate",CommissionSum:"Total commission amount",AvailableForWithdrawal:"Available for withdrawal",ValidityPeriod:"Validity period",TotalCommissionAmount:"Total commission amount",Agreement:["I confirm that I have read and agree with","Affiliate Program Agreement"],documents:{HeadPart1:"Affiliate Program Agreement",HeadPart2:"Partnership Rules",PartnerRules1:"If you are caught inviting users who already have accounts on TopTrader, or committing other fraudulent activities, TopTrader will revoke your partner status and reduce your reward to 0%. ",PartnerRules2:"If you are found to be secretly offering commissions higher than what TopTrade offers to others, TopTrader will revoke your affiliate status and change your commission percentage to 0%.",PartnerRules3:"If it is determined that you have attempted to mislead users through phishing sites/pages similar to the TopTrader site/pages, TopTrader will revoke your affiliate status and adjust your commission percentage to 0%.",PartnerRules4:"You are prohibited from making any misleading statements, including but not limited to attempts at search engine optimization using such keywords associated with TopTrader. Violation of these rules will result in forfeiture of rewards and loss of affiliate status.",PartnerRules5:"At any time, TopTrader reserves the right to revoke a partner's status, cancel his right to receive discounts, change the discount percentage to 0%, return all discounts paid and file a claim for damages against partners who cause any damage to the company TopTrader, defame TopTrader or otherwise act against TopTrader",RuleHeading1:"This includes, but is not limited to, the following circumstances:",Circum1:"Posting false or negative information about TopTrader on social networks.",Circum2:"Organization of economic claims against TopTrader.",MainRules1:"TopTrader reserves the right to change, amend or cancel these rules at any time without prior notice. By continuing to use the services of this site, you confirm your acceptance of this agreement. If your actions do not favor TopTrader, TopTrader reserves the right to the right to change, supplement or cancel these rules at any time without prior notice.",MainRules2:"By continuing to use the services of this site, you confirm your acceptance of this agreement. If your actions do not favor TopTrader, any relationship between you and TopTrader will automatically terminate. Matters not addressed herein are governed by the policies of TopTrader. reserves the right to change, amend or cancel these rules at any time without prior notice.",MainRules3:"By continuing to use the services of this site, you confirm your acceptance of this agreement. If your actions do not favor TopTrader, any relationship between you and TopTrader will automatically terminate. Matters not addressed herein are governed by TopTrader's policies. , any cooperation between you and TopTrader will be automatically terminated. Issues not addressed in this document are subject to the policies of TopTrader reserves the right to change, amend or cancel these rules at any time without prior notice. By continuing to use the services of this site, you. confirm your agreement to this agreement. If your actions do not favor TopTrader, any cooperation between you and TopTrader will be automatically terminated. Matters not addressed herein will be governed by TopTrader's policy."},tabs:{Referrals:"Рефералы",YourIncome:"Ваш доход",Settings:"Настройки",Documentation:"Документы"}},personalDevices:{DevicesSessions:"Devices signed into your account",ChooseThisDeviceToLogOut:"Select this device to sign out",ActiveSessions:"Active sessions on devices:",caption1:"Shown are the devices that currently have access to the platform under your account.",caption2:"If you do not recognize at least one thing, contact the administration.",caption3:"To end your session on all devices, click the button below. Please note that you will be logged out from the device from which you are performing these actions.",LogOutAllDevices:"Log out of all devices"}}},da={Country:"Страна",copy:"Копировать",agree:"Согласен",next:"Вперед",instrument:"Инструмент",result:"Итог",fixed:"Фиксированный",dynamic:"Динамический",dynamic2:"Динамическая",active:"Активный",loss:"Убыток",details_by_portfolios:"Детализация по портфелям",apply:"Применить",tctsyntsttt:"Для копирования торговых сигналов, Вам необходимо оформить подписку на проект ТopТrader в размере фиксированного, ежемесячного платежа:",ycpfiateocp:"Оплатить его можно в конце оформления копирования и в начале каждого месяца из раздела “Счета”.",twatcareosp:"Это позволит без ограничений копировать и получать экспертизу выбранных провайдеров или портфелей.",tutrfkautta:"Пользователь принимает на себя ответственность за знание и понимание терминов и определений, используемых на Сайте и в ПО, в том числе (но не ограничиваясь) знания о финансовых инструментах и (или) видах сделок, терминах финансового рынка, специализированного программного обеспечения, используемого для работы на финансовом рынке, терминах инвестора и другими необходимыми знаниями в области инвестирования.",aipotsirrfa:"Информация, размещаемая на сайте, в том числе содержащая: результаты исследований, прогнозы, любые оценки в отношении финансовых инструментов — не является инвестиционной рекомендацией Пользователю.",adtbsaofart:"Решение о покупке, продаже и (или) следованию любой рекомендации, торговому сигналу в отношении любого финансового инструмента и (или) торгуемого актива Пользователь принимает самостоятельно на свой страх и риск.",ciaadotofoa:"Копирование - это автоматическое дублирование торговых операций с одного счета на другой в режиме реального времени. Если провайдер* установил плату за торговые сигналы, она взымается в момент оформления копирования и далее раз в месяц (при включенном автопродлении).",atprtcsmiat:"По желанию провайдера* в услугу “Копирование” может входить доступ к эксклюзивному контенту, который создает провайдер на платформе TopTrader.",suiraapitfs:"Настройте инструменты, риск и период активности на следующих шагах.",ppotsanspsi:"* Провайдер – поставщик торговых сигналов, аналитики, новостей, стримов. Статус Провайдера устанавливается пользователем в личном кабинете после уплаты Платы за подписку на проект TopTrader",ictihraattt:["Я подтверждаю, что прочитал и согласен с","ПОЛОЖЕНИЯМИ И УСЛОВИЯМИ СОГЛАШЕНИЯ ПОЛЬЗОВАТЕЛЯ И ПОЛОЖЕНИЯ ОБ ОПЛАТЕ"],wpocdyptu:"Какой процент капитала планируете использовать?",eaoiipp:"Расчетная сумма инвестирования в провайдеров/портфель",aoicotbotpo:"Рассчитанная на основании процента от капитала сумма инвестирования",aawl:"Доступная сумма с учетом кредитного плеча",aofotawfnfp:"Количество средств на счете без плавающей незафиксированной прибыли по текущим открытым ордерам",aofotatictr:"Количество средств на счете с учетом результатов по текущим открытым позициям (плавающей прибыли/убытка).",afmbtl:"Выделенные средства счёта помноженные на размер кредитного плеча",fimafviattt:"Фиксированный способ инвестирования - на сделку выделяется фиксированный объем",dimtvoticrt:"Динамический способ инвестирования - объем сделки рассчитывается относительно текущих средств счёта в соответствии с установленным процентом",aimasnotiaf:"Активный способ инвестирования - на каждого провайдера из портфеля выделяется установленное количество сделок. Объем сделки рассчитывается в соответствии с расчетной суммой инвестирования поделенной на установленное количество сделок.",aoafptcatti:"Количество выделенных средств на сделку, рассчитанное в соответствии с инвестиционным капиталом деленным на общее количество сделок",spotafatwtv:"Установленный от средств счёта процент, в соответствии с которым определяется объем сделки",cnot:"Расчетное количество сделок",notciawtcao:"Количество сделок, рассчитанное в соответствии с расчетной суммой инвестирования поделенной на объем сделки",notatepitp:"Количество сделок, выделяемых на каждого провайдера в портфеле",notateiitp:"Количество сделок, выделяемых на каждый инструмент в портфеле",ltloc:"Ограничить потери капитала",swrtpoafatl:"Приостановить при достижении - процент от выделенных средств, при потере которой, прекращается инвестирование в портфель",cvpt:"Расчетный объем на сделку",cnotpp:"Расчетное количество сделок на провайдера",cnotpi:"Расчетное количество сделок на инструмент",pottnotbtvp:"Произведение общего количества сделок на объем по одной сделке",you_are_copying:"Вы копируете",stop:"Стоп",profile:"Профиль",market:"Рынок",tops:"Tопы",portfolios:"Портфели",settings:"Настройки",menu_setup:"Настройка меню",new_group:"Новая группа",section:"Раздел",display_by:"Отображать",display:"Показать",on_hover:"при наведении",pl:"P/L",by_click:"по клику",text:"Текст",color:"Цвет",icon:"Иконка",avatar:"Аватар",delete_the_group:"Удалить группу?",cancel:"Отменить",delete:"Удалить",logo_customization:"Настройка логотипа",iith:"Изображение в шапке сайта",full_TT_logo:"Полный логотип TT",shoty_TT_logo:"Краткий логотип TT",my_text:"Мой текст",my_logo:"Мой логотип",balance:"Баланс",equity:"Средства",margin:"Маржа",margin_account:"Маржа счета",margin_occupied:"Маржа занято",margin_available:"Маржа свободно",leverage:"Кр. плечо",max_drawdown:"Макс. просадка",current_drawdown:"Просадка",net_profit_full:"Чистая прибыль",net_profit:"Чист. прибыль",successful_trades:"Усп. сделок",successful_trades_full:"Успешных сделок",successful_trades_percent:"Усп. сделок, %",successful_trades2:"Успeшных сделок",profit_factor:"Профит фактор",recovery_factor:"Фактор восст-ия",sharpe_ratio:"Коэфф. Шарпа",copying:"Копируют",copying2:"Копирую",copying3:"Копирование",funds_under_management:"Ср. под управлением",tt_subscription:"Подписка TT",account_creation_date:"Дата создания счёта",tbsd:"Торговля по стратегии, дней",replenishments_withdrawals:"Пополнения/списания",closed_trade:"Закрытые сделки",closed_trades:"Закрытых сделок",profitable_closed_trades:"Прибыльных закрытых сделок",unprofitable_closed_trades:"Убыточных закрытых сделок",apptd:"Средняя прибыль на сделку, $",apptp:"Средняя прибыль на сделку, pip",of_the_result:"% от результата",cost_$_month:"Стоимость $/мес.",the_entire_portfolio:"Весь портфель",per_month:"в мес.",account_balance:"Баланс счета",account_equity:"Средства счета",average_by_equity:"Средняя по Средствам",selected_instruments:"Выбранные инструменты",you_are_investing:"Вы инвестируете:",investment_method:"Способ инвестирования",investment_parameters:"Параметры инвестирования",volume_per_trade:"Объем на сделку",volume_per_contract:"Объем на контракт",percentage_of_trade:"Процент на сделку",trades_per_provider:"Сделок на провайдера",trades_per_instrument:"Сделок на инструмент",suspend_when_reached:"Приостановить при достижении",funds_left:"Останется средств",calculated_capital:"Расчетный капитал",tnot:"Общее кол-во сделок",provider:"Провайдер",providers:"Провайдеров",providers_1:"Провайдеры",providers2:"Провайдеры",nopitp:"Количество провайдеров в портфеле",affm:"Выделенные средства для управления",voot:"Размер одной сделки",number_of_trades:"Количество сделок",smwadir:"Приостановить управление при достижении просадки",aappfm:"Выделенная сумма на одного провайдера под управление",success_management_fee:"коммисия за эффективное управление",afwdotponpi:"Плата, зависящая от процента чистой прибыли. Взимается в первый день каждого месяца после подписки на стратегию и рассчитывается по принципу High Water Mark, что исключает двойную оплату. Плата также взимается в момент полного или частичного снятия средств со счета для копирования и после прекращения копирования стратегии.",pfattsnfate:"Оплата за доступ к функционалу «СМС-уведомления». По итогу дня Вы будете получать отчет о копировании",$_1_month:"₽ 70/мес.",$_5_month:"370 р.",compare:"Сравнить",profitability:"Доходность",aipm:"Средний доход за месяц",aipm2:"Ср. доход за месяц",participant:"Участник",participants:"Участники",of_capital:"% от капитала",allocated_funds:"Выделенные средства",back:"Назад",profit_in:"Доход в",management_statistics:"Статистика управления",total_result:"Суммарный результат",total_deposits_withdrawals:"Суммарные пополнения/списания",deposits_withdrawals:"Пополнения/списания",tsoadawotua:"Сумма всех пополнений и списаний пользователя по счёту",troacd:"Итоговый результат по всем закрытым сделкам",nodstsot:"Количество дней, прошедших с начала торговли",percentage_successful_trades:"Процент успешных сделок",sotfttnfwap:"Доля сделок от общего числа, по которым зафиксирована прибыль",ambditmolfa:"Наибольшее падение баланса от локального максимума",titrottmttt:"Это соотношение денег трейдера к общему объёму средств, которыми он торгует",ciotprr:"Сравнительный показатель отношения доходности и риска",mathematical_expectation:"Мат. ожидание",tmeapptitro:"Математическое ожидание (средняя прибыль на сделку) является результатом деления чистой прибыли на количество всех сделок.",poct:"Прибыль по закрытым сделкам",poctip:"Прибыль по закрытым сделкам в пипсах",tpoi:"Всего пипсов дохода",tsoipfei:"Сумма пипсов дохода по каждому инструменту",agdi:"Среднегеометр. дневная доходность",agmi:"Среднегеометр. месячная доходность",agai:"Среднегеометр. годовая доходность",trading_activity:"Торговая активность",total_trades:"Сделок всего",notootp:"Количество сделок, открытых по портфелю",profitable_trades:"Приб. сделок",profitable_trades2:"Прибыльных сделок",buy:"Позиций на покупку",buy2:"Сделки на покупку",sell:"Позиций на продажу",sell2:"Сделки на продажу",unprofitable_trades:"Убыт. сделок",open_trades:"Открытые сделки",tnoot:"Общее количество открытых сделок",tnoct:"Общее количество закрытых сделок",soctoottnfw:"Доля закрытых сделок от общего числа, по которым зафиксирована прибыль",soctoottnfwal:"Доля закрытых сделок от общего числа, по которым зафиксирован убыток",troot:"Суммарный рез. по откр. сделкам",soploaot:"Сумма доходов/убытков по всем открытым сделкам",troct:"Суммарный рез. по закр. сделкам",soploact:"Сумма доходов/убытков по всем закрытым сделкам",tavopfetcat:"Среднее значение прибыли с каждой сделки, рассчитанное как суммарная прибыль от всех сделок, поделенная на количество сделок",equity_turnover:"Оборот средств",trading_volume:"Торгуемый объем",fee:"Комиссия",fcttuacttpf:"Средства, взимаемые с пользователя и начисляемые провайдеру за успешное управление",tsovotwtipd:"Сумма стоимостей сделок с торговыми инструментами, совершенных за определенный период времени",tnouctp:"Общее количество пользователей, копирующих данного провайдера",ttaomttpshi:"Общее количество средств, которые вложили под управление подписчики провайдера",tpbsd:"Срок торговли по стратегии, дней",trficatrotn:"Фактор восстановления (recovery factor) рассчитывается как отношение чистой прибыли к максимальной просадке. Чем выше фактор восстановления, тем быстрее система восстанавливается после просадки.",tpfshmtttpe:"Фактор прибыльности показывает, во сколько раз общая прибыль превышает общий убыток. Чем больше это значение, тем лучше.",statistics_for_account:"Статистика по счету",yavaapots:"Вы верифицированы как провайдер торговых сигналов",current_day_result:"Результат текущего дня",on:"на",instruments:"Инструменты",trades_open:"Сделок открыто",trades_closed:"Сделок закрыто",all_trades:"Все сделки",maximum_balance_drawdown:"Макс. просадка баланса",tmpt:"Наиболее прибыльная сделка",tmut:"Наиболее убыточная сделка",average_trade_profit:"Средняя прибыль сделки",apippt:"Средняя прибыль в пипсах по сделке",average_trade_length:"Средняя продолжительность сделки",dfei:"Детально по инструментам",no_data:"Данные отсутствуют",trades:"Сделки",pips:"Пипсы",profit:"Прибыль",distribution:"Распределение",total_profit:"Общая прибыль",ml5si:"Мои последние подписки/инвестиции",all_subscribers:"Все подписчики",project_fee:"Комиссия (0,25%) за пользование проектом",account_number:"Номер торгового счета",eotsd:"Средства на выбранную дату",broker:"Брокер",general_equity:"Общие средства",general_fee:"Общая комиссия",date:"Дата",day:"День",year:"Год",total_days:"Всего дней",total_monthes:"Всего месяцев",week:"Неделя",month:"Месяц",portfolio_provider:"Портфель/Провайдер",cifs:"Текущий доход от подписки",my_income:"Мой доход",ending_at:"Окончание",status:"Статус",total_income:"Всего доход",common_income:"Общий доход",ibot:"Доход по открытым сделкам",income_from_investments:"Доход по инвестициям",PLbot:"P/L по открытым сделкам",current_income:"Текущий доход",sodiitots:"Настройки отображаемой информации в шапке сайта",reset_settings:"Сброс настроек",d:"д.",h:"ч",personal_area:"Личный кабинет",about_the_project:"О проекте",exit:"Выход",sound_on_off:"Вкл/Выкл звук",night_mode:"Ночной режим",server_connection:"Соединение с сервером",chat_connection:"Соединение с чатом",streaming:"Стриминг",vcac:"Видеозвонки и конференции",no_server_connection:"Нет подключения к серверу",pwticotsiutm:"Проблемы с соединением c интернетом, либо на сервере ведутся технические работы",refresh_page:"Обновить страницу",tnhy:"Здесь пока пусто.",sibcanp:"Начните инвестировать с создания нового портфеля.",fiweai:"Наполните его экспертами и инвестируйте!",create_a_portfolio:"Создать портфель",phbc:"Портфель создан",dwtuc:"Дата создания портфеля пользователем",start_investing:"Начало инвестирования",start_copying:"Начало копирования",start_copying2:"Начать копирование",siitc:"Дата начала инвестирования в созданный портфель",management_fee:"Комиссия за управление",sdocp:"Дата начала копирования сигналов провайдера",fsbat:"Комиссия применяется к чистой прибыли и снимается в конце каждого месяца по принципу “High Water Mark”",portfolio_statistics:"Статистика Портфеля",notco:"Количество сделок, закрытых по портфелю",napot:"Количество и процент сделок от общего числа, по которым зафиксирована прибыль",positions_for_buying:"Позиций на покупку",napob:"Количество и процент сделок на покупку от числа прибыльных",positions_for_selling:"Позиций на продажу",napofs:"Количество и процент сделок на продажу от числа прибыльных",napos:"Количество и процент сделок на продажу от числа убыточных",napobt:"Количество и процент сделок на покупку от числа убыточных",risk_management:"Управление риском",caafi:"Расчетная сумма, выделенная для инвестирования",vapot:"Объем, выделенный на одну сделку",notca:"Количество сделок, рассчитанное в соответствии с расчетной суммой инвестирования поделенной на объем сделки",tttp:"Сделок на провайдера",notcat:"Количество сделок, рассчитанное в соответствии с общим числом сделок на количество провайдеров в портфеле",poafa:"Процент от выделенных средств, при потере которого прекращается инвестирование в портфель",ftwrw:"Доля средств, оставшихся у пользователя при достижении ограничения потери капитала",possible_loss:"Возможный убыток",aoftd:"Рассчитанное на основании потери капитала количество средств, которое потерял пользователь",success_rate:"Процент успеха",initial_balance:"Начальный баланс",ubats:"Баланс пользователя в момент запуска копирования",current_balance:"Текущий баланс",ucb:"Баланс пользователя на текущий момент",eitmt:"Средства – это деньги, которые будут на балансе, если закрыть все открытые сделки",post:"Процент успешных сделок",pocto:"Percentage of closed trades, of the total number, for which a profit was recorded",the_sharpe_ratio:"Коэффициент Шарпа",the_sharpe_ratio2:"Коэф. Шарпа",arfta:"Отношение средней премии за риск к среднему отклонению портфеля",ambrf:"Наибольшее падение баланса от локального максимума в процентах",sotpo:"Cумма произведения вероятностей получения прибыли со сделки, умноженная на фактический результат каждой сделки",oipp:"Сумма пипсов дохода по каждому инструменту",rotro:"Результат отношения общего количества всех сделок, принесших прибыль к сумме убыточных торговых операция за определенный временной интервал",rotap:"Ratio of the absolute profit to the maximum drawdown",altoa:"Среднее время жизни сделки от момента ее открытия до закрытия",funds_turnover:"Оборот средств",sovot:"Сумма стоимостей сделок с торговыми инструментами, совершенных за определенный период времени",votuf:"Объем средств пользователя, на который открыты сделки в текущий момент",fcftu:"Средства, взимаемые с пользователя и начисляемые провайдеру за успешное управление",value:"Значение",apipp:"Средняя прибыль в пипсах по сделке",m:"м.",tioi:"Общий доход по инвестициям",soift:"Статистика по инвестициям за день",statistics_on_investments:"Статистика по инвестициям",comparison_of_investments:"Сравнение инвестиций",comparison:"Сравнение",equity_increase:"Прирост средств",report:"Отчет",history:"История",apioc:"Усреднённый доход портфеля по закрытым сделкам",portfolio_income:"Доход портфеля",portfolio_income_for:"Доход портфеля за",coppp:"Сравнение доходности участников портфеля",statistic:"Статистика",additional_portfolio_statistics:"Дополнительная статистика по портфелю",yibpp:"Ваш доход по портфелю/провайдеру",iftd:"Доход за день",ypifa:"Ваш доход по портфелю за определённый период ДЕНЬ/НЕДЕЛЯ/МЕСЯЦ",yiotp:"Ваш доход по портфелю относительно средств счета",of_success:"% успеха",posdm:"Процентные показатели успешных дней, месяцев, сделок",portfolio_profitability_report:"Отчет по доходности портфеля",average_provider_income:"Средний доход провайдера",average_portfolio_income:"Средний доход портфеля",average_income:"Средний доход",ynift:"Ваш чистый доход от",for:"за",days:"дней",income_by_days:"Доход по дням",income_by_hours:"Доход по часам",contract:"Контракт",type:"Тип",volume:"Объем",volume_of:"%, объёма",psftd:"Статистика портфеля за день",prsftd:"Статистика провайдера за день",portfolio_participants:"Участники портфеля",provider_instruments:"Инструменты провайдера",trading_day:"Торговый день",ioctr:"Доход по закрытым сделкам",iocta:"Доход по закрытым сделкам на начало дня",ioctat:"Доход по закрытым сделкам на конец дня",ifctf:"Доход по закрытым сделкам за день",ifctfp:"Доход по закрытым сделкам за день, %",aippo:"Средний доход на провайдера по закрытым сделкам",aippop:"Средний доход на провайдера по закрытым сделкам, %",voct:"Объём по закрытым сделкам",total_closed_trades:"Всего закрытых сделок",ioota:"Доход по открытым сделкам на начало дня",iootat:"Доход по открытым сделкам на конец дня",iootf:"Доход по открытым сделкам за день",iootfp:"Доход по открытым сделкам за день, %",volume_of_open_trades:"Объем открытых сделок",apatb:"Абсолютная прибыль на начало дня",apate:"Абсолютная прибыль на конец дня",appd:"Абсолютная прибыль за день",appdp:"Абсолютная прибыль за день, %",absolute_profit:"Абсолютная прибыль",open_price:"Цена открытия",of_total:"% от общего",twenc:"В течение дня не было закрытых сделок",provider_profit_statistics:"Статистика прибыли провайдерa",psop:"Статистика прибыли провайдеров",iftw:"Доход неделя",monday:"понедельник",tuesday:"вторник",wednesday:"среда",thursday:"четверг",friday:"пятница",saturday:"суббота",sunday:"воскресенье",mounthArr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],daysArr:["ПН","ВТ","СР","ЧТ","ПТ","СБ","ВС"],mounthShortArr:["год","янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек","итог"],income:"Доход",ipfm:"Доход за месяц",gotcp:"График текущей прибыли портфеля",hotpp:"Гистограмма дохода портфеля по дням",psabg:"Статистика по портфелю формируется",eatbo:"Средства на начало месяца",eatbot:"Средства на начало дня","eatуot":"Средства на конец дня",successful_days:"Успешных дней",successful_months:"Успешных месяцев",current:"Текущий",TrendTradingWidget:"Топ-провайдеры",by_portfolio:"по портфелю",by_portfolios:"по портфелям",by_account:"по счету",income_on_investments:"Доход по инвестициям",tsabg:"Статистика формируется, либо по потфелям ещё не было сделок",profit_in_money:"Доход в деньгах",prtae:"Процент относительно средств счета",sftd:"Статистика за день",traded_instruments:"Торгуемые инструменты",occupied:"Занято",available:"Свободно",leverage_full:"Кредитное плечо",invested:"Инвестировано",using_leverage:"C использ. КП",without_leverage:"Без исп. КП",available_for_investment:"Свободно для инвестиций",for_closed_trades:"По закрытым сделкам",investments:"Инвестиции",affiw:"Выделено средств на инвестиции, с учетом Кредитного плеча и без",fffiw:"Свободно средств для инвестиций, с учетом Кредитного плеча и без",total_for_portfolios:"Итог по портфелям",result_by_providers:"Итог по провайдерам",your_investments:"Ваши инвестиции",account_profile:"Профиль счета",profile_created:"Профиль создан",trading_statistics:"Торговая статистика",pftdb:"Доход за день по портфелям",profit_by_portfolios:"Доход по портфелям",hotgo:"Гистограмма прироста средств в процентах",trading_analytics:"Торговая аналитика",before_cancelled:"До отмены",investing:"Инвестирование",paused:"На паузе",inactive:"Не активный",report_for:"Отчет за",filter:"Фильтр",all:"Все",add:"Добавить",add_chart:"Добавить график",tsott:"Торговая стратегия топа",tiott:"Общий доход топа",increase_per_day:"Прирост в сутки",increase_per_month:"Прирост в месяц",forecasted_profitability:"Прогнозируемая доходность",minimum_funds:"Минимальные средства",minimum_contract_value:"Мин. стоимость контракта",mnot:"Мин. количество сделок",mm_model:"Модель ММ",trading_months:"Торговых месяцев",trading_days:"Trading days",income_calculator:"Калькулятор дохода",atttypaycsa:"Добавьте данынй Топ в свой профиль, вы сможете моделировать любой сценарий инвестирования.",tiottip:"Общий доход Топа, в пипсах",ipdip:"Прирост в сутки, в процентах",ipmip:"Прирост в месяц, в процентах",increase:"Прирост",tops_profit:"Прибыль Топа",iott:"Доход Tопа",analytics:"Аналитика",top_analytics:"Аналитика Tопа",comparison_of_participants:"Сравнение участников",postott:"Процент успешных сделок Топа",the_entire_story:"Вся история",tiotpip:"Совокупный общий доход участников Топа, в пипсах",add_to_portfolio:"Добавить в портфель",atmi:"Добавить в мои инвестиции",atmi2:'Добавить в "Мои инвестиции"',tmptp:"Самые доходные Топ-провайдеры",rftp:"Удалить из портфеля",sign_in:"Вход",background_buttons:"Фон кнопок",registration:"Регистрация",email_login_phone:"Электронная почта, логин, телефон",password:"Пароль",forgot_your_password:"Забыли пароль",tainrotspgt:"Аккаунт не зарегистрирован на сервере, пожалуйста пройдите процедуру регистрации",iyhaarwooop:"Если у Вас есть счет зарегистрированный у одного из наших партнеров Вы можете пройти",simplified_registration_procedure:"упрощенную процедуру регистрации,",bataba:"активировав аккаунт по счету",authorization_error:"Ошибка авторизации",invalid_password:"Неверный пароль",your_account_data:"Данные вашего аккаунта",account_registration:"Регистрация по счету",log_in:"Войти",login:"Логин",user_registration:"Регистрация пользователя",ronu:"Регистрация новых пользователей",rftwwtmmutb:"Регистрация для тех, кто хочет зарабатывать используя свой брокерский счет",ynas:"Ваше имя и фамилия",name:"Имя",surname:"Фамилия",anat:"Номер счета и трейдер",trader:"Трейдер",saunuoll:"Укажите уникальное имя-никнейм используя только латинские буквы",email_address:"Адрес электронной почты",set_password:"Придумайте пароль",confirm_password:"Подтвердить пароль",pdnm:"Пароли не совпадают",pmcal8cinua:"Пароль должен содержать не менее 8-ми символов, в том числе цифры, прописные и строчные буквы",mpl8c:"Минимальная длина пароля 8 символов",tpmcualcl:"Пароль должен содержать заглавные и строчные буквы",tpmcalod:"Пароль должен содержать не менее одной цифры",llanaa:"Допускаются латинские буквы и цифры",llnassaa:"Допускаются латинские буквы, цифры и спецсимволы",lmcalol:"Логин должен содержать хотябы одну букву",invalid_format:"Неверный формат",registration_confirmation:"Подтверждение регистрации",tcicptrbtf:"Код верный! Для завершения Нажмите кнопку 'Регистрация'!",send_code:"Отправить код",accwbsttspn:"На указаный номер телефона будет выслан код подтверждения.",septal:"Ошибка сервера! Повторите запрос позже!",invalid_code:"Неправильный код",check_code:"Проверить код",resend:"Выслать ещё",tpniarots:"Номер телефона уже зарегистрирован на сервере",phone:"Телефон",confirmation_code:"Код подтверждения",code_validity_time:"Время действия кода",tlaeploeado:"Такой логин уже существует, войдите по нему или введите другой.",teaeploeado:"Такой e-mail уже существует, войдите по нему или введите другой.",password_recovery:"Восстановление пароля",input_format_error:"Ошибка формата ввода!",tpninrots:"Номер телефона не зарегистрирован на сервере!",etpnawyatry:"Укажите номер телефона, который был привязан к Вашему аккаунту, для восстановления пароля.",new_password:"Новый пароль",sanptwbaart:"Укажите новый пороль, который станет активным и заменит собой старый",sawffwodywt:"Обнаружено несколько учетных записей. Для какой из них Вы хотите восстановить пароль",invalid_code_entered:"Введён неверный код",resent_code:"Отправить код повторно",etcsttpnltt:"Укажите присланный, на привязанный к аккаунту номер телефона, код. Для потверждения принадлежности к аккаунту.",reset_password:"Сбросить пароль",ccal:"Подтвердить код и войти",brycttpopda:"Регистрируясь, вы даете согласие на обработку персональных данных и соглашаетесь с Соглашением и всеми его приложениями.",study_the_document:"Ознакомиться.",rtpsctpdpac:"Ознакомиться с положением о конфиденциальности, согласием на обработку персональных данных и политикой в отношении файлов cookie можно",here:"здесь",okay:"Понятно",congratulations:"Поздравляем",yhsiitp:"Вы начали инвестировать в портфель",new_portfolio:"Новый портфель",portfolio:"Портфель",ycstpsamiit:"Увидеть статистику портфеля и управлять им можно в разделе “Профиль” - “Мои инвестиции”.",edit:"Редактировать",stop_copying:"Остановить копирование",csoada:"Копирование сигналов на Demo-счете",agreement:"Cоглашение",selected_providers:"Выбранные провайдеры",capital_distribution:"Распределение капитала",your_choice:"Ваш выбор",about_me:"Обо мне",about_user:"О пользователе",trading:"Торговля",my_world:"Мой мир",subscription:"Подписки",subscribers:"Подписки",reports:"Отчеты",total:"Общий",this_day:"Текущий день",forecast:"Прогноз",begah:"График Баланс/Средства и гистограмма дохода в процентах по дням",conio:"График чистого дохода по открытым и закрытым сделкам",coiiw:"Сравнение показателей дохода(Баланс, Средства) в рамках года и месяцев",average:"Средний",max:"Максимум",min:"Минимум",maximaze:"Развернуть",collapse:"Свернуть",hoibm:"Гистограмма дохода по месяцам",histogram_of_income:"Гистограмма дохода",wadms:"Виджеты: Кр. плечо, Просадка по счёту, Маржа, Коэффициент Шарпа",pfftm:"Прогноз прибыли на месяц",coaed:"Изменение средств счета в течение торгового дня",coaedt:"Изменение средств счета в течение торговой недели",coaedtm:"Изменение средств счета в течение месяца",full_screen:"На весь экран",fftm:"Прогноз на месяц",fftd:"Прогноз на день",iece:"Начальные средства / текущие средства",Sydney:"СИДНЕЙ",Tokyo:"ТОКИО",Frankfurt:"ФРАНКФУРТ",London:"ЛОНДОН",New_York:"НЬЮ ЙОРК",iooac:"Доход по открытым и закрытым сделкам по контрактам портфеля",picoc:"Сравнение дохода портфеля по закрытым сделкам",ciioo:"Изменение дохода по открытым сделкам по портфелю в течение торгового дня",ciioow:"Изменение дохода по открытым сделкам по портфелю в течение торговой недели",ciioom:"Изменение дохода по открытым сделкам по портфелю в течение месяца",itbm:"Таблица дохода по месяцам",tsucar:"Этот сайт использует файлы cookie и связанные с ними технологии для работы сайта, аналитики и рекламы третьих лиц. Ознакомиться с положением о конфиденциальности, согласием на обработку персональных данных и политикой в отношении файлов cookie можно",butsy:"Используя настоящий сайт, вы соглашаетесь с Соглашением и всеми его приложениями.",view:"Ознакомиться",accept:"Принять",reject:"Отклонить",otota:"Открыто сделок по счету",tvoot:"Совокупный объем по открытым сделкам",ctfroopip:"Текущий совокупный финансовый результат открытых позиций в пипсах",ctfroopipt:"Текущий совокупный финансовый результат открытых позиций в процентах",ctfroopiuni:"Текущий совокупный финансовый результат открытых позиций в долларах США. Чистый доход за вычетом комиссий (SF 33%)",yiicoaffaap:"Ваш доход.
Доход состоит из фиксированной оплаты и от процента (SF) средств подписчиков.",sfsrtiittsp:"SF - Процент от успеха.
Данный показатель - доход провайдера торговых сигналов от управления или копирования на Вашем торговом счете",scys:"Подписчики копирующие Вашу стратегию",aomtswraaci:"Сумма средств, которые подписчики с реальными счетами вкладывают в копирование в настоящий момент",cpfys:"Полученная совокупная прибыль от Вашей стратегии",ynifcticoaf:"Ваш чистый доход от копирования. Доход состоит из фиксированной оплаты и от процента успешных сделок",turnover_of_capital:"Обороты капитала",profit_from_copying:"Прибыль от копир.",income_table:"Таблица дохода",my_profit:"Моя прибыль",order_number:"Номер ордера",opening_time:"Время открытия",closing_time:"Время закрытия",price:"Цена",swap:"Своп",closing_price:"Цена закрытия",yabc:"Вас копируют",vofi:"Объем инвестированных средств",your_income:"Ваш доход",copied:"Копировали",ctota:"Закрыто сделок по торговому счету",csdpostfct:"Закрыто успешных сделок.
Процент успешных сделок от закрытых",voctota:"Объем закрытых сделок по торговом счету",cfrocpip:"Текущий финансовый результат закрытых позиций в пипсах",cfrocpi:"Текущий финансовый результат закрытых позиций в процентах",cfrocpiudni:"Текущий финансовый результат закрытых позиций в долларах США. Чистый доход за вычетом комиссии.",ypftmotbots:"Ваша прибыль от сделок совершенных на основе торговых сигналов",atpfcs:"Сумма для оплаты за копирование сигналов",tiowthbm:"Торговые инструменты по которым совершенны сделки",tvofiict:"Задействованный объем средств по закрытым сделкам",tvofiiot:"Задействованный объем средств по открытым сделкам",pfytip:"Прибыль от Ваших сделок в PIP",pfyti:"Прибыль от Ваших сделок в процентах",pfyti$:"Прибыль от Ваших сделок в $",noswcys:"Количество подписчиков, копирующих Ваши сигналы",spfys:"Прибыль подписчиков от Ваших сигналов",ypfcys:"Ваш доход от копирования ваших сигналов",spfr:"SF 30% оплата за результат",tvofiit:"Задействованный объем средств по сделкам",aysywtdtp:"Вы уверены, что хотите удалить портфель?",aystywtsi:"Вы уверены, что хотите остановить инвестирование?",tanotitp:[function(t){return"В портфеле есть ".concat(t," открытых сделок!")},"В случае прекращения инвестирования Вы получите убыток:"],yes:"Да",no:"Нет",of:"из",today:"Сегодня",event_name:"Название события",event_description:"Описание события",copy_event:"Копировать событие",edit_event:"Редактировать событие",add_event:"Добавить событие",no_events:"События отсутствуют",you:"Вы",ctcos:[function(t){return"Отменили копирование сигналов “".concat(t,"”")}],content:"Контент",incys:"теперь копирует Ваши сигналы",nyacs:[function(t){return"Теперь копируете сигналы “".concat(t,"”")}],ctcoys:"Отменил копирование Ваших сигналов",ctsocys:"Изменил настройки копирования Ваших сигналов",ctsocsf:[function(t){return"Изменили настройки копирования сигналов от “".concat(t,"”")}],stys:"Подписался на Ваши сигналы",subscribed_to_signals:[function(t){return"Подписались на сигналы “".concat(t,"”")}],ufys:"Отписался от Ваших сигналов",unsubscribed_from_signals:[function(t){return"Отписались от сигналов “".concat(t,"”")}],ptif:[function(t){return"Оплатили выставленный счет на $ ".concat(t,"")}],ptiffcys:[function(t){return"Оплатил выставленный счет на $ ".concat(t," за копирование Ваших сигналов")}],user:"Пользователь",expiration:"Окончание",conten_rates:"Цена за контент",ml5s:"Мои 5 последних подписчиков",invested_capital:"Инвестированный капитал",my_net_income:"Мой чистый доход",number:"Количество",income_from_copying:"Доход от копирования",tifct:"Совокупный доход по закрытым сделкам",assets_under_management:"Активы под управлением",average_profit_per_trade:"Средняя прибыль на сделку",yaactpiotaa:"Вы уже копируете данного провайдера. Для того чтобы добавить провайдера в Ваш портфель Вам необходимо дождаться окончания периода копирования или прекратить копирование сейчас в личном кабинете, но в этом случае денежные средства за оплаченный период возвращены не будут",top_providers:"Топ-провайдеры",yhsupfytsy:"Вы ещё не настроили цены на Ваши торговые сигналы",configure:"Настроить",tsba:"Торговые сигналы по счёту",yhsupfcy:"Вы ещё не настроили цены на контент",user_content:"Контент пользователя",ltysn:"Ссылки на Ваши соц. сети",save:"Сохранить",iipt:"Средний доход на сделку",iutct:"Доход по контракту",tanot:"Cейчас нет открытых сделок",nedfs:"Данных для статистики не достаточно",comparison_by_instruments:"Сравнение по инструментам",mtsir:"Move the SL when it reaches",at_the_level:"На уровень",timeframe:"Таймфрейм",open:"Открыть",instruments_catalog:"Каталог инструментов",nothing_here_yet:"Здесь пока ничего нет!",stdif:"Выберите нужный инструмент из каталога инструментов.",section_in_development:"Раздел в разработке",academy:"Академия",tsdas:"В данном разделе отображается вся статистика и аналитика по Вашим сделкам и по сделкам провайдеров торговых сигналов. А еще здесь Вы можете осуществлять торговые операции.",stmaiy:"Выберете интересующие Вас рынки и инструменты, и система построит графики, и предоставит актуальную информацию по открытым и закрытым позициям.",uasofg:"Используйте набор графических инструментов для анализа, следите за актуальными новостными данными и макроэкономическими показателями, стримами и видеоконференции прямо на графике.",otssb:"Наблюдайте за настроением рынка, которое задают провайдеры торговых сигналов. Выбирайте лучших из них, копируйте и добавляйте в свои портфели.",market_section:"Раздел 'Рынок'",dsam:"Больше не показывать",ucee:"Неожиданная ошибка исполнения кода.",invalid_operation:"Недопустимая операция.",npoaes:"Отсутствует обработка ошибочной ситуации.",ifitatpto:"Недостаточно средств на счете для выполнения операции",uina:"Пользователь не авторизован",nerteto:"Недостаточно прав для выполнения операции",sufdtae:"Упало обновление сервиса по причине ошибки",tfcasc:"Таймаут ожидания завершения всех дел сервиса",sttaf:"Сохранение торгового счета не удалось",command_processing_error:"Ошибка обработки команды",nmowf:"Соответствующий объект не найден",tinntpaa:"Производить действие нет необходимости",not_implemented:"Не реализовано",tbcip:"Торговля по контракту запрещена",no_price:"Нет цены",tpiwtr:"Цена хуже запрошенной",ndtptr:"Нет дилера для обработки запроса",dealer_disconnected:"Дилер отключен",tvbmav:"Объем сделки меньше минимально допустимого значения",tvgtmva:"Объем сделки больше максимально допустимого значения",tvinabs:"Объем сделки не выровнен на величину шага",sotcnf:"Спецификации торгуемого контракта не найдены",sitcttm:"SL слишком близко к рынку",titctm:"TP слишком близко к рынку",rpirf:"Обработка запроса перенаправлена дальше",non_trade_hours:"Неторговые часы",tddnato:"Дилер не принял такой заказ",tspotpolinv:"Указаный период жизни отложенного ордера не валиден",ecooiidtpg:"Исполнение (закрытие) ордера невозможно ввиду ценового гэпа",tpiotc:"Цена вышла за рамки дозволенного",qinf:"Котировка не найдена",ecosowpe:"Исполнение (закрытие) нескольких ордеров выполнено частично",ttraroass:"Попытка выполнить запрос на остановленном Шарде",eosdafmtdhb:"Ошибка одновременного доступа к данным из нескольких потоков. Данные изменены и не актуальны",trtawnfits:"Искомый торговый счет не найден в системе",trewwnf:"Искомый обменный кошелек не найден",roipftcgc:"Выполняемая операция запрещена для данной категории группы контрактов",trifi:"Запрос сформирован некорректно",tmrpm:"Слишком много запросов в минуту",too_many_orders:"Слишком много ордеров",sms_confirmation_required:"Требуется смс для подтверждения",csinc:"Смс для подтверждения не верно",taiaaaa:"Счет уже активирован и присвоен",ahtbltea:"Требуется связать счет с имеющимся",toibplacbma:"Ордер в процессе обработки, залочен и не может быть модифицирован в данный момент",tmoo:"Слишком много открытых ордеров",tmpo:"Слишком много отложенных ордеров",nbwtiwf:"Брокер по данному ID не найден",nuftbaawf:"Пользователь по данному брокеру и счету не найден",tcphbattps:"Созданный портфель добавлен в раздел “Портфели”.",oo:"из",lbt:"Лимиты по сделкам",tscia:"Данный раздел содержит информацию о Вас и Вашей стратегии, подробную торговую статистику и аналитику по каждому Вашему счету, данные по Вашим подпискам и подписчикам, отчеты.",apgit:"Все Провайдеры попадают в подраздел Топов - площадку для продажи торговых сигналов. Здесь другие пользователи могут найти и копировать торговые сигналы провайдера, а также добавлять провайдеров в состав портфеля и создавать индивидуальные инвестиционные решения исходя из области своих интересов в финансовых рынках.",tbpft:"Лучшие провайдеры формируют Топы - готовые решения по набору торговых сигналов одного или нескольких провайдеров, которое формирует система исходя из заданных параметров по инструментам и по % успешных сделок.",tscds:"Раздел содержит подробную статистику и аналитику по всем портфелям торговых сигналов провайдеров, которые Вы создаете, а также информацию о готовых решениях - Топы",ycsup:"Вы можете произвести настройку тестового варианта портфеля по выбранным провайдерам, капиталу, настроить манименеджмент и риски, а так же управлять активными портфелями.",portfolio_section:"Раздел 'Портфель'",tops_section:"Раздел топы",profile_section:"Раздел профиль",trscd:"Раздел “Отчёт” содержит детальную информацию по каждому счёту пользователя за выбранный период по дню, неделе или месяцу:",sota:"Статистику по счету",hotoo:"Историю торговых операций по закрытым и открытым позициям пользователя",iastt:"Информацию о подписках на торговые сигналы провайдеров, как по инструментам, так и в составе портфелей",iotus:"Информацию по подписчикам пользователя и по доходу от подписок",feoua:"Для удобства использования вся информация представлена в видео таблице и графиков с соответствующими подсказками",report_section:"Раздел “Отчет”",oropa:"Открытые сделки провайдеров и лимит количества доступных для открытия сделок по портфелю",anopaetaa10:"Превышено допустимое количество попыток ввода пароля. Попробуйте повторить ввод через 10 минут.",btit:"Транслировать сделки в Телеграм",cltta:"Канал привязанный к счету",account_for_broadcasting:"Счет для трансляции",channel_name:"Имя канала",tsubo:"Для настройки трансляции отчетов по Вашим сделкам в канал/группу Телеграм вам необходимо создать канал/группу и добавить туда бота ",tetno:"После ввести имя созданной группы в поле выше и нажать кнопку “Подключить”.",ycact:"Вы всегда сможете изменить настройки в ",personal_cabinet:"Личном кабинете",detailed_instruction:"Подробная инструкция",connect:"Подключить",tcial:"Канал уже привязан к другому счету",btinf:"Бот ttPlatformBot не найден в канале, либо канал не существует",top:"Топ",available_funds:"Свободные средства счета",reserved_amount:"Зарезервированная сумма",wpofdyptiit:"Какой процент средств планируете инвестировать в Портфель?",wpofdyptiii:"Какой процент средств планируете инвестировать в инструменты?",iail:"Сумма инвестирования с учетом кредитного плеча",afpdap:"Сумма копирования пропорционально распределена между провайдерами",afpdai:"Сумма копирования пропорционально распределена между инструментами",total_contracts:"Всего контрактов",instruments_for_copying:"Инструменты для копирования",sisotep:"Выберите инструменты отдельно или весь портфель:",fitf:"Заполните поле",wptbd:"Мы подготовили для Вас лучшие предложения для инвестирования. Перетащите сюда карточку Топа, Портфеля или Провайдера и нажмите “Копировать”.",iatbo:"Также лучшие предложения Вы всегда найдете в правой части сайта.",start_earning:"Начните зарабатывать!",yanii:"Пока Вы не инвестируете в Топы, Портфели или Провайдеров. Начните это, нажав кнопку “Копировать” в интересных Вам предложениях.",start_trading:"Начните торговать!",tinedt:"Для построения графика недостаточно данных. Начните совершать сделки и в этом разделе Вы увидите торговую аналитку",comparison_by_account:"Сравнение по счету",subscribed_to_groups:"Подписан на группы",my_groups:"Мои группы",groups_archive:"Архив групп",favorites:"Избранное",contacts:"Контакты",black_list:"Черный список",support:"Техподдержка",agbi:"Группы аналитики по инструменту",tools:"Инструменты",tanuw:"Пользователей с задаными параметрами нет",sfagoc:"Поиск группы или контакта",groups:"Группы",hjtg:"присоеденился к группе",added_to_group:"добавлен в группу",removed_from_group:"удалён из группы",left_the_group:"покинул группу",taat:"Администратор добавил теги",acga:"Администратор сменил аватар группы",acgnt:"Администратор сменил название группы на",blocked:"заблокирован",owner:"(Owner)",delete_message:"Удалить сообщение",reply:"Ответить",write:"Написать",remove_from_group:"Удалить из группы",complain:"Пожаловаться",typing:"печатает...",was_online:"был в сети",from_favorite:"Из Избранного",add_to_favorites:"В Избранное",unblock:"Разблокировать",block:"Заблокировать",remove_from_list:"Удалить из списка",add_Members:"Добавить участников",group_members:"Участники группы",conference:"Конференция",leave_group:"Покинуть группу",about_the_group:"О группе",archive:"Архив",delete_group:"Удалить группу",unzip:"Разархивировать",mute_sound:"Отключить звук",post_a_chat:"Закрепить чат",hide_chat:"Скрыть чат",you_cannot_write:"Вы не можете писать",tuhly:"Пользователь залокировал Вас",yhbtu:"Вы заблокировали пользователя",sttc:"Подписаться на канал",take_photo_video:"Снять Фото/Видео",record_audio:"Записать Аудио",attach_file:"Прикрепить Файл",save_on_computer:"Сохранить на компьютер",select_a_file:"Выбрать файл",or_drag_file:"Или перетащить файл сюда",send_file:"Отправить файл",photo_video_message:"Фото/Видео сообщение",nattc:"Нет доступа к камере! Проверьте разрешения на доступ к камере и исправность оборудования",ybdns:"Ваш браузер не поддерживает данную технологию. Поробуйте обновить ПО до последней версии или воспользуйтесь другим браузером",come_back:"Вернуться назад",add_description:"Добавить описание",send:"Отправить",to_take_a_photo:"Сделать снимок",record_video:"Записать видео",audio_message:"Аудио сообщение",start_recording:"Начать запись",stop_recording:"Остановить запись",aptf:"Добавить провайдера в избранное",ctpt:"Копировать торговые сделки провайдера",aapttcatit:"Добавить провайдера на график и отслеживать его сделки",rpff:"Удалить провайдера из избранных",pltv:"Вставьте ссылку для просмотра",invalid_link:"Неккоректная ссылка",search:"Поиск",not_found:"Не найдено",allStreams:"Все стримы",myStreams:"Мои стримы",streamName:"Название стрима",enterTheTitle:"Введите название",description:"Описание",enterTheDescription:"Введите описание",fieldIsRequired:"Поле обязательно к заполнению",dateOfTheBroadcast:"Нужно указать дату трансляции",startYourStream:"Начать свой стрим",startedStream:"Запустить стрим",deleteStream:"Удалить стрим",warnTooltipDeleteStream:"Вы точно хотите удалить стрим?",ownerStreamFilter:"Мои стримы",allStreamFilter:"Все стримы",freeAccess:"Свободный доступ",bySubscription:"По подписке",dateOfBeginning:"Дата начала",timeOfBeginning:"Время начала",startnNow:"Сейчас",schedule:"Запланировать",scheduledDateMust:"Запланированная дата не должна быть ранее текущей",resolution:"Разрешение",streamOnlySubscribers:"Стрим только для подписчиков",createStream:"Создать стрим",publicationPageGo:"Перейти на страницу публикации",started:"Начало",AddToFavorits:"Добавьте в избранное",tagsContracts:"Теги контрактов",selectContract:"Выбрать контракт",uploadYourPhoto:"Загрузите Вашу фотографию",tradingToolsConfigToolsList_quote:"Изменение за 24 часа",tradingToolsConfigToolsList_averPrice:"Средняя цена",tradingToolsConfigToolsList_compact:"Компактный вид",portfolio_launched:"Портфель запущен",portfolio_stopped:"Портфель остановлен",portfolio_did_not_launch:"Портфель не запускался",daily_report:"Дневной отчет",weekly_report:"Недельный отчет",monthly_report:"Отчет за месяц",daily_gain:"прирост за день",weekly_growth:"прирост за неделю",growth_per_month:"прирост за месяц",notifications:"Уведомления",wmdyp:"На каком рынке Вы предпочитаете торговать. Мы заранее создадим Вам демо-счет. Позже Вы сможете добавить демо-счет на любом рынке.",common:{successStatus:"Успешно",Deposit:"Депозит",Leverage:"Плечо",PayAttention:"Обратите внимание!","mon.":"мес.","d.":"д.","h.":"ч.",Cancel:"Отмена",Confirm:"Подтвердить","Confirm?":"Подтвердить?",select:{Placeholder:"Выберите...",PlaceholderCountry:"Выберите страну...",ChooseTheCountry:"Выберите страну",noData:"Нет данных для отображения",Followers:"Кол-во Ваших последователей"},Pay:"Оплатить",PayNow:"Оплатить сейчас",Account:"Счет",Country:"Страна",SendRequest:"Отправить запрос",Watch:"Смотреть",Stop:"Прекратить",Start:"Начать",Understand:"Понятно",RussianRuble:"₽ - Российские рубли",Continue:"Продолжить"},personalArea:{PersonalAccount:"Личный Кабинет",ProfileCreated:"Профиль создан",sidebar:{MyData:"Данные",TelegramReports:"Отчеты в Телеграм",Signals:"Настройка торговых сигналов",Partner:"Партнерская программа",TradingAccounts:"Торговые счета",Payments:"Платежи",Verification:"Верификация",Devices:"Устройства",Documents:"Документы"},personalMyData:{public:{PublicInformation:"Публичная Информация",PersonalName:"Имя Фамилия",FirstName:"Имя",Surname:"Фамилия",Avatar:"Аватар",AboutMe:"Обо мне",AboutPlaceholder:"Расскажите о себе",Country:"Страна",City:"Город",Timezone:"Время",WebSite:"Веб-сайт"},auth:{Auth:"Аутентификация",Login:"Логин",MobilePhone:"Телефон",Email:"E-mail",ChangePassword:"Сменить пароль",CurrentPassword:"Текущий пароль",CheckPassword:"Проверить пароль",NewPass:"Новый пароль",AcceptNewPass:"Принять",TooManyTries:"Слишком много попыток, попробуйте позже.",WrongPassword:"Неверный пароль.",Setup:"Настроить",TurnOff:"Отключить",TwoFA:"Двухфакторная авторизация:",GoogleAuth:"Google Authenticator",GoogleAuthSuccess:"Двухфакторная авторизация Google Authenticator успешно настроена",GoogleAuthRemoved:"Двухфакторная авторизация Google Authenticator отключена"},currency:{Currency:"Валюта",CurrencyDisclaimer:"Укажите тип валюты для расчета за ваши услуги:"}},personalTradingAccounts:{ConnectMT5:"Подключить MT5",ConnectAccount:"Подключить счет",NewDemoAccount:"Новый Демо-счет",CreateDemoAccount:"Создать Демо-счет",DemoAccountCreated:"Демо-счет создан!",ToNewAccount:"К новому счету",CreateMore:"Создать еще",DeleteDemoAccount:"Удалить Демо-счет",CaptionHedging:"Тип счета - “Хеджинг” (Одновременная торговля в лонг и в шорт направлении)",CaptionPeriod:"После создания Демо-счета начнется отсчет бесплатного периода - 1 мес.",CaptionPayment:"По окончании которого потребуется оплата - 500 ₽/месяц.",GetPaidMore:"Как зарабатывать больше?",CaptionPaidMore:["Если вы хотите зарабатывать на продаже своих торговых сигналов или контента необходимо пройти ","верификацию","и стать провайдером торговых сигналов."],PassVerification:"Пройти верификацию",CaptionHourglassPeriod:"Идет пробный период по этому счету",CaptionHourglassPayment:"По окончанию пробного периода необходимо оплатить подписку по этому счету",AccountCurrency:"Валюта счета",AmountToTopUp:"Сумма для пополнения",TopUpAccountBalance:"Пополнить баланс счета",TopUpBalance:"Пополнить баланс",BalanceReplenishedSuccessfully:"Вы успешно пополнили баланс",SetAsDefaultAccount:"Сделать счетом по умолчанию",DeletedSuccessfully:"Удаление прошло успешно",CannotDeleteWhilePublished:"Вы не можете удалить счет так как у него есть источники сигналов."},personalPayments:{tscstt:"Общая сумма: комиссия за копирование + подписка ТТ",TTSubscriptionPayment:"Оплата подписки ТТ",TotalSum:"Сумма оплаты",TimeInterval:"Временной интервал",PaymentPurpose:"Назначение платежа",PortfolioTopProvider:"Портфель / Топ / Провайдер",PortfolioWorkingPeriod:"Время работы портфеля",NetIncome:"Чистый доход",YouDoNotInvest:"Вы не инвестируете!",ydnhip:"У Вас пока нет инвестиций в портфели, топы или провайдеров. Начните инвестировать в разделе “Топы” или “Инвестиции”",PaymentsHistory:"История платежей",Payment:"Оплата",YouSave:"Вы экономите",CopyingFee:"Оплата копирования",iypflp:"При оплате за больший период Вы получите скидку",Endless:"Бесконечный",Ended:"Закончился",Nosub:"Нет подписки",noHistoryAccount:"Для этого счета история платежей отсутствует",payedPeriodTill:"Оплачено до:",AccountNotSelected:"Счет не выбран",noDataAccount:"Нет данных для этого счета",months:{Month:"1 Месяц","3 Month":"3 Месяца","6 Month":"6 Месяцев","9 Month":"9 Месяцев","12 Month":"12 Месяцев","24 Month":"24 Месяца"}},personalVerification:{FullName:"Ф.И.О.",Broker:"Ваш брокер",Experience:"Опыт работы",Followers:"Последователи",Markets:"Рынки",AccountType:"Тип счета",Passport:"Паспорт",vaass:"Верификация в качестве продавца услуг",tualay:"Расскажите немного о себе, опишите Ваш опыт работы на торговых рынках.",PhotoPage:"страница с фото",MarkedFieldsRequired:["Поля отмеченые","являются обязательными"],matiy:"Отметьте интересующие Вас направления. Чем Вам интересно заниматься на платформе TopTrader?",rbsgafAnalyst:"Вести блоги, стримы и группы о финансах (Аналитик)",tmmmstProvider:"Торговать на рынках и зарабатывать на продаже торговых сигналов (Провайдер)"},personalSignals:{FixedPaymentPM:"Фиксированнная оплата в месяц (MF), $",PercentOfSuccess:"% от успеха (SF)",InvestWarning:"Вы инвестируете по данному счету. Стать провайдером сигналов с активными портфелями нельзя. Остановите все запущенные портфели.",TradesWarning50:"Для добавления инструментов в настройку стоимости необходимо в разделе “Рынок” совершить не менее 50 сделок по новому инструменту",VideoInstruction:"Видеоинструкция",PublishTradeSignals:" публиковать торг. сигналы",NotAProviderAnymore:" теперь не является провайдером",RemoveAccountProviderStatus:"Вы уверены, что хотите снять статус “счет-провайдер” со счета ",PopupCaption1:"Обратите внимание, что при пользовании счетом-провайдером функция инвестирования в других провайдеров недоступна.",PopupCaption2:"Для назначения цен на торговые сигналы по инструменту у Вас должно быть совершено не менее 50-ти сделок.",PopupCaption3:"Пользование TopTrader по этому счету станет бесплатным.",PopupCaption4:"Вы уверены, что хотите сделать счет счетом-провайдером торговых сигналов?",NoAccounts:"У Вас пока что нет счетов",OpenAccount:"Создать счет"},personalPartner:{tnbr:"Нет границ и ограничений!",iyftt:"Привлекайте друзей на платформу - и зарабатывайте!",dywtri:"Хотите получать доход от привлечения на TopTrader ваших друзей и знакомых, мгновенно получать до 50% от закрытых сделок привлеченного пользователя?",gurlqi:"Генерируйте уникальную реферальную ссылку (или qrcode). Приглашайте по этой ссылке новых пользователей - и выводите деньги на свой счет!",anawvc:"Для получения всех комиссионных будет создан новый счет. Вознаграждение начисляется раз в сутки по итогу каждого дня. В любой момент Вы сможете вывести средтсва в любой банк или перевести на торговый счет внутри платформы.",anawvcpd:"Для получения всех комиссионных будет создан новый счет. Вознаграждение начисляется раз в сутки.",aatycwf:"В любой момент Вы сможете вывести средства или перевести на торговый счет внутри платформы.",ReferralLink:"Реферальная ссылка",Generate:"Сгенерировать",YourLink:"Ваша ссылка",BecomeToptraderPartner:"Становитесь партнером TopTrader!",BecomePartner:"Стать партнером",PaidToPartners:"Выплачено партнерам",Referrals:"Число рефералов",ReferralPercent:"Реферальный процент",CommissionRate:"Ставка комиссионных",CommissionSum:"Общая сумма комиссионных",AvailableForWithdrawal:"Доступно для вывода",ValidityPeriod:"Срок действия",TotalCommissionAmount:"Общая сумма комиссионных",Agreement:["Я подтверждаю, что прочитал(а) и согласен с","Соглашение о партнерской программе"],documents:{HeadPart1:"Соглашение о партнерской программе",HeadPart2:"Правила партнерства",PartnerRules1:"Если вы будете уличены в приглашении пользователей, уже имеющих аккаунты на TopTrader, или в совершении других мошеннических действий, TopTrader лишит вас партнерского статуса и снизит размер вознаграждения до 0%.",PartnerRules2:"Если будет установлено, что вы тайно предлагаете комиссионные выше тех, что TopTrade предлагает другим, TopTrader аннулирует ваш партнерский статус и изменит ваш процент комиссионных до 0%.",PartnerRules3:"Если будет установлено, что вы пытались ввести пользователей в заблуждение с помощью фишинговых сайтов/страниц, похожих на сайт/страницы TopTrader, TopTrader аннулирует ваш партнерский статус и скорректирует процент комиссионных до 0%.",PartnerRules4:"Вам запрещается делать какие-либо вводящие в заблуждение заявления, включая, помимо прочего, попытки поисковой оптимизации с использованием таких ключевых слов,  связанных  с TopTrader. Нарушение этих правил влечет за собой конфискацию вознаграждений и лишение партнерского статуса.",PartnerRules5:"В любой момент компания TopTrader оставляет за собой право лишить партнера статуса, отменить его право на получение скидок, изменить процент скидок до 0%, вернуть все выплаченные скидки и подать иск о возмещении ущерба против партнеров, которые наносят какой-либо ущерб компании TopTrader, порочат компанию TopTrader или иным образом действуют против компании TopTrader.",RuleHeading1:"Это включает, помимо прочего, следующие обстоятельства:",Circum1:"Размещение ложной или негативной информации о компании TopTrader в социальных сетях. ",Circum2:"Организация экономических претензий к компании TopTrader.",MainRules1:"Компания TopTrader оставляет за собой право изменять, дополнять или отменять данные правила в любое время без предварительного уведомления. Продолжая пользоваться услугами данного сайта, вы подтверждаете свое согласие с данным соглашением. Если ваши действия не будут благоприятствовать компанииTopTrader, компания TopTrader оставляет за собой право изменять, дополнять или отменять данные правила в любое время без предварительного уведомления.",MainRules2:"Продолжая пользоваться услугами данного сайта, вы подтверждаете свое согласие с данным соглашением. Если ваши действия не будут благоприятствовать компании TopTrader, любое сотрудничество между вами и компанией TopTrader будет автоматически прекращено. Вопросы, не рассмотренные в настоящем документе, регулируются политикой компании TopTrader. оставляет за собой право изменять, дополнять или отменять данные правила в любое время без предварительного уведомления.",MainRules3:"Продолжая пользоваться услугами данного сайта, вы подтверждаете свое согласие с данным соглашением. Если ваши действия не будут благоприятствовать компании TopTrader, любое сотрудничество между вами и компанией TopTrader будет автоматически прекращено. Вопросы, не рассмотренные в настоящем документе, регулируются политикой компании TopTrader., любое сотрудничество между вами и компанией TopTrader будет автоматически прекращено. Вопросы, не рассмотренные в настоящем документе, регулируются политикой компании TopTrader. оставляет за собой право изменять, дополнять или отменять данные правила в любое время без предварительного уведомления. Продолжая пользоваться услугами данного сайта, вы подтверждаете свое согласие с данным соглашением. Если ваши действия не будут благоприятствовать компании TopTrader, любое сотрудничество между вами и компанией TopTrader будет автоматически прекращено. Вопросы, не рассмотренные в настоящем документе, регулируются политикой компании TopTrader."},tabs:{Referrals:"Referrals",YourIncome:"Your income",Settings:"Settings",Documentation:"Documentation"}},personalDevices:{DevicesSessions:"Устройства, на которых выполнен вход в ваш аккаунт",ChooseThisDeviceToLogOut:"Выберите это устройство, чтобы выполнить выход",ActiveSessions:"Активные сессии на устройствах:",caption1:"Показаны устройства, которые в данный момент имеют доступ к платформе под вашим аккаунтом. ",caption2:"Если Вы не узнаете хотя бы одно, обратитесь к администрации.",caption3:"Для завершения сеанса на всех устройствах нажмите кнопку ниже. Обратите внимание, что выход будет произведен и из устройства с которого Вы выполняете эти действия. ",LogOutAllDevices:"Выйти из всех устройств"}}},ha=i("a925"),pa=new o["default"];o["default"].use(ha["a"]);var ga="ru",fa=new ha["a"]({locale:ga,fallbackLocale:"ru"===ga?"en":ga,messages:{en:ua,ru:da}}),ma="en";function va(t){ma=t,pa.$emit("changeLanguageCode")}function ya(t,e){var i;switch(e){case"en":i=ua;break;case"ru":i=da;break}return i[t]}var Ca={props:{typeBtn:{type:String,default:"primary"},disable:{type:Boolean,required:!1,default:!1},modifier:{type:String},process:{type:Boolean,default:!1}},computed:{className:function(){return"button-"+this.typeBtn},isDisabled:function(){return!this.disable},classNameText:function(){return"button-"+this.typeBtn+"__text"},mod:function(){var t=this,e="",i=Object(D["a"])(e,2),o=i[0],n=i[1];return this.modifier?(o=this.modifier.split(" "),n=o.map((function(e){return"".concat(t.className,"--")+e})).join(" "),n):""}},mounted:function(){var t=this;this.$forceUpdate(),pa.$on("changeLanguageCode",(function(){t.$forceUpdate()}))},destroyed:function(){var t=this;pa.$off("changeLanguageCode",(function(){t.$forceUpdate()}))}},ba=Ca,Sa=(i("e67b"),Object(C["a"])(ba,ca,la,!1,null,"52c4ea80",null)),Pa=Sa.exports,Ta=(i("c96a"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"input-text",class:[{"input-text--small":t.small},{"input-text--prefixed":t.prefix}]},[t.label&&!t.small?e("label",{staticClass:"input-text__label"},[t._v(t._s(t.label))]):t._e(),e("span",{staticClass:"input-text__wrapper"},[t.prefix?e("span",{staticClass:"input-text__pre"},[t._v(t._s(t.prefix))]):t._e(),t.typePassword?e("input",t._b({staticClass:"input-text__control input-text--password",class:{"input-text__control--invalid":t.error},attrs:{placeholder:t.placeholderValue,type:t.typePass},domProps:{value:t.model},on:{blur:function(e){return t.validate(t.pattern,t.model)},input:function(e){return t.$emit("input",e.target.value)},keydown:function(e){return t.isCapsLock(e)},keyup:function(e){return t.onKeyup(e)}}},"input",t.$attrs,!1)):e("input",t._b({staticClass:"input-text__control",class:{"input-text__control--invalid":t.error},attrs:{placeholder:t.placeholderValue,type:t.type},domProps:{value:t.model},on:{blur:function(e){return t.validate(t.pattern,t.model)},input:function(e){return t.onInput(e,t.pattern)},keydown:function(e){return t.isCapsLock(e)},keyup:function(e){return t.onKeyup(e)}}},"input",t.$attrs,!1)),t.small?t._e():e("span",{staticClass:"input-text__placeholder"},[t._v(t._s(t.placeholder))]),t.typePassword?e("span",{staticClass:"input-text__icon"},[e("Button-icon",{attrs:{modifier:"flat square",iconName:t.iconPassword},on:{toggle:t.toggleShowPassword}})],1):t._e(),!t.typePassword&&t.icon?e("span",{staticClass:"input-text__icon",on:{mouseover:t.hoverHandler,mouseleave:t.leaveHandler}},[e("Button-icon",{attrs:{modifier:"flat square",iconName:t.icon}})],1):t._e(),t.process?e("div",{staticClass:"input-text__loader"},[e("span"),e("span"),e("span")]):t._e(),t.clear&&t.clearShow?e("span",{staticClass:"input-text__clear",on:{click:t.clearInput}},[e("svgIcon",{attrs:{name:"Close-order"}})],1):t._e()]),t.caps&&t.typePassword?e("span",{staticClass:"input-text__helper",class:{"input-text__helper--warning":t.caps}},[e("span",[e("SvgIcon",{attrs:{name:"Warning"}}),t._v(" "+t._s(t.warningText))],1)]):t._e(),t.error?e("span",{staticClass:"input-text__helper"},[e("span",[e("SvgIcon",{attrs:{name:"Warning"}})],1),e("span",[t._v(t._s(t.errorText))])]):t._e(),t.errorTextServer?e("span",{staticClass:"input-text__helper"},[e("span",[e("SvgIcon",{attrs:{name:"Warning"}}),t._v(" "+t._s(t.errorTextServer))],1)]):t._e()])}),xa=[],Oa={components:{SvgIcon:L,ButtonIcon:Nt},inheritAttrs:!1,data:function(){return{error:!1,val:this.model,caps:!1,iconPassword:"Show-on",typePass:"password",show:!1,process:!1,clearShow:!1}},model:{prop:"model"},props:{model:{type:[String,Number]},type:{type:String,default:"text"},label:{type:String},icon:{type:String},placeholder:{type:String},errorText:{type:String,default:"Ошибка"},warningText:{type:String,default:"Включен “Caps Lock”"},errorTextServer:{type:String},pattern:{type:String},placeholderValue:[String,Number],small:{type:Boolean,default:!1},typePassword:{type:Boolean,Default:!1},load:{type:Boolean},isError:{type:Boolean},prefix:{type:String},clear:{type:Boolean,default:!1}},watch:{isError:function(){this.error=!0===this.isError},show:function(){this.show?(this.iconPassword="Show-off",this.typePass="text"):(this.iconPassword="Show-on",this.typePass="password")},load:function(){!0===this.load?this.process=!0:this.process=!1}},methods:{validate:function(t,e){var i=new RegExp(t);i.test(e)?this.error=!1:this.error=!0,this.$emit("patternValid",i.test(e))},onInput:function(t,e){this.$emit("input",t.target.value),this.validate(e,t.target.value)},toggleShowPassword:function(){this.show=!this.show},isCapsLock:function(t){t.getModifierState&&(this.caps=t.getModifierState("CapsLock"))},hoverHandler:function(){this.$emit("hover")},leaveHandler:function(){this.$emit("leave")},onKeyup:function(t){this.$emit("keyup",t)},clearInput:function(){this.$emit("clearInput")}}},wa=Oa,_a=(i("8bf47"),Object(C["a"])(wa,Ta,xa,!1,null,null,null)),Aa=_a.exports,Da=function(){var t=this,e=t._self._c;return e("div",{staticClass:"radio-button"},[e("label",{staticClass:"radio-button__label"},[e("input",{staticClass:"radio-button__input",attrs:{type:"radio"},domProps:{checked:t.shouldBeChecked,value:t.value},on:{change:t.updateInput}}),e("span",{class:"radio-button__icon radio-button__icon_".concat(t.theme)},[e("svgIcon",{attrs:{name:t.iconName}})],1),e("span",{class:"radio-button__text radio-button__text_".concat(t.theme)},[t._t("default")],2)])])},ka=[],Ia={model:{prop:"modelValue",event:"change"},props:{value:{type:[String,Number]},theme:{default:"light",type:String},modelValue:{default:""}},computed:{shouldBeChecked:function(){return this.modelValue===this.value},iconName:function(){return this.modelValue===this.value?"Radiobutton-on":"Radiobutton-off"}},methods:{updateInput:function(){this.$emit("change",this.value)}}},Ba=Ia,Ma=(i("f6de"),Object(C["a"])(Ba,Da,ka,!1,null,null,null)),$a=Ma.exports,La=function(){var t=this,e=t._self._c;return e("div",{staticClass:"tooltip",class:["tooltip--".concat(t.pos),{"tooltip--open":t.open}]},[e("div",{staticClass:"tooltip__content"},[t._t("content")],2),t.outside?t._e():e("div",{staticClass:"tooltip__component"},[t._t("default")],2)])},Fa=[],ja={props:{pos:{type:String,default:"center"},open:{type:Boolean},outside:{type:Boolean}}},Ra=ja,Wa=(i("7cc6"),Object(C["a"])(Ra,La,Fa,!1,null,null,null)),Na=Wa.exports,Ea=(i("498a"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-steps__step"},[e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group-label heading-modal"},[t._v(t._s(t.$t("ynas")))]),e("div",{staticClass:"form-control-fieldName"},[e("DxTextBox",{attrs:{height:"60",labelMode:"static","value-change-event":"input",label:t.$t("name"),hoverStateEnabled:!1,activeStateEnabled:!1},model:{value:t.regName,callback:function(e){t.regName="string"===typeof e?e.trim():e},expression:"regName"}}),t.validName?e("span",{staticClass:"text-error"},[t._v(t._s(t.validName))]):t._e()],1),e("div",{staticClass:"form-control-surname"},[e("DxTextBox",{attrs:{labelMode:"static",height:"60","value-change-event":"input",label:t.$t("surname"),hoverStateEnabled:!1},model:{value:t.lastName,callback:function(e){t.lastName="string"===typeof e?e.trim():e},expression:"lastName"}}),t.validSurName?e("span",{staticClass:"text-error"},[t._v(t._s(t.validSurName))]):t._e()],1),e("div",{staticClass:"form-group-label heading-modal"},[t._v(t._s(t.$t("market")))]),e("div",{staticClass:"form-control-selectBox",class:"form-control-selectBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"form-control-checkboxInput"},[e("DxSelectBox",{attrs:{items:t.markets,value:"Crypto",hoverStateEnabled:!1,activeStateEnabled:!1,onValueChanged:t.setMarket}})],1),e("div",{staticClass:"textCheckbox",class:"textCheckbox_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("wmdyp")))])]),e("div",{staticClass:"form-control-checkbox"},[e("div",{staticClass:"checkbox"},[e("DxCheckBox",{attrs:{elementAttr:{class:"checkBoxCustom"}},model:{value:t.agree,callback:function(e){t.agree=e},expression:"agree"}})],1),e("div",{staticClass:"textCheckbox",class:"textCheckbox_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("brycttpopda"))+" "),e("a",{attrs:{href:t.linkForDocks,target:"_blank"}},[t._v(t._s(t.$t("study_the_document")))]),e("br"),t._v(" "+t._s(t.$t("rtpsctpdpac"))+" "),e("a",{attrs:{href:t.linkForDocks,target:"_blank"}},[t._v(t._s(t.$t("here"))+".")])])]),e("div",{staticClass:"footer"},[e("DxButton",{key:"nextButtonReg",attrs:{width:"100%",height:"48",type:"default",disabled:t.disableButtonNext,elementAttr:{class:"buttonNextPopup"},text:t.$t("next")},on:{click:t.nextStep}})],1)]),t.profi?e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group-label"},[t._v(t._s(t.$t("anat")))]),e("div",{staticClass:"form-control"},[e("Input-text",{attrs:{placeholder:"Номер счета"},model:{value:t.ID,callback:function(e){t.ID=e},expression:"ID"}})],1),e("div",{staticClass:"form-control"},[e("div",{staticClass:"form-label"},[t._v(t._s(t.$t("trader")))]),e("div",{staticClass:"select"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.broker,expression:"broker"}],on:{change:function(e){var i=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.broker=e.target.multiple?i:i[0]}}},[e("option",{attrs:{selected:""}},[t._v(t._s(t.broker))]),t._l(t.options,(function(i,o){return e("option",{key:o,domProps:{value:i.name}},[t._v(t._s(i.name))])}))],2)])])]):t._e()])}),Ua=[],Va=function(){var t=this,e=t._self._c;return e("div",{class:"checkbox checkbox_".concat(t.getActiveTheme)},[e("label",{staticClass:"checkbox__label",attrs:{for:"check"+t._uid}},[e("input",{staticClass:"checkbox__input",attrs:{type:"checkbox",name:t.name,id:"check"+t._uid},domProps:{checked:t.state,value:t.value},on:{change:t.onChange}}),t.starMode?e("div",{class:"checkbox__icon checkbox__icon_".concat(t.getActiveTheme)},[t.state?e("svgIcon",{attrs:{name:"Favorite-on"}}):e("svgIcon",{attrs:{name:"Favorite"}})],1):e("div",{class:"checkbox__icon checkbox__icon_".concat(t.getActiveTheme),style:{color:t.state?t.colorState:"",width:"".concat(t.size,"px"),height:"".concat(t.size,"px")}},[t.state?e("svgIcon",{attrs:{name:"Checkbox-on",size:t.size}}):e("svgIcon",{attrs:{name:"Checkbox-off",size:t.size}})],1),t.$slots.default?e("div",{staticClass:"checkbox__text"},[t._t("default")],2):t._e()])])},Ha=[],Ga={data:function(){return{iconName:"Checkbox-off",check:this.cheked}},model:{prop:"modelValue",event:"change"},props:{name:{type:String,default:null},size:{type:Number,default:24},value:{default:null},colorState:{default:""},modelValue:{default:void 0},checked:{type:Boolean,default:!1},starMode:{type:Boolean},model:{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{state:function(){return void 0===this.modelValue?this.checked:this.modelValue instanceof Array?this.modelValue.indexOf(this.value)>-1:!!this.modelValue}}),methods:{onChange:function(){this.toggle()},upDate:function(){this.checked&&!this.state&&this.toggle()},toggle:function(){var t;this.modelValue instanceof Array?(t=this.modelValue.slice(0),this.state?t.splice(t.indexOf(this.value),1):t.push(this.value)):t=!this.state,this.$emit("change",t)}},watch:{checked:function(t){t!==this.state&&this.toggle()}},mounted:function(){this.checked&&!this.state&&this.toggle()}},qa=Ga,za=(i("6299"),Object(C["a"])(qa,Va,Ha,!1,null,null,null)),Ya=za.exports,Xa="dataRegistration";function Qa(){return JSON.parse(sessionStorage.getItem(Xa))}function Ja(t,e){var i=Qa()||{};i[e]=Object(c["a"])(Object(c["a"])({},i[e]),t),sessionStorage.setItem(Xa,JSON.stringify(i))}function Ka(){sessionStorage.removeItem(Xa)}var Za={name:"nameAndSurnameStep",components:{Checkbox:Ya,Tooltip:Na,ButtonIcon:Nt,DxTextBox:wt["DxTextBox"],DxButton:wt["DxButton"],DxCheckBox:wt["DxCheckBox"],DxSelectBox:wt["DxSelectBox"]},props:{activity:{type:String},theme:{type:String}},data:function(){return{ID:"",broker:"Выберите брокера",options:[{id:"1",name:"trader 1"},{id:"2",name:"trader 2"},{id:"3",name:"trader 3"},{id:"4",name:"trader 4"},{id:"5",name:"trader 5"},{id:"6",name:"trader 6"}],markets:["Crypto","Forex"],market:"Crypto",regName:"",lastName:"",role:[],profi:!1,validName:"",validSurName:"",agree:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getNumberStepsForRegistration:"modal/getNumberStepsForRegistration",getActiveTheme:"headerSettings/getActiveTheme"})),{},{patternRules:function(){return"^[А-Яа-яЁё-]+$|^[a-zA-Z\\s]+$"},disableButtonNext:function(){return[!this.agree,!this.regName,!this.lastName,this.validName,this.validSurName].some(Boolean)},linkForDocks:function(){return"https://about.toptrader.ru/docs/"}}),watch:{activity:function(t){this.role.push(t)},regName:function(t){this.validName=!new RegExp(this.patternRules).test(t)&&this.$t("fitf")},lastName:function(t){this.validSurName=!new RegExp(this.patternRules).test(t)&&this.$t("fitf")}},methods:{validDataName:function(){var t=Boolean(this.validName&&this.validSurName);this.$emit("validNameAndSurname",{firstName:this.regName,lastName:this.lastName,role:1,valid:t})},onInputName:function(t){this.validName=t,this.validDataName()},onInputSurName:function(t){this.validSurName=t,this.validDataName()},setMarket:function(t){this.market=t.value},toggleModalActivity:function(){this.$emit("mouseover")},nextStep:function(){this.agree&&(Ja({firstName:this.regName,lastName:this.lastName},"user"),Ja({UserId:(new Date).toISOString(),Balance:1e5,accountGroupCode:"Crypto"===this.market?"CryptoDemo":"Demo",assetCode:"Crypto"===this.market?"USDT":"USD",Leverage:50},"account"),this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"LoginAndPass",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:2}))}}},tc=Za,ec=(i("bd53"),Object(C["a"])(tc,Ea,Ua,!1,null,null,null)),ic=ec.exports,oc=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"form-steps__step"},[t.emailExist?t._e():e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-control d-flex flex-vertical"},[e("DxTextBox",{directives:[{name:"debounce",rawName:"v-debounce:1s",value:t.checkUnic,expression:"checkUnic",arg:"1s"}],staticClass:"mb-16",attrs:{labelMode:"static",height:"60","value-change-event":"input",label:t.$t("login"),inputAttr:{id:"Login"},hoverStateEnabled:!1},model:{value:t.login,callback:function(e){t.login="string"===typeof e?e.trim():e},expression:"login"}}),e("ErrorText",{attrs:{text:t.invalidLogin,visible:Boolean(t.invalidLogin)}}),t.loginExist?t._e():e("span",{staticClass:"form-control__legend mt-0 mb-16 modal-legend"},[t._v(t._s(t.$t("saunuoll")))])],1)]),t.loginExist?t._e():e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-control"},[e("DxTextBox",{directives:[{name:"debounce",rawName:"v-debounce:1s",value:t.checkUnic,expression:"checkUnic",arg:"1s"}],staticClass:"mb-16",attrs:{labelMode:"static",height:"60","value-change-event":"input",label:t.$t("email_address"),inputAttr:{id:"Email"},hoverStateEnabled:!1},model:{value:t.email,callback:function(e){t.email="string"===typeof e?e.trim():e},expression:"email"}}),e("ErrorText",{attrs:{text:t.invalidEmail,visible:Boolean(t.invalidEmail)}})],1)]),t.loginExist||t.emailExist?e("div",[e("DxButton",{key:"ButtonGoToAuth",attrs:{width:"100%",height:"48",type:"success",elementAttr:{class:"buttonLogin greenButton"},text:t.$t("login"),icon:t.$iconPath("new-entry")},on:{click:t.goToAuthorization}}),e("a",{staticClass:"form-link mb-16 mt-0 forgotPass",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showRecoverPassModal.apply(null,arguments)}}},[t._v(t._s(t.$t("forgot_your_password")))])],1):e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group-label mb-16 heading-modal"},[t._v(t._s(t.$t("set_password")))]),e("PassAndConfirmPass",{attrs:{password:t.pass,passwordRepeat:t.pass2},on:{valueChanged:t.valueChangedPass,invalid:t.invalidPass}})],1)]),e("div",{staticClass:"footer"},[e("DxButton",{key:"buttonBackLoginPassword",attrs:{height:"48",type:"normal",elementAttr:{class:"buttonOutlined"},text:t.$t("back")},on:{click:t.goBackPreviousPage}}),e("DxButton",{key:"buttonNextLoginPassword",attrs:{height:"48",type:"default",disabled:t.disabledButtonNext,elementAttr:{class:"buttonNext"},text:t.$t("next")},on:{click:t.nextStep}})],1)])},nc=[],sc=i("e614"),rc=i.n(sc),ac=i("6191"),cc=i.n(ac),lc=function(){var t=this,e=t._self._c;return t.visible?e("span",{staticClass:"text-error"},[e("SvgIcon",{attrs:{name:"Warning"}}),t._v(t._s(t.text))],1):t._e()},uc=[],dc={name:"ErrorText",props:{visible:{type:[Boolean,String],default:!1},text:{type:[Boolean,String],default:""}},components:{SvgIcon:L}},hc=dc,pc=(i("f805"),Object(C["a"])(hc,lc,uc,!1,null,"8c63ce5c",null)),gc=pc.exports,fc=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PassAndConfirmPassAccount"},[e("div",{staticClass:"form-control"},[e("DxTextBox",{staticClass:"mb-16",attrs:{height:"60",labelMode:"static","value-change-event":"keyup",label:t.$t("password"),mode:t.passwordMode,value:t.password,hoverStateEnabled:!1},on:{"value-changed":function(e){return t.valueChanged(e,"pass")}}},[e("PasswordViewButton",{attrs:{mode:t.passwordMode},on:{click:function(e){return t.setTypeInput("passwordMode")}}})],1),e("ErrorText",{attrs:{text:t.invalidPass,visible:Boolean(t.invalidPass)}})],1),e("div",{staticClass:"form-control mt-16"},[e("DxTextBox",{staticClass:"mb-16",attrs:{height:"60",labelMode:"static","value-change-event":"keyup",label:t.$t("confirm_password"),mode:t.passwordModeConfirm,value:t.passwordRepeat,hoverStateEnabled:!1},on:{"value-changed":function(e){return t.valueChanged(e,"pass2")}}},[e("PasswordViewButton",{attrs:{mode:t.passwordModeConfirm},on:{click:function(e){return t.setTypeInput("passwordModeConfirm")}}})],1),e("ErrorText",{attrs:{text:t.$t("pdnm"),visible:t.invalidPassRepeat}}),e("span",{staticClass:"form-control__legend mb-16 mt-0 modal-legend"},[t._v(t._s(t.$t("pmcal8cinua")))])],1)])},mc=[],vc=function(){var t=this,e=t._self._c;return e("span",{staticClass:"iconWrapper",on:{click:t.setTypeInput}},[e("svgIcon",{attrs:{name:t.getIconPassword,viewBox:"0 0 24 24"}})],1)},yc=[],Cc={name:"PasswordViewButton",props:{mode:{type:String}},components:{SvgIcon:L},computed:{getIconPassword:function(){return"text"===this.mode?"Show-off":"Show-on"}},methods:{setTypeInput:function(){this.$emit("click")}}},bc=Cc,Sc=(i("41ea"),Object(C["a"])(bc,vc,yc,!1,null,"4f91a8df",null)),Pc=Sc.exports,Tc={name:"PassAndConfirmPass",props:{password:String,passwordRepeat:String},components:{DxTextBox:sc["DxTextBox"],PasswordViewButton:Pc,ErrorText:gc},data:function(){return{passwordMode:"password",passwordModeConfirm:"password",invalidPass:!1,invalidPassRepeat:!1}},watch:{password:function(t){var e=/^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._\-\{}\[\]~\<\>\?]{8,}$/g,i=/(?=.*[A-Z])/g,o=/(?=.*[a-z])/g,n=/[0-9]+?/g;t.length<8?this.invalidPass=this.$t("mpl8c"):i.test(t)&&o.test(t)?n.test(t)?e.test(t)?this.invalidPass=!1:this.invalidPass=this.$t("llnassaa"):this.invalidPass=this.$t("tpmcalod"):this.invalidPass=this.$t("tpmcualcl"),this.invalidPassRepeat=Boolean(t!==this.passwordRepeat)},passwordRepeat:function(t){this.invalidPassRepeat=Boolean(t!==this.password)},invalidPass:function(t){this.$emit("invalid",Boolean(t||this.invalidPassRepeat))},invalidPassRepeat:function(t){this.$emit("invalid",Boolean(t||this.invalidPass))}},methods:{setTypeInput:function(t){this[t]="text"===this[t]?"password":"text"},valueChanged:function(t,e){var i=t.value;this.$emit("valueChanged",{value:i,name:e})}}},xc=Tc,Oc=(i("9034"),Object(C["a"])(xc,fc,mc,!1,null,"fd45ed90",null)),wc=Oc.exports,_c={components:{DxTextBox:sc["DxTextBox"],DxButton:ac["DxButton"],PassAndConfirmPass:wc,ErrorText:gc},data:function(){return{login:"",email:"",pass:"",pass2:"",loginPattern:"^[A-Za-z0-9_.]+$",loginPatternSymbol:"^\\d+$",emailPattern:"^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]+$",loginExist:!1,emailExist:!1,invalidLogin:!1,invalidEmail:!1,invalidPasswords:!1,additionalDataCheckUser:{}}},watch:{login:function(t){var e=new RegExp(this.loginPatternSymbol).test(t),i=!new RegExp(this.loginPattern).test(t);this.invalidLogin=e?this.$t("lmcalol"):!!i&&this.$t("invalid_format")},email:function(t){this.invalidEmail=!new RegExp(this.emailPattern).test(t)&&this.$t("invalid_format")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({urlApi:"api/api",getNumberStepsForRegistration:"modal/getNumberStepsForRegistration"})),{},{disabledButtonNext:function(){return[!this.invalidLogin,this.login,!this.invalidEmail,this.email,!this.invalidPasswords,this.pass,this.pass2].some((function(t){return!t}))}}),methods:{checkUnic:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(n=e.target.id,s="invalid"+n,a=n.toLowerCase(),c=a+"Exist",o.prev=4,i[s]){o.next=14;break}return o.next=8,i.$http.post("".concat(i.urlApi,"CheckUser"),Object(Vt["a"])({},a,t));case 8:l=o.sent,u=l.data,i[c]=u[c],u[c]&&("login"===a?i.invalidLogin=i.$t("tlaeploeado"):i.invalidEmail=i.$t("teaeploeado"),i.additionalDataCheckUser={userId:u.usersInfo[0].id,role:u.usersInfo[0].role}),o.next=15;break;case 14:i[c]=!1;case 15:o.next=19;break;case 17:o.prev=17,o.t0=o["catch"](4);case 19:case"end":return o.stop()}}),o,null,[[4,17]])})))()},goToAuthorization:function(){var t=this.loginExist?this.login:this.email,e=JSON.stringify(Object(c["a"])({dataLogin:t},this.additionalDataCheckUser));localStorage.setItem("dataExist",e),this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},goBackPreviousPage:function(){if(this.loginExist||this.emailExist)return this.login=this.loginExist?"":this.login,this.loginExist&&(this.loginExist=!1),this.email=this.emailExist?"":this.login,void(this.emailExist&&(this.emailExist=!1));this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"NameAndSurnameStep",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:1})},valueChangedPass:function(t){var e=t.value,i=t.name;this[i]=e},invalidPass:function(t){this.invalidPasswords=t},nextStep:function(){Ja({login:this.login,email:this.email,password:this.pass},"user"),this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ValidPhone",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:3})},showRecoverPassModal:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalRecoverPass",title:"password_recovery"})}}},Ac=_c,Dc=(i("0563"),Object(C["a"])(Ac,oc,nc,!1,null,"2e549074",null)),kc=Dc.exports,Ic=function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-steps__step"},[e("div",{staticClass:"form-group-valid-phone"},[e("div",{staticClass:"form-group-title-valid-phone heading-modal"},[t._v(t._s(t.$t("registration_confirmation")))]),t.disabledButtonRegistration?e("div",{staticClass:"form-group-title-valid-phone choise-confirmation"},[e("Radio",{attrs:{theme:t.getActiveTheme,value:"phone",modelValue:t.confirmationMode},on:{change:t.setModeConfirmation}},[t._v("По телефону")]),e("Radio",{attrs:{theme:t.getActiveTheme,value:"email",modelValue:t.confirmationMode},on:{change:t.setModeConfirmation}},[t._v("По email")])],1):t._e(),e("div",{staticClass:"form-control form-control--phone"},["phone"===t.confirmationMode?e("PhoneFieldWithMask",{attrs:{phone:t.phone,phoneCode:t.phoneCode,"current-mask":t.currentMask,disabled:t.statusValidCodeFormat},on:{inputChanged:t.inputPhoneHandler,selectionChanged:t.setMask}}):e("DxTextBox",{staticClass:"mb-16",attrs:{value:t.getEmail,disabled:!0,labelMode:"static",height:"60","value-change-event":"input",label:t.$t("email_address"),inputAttr:{id:"Email"},hoverStateEnabled:!1}})],1),t.statusValidCodeFormat?[e("span",{staticClass:"registration-permission"},[t._v(t._s(t.$t("tcicptrbtf")))])]:t.sendedPhone||t.existPhone?t.sendedPhone&&!t.existPhone?[e("ConfirmationCodeAndTimer",{attrs:{timer:t.timer},on:{timerEnd:t.endTimerCode},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),e("ErrorText",{attrs:{text:t.$t(t.validCodeServerError?"septal":"invalid_code"),visible:!t.statusValidCode||t.validCodeServerError}}),e("div",{staticClass:"code-buttons"},[e("DxButton",{key:"buttonVarifyCode",attrs:{height:"32",width:"100%",type:"default",elementAttr:{class:"buttonVarifyCode"},disabled:t.disabledCheckCodeButton,text:t.$t("check_code")},on:{click:t.varifyCode}}),e("DxButton",{key:"buttonForRepeatSms",attrs:{height:"32",width:"100%",type:"normal",elementAttr:{class:"buttonOutlined"},disabled:t.buttonRepeatSmsDisable,text:t.$t("resend"),icon:t.$iconPath("Reset")},on:{click:t.setTimeoutForRepeatSms}})],1)]:[e("ErrorText",{attrs:{text:t.$t("tpniarots"),visible:!0}})]:[e("DxButton",{key:"buttonSendCode",attrs:{height:"48",width:"100%",type:"default",elementAttr:{class:"buttonSendCode"},disabled:t.getDidabledStatusForSnedCode},on:{click:t.setTimeoutForRepeatSms},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("send_code"),isLoading:t.isLoading}})]},proxy:!0}])}),e("span",{staticClass:"form-control__legend mb-16 modal-legend"},[t._v(t._s(t.$t("accwbsttspn")))])]],2),e("div",{staticClass:"footer"},[t.statusValidCodeFormat?t._e():e("DxButton",{key:"buttonBackLoginPassword",attrs:{height:"48",type:"normal",elementAttr:{class:"buttonOutlined"},text:t.$t("back")},on:{click:t.goBackPreviousPage}}),t.existPhone?e("DxButton",{key:"ButtonGoToAuthFromPhoneConfirm",attrs:{height:"48",type:"success",elementAttr:{class:"buttonLogin greenButton"},text:t.$t("log_in"),icon:t.$iconPath("new-entry")},on:{click:t.goToAuthorization}}):e("DxButton",{key:"buttonRegisterFinish",attrs:{height:"48",type:"default",disabled:t.disabledButtonRegistration,elementAttr:t.classesForButtonNext},on:{click:t.register},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("registration"),isLoading:t.isLoadingReg}})]},proxy:!0}])})],1)])},Bc=[],Mc=(i("466d"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-countdown",class:t.classDark},[t._v(t._s(t.count<10?"0"+t.count:t.count)+" : "+t._s(t.seconds<10?"0"+t.seconds:t.seconds))])}),$c=[],Lc={props:{minutes:{default:2}},data:function(){return{seconds:59,count:this.minutes,timeOut:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{classDark:function(){return{dark:"dark"===this.getActiveTheme}}}),methods:{startTimer:function(){var t=this;0===this.count&&0===this.seconds?this.$emit("timerEnd",this.updateTimer):setTimeout((function(){t.count>=0&&(t.seconds--,t.seconds<0&&(t.seconds=59,t.count--),t.startTimer())}),1e3)},updateTimer:function(){this.seconds=59,this.count=this.minutes,this.startTimer()}},mounted:function(){this.startTimer()},beforeDestroy:function(){}},Fc=Lc,jc=(i("d775"),Object(C["a"])(Fc,Mc,$c,!1,null,"1e7596b6",null)),Rc=jc.exports,Wc=[{ID:"ru",country:"Russia (Россия)",phoneCode:"+7",mask:"(###) ###-##-##"},{ID:"us",country:"United States",phoneCode:"+1",mask:"(###) ###-####"},{ID:"gb",country:"United Kingdom",phoneCode:"+44",mask:"##-####-####"},{ID:"de",country:"Germany (Deutschland)",phoneCode:"+49",mask:"(###) ###-#####"},{ID:"cn",country:"China (中国)",phoneCode:"+86",mask:"(###) ####-####"},{ID:"af",country:"Afghanistan (افغانستان)",phoneCode:"+93",mask:"##-###-####"},{ID:"al",country:"Albania (Shqipëri)",phoneCode:"+355",mask:"(###) ###-###"},{ID:"dz",country:"Algeria (الجزائر)",phoneCode:"+213",mask:"##-###-####"},{ID:"as",country:"American Samoa",phoneCode:"+1684",mask:"###-####"},{ID:"ad",country:"Andorra",phoneCode:"+376",mask:"###-###"},{ID:"ao",country:"Angola",phoneCode:"+244",mask:"(###) ###-###"},{ID:"ai",country:"Anguilla",phoneCode:"+1264",mask:"###-####"},{ID:"ag",country:"Antigua and Barbuda",phoneCode:"+1268",mask:"###-####"},{ID:"ar",country:"Argentina",phoneCode:"+54",mask:"(###) ###-####"},{ID:"am",country:"Armenia (Հայաստան)",phoneCode:"+374",mask:"##-###-###"},{ID:"aw",country:"Aruba",phoneCode:"+297",mask:"###-####"},{ID:"ac",country:"Ascension Island",phoneCode:"+247",mask:"####"},{ID:"au",country:"Australia",phoneCode:"+61",mask:"#-####-####"},{ID:"at",country:"Austria (Österreich)",phoneCode:"+43",mask:"(###) ###-####"},{ID:"az",country:"Azerbaijan (Azərbaycan)",phoneCode:"+994",mask:"##-###-##-##"},{ID:"bs",country:"Bahamas",phoneCode:"+1242",mask:"###-####"},{ID:"bh",country:"Bahrain (البحرين)",phoneCode:"+973",mask:"####-####"},{ID:"bd",country:"Bangladesh (বাংলাদেশ)",phoneCode:"+880",mask:"##-###-###"},{ID:"bb",country:"Barbados",phoneCode:"+1246",mask:"###-####"},{ID:"by",country:"Belarus (Беларусь)",phoneCode:"+375",mask:"(##) ###-##-##"},{ID:"be",country:"Belgium (België)",phoneCode:"+32",mask:"(###) ###-###"},{ID:"bz",country:"Belize",phoneCode:"+501",mask:"###-####"},{ID:"bj",country:"Benin (Bénin)",phoneCode:"+229",mask:"##-##-####"},{ID:"bm",country:"Bermuda",phoneCode:"+1441",mask:"###-####"},{ID:"bt",country:"Bhutan (འབྲུག)",phoneCode:"+975",mask:"#-###-###"},{ID:"bo",country:"Bolivia",phoneCode:"+591",mask:"#-###-####"},{ID:"ba",country:"Bosnia and Herzegovina (Босна и Херцеговина)",phoneCode:"+387",mask:"##-#####"},{ID:"bw",country:"Botswana",phoneCode:"+267",mask:"##-###-###"},{ID:"br",country:"Brazil (Brasil)",phoneCode:"+55",mask:"(##) ####-####"},{ID:"vg",country:"British Virgin Islands",phoneCode:"+1284",mask:"###-####"},{ID:"bn",country:"Brunei",phoneCode:"+673",mask:"###-####"},{ID:"bg",country:"Bulgaria (България)",phoneCode:"+359",mask:"(###) ###-###"},{ID:"bf",country:"Burkina Faso",phoneCode:"+226",mask:"##-##-####"},{ID:"bi",country:"Burundi (Uburundi)",phoneCode:"+257",mask:"##-##-####"},{ID:"kh",country:"Cambodia (កម្ពុជា)",phoneCode:"+855",mask:"##-###-###"},{ID:"cm",country:"Cameroon (Cameroun)",phoneCode:"+237",mask:"####-####"},{ID:"ca",country:"Canada",phoneCode:"+1",mask:"(###) ###-####"},{ID:"cv",country:"Cape Verde (Kabu Verdi)",phoneCode:"+238",mask:"(###) ##-##"},{ID:"bq",country:"Caribbean Netherlands",phoneCode:"+599",mask:"###-####"},{ID:"ky",country:"Cayman Islands",phoneCode:"+1345",mask:"###-####"},{ID:"cf",country:"Central African Republic (République centrafricaine)",phoneCode:"+236",mask:"##-##-####"},{ID:"td",country:"Chad (Tchad)",phoneCode:"+235",mask:"##-##-##-##"},{ID:"cl",country:"Chile",phoneCode:"+56",mask:"#-####-####"},{ID:"cx",country:"Christmas Island",phoneCode:"+6189164",mask:"####"},{ID:"cc",country:"Cocos (Keeling) Islands",phoneCode:"+6189162",mask:"####"},{ID:"co",country:"Colombia",phoneCode:"+57",mask:"(###) ###-####"},{ID:"km",country:"Comoros (جزر القمر)",phoneCode:"+269",mask:"##-#####"},{ID:"cd",country:"Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",phoneCode:"+243",mask:"(###) ###-###"},{ID:"cg",country:"Congo (Republic) (Congo-Brazzaville)",phoneCode:"+242",mask:"##-###-####"},{ID:"ck",country:"Cook Islands",phoneCode:"+682",mask:"##-###"},{ID:"cr",country:"Costa Rica",phoneCode:"+506",mask:"####-####"},{ID:"ci",country:"Côte d’Ivoire",phoneCode:"+225",mask:"##-###-###"},{ID:"hr",country:"Croatia (Hrvatska)",phoneCode:"+385",mask:"##-###-###"},{ID:"cu",country:"Cuba",phoneCode:"+53",mask:"#-###-####"},{ID:"cw",country:"Curaçao",phoneCode:"+599",mask:"###-####"},{ID:"cy",country:"Cyprus (Κύπρος)",phoneCode:"+357",mask:"##-###-###"},{ID:"cz",country:"Czech Republic (Česká republika)",phoneCode:"+420",mask:"(###) ###-###"},{ID:"dk",country:"Denmark (Danmark)",phoneCode:"+45",mask:"##-##-##-##"},{ID:"dj",country:"Djibouti",phoneCode:"+253",mask:"##-##-##-##"},{ID:"dm",country:"Dominica",phoneCode:"+1767",mask:"###-####"},{ID:"do",country:"Dominican Republic (República Dominicana)",phoneCode:"+1",mask:"(###) ###-####"},{ID:"ec",country:"Ecuador",phoneCode:"+593",mask:"##-###-####"},{ID:"eg",country:"Egypt (مصر)",phoneCode:"+20",mask:"(###) ###-####"},{ID:"sv",country:"El Salvador",phoneCode:"+503",mask:"##-##-####"},{ID:"gq",country:"Equatorial Guinea (Guinea Ecuatorial)",phoneCode:"+240",mask:"##-###-####"},{ID:"er",country:"Eritrea",phoneCode:"+291",mask:"#-###-###"},{ID:"ee",country:"Estonia (Eesti)",phoneCode:"+372",mask:"####-####"},{ID:"sz",country:"Eswatini",phoneCode:"+268",mask:"##-##-####"},{ID:"et",country:"Ethiopia",phoneCode:"+251",mask:"##-###-####"},{ID:"fk",country:"Falkland Islands (Islas Malvinas)",phoneCode:"+500",mask:"#####"},{ID:"fo",country:"Faroe Islands (Føroyar)",phoneCode:"+298",mask:"###-###"},{ID:"fj",country:"Fiji",phoneCode:"+679",mask:"##-#####"},{ID:"fi",country:"Finland (Suomi)",phoneCode:"+358",mask:"(###) ###-##-##"},{ID:"fr",country:"France",phoneCode:"+33",mask:"(###) ###-###"},{ID:"gf",country:"French Guiana (Guyane française)",phoneCode:"+594",mask:"#####-####"},{ID:"pf",country:"French Polynesia (Polynésie française)",phoneCode:"+689",mask:"##-##-##"},{ID:"ga",country:"Gabon",phoneCode:"+241",mask:"#-##-##-##"},{ID:"gm",country:"Gambia",phoneCode:"+220",mask:"(###) ##-##"},{ID:"ge",country:"Georgia (საქართველო)",phoneCode:"+995",mask:"(###) ###-###"},{ID:"gh",country:"Ghana (Gaana)",phoneCode:"+233",mask:"(###) ###-###"},{ID:"gi",country:"Gibraltar",phoneCode:"+350",mask:"###-#####"},{ID:"gr",country:"Greece (Ελλάδα)",phoneCode:"+30",mask:"(###) ###-####"},{ID:"gl",country:"Greenland (Kalaallit Nunaat)",phoneCode:"+299",mask:"##-##-##"},{ID:"gd",country:"Grenada",phoneCode:"+1473",mask:"###-####"},{ID:"gp",country:"Guadeloupe",phoneCode:"+590",mask:"(###) ###-###"},{ID:"gu",country:"Guam",phoneCode:"+1671",mask:"###-####"},{ID:"gt",country:"Guatemala",phoneCode:"+502",mask:"#-###-####"},{ID:"gg",country:"Guernsey",phoneCode:"+441481",mask:"##-####"},{ID:"gn",country:"Guinea (Guinée)",phoneCode:"+224",mask:"##-###-###"},{ID:"gw",country:"Guinea-Bissau (Guiné Bissau)",phoneCode:"+245",mask:"#-######"},{ID:"gy",country:"Guyana",phoneCode:"+592",mask:"###-####"},{ID:"ht",country:"Haiti",phoneCode:"+509",mask:"##-##-####"},{ID:"hn",country:"Honduras",phoneCode:"+504",mask:"####-####"},{ID:"hk",country:"Hong Kong (香港)",phoneCode:"+852",mask:"####-####"},{ID:"hu",country:"Hungary (Magyarország)",phoneCode:"+36",mask:"(###) ###-###"},{ID:"is",country:"Iceland (Ísland)",phoneCode:"+354",mask:"###-####"},{ID:"in",country:"India (भारत)",phoneCode:"+91",mask:"(####) ###-###"},{ID:"id",country:"Indonesia",phoneCode:"+62",mask:"##-###-##"},{ID:"ir",country:"Iran (ایران)",phoneCode:"+98",mask:"(###) ###-####"},{ID:"iq",country:"Iraq (العراق)",phoneCode:"+964",mask:"(###) ###-####"},{ID:"ie",country:"Ireland",phoneCode:"+353",mask:"(###)###-###"},{ID:"il",country:"Israel (ישראל)",phoneCode:"+972",mask:"##-###-####"},{ID:"it",country:"Italy (Italia)",phoneCode:"+39",mask:"(###) ####-###"},{ID:"jm",country:"Jamaica",phoneCode:"+1876",mask:"###-####"},{ID:"jp",country:"Japan (日本)",phoneCode:"+81",mask:"##-####-####"},{ID:"jo",country:"Jordan (الأردن)",phoneCode:"+962",mask:"#-####-####"},{ID:"kz",country:"Kazakhstan (Казахстан)",phoneCode:"+77",mask:"##-###-##-##"},{ID:"ke",country:"Kenya",phoneCode:"+254",mask:"###-######"},{ID:"ki",country:"Kiribati",phoneCode:"+686",mask:"##-###"},{ID:"kw",country:"Kuwait (الكويت)",phoneCode:"+965",mask:"####-####"},{ID:"kg",country:"Kyrgyzstan (Кыргызстан)",phoneCode:"+996",mask:"(###) ###-###"},{ID:"la",country:"Laos (ລາວ)",phoneCode:"+856",mask:"##-###-###"},{ID:"lv",country:"Latvia (Latvija)",phoneCode:"+371",mask:"##-###-###"},{ID:"lb",country:"Lebanon (لبنان)",phoneCode:"+961",mask:"##-###-###"},{ID:"ls",country:"Lesotho",phoneCode:"+266",mask:"#-###-####"},{ID:"lr",country:"Liberia",phoneCode:"+231",mask:"##-###-###"},{ID:"ly",country:"Libya (ليبيا)",phoneCode:"+218",mask:"##-###-###"},{ID:"li",country:"Liechtenstein",phoneCode:"+423",mask:"(###) ###-####"},{ID:"lt",country:"Lithuania (Lietuva)",phoneCode:"+370",mask:"(###) ##-###"},{ID:"lu",country:"Luxembourg",phoneCode:"+352",mask:"(###) ###-###"},{ID:"mo",country:"Macau (澳門)",phoneCode:"+853",mask:"####-####"},{ID:"mk",country:"Macedonia (Македонија)",phoneCode:"+389",mask:"##-###-###"},{ID:"mg",country:"Madagascar (Madagasikara)",phoneCode:"+261",mask:"##-##-#####"},{ID:"mw",country:"Malawi",phoneCode:"+265",mask:"#-####-####"},{ID:"my",country:"Malaysia",phoneCode:"+60",mask:"##-###-####"},{ID:"mv",country:"Maldives",phoneCode:"+960",mask:"###-####"},{ID:"ml",country:"Mali",phoneCode:"+223",mask:"##-##-####"},{ID:"mt",country:"Malta",phoneCode:"+356",mask:"####-####"},{ID:"mh",country:"Marshall Islands",phoneCode:"+692",mask:"###-####"},{ID:"mq",country:"Martinique",phoneCode:"+596",mask:"(###) ##-##-##"},{ID:"mr",country:"Mauritania (موريتانيا)",phoneCode:"+222",mask:"##-##-####"},{ID:"mu",country:"Mauritius (Moris)",phoneCode:"+230",mask:"###-####"},{ID:"yt",country:"Mayotte",phoneCode:"+262",mask:"#####-####"},{ID:"mx",country:"Mexico (México)",phoneCode:"+52",mask:"(###) ###-####"},{ID:"fm",country:"Micronesia",phoneCode:"+691",mask:"###-####"},{ID:"md",country:"Moldova (Republica Moldova)",phoneCode:"+373",mask:"####-####"},{ID:"mc",country:"Monaco",phoneCode:"+377",mask:"####-####"},{ID:"mn",country:"Mongolia (Монгол)",phoneCode:"+976",mask:"##-##-####"},{ID:"me",country:"Montenegro (Crna Gora)",phoneCode:"+382",mask:"##-###-###"},{ID:"ms",country:"Montserrat",phoneCode:"+1664",mask:"###-####"},{ID:"ma",country:"Morocco (المغرب)",phoneCode:"+212",mask:"##-####-###"},{ID:"mz",country:"Mozambique (Moçambique)",phoneCode:"+258",mask:"##-###-###"},{ID:"mm",country:"Myanmar (Burma) (မြန်မာ)",phoneCode:"+95",mask:"##-###-###"},{ID:"na",country:"Namibia (Namibië)",phoneCode:"+264",mask:"##-###-####"},{ID:"nr",country:"Nauru",phoneCode:"+674",mask:"###-####"},{ID:"np",country:"Nepal (नेपाल)",phoneCode:"+977",mask:"##-###-###"},{ID:"nl",country:"Netherlands (Nederland)",phoneCode:"+31",mask:"##-###-####"},{ID:"nc",country:"New Caledonia (Nouvelle-Calédonie)",phoneCode:"+687",mask:"##-####"},{ID:"nz",country:"New Zealand",phoneCode:"+64",mask:"(###) ###-###"},{ID:"ni",country:"Nicaragua",phoneCode:"+505",mask:"####-####"},{ID:"ne",country:"Niger (Nijar)",phoneCode:"+227",mask:"##-##-####"},{ID:"ng",country:"Nigeria",phoneCode:"+234",mask:"(###) ###-####"},{ID:"nu",country:"Niue",phoneCode:"+683",mask:"####"},{ID:"nf",country:"Norfolk Island",phoneCode:"+672",mask:"###-###"},{ID:"kp",country:"North Korea (조선 민주주의 인민 공화국)",phoneCode:"+850",mask:"##-###-###"},{ID:"mp",country:"Northern Mariana Islands",phoneCode:"+1670",mask:"###-####"},{ID:"no",country:"Norway (Norge)",phoneCode:"+47",mask:"(###) ##-###"},{ID:"om",country:"Oman (عُمان)",phoneCode:"+968",mask:"##-###-###"},{ID:"pk",country:"Pakistan (پاکستان)",phoneCode:"+92",mask:"(###) ###-####"},{ID:"pw",country:"Palau",phoneCode:"+680",mask:"###-####"},{ID:"ps",country:"Palestine (فلسطين)",phoneCode:"+970",mask:"##-###-####"},{ID:"pa",country:"Panama (Panamá)",phoneCode:"+507",mask:"###-####"},{ID:"pg",country:"Papua New Guinea",phoneCode:"+675",mask:"(###) ##-###"},{ID:"py",country:"Paraguay",phoneCode:"+595",mask:"(###) ###-###"},{ID:"pe",country:"Peru (Perú)",phoneCode:"+51",mask:"(###) ###-###"},{ID:"ph",country:"Philippines",phoneCode:"+63",mask:"(###) ###-####"},{ID:"pl",country:"Poland (Polska)",phoneCode:"+48",mask:"(###) ###-###"},{ID:"pt",country:"Portugal",phoneCode:"+351",mask:"##-###-####"},{ID:"pr",country:"Puerto Rico",phoneCode:"+1",mask:"(###) ###-####"},{ID:"qa",country:"Qatar (قطر)",phoneCode:"+974",mask:"####-####"},{ID:"re",country:"Réunion (La Réunion)",phoneCode:"+262",mask:"#####-####"},{ID:"ro",country:"Romania (România)",phoneCode:"+40",mask:"##-###-####"},{ID:"rw",country:"Rwanda",phoneCode:"+250",mask:"(###) ###-###"},{ID:"bl",country:"Saint Barthélemy",phoneCode:"+590",mask:"(###) ###-###"},{ID:"sh",country:"Saint Helena",phoneCode:"+290",mask:"####"},{ID:"kn",country:"Saint Kitts and Nevis",phoneCode:"+1869",mask:"###-####"},{ID:"lc",country:"Saint Lucia",phoneCode:"+1758",mask:"###-####"},{ID:"pm",country:"Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)",phoneCode:"+508",mask:"##-####"},{ID:"vc",country:"Saint Vincent and the Grenadines",phoneCode:"+1784",mask:"###-####"},{ID:"ws",country:"Samoa",phoneCode:"+685",mask:"##-####"},{ID:"sm",country:"San Marino",phoneCode:"+378",mask:"####-######"},{ID:"st",country:"São Tomé and Príncipe (São Tomé e Príncipe)",phoneCode:"+239",mask:"##-#####"},{ID:"sa",country:"Saudi Arabia (المملكة العربية السعودية)",phoneCode:"+966",mask:"#-###-####"},{ID:"sn",country:"Senegal (Sénégal)",phoneCode:"+221",mask:"##-###-####"},{ID:"rs",country:"Serbia (Србија)",phoneCode:"+381",mask:"##-###-####"},{ID:"sc",country:"Seychelles",phoneCode:"+248",mask:"#-###-###"},{ID:"sl",country:"Sierra Leone",phoneCode:"+232",mask:"##-######"},{ID:"sg",country:"Singapore",phoneCode:"+6565",mask:"#######"},{ID:"sx",country:"Sint Maarten",phoneCode:"+1721",mask:"###-####"},{ID:"sk",country:"Slovakia (Slovensko)",phoneCode:"+421",mask:"(###) ###-###"},{ID:"si",country:"Slovenia (Slovenija)",phoneCode:"+386",mask:"##-###-###"},{ID:"sb",country:"Solomon Islands",phoneCode:"+677",mask:"#####"},{ID:"so",country:"Somalia (Soomaaliya)",phoneCode:"+252",mask:"##-###-###"},{ID:"za",country:"South Africa",phoneCode:"+27",mask:"##-###-####"},{ID:"kr",country:"South Korea (대한민국)",phoneCode:"+82",mask:"##-###-####"},{ID:"ss",country:"South Sudan (جنوب السودان)",phoneCode:"+211",mask:"##-###-####"},{ID:"es",country:"Spain (España)",phoneCode:"+34",mask:"(###) ###-###"},{ID:"lk",country:"Sri Lanka (ශ්&රී ලංකාව)",phoneCode:"+94",mask:"##-###-####"},{ID:"sd",country:"Sudan (السودان)",phoneCode:"+249",mask:"##-###-####"},{ID:"sr",country:"Suriname",phoneCode:"+597",mask:"###-####"},{ID:"se",country:"Sweden (Sverige)",phoneCode:"+46",mask:"##-###-####"},{ID:"ch",country:"Switzerland (Schweiz)",phoneCode:"+41",mask:"##-###-####"},{ID:"sy",country:"Syria (سوريا)",phoneCode:"+963",mask:"##-####-###"},{ID:"tw",country:"Taiwan (台灣)",phoneCode:"+886",mask:"####-####"},{ID:"tj",country:"Tajikistan",phoneCode:"+992",mask:"##-###-####"},{ID:"tz",country:"Tanzania",phoneCode:"+255",mask:"##-###-####"},{ID:"th",country:"Thailand (ไทย)",phoneCode:"+66",mask:"##-###-###"},{ID:"tl",country:"Timor-Leste",phoneCode:"+670",mask:"###-####"},{ID:"tg",country:"Togo",phoneCode:"+228",mask:"##-###-###"},{ID:"tk",country:"Tokelau",phoneCode:"+690",mask:"####"},{ID:"to",country:"Tonga",phoneCode:"+676",mask:"#####"},{ID:"tt",country:"Trinidad and Tobago",phoneCode:"+1868",mask:"###-####"},{ID:"tn",country:"Tunisia (تونس)",phoneCode:"+216",mask:"##-###-###"},{ID:"tr",country:"Turkey (Türkiye)",phoneCode:"+90",mask:"(###) ###-####"},{ID:"tm",country:"Turkmenistan",phoneCode:"+993",mask:"#-###-####"},{ID:"tc",country:"Turks and Caicos Islands",phoneCode:"+1649",mask:"###-####"},{ID:"tv",country:"Tuvalu",phoneCode:"+688",mask:"#####"},{ID:"vi",country:"U.S. Virgin Islands",phoneCode:"+1340",mask:"###-####"},{ID:"ug",country:"Uganda",phoneCode:"+256",mask:"(###) ###-###"},{ID:"ua",country:"Ukraine (Україна)",phoneCode:"+380",mask:"(##) ###-##-##"},{ID:"ae",country:"United Arab Emirates (الإمارات العربية المتحدة)",phoneCode:"+971",mask:"#-###-#####"},{ID:"uy",country:"Uruguay",phoneCode:"+598",mask:"#-###-##-##"},{ID:"uz",country:"Uzbekistan (Oʻzbekiston)",phoneCode:"+998",mask:"##-###-####"},{ID:"vu",country:"Vanuatu",phoneCode:"+678",mask:"#####"},{ID:"va",country:"Vatican City (Città del Vaticano)",phoneCode:"+396698",mask:"#####"},{ID:"ve",country:"Venezuela",phoneCode:"+58",mask:"(###) ###-####"},{ID:"vn",country:"Vietnam (Việt Nam)",phoneCode:"+84",mask:"##-####-###"},{ID:"wf",country:"Wallis and Futuna (Wallis-et-Futuna)",phoneCode:"+681",mask:"##-####"},{ID:"ye",country:"Yemen (اليمن)",phoneCode:"+967",mask:"#-###-###"},{ID:"zm",country:"Zambia",phoneCode:"+260",mask:"##-###-####"},{ID:"zw",country:"Zimbabwe",phoneCode:"+263",mask:"#-######"}],Nc=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dx-button-content"},[t.isLoading?t._e():[e("div",{staticClass:"wraptextIcon"},[t.iconName?e("i",{staticClass:"dx-icon dx-svg-icon"},[e("svgIcon",{attrs:{name:t.iconName}})],1):t._e(),e("span",{staticClass:"dx-button-text"},[t._v(t._s(t.text))])])],t.isLoading?[e("div",{staticClass:"loader-container"},[e("ButtonLoader")],1)]:t._e()],2)},Ec=[],Uc=function(){var t=this;t._self._c;return t._m(0)},Vc=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"button__loader"},[e("span"),e("span"),e("span")])}],Hc=(i("5c71"),{}),Gc=Object(C["a"])(Hc,Uc,Vc,!1,null,null,null),qc=Gc.exports,zc={name:"LoadingForButton",components:{svgIcon:L,ButtonLoader:qc},props:{iconName:{type:String},text:{type:String},isLoading:{type:Boolean,default:!1}}},Yc=zc,Xc=(i("7076"),Object(C["a"])(Yc,Nc,Ec,!1,null,"9ff193a8",null)),Qc=Xc.exports,Jc=function(){var t=this,e=t._self._c;return e("div",{key:t.currentMask,staticClass:"containter-phone-field"},[e("DxTextBox",{attrs:{label:t.$t("phone"),labelMode:"static",height:"60","min-height":"60",disabled:t.disabled,elementAttr:t.elementAttrForTextBoxPhoneSelect,mask:t.currentMask,"value-change-event":"input",onValueChanged:t.inputHandler,useMaskedValue:!1,value:t.phone,hoverStateEnabled:!1}}),e("DxSelectBox",{attrs:{"data-source":t.phoneList,value:t.phoneCode,"value-expr":"phoneCode",elementAttr:{class:"selectBoxPhoneNumbers"},dropDownOptions:{height:300,width:440},"on-selection-changed":t.setMask,"field-template":"field","item-template":"item",disabled:t.disabled},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"custom-item"},[e("div",{staticClass:"iti-flag",class:o.ID}),e("span",{staticClass:"phoneCode"},[t._v(t._s(o.phoneCode))]),e("DxTextBox",{attrs:{value:o&&o.phoneCode,"read-only":!0,inputAttr:{hidden:!0}}})],1)]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"custom-item",class:t.darkClass},[e("div",{staticClass:"phone-name"},[e("strong",[t._v(t._s(o.phoneCode)+" ")]),e("div",{staticClass:"iti-flag",class:o.ID}),t._v(" "+t._s(o.country))])])]}}])})],1)},Kc=[],Zc={name:"PhoneFieldWithMask",props:{phone:{type:String},phoneCode:{type:String},currentMask:{type:String},dataSource:{type:Array},disabled:{type:Boolean,default:!1}},components:{DxSelectBox:Bo.a,DxTextBox:rc.a},data:function(){return{phoneList:Wc,firstSelect:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},elementAttrForTextBoxPhoneSelect:function(){var t;switch(this.phoneCode.length){case 2:t=56;break;case 3:t=68;break;case 4:t=75;break;case 5:t=82;break;case 6:t=92;break;case 7:t=102;break;case 8:t=107;break;default:t=56}return{class:"textBoxPhoneSelect",style:"padding-left: ".concat(t,"px")}}}),methods:{setMask:function(t){this.firstSelect?this.$emit("selectionChanged",t):this.firstSelect=!0},inputHandler:function(t){this.$emit("inputChanged",t.value)}}},tl=Zc,el=(i("2cb3"),Object(C["a"])(tl,Jc,Kc,!1,null,null,null)),il=el.exports,ol=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrap-code-field"},[e("DxTextBox",{attrs:{width:"168",height:"60",mask:"0000",labelMode:"static",label:t.$t("confirmation_code"),elementAttr:{class:"textBoxCode"},value:t.value,"value-change-event":"keyup",hoverStateEnabled:!1},on:{"value-changed":t.changeHandler}}),e("div",{staticClass:"wrap-timer"},[e("div",{staticClass:"text-timer modal-legend"},[t._v(t._s(t.$t("code_validity_time"))+":")]),e("Timer",{on:{timerEnd:t.endTimerCode}})],1)],1)},nl=[],sl={name:"ConfirmationCodeAndTimer",props:{timer:{type:Boolean},value:String},components:{DxTextBox:rc.a,Timer:Rc},data:function(){return{}},methods:{endTimerCode:function(t){this.$emit("timerEnd",t)},changeHandler:function(t){this.$emit("input",t.value)}}},rl=sl,al=(i("8303"),Object(C["a"])(rl,ol,nl,!1,null,null,null)),cl=al.exports,ll={components:{Radio:$a,Timer:Rc,DxTextBox:rc.a,DxButton:ac["DxButton"],ErrorText:gc,LoadingForButton:Qc,PhoneFieldWithMask:il,ConfirmationCodeAndTimer:cl},data:function(){return{code:"",confirmationMode:"phone",statusValidCode:!0,validCodeServerError:!1,phoneCode:Wc[0].phoneCode,phone:"",currentMask:Wc[0].mask,lengthNumber:Wc[0].mask.match(/#/g).length,sendedPhone:!1,sendedCode:!1,buttonRepeatSmsDisable:!0,statusValidCodeFormat:!1,serverError:!1,timerDown:!0,timer:!0,existPhone:!1,additionalDataCheckUser:{},updateTimerFunc:null,isLoading:!1,isLoadingReg:!1,loadedService:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({apiUrl:"api/api",getNumberStepsForRegistration:"modal/getNumberStepsForRegistration",getActiveTheme:"headerSettings/getActiveTheme",getPaymentReference:"paymentService/getPaymentReference",getSession:"auth/getSession"})),{},{getDidabledStatusForSnedCode:function(){return"phone"===this.confirmationMode&&(!this.getStatusValidPhoneFormat||this.isLoading)},getEmail:function(){var t=Qa();return t.user.email},getStatusValidPhoneFormat:function(){return this.phone.length===this.lengthNumber},disabledCheckCodeButton:function(){return 4!==this.code.length},disabledButtonRegistration:function(){return!this.statusValidCodeFormat||this.isLoadingReg},classesForButtonNext:function(){return{class:"buttonNext ".concat(this.statusValidCodeFormat?"w100":"")}}}),watch:{phone:function(t){t.length=400&&(t.validCodeServerError=!0);case 12:t.sendedCode=!0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))()},endTimerCode:function(t){this.updateTimerFunc||(this.updateTimerFunc=t),this.code="",this.buttonRepeatSmsDisable=!1},goToAuthorization:function(){var t=JSON.stringify(Object(c["a"])({dataLogin:this.phoneCode+this.phone},this.additionalDataCheckUser));localStorage.setItem("dataExist",t),this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},goBackPreviousPage:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"LoginAndPass",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:2}),this.existPhone&&(this.phone="",this.existPhone=!1)},register:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i="phone"===t.confirmationMode?{role:"User",isVerifiedEmail:!1,isVerifiedPhone:!0,phone:t.phoneCode+t.phone}:{role:"User",isVerifiedEmail:!0,isVerifiedPhone:!1,email:t.getEmail},Ja(i,"user"),t.isLoadingReg=!0,o=Qa(),e.prev=4,e.next=7,t.$store.dispatch("reg/registartion",o);case 7:return e.next=9,t.$store.dispatch("auth/performLogin",{username:o.user.login,password:o.user.password,role:"User",token:"token",regModal:!0});case 9:t.$store.dispatch("modal/setPopupData",{visible:!1}),t.isLoadingReg=!0,e.next=16;break;case 13:throw e.prev=13,e.t0=e["catch"](4),e.t0;case 16:case"end":return e.stop()}}),e,null,[[4,13]])})))()}}},ul=ll,dl=(i("af16"),Object(C["a"])(ul,Ic,Bc,!1,null,"1996b139",null)),hl=dl.exports,pl=function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-steps__step"},[e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group-label"},[t._v(t._s(t.$t("whMar"))),e("br"),t._v(t._s(t.$t("uu"))+" ?")]),e("div",{staticClass:"form-group-box"},t._l(t.options,(function(i,o){return e("div",{key:i.id,staticClass:"form-group-box__row"},[e("Checkbox",{attrs:{name:"trading[]",value:i.name},on:{change:function(e){return t.checkAll(i.id)}},model:{value:t.trading,callback:function(e){t.trading=e},expression:"trading"}},[t._v(" "+t._s(i.name)+" ")]),e("Tooltip",{attrs:{pos:"left"},scopedSlots:t._u([{key:"content",fn:function(){return[t._v("Tooltip content "),e("br"),t._v(" "),e("p",[t._v("html Tooltip content")])]},proxy:!0}],null,!0)},[e("Button-icon",{attrs:{iconName:"Info",modifier:"square flat"}})],1)],1)})),0)])])},gl=[],fl={components:{InputText:Aa,Checkbox:Ya,Tooltip:Na,ButtonIcon:Nt},data:function(){return{ID:"",options:[{id:"1",name:"Все"},{id:"2",name:"Forex"},{id:"3",name:"Crypto"},{id:"4",name:"Indices"},{id:"5",name:"Commodities"},{id:"6",name:"Stocks"},{id:"7",name:"Futures"}],trading:[]}},watch:{trading:function(){this.validDataTrading()}},methods:{checkAll:function(t){"1"===t&&this.trading.includes("Все")?this.trading=this.options.map((function(t){return t.name})):"1"!==t||this.trading.includes("Все")?"1"!==t&&this.trading.includes("Все")&&this.trading.splice(0,1):this.trading=[]},validDataTrading:function(){var t={trading:[]};this.trading.length>0?(t={trading:this.trading},this.$emit("validDataTrading",t)):this.$emit("validDataTrading",t)}}},ml=fl,vl=Object(C["a"])(ml,pl,gl,!1,null,null,null),yl=vl.exports,Cl=function(){var t=this,e=t._self._c;return e("Modal",{staticClass:"modal--activity",attrs:{isOpen:t.isOpen,title:t.$t("yourActivity")},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"modal-activity"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col col-6"},[e("div",{staticClass:"modal-activity__left"},[e("h3",{staticClass:"form-group-label"},[t._v(t._s(t.$t("investorWord")))]),e("div",{staticClass:"modal-text"},[t._v(t._s(t.$t("longTxtInv")))]),e("Button",{attrs:{typeBtn:"secondary big"},on:{click:function(e){return t.setActivity("Инвестор")}}},[t._v(t._s(t.$t("invI")))])],1)]),e("div",{staticClass:"col col-6"},[e("div",{staticClass:"modal-activity__right"},[e("h3",{staticClass:"form-group-label"},[t._v(t._s(t.$t("traderWord")))]),e("div",{staticClass:"modal-text"},[t._v(t._s(t.$t("traderDef"))+" ")]),e("div",{staticClass:"modal-text"},[t._v(t._s(t.$t("traderRules")))]),e("Button",{attrs:{typeBtn:"secondary big"},on:{click:function(e){return t.setActivity("Трейдер")}}},[t._v(t._s(t.$t("traderI")))])],1)])])])]},proxy:!0}])})},bl=[],Sl={name:"ModalActivity",components:{Modal:Oe,Button:Pa},props:["isOpen"],methods:{close:function(){this.$emit("close")},setActivity:function(t){this.$emit("setActivity",t)}}},Pl=Sl,Tl=(i("fbbd"),Object(C["a"])(Pl,Cl,bl,!1,null,null,null)),xl=Tl.exports,Ol={components:{Modal:Oe,Button:Pa,ButtonIcon:Nt,InputText:Aa,RadioButton:$a,Tooltip:Na,svgIcon:L,nameAndSurnameStep:ic,loginAndPass:kc,validPhone:hl,tradingStep:yl,ModalActivity:xl,DxButton:cc.a},props:["isOpen"],data:function(){return{regObject:{firstName:"",lastName:"",role:"User",password:"",email:"",login:"",isVerifiedEmail:!1,isVerifiedPhone:!0,phone:""},steps:3,serverError:!1,currentStep:0,validCurrentStep:[!0,!0,!0],validSteps:[],openModalActivity:!1,activity:null,regLoad:!1}},computed:Object(c["a"])(Object(c["a"])({selected:function(){return this.options.filter((function(t){return!0===t.selected}))}},Object(p["c"])({errors:"reg/getError",userId:"reg/getUserId",regStatus:"reg/getStatus",getActiveTheme:"headerSettings/getActiveTheme",getSession:"auth/getSession"})),{},{isComplete:function(){return this.validSteps.includes(0)&&3===this.currentStep},removeDuplicates:function(t){return t.filter((function(e,i){return t.indexOf(e)===i}))},validStep:function(){return this.validCurrentStep[this.currentStep]},getServerError:function(){return this.serverError}}),watch:{},methods:{isValidStep:function(t){return this.validSteps.includes(t)},prevStep:function(){this.currentStep>0&&(this.validSteps.splice(this.currentStep,1),this.currentStep-=1)},nextStep:function(){this.currentStep<4&&(!this.isValidStep(this.currentStep)&&this.validSteps.splice(this.currentStep-1,0,this.currentStep),this.currentStep+=1)},setValidStep:function(t){this.$set(this.validCurrentStep,this.currentStep,t)},registrationUser:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(t.regObject.login&&t.regObject.password&&t.regObject.phone)){e.next=6;break}return t.regLoad=!0,e.next=4,t.$store.dispatch("reg/registartion",t.regObject);case 4:t.regLoad=!1,t.regStatus?(t.$store.dispatch("modal/switchFinishModal",{firstName:t.regObject.firstName,lastName:t.regObject.lastName}),t.$store.dispatch("modal/switchRegModal"),t.$store.commit("reg/setStatus",!1)):t.serverError=!0;case 6:case"end":return e.stop()}}),e)})))()},setNameAndLastName:function(t){t.firstName&&t.lastName&&t.role&&(this.regObject.firstName=t.firstName,this.regObject.lastName=t.lastName),this.setValidStep(!t.valid)},setLoginAdnPass:function(t){t.login&&t.pass&&t.email&&(this.regObject.login=t.login,this.regObject.id=t.login,this.regObject.password=t.pass,this.regObject.email=t.email),this.setValidStep(!t.valid)},setPhone:function(t){t.phone&&(this.regObject.phone=t.phone),this.setValidStep(!t.valid)},setTrading:function(t){this.setValidStep(!t.trading)},close:function(){this.$store.dispatch("modal/switchRegModal"),this.validCurrentStep=[!1,!1,!1],this.currentStep=0,this.validSteps=[]},toggleModalActivity:function(){this.openModalActivity=!this.openModalActivity},setActivity:function(t){this.activity=t,this.toggleModalActivity()}}},wl=Ol,_l=(i("2d8a"),Object(C["a"])(wl,ra,aa,!1,null,null,null)),Al=_l.exports,Dl=function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal-login-wrapper"},[e("form",{staticClass:"form-group-modal-login",on:{submit:function(t){t.preventDefault()}}},[e("div",{staticClass:"form-control-debounce"},[e("DxTextBox",{directives:[{name:"debounce",rawName:"v-debounce:1s",value:t.checkLogin,expression:"checkLogin",arg:"1s"}],ref:"login",attrs:{label:t.$t("email_login_phone"),labelMode:"static",height:"60",onKeyUp:t.keyEnterHandler,hoverStateEnabled:!1},model:{value:t.login,callback:function(e){t.login=e},expression:"login"}})],1),t.authButton?e("div",{staticClass:"form-control-password"},[e("DxTextBox",{ref:"password",attrs:{label:t.$t("password"),labelMode:"static",mode:t.passwordMode,height:"60","value-change-event":"input",hoverStateEnabled:!1,onKeyUp:t.keyEnterHandler},model:{value:t.pass,callback:function(e){t.pass=e},expression:"pass"}},[e("PasswordViewButton",{attrs:{mode:t.passwordMode},on:{click:t.setTypeInput}})],1)],1):t._e(),t.authButton?e("a",{staticClass:"form-link forgotPass",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showRecoverPassModal.apply(null,arguments)}}},[t._v(t._s(t.$t("forgot_your_password")))]):t._e()]),t.regSetButton?e("div",[e("div",{staticClass:"offerToRegister"},[e("svgIcon",{attrs:{name:"Warning"}}),t._v(t._s(t.$t("tainrotspgt")))],1),e("DxButton",{attrs:{width:"auto",height:"32",type:"default",elementAttr:{class:"buttonReg"},text:t.$t("registration"),icon:t.$iconPath("new-registration")},on:{click:t.callSignInModal}})],1):t._e(),t.error&&!t.regSetButton?e("div",{staticClass:"text-error"},[e("svgIcon",{attrs:{name:t.getErrorIcon}}),t._v(t._s(t.$t(t.error))),t.getSession?e("div",[t._v(t._s(t.$t("your_account_data")))]):t._e()],1):t._e(),t.authButton?e("DxButton",{key:"authButton",attrs:{width:"100%",height:"48",type:"success",disabled:t.getStatusButton||t.isLoading,elementAttr:{class:"buttonLogin greenButton"},useSubmitBehavior:!0},on:{click:function(e){return t.auth(e)}},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{iconName:"new-entry",text:t.$t("log_in"),isLoading:t.isLoading}})]},proxy:!0}],null,!1,1968993087)}):t._e(),t._m(0)],1)},kl=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"form-group-footer"},[e("div",{staticClass:"form-control-footer"},[e("div",{staticClass:"form-captcha"}),e("span",{staticClass:"form-control__legend modal-legend"},[t._v("This site is protected by reCAPTCHA and the Google "),e("a",{attrs:{href:"https://policies.google.com/privacy"}},[t._v("Privacy Policy")]),t._v(" and "),e("a",{attrs:{href:"https://policies.google.com/terms"}},[t._v("Terms of Service")]),t._v(" apply.")])])])}],Il={name:"ModalLogin",components:{svgIcon:L,Avatar:E,LoadingForButton:Qc,DxButton:ac["DxButton"],DxTextBox:rc.a,PasswordViewButton:Pc,ErrorText:gc},props:{isOpen:Boolean,shownProp:Boolean},data:function(){return{login:"",pass:"",regSetButton:!1,authButton:!1,userId:"",role:"",phoneExist:!1,isLoading:!1,passwordMode:"password"}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({error:"auth/getAuthError",getHandshake:"auth/getHandshake",getSession:"auth/getSession",userDetails:"user/getUserDetail",getApiURL:"api/api",getNumberStepsForRegistration:"modal/getNumberStepsForRegistration"})),{},{getStatusButton:function(){return!(this.login&&this.pass)},getErrorIcon:function(){return this.error?"Warning":"Check"}}),methods:{setTypeInput:function(){this.passwordMode="text"===this.passwordMode?"password":"text"},keyEnterHandler:function(t){"Enter"===t.event.key&&!this.getStatusButton&&this.authButton&&this.auth()},callSignInModal:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"NameAndSurnameStep",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:1})},callActivateAccount:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalAccountSign",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:1})},checkLogin:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!(t.trim().length<2)){i.next=2;break}return i.abrupt("return");case 2:return o=/^\d+$/.test(t)?"+"+t:t,i.prev=3,i.next=6,e.$http.post("".concat(e.getApiURL,"CheckUser"),{all:o});case 6:n=i.sent,n.data&&(s=n.data.usersInfo,(null===s||void 0===s?void 0:s.length)>=1?(e.userId=s[0].id,e.role="User",e.regSetButton=!1,e.authButton=!0,e.$nextTick((function(){e.$refs.password.instance.focus()})),e.phoneExist=n.data.phoneExist&&e.login):(e.regSetButton=!0,e.authButton=!1)),i.next=12;break;case 10:i.prev=10,i.t0=i["catch"](3);case 12:case"end":return i.stop()}}),i,null,[[3,10]])})))()},SendHandshake:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.post("".concat(t.getApiURL,"Auth/HandShake"),JSON.stringify(t.getHandshake));case 2:return i=e.sent,o=i.data,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})))()},auth:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,t.$workKeys.getOneUseSignKey();case 3:return i=e.sent,o={username:/^\d+$/.test(t.login)?"+"+t.login:t.login,password:t.pass,role:t.role,id:t.userId,FPData:window.navigator.userAgent,code:"",NewPublicUserKey:i.exportKeyPublic},e.next=7,t.SendHandshake();case 7:return n=e.sent,e.next=10,t.$workKeys.decryptData(n);case 10:return s=e.sent,e.next=13,t.$workKeys.encryptMessage(JSON.stringify(o),s,{name:"RSA-OAEP",hash:"SHA-256"});case 13:return a=e.sent,e.next=16,t.$store.dispatch("auth/performLogin",[{data:a,sessionId:t.getHandshake.sessionId},{ek:s,sk:i.exportKeyPrivate}]);case 16:t.getSession&&("Partner"===o.role&&t.$router.push({name:"Partner",params:{id:t.userId}}),t.login="",t.pass=""),setTimeout((function(){t.isLoading=!1}),300);case 18:case"end":return e.stop()}}),e)})))()},recaptcha:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$recaptchaLoaded();case 2:return e.next=4,t.$recaptcha("login");case 4:i=e.sent,i&&t.auth(i);case 6:case"end":return e.stop()}}),e)})))()},showRecoverPassModal:function(){this.phoneExist&&(this.phoneExist=!1),this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalRecoverPass",title:"password_recovery"})}},watch:{shownProp:function(t){t&&this.$refs.login.instance.focus()}},mounted:function(){var t=this,e=JSON.parse(localStorage.getItem("dataExist"));e&&(this.authButton=!0,this.$nextTick((function(){t.$refs.password.instance.focus()})),this.login=e.dataLogin,this.role=e.role,this.userId=e.userId,localStorage.removeItem("dataExist"))},destroyed:function(){this.error&&this.$store.commit("auth/setError","")}},Bl=Il,Ml=(i("a4938"),Object(C["a"])(Bl,Dl,kl,!1,null,null,null)),$l=Ml.exports,Ll=function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal-login__regBtns"},[e("div",{staticClass:"modal-login__regBtns-btnWrapper"},[e("DxButton",{key:"urWord",attrs:{width:"auto",height:"32",type:"default",elementAttr:{class:"buttonRegPopup"},text:t.$t("user_registration"),icon:t.$iconPath("new-registration")},on:{click:t.openRegModal}}),e("div",{staticClass:"prompt"},[e("div",{staticClass:"prompt-text mb-16 modal-legend"},[t._v(t._s(t.$t("ronu")))])])],1),e("div",{staticClass:"modal-login__regBtns-btnWrapper"},[e("DxButton",{key:"accountReg",attrs:{height:"32",width:"auto",type:"default",elementAttr:{class:"buttonRegPopup"},text:t.$t("account_registration"),icon:t.$iconPath("Reg-bill")},on:{click:t.openAccSignModal}}),e("div",{staticClass:"prompt"},[e("div",{staticClass:"prompt-text modal-legend"},[t._v(t._s(t.$t("rftwwtmmutb")))])])],1)])},Fl=[],jl={components:{DxButton:ac["DxButton"]},data:function(){return{}},computed:Object(c["a"])({},Object(p["c"])("modal",["getNumberStepsForRegistration"])),methods:{openRegModal:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"NameAndSurnameStep",title:"registration",numberSteps:this.getNumberStepsForRegistration,current:1})},openAccSignModal:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalAccountSign",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:1})}}},Rl=jl,Wl=(i("23a3"),Object(C["a"])(Rl,Ll,Fl,!1,null,"72b48c39",null)),Nl=Wl.exports,El=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.isOpen,title:t.$t("greet"),width:"900",modifier:"modal--meet"},on:{close:t.onClick},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"meeting"},[e("div",{staticClass:"meeting__headgroup"},[e("h2",{staticClass:"meeting__head"},[t._v(t._s(t.$t("respectedWord"))+" "+t._s(t.getName)+", "+t._s(t.$t("welcTopTr"))+" !")]),e("h3",{staticClass:"meeting__head"},[t._v(t._s(t.$t("yhgtfa"))+" "),e("strong",[t._v("14 "+t._s(t.$t("chatAboutText09"))+".")])]),e("h3",{staticClass:"meeting__head"},[t._v(t._s(t.$t("ycdias"))+".")])])])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary",modifier:"big"},on:{click:t.authUser}},[t._v(t._s(t.$t("contWork")))]),e("Button",{attrs:{typeBtn:"primary",modifier:"big",process:!!t.loadAuth,disabled:t.loadAuth},on:{click:t.goToLK}},[t._v(t._s(t.$t("goToPerAcc")))])],1)]},proxy:!0}])})},Ul=[],Vl={components:{Modal:Oe,Button:Pa,svgIcon:L},data:function(){return{loadAuth:!1,slide1:[{text:"Настроить свой профиль через личный кабинет",link:"/personal-area"},{text:"Найти себя в списке стратегий",link:"/strategies"},{text:"Стать экспертом",link:"/"},{text:"Ивестируйте в лучших из лучших",link:"/"},{text:"Узнать как устроен проект",link:"/"}]}},props:{isOpen:{type:Boolean}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getLogin:"reg/getRegLogin",getPass:"reg/getRegPass",getRole:"reg/getRegRole",getFinishModalData:"modal/getFinishModalData"})),{},{getName:function(){var t,e;return"".concat(null===(t=this.getFinishModalData)||void 0===t?void 0:t.firstName," ").concat(null===(e=this.getFinishModalData)||void 0===e?void 0:e.lastName)}}),methods:{onClick:function(){this.$store.dispatch("modal/switchFinishModal")},authUser:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o={username:e.getLogin,password:e.getPass,role:e.getRole,token:t||"token"},e.loadAuth=!0,i.next=4,e.$store.dispatch("auth/performLogin",o);case 4:e.loadAuth=!1,e.close();case 6:case"end":return i.stop()}}),i)})))()},close:function(){this.$store.dispatch("modal/switchFinishModal")},goToLK:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.authUser();case 2:return e.next=4,t.$router.push("/personal-area");case 4:t.close();case 5:case"end":return e.stop()}}),e)})))()}}},Hl=Vl,Gl=(i("c65f"),Object(C["a"])(Hl,El,Ul,!1,null,null,null)),ql=Gl.exports,zl=function(){var t=this,e=t._self._c;return e("div",[t.loginValid?t._e():e("div",[e("div",{staticClass:"form-group-pass-rec"},[e("div",{staticClass:"form-control-textbox"},[e("PhoneFieldWithMask",{attrs:{phone:t.phone,phoneCode:t.phoneCode,"current-mask":t.currentMask},on:{inputChanged:t.inputPhoneHandler,selectionChanged:t.setMask}}),e("ErrorText",{attrs:{text:t.$t("septal"),visible:t.serverError}}),e("ErrorText",{attrs:{text:t.$t("input_format_error"),visible:t.errorFormat}}),e("ErrorText",{attrs:{text:t.$t("tpninrots"),visible:!t.errorExist}}),e("span",{staticClass:"helper-recovery-text modal-legend"},[t._v(t._s(t.$t("etpnawyatry")))])],1)])]),t.loginValid&&!t.resetPasswordStatus?e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-control"},[e("DxTextBox",{attrs:{height:"60",label:t.$t("new_password"),labelMode:"static",mode:t.passwordMode,elementAttr:{class:"newPassField"},"value-change-event":"input"},model:{value:t.pass,callback:function(e){t.pass=e},expression:"pass"}},[e("PasswordViewButton",{attrs:{mode:t.passwordMode},on:{click:t.setTypeInput}})],1),e("ErrorText",{attrs:{text:t.invalidPass,visible:Boolean(t.invalidPass)}}),e("span",{staticClass:"helper-recovery-text modal-legend"},[t._v(t._s(t.$t("sanptwbaart")))])],1)])]):t._e(),t.choiceAccount?e("div",{staticStyle:{"margin-top":"10px"}},[e("div",{staticStyle:{"margin-bottom":"10px","line-height":"1.3"}},[t._v(t._s(t.$t("sawffwodywt"))+"?")]),t._l(t.userAccounts,(function(i,o){return e("div",{key:o,staticStyle:{padding:"5px","border-top":"1px solid #f0f0f0",cursor:"pointer"},style:i.active?{background:"#ebfff3"}:{},on:{click:function(e){return t.setChoiceAccount(i,o)}}},[e("div",{staticStyle:{display:"flex"}},[e("Avatar",{attrs:{src:i.userData.avatarURL}}),e("div",{staticStyle:{"margin-left":"20px"}},[e("div",{staticClass:"modal-legend"},[t._v(t._s(i.userData.firstName)+" "+t._s(i.userData.lastName))]),e("div",{staticClass:"modal-legend"},[t._v(t._s(i.userData.role))])])],1)])}))],2):t._e(),t.resetPasswordStatus?e("div",{staticClass:"resetPasswordStatus"},[e("div",{staticStyle:{padding:"5px"}},[e("div",{staticClass:"mb-16",staticStyle:{display:"flex"}},[e("Avatar",{attrs:{src:t.activeResetAccount.userData.avatarURL}}),e("div",{staticStyle:{"margin-left":"20px"}},[e("div",{staticClass:"modal-legend"},[t._v(t._s(t.activeResetAccount.userData.firstName)+" "+t._s(t.activeResetAccount.userData.lastName))]),e("div",{staticClass:"modal-legend"},[t._v(t._s(t.activeResetAccount.userData.role))])])],1)])]):t._e(),t.resetPasswordStatus?e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-control"},[e("ConfirmationCodeAndTimer",{on:{timerEnd:t.endTimerCode},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),e("ErrorText",{attrs:{text:t.$t("invalid_code_entered")+"!",visible:t.errorValidCode}}),e("ErrorText",{attrs:{text:t.$t("septal")+"!",visible:t.serverError}}),e("DxButton",{key:"buttonrepeatSms",attrs:{width:"100%",height:"48",type:"default",disabled:t.disabledButtonRepeatSms,elementAttr:{class:"buttonResendCode"},text:t.$t("resent_code")},on:{click:t.getPinCode}}),e("span",{staticClass:"form-control__legend modal-legend"},[t._v(t._s(t.$t("etcsttpnltt")))])],1)])]):t._e(),t.loginValid?t._e():e("DxButton",{key:"resetPassButton",attrs:{width:"100%",height:"48",type:"default",disabled:!t.getStatusValidPhoneFormat||t.isLoading},on:{click:t.checkUnic},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("reset_password"),isLoading:t.isLoading}})]},proxy:!0}],null,!1,3796852105)}),t.loginValid&&!t.resetPasswordStatus?e("DxButton",{key:"getPincideButton",attrs:{width:"100%",height:"48",type:"default",disabled:t.disabledGetPinCodeButton},on:{click:t.getPinCode},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("reset_password"),isLoading:t.isLoading}})]},proxy:!0}],null,!1,3796852105)}):t._e(),t.resetPasswordStatus?e("DxButton",{key:"checkCodeButton",attrs:{width:"100%",height:"48",type:"success",elementAttr:{class:"greenButton"},disabled:!t.isCodeValid||t.isLoading},on:{click:t.checkCode},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("ccal"),isLoading:t.isLoading}})]},proxy:!0}],null,!1,4115241297)}):t._e()],1)},Yl=[],Xl={name:"ModalRecoverPass",components:{DxTextBox:rc.a,DxButton:ac["DxButton"],ErrorText:gc,PasswordViewButton:Pc,svgIcon:L,Avatar:E,ConfirmationCodeAndTimer:cl,PhoneFieldWithMask:il,LoadingForButton:Qc},props:["isOpen"],data:function(){return{phone:"",phoneCode:Wc[0].phoneCode,currentMask:Wc[0].mask,lengthNumber:Wc[0].mask.match(/#/g).length,userID:"",role:"",choiceAccount:!1,userAccounts:[],loginValid:!1,code:"",pass:"",disabledButtonRepeatSms:!0,errorFormat:!1,errorExist:!0,errorValidCode:!1,serverError:!1,resetPasswordStatus:!1,passwordMode:"password",isLoading:!1,invalidPass:!1,updateTimerFunc:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({urlApi:"api/api",getSession:"auth/getSession"})),{},{fullPhone:function(){return this.phoneCode+this.phone},getStatusValidPhoneFormat:function(){return this.phone.length===this.lengthNumber},isCodeValid:function(){return 4===this.code.length},activeResetAccount:function(){var t=this;return this.userAccounts.find((function(e){return e.userData.id===t.userID}))},disabledGetPinCodeButton:function(){return Boolean(!this.pass.length||this.invalidPass||!this.activeResetAccount||this.isLoading)}}),watch:{pass:function(t){if(t.length>0){var e=/^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._\-\{}\[\]~\<\>\?]{8,}$/g,i=/(?=.*[A-Z])/g,o=/(?=.*[a-z])/g,n=/[0-9]+?/g;t.length<8?this.invalidPass=this.$t("mpl8c"):i.test(t)&&o.test(t)?n.test(t)?e.test(t)?this.invalidPass=!1:this.invalidPass=this.$t("llnassaa"):this.invalidPass=this.$t("tpmcalod"):this.invalidPass=this.$t("tpmcualcl")}this.resetPasswordStatus=!1}},methods:{inputPhoneHandler:function(t){this.phone=t},setMask:function(t){this.phone="",this.phoneCode=t.selectedItem.phoneCode,this.currentMask=t.selectedItem.mask||"(###) ###-##-##",this.lengthNumber=this.currentMask.match(/#/g).length},setTypeInput:function(){this.passwordMode="text"===this.passwordMode?"password":"text"},checkUnic:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.prev=1,e.next=4,t.$http.post("".concat(t.urlApi,"CheckUser"),{all:t.fullPhone});case 4:i=e.sent,t.serverError=!1,o=i.data.usersInfo,o&&1===o.length?(t.loginValid=!0,t.userID=o[0].id,t.role=o[0].role,t.userAccounts.push({userData:o[0]})):o&&o.length>1?(t.userAccounts=o.map((function(t){return{userData:t,active:!1}})),t.loginValid=!0,t.choiceAccount=!0):o&&!o.length&&(t.errorExist=!1),e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](1),t.serverError=!0;case 13:return e.prev=13,setTimeout((function(){t.isLoading=!1}),300),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})))()},setChoiceAccount:function(t,e){this.userAccounts.forEach((function(t,i){t.active=Boolean(i===e)})),this.userID=t.userData.id,this.role=t.userData.role},endTimerCode:function(t){this.updateTimerFunc||(this.updateTimerFunc=t),this.code="",this.disabledButtonRepeatSms=!1},checkCode:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,i={pin:t.code,userId:t.userID,password:t.pass},e.prev=2,e.next=5,t.$http.post("".concat(t.urlApi,"VerifyUserPin"),i);case 5:n=e.sent,t.serverError=!1,"NoError"===(null===(o=n.data)||void 0===o?void 0:o.actionStatus)?t.auth():t.errorValidCode=!0,e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](2),t.serverError=!0;case 13:return e.prev=13,setTimeout((function(){t.isLoading=!1}),300),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})))()},getPinCode:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.prev=1,e.next=4,t.$http.get("".concat(t.urlApi,"GetUserPinCode?userId=").concat(t.userID));case 4:i=e.sent,i.data&&i.data.isOK?(t.resetPasswordStatus&&t.updateTimerFunc(),t.serverError=!1,t.resetPasswordStatus=!0,t.choiceAccount=!1,t.disabledButtonRepeatSms=!0):(t.serverError=!0,t.resetPasswordStatus=!1),e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](1),t.serverError=!0,t.resetPasswordStatus=!1;case 12:return e.prev=12,setTimeout((function(){t.isLoading=!1}),300),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,8,12,15]])})))()},auth:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={username:t.fullPhone,password:t.pass,token:"token",role:t.role},e.next=3,t.$store.dispatch("auth/performLogin",i);case 3:t.getSession&&t.$store.dispatch("modal/setPopupData",{visible:!1});case 4:case"end":return e.stop()}}),e)})))()}}},Ql=Xl,Jl=(i("9289"),Object(C["a"])(Ql,zl,Yl,!1,null,"14f25526",null)),Kl=Jl.exports,Zl=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ModalContractsCategory"},[e("DxPopup",{attrs:{visible:t.isOpen,shading:!1,width:"420",height:"400"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"ModalContractsCategory-title",class:"ModalContractsCategory-title_".concat(t.getActiveTheme)},[t._v("Каталог контрактов")])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"ModalContractsCategory-content",class:"ModalContractsCategory-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"ModalContractsCategory-content_left"},t._l(t.getCatalogs,(function(i,o){return e("div",{key:o,staticClass:"ModalContractsCategory-catalogsItems",class:t.isActive===o?"ModalContractsCategory-catalogsItems_isActive_".concat(t.getActiveTheme):"ModalContractsCategory-catalogsItems_".concat(t.getActiveTheme),attrs:{itemData:i.length.toString()},on:{click:function(e){return t.setCatalog(o)}}},[e("div",{staticClass:"ModalContractsCategory-catalogsItems_name"},[t._v(t._s("all"===o?t.$t("all"):o))]),e("div",{staticClass:"ModalContractsCategory-catalogsItems_count",class:t.isActive===o?"ModalContractsCategory-catalogsItems_count_isActive_".concat(t.getActiveTheme):"ModalContractsCategory-catalogsItems_count_".concat(t.getActiveTheme)},[t._v(t._s(i.length))]),e("div",{staticClass:"ModalContractsCategory-catalogsItems_icon"},[e("svgIcon",{attrs:{name:"Arrow-expand-right"}})],1)])})),0),e("div",{staticClass:"ModalContractsCategory-content_right"},[e("div",{staticClass:"ModalContractsCategory-tableContracts"},[e("div",{staticClass:"ModalContractsCategory-tableContracts-head",class:"ModalContractsCategory-tableContracts-head_".concat(t.getActiveTheme)},[e("div",{staticClass:"ModalContractsCategory-tableContracts_row"},[e("div",{staticClass:"ModalContractsCategory-tableContracts_cell"},[e("Checkbox",{attrs:{checked:t.getCheckAllActiveCatalogs,value:"1"},on:{change:function(e){return t.setAllQuotesToActive(e)}}})],1),e("div",{staticClass:"ModalContractsCategory-tableContracts_cell"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"ModalContractsCategory-tableContracts_cell"},[t._v(t._s(t.$t("type")))])])]),e("div",{staticClass:"ModalContractsCategory-tableContracts-body"},[e("Vue-perfect-scrollbar",{staticClass:"ModalContractsCategory-tableContracts-scrollArea"},t._l(t.activeCatalogItems,(function(i,o){return e("div",{staticClass:"ModalContractsCategory-tableContracts_row"},[e("div",{staticClass:"ModalContractsCategory-tableContracts_cell"},[e("Checkbox",{attrs:{checked:!i.active,value:"1"},on:{change:function(e){return t.setActive(e,i)}}})],1),e("div",{staticClass:"ModalContractsCategory-tableContracts_cell",class:"ModalContractsCategory-tableContracts_cell_".concat(t.getActiveTheme)},[t._v(t._s(i.s))]),e("div",{staticClass:"ModalContractsCategory-tableContracts_cell",class:"ModalContractsCategory-tableContracts_cell_".concat(t.getActiveTheme)},[t._v(t._s(i.groupName))])])})),0)],1)])])])]},proxy:!0}])})],1)},tu=[],eu={components:{DxPopup:wt["DxPopup"],ButtonIcon:Nt,LabelBar:Ce,ListItemMenu:dt,Checkbox:Ya,VuePerfectScrollbar:Xt.a},props:{isOpen:{type:Boolean},mode:{default:null}},data:function(){return{tools:[],activeIndex:null,isActive:"all",activeCatalogItems:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllQuotes:"quotesCatalogs/getAllQuotes",getCatalogs:"quotesCatalogs/getCatalogs",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getActiveCatalog:function(){return this.$store.getters["quotesCatalogs/getCatalogsByType"](this.isActive)},getCheckAllActiveCatalogs:function(){return!0},getActiveQuote:function(){return this.$store.getters["quotesCatalogs/getCatalogsByType"]("active")},rowActive:function(t){return t===this.activeIndex}}),methods:{close:function(){this.$store.dispatch("modal/switchChartTradingModalCat",null)},setCatalog:function(t){var e=this;this.isActive=t,this.activeCatalogItems=[],this.getActiveCatalog&&this.getActiveCatalog.forEach((function(t){var i;i=e.mode?e.mode.listContracts.filter((function(e){return e===t.s})):e.getActiveQuote.filter((function(e){return e.s===t.s})),e.activeCatalogItems.push({s:t.s,groupName:t.groupName,active:!i.length})}))},setAllQuotesToActive:function(t){var e=this;this.getActiveCatalog.forEach((function(i){e.setActive(t,i)}))},setActive:function(t,e){this.mode?t?this.$store.dispatch("modal/addInstrumentToChartTradingModalCat",e.s):this.$store.dispatch("modal/removeInstrumentToChartTradingModalCat",e.s):t?this.$store.dispatch("quotesCatalogs/addQuoteInActive",{index:this.$store.getters["quotesCatalogs/getCatalogsByType"]("active").length,s:e.s,listText:e.s}):this.$store.dispatch("quotesCatalogs/removeQuoteInActive",{index:iu(e,this.getActiveQuote),s:e.s,listText:e.s}),this.setCatalog(this.isActive)}},mounted:function(){this.setCatalog(this.isActive)},beforeDestroy:function(){this.mode||this.setCatalog("active")}};function iu(t,e){var i=0;return e.forEach((function(e,o){e.s===t.s&&(i=o)})),i}var ou=eu,nu=(i("a846"),Object(C["a"])(ou,Zl,tu,!1,null,"4cf4d587",null)),su=nu.exports,ru=(i("841c"),function(){var t=this,e=t._self._c;return e("Modal",{ref:"modal",attrs:{isOpen:t.isOpen,modifier:"modal--popover modal--newcat",title:t.$t("toolCatalog"),width:"682"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"trading-modal-cat"},[e("div",{staticClass:"trading-modal-cat__top"},[e("div",{staticClass:"buttons-group trading-modal-cat__top_groups",class:{"trading-modal-cat__top_groups--controls":t.screens&&t.screens.length>4}},[e("VuePerfectScrollbar",{attrs:{id:"groupBtnScroll",settings:t.groupSettingsScroll}},t._l(t.screens,(function(i,o){return e("div",{key:o,staticClass:"buttons-group trading-modal-cat__groupBtn"},[e("Button-counter",{ref:"btn"+o,refInFor:!0,attrs:{isActive:o===t.activeScreen&&1!==t.activeMod,modifier:"min flat group lowercase",btnCount:"("+t.getCountGroup(o)+")"},on:{tab:function(e){return t.toggleScreen(o)}}},[e("span",[t._v(" "+t._s(t.$t("group"))+" "+t._s(i.text+1))])]),e("Button-icon",{attrs:{iconName:"Add",modifier:"group flat square min dropdownTrigger",isActive:o===t.activeEditGroup&&1===t.activeMod},on:{toggle:function(e){return t.toggleMod(o)}}}),e("Button-icon",{attrs:{iconName:"Close",modifier:"group flat square min red-icon"},on:{toggle:function(e){return t.toggleAlert(o)}}})],1)})),0),t.screens&&t.screens.length>4?e("div",{staticClass:"trading-modal-cat__groupBtn_cntrl right",on:{click:function(e){return t.sideScroll("right",25,100,10)}}},[e("svgIcon",{attrs:{name:"Arrow-expand-right",color:"#c8c8c8"}})],1):t._e(),t.screens&&t.screens.length>4?e("div",{staticClass:"trading-modal-cat__groupBtn_cntrl left",on:{click:function(e){return t.sideScroll("left",25,100,10)}}},[e("svgIcon",{attrs:{name:"Arrow-expand-left",color:"#c8c8c8"}})],1):t._e()],1),e("div",{staticClass:"buttons-group trading-modal-cat__top_add"},[e("Button-icon",{attrs:{iconName:"Add",modifier:"square flat group min"},on:{toggle:t.addScreen}})],1)]),1===t.activeMod?e("div",{staticClass:"trading-modal-cat__top trading-modal-cat__top-sb"},[e("div",{staticClass:"buttons-group"},t._l(t.getCatalogs,(function(i,o){return e("Button-counter",{directives:[{name:"show",rawName:"v-show",value:"active"!==o,expression:"index !== 'active'"}],key:o,attrs:{btnCount:i.length.toString(),isActive:t.isActive===o,modifier:"group flat min"},on:{tab:function(e){return t.setCatalog(o)}}},[t._v(t._s("all"===o?t.$t("allWord"):o))])})),1),e("div",{staticClass:"modal--newcat__search",class:{"modal--newcat__search--open":t.openSearch}},[e("Input-text",{attrs:{small:""},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e("Button-icon",{attrs:{iconName:"Search-mini",modifier:"square flat group min"}})],1)]):t._e(),t.getFavoriteGroupItems&&0===t.getFavoriteGroupItems.length&&0===t.activeMod?e("div",{staticClass:"form-message"},[t._v(t._s(t.$t("inGroup"))+" "+t._s(t.activeScreen+1)+" "+t._s(t.$t("noToolsYet")))]):t._e(),e("div",{staticClass:"trading-modal-cat__table table"},[e("div",{staticClass:"table__head"},[e("div",{staticClass:"table__row"},[e("div",{staticClass:"table__cell table__cell--null"}),e("div",{staticClass:"table__cell table__cell--80"},[t._v("symbol")]),e("div",{staticClass:"table__cell table__cell--80"},[t._v("name")]),e("div",{staticClass:"table__cell table__cell--90"},[t._v("type")]),e("div",{staticClass:"table__cell table__cell--60"},[t._v("sell")]),e("div",{staticClass:"table__cell table__cell--40"}),e("div",{staticClass:"table__cell table__cell--60"},[t._v("buy")])])]),0===t.activeMod&&t.getFavoriteGroupItems&&t.getFavoriteGroupItems.length>0?e("div",{staticClass:"table__body"},[e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[e("DxSortable",{attrs:{data:t.screens},on:{"drag-start":function(e){return t.onListDragStart(e)},reorder:function(e){return t.onListDrop(e)}}},t._l(t.getFavoriteGroupItems,(function(i,o){return e("div",{staticClass:"table__row"},[e("span",{staticClass:"table__row_drag"},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"table__cell table__cell--24 table__cell_favorite",attrs:{title:t.getTooltip}},[e("span",{on:{click:function(e){return t.removeFavorite(i.s)}}},[e("svgIcon",{attrs:{name:t.getIsFavorite(i.s)?"Favorite-on":"Favorite",color:t.getIsFavorite(i.s)?"#3C73F1":"#8C8C8C"}})],1)]),e("div",{staticClass:"table__cell table__cell--80"},[t._v(t._s(i.s))]),e("div",{staticClass:"table__cell table__cell--80"},[t._v(t._s(i.s))]),e("div",{staticClass:"table__cell table__cell--90"},[t._v(t._s(i.groupName))]),e("div",{staticClass:"table__cell table__cell--60 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s(i.a))])]),e("div",{staticClass:"table__cell table__cell--40 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s((i.a-i.b).toFixed(5)))])]),e("div",{staticClass:"table__cell table__cell--60 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s(i.b))])])])})),0)],1)],1):t._e(),1===t.activeMod?e("div",{staticClass:"table__body"},[e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[e("DxSortable",{attrs:{data:t.activeCatalogItems},on:{"drag-start":function(e){return t.onRowDragStart(e)},reorder:function(e){return t.onRowDrop(e)}}},t._l(t.getActiveCatalog,(function(i,o){return e("div",{ref:"row"+o,refInFor:!0,staticClass:"table__row"},[e("span",{staticClass:"table__row_drag"},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"table__cell table__cell--24 table__cell_favorite",attrs:{title:t.getTooltip}},[e("span",{on:{click:function(e){return t.addFavorite(i.s,o,e)}}},[e("svgIcon",{attrs:{name:t.getIsFavoriteCat(i.s)?"Favorite-on":"Favorite",color:t.getIsFavoriteCat(i.s)?"#3C73F1":"#8C8C8C"}})],1)]),e("div",{staticClass:"table__cell table__cell--80"},[t._v(t._s(i.s))]),e("div",{staticClass:"table__cell table__cell--80"},[t._v(t._s(i.s))]),e("div",{staticClass:"table__cell table__cell--90"},[t._v(t._s(i.groupName))]),e("div",{staticClass:"table__cell table__cell--60 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s(i.a))])]),e("div",{staticClass:"table__cell table__cell--40 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s((i.a-i.b).toFixed(5)))])]),e("div",{staticClass:"table__cell table__cell--60 table__cell--val"},[e("span",{staticClass:"table__cell--val1"},[t._v(t._s(i.b))])])])})),0)],1)],1):t._e()])]),e("Alert",{attrs:{enabled:t.alert}},[e("div",{staticClass:"form-label alert__text"},[t._v(t._s(t.$t("chatConfigMenuA"))+"?")]),e("div",{staticClass:"alert__controls"},[e("Button",{attrs:{typeBtn:"cancel",modifier:"min"},on:{click:function(e){t.alert=!1}}},[t._v(t._s(t.$t("cancel")))]),e("Button",{attrs:{typeBtn:"primary",modifier:"red min"},on:{click:function(e){return t.deleteScreen(t.alertProp)}}},[t._v(t._s(t.$t("delete")))])],1)])]},proxy:!0}])})}),au=[],cu=function(){var t=this,e=t._self._c;return e("button",{staticClass:"button button-favorite",class:{"button-favorite--active ":t.favorite},attrs:{type:"button"},on:{click:t.toggle}},[e("span",{staticClass:"button__icon button-favorite__icon"},[e("SvgIcon",{attrs:{name:t.iconName}})],1)])},lu=[],uu={components:{SvgIcon:L},data:function(){return{favorite:!1}},props:{isActive:{type:Boolean,default:!1}},watch:{isActive:function(t){this.favorite=!0===t}},computed:{iconName:function(){return!0===this.favorite?"Favorite-on":"Favorite"}},methods:{toggle:function(){this.favorite=!this.favorite,this.$emit("toggleFavorite",this.favorite)}},mounted:function(){this.favorite=this.isActive}},du=uu,hu=(i("b21c"),Object(C["a"])(du,cu,lu,!1,null,null,null)),pu=hu.exports,gu={components:{Modal:Oe,Alert:Ge,ButtonLabel:Z,LabelBar:Ce,ListItemMenu:dt,svgIcon:L,Checkbox:Ya,ButtonIcon:Nt,VuePerfectScrollbar:Xt.a,InputText:Aa,ButtonFavorite:pu,ButtonCounter:oe,Button:Pa,DxSortable:Gn.a},data:function(){return{tools:[],activeIndex:null,isActive:"all",activeCatalogItems:[{a:.7769,b:.7768,d:0,s:"6A",groupName:"Futures",active:!1,favoriteGroup:0},{a:1.3956,b:1.3955,d:0,s:"6B",groupName:"Futures",active:!0,favoriteGroup:0},{a:.7981,b:.79805,d:0,s:"6C",groupName:"Futures",active:!1,favoriteGroup:0},{a:1.2053,b:1.20525,d:0,s:"6E",groupName:"Futures",active:!1,favoriteGroup:0},{a:.00922,b:.00922,d:0,s:"6J",groupName:"Futures",active:!0},{a:.0129,b:.0129,d:0,s:"6R",groupName:"Futures",active:!0},{a:1.0932,b:1.0931,d:0,s:"6S",groupName:"Futures",active:!0},{a:134.06,b:134.06,d:0,s:"AAPL",groupName:"Share",active:!0},{a:.97344,b:.97325,d:0,s:"AUDCAD",groupName:"Forex",active:!0},{a:.71166,b:.71148,d:0,s:"AUDCHF",groupName:"Forex",active:!0},{a:84.25,b:84.235,d:0,s:"AUDJPY",groupName:"Forex",active:!0},{a:1.0799,b:1.07969,d:0,s:"AUDNZD",groupName:"Forex",active:!0},{a:.77676,b:.77663,d:0,s:"AUDUSD",groupName:"Forex",active:!0},{a:56935,b:56850,d:0,s:"BTCX",groupName:"Crypto",active:!0},{a:86.557,b:86.542,d:0,s:"CADJPY",groupName:"Forex",active:!0},{a:118.4,b:118.38,d:0,s:"CHFJPY",groupName:"Forex",active:!0},{a:63.69,b:63.67,d:0,s:"CL",groupName:"Futures",active:!0},{a:4137.75,b:4137.5,d:0,s:"ES",groupName:"Futures",active:!0},{a:1.55014,b:1.54993,d:0,s:"EURAUD",groupName:"Forex",active:!0},{a:1.50883,b:1.50866,d:0,s:"EURCAD",groupName:"Forex",active:!0},{a:1.10305,b:1.10289,d:0,s:"EURCHF",groupName:"Forex",active:!0},{a:.86289,b:.86273,d:0,s:"EURGBP",groupName:"Forex",active:!0},{a:130.586,b:130.573,d:0,s:"EURJPY",groupName:"Forex",active:!0},{a:1.67386,b:1.67361,d:0,s:"EURNZD",groupName:"Forex",active:!0},{a:10.1412,b:10.14002,d:0,s:"EURSEK",groupName:"Forex",active:!0},{a:1.20399,b:1.20386,d:0,s:"EURUSD",groupName:"Forex",active:!1},{a:1.79667,b:1.79638,d:0,s:"GBPAUD",groupName:"Forex",active:!0},{a:1.74876,b:1.74853,d:0,s:"GBPCAD",groupName:"Forex",active:!0},{a:1.27846,b:1.27826,d:0,s:"GBPCHF",groupName:"Forex",active:!0},{a:151.352,b:151.333,d:0,s:"GBPJPY",groupName:"Forex",active:!0},{a:1.94004,b:1.93972,d:0,s:"GBPNZD",groupName:"Forex",active:!0},{a:1.39546,b:1.39527,d:0,s:"GBPUSD",groupName:"Forex",active:!1},{a:2286.67,b:2286.67,d:0,s:"GOOGL",groupName:"Share",active:!0},{a:261.06,b:261.06,d:0,s:"MSFT",groupName:"Share",active:!0},{a:13847.5,b:13846.75,d:0,s:"NQ",groupName:"Futures",active:!0},{a:78.026,b:78.008,d:0,s:"NZDJPY",groupName:"Forex",active:!0},{a:.71938,b:.71923,d:0,s:"NZDUSD",groupName:"Forex",active:!0},{a:.86375,b:.8636,d:0,s:"RP",groupName:"Futures",active:!0},{a:727.5,b:727.5,d:0,s:"TSLA",groupName:"Share",active:!0},{a:1.25326,b:1.2531,d:0,s:"USDCAD",groupName:"Forex",active:!0},{a:.91622,b:.91607,d:0,s:"USDCHF",groupName:"Forex",active:!0},{a:108.468,b:108.456,d:0,s:"USDJPY",groupName:"Forex",active:!1},{a:76.96224,b:76.94141,d:0,s:"USDRUB",groupName:"Forex",active:!0},{a:8.4235,b:8.42239,d:0,s:"USDSEK",groupName:"Forex",active:!0}],openSearch:!1,search:"",screens:[{text:0,items:[]},{text:1,items:[]},{text:2,items:[]},{text:3,items:[]}],activeScreen:0,activeMod:0,activeEditGroup:null,modBtns:[{label:ya("modalServicesBtns3",ma)},{label:ya("catalogWord",ma)}],activeFavoritesGroupItems:[],updated:!1,alert:!1,alertProp:null,groupSettingsScroll:{suppressScrollY:!0}}},props:["isOpen"],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllQuotes:"quotesCatalogs/getAllQuotes",getCatalogs:"quotesCatalogs/getCatalogs"})),{},{getActiveCatalog:function(){var t=this;return"all"===this.isActive?this.activeCatalogItems:this.activeCatalogItems.filter((function(e){return e.groupName===t.isActive}))},getActiveQuote:function(){return this.$store.getters["quotesCatalogs/getCatalogsByType"]("active")},rowActive:function(t){return t===this.activeIndex},getTooltip:function(){var t=this.activeScreen+1;return this.favorite?"".concat(this.$t("chatMessageOptionList5")," ").concat(t):"".concat(this.$t("addGr")," ").concat(t)},getIsNotFavoriteGroup:function(){return this.activeCatalogItems.filter((function(t){return void 0===t.favoriteGroup||0===t.favoriteGroup.length}))},getFavoriteGroupItems:function(){var t,e=this,i=function(t){return t.text===e.activeScreen};return null===(t=this.screens.filter((function(t){return i(t)}))[0])||void 0===t?void 0:t.items}}),methods:{getFavoriteGroup:function(){var t=this;this.activeFavoritesGroupItems=this.activeCatalogItems.filter((function(e){var i;return null===e||void 0===e||null===(i=e.favoriteGroup)||void 0===i?void 0:i.includes(t.activeScreen)}))},close:function(){this.$store.dispatch("modal/switchChartTradingNewModalCat")},setCatalog:function(t){this.isActive=t},setMessageHandler:function(t){t&&t.command&&"Quotes"==t.command&&this.updateQuote(t.data)},updateQuote:function(t){var e=this;t.length&&t.forEach((function(t){mu(t,e)}))},setActive:function(t,e){t?this.$store.dispatch("quotesCatalogs/addQuoteInActive",{index:this.$store.getters["quotesCatalogs/getCatalogsByType"]("active").length,s:e.s,listText:e.s}):this.$store.dispatch("quotesCatalogs/removeQuoteInActive",{index:vu(e,this.getActiveQuote),s:e.s,listText:e.s}),this.setCatalog(this.isActive)},subscribeOfQuotes:function(t){var e={command:"Quotes",method:"Subscribe",data:{Quotes:fu(t).concat(fu(this.getActiveQuote))}};this.$socketStream.sendCommand({ws:"apiWS2",command:e})},toggleSearch:function(){this.openSearch=!this.openSearch},addScreen:function(){var t=this.screens.length;t<6&&(this.screens.push({text:t,items:[]}),this.$store.commit("quotesCatalogs/setScreens",this.screens.length))},toggleAlert:function(t){this.screens&&this.screens.length>1?(this.alert=!0,this.alertProp=t):this.alert=!1},deleteScreen:function(t){var e=this;this.screens&&this.screens.length>1&&(this.screens.splice(t,1),this.$store.commit("quotesCatalogs/setScreens",this.screens.length),this.screens.forEach((function(t,i){e.$set(e.screens[i],"text",i)})),this.alert=!1),this.alert=!1},toggleScreen:function(t){this.activeMod=0,this.activeScreen=t},addFavorite:function(t,e,i){var o=this.getActiveCatalog[e],n=this.screens[this.activeEditGroup].items;if(null!==n&&void 0!==n&&n.some((function(e){return e.s===t}))){var s=n.map((function(t){return t.s})).indexOf(t);this.screens[this.activeEditGroup].items.splice(s,1)}else{var r=[].concat(Object(x["a"])(n),[o]);this.$set(this.screens[this.activeEditGroup],"items",r),this.eventHook(i,e)}},getIsFavorite:function(t){var e;return null===(e=this.screens[this.activeScreen])||void 0===e?void 0:e.items.some((function(e){return e.s===t}))},getIsFavoriteCat:function(t){var e;return null===(e=this.screens[this.activeEditGroup])||void 0===e?void 0:e.items.some((function(e){return e.s===t}))},removeFavorite:function(t){var e=this.screens[this.activeScreen].items,i=e.map((function(t){return t.s})).indexOf(t);e.splice(i,1)},setDefaultFaforiteGroup:function(){var t=this;this.screens.forEach((function(e,i){var o=t.activeCatalogItems.slice(0,4);t.$set(t.screens[i],"items",o)}))},toggleMod:function(t){this.activeMod=1,this.activeEditGroup=t},eventHook:function(t,e){var i=t.clientY,o=this.$refs.modal.$el.children[0].children[0].getBoundingClientRect().top,n=this.$refs["btn"+this.activeEditGroup][0].$el.offsetTop,s=this.$refs["btn"+this.activeEditGroup][0].$el.offsetLeft,r=i-o-n-80,a=document.createElement("div"),c=this.$refs["row"+e][0],l=c.getBoundingClientRect().left,u=c.getBoundingClientRect().top;document.body.appendChild(a),a.classList.add("modal-cat-row-fake"),a.style.position="absolute",a.style.left=l+"px",a.style.top=u+"px",setTimeout((function(){var t=c.cloneNode(!0);a.appendChild(t),a.classList.add("portfolio-add-fake--flying"),a.style.transform="translate("+(s-140)+"px,"+-r+"px) scale(0.3)"}),500),setTimeout((function(){a.remove()}),2e3)},getCountGroup:function(t){var e=0;return this.screens.forEach((function(i){i.text===t&&(e=i.items.length)})),e},sideScroll:function(t,e,i,o){var n=document.querySelector("#groupBtnScroll"),s=0,r=setInterval((function(){"left"===t?n.scrollLeft-=o:n.scrollLeft+=o,s+=o,s>=i&&window.clearInterval(r)}),e)},onListDragStart:function(t){t.itemData=t.fromData[this.activeScreen].items[t.fromIndex]},onListDrop:function(t){this.screens[this.activeScreen].items.splice(t.fromIndex,1),this.screens[this.activeScreen].items.splice(t.toIndex,0,t.itemData)},onRowDragStart:function(t){t.itemData=t.fromData[t.fromIndex]},onRowDrop:function(t){t.fromData.splice(t.fromIndex,1),t.toData.splice(t.toIndex,0,t.itemData)},update:function(){this.modBtns[0].label=ya("modalServicesBtns3",ma),this.modBtns[1].label=ya("catalogWord",ma)}},mounted:function(){var t=this;this.setCatalog(this.isActive),this.setDefaultFaforiteGroup(),this.update(),pa.$on("changeLanguageCode",(function(){t.update(),t.$forceUpdate()}))},destroyed:function(){var t=this;pa.$off("changeLanguageCode",(function(){t.update(),t.$forceUpdate()}))},beforeDestroy:function(){this.setCatalog("active")}};function fu(t){var e=[];return t.forEach((function(t){e.push(t.s)})),e}function mu(t,e){for(var i=0;i0)return"on"===this.favorite||"off"===this.favorite?"Favorite-on":""}},mounted:function(){var t=this;pa.$on("changeLanguageCode",(function(){t.$forceUpdate()}))},destroyed:function(){var t=this;pa.$off("changeLanguageCode",(function(){t.$forceUpdate()}))}},Ru=ju,Wu=(i("74d2e"),Object(C["a"])(Ru,Du,ku,!1,null,null,null)),Nu=Wu.exports,Eu=function(){var t=this,e=t._self._c;return e("div",{class:"input-search input-search_theme"},[e("input",t._b({directives:[{name:"debounce",rawName:"v-debounce:1s",value:t.onKeyup,expression:"onKeyup",arg:"1s"}],class:"input-search__control input-search__control_".concat(t.theme),attrs:{type:"text",placeholder:t.placeholder,"debounce-events":"input"}},"input",t.$attrs,!1)),t.model?t._e():e("span",{class:"input-search__icon input-search__icon_".concat(t.theme)},[e("svgIcon",{attrs:{name:"Search-mini"}})],1)])},Uu=[],Vu={inheritAttrs:!1,model:{prop:"model"},props:{model:{type:String,required:!0},placeholder:{type:String},theme:{type:String,default:"dark"}},methods:{onKeyup:function(t){this.$emit("input",t)}}},Hu=Vu,Gu=(i("9b4b"),Object(C["a"])(Hu,Eu,Uu,!1,null,"55069df5",null)),qu=Gu.exports,zu={components:{Modal:Oe,DropdownButton:Au,DropdownMenu:vt,Button:Pa,InputText:Aa,ListItem:le,Broker:Nu,ButtonIcon:Nt,InputSearch:qu,svgIcon:L,Timer:Rc,VuePerfectScrollBar:Xt.a},props:["isOpen"],data:function(){return{userId:"",buttonRepeatSms:!0,brokerControl:!0,brokersDropdown:!1,validAccount:!1,hasBinding:!1,accNumber:"",selectedBroker:{},defaultSelectedBroker:"Выбрать брокера",loginOwner:"",search:"",stepAccess:!1,stepFinish:!1,code:"",loadCode:!1,errorCode:!1,timer:!0,time:2}},watch:{selectedBroker:function(t,e){this.brokerControl=t===e}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBrokers:"brokers/getBrokers",getApiUri:"api/api",getUserInfo:"user/getUserDetail",getSession:"auth/getSession"})),{},{iconDropdown:function(){return!0===this.brokersDropdown?"Arrow-dropdown-top":"Arrow-dropdown-bottom"},validText:function(){return this.validAccount?"Счет найден":"Счет не найден"},validIcon:function(){return this.validAccount?"Check":"Close"},accNumberLabel:function(){return this.validAccount?"Номер счета":"Указаный номер счёта"},isCodeValid:function(){return 4===this.code.length}}),methods:{CheckBrokerAccount:function(){var t=this,e=JSON.stringify({login:Number(this.accNumber),brokerId:this.selectedBroker.id}),i=this.$workKeys.signMessage(e,this.getSession.sk);this.loadCode=!0,this.$http.post(this.getApiUri+"CheckBrokerLogin/CheckBrokerAccount",e,{headers:{"Content-Type":"application/json","X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":i}}).then((function(e){t.loadCode=!1,e.data&&e.data.actionStatus&&e.data.accountInfo?(t.userId=e.data.accountInfo.ttUser.id,138===e.data.actionStatus?(t.stepAccess=!0,t.validAccount=!0,t.hasBinding=!0):140===e.data.actionStatus?(t.stepAccess=!0,t.validAccount=!0,t.hasBinding=!1,t.loginOwner=e.data.accountInfo.ttUser.login):141===e.data.actionStatus?(t.stepAccess=!0,t.validAccount=!0,t.hasBinding=!0,t.getCode(t.userId)):301===e.data.actionStatus&&(t.loadCode=!1,t.stepAccess=!0,t.validAccount=!1)):(t.loadCode=!1,t.stepAccess=!0,t.validAccount=!1)})).catch((function(){t.loadCode=!1,t.stepAccess=!0,t.validAccount=!1}))},getCode:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.timer=!1,e.$nextTick((function(){e.timer=!0})),i.next=4,e.$http.get(e.getApiUri+"GetUserPinCode?userId="+t).then((function(t){t.data&&t.data.isOK?(e.errorCode=!1,e.setTimeoutForRepeatSms()):e.errorCode=!0}));case 4:case"end":return i.stop()}}),i)})))()},addAccount:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadCode=!0,t.errorCode=!1,i=JSON.stringify({pin:+t.code,userFrom:t.userId,userTo:t.getUserInfo.id}),e.next=5,t.$workKeys.signMessage(i,t.getSession.sk);case 5:o=e.sent,t.$http.post(t.getApiUri+"MergeUsersByPin",i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(e){t.loadCode=!1,e.data&&e.data.isOK?(t.errorCode=!1,t.$store.dispatch("subscribeOrders/getAccountsUser",{guid:t.getUserInfo.id,accId:0}).then((function(){setTimeout((function(){t.close()}),1e3)})),t.stepFinish=!0):t.errorCode=!0})).catch((function(){t.loadCode=!1,t.errorCode=!0}));case 7:case"end":return e.stop()}}),e)})))()},onClickListItem:function(t){this.selectedBroker=t,this.toggleDropdown()},pevStep:function(){this.stepAccess=!1},toggleDropdown:function(){this.brokersDropdown=!this.brokersDropdown},close:function(){this.$store.dispatch("modal/switchAddAccountModal")},endTimerCode:function(){this.timer=!1,this.code=""},prevStep:function(){this.stepAccess=!1},setTimeoutForRepeatSms:function(){var t=this;this.buttonRepeatSms=!0,setTimeout((function(){t.buttonRepeatSms=!1}),2e4)}}},Yu=zu,Xu=(i("c1aa"),Object(C["a"])(Yu,Su,Pu,!1,null,null,null)),Qu=Xu.exports,Ju=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:"isOpen",title:t.$t("compExp"),modifier:"modal--compare modal-compare",width:"900"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"compare"},[e("div",{staticClass:"compare__left"},[e("div",{staticClass:"compare-table__row table__row"},[e("span",{staticClass:"ml-12"},[t._v(t._s(t.$t("btnsLibrary3")))])]),e("Vue-perfect-scrollbar",{staticClass:"compare__scroll"},t._l(t.getProviders.data,(function(i,o){return e("ProviderItem",{key:o,attrs:{provider:i,countCheckProviders:t.providersList.length},on:{setProvider:function(e){return t.setProvider(e)}}})})),1)],1),e("div",{staticClass:"compare__right"},[e("div",{staticClass:"compare__data compare-data"},[e("ChartCompare",{attrs:{providerList:t.providersList}})],1)])])]},proxy:!0}])})},Ku=[],Zu=function(){var t=this,e=t._self._c;return e("div",{staticClass:"compare-table__row table__row"},[e("div",{staticStyle:{width:"167px"}},[e("User",{attrs:{name:t.getNameProvider,ava:t.provider.userInfo.avatarURL,rating:"5.2",online:"",favorites:"off"}})],1),e("div",{staticStyle:{width:"20px"}},[e("Toggle",{directives:[{name:"show",rawName:"v-show",value:t.countCheckProviders<=4||t.statusToogle,expression:"countCheckProviders <= 4 || statusToogle"}],on:{toggle:function(e){return t.switchToogle(e)}}})],1)])},td=[],ed=function(t,e){return t("div",e._b({staticClass:"table__cell",class:[e.data.class,e.data.staticClass||""],style:e.$options.cellWidth(e.props.width)},"div",e.data.attrs,!1),[e._t("default")],2)},id=[],od={functional:!0,props:{width:{type:String}},cellWidth:function(t){return"width: ".concat(t/10,"rem")}},nd=od,sd=(i("c653"),Object(C["a"])(nd,ed,id,!0,null,null,null)),rd=sd.exports,ad=function(){var t=this,e=t._self._c;return e("div",{staticClass:"user"},[e("div",{staticClass:"user__ava"},[e("Avatar",{attrs:{src:t.ava,size:t.sizeAva,online:t.online,favorites:t.favorites,theme:t.getActiveTheme}})],1),e("div",{staticClass:"user__body",on:{click:t.openProfile}},[e("div",{class:"user__name user__name_".concat(t.getActiveTheme),attrs:{title:t.name}},[t._v(t._s(t.name))]),void 0!==t.nickName?e("div",{staticClass:"user__nick"},[t._v(t._s(t.nickName))]):t._e(),e("div",{staticClass:"user__rating"},[t.rating?e("Rating",{attrs:{value:"3.5"}}):t._e(),t.typeAccount?e("div",{staticClass:"user__typeAccount",style:t.accountTypeStyle},[t._v(t._s(t.typeAccount))]):t._e(),t.trendExpert.status&&"None"!==t.trendExpert.data?e("div",{staticClass:"user__trendExpert",style:t.trendStyle},["Buy_Sell"!==t.trendExpert.data?e("span",[t._v(t._s(t.trendExpert.data))]):e("span",[e("span",[t._v("BUY")]),t._v("/"),e("span",{staticStyle:{color:"red"}},[t._v("SELL")])])]):t._e()],1)])])},cd=[],ld={components:{Avatar:E,Rating:Fu,DxTooltip:Pt["DxTooltip"]},props:{name:{type:String},sizeAva:{default:"3.2"},nickName:{type:[String,Number]},ava:{type:String},rating:{type:String},typeAccount:{type:String,default:""},trendExpert:{type:Object,default:function(){return{status:!1,data:""}}},online:{type:Boolean},favorites:{type:String},data:{type:Object}},data:function(){return{targetMouseEnter1:"",tooltip1:!1,userTheme:!1,accountTypeStyle:{},trendStyle:{}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getAccountTypeStyle:function(){return"Demo"===this.typeAccount?this.styleGreen:this.styleRed},getTrendStyle:function(){return"Sell"===this.trendExpert.data?this.styleGreen:this.styleRed}}),methods:{openProfile:function(){if(this.$emit("openProfile"),this.data){var t=this.$router.resolve({name:"UserProfile",query:{accountId:this.data.login,userId:this.data.userId}});window.open(t.href,"_blank")}},update:function(){"light"===this.getActiveTheme?(this.widgetTheme=!0,this.accountTypeStyle="Demo"===this.typeAccount?{color:"#008e72"}:{color:"#DA0000"},this.trendStyle="Sell"===this.trendExpert.data?{color:"#008e72"}:{color:"#DA0000"}):(this.widgetTheme=!1,this.accountTypeStyle="Demo"===this.typeAccount?{color:"#01fcaa"}:{color:"#fa4c4a"},this.trendStyle="Sell"===this.trendExpert.data?{color:"#01fcaa"}:{color:"#fa4c4a"})}},mounted:function(){localStorage.theme||(localStorage.theme="light"),this.update()},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},ud=ld,dd=(i("c7be"),Object(C["a"])(ud,ad,cd,!1,null,"1b643396",null)),hd=dd.exports,pd={components:{Avatar:E,Cell:rd,User:hd,Toggle:qo},props:{provider:{default:function(){return{}}},countCheckProviders:{type:Number}},data:function(){return{statusToogle:!1}},computed:{getNameProvider:function(){return"".concat(this.provider.userInfo.firstName," ").concat(this.provider.userInfo.lastName)}},methods:{switchToogle:function(t){this.statusToogle=t,this.$emit("setProvider",{status:t,provider:this.provider})}}},gd=pd,fd=Object(C["a"])(gd,Zu,td,!1,null,null,null),md=fd.exports,vd=function(){var t=this,e=t._self._c;return e("div",{staticStyle:{width:"100%",height:"100%","flex-grow":"1"}},[e("DxChart",{ref:"chart",attrs:{dataSource:t.storeData,id:"chart"}},[t._l(t.series,(function(t){return e("DxSeries",{key:t.name,attrs:{name:t.name,ignoreEmtyPoints:!0,barPadding:0,width:t.width,type:t.type,border:t.border,color:t.color,hoverMode:"none",label:t.label,point:t.point,valueField:t.valueField,argumentField:t.argumentField}})})),e("DxLegend",{attrs:{visible:!0,"vertical-alignment":"bottom","horizontal-alignment":"center",customizeText:t.getTextForLegend}}),e("DxArgumentAxis",{attrs:{"argument-type":t.getTypeArgAxis}}),e("DxValueAxis",{attrs:{position:"right"}})],2)],1)},yd=[],Cd=i("5660"),bd=i.n(Cd),Sd=i("3922"),Pd=i("b499");function Td(t){if(t[0].length||t[1]){var e={data:xd(t[0]),dailyData:wd(t[1])};return e}}function xd(t){if(!t.length)return[];var e=[];return t.forEach((function(t){e.push(Od(t))})),e}function Od(t){return{accountId:t[0],date:t[1],contract:t[2],volumeOpen:t[3],volumeClose:t[4],profitOpen:t[5],profitClose:t[6],floatingProfitOpen:t[7],floatingProfitClose:t[8],usedVolume:t[9],closedCount:t[10],pClosedCount:t[11],forecast:t[12],equity:t[13],sharp:t[14],isFake:t[15],pip:t[16]}}function wd(t){return{accountId:t[0],date:t[1],currency:t[2],accountGroup:t[3],equityHigh:t[4],equityLow:t[5],equityClose:t[6],balanceHigh:t[7],balanceLow:t[8],balanceClose:t[9],deposit:t[10],profitHigh:t[11],profitLow:t[12],profitClose:t[13],leverage:t[14],leverageHigh:t[15],margin:t[16],marginHigh:t[17],drawdown:t[18],drawdownHigh:t[19],swaps:t[20],commissions:t[21],forecastForDay:t[22],equityOpen:t[23],dailySharp:t[24],withOutDeposit:t[25],closedCount:t[26],pClosedCount:t[27],procPosOrders:t[28],pip:t[29],isFake:t[30]}}var _d={components:{DxChart:bd.a,ArrayStore:Pd["a"],DxArgumentAxis:Cd["DxArgumentAxis"],DxValueAxis:Cd["DxValueAxis"],DxZoomAndPan:Cd["DxZoomAndPan"],DxScrollBar:Cd["DxScrollBar"],DxMinVisualRangeLength:Cd["DxMinVisualRangeLength"],DxExport:Cd["DxExport"],DxLegend:Cd["DxLegend"],DxCommonAnnotationSettings:Cd["DxCommonAnnotationSettings"],DxCommonSeriesSettings:Cd["DxCommonSeriesSettings"],DxAnnotation:Cd["DxAnnotation"],DxSeries:Cd["DxSeries"],DataSource:Sd["a"],DxTooltip:Cd["DxTooltip"]},props:{providerList:{default:function(){return[]}},typeCompare:{default:"equity",type:String},typeChart:{default:"line",type:String}},data:function(){return{series:[],storeData:new Sd["a"]({store:new Pd["a"]({data:[],key:"accountId",paginate:!1}),paginate:!1}),colors:["#FF9421","#3C73F1","#008E72","rgb(255,121,226)","#2CCCFF"],providersStat:[]}},watch:{providerList:function(t){this.setProviderFromChart(t)}},computed:{getTypeArgAxis:function(){return"line"===this.typeChart?"datetime":"string"}},methods:{setProviderFromChart:function(t){this.series.length?this.series.length&&this.series.lengtht.length&&this.clearStoreAndRemoveSeries(this.removeProviderFromChart()):this.getPigForProvider(t[0])},clearStoreAndRemoveSeries:function(t){var e=this,i=this.$refs.chart.instance,o=i.getDataSource().items();this.removeStatProviders(t.name),o.forEach((function(i){i[t.name]&&e.storeData.store().remove(t.name+i.date)})),this.series.forEach((function(e,i,o){e.name===t.name&&o.splice(i,1)})),this.storeData.reload()},removeProviderFromChart:function(){var t=this;return this.series.filter((function(e){return!t.providerList.some((function(t){return e.name===t.accountId}))}))[0]},removeStatProviders:function(t){this.providersStat.forEach((function(e,i,o){e.dailyData.accountId===t&&o.splice(i,1)}))},setMessageHandler:function(t){if(t&&t.command&&"ContractStatisticsByAccount"===t.command){var e=Td(JSON.parse(t.data));this.setDataForChart(e)}},getPigForProvider:function(t){var e={command:"ContractStatisticsByAccount",data:{AccountId:t.accountId,contracts:[t.contract]},method:"get"};this.$socketStream.sendCommand({ws:"apiWS",command:e})},addDataInStoreChart:function(t){var e=this;t.forEach((function(t){e.storeData.store().insert(t)})),this.storeData.reload()},addLineToChart:function(t){this.series.push({name:t,argumentField:"date",valueField:t,type:"spline",color:this.getColorByChart(),width:3,label:{visible:!1},point:{visible:!1}})},setDataForChart:function(t){t&&(this.providersStat.push(t),"line"===this.typeChart&&"equity"===this.typeCompare&&(this.addDataInStoreChart(this.getPointsEquityForLine(t.data)),this.addLineToChart(t.dailyData.accountId)),this.storeData.reload())},getTextForLegend:function(t){var e=this.providerList.filter((function(e){return e.accountId===t.seriesName}));if(e.length)return"".concat(e[0].userInfo.firstName," ").concat(e[0].userInfo.lastName)},getColorByChart:function(){var t=this.series.map((function(t){return t.color})),e=this.colors.filter((function(e){return!t.some((function(t){return e===t}))}));return e[0]},getPointsEquityForLine:function(t){return t.map((function(t){var e={};return e.date=t.date,e[t.accountId]=t.equity,e.accountId=t.accountId+t.date,e}))}},mounted:function(){this.$socketStream.$on("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},Ad=_d,Dd=Object(C["a"])(Ad,vd,yd,!1,null,null,null),kd=Dd.exports,Id={components:{Modal:Oe,DropdownButton:Au,ListItem:le,ButtonIcon:Nt,svgIcon:L,VuePerfectScrollbar:Xt.a,ProviderItem:md,ChartCompare:kd},props:{isOpen:{default:!1,type:Boolean}},data:function(){return{providersList:[]}},computed:Object(c["a"])({},Object(p["c"])({getProviders:"modal/getCompareProvidersModalStatus"})),methods:{close:function(){this.$store.dispatch("modal/switchCompareProvidersModal")},isProfit:function(t){return!!t.profit},setProvider:function(t){t.status?this.providersList.push(t.provider):this.providersList.forEach((function(e,i,o){e.id===t.provider.id&&o.splice(i,1)}))},iconName:function(t){return this.isProfit(t)?"Arrow-score-increase":"Arrow-score-decrease"}}},Bd=Id,Md=(i("2006"),Object(C["a"])(Bd,Ju,Ku,!1,null,null,null)),$d=Md.exports,Ld=function(){var t=this,e=t._self._c;return e("div",{staticClass:"coockiesAcceptModal"},[e("div",{staticClass:"coockiesAcceptModal-contentWrap"},[e("div",{staticClass:"coockiesAcceptModal-textWrap"},[e("div",{staticClass:"coockiesAcceptModal-text"},[t._v(t._s(t.$t("tsucar"))+" "),e("a",{attrs:{href:t.linkForDocks,target:"_blank"}},[t._v(t._s("".concat(t.$t("here"),".")))])]),e("div",{staticClass:"coockiesAcceptModal-text"},[t._v(t._s(t.$t("butsy"))),e("a",{attrs:{href:t.linkForDocks,target:"_blank"}},[t._v(t._s("".concat(t.$t("view"),".")))])])]),e("div",{staticClass:"coockiesAcceptModal-buttonBlock"},[e("div",{staticClass:"coockiesAcceptModal-button"},[e("ButtonIconFlat",{attrs:{icon:{name:"Check",color:"#008e72"},modifier:{class:["coockiesAcceptModal-buttonItem"]}},on:{click:t.acceptRules}},[t._v(t._s(t.$t("accept")))])],1),e("div",{staticClass:"coockiesAcceptModal-button"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close",color:"#e91212"},modifier:{class:["coockiesAcceptModal-buttonItem"]}},on:{click:t.noAcceptRules}},[t._v(t._s(t.$t("reject")))])],1)])])])},Fd=[],jd={data:function(){return{linkForDocks:"https://about.toptrader.ru/docs/"}},methods:{acceptRules:function(){localStorage.setItem("acceptRules",!0),this.$emit("acceptRules")},noAcceptRules:function(){this.$emit("acceptRules")}}},Rd=jd,Wd=(i("ad7b"),Object(C["a"])(Rd,Ld,Fd,!1,null,"280e61ad",null)),Nd=Wd.exports,Ed=function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal-order-cnt",class:t.currentTypeOrder},[e("Modal",{attrs:{isOpen:t.isOpen,title:t.getTitle,modifier:"modal-order",isWithoutMask:!0,isDraggble:!0},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"modal-order-body"},[t.getOrder||"CryptoOrder"===t.componentName?t._e():e("div",{staticClass:"modal-order-body__types",class:t.getActiveTheme},[e("div",{staticClass:"modal-order-body-tabs__item",class:"".concat("MomentOrder"===t.currentTypeOrder&&"selectTypeOrder"," ").concat(t.getActiveTheme),on:{click:function(){return t.currentTypeOrder="MomentOrder"}}},[t._v("Order")]),e("div",{staticClass:"modal-order-body-tabs__item",class:"".concat("PendingOrder"===t.currentTypeOrder&&"selectTypeOrder"," ").concat(t.getActiveTheme),on:{click:function(){return t.currentTypeOrder="PendingOrder"}}},[t._v("Limit order")])]),e("div",{staticClass:"modal-order-body__content"},[t.quotes.sell?e(t.componentName,{tag:"component",attrs:{quotes:t.quotes,btcusd:t.btcusd,activeSymbol:t.activeSymbol,order:t.getOrder,stepInput:t.quotes.spred},on:{closeModal:t.close}}):e("Preloader")],1)])]},proxy:!0}])})],1)},Ud=[],Vd=function(){var t=this,e=t._self._c;return e("div",{staticClass:"input-number",class:{"input-number--small":t.small}},[t.label&&!t.small?e("label",{staticClass:"input-number__label"},[t._v(t._s(t.label))]):t._e(),e("span",{staticClass:"input-number__wrapper"},[t.small?t._e():e("span",{staticClass:"input-number__placeholder"},[t._v(t._s(t.placeholder))]),e("input",t._b({directives:[{name:"model",rawName:"v-model.number",value:t.currentValue,expression:"currentValue",modifiers:{number:!0}}],staticClass:"input-number__control",attrs:{disabled:t.disabled,min:t.min,max:t.max,step:t.step,placeholder:t.placeholderValue,type:"number"},domProps:{value:t.currentValue},on:{blur:[function(e){t.currentValue=t.value},function(e){return t.$forceUpdate()}],keydown:[function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"]))return null;t.currentValue=t.value},function(e){if(!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.currentValue=t.value},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.increment.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.decrement.apply(null,arguments))}],input:function(e){e.target.composing||(t.currentValue=t._n(e.target.value))}}},"input",t.$attrs,!1)),e("span",{staticClass:"input-number__controls buttons-group buttons-group--vertical"},[e("Button-icon",{attrs:{iconName:"Arrow-dropdown-top-input",modifier:"flat group"},on:{toggle:t.increment}}),e("Button-icon",{attrs:{iconName:"Arrow-dropdown-bottom-input",modifier:"flat group"},on:{toggle:t.decrement}})],1)])])},Hd=[],Gd={components:{ButtonIcon:Nt,GroupButtons:pe},data:function(){return{currentValue:this.value,decrementDisabled:!1,incrementDisabled:!1,inputDisabled:this.disabled}},props:{disabled:Boolean,max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{required:!0},step:{type:Number,default:.1},small:{type:Boolean},label:{type:String},placeholder:{type:String},placeholderValue:{type:[String,Number]}},watch:{currentValue:function(t){this.inputValue(t)},disabled:function(t){this.incrementDisabled=!!t,this.decrementDisabled=!!t}},methods:{inputValue:function(t){this.currentValue=qd("ceil",t,-1),this.$emit("input",this.currentValue)},increment:function(){var t=this.currentValue+this.step;this.decrementDisabled=!1,this._updateValue(t)},decrement:function(){var t=this.currentValue+-1*this.step;this.incrementDisabled=!1,this._updateValue(t)},_updateValue:function(t){var e=this.currentValue;e!==t&&"number"===typeof this.value&&(t<=this.min&&(t=this.min,this.decrementDisabled=!0),t>=this.max&&(t=this.max,this.incrementDisabled=!0),this.inputValue(t))}},mounted:function(){this.value===this.min&&(this.decrementDisabled=!0)}};function qd(t,e,i){return"undefined"===typeof i||0===+i?Math[t](e):(e=+e,i=+i,isNaN(e)||"number"!==typeof i||i%1!==0?NaN:(e=e.toString().split("e"),e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+i:i))))}var zd=Gd,Yd=(i("e1a0"),Object(C["a"])(zd,Vd,Hd,!1,null,null,null)),Xd=Yd.exports,Qd=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"fadeOut"}},[t.enabled?e("div",{class:"preloader preloader_".concat(t.getActiveTheme),style:"opacity:"+t.opacity},[t.progress&&t.progress.length&&!t.circle?e("div",{staticClass:"preloader__progress",style:"width:"+t.progress+"%"}):t._e(),!t.progress&&t.icon?e("div",{class:"preloader__icon preloader__icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Change",size:t.sizeIcon}})],1):t._e(),t.message&&!t.progress&&t.enabledMessage?e("div",{staticClass:"preloader__view-message",class:"preloader__view-message_".concat(t.getActiveTheme)},[t._v(t._s(t.message))]):t._e(),!t.enabledMessage||t.progress&&!t.icon?e("div",{staticClass:"preloader__view",class:t.enabledMessage&&!t.progress?"preloader__view-message preloader__view_".concat(t.getActiveTheme):"preloader__view_".concat(t.getActiveTheme)},[t._v(t._s(t.getProgress))]):t._e(),!t.enabledMessage||t.circle&&t.progress?e("div",{staticClass:"preloader__circle"},[e("progress-ring",{attrs:{radius:80,progress:+t.progress,stroke:6}})],1):t._e()]):t._e()])},Jd=[],Kd=function(){var t=this,e=t._self._c;return e("div",{staticClass:"progress-ring"},[e("svg",{attrs:{height:2*t.getRadius,width:2*t.getRadius}},[e("circle",{staticClass:"progress-ring__circle",attrs:{stroke:t.strokeColorDefault,"stroke-width":t.stroke,fill:"transparent",r:t.getNormalizedRadius,cx:t.getRadius,cy:t.getRadius}}),e("circle",{staticClass:"progress-ring__circleFill",style:{strokeDashoffset:t.strokeDashoffset},attrs:{stroke:t.strokeColorFill,"stroke-dasharray":t.getCircumference+" "+t.getCircumference,"stroke-width":t.stroke,fill:"transparent",r:t.getNormalizedRadius,cx:t.getRadius,cy:t.getRadius}})]),t.$slots.default?e("div",{staticClass:"progress-ring__component"},[t._t("default")],2):t._e()])},Zd=[],th={props:{radius:Number,progress:Number,stroke:Number,strokeColorDefault:{type:String,default:"#FF5656"},strokeColorFill:{type:String,default:"#00AD88"}},data:function(){var t=this.radius-2*this.stroke,e=2*t*Math.PI;return{normalizedRadius:t,circumference:e}},computed:{getRadius:function(){return this.radius},getNormalizedRadius:function(){return this.radius-2*this.stroke},getCircumference:function(){return 2*this.normalizedRadius*Math.PI},strokeDashoffset:function(){return this.circumference-this.progress/100*this.circumference}},mounted:function(){this.normalizedRadius=this.getNormalizedRadius,this.circumference=this.getCircumference}},eh=th,ih=(i("6d64"),Object(C["a"])(eh,Kd,Zd,!1,null,null,null)),oh=ih.exports,nh={name:"Preloader",components:{ProgressRing:oh},props:{enabled:{type:Boolean},message:{type:String},progress:{default:0},opacity:{type:String,default:"0.91"},circle:{type:Boolean},icon:{type:Boolean},sizeIcon:{type:Number,default:33},enabledMessage:{type:Boolean,default:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getProgress:function(){var t=Math.ceil(this.progress);return isFinite(t)&&""!==this.progress?(t.toString(),"".concat(t," %")):""===this.progress?this.message:void 0},getDashArrayProgress:function(){var t=90,e=Math.PI*(2*t);return(100-this.progress)/100*e}})},sh=nh,rh=(i("921d"),Object(C["a"])(sh,Qd,Jd,!1,null,null,null)),ah=rh.exports,ch=function(){var t=this,e=t._self._c;return e("div",{class:"textarea textarea_".concat(t.theme),style:"width:"+t.width+"rem; height: "+t.height+"rem;",on:{click:function(e){return t.onFocus(e)}}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.text,expression:"text"}],attrs:{maxlength:t.maxlength},domProps:{value:t.text},on:{input:[function(e){e.target.composing||(t.text=e.target.value)},function(e){return t.onInput(e)}],blur:function(e){return t.onBlur(e)},keydown:t.onKeydown,focus:function(e){return t.onFocus(e)}}}),0===t.text.length?e("div",{class:"textarea__placeholder textarea__placeholder_".concat(t.theme)},[t._v(t._s(t.placeholder))]):t._e(),t.counter?e("div",{staticClass:"textarea__counter"},[t._v(t._s(t.getCount)+" / 500")]):t._e(),e("div",{staticClass:"textarea__helper"},[t._v(t._s(t.helper))])])},lh=[],uh={props:{width:{type:[String,Number]},theme:{type:String,default:"light"},height:{type:[String,Number],default:"10"},counter:{type:Boolean,default:!0},maxlength:{type:Number,default:500},placeholder:{type:String},helper:{type:String},autofocus:{type:Boolean,default:!1}},data:function(){return{text:"",focus:!1}},watch:{autofocus:function(t){this.focus=!!t}},computed:{getCount:function(){return this.text.length}},methods:{onInput:function(){this.$emit("input",this.text)},onKeydown:function(t){"Enter"===t.code&&(t.preventDefault(),this.$emit("enter"))},onFocus:function(t){this.focus=!0,this.$emit("focus",t)},onBlur:function(){this.focus=!1,this.$emit("blur")},clean:function(){this.text=""}},mounted:function(){this.autofocus?this.focus=!0:this.focus=!1}},dh=uh,hh=(i("347a"),Object(C["a"])(dh,ch,lh,!1,null,null,null)),ph=hh.exports,gh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"moment-order-container"},[e("div",{staticClass:"moment-order-container__row"},[e("InputRow",{attrs:{changeVolumeType:t.changeVolumeType,volumeType:t.getVolumeType,volume:t.volume,volumeDinamic:t.volumeDinamic,validations:t.validations,changeValue:t.changeValue}})],1),e("div",{staticClass:"moment-order-container__row"},[e("Input",{style:{marginRight:"12px"},attrs:{label:"Stop loss",value:t.stopLoss,step:.3*t.quotes.buy,validation:t.validations.stopLoss,modifire:"negative"},on:{minus:function(e){return t.changeLimit("stopLoss",!0)},add:function(e){return t.changeLimit("stopLoss")},change:function(e){return t.changeValue(e,"stopLoss",0)}}}),e("Input",{attrs:{label:"Take profit",value:t.takeProfit,step:.3*t.quotes.buy,validation:t.validations.takeProfit,modifire:"positive"},on:{minus:function(e){return t.changeLimit("takeProfit",!0)},add:function(e){return t.changeLimit("takeProfit")},change:function(e){return t.changeValue(e,"takeProfit",0)}}})],1),e("div",{staticClass:"moment-order-container__row"},[e("div",{staticClass:"moment-order-container__checkBox",class:t.getActiveTheme,on:{click:t.changeActiveDefence}},[e("DxCheckBox",{attrs:{"element-attr":{class:"attr-to-check-box ".concat(t.getActiveTheme)},value:t.activeDefence}}),t._v("Trailing stop loss")],1)]),e("div",{staticClass:"moment-order-container__trialing",class:t.getClassesForActiveDefence},[e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("mtsir"))),e("Input",{attrs:{label:"",value:t.levelChange,step:10},on:{minus:function(e){return t.changeValue(e,"levelChange",10)},add:function(e){return t.changeValue(e,"levelChange",10)},change:function(e){return t.changeValue(e,"levelChange",10)}}})],1),e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("at_the_level"))),e("Input",{attrs:{label:"",value:t.levelResult,step:10},on:{minus:function(e){return t.changeValue(e,"levelResult",10)},add:function(e){return t.changeValue(e,"levelResult",10)},change:function(e){return t.changeValue(e,"levelResult",10)}}})],1)]),e("div",{staticClass:"moment-order-container__area",class:t.getActiveTheme},[e("textarea",{attrs:{name:"note-order",placeholder:"Note"}})]),e("div",{staticClass:"buttons-open-order"},[e("div",{staticClass:"button-open-order sell",class:t.getActiveTheme,style:{marginRight:"12px"}},[e("div",{staticClass:"button-open-order__trigger sell",class:t.getActiveTheme,on:{click:function(e){return t.openOrder("sell")}}},[e("div",{staticClass:"price"},[t._v(t._s(t.quotes.sell))]),e("div",{staticClass:"typeLabel"},[t._v("Sell")])])]),e("div",{staticClass:"buttons-open-order__spred",class:t.getActiveTheme},[t._v(t._s(t.stepInput))]),e("div",{staticClass:"button-open-order buy",class:t.getActiveTheme},[e("div",{staticClass:"button-open-order__trigger buy",class:t.getActiveTheme,on:{click:function(e){return t.openOrder("buy")}}},[e("div",{staticClass:"price"},[t._v(t._s(t.quotes.buy))]),e("div",{staticClass:"typeLabel"},[t._v("Buy")])])])])])},fh=[],mh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"input-counter"},[e("div",{staticClass:"input-counter__label",class:t.getActiveTheme},[t._v(t._s(t.label))]),e("div",{staticClass:"input-counter-field",class:"".concat(t.getActiveTheme," ").concat(t.modifire)},[e("div",{staticClass:"input-counter-field__icn add",class:t.getActiveTheme,attrs:{size:32}},[t.isDisabled?t._e():e("div",{on:{click:function(e){return t.$emit("minus",t.value-t.step)},mousedown:t.mousedownOnMinus,mouseup:t.clearIntervalOnMinus}},[e("svgIcon",{attrs:{name:"Minus"}})],1)]),e("input",{attrs:{type:"number",disabled:t.isDisabled},domProps:{value:t.value},on:{input:function(e){return t.$emit("change",e.target.value)}}}),e("div",{staticClass:"input-counter-field__icn remove",class:t.getActiveTheme,attrs:{size:32}},[t.isDisabled?t._e():e("div",{on:{click:function(e){return t.$emit("add",t.value+t.step)},mousedown:t.mousedownOnAdd,mouseup:t.clearIntervalOnAdd}},[e("svgIcon",{attrs:{name:"Add"}})],1)])]),t.validation.isValid?t._e():e("div",{staticClass:"input-counter__label",class:t.getActiveTheme+" error"},[t._v(t._s(t.validation.error))])])},vh=[],yh={components:{},data:function(){return{intervalOnMinus:null,intervalOnAdd:null}},props:{label:{type:String,default:""},isDisabled:{type:Boolean},value:{default:0},step:{default:0},modifire:{type:String,default:"",required:!1},validation:{type:Object,required:!1,default:function(){return{isValid:!0,error:""}}}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{mousedownOnMinus:function(){var t=this;this.isDisabled||(this.intervalOnMinus&&this.clearIntervalOnMinus(),this.intervalOnMinus=setInterval((function(){t.$emit("minus",t.value-t.step)}),150))},clearIntervalOnMinus:function(){clearInterval(this.intervalOnMinus),this.intervalOnMinus=null},mousedownOnAdd:function(){var t=this;this.isDisabled||(this.intervalOnAdd&&this.clearIntervalOnAdd(),this.intervalOnAdd=setInterval((function(){t.$emit("add",t.value+t.step)}),150))},clearIntervalOnAdd:function(){clearInterval(this.intervalOnAdd),this.intervalOnAdd=null}}},Ch=yh,bh=(i("6d9b"),Object(C["a"])(Ch,mh,vh,!1,null,"1aac470c",null)),Sh=bh.exports;function Ph(t){return 0===t?1:1===t?10:2===t?100:3===t?1e3:4===t?1e4:5===t?1e5:1e6}var Th=i("ee80"),xh=i.n(Th),Oh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"row-volume"},[e("div",{staticStyle:{"flex-basis":"50%",width:"50%","flex-grow":"1","margin-right":"1rem"}},[e("Input",{attrs:{label:"Volume",value:t.volume,step:1e3,validation:t.validations.volume},on:{minus:function(e){return t.changeValue(e,"volume",1e3)},add:function(e){return t.changeValue(e,"volume",1e3)},change:function(e){return t.changeValue(e,"volume",1e3)}}})],1),e("div",{staticClass:"row-freeMargin",staticStyle:{"flex-basis":"50%",width:"50%","flex-grow":"1"}},[e("div",{class:"row-freeMargin_label row-freeMargin_label_".concat(t.getActiveTheme)},[t._v("Free Margin Percent")]),e("div",{class:"row-freeMargin_data row-freeMargin_data_".concat(t.getActiveTheme),style:{color:100*t.volume/t.getFreeMargin<20?t.getPositiveColor:t.getNegativeColor}},[t._v(t._s((100*t.volume/t.getFreeMargin).toFixed(2))+" %")])])])},wh=[],_h={components:{RadioButton:$a,Input:Sh},data:function(){return{typeVolume:"volume"}},props:["volume","validations","changeValue"],watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",defaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics"})),{},{getEquity:function(){if(this.defaultAccount)return this.defaultAccount.equity},getPositiveColor:function(){return"dark"===this.getActiveTheme?"#00ffac":"#008e72"},getNegativeColor:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},getAllMargin:function(){return this.getEquity*this.getStatistics.account.maxLeverage},getFreeMargin:function(){return this.getAllMargin-this.getStatistics.account.margin}})},Ah=_h,Dh=(i("9cf4"),Object(C["a"])(Ah,Oh,wh,!1,null,null,null)),kh=Dh.exports,Ih={components:{DxCheckBox:Th["DxCheckBox"],Textarea:ph,InputRow:kh,Input:Sh},data:function(){return{volume:1e3,stopLoss:0,volumeType:"Money",activeDefence:!1,levelChange:500,levelResult:100,takeProfit:0,volumeDinamic:.01,note:"",validations:{takeProfit:{isValid:!0,error:null},stopLoss:{isValid:!0,error:null},volume:{isValid:!0,error:null}}}},props:["quotes","activeSymbol","stepInput"],watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getProfileAccounts:"subscribeOrders/getProfileAccount",getListingAccount:"subscribeOrders/getListingAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics",getContracts:"contracts/getContracts",getSession:"auth/getSession",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen"})),{},{getEquity:function(){if(this.getDefaultAccount)return this.getDefaultAccount.equity},getPercent:function(){return this.volumeDinamic*this.getFreeMargin/100},getAllMargin:function(){return this.getEquity*this.getStatistics.account.maxLeverage},getFreeMargin:function(){return this.getAllMargin-this.getStatistics.account.margin},getVolume:function(){return"Money"===this.volumeType?this.volume:this.volumeDinamic},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.activeSymbol})).precision;return e},getStep:function(){return 1/Ph(this.getPrecision)*30},getVolumeType:function(){return this.volumeType},getActiveAccount:function(){var t=this,e=this.getProfileAccounts.find((function(e){return e.id===(t.getListingAccount?t.getListingAccount.id:t.getDefaultAccount.id)}));return e},getClassesForActiveDefence:function(){var t;return t={},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,"isOpen",this.activeDefence),t}}),methods:{changeVolumeType:function(t){this.volumeType=t},changeActiveDefence:function(){this.activeDefence=!this.activeDefence,this.handlerTrialingForChart(this.activeDefence)},newValue:function(t,e){this[e]=t,this.handlerTrialingForChart(this.activeDefence)},handlerTrialingForChart:function(t){if(t){var e={idChart:this.getSelectedButtonForActiveScreen.id,symbol:this.getSelectedButtonForActiveScreen.symbol,levelChange:this.levelChange,levelResult:this.levelResult};localStorage.setItem("isTrialingFromModal",JSON.stringify(e))}else localStorage.setItem("isTrialingFromModal","")},changeLimit:function(t,e){var i=this[t]||this.quotes.buy,o=e?-1*this.getStep:this.getStep,n=+(i+o).toFixed(this.getPrecision);this.changeValue(n,t,0),this.createTemporaryLimits()},createTemporaryLimits:function(){var t={takeProfit:this.takeProfit,stopLoss:this.stopLoss,idChart:this.getSelectedButtonForActiveScreen.id,symbol:this.getSelectedButtonForActiveScreen.symbol,volume:this.volume};localStorage.setItem("temporaryLimits",JSON.stringify(t))},changeValue:function(t,e,i){if(i=i||0,+t100)return void(this[e]=100);var o=+(+t).toFixed(2);this[e]=+o}this[e]=+t,this.handlerTrialingForChart(this.activeDefence),this.updateValidation(e)}},changeValueDynamic:function(t,e,i){if(i=i||0,+t100)this[e]=100;else{var o=+t.toFixed(2);this[e]=+o}},updateValidation:function(t,e){e=e||{isValid:!0,error:null};var i=JSON.parse(JSON.stringify(this.validations));i[t]=e,this.validations=i},openOrder:function(t){var e=this,i={openPrice:this.quotes[t],takeProfit:this.takeProfit,stopLoss:this.stopLoss};this.validateFields(t,i).then((function(){e.sentOrder("sell"===t?"Sell":"Buy")})).catch((function(t){e.updateValidation(t.type,{isValid:!1,error:t.msg})}))},validateFields:function(t,e){var i={sell:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit>+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены рынка"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены рынка"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},getVolumeFromPercent:function(){var t="Money"===this.volumeType?this.volume:this.getFreeMargin*(this.volumeDinamic/100),e=(t/1e3).toFixed(0),i=(1e3*+e).toFixed(0);return+i},sentOrder:function(t){if(!this.getSession)return this.$emit("closeModal"),void this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"});var e=this.getVolumeFromPercent(),i={Command:"OpenTradingOrder",data:{accountId:this.getActiveAccount.id,orderType:t,volume:e,contractName:this.getActiveAccount.brokerId?this.activeSymbol+".a":this.activeSymbol,comment:"",takeProfit:this.takeProfit,stopLoss:this.stopLoss,trailingSl:this.activeDefence?this.levelResult:null,trailingStart:this.activeDefence?this.levelChange:null},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:i}),this.$emit("close"),this.$emit("closeModal")}},destroyed:function(){localStorage.setItem("temporaryLimits",""),this.handlerTrialingForChart()}},Bh=Ih,Mh=(i("02f6"),Object(C["a"])(Bh,gh,fh,!1,null,"25c43b8d",null)),$h=Mh.exports,Lh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"moment-order-container"},[e("div",{staticClass:"moment-order-container__row"},[e("div",{staticClass:"moment-order-radio",class:"".concat(t.getActiveTheme," ").concat(t.getClassTypes("Sell")),style:{marginRight:"12px"},on:{click:function(e){return t.changeTypeOrder("Sell")}}},[e("div",{staticClass:"moment-order-radio__label"},[t._v("Sell limit")])]),e("div",{staticClass:"moment-order-radio",class:"".concat(t.getActiveTheme," ").concat(t.getClassTypes("Buy")),on:{click:function(e){return t.changeTypeOrder("Buy")}}},[e("div",{staticClass:"moment-order-radio__label"},[t._v("Buy limit")])])]),e("div",{staticClass:"moment-order-container__row"},[e("InputRow",{attrs:{changeVolumeType:t.changeVolumeType,volumeType:t.getVolumeType,volume:t.volume,volumeDinamic:t.volumeDinamic,validations:t.validations,changeValue:t.changeValue}})],1),e("div",{staticClass:"moment-order-container__row"},[e("Input",{attrs:{label:"Price",value:t.newPrice,step:t.getStep,validation:t.validations.newPrice},on:{minus:function(e){return t.changeLimit("newPrice",!0)},add:function(e){return t.changeLimit("newPrice")},change:function(e){return t.changeValue(e,"newPrice",0)}}})],1),e("div",{staticClass:"moment-order-container__row"},[e("Input",{style:{marginRight:"12px"},attrs:{modifire:"negative",label:"Stop loss",value:t.stopLoss,step:t.getStep,validation:t.validations.stopLoss},on:{minus:function(e){return t.changeLimit("stopLoss",!0)},add:function(e){return t.changeLimit("stopLoss")},change:function(e){return t.changeValue(e,"stopLoss",0)}}}),e("Input",{attrs:{modifire:"positive",label:"Take profit",value:t.takeProfit,step:t.getStep,validation:t.validations.takeProfit},on:{minus:function(e){return t.changeLimit("takeProfit",!0)},add:function(e){return t.changeLimit("takeProfit")},change:function(e){return t.changeValue(e,"takeProfit",0)}}})],1),e("div",{staticClass:"moment-order-container__row"},[e("Dropdown",{attrs:{label:"Expiration",list:t.listTimes,value:t.getCurrentTime},on:{selectItem:t.selectItem}})],1),e("div",{staticClass:"moment-order-container__row"},[e("div",{staticClass:"moment-order-container__checkBox",class:t.getActiveTheme,on:{click:t.changeActiveDefence}},[e("DxCheckBox",{attrs:{"element-attr":{class:"attr-to-check-box ".concat(t.getActiveTheme)},value:t.activeDefence}}),t._v("Trailing stop loss")],1)]),e("div",{staticClass:"moment-order-container__trialing",class:t.getClassesForActiveDefence},[e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("mtsir"))),e("Input",{attrs:{label:"",value:t.levelChange,step:10},on:{minus:function(e){return t.changeValue(e,"levelChange",10)},add:function(e){return t.changeValue(e,"levelChange",10)},change:function(e){return t.changeValue(e,"levelChange",10)}}})],1),e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("at_the_level"))),e("Input",{attrs:{label:"",value:t.levelResult,step:10},on:{minus:function(e){return t.changeValue(e,"levelResult",10)},add:function(e){return t.changeValue(e,"levelResult",10)},change:function(e){return t.changeValue(e,"levelResult",10)}}})],1)]),e("div",{staticClass:"moment-order-container__aread",class:t.getActiveTheme},[e("textarea",{attrs:{name:"note-order",placeholder:"Note"}})]),e("div",{staticClass:"pending-order__btn",class:"".concat(t.getActiveTheme," ").concat(t.type),on:{click:function(e){return t.openOrder(t.type)}}},[t._v("Place order")])])},Fh=[],jh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"input-counter"},[e("div",{staticClass:"input-counter__label",class:t.getActiveTheme},[t._v(t._s(t.label))]),e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],staticClass:"dropdown-field",class:t.getActiveTheme},[e("div",{staticClass:"dropdown-value",attrs:{type:"text"},on:{click:t.handleClickOnInput}},[t._v(t._s(t.value.label))]),t.isOpen?e("div",{staticClass:"input-counter-dropdown",class:t.getActiveTheme},t._l(t.list,(function(i){return e("div",{staticClass:"input-counter-dropdown__item",class:t.getActiveTheme,on:{click:function(e){return t.selectItem(i)}}},[t._v(t._s(i.label))])})),0):t._e()])])},Rh=[],Wh={components:{},data:function(){return{isOpen:!1}},props:{label:{type:String,default:""},value:{default:""},list:{type:Array}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{selectItem:function(t){this.$emit("selectItem",t),this.close()},close:function(){this.isOpen=!1},handleClickOnInput:function(){this.isOpen=!this.isOpen}}},Nh=Wh,Eh=(i("42a6"),Object(C["a"])(Nh,jh,Rh,!1,null,"4cf1e270",null)),Uh=Eh.exports,Vh={components:{DxCheckBox:Th["DxCheckBox"],RadioButton:$a,Dropdown:Uh,Textarea:ph,InputRow:kh,Input:Sh},data:function(){return{volume:1e3,stopLoss:0,volumeType:"Money",activeDefence:!1,currentTime:0,levelChange:500,levelResult:100,volumeDinamic:.01,id:null,takeProfit:0,listTimes:[{id:0,label:"The execution",hours:696},{id:1,label:"01:00",hours:1},{id:2,label:"02:00",hours:2},{id:3,label:"03:00",hours:3},{id:4,label:"06:00",hours:6},{id:5,label:"12:00",hours:12},{id:6,label:"24:00",hours:24}],isInitPrice:!0,note:"",type:"Sell",newPrice:0,validations:{takeProfit:{isValid:!0,error:null},stopLoss:{isValid:!0,error:null},volume:{isValid:!0,error:null},newPrice:{isValid:!0,error:null}}}},props:["quotes","activeSymbol"],watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getProfileAccounts:"subscribeOrders/getProfileAccount",getListingAccount:"subscribeOrders/getListingAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",getContracts:"contracts/getContracts",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getSession:"auth/getSession"})),{},{getClassesForActiveDefence:function(){var t;return t={},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,"isOpen",this.activeDefence),t},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.activeSymbol})).precision;return e},getVolumeType:function(){return this.volumeType},getStep:function(){return 1/Ph(this.getPrecision)*10},getClassTypes:function(){var t=this;return function(e){if(e===t.type)return t.type}},getCurrentTime:function(){var t=this;return this.listTimes.find((function(e){return e.id===t.currentTime}))},getActiveAccount:function(){var t=this,e=this.getProfileAccounts.find((function(e){return e.id===(t.getListingAccount?t.getListingAccount.id:t.getDefaultAccount.id)}));return e}}),methods:{changeVolumeType:function(t){this.volumeType=t},changeActiveDefence:function(){this.activeDefence=!this.activeDefence},initPrice:function(){if(this.isInitPrice){var t=this.quotes[this.type.toLowerCase()],e="Sell"===this.type?1:-1,i=t+e*(8*this.getStep);this.newPrice=+i.toFixed(this.getPrecision)}},setNewValuePendingOrder:function(t){t.data?t.symbol===this.activeSymbol&&(t.data=t.data.creater||t.data,this.takeProfit=t.data.takeProfit,this.stopLoss=t.data.stopLoss,this.newPrice=t.data.openPrice,this.volume=t.data.volume,this.currentTime=this.listTimes.find((function(e){return e.hours===t.data.hours})).id):this.$emit("closeModal")},updatePendingOrder:function(t){!t&&this.id&&(this.id="createrPendingOrder_".concat(e,"_").concat(Math.floor(Math.random()*(new Date).getTime())));var e=this.newPrice||this.quotes[this.type.toLowerCase()];t&&(this.id=null)},changeTypeOrder:function(t){this.type=t,this.takeProfit=0,this.stopLoss=0,this.initPrice(),this.nulifyValidations(),this.updatePendingOrder()},nulifyValidations:function(){this.validations={takeProfit:{isValid:!0,error:null},stopLoss:{isValid:!0,error:null},volume:{isValid:!0,error:null},newPrice:{isValid:!0,error:null}}},changeLimit:function(t,e){var i=this.newPrice||this.quotes.buy,o=this[t]||i,n=e?-1*this.getStep:this.getStep,s=+(o+n).toFixed(this.getPrecision);this.changeValue(s,t,0)},checkValid:function(t,e){if("takeProfit"!==t&&"stopLoss"!==t)return e;var i={Buy:{takeProfit:+e>+this.newPrice,stopLoss:+e<+this.newPrice},Sell:{takeProfit:+e<+this.newPrice,stopLoss:+e>+this.newPrice}};i[this.type][t]?this[t]=e:this[t]=0,this.updatePendingOrder()},debauncer:function(t,e,i,o){this[t]?(clearTimeout(this[t]),this[t]=setTimeout((function(){return e.apply(void 0,Object(x["a"])(i))}),o)):this[t]=setTimeout((function(){return e.apply(void 0,Object(x["a"])(i))}),o)},changeValue:function(t,e,i){i=i||0,+tt&&(e.stopLoss=0)}},Sell:{takeProfit:function(){e.takeProfit>t&&(e.takeProfit=0)},stopLoss:function(){e.stopLoss+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},toIsoString:function(t){t.getTimezoneOffset();var e=function(t){return(t<10?"0":"")+t};return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())},getWithHours:function(t){var e=new Date(this.getServerTime.now),i=(new Date).getTimezoneOffset()/60;return e.setHours(e.getHours()+i+t),e},openPosition:function(t){var e=this.getWithHours(t.hours),i={command:"PendingTradingOrder",Token:this.getSession,data:{accountId:this.getDefaultAccount.id,comment:"",volumeType:"Money"===this.volumeType?0:1,contractName:this.activeSymbol,volume:"Money"===this.volumeType?t.volume:this.volumeDinamic,orderType:t.orderType,stopLoss:t.stopLoss,takeProfit:t.takeProfit,trailingStart:this.activeDefence?this.levelChange:null,trailingSl:this.activeDefence?this.levelResult:null,priceType:"Stop",timeEnd:this.toIsoString(e),price:t.openPrice}};this.$socketStream.sendCommand({ws:"apiWS",command:i}),this.$emit("closeModal")}},mounted:function(){this.initPrice(),this.updatePendingOrder()},destroyed:function(){this.updatePendingOrder(!0)}},Hh=Vh,Gh=(i("9e12"),Object(C["a"])(Hh,Lh,Fh,!1,null,null,null)),qh=Gh.exports,zh=function(){var t=this,e=t._self._c;return e("div",{staticClass:"moment-order-container"},[e("div",{class:"moment-order-container__infoWrapper moment-order-container__infoWrapper_".concat(t.getActiveTheme)},[e("div",{staticClass:"moment-order-container__infoItem"},[e("div",{class:"moment-order-container__infoLabel moment-order-container__infoLabel_".concat(t.getActiveTheme)},[t._v("Type")]),e("div",{staticClass:"moment-order-container__infoData",style:{color:"Sell"===t.getOrderType?t.getNegativeColorOrder:t.getPositiveColorOrder}},[t._v(t._s(t.getTitleTypeOrders))])]),e("div",{staticClass:"moment-order-container__infoItem"},[e("div",{class:"moment-order-container__infoLabel moment-order-container__infoLabel_".concat(t.getActiveTheme)},[t._v("Price")]),e("div",{staticClass:"moment-order-container__infoData",style:{color:"Sell"===t.getOrderType?t.getNegativeColorOrder:t.getPositiveColorOrder}},[t._v(t._s(t.getPrice))])]),e("div",{staticClass:"moment-order-container__infoItem"},[e("div",{class:"moment-order-container__infoLabel moment-order-container__infoLabel_".concat(t.getActiveTheme)},[t._v("Volume")]),e("div",{staticClass:"moment-order-container__infoData",style:{color:"light"===t.getActiveTheme?"#333":"#fff"}},[t._v(t._s(t.$moneyf(t.getVolume)))])]),e("div",{staticClass:"moment-order-container__infoItem"},[e("div",{class:"moment-order-container__infoLabel moment-order-container__infoLabel_".concat(t.getActiveTheme)},[t._v("Profit")]),e("div",{staticClass:"moment-order-container__infoData",style:{color:t.getProfit<0?t.getNegativeColorOrder:t.getPositiveColorOrder}},[t._v("$ "+t._s(t.$moneyf(t.getProfit)))])])]),e("div",{staticClass:"moment-order-container__row"},[e("Input",{style:{marginRight:"12px"},attrs:{label:"Stop loss",value:t.getStopLoss,step:.3*t.quotes.buy,validation:t.validations.stopLoss,modifire:"negative"},on:{minus:function(e){return t.changeLimit("stopLoss",t.getStep,!0)},add:function(e){return t.changeLimit("stopLoss",t.getStep)},change:function(e){return t.changeValue(e,"stopLoss",0)}}}),e("Input",{attrs:{label:"Take profit",value:t.getTakeProfit,step:.3*t.quotes.buy,validation:t.validations.takeProfit,modifire:"positive"},on:{minus:function(e){return t.changeLimit("takeProfit",t.getStep,!0)},add:function(e){return t.changeLimit("takeProfit",t.getStep)},change:function(e){return t.changeValue(e,"takeProfit",0)}}})],1),t.getOrders.length&&1===t.getOrders.length?e("div",{staticClass:"moment-order-container__row"},[e("div",{staticClass:"moment-order-container__checkBox",class:t.getActiveTheme},[e("DxCheckBox",{key:t.getDefenceStatus,attrs:{"element-attr":{class:"attr-to-check-box ".concat(t.getActiveTheme)},value:t.getDefenceStatus,onValueChanged:t.changeActiveDefence}}),t._v("Trailing stop loss")],1)]):t._e(),t.getOrders&&t.getOrders.length?e("div",{staticClass:"moment-order-container__trialing",class:t.getClassesForActiveDefence},[e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("mtsir"))),e("Input",{attrs:{label:"",value:t.getOrders[0].trailingStart?t.getOrders[0].trailingStart:t.levelChange,step:10},on:{minus:function(e){return t.changeLimit("trailingStart",10,!0)},add:function(e){return t.changeLimit("trailingStart",10)},change:function(e){return t.changeValue(e,"trailingStart",10)}}})],1),e("div",{staticClass:"moment-order-container__trialingDescription",class:t.getActiveTheme},[t._v(t._s(t.$t("at_the_level"))),e("Input",{attrs:{label:"",value:t.getOrders[0].trailingSL?t.getOrders[0].trailingSL:t.levelResult,step:10},on:{minus:function(e){return t.changeLimit(t.getTrailingSLLabel,10,!0)},add:function(e){return t.changeLimit(t.getTrailingSLLabel,10)},change:function(e){return t.changeValue(e,t.getTrailingSLLabel,10)}}})],1)]):t._e(),e("div",{staticClass:"button-confirmSettings"},[e("ButtonIconFlat",{attrs:{modifier:{class:["buttonSettings","buttonSettings_".concat(t.getActiveTheme)]},disabled:!t.updateOrder},on:{click:function(e){return t.modifyOrder(t.updateOrder)}}},[t._v(t._s(t.$t("apply")))])],1),e("div",{staticClass:"buttons-open-order"},[e("div",{staticClass:"button-open-order",class:"".concat(t.getActiveTheme," ").concat(t.getRevertOrderType)},[e("div",{staticClass:"button-open-order__trigger",class:"".concat(t.getActiveTheme," ").concat(t.getRevertOrderType),on:{click:t.closePosition}},[t._v(t._s(t.getRevertOrderType)+" "+t._s(t.quotes.sell))])])])])},Yh=[],Xh={data:function(){return{debounce:null}},methods:{debouncer:function(t,e,i){var o=this;clearTimeout(this.debounce),this.debounce=setTimeout((function(){o[t](i||void 0)}),e)}}},Qh=i("d4ec"),Jh=i("bee2"),Kh=function(){function t(){Object(Qh["a"])(this,t),this.events={}}return Object(Jh["a"])(t,[{key:"clone",value:function(){return new t(this.events)}},{key:"subscribe",value:function(t,e){!this.events[t]&&(this.events[t]=[]),this.events[t].push(e)}},{key:"unsubscribe",value:function(t,e){this.events[t]&&(this.events[t]=this.events[t].filter((function(t){return e!==t})))}},{key:"emit",value:function(t,e){var i=this.events[t];i&&i.forEach((function(t){return t.call(null,e)}))}}],[{key:"from",value:function(e){return new t(e)}}]),t}(),Zh=new Kh,tp={components:{DxCheckBox:Th["DxCheckBox"],Textarea:ph,InputRow:kh,Input:Sh},data:function(){return{stopLoss:0,allOrders:[],levelChange:500,levelResult:100,changeMessage:"",updateOrder:null,updateProfit:0,validations:{takeProfit:{isValid:!0,error:null},stopLoss:{isValid:!0,error:null},volume:{isValid:!0,error:null}}}},props:["quotes","order","activeSymbol","stepInput"],mixins:[Xh],watch:{changeMessage:function(t,e){(t&&e||e&&!t)&&this.debouncer("onchangeTextArea",300,t)},getCountOrders:function(t){t||this.$emit("closeModal")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getProfileAccounts:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics",getContracts:"contracts/getContracts",getSession:"auth/getSession",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getNewOrderModal:"modal/getNewOrderModal"})),{},{ordersByIdFilter:function(){var t=this;return this.allOrders.filter((function(e){return t.order.some((function(t){return t===e.id}))}))},getPositiveColorOrder:function(){return"dark"===this.getActiveTheme?"#00ffac":"#008e72"},getTitleTypeOrders:function(){if(this.getOrderType)return this.getOrders.length>1?"".concat(this.getOrderType,"(").concat(this.getOrders.length,")"):this.getOrderType},getPrice:function(){if(this.getOrderType){var t=0;return(this.getOrders.reduce((function(t,e){return t+e.openPrice}),t)/this.getOrders.length).toFixed(this.getPrecision)}},getProfit:function(){if(this.getOrderType){var t=0;return this.updateProfit?this.updateProfit:this.getOrders.reduce((function(t,e){return t+e.profit}),t)}},getNegativeColorOrder:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},getOrders:function(){return this.updateOrder||this.ordersByIdFilter},getCountOrders:function(){return this.getOrders.length},getStopLoss:function(){if(this.getOrders&&this.getOrders.length){var t=this.getOrders[0].stopLoss,e=this.getOrders.every((function(e){return e.stopLoss===t}));return e?this.getOrders[0].stopLoss:0}},getTakeProfit:function(){if(this.getOrders&&this.getOrders.length){var t=this.getOrders[0].takeProfit,e=this.getOrders.every((function(e){return e.takeProfit===t}));return e?this.getOrders[0].takeProfit:0}},getDefenceStatus:function(){if(this.getOrders&&this.getOrders.length){var t=this.getOrders[0].trailingSL,e=this.getOrders[0].trailingStart;return t&&e}},getStartPrices:function(){if(this.getOrders&&this.getOrders.length)return"Buy"===this.order[0].orderType?{stopLoss:Math.min.apply(null,this.getOrders.map((function(t){return t.openPrice}))),takeProfit:Math.max.apply(null,this.getOrders.map((function(t){return t.openPrice})))}:{stopLoss:Math.max.apply(null,this.getOrders.map((function(t){return t.openPrice}))),takeProfit:Math.min.apply(null,this.getOrders.map((function(t){return t.openPrice})))}},getVolume:function(){if(this.getOrders&&this.getOrders.length){var t=0,e=this.getOrders.reduce((function(t,e){return t+e.volume}),t);return e}},getRevertOrderType:function(){if(this.getOrderType)return"Buy"===this.getOrderType?"Sell":"Buy"},getOrderType:function(){if(this.getOrders&&this.getOrders.length)return this.getOrders[0].orderType},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.activeSymbol})).precision;return e},getStep:function(){return 1/Ph(this.getPrecision)*30},getActiveAccount:function(){return this.getDefaultAccount},getClassesForActiveDefence:function(){var t;return t={},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,"isOpen",this.getDefenceStatus),t},getTrailingSL:function(){return this.getOrders.trailingSl||this.getOrders.trailingSL},getTrailingSLLabel:function(){return this.getOrders[0].trailingSl?"trailingSl":this.getOrders[0].trailingSL?"trailingSL":"trailingSl"}}),methods:{setMessageHandler:function(t){t&&t.command&&"BrokerPosition"===t.command?t.data.accountId===this.getDefaultAccount.id&&(this.allOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders,this.updateOrder=null,"Closed"===t.data.status&&(this.updateOrder=null)):t&&t.command&&"AccountsDetails"===t.command&&this.setProfitForOrders(t.data)},setProfitForOrders:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id})).openOrders.tradingOrders,o=0;this.getOrders.forEach((function(t){var e=i.find((function(e){return e.id===t.id}));e&&(o+=e.profit)})),this.updateProfit=o},changeLimit:function(t,e,i){var o=this.getClonnedOrders(),n=o[0].orderType,s=i?-1:1,r=o[0][t]||this.getStartPrices[t],a=r+e*s,c="takeProfit"!==t&&"stopLoss"!==t||("Buy"===n&&"takeProfit"===t&&a>=+this.getPrice||"Buy"===n&&"stopLoss"===t&&a<=+this.getPrice||"Sell"===n&&"stopLoss"===t&&a>=+this.getPrice||"Sell"===n&&"takeProfit"===t&&a<=+this.getPrice);if(c){var l=a.toFixed(this.getPrecision);o.forEach((function(e){e[t]=+l})),this.updateOrder=o,Zh.emit("change_".concat(t),this.updateOrder)}},modifyOrder:function(t){var e=this;t.forEach((function(t){var i={Command:"ModifyTradingOrder",data:t,Token:e.getSession};e.$socketStream.sendCommand({ws:"apiWS",command:i})})),Zh.emit("change_takeProfit",0)},changeActiveDefence:function(t){var e;t.value?(e=this.getClonnedOrders(),e.forEach((function(t){t.trailingStart=500,t.trailingSL=100}))):(e=this.getClonnedOrders(),e.forEach((function(t){t.trailingStart=0,t.trailingSL=0}))),this.updateOrder=e},getClonnedOrders:function(){var t=JSON.parse(JSON.stringify(this.getOrders));return t},closePosition:function(){var t=this;this.getOrders.forEach((function(e){var i={Command:"CloseTradingOrder",data:{accountId:e.accountId,id:e.id},Token:t.getSession};t.$socketStream.sendCommand({ws:"apiWS",command:i})})),this.$emit("closeModal")},changeValue:function(t,e,i){if(i=i||0,+t100)return void(this[e]=100);var o=+(+t).toFixed(2);this[e]=+o}this[e]=+t,this.updateValidation(e)}},updateValidation:function(t,e){e=e||{isValid:!0,error:null};var i=JSON.parse(JSON.stringify(this.validations));i[t]=e,this.validations=i},validateFields:function(t,e){var i={sell:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit>+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены рынка"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены рынка"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},onchangeTextArea:function(t){var e=this.getClonnedOrders();e.forEach((function(e){e.comment=t})),this.updateOrder=e}},mounted:function(){var t=this;this.$socketStream.$on("apiWS",this.setMessageHandler),this.allOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders,this.$nextTick((function(){t.changeMessage=t.getOrders[0].comment||""}))},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),Zh.emit("change_takeProfit",0)}},ep=tp,ip=(i("b93c"),Object(C["a"])(ep,zh,Yh,!1,null,"5c9f3af0",null)),op=ip.exports,np=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ByBitOrder",class:t.darkClass},[e("div",{staticClass:"crossOrIsolated"},[e("div",{staticClass:"buttonCross",class:{active:"spot"===t.valueTopButton},on:{click:function(e){t.valueTopButton="spot"}}},[t._v("Spot")]),e("div",{staticClass:"buttonIsolated",class:{active:"margin"===t.valueTopButton},on:{click:function(e){t.valueTopButton="margin"}}},[t._v("Margin 10x")])]),e("div",{staticClass:"componentButtons"},t._l(t.componentButtons,(function(i){return e("div",{key:i.id,staticClass:"buttonTabs",class:{active:t.tabsComponent===i.component},on:{click:function(e){return t.setView(i.component)}}},[e("span",{staticClass:"text"},[t._v(t._s(i.title))])])})),0),e("div",{staticClass:"contentTabs"},[e(t.tabsComponent,t._b({tag:"component"},"component",t.propsComponent[t.tabsComponent],!1)),e("BuyAndSellButtons",{attrs:{quotes:t.quotes,openOrder:t.openOrder}})],1)])},sp=[],rp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Limit",class:t.darkClass},[e("AvailableBalance"),e("InputContent",{attrs:{title:"Order price",currency:"USDT"}}),e("InputContent",{attrs:{title:"Qty",currency:"BTS"}}),e("PercentRange"),e("InputContent",{attrs:{title:"Order Value",currency:"USDT"}}),"margin"===t.valueTopButton?e("Amount"):t._e(),e("MarketSentiment")],1)},ap=[],cp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AvailableBalance",class:t.darkClass},[e("div",{staticClass:"title"},[t._v("Available Balance:")]),e("div",{staticClass:"balance"},[t._v("1 457 858.20 USDT")])])},lp=[],up={name:"AvailableBalance",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},dp=up,hp=(i("218a"),Object(C["a"])(dp,cp,lp,!1,null,"3654d11b",null)),pp=hp.exports,gp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RangeSlider",class:t.darkClass,style:t.rootStyle},[e("div",{staticClass:"pseudoTrack"},[e("div",{staticClass:"valueView"},[t._v(t._s(t.valueRange)+t._s(t.valuePrefix))])]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.valueRange,expression:"valueRange"}],attrs:{type:"range",min:t.min,max:t.max,step:t.step},domProps:{value:t.valueRange},on:{__r:function(e){t.valueRange=e.target.value}}})])},fp=[],mp={name:"RangeSlider",mixins:[xt],props:{step:{type:Number},max:{type:Number},min:{type:Number},thumbWidth:{type:Number},valuePrefix:{type:String,default:""}},components:{},data:function(){return{valueRange:20}},computed:{rootStyle:function(){return{"--currentRange":this.valueRange+"%","--percentView":this.percentView+"%","--thumbWidth":this.thumbWidth+"px"}},percentView:function(){var t=this.max-this.min,e=this.valueRange-this.min;return 100*e/t}},watch:{valueRange:function(t){this.$emit("valueRangeChanged",t)}},mounted:function(){},destroyed:function(){},methods:{}},vp=mp,yp=(i("dadf"),Object(C["a"])(vp,gp,fp,!1,null,"63ac6cb8",null)),Cp=yp.exports,bp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Leverage",class:t.darkClass},[e("div",{staticClass:"title"},[t._v("Leverage")]),e("div",{staticClass:"sliderBlock"},[e("div",{staticClass:"leftValue"},[t._v("1x")]),e("div",{staticClass:"slider"},[e("RangeSlider",{attrs:{step:1,min:1,max:100,"thumb-width":43,"value-prefix":"x"}})],1),e("div",{staticClass:"rightValue"},[t._v("100x")])])])},Sp=[],Pp={name:"Leverage",mixins:[xt],props:{},components:{RangeSlider:Cp},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Tp=Pp,xp=(i("b513"),Object(C["a"])(Tp,bp,Sp,!1,null,"bb29384e",null)),Op=xp.exports,wp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InputContent",class:t.darkClass},[t.title?e("div",{staticClass:"title"},[t._v(t._s(t.title))]):t._e(),e("div",{staticClass:"wrapInput"},[e("div",{staticClass:"inputContainer"},[t.isTypeNumber?e("button",{staticClass:"btn minus",on:{click:function(e){return t.setValue(-1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconMinus,!1))],1):t._e(),e("input",{ref:"input",attrs:{type:t.type,step:t.step},domProps:{value:t.value},on:{input:t.inputHandler,blur:t.blurHandler}}),t.isTypeNumber?e("button",{staticClass:"btn plus",on:{click:function(e){return t.setValue(1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconPlus,!1))],1):t._e()]),t.currency?e("div",{staticClass:"currency"},[t._v(t._s(t.currency))]):t._e()])])},_p=[],Ap={name:"InputContent",mixins:[xt],inject:["setInputData"],props:{title:{type:String,default:""},currency:{type:String,default:""},type:{type:String,default:"text"},value:{type:[Number,String]},field:{type:String},minValue:{type:[Boolean,String,Number],default:0},maxValue:{type:[Boolean,String,Number],default:0},step:{type:[Boolean,String,Number],default:0}},components:{},data:function(){return{}},computed:{isTypeNumber:function(){return"number"===this.type},iconMinus:function(){return{name:"Minus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconPlus:function(){return{name:"Plus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},numberCharacters:function(){var t,e=this.step.toString().split("."),i=(null===(t=e[1])||void 0===t?void 0:t.length)||0;return Math.pow(10,i)}},mounted:function(){},destroyed:function(){},methods:{inputHandler:function(t){var e=+t.target.value;this.setInputData(e,this.field)},blurHandler:function(t){var e=+t.target.value;if("number"===this.type){(ethis.maxValue)&&(e=ethis.maxValue)){var i=e*this.numberCharacters,o=this.step*this.numberCharacters;i%o!==0&&(e=Math.round(i)/this.numberCharacters),this.setInputData(e,this.field)}}}},Dp=Ap,kp=(i("0528"),Object(C["a"])(Dp,wp,_p,!1,null,"3f5373c2",null)),Ip=kp.exports,Bp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PercentRange",class:t.darkClass},[e("div",{staticClass:"leftValue"},[t._v("0%")]),e("div",{staticClass:"slider"},[e("RangeSlider",{attrs:{step:1,min:0,max:100,"thumb-width":43}})],1),e("div",{staticClass:"rightValue"},[t._v("100%")])])},Mp=[],$p={name:"PercentRange",mixins:[xt],props:{},components:{RangeSlider:Cp},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Lp=$p,Fp=(i("2104"),Object(C["a"])(Lp,Bp,Mp,!1,null,"3720dad4",null)),jp=Fp.exports,Rp=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MarketSentiment",class:t.darkClass},[e("div",{staticClass:"floatLabel"},[t._v("Настроение рынка")]),e("div",{staticClass:"collapsed"},[e("div",{staticClass:"sellCollapsed"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.getSellTrend)+"%")]),e("div",{staticClass:"text"},[t._v("SELL")])])]),e("div",{staticClass:"indicator",style:t.sliderStyle},[t._m(0)]),e("div",{staticClass:"byCollapsed"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.getBuyTrend)+"%")]),e("div",{staticClass:"text"},[t._v("BUY")])])])])])},Wp=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"realSize"},[e("div",{staticClass:"caret"})])}],Np={name:"MarketSentiment",mixins:[xt],props:{symbol:{type:String}},components:{},data:function(){return{trendData:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api"})),{},{getAllCountOrders:function(){return this.trendData.length?this.trendData[0].buyCount+this.trendData[0].sellCount:0},getSellTrend:function(){if(!this.trendData.length)return 50;var t=this.trendData[0].sellCount;return t?Math.round(100*t/this.getAllCountOrders):0},getBuyTrend:function(){return this.trendData.length?100-this.getSellTrend:50},getDelta:function(){return this.trendData.length?this.getBuyTrend>this.getSellTrend?this.getBuyTrend-50:this.getBuyTrend+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены рынка"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены рынка"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},sentOrder:function(t){if(!this.getToken)return this.$emit("closeModal"),void this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"});var e={Command:"OpenTradingOrder",data:{accountId:this.getDefaultAccount.id,orderType:t,volume:+this.orderValue,contractName:this.activeSymbol,comment:"",takeProfit:0,stopLoss:0,trailingSl:null,trailingStart:null},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.$emit("close"),this.$emit("closeModal")}}},Ig=kg,Bg=(i("c391"),Object(C["a"])(Ig,np,sp,!1,null,"37b0db13",null)),Mg=Bg.exports,$g=function(){var t=this,e=t._self._c;return e("div",{staticClass:"BitGetOrder",class:t.darkClass},[e("div",{staticClass:"topButton"},[e("div",{staticClass:"buttonTab",class:{active:"cross"===t.topButtonValue},on:{click:function(e){return t.setTopButtonValue("cross")}}},[t._v("Cross")]),e("div",{staticClass:"buttonTab",class:{active:"isolated"===t.topButtonValue},on:{click:function(e){return t.setTopButtonValue("isolated")}}},[t._v("Isolated")]),e("div",{staticClass:"buttonTab",class:{active:"leverage"===t.topButtonValue},on:{click:function(e){return t.setTopButtonValue("leverage")}}},[t._v("Leverage 20x")])]),e("div",{staticClass:"buttonCloseAndOpen"},[e("button",{staticClass:"mybutton",class:{active:"open"===t.position},on:{click:function(e){return t.setPosition("open")}}},[t._v("Open")]),e("button",{staticClass:"mybutton",class:{active:"close"===t.position},on:{click:function(e){return t.setPosition("close")}}},[t._v("Close")])]),e("div",{ref:"container",staticClass:"adaptiveBlockContainer"},[t.refContainer?e("AdaptiveLineButtons",{attrs:{idDropDown:"openOrder",tabsSet:t.buttonsArray,refTabWrapper:t.refContainer,maxHeightDropDownList:200,widthDropDownList:100},on:{setActiveTab:t.setActiveTab},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.data;return[e("div",{staticClass:"name"},[t._v(t._s(o.value))])]}}],null,!1,2907741113)}):t._e()],1),e("div",{staticClass:"tabsContent"},[e(t.activeTab,t._b({tag:"component"},"component",t.propsComponent[t.activeTab],!1),[e("BuyAndSellButtons",{attrs:{quotes:t.quotes,openOrder:t.openOrder}})],1)],1)])},Lg=[],Fg=function(){var t=this,e=t._self._c;return e("div",{key:t.calcOperation,staticClass:"AdaptiveLineButtons",class:t.rootClass},[t._l(t.arrayButtons,(function(i,o){return e("ButtonComponent",{class:t.dopClassFirst,attrs:{index:o,dataTabs:i},on:{mouseenter:t.mouseenter,mouseleave:t.mouseleave,setActiveTab:t.setActiveTab,setWidthButton:t.setWidthButton},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.data;return[t._t("default",null,{data:i})]}}],null,!0)})})),t.tabSetDropDown.length>0?e("DropDownButton",{key:JSON.stringify(t.tabSetDropDown),class:t.classDropDown,attrs:{items:t.tabSetDropDown,"display-expr":"text",showArrowIcon:!0,hoverStateEnabled:!1,id:t.idDropDown,icon:t.$iconPath("new-dropdown-arrow-down"),focusStateEnabled:!1,"drop-down-options":t.dropDownOption,dropDownContentTemplate:"content"},scopedSlots:t._u([{key:"content",fn:function(i){var o=i.data;return[e("div",{staticClass:"adaptiveTabs-ddList",style:t.styleDropDown,on:{wheel:function(t){t.stopPropagation()}}},t._l(o,(function(i,o){return e("ButtonComponent",{attrs:{index:o,dataTabs:i},on:{setActiveTab:t.setActiveTab,setWidthButton:t.setWidthButton},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.data;return[t._t("default",null,{data:i})]}}],null,!0)})})),1)]}}],null,!1,3296357968)}):t._e()],2)},jg=[],Rg=function(){var t=this,e=t._self._c;return e("button",{ref:"button",staticClass:"ButtonComponent",class:t.rootClass,on:{mouseenter:t.mouseenter,mouseleave:t.mouseleave,click:function(e){return e.stopPropagation(),t.setActiveTab.apply(null,arguments)}}},[t._t("default",null,{data:t.dataTabs})],2)},Wg=[],Ng={name:"ButtonComponent",components:{},props:{dataTabs:{type:Object},index:{type:Number}},mixins:[xt],data:function(){return{}},watch:{},computed:{rootClass:function(){var t=[Object(c["a"])({first:0===this.index,isActive:this.dataTabs.isActive},this.darkClass)];return this.dataTabs.dopClass&&t.push(this.dataTabs.dopClass),t}},methods:{setActiveTab:function(){this.$emit("setActiveTab",this.dataTabs)},mouseenter:function(t){this.$emit("mouseenter",{e:t,dataButton:this.dataTabs})},mouseleave:function(){this.$emit("mouseleave")}},mounted:function(){this.$emit("setWidthButton",this.$refs.button.offsetWidth)},destroyed:function(){},activated:function(){},deactivated:function(){}},Eg=Ng,Ug=(i("3303"),Object(C["a"])(Eg,Rg,Wg,!1,null,"a6f2952c",null)),Vg=Ug.exports,Hg=i("d1d4"),Gg=i.n(Hg),qg={data:function(){return{resizeObserver:null,el:null}},beforeDestroy:function(){this.resizeObserver&&this.resizeObserver.unobserve(this.el)},methods:{initObserver:function(t,e){var i=new ResizeObserver(t);i.observe(e),this.resizeObserver=i,this.el=e}}},zg=function(t,e){var i;return function(){var o=arguments,n=this;clearInterval(i),i=setTimeout((function(){t.apply(n,o)}),e)}},Yg={name:"AdaptiveLineButtons",components:{ButtonComponent:Vg,DropDownButton:Gg.a},props:{tabsSet:{type:Array},refTabWrapper:{type:Node},idDropDown:{type:String},maxHeightDropDownList:{type:[Boolean,String,Number]},widthDropDownList:{type:[Boolean,String,Number]},dopClassFirst:{type:String,default:""}},mixins:[qg,xt],data:function(){return{tabSetVisible:[],tabSetVisibleWidth:[],tabSetDropDown:[],tabSetDropDownWidth:[],calcOperation:"progress",widthButtonDropDown:32,indexSlice:0,buttonsWidthArray:[],widthContainer:null}},watch:{tabsSet:function(){this.redraw()},buttonsWidthArray:function(t){var e=this;if(this.widthContainer&&-1!==this.widthContainer&&t.length===this.tabsSet.length){var i=0,o=!0;this.buttonsWidthArray.forEach((function(t,n){o&&(o=i+t+e.widthButtonDropDown-1){var s,r,a,c,l=this.tabSetDropDown.splice(n,1),u=this.tabSetDropDownWidth.splice(n,1),d=this.tabSetVisible.splice(-1,1),h=this.tabSetVisibleWidth.splice(-1,1);(s=this.tabSetDropDown).unshift.apply(s,Object(x["a"])(d)),(r=this.tabSetDropDownWidth).unshift.apply(r,Object(x["a"])(h)),(a=this.tabSetVisible).push.apply(a,Object(x["a"])(l)),(c=this.tabSetVisibleWidth).push.apply(c,Object(x["a"])(u));var p=this.tabSetVisibleWidth.reduce((function(t,e){return t+e}),0);if(p+this.widthButtonDropDown>this.widthContainer)return void this.repeatCalcWidth()}this.calcOperation="finish"}}},computed:{maxHeightDropDown:function(){return this.maxHeightDropDownList?"string"===typeof this.maxHeightDropDownList?this.maxHeightDropDownList:this.maxHeightDropDownList+"px":"none"},widthDropDown:function(){return this.widthDropDownList?"string"===typeof this.widthDropDownList?this.widthDropDownList:this.widthDropDownList+"px":"auto"},styleDropDown:function(){return{width:this.widthDropDown,maxHeight:this.maxHeightDropDown}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{wrap:"progress"===this.calcOperation})},arrayButtons:function(){return"progress"===this.calcOperation?this.tabsSet:this.tabSetVisible},classDropDown:function(){return"dropDownButton"},dropDownOption:function(){return{width:"auto",container:".".concat(this.classDropDown),position:{my:"top right",at:"bottom right",of:"#".concat(this.idDropDown),offset:{x:0,y:4}}}}},methods:{repeatCalcWidth:function(){var t,e,i=this.tabSetVisible.splice(-2,1),o=this.tabSetVisibleWidth.splice(-2,1);(t=this.tabSetDropDown).unshift.apply(t,Object(x["a"])(i)),(e=this.tabSetDropDownWidth).unshift.apply(e,Object(x["a"])(o));var n=this.tabSetVisibleWidth.reduce((function(t,e){return t+e}),0);if(n+32>this.widthContainer)return this.repeatCalcWidth();this.calcOperation="finish"},redraw:function(){this.indexSlice=0,this.buttonsWidthArray=[],this.tabSetVisible=[],this.tabSetVisibleWidth=[],this.tabSetDropDown=[],this.tabSetDropDownWidth=[],this.calcOperation="progress"},onResize:zg((function(){this.widthContainer=this.refTabWrapper.clientWidth-1,this.redraw()}),100),setWidthButton:function(t){this.buttonsWidthArray.push(t)},setActiveTab:function(t){this.$emit("setActiveTab",t)},mouseenter:function(t){this.$emit("mouseenter",t)},mouseleave:function(){this.$emit("mouseleave")}},mounted:function(){this.widthContainer=this.refTabWrapper.clientWidth-1,this.initObserver(this.onResize,this.refTabWrapper)}},Xg=Yg,Qg=(i("2656"),Object(C["a"])(Xg,Fg,jg,!1,null,"4816c3a6",null)),Jg=Qg.exports,Kg=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Limit",class:t.darkClass},[e("AvailableBalance"),e("InputContent",{attrs:{title:"Price",currency:"USDT"}}),e("AmountAndCurrency",{attrs:{list:t.list,valueList:t.valueList}}),e("PercentRange"),t.isClosePosition?t._e():e("LongAndShortCheckbox",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort}}),e("MarketSentiment"),t._t("default"),e("CostMax"),e("div",{staticClass:"effectiveTime"},[e("div",{staticClass:"title"},[t._v("Effective time")]),e("div",{staticClass:"selectContent"},[e("DxSelectBox",{attrs:{width:"100%",height:32,items:t.listTime,value:t.valueListTime.id,"value-expr":"id","display-expr":"title","element-attr":t.elementAttr,dropDownOptions:{wrapperAttr:{class:t.dropDownOptionsClass}}},on:{valueChanged:function(e){return t.onValueChanged(e,"listTime")}}})],1)]),e("Margin")],2)},Zg=[],tf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AmountAndCurrency",class:t.darkClass},[e("div",{staticClass:"title"},[t._v("Amount")]),e("div",{staticClass:"wrapInput"},[e("InputContent",{attrs:{type:"number",field:t.field,value:t.valueInput,step:t.findContract.volumeStep,"max-value":t.findContract.maxVolume,"min-value":t.findContract.minVolume}}),e("div",{staticClass:"currency"},[e("DxSelectBox",{attrs:{width:"100%",height:32,items:t.list,value:t.valueList.id,"value-expr":"id","display-expr":"title","element-attr":t.elementAttr,dropDownOptions:{wrapperAttr:{class:t.dropDownOptionsClass}}},on:{valueChanged:function(e){return t.onValueChanged(e,"list")}}})],1)],1)])},ef=[],of={name:"AmountAndCurrency",mixins:[xt],inject:["onValueChanged","setInputData"],props:{list:{type:Array},valueList:{type:Object},valueInput:{type:[String,Number],default:""},field:{type:String,default:""},findContract:{type:Object}},components:{InputContent:Ip,DxSelectBox:Bo.a},data:function(){return{}},computed:{dropDownOptionsClass:function(){var t="dropDownSelectCrypto";return this.darkClass.dark&&(t+=" dark"),t},elementAttr:function(){var t={class:"selectForCrypto"};return this.darkClass.dark&&(t={class:"selectForCrypto dark"}),t}},mounted:function(){},destroyed:function(){},methods:{inputHandler:function(t){var e=t.target.value;this.setInputData(e,this.field)}}},nf=of,sf=(i("e8a5"),Object(C["a"])(nf,tf,ef,!1,null,"dbccb202",null)),rf=sf.exports,af=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LongAndShortCheckbox",class:t.darkClass},[e("div",{staticClass:"leftCheckbox"},[e("DxCheckBox",{attrs:{value:t.checkLong,elementAttr:{class:"checkBoxCustom"}},on:{valueChanged:function(e){return t.setStatusCheckBox(e,"checkLong")}}}),e("div",{staticClass:"text"},[t._v("Long TP/SL")])],1),e("div",{staticClass:"rightCheckbox"},[e("DxCheckBox",{attrs:{value:t.checkShort,elementAttr:{class:"checkBoxCustom"}},on:{valueChanged:function(e){return t.setStatusCheckBox(e,"checkShort")}}}),e("div",{staticClass:"text"},[t._v("Short TP/SL")])],1)])},cf=[],lf={name:"LongAndShortCheckbox",inject:["setStatusCheckBox"],mixins:[xt],props:{checkLong:{type:Boolean},checkShort:{type:Boolean}},components:{DxCheckBox:Th["DxCheckBox"]},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},uf=lf,df=(i("fb8f"),Object(C["a"])(uf,af,cf,!1,null,"41ca78bd",null)),hf=df.exports,pf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Margin",class:t.darkClass},[e("div",{staticClass:"title"},[t._v("Margin")]),t._m(0),t._m(1)])},gf=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"line"},[e("div",{staticClass:"title"},[t._v("Margin ratio:")]),e("div",{staticClass:"value"},[t._v("0.00%")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"line"},[e("div",{staticClass:"title"},[t._v("Maintenance margin:")]),e("div",{staticClass:"value"},[t._v("0.00000000")])])}],ff={name:"Margin",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},mf=ff,vf=(i("d6d1"),Object(C["a"])(mf,pf,gf,!1,null,"429c131a",null)),yf=vf.exports,Cf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CloseAmount",class:t.darkClass},[t._m(0)])},bf=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"line"},[e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Close amount:")]),e("div",{staticClass:"value"},[t._v("0 BTC")])]),e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Close amount:")]),e("div",{staticClass:"value"},[t._v("0 BTC")])])])}],Sf={name:"CloseAmount",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Pf=Sf,Tf=(i("803e"),Object(C["a"])(Pf,Cf,bf,!1,null,"74f27b5f",null)),xf=Tf.exports,Of=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CostMax",class:t.darkClass},[t._m(0),t._m(1)])},wf=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"cost"},[e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Cost:")]),e("div",{staticClass:"value"},[t._v("0.000 USDT")])]),e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Cost:")]),e("div",{staticClass:"value"},[t._v("0.000 USDT")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"max"},[e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Max:")]),e("div",{staticClass:"value"},[t._v("0.000 BTC")])]),e("div",{staticClass:"part"},[e("div",{staticClass:"title"},[t._v("Max:")]),e("div",{staticClass:"value"},[t._v("0.000 BTC")])])])}],_f={name:"CostMax",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Af=_f,Df=(i("44b4"),Object(C["a"])(Af,Of,wf,!1,null,"fa443850",null)),kf=Df.exports,If={name:"Limit",inject:["onValueChanged"],mixins:[xt],props:{list:{type:Array},listTime:{type:Array},valueList:{type:Object},valueListTime:{type:Object},checkLong:{type:Boolean},checkShort:{type:Boolean},position:{type:String}},components:{AvailableBalance:pp,InputContent:Ip,AmountAndCurrency:rf,PercentRange:jp,LongAndShortCheckbox:hf,MarketSentiment:Vp,Margin:yf,CostMax:kf,CloseAmount:xf,DxSelectBox:Bo.a},data:function(){return{}},computed:{isClosePosition:function(){return"close"===this.position},dropDownOptionsClass:function(){var t="dropDownSelectCrypto";return this.darkClass.dark&&(t+=" dark"),t},elementAttr:function(){var t={class:"selectForCrypto"};return this.darkClass.dark&&(t={class:"selectForCrypto dark"}),t}},mounted:function(){},destroyed:function(){},methods:{}},Bf=If,Mf=(i("ff4f"),Object(C["a"])(Bf,Kg,Zg,!1,null,"62e29e98",null)),$f=Mf.exports,Lf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Market",class:t.darkClass},[e("AvailableBalance"),e("AmountAndCurrency",{attrs:{field:"amountValue",list:t.list,valueList:t.valueList,findContract:t.findContract,valueInput:t.amountValue}}),e("PercentRange"),e("MarketSentiment"),t._t("default"),e("CloseAmount"),e("Margin")],2)},Ff=[],jf={name:"Market",mixins:[xt],props:{list:{type:Array},valueList:{type:Object},amountValue:{type:[String,Number]},findContract:{type:Object}},components:{AvailableBalance:pp,AmountAndCurrency:rf,PercentRange:jp,MarketSentiment:Vp,CloseAmount:xf,Margin:yf},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Rf=jf,Wf=(i("bd19"),Object(C["a"])(Rf,Lf,Ff,!1,null,"275414b6",null)),Nf=Wf.exports,Ef=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TrailingStop",class:t.darkClass},[e("InputContent",{attrs:{title:"Trigger price",currency:"USDT"}}),e("InputContent",{attrs:{title:"Callback rate",currency:"%"}}),e("PercentRange"),e("InputContent",{attrs:{title:"Amount",currency:"BTS"}}),e("LongAndShortCheckbox",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort}}),e("MarketSentiment"),t._t("default"),e("Margin")],2)},Uf=[],Vf={name:"TrailingStop",mixins:[xt],props:{checkLong:{type:Boolean},checkShort:{type:Boolean}},components:{InputContent:Ip,PercentRange:jp,LongAndShortCheckbox:hf,MarketSentiment:Vp,Margin:yf},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Hf=Vf,Gf=(i("2554"),Object(C["a"])(Hf,Ef,Uf,!1,null,"996e6dba",null)),qf=Gf.exports,zf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Trigger",class:t.darkClass},[e("AvailableBalance"),e("div",{staticClass:"twoFields"},[e("InputContent",{attrs:{title:"Trigger price",currency:"USDT"}})],1),e("div",{staticClass:"twoFields"},[e("InputContent",{attrs:{title:"Execution price",currency:"USDT"}})],1),e("AmountAndCurrency",{attrs:{list:t.list,valueList:t.valueList}}),e("PercentRange"),e("LongAndShortCheckbox",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort}}),e("MarketSentiment"),t._t("default"),e("CostMax"),e("Margin")],2)},Yf=[],Xf={name:"Trigger",mixins:[xt],props:{checkLong:{type:Boolean},checkShort:{type:Boolean},list:{type:Array},valueList:{type:Object},amountValue:{type:[String,Number]}},components:{AmountAndCurrency:rf,LongAndShortCheckbox:hf,MarketSentiment:Vp,AvailableBalance:pp,PercentRange:jp,CostMax:kf,Margin:yf,InputContent:Ip},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Qf=Xf,Jf=(i("8cfa"),Object(C["a"])(Qf,zf,Yf,!1,null,"47527a97",null)),Kf=Jf.exports,Zf=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PostOnly",class:t.darkClass},[e("AvailableBalance"),e("InputContent",{attrs:{title:"Trigger price",currency:"USDT"}}),e("AmountAndCurrency",{attrs:{list:t.list,valueList:t.valueList}}),e("PercentRange"),e("LongAndShortCheckbox",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort}}),e("MarketSentiment"),t._t("default"),e("CostMax"),e("Margin")],2)},tm=[],em={name:"PostOnly",mixins:[xt],props:{list:{type:Array},valueList:{type:Object},checkLong:{type:Boolean},checkShort:{type:Boolean}},components:{AvailableBalance:pp,AmountAndCurrency:rf,InputContent:Ip,PercentRange:jp,LongAndShortCheckbox:hf,MarketSentiment:Vp,CostMax:kf,Margin:yf},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},im=em,om=(i("b2f6"),Object(C["a"])(im,Zf,tm,!1,null,"0887f135",null)),nm=om.exports,sm={name:"BitGetOrder",mixins:[xt],props:{quotes:{type:Object},activeSymbol:{type:String}},components:{AdaptiveLineButtons:Jg,Limit:$f,Market:Nf,TrailingStop:qf,Trigger:Kf,PostOnly:nm,BuyAndSellButtons:Dg},provide:function(){return{onValueChanged:this.onValueChanged,setStatusCheckBox:this.setStatusCheckBox,setInputData:this.setInputData}},data:function(){return{amountValue:"",position:"open",checkLong:!1,checkShort:!1,refContainer:null,activeTab:"Market",topButtonValue:"cross",valueList:{id:1,title:"BTS"},valueListTime:{id:1,title:"GTS"},list:[{id:1,title:"BTS"},{id:2,title:"USDT"},{id:3,title:"???"}],listTime:[{id:1,title:"GTS"},{id:2,title:"FOK"},{id:3,title:"IOK"}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{findContract:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.activeSymbol}))},buttonsArray:function(){return[{value:"Market",componentName:"Market",isActive:"Market"===this.activeTab},{value:"Limit",componentName:"Limit",isActive:"Limit"===this.activeTab},{value:"Trailing stop",componentName:"TrailingStop",isActive:"TrailingStop"===this.activeTab},{value:"Trigger",componentName:"Trigger",isActive:"Trigger"===this.activeTab},{value:"Post only",componentName:"PostOnly",isActive:"PostOnly"===this.activeTab}]},propsComponent:function(){return{Limit:{list:this.list,valueList:this.valueList,checkLong:this.checkLong,checkShort:this.checkShort,listTime:this.listTime,valueListTime:this.valueListTime,position:this.position,quotes:this.quotes},Market:{list:this.list,valueList:this.valueList,amountValue:this.amountValue,findContract:this.findContract},TrailingStop:{checkLong:this.checkLong,checkShort:this.checkShort},Trigger:{list:this.list,valueList:this.valueList,checkLong:this.checkLong,checkShort:this.checkShort,amountValue:this.amountValue},PostOnly:{list:this.list,valueList:this.valueList,checkLong:this.checkLong,checkShort:this.checkShort}}}}),mounted:function(){var t;this.refContainer=this.$refs.container,this.amountValue=(null===(t=this.findContract)||void 0===t?void 0:t.minVolume)||0},destroyed:function(){},methods:{setInputData:function(t,e){this[e]=t},setActiveTab:function(t){this.activeTab=t.componentName},onValueChanged:function(t,e){"list"!==e?this.valueListTime=this.listTime.find((function(e){return e.id===t.value})):this.valueList=this.list.find((function(e){return e.id===t.value}))},setStatusCheckBox:function(t,e){this[e]=t.value},setPosition:function(t){this.position=t},openOrder:function(t){var e=this,i={openPrice:this.quotes[t],takeProfit:0,stopLoss:0};this.validateFields(t,i).then((function(){e.sentOrder("sell"===t?"Sell":"Buy")})).catch((function(t){window.console.log(t)}))},validateFields:function(t,e){var i={sell:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit>+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены рынка"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены рынка"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},sentOrder:function(t){if(!this.getToken)return this.$emit("closeModal"),void this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"});var e={Command:"OpenTradingOrder",data:{accountId:this.getDefaultAccount.id,orderType:t,volume:+this.amountValue,contractName:this.activeSymbol,comment:"",takeProfit:0,stopLoss:0,trailingSl:null,trailingStart:null},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.$emit("close"),this.$emit("closeModal")},setTopButtonValue:function(t){this.topButtonValue=t}}},rm=sm,am=(i("2166"),i("e73f"),Object(C["a"])(rm,$g,Lg,!1,null,"fc145c4e",null)),cm=am.exports,lm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CryptoOrder",class:t.darkClass},[e("SpotDerivatives",{attrs:{margin:t.margin,activeTab:t.activeTab}}),t.margin?e("CrossAndCalculate",{attrs:{marginMode:t.marginMode,selectedLeverage:t.selectedLeverage}}):t._e(),e(t.activeTab,t._b({tag:"component"},"component",t.propsComponent[t.activeTab],!1),[t._v("// Spot or Derivatives")]),e("DxPopup",{ref:"refModal",attrs:{width:"auto",height:"auto",visible:t.isOpenModal,closeOnOutsideClick:!0,position:t.position,shading:!1,showTitle:!1,"content-template":"content"},on:{hidden:t.hidden},scopedSlots:t._u([{key:"content",fn:function(){return[e(t.componentInModal,t._b({tag:"component"},"component",t.modalProps[t.componentInModal],!1))]},proxy:!0}])})],1)},um=[],dm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SpotDerivatives",class:t.darkClass},[e("div",{staticClass:"tabSection"},[e("div",{staticClass:"buttonTab",class:{active:"Spot"===t.activeTab},on:{click:function(e){return t.setTab("Spot")}}},[t._v("Spot")]),e("div",{staticClass:"buttonTab",class:{active:"Derivatives"===t.activeTab},on:{click:function(e){return t.setTab("Derivatives")}}},[t._v("Derivatives")])]),e("div",{staticClass:"checkboxSection"},[e("DxCheckBox",{attrs:{value:t.margin,elementAttr:{class:"checkBoxCustom"}},on:{valueChanged:function(e){return t.setStatusCheckBox(e,"margin")}}}),e("div",{staticClass:"text"},[t._v("Margin")])],1)])},hm=[],pm={name:"SpotDerivatives",inject:["setData","setTab"],mixins:[xt],props:{margin:{type:Boolean},activeTab:{type:String}},components:{DxCheckBox:Th["DxCheckBox"]},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{setStatusCheckBox:function(t,e){this.setData(t.value,e)}}},gm=pm,fm=(i("fa04"),Object(C["a"])(gm,dm,hm,!1,null,"18e6c5ef",null)),mm=fm.exports,vm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Derivatives"},[e("ButtonOpenClose"),e(t.componentName,t._b({tag:"component"},"component",t.propsComponent[t.componentName],!1))],1)},ym=[],Cm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ByOrSellButton",class:t.darkClass},[e("button",{staticClass:"sell",class:{active:"sell"===t.transactionType},on:{click:function(e){return t.setTransactionType("sell")}}},[t._v(t._s(t.textSell))]),e("button",{staticClass:"buy",class:{active:"buy"===t.transactionType},on:{click:function(e){return t.setTransactionType("buy")}}},[t._v(t._s(t.textBuy))])])},bm=[],Sm={name:"ByOrSellButton",inject:["setTransactionType"],mixins:[xt],props:{transactionType:{type:String},typeOrder:{type:String}},components:{},data:function(){return{}},computed:{textSell:function(){return"Limit"===this.typeOrder?"Sell Limit":"Sell"},textBuy:function(){return"Limit"===this.typeOrder?"Buy Limit":"Buy"}},mounted:function(){},destroyed:function(){},methods:{}},Pm=Sm,Tm=(i("6dc8d"),Object(C["a"])(Pm,Cm,bm,!1,null,"5edc46b9",null)),xm=Tm.exports,Om=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LimitOrMarketButton",class:t.darkClass},[e("button",{class:{active:"Limit"===t.typeOrder},on:{click:function(e){return t.setTypeOrder("Limit")}}},[t._v("Limit")]),e("button",{class:{active:"Market"===t.typeOrder},on:{click:function(e){return t.setTypeOrder("Market")}}},[t._v("Market")])])},wm=[],_m={name:"LimitOrMarketButton",inject:["setTypeOrder"],mixins:[xt],props:{typeOrder:{type:String}},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},Am=_m,Dm=(i("572e"),Object(C["a"])(Am,Om,wm,!1,null,"29a8ce6d",null)),km=Dm.exports,Im=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LimitDerivatives"},[e("AvailableBalance"),e("InputContent",{attrs:{title:"Order price",type:"number",field:"orderPrice",label:"USDT",value:t.orderPrice,visibleButton:!1}}),e("InputContent",{attrs:{title:"Qty",type:"number",field:"qty",label:"BTS",value:t.qty,visibleButton:!1}}),e("InputContent",{attrs:{title:"Order value",type:"number",field:"orderValue",label:"USDT",value:t.orderValue,visibleButton:!1}}),e("LongAndShortRadio",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort}}),e("ValueAndCost"),e("MarketSentiment"),e("ButtonComponents")],1)},Bm=[],Mm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AvailableBalance",class:t.darkClass},[e("div",{staticClass:"title"},[t._v("Available Balance:")]),e("div",{staticClass:"balance"},[t._v(t._s(t.getEquity)+" USDT")])])},$m=[];function Lm(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"===typeof+t){var o=Math.trunc(+t).toString().length+e;if(0===e){var n=new Intl.NumberFormat("ru-RU").format(t).replace(",",".");return i?n:n.replace(/\s/g,"")}var s=new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:o}).format(+t).replace(",",".");return i?s:+s.replace(/\s/g,"")}}function Fm(t,e){var i=Math.pow(10,e),o=Math.round(t*i)/i;return o}var jm={name:"AvailableBalance",mixins:[xt],props:{},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStat:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getEquity:function(){return this.getStat?Lm(this.getStat.account.equity,2,!0):Lm(this.getDefaultAccount.equity,2,!0)}}),mounted:function(){},destroyed:function(){},methods:{}},Rm=jm,Wm=(i("c661"),Object(C["a"])(Rm,Mm,$m,!1,null,"7c7a4d24",null)),Nm=Wm.exports,Em=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InputContent",class:t.darkClass,style:{marginBottom:t.mb+"px"}},[t.title?e("div",{staticClass:"title"},[t._v(t._s(t.title))]):t._e(),e("div",{staticClass:"wrapInput"},[e("div",{staticClass:"inputContainer"},[t.isTypeNumber&&t.visibleButton?e("button",{staticClass:"btn minus",on:{click:function(e){return t.setValue(-1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconMinus,!1))],1):t._e(),e("input",{ref:"input",class:t.inputClass,style:{textAlign:t.align},attrs:{type:t.type,step:t.step},domProps:{value:t.value},on:{input:t.inputHandler,blur:t.blurHandler}}),t.isTypeNumber&&t.visibleButton?e("button",{staticClass:"btn plus",on:{click:function(e){return t.setValue(1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconPlus,!1))],1):t._e(),t.label?e("div",{staticClass:"label"},[t._v(t._s(t.label))]):t._e()]),t.currency?e("div",{staticClass:"currency"},[t._v(t._s(t.currency))]):t._e()])])},Um=[],Vm={name:"InputContent",mixins:[xt],inject:["setData"],props:{title:{type:String,default:""},currency:{type:String,default:""},type:{type:String,default:"text"},value:{type:[Number,String]},field:{type:String},minValue:{type:[Boolean,String,Number],default:-1e9},maxValue:{type:[Boolean,String,Number],default:1e9},step:{type:[Boolean,String,Number],default:1},visibleButton:{type:Boolean,default:!0},label:{type:String,default:""},align:{type:String,default:"left"},mb:{type:Number,default:8}},components:{},data:function(){return{}},computed:{isTypeNumber:function(){return"number"===this.type},iconMinus:function(){return{name:"Minus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconPlus:function(){return{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},numberCharacters:function(){var t,e=this.step.toString().split("."),i=(null===(t=e[1])||void 0===t?void 0:t.length)||0;return Math.pow(10,i)},inputClass:function(){return{buttonsInput:this.isTypeNumber&&this.visibleButton}}},mounted:function(){},destroyed:function(){},methods:{inputHandler:function(t){var e=+t.target.value;this.setData(e,this.field)},blurHandler:function(t){var e=+t.target.value;if("number"===this.type){(ethis.maxValue)&&(e=ethis.maxValue)){var i=e*this.numberCharacters,o=this.step*this.numberCharacters;i%o!==0&&(e=Math.round(i)/this.numberCharacters),this.setData(e,this.field)}}}},Hm=Vm,Gm=(i("252a"),Object(C["a"])(Hm,Em,Um,!1,null,"30a52ea8",null)),qm=Gm.exports,zm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LongAndShortRadio",class:t.darkClass},t._l(t.radioButtonGroup,(function(i){return e("div",{key:i.value,staticClass:"radio"},[e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.eventRadio,expression:"eventRadio"}],attrs:{type:"radio"},domProps:{value:i.value,checked:t._q(t.eventRadio,i.value)},on:{change:function(e){t.eventRadio=i.value}}}),e("span",{staticClass:"title"},[t._v(t._s(i.title))])])])})),0)},Ym=[],Xm={name:"LongAndShortRadio",inject:["setData"],mixins:[xt],props:{checkLong:{type:Boolean},checkShort:{type:Boolean},transactionType:{type:String}},components:{DxCheckBox:Th["DxCheckBox"]},data:function(){return{eventRadio:this.transactionType}},computed:{radioButtonGroup:function(){return[{value:"buy",title:"Long TP/SL"},{value:"sell",title:"Short TP/SL"}]}},mounted:function(){},destroyed:function(){},watch:{eventRadio:function(t){this.setData(t,"transactionType")}},methods:{}},Qm=Xm,Jm=(i("b997"),Object(C["a"])(Qm,zm,Ym,!1,null,"7bc3441f",null)),Km=Jm.exports,Zm=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ValueAndCost",class:t.darkClass},[t._m(0),t._m(1)])},tv=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"valueSection"},[e("div",{staticClass:"title"},[t._v("Value")]),e("div",{staticClass:"value"},[e("span",{staticClass:"green"},[t._v("264,373.79")]),t._v(" / "),e("span",{staticClass:"red"},[t._v("264,504.33")]),t._v("  USDT")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"costSection"},[e("div",{staticClass:"title"},[t._v("Cost")]),e("div",{staticClass:"value"},[e("span",{staticClass:"green"},[t._v("264,373.79")]),t._v(" / "),e("span",{staticClass:"red"},[t._v("264,504.33")]),t._v("  USDT")])])}],ev={name:"ValueAndCost",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},iv=ev,ov=(i("3f6a"),Object(C["a"])(iv,Zm,tv,!1,null,"15cf2ce4",null)),nv=ov.exports,sv=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MarketSentiment",class:t.darkClass},[e("div",{staticClass:"floatLabel"},[t._v("Настроение рынка")]),e("div",{staticClass:"collapsed"},[e("div",{staticClass:"sellCollapsed"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(46)+"%")]),e("div",{staticClass:"text"},[t._v("SELL")])])]),e("div",{staticClass:"indicator",style:t.sliderStyle},[e("div",{staticClass:"realSize"},[e("div",{staticClass:"caret"},[t._v(t._s(26))])])]),e("div",{staticClass:"byCollapsed"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(54)+"%")]),e("div",{staticClass:"text"},[t._v("BUY")])])])])])},rv=[],av={name:"MarketSentiment",mixins:[xt],props:{},components:{},data:function(){return{}},computed:{getDataIconBear:function(){return{name:"Bear",color:this.darkClass.dark?"#fa4c4a":"#E91212"}},getDataIconBull:function(){return{name:"Bull",color:this.darkClass.dark?"#00ffac":"#008E72"}},sliderStyle:function(){return{"--percent":"26%"}}},mounted:function(){},destroyed:function(){},methods:{}},cv=av,lv=(i("0717"),Object(C["a"])(cv,sv,rv,!1,null,"150c8ea6",null)),uv=lv.exports,dv=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonComponents",class:t.darkClass},[e("button",{staticClass:"buy",attrs:{disabled:t.disabledBuy},on:{click:function(e){return t.openOrder("buy")}}},[t._v("Buy/Long")]),e("button",{staticClass:"sell",attrs:{disabled:t.disabledSell},on:{click:function(e){return t.openOrder("sell")}}},[t._v("Sell/Short")])])},hv=[],pv={name:"ButtonComponents",inject:["openOrder"],mixins:[xt],props:{transactionType:{type:String}},components:{},data:function(){return{}},computed:{disabledBuy:function(){return"sell"===this.transactionType},disabledSell:function(){return"buy"===this.transactionType}},mounted:function(){},destroyed:function(){},methods:{}},gv=pv,fv=(i("44728"),Object(C["a"])(gv,dv,hv,!1,null,"fc7a1ca2",null)),mv=fv.exports,vv={name:"LimitDerivatives",mixins:[],props:{orderPrice:{type:[Number,String]},qty:{type:[Number,String]},orderValue:{type:[Number,String]},checkLong:{type:Boolean},checkShort:{type:Boolean}},components:{AvailableBalance:Nm,InputContent:qm,LongAndShortRadio:Km,ValueAndCost:nv,MarketSentiment:uv,ButtonComponents:mv},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},yv=vv,Cv=(i("c123"),Object(C["a"])(yv,Im,Bm,!1,null,"4555c4ac",null)),bv=Cv.exports,Sv=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MarketDerivatives",class:t.darkClass},[e("AvailableBalance"),e("div",{staticClass:"orderByQty",on:{click:t.openModalOrderPlacement}},[e("div",{staticClass:"title"},[t._v("Order by Qty")]),e("div",{staticClass:"triangle"})]),e("div",{staticClass:"titleHardcode"},[t._v("Order Value")]),e("HardcodeInput",{attrs:{field:"orderValue",value:t.orderValue,"min-value":t.findContract.minVolume,"max-value":t.findContract.maxVolume,step:t.orderValueStep,dopText:t.dopTextOrderValue,transactionType:t.transactionType,quotes:t.quotes,digit:t.digit,mb:8}}),e("PercentsSlices",{attrs:{percent:t.percent}}),e("LongAndShortRadio",{attrs:{checkLong:t.checkLong,checkShort:t.checkShort,transactionType:t.transactionType}}),e("InputWithSelect",{attrs:{title:"Take profit price",configInput:t.configInputProfit,configSelect:t.configSelectProfit,error:t.profitError.error,textError:t.profitError.errorText}}),e("InputWithSelect",{staticClass:"mb8",attrs:{title:"Stop loss price",configInput:t.configInputLoss,configSelect:t.configSelectLoss,error:t.lossError.error,textError:t.lossError.errorText}}),e("div",{staticClass:"lineText"},[e("div",{staticClass:"title"},[t._v("Amount to Borrow")]),e("div",{staticClass:"value"},[t._v(" "+t._s(t.amountToBorrow)+" USDT")])]),e("div",{staticClass:"lineText mb8"},[e("div",{staticClass:"title"},[t._v("Max. buying amount")]),e("div",{staticClass:"value"},[t._v(" "+t._s(t.maxBuyingAmount)+" coins")])]),e("MarketSentiment"),e("ButtonComponents",{attrs:{transactionType:t.transactionType}})],1)},Pv=[],Tv=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PercentsSlices",class:t.darkClass},t._l(t.percents,(function(i){return e("div",{key:i,staticClass:"slice",class:{active:i===t.percent},on:{click:function(e){return t.setData(i,"percent")}}},[t._v(t._s(i)+" %")])})),0)},xv=[],Ov={name:"PercentsSlices",inject:["setData"],mixins:[xt],props:{percent:{type:Number}},components:{},data:function(){return{}},computed:{percents:function(){return[10,25,50,75,100]}},mounted:function(){},destroyed:function(){},methods:{}},wv=Ov,_v=(i("2500"),Object(C["a"])(wv,Tv,xv,!1,null,"0556eeb0",null)),Av=_v.exports,Dv=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HardcodeInput",class:t.darkClass,style:t.styleRoot},[t.title?e("div",{staticClass:"leftText"},[t._v(t._s(t.title))]):t._e(),e("button",{staticClass:"btn minus",on:{click:function(e){return e.stopPropagation(),t.setValue(-1)},pointerdown:function(e){return t.pointerDownHandler(-1)},pointerup:t.pointerUpHandler}},[e("svgIcon",t._b({},"svgIcon",t.iconMinus,!1))],1),e("label",{staticClass:"inputContainer"},[e("span",{staticClass:"inputWrap",attrs:{"data-val":t.value}},[e("input",{ref:"input",attrs:{type:"number",step:t.step},domProps:{value:t.value},on:{input:t.inputHandler,blur:t.blurHandler}})]),e("div",{staticClass:"dopText"},[t._v(t._s(t.dopText))])]),e("button",{staticClass:"btn plus",on:{click:function(e){return e.stopPropagation(),t.setValue(1)},pointerdown:function(e){return t.pointerDownHandler(1)},pointerup:t.pointerUpHandler}},[e("svgIcon",t._b({},"svgIcon",t.iconPlus,!1))],1),e("DropDownButton",{ref:"dropDown",class:t.classDropDown,attrs:{items:t.tabSetDropDown,opened:t.opened,"display-expr":"text",showArrowIcon:!0,hoverStateEnabled:!1,id:t.idDropDown,icon:t.$iconPath("new-dropdown-arrow-down"),focusStateEnabled:!1,"drop-down-options":t.dropDownOption,dropDownContentTemplate:"content"},scopedSlots:t._u([{key:"content",fn:function(i){var o=i.data;return[e("div",{staticClass:"valueList",on:{wheel:function(t){t.stopPropagation()}}},t._l(o,(function(i){return e("div",{staticClass:"oneValue",on:{click:function(e){return t.clickValue(i.value)}}},[e("span",{staticClass:"itemValue"},[t._v(t._s(i.value))]),e("span",{domProps:{innerHTML:t._s(i.dopText)}})])})),0)]}}])})],1)},kv=[],Iv={name:"HardcodeInput",inject:["setData"],mixins:[xt],props:{value:{type:[Number,String]},field:{type:String,default:""},minValue:{type:[Boolean,String,Number],default:-1e9},maxValue:{type:[Boolean,String,Number],default:1e9},step:{type:[Boolean,String,Number],default:1},title:{type:String},mb:{type:Number,default:0},dopText:{type:String},transactionType:{type:String},quotes:{type:Object},digit:{type:Number}},components:{DropDownButton:Gg.a},data:function(){return{interval:null,opened:!1}},computed:{tabSetDropDown:function(){var t=this,e=this.step,i=Array.from(new Array(12)).map((function(i,o){var n=+(e*++o).toFixed(12);8===o&&(e=100*t.step),o>7&&(n=e++);var s=n*t.quotes.sell;sUSDT)":"("+Lm(Fm(r,t.digit),5,!0)+"USDT)";return{id:o,value:n,dopText:a}}));return i},iconMinus:function(){return{name:"Minus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconPlus:function(){return{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},idDropDown:function(){return this.field},classDropDown:function(){return"dropDownButton"},dropDownOption:function(){return{width:"auto",container:".".concat(this.classDropDown),position:{my:"top right",at:"bottom right",of:"#".concat(this.idDropDown),offset:{x:0,y:4}}}},numberCharacters:function(){var t,e=this.step.toString().split("."),i=(null===(t=e[1])||void 0===t?void 0:t.length)||0;return Math.pow(10,i)},styleRoot:function(){return{marginBottom:this.mb+"px",paddingLeft:this.title?"8px":0}}},mounted:function(){},destroyed:function(){},methods:{pointerDownHandler:function(t){var e=this;this.interval=setInterval((function(){e.setValue(t)}),300)},pointerUpHandler:function(){clearInterval(this.interval)},setValue:function(t){var e=+(+this.value+this.step*t).toFixed(12);if(ethis.maxValue)e=this.maxValue;else{var i=e*this.numberCharacters,o=this.step*this.numberCharacters;i%o!==0&&(e=Math.round(i)/this.numberCharacters),this.setData(e,this.field,this.step)}},inputHandler:function(t){var e=+t.target.value;this.setData(e,this.field)},blurHandler:function(t){var e=+t.target.value;(ethis.maxValue)&&(e=ethis.takeProfit?{error:!0,errorText:"Take profit должен быть выше цены рынка"}:"sell"===this.transactionType&&this.quotes.buythis.stopLoss?{error:!0,errorText:"Stop loss должен быть выше цены рынка"}:{error:!1,errorText:""}},stat:function(){var t;return(null===(t=this.getStat)||void 0===t?void 0:t.account)||this.getDefaultAccount},amountToBorrow:function(){var t=this.stat.equity,e=this.stat.maxLeverage;return Lm(t*e,2,!0)},maxBuyingAmount:function(){var t=this.stat.equity,e=this.stat.maxLeverage,i=this.quotes.buy,o=t*e/i;return Lm(o,o<1?5:1,!0)},buyContractPrice:function(){var t=this.orderValue*this.quotes.buy;return tthis.takeProfit?{error:!0,errorText:"Take profit должен быть выше цены рынка"}:"sell"===this.transactionType&&this.quotes.buythis.stopLoss?{error:!0,errorText:"Stop loss должен быть выше цены рынка"}:{error:!1,errorText:""}},stat:function(){var t;return(null===(t=this.getStat)||void 0===t?void 0:t.account)||this.getDefaultAccount},amountToBorrow:function(){var t=this.stat.equity,e=this.stat.maxLeverage;return Lm(t*e,2,!0)},maxBuyingAmount:function(){var t=this.stat.equity,e=this.stat.maxLeverage,i=this.quotes.buy,o=t*e/i;return Lm(o,o<1?5:1,!0)},payContract:function(){return this.findContract.name.slice(-3)},buyContractPrice:function(){var t=this.orderValue*this.quotes.buy;return t=this.quotes.buy&&(t=this.quotes.buy),"takeProfit"===e&&t<=this.quotes.buy&&(t=this.quotes.buy)):"sell"===this[this.activeTab].transactionType&&("stopLoss"===e&&t<=this.quotes.buy&&(t=this.quotes.buy),"takeProfit"===e&&t>=this.quotes.buy&&(t=this.quotes.buy)),this[this.activeTab][e]=+t.toFixed(3)},setData:function(t,e){["takeProfit","stopLoss"].includes(e)?this.setProfitLossPrice(t,e):"undefined"!==typeof this[this.activeTab][e]?this[this.activeTab][e]=t:this[e]=t},setTab:function(t){this.activeTab=t},setTransactionType:function(t){this[this.activeTab].transactionType=t},setTypeOrder:function(t){this[this.activeTab].typeOrder=t},onValueChanged:function(t,e){var i=e.field,o=e.arr;this[this.activeTab][i]=this[o].find((function(e){return e.id===t.value}))},setActiveLimitTime:function(t){this[this.activeTab].timeLimit=t.value},hidden:function(){var t=this;this.isOpenModal=!1,this.$nextTick((function(){t.position={},t.componentInModal=""}))},hiddenHandler:function(){this.refModal.instance.hide()},openModal:function(t){var e=this,i=t.position,o=t.componentName;this.position=i,this.componentInModal=o,this.$nextTick((function(){e.isOpenModal=!0}))},openOrder:function(t){var e=this;if(t){var i={openPrice:this.quotes[t],takeProfit:this.Spot.takeProfit,stopLoss:this.Spot.stopLoss};this.validateFields(t,i).then((function(){e.sentOrder("sell"===t?"Sell":"Buy")})).catch((function(t){window.console.log(t)}))}},validateFields:function(t,e){var i={sell:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit>+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть ниже цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss<+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть выше цены рынка"}:""}},buy:{takeProfit:function(t){return t.takeProfit&&+t.takeProfit<+t.openPrice?{type:"takeProfit",msg:"Take profit должен быть выше цены рынка"}:""},stopLoss:function(t){return t.stopLoss&&+t.stopLoss>+t.openPrice?{type:"stopLoss",msg:"Stop loss должен быть ниже цены рынка"}:""}}},o=new Promise((function(o,n){var s=i[t]["takeProfit"](e)||i[t]["stopLoss"](e);if(!s)return o(e);n(s)}));return o},sentOrder:function(t){if(!this.getSession)return this.$emit("closeModal"),void this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"});var e={Command:"OpenTradingOrder",data:{accountId:this.getDefaultAccount.id,orderType:t,volume:this.byOrSellVolume,contractName:this.activeSymbol,comment:"",takeProfit:+this.Spot.takeProfit,stopLoss:+this.Spot.stopLoss,trailingSl:this.Spot.trailingStopLoss?this.Spot.toLevel:null,trailingStart:this.Spot.trailingStopLoss?this.Spot.moveSl:null},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.$emit("close"),this.$emit("closeModal")}}},NC=WC,EC=(i("91cc"),i("9faa"),Object(C["a"])(NC,lm,um,!1,null,"25105d21",null)),UC=EC.exports,VC={name:"ModalOrder",components:{Modal:Oe,Button:Pa,ButtonIcon:Nt,InputNumber:Xd,Checkbox:Ya,ButtonLabel:Z,MomentOrder:$h,GroupButtons:pe,SettingsOrder:op,PendingOrder:qh,ByBitOrder:Mg,BitGetOrder:cm,CryptoOrder:UC,Textarea:ph,Preloader:ah},data:function(){return{currentTypeOrder:"",volume:.01,price:1.09547,tp:0,sl:0,checkTP:"",checkSL:"",disabledTP:!0,disabledSL:!0,activeBtn:"sell",tabs:[{index:0,label:"Market"},{index:1,label:"Limit"},{index:2,label:"Stop"}],activeTab:"Market",btcusd:{},quotes:{sell:0,buy:0},precisionActiveContract:null,text:""}},props:{isOpen:Boolean,data:{type:Object|String}},watch:{checkTP:function(t){this.disabledTP=!0!==t},checkSL:function(t){this.disabledSL=!0!==t}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getProfileAccounts:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession",getContracts:"contracts/getContracts",getCatalogs:"quotesCatalogs/getCatalogs"})),{},{activeSymbol:function(){return this.data.symbol},getOrder:function(){var t=this.data.payload?this.data.payload:null;return t},getActiveAccount:function(){var t=this,e=this.getProfileAccounts.find((function(e){return e.id===t.getDefaultAccount.id}));return e},isActiveBtnSell:function(){return"sell"===this.activeBtn?"button-sellbuy--active":""},getStepForInput:function(){return 1/Math.pow(10,this.precisionActiveContract)},getActiveContractSettings:function(){var t=this,e={groupName:"",b:0,a:0};if(this.$store.getters["quotesCatalogs/getCatalogsByType"]("all").length)return this.$store.getters["quotesCatalogs/getCatalogsByType"]("all").forEach((function(i){i.s===t.activeSymbol&&(e=i)})),e},isActiveBtnBuy:function(){return"buy"===this.activeBtn?"button-sellbuy--active":""},getCheckTpSl:function(){return!0===this.checkTP?this.tp:this.sl},getNewOrderBtnText:function(){return"sell"===this.activeBtn?"".concat(this.activeBtn," ").concat(this.volume," / ").concat(this.quotes.sell):"".concat(this.activeBtn," ").concat(this.volume," / ").concat(this.quotes.buy)},getNewOrderBtnBg:function(){return"sell"===this.activeBtn?"button-primary--red":""},getTitle:function(){return this.getOrder?"Settings order":"MomentOrder"===this.currentTypeOrder?"New order ".concat(this.data.symbol):"PendingOrder"===this.currentTypeOrder?"New pending order":void 0},getSpread:function(){var t=this.quotes.sell-this.quotes.buy;return t.toFixed(0)},findContract:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.data.symbol}))},isCrypto:function(){var t=this;return this.getCatalogs["Crypto"].find((function(e){return e.s===t.data.symbol}))},componentName:function(){return this.isCrypto&&"MomentOrder"===this.currentTypeOrder?"CryptoOrder":this.getOrder?"SettingsOrder":this.currentTypeOrder}}),methods:{toggle:function(t){this.activeBtn=t},setMessageHandler:function(t){t&&t.command&&"Quotes"===t.command&&this.updateQuote(t.data)},updateQuote:function(t){var e=this;t.length&&t.forEach((function(t){"BTCUSD"===t.s&&(e.btcusd=t),t.s===e.activeSymbol&&(e.quotes={sell:t.a,buy:t.b,spred:((t.a-t.b)*Math.pow(10,e.precisionActiveContract)).toFixed()})}))},setActiveContract:function(t){var e=this;t.forEach((function(t){t.instrumentName===e.activeSymbol&&(e.precisionActiveContract=t.precision)}))},changeTab:function(t){this.activeTab=t},sentOrder:function(){if(this.getSession){var t={Command:"OpenTradingOrder",data:{accountId:this.getActiveAccount.id,orderType:"sell"===this.activeBtn?"Sell":"Buy",volume:this.getActiveAccount.brokerId?this.volume:1e5*this.volume,contractName:this.getActiveAccount.brokerId?this.activeSymbol+".a":this.activeSymbol,comment:this.text},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:t}),this.$emit("close")}else this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},orderStart:function(){this.$emit("newOrder")},close:function(){this.$store.dispatch("modal/switchNewOrderModal","")},onInput:function(t){this.text=t}},mounted:function(){var t=this;this.currentTypeOrder=this.data.type,this.$http.get(this.$store.getters["api/api"]+"Contracts?includeMarketData=false&instrumentName="+this.activeSymbol).then((function(e){t.setActiveContract(e.data),t.getActiveContractSettings&&(t.quotes={sell:t.getActiveContractSettings.a,buy:t.getActiveContractSettings.b})})),this.$socketStream.$on("apiWS2",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS2",this.setMessageHandler)}},HC=VC,GC=(i("27df"),Object(C["a"])(HC,Ed,Ud,!1,null,null,null)),qC=GC.exports,zC=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeNotificationModal"},[e("DxPopup",{ref:"popup",staticClass:"ordersPanel_wrap",attrs:{visible:t.getTradeNotification,container:"TradeNotificationModal",height:"380px",width:"420px",dragEnabled:!0,dragOutsideBoundary:!0,position:{my:"left bottom",at:"left bottom",of:".TradingChart-chart",offset:{x:36,y:-42}},shading:!1,"content-template":"content","title-template":"title"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"head"},[e("svgIcon",{attrs:{name:"Drag"}}),t._v("Уведомление торгового сервера")],1)]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"contentWrap"},[t.getLastOrdersNotification&&t.getLastOrdersNotification.length?e("div",{key:t.getLengthNotifications,staticClass:"content content",on:{wheel:function(t){t.stopPropagation()}}},t._l(t.getLastOrdersNotification,(function(t){return e("div",{staticClass:"contentItem"},[e(t.typeNoti,{tag:"component",attrs:{order:t}})],1)})),0):e("div",{staticClass:"noData"},[e("img",{attrs:{src:t.babyCryImg,alt:""}}),e("div",{staticClass:"text"},[t._v("У вас пока нет ордеров!")])]),e("div",{staticClass:"control"},[e("ButtonIconFlat",{ref:"button",staticClass:"buttonCustom",attrs:{icon:t.iconMenu},on:{toggle:t.openMenu}}),e("span",{staticClass:"descriptions"},[t._v("Мы храним ордера за текущие сутки")]),e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconClose},on:{toggle:t.closeModal}},[t._v("Закрыть")])],1),e("DxPopup",{attrs:{width:"auto",height:"auto",visible:t.isOpenMenu,closeOnOutsideClick:!0,position:t.positions,shading:!1,showTitle:!1},on:{hidden:t.hiddenHandler}},[e("SettingsList")],1)],1)]},proxy:!0}])})],1)},YC=[],XC=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(new Date(t.order.openDate).toLocaleString("ru")," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v(t._s(t.order.pendingOrderId&&!t.order.subscriptionId?"Открытие сделки по лимиту":"Открытие сделки"))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),t.order.subscriptionId?e("div",{staticClass:"TradeOpenOrderNotification-provider"},[e("div",{staticClass:"TradeOpenOrderNotification-provider-text"},[t._v("Сделка от провайдера")]),e("div",{staticClass:"TradeOpenOrderNotification-provider-avatar"},[e("Avatar",{attrs:{src:t.order.sourceUserAvatar,size:"2.3"}})],1),e("div",{staticClass:"TradeOpenOrderNotification-provider-name"},[t._v(t._s(t.order.sourceUserName))])]):t._e(),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Ордер №")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" "+t._s(t.order.sequenceId))])]),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.order.volume)+" "+t._s(t.priceCrypto))])])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("TP")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.stopLoss))])]),t._m(2)]),t.order.trailingStart?e("div",{staticClass:"TradeOpenOrderNotification-tsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing Start")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingStart))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingSL))])]),t._m(3)]):t._e(),e("div",{staticClass:"TradeOpenOrderNotification-icon"},[e("img",{attrs:{src:"Sell"===t.order.orderType?t.getBearIcon:t.getBullIcon,width:"70px",height:"70px"}})])])},QC=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],JC={name:"TradeOpenOrderNotification",components:{Avatar:E},props:{order:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCatalogs:"quotesCatalogs/getCatalogs"})),{},{getBullIcon:function(){return i("cd4e")},getBearIcon:function(){return i("6381a")},quotes:function(){var t,e=this;return null!==(t=this.getCatalogs)&&void 0!==t&&t["Crypto"]?this.getCatalogs["Crypto"].find((function(t){return t.s===e.order.contractName})):null},isCrypto:function(){return!!this.quotes},priceCrypto:function(){if(this.isCrypto){var t=this.order.volume*this.order.openPrice;return t<.01&&(t=.01),"(".concat(Lm(Fm(t,2))," USDT)")}return""}})},KC=JC,ZC=(i("c1b5"),Object(C["a"])(KC,XC,QC,!1,null,"3d3c1b44",null)),tb=ZC.exports,eb=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(new Date(t.order.closedDate).toLocaleString("ru")," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v("Закрытие лимитного ордера")]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Активная защита")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" "+t._s(t.order.trailingStart?"вкл":"выкл"))])]),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.pendingPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.order.volume))])])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("TP")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.stopLoss))])]),t._m(2)]),t.order.trailingStart?e("div",{staticClass:"TradeOpenOrderNotification-tsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing Start")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingStart))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingSL))])]),t._m(3)]):t._e(),"Conditions"===t.order.pendingCloseReason?e("div",{staticClass:"TradeOpenOrderNotification-Conditions"},[t._v("Истекло время размещения")]):t._e()])},ib=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],ob={name:"TradePendingOrderNotification",props:{order:{type:Object}},computed:{}},nb=ob,sb=(i("fdb1"),Object(C["a"])(nb,eb,ib,!1,null,"96da6e8e",null)),rb=sb.exports,ab=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(new Date(t.order.closedDate).toLocaleString("ru")," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v("Закрытие сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),e("div",{staticClass:"TradeOpenOrderNotification-case"},[t._v(t._s(t.getCaseClosedOrder))]),t.order.subscriptionId?e("div",{staticClass:"TradeOpenOrderNotification-provider"},[e("div",{staticClass:"TradeOpenOrderNotification-provider-text"},[t._v("Сделка от провайдера")]),e("div",{staticClass:"TradeOpenOrderNotification-provider-avatar"},[e("Avatar",{attrs:{src:t.order.sourceUserAvatar,size:"2.3"}})],1),e("div",{staticClass:"TradeOpenOrderNotification-provider-name"},[t._v(t._s(t.order.sourceUserName))])]):t._e(),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Ордер №")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" "+t._s(t.order.sequenceId))])]),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Был открыт")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(new Date(t.order.openDate).toLocaleString("ru")))])]),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Был закрыт")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(new Date(t.order.closedDate).toLocaleString("ru")))])]),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-price",staticStyle:{"margin-right":"2rem"}},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-price",staticStyle:{"padding-left":"0.6rem"}},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена выхода")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.closePrice))])])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.$moneyf(t.order.volume)))])]),e("div",{staticClass:"TradeOpenOrderNotification-profit"},[e("div",{staticClass:"TradeOpenOrderNotification-profit-text"},[t._v("Финансовый результат сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-profit-data",style:{color:t.order.profit<0?"#e91212":"#008e72"}},[t._v(t._s("$ ".concat(t.$moneyf(t.order.profit)," (").concat(t.getVolumeValue," %) (").concat(t.getPipsProfit," pips)")))])])])},cb=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],lb={name:"TradeClosedOrderNotification",components:{Avatar:E},props:{order:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts"})),{},{getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.order.contractName})).precision;return e},getCaseClosedOrder:function(){switch(this.order.reason){case"Position_TP":return"Ордер закрыт по TP";case"Position_SL":return"Ордер закрыт по SP";default:return"Ордер закрыт по рынку"}},getContractBySymbol:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.order.contractName}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getVolumeValue:function(){return this.getCryptoStatus?this.getSumONCryptoVolume:this.getPrcentOnVolume},getSumONCryptoVolume:function(){var t=this.order.volume*this.order.openPrice,e=100*this.order.profit/t;return this.$moneyf(e,Math.abs(e)<.001?3:2)},getPrcentOnVolume:function(){if(!this.order.profit)return 0;var t=100*this.order.profit/this.order.volume;return this.$moneyf(t,Math.abs(t)<.001?3:2)},getPipsProfit:function(){var t="Sell"===this.order.orderType?this.order.openPrice-this.order.closePrice:this.order.closePrice-this.order.openPrice;return Math.trunc(t*Ph(this.getPrecision))}})},ub=lb,db=(i("9b7b"),Object(C["a"])(ub,ab,cb,!1,null,"a043dc34",null)),hb=db.exports,pb=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(new Date(t.order.createdDate).toLocaleString("ru")," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v("Лимитный ордер размещен")]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Активная защита")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" "+t._s(t.order.trailingStart?"вкл":"выкл"))])]),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.pendingPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.order.volume))])])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("TP")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.stopLoss))])]),t._m(2)]),t.order.trailingStart?e("div",{staticClass:"TradeOpenOrderNotification-tsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing Start")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingStart))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingSL))])]),t._m(3)]):t._e()])},gb=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],fb={name:"TradePendingOrderNotification",props:{order:{type:Object}},computed:{}},mb=fb,vb=(i("a30ed"),Object(C["a"])(mb,pb,gb,!1,null,"4d0645ee",null)),yb=vb.exports,Cb=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(new Date(t.order.createdDate).toLocaleString("ru")," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v("Редактирование лимитного ордера")]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(2),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.pendingPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.order.volume))])])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("TP")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.stopLoss))])]),t._m(3)]),t.order.trailingStart?e("div",{staticClass:"TradeOpenOrderNotification-tsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing Start")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingStart))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingSL))])]),t._m(4)]):t._e()])},bb=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Активная защита")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" вкл")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],Sb={name:"TradePendingOrderNotification",props:{order:{type:Object}},computed:{}},Pb=Sb,Tb=(i("2c9e"),Object(C["a"])(Pb,Cb,bb,!1,null,"08615f6f",null)),xb=Tb.exports,Ob=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification"},[e("div",{staticClass:"TradeOpenOrderNotification-title"},[t._m(0),e("div",{staticClass:"TradeOpenOrderNotification-titleDate"},[t._v(" "+t._s("".concat(t.order.modifyDate," UTC")))]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount"},[e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-text"},[t._v("Счет")]),e("div",{staticClass:"TradeOpenOrderNotification-titleAccount-sequence"},[t._v(t._s(t.order.accountSequenceId))])])]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti"},[e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-event"},[t._v("Редактирование ордера")]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-type",style:{color:"Sell"===t.order.orderType?"#e91212":"#008e72"}},[t._v(t._s(t.order.orderType.toUpperCase()))]),e("div",{staticClass:"TradeOpenOrderNotification-nameNoti-contract"},[t._v(t._s(t.order.contractName))])]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber"},[e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-text"},[t._v("Ордер №")]),e("div",{staticClass:"TradeOpenOrderNotification-orderNumber-number"},[t._v(" "+t._s(t.order.sequenceId))])]),e("div",{staticClass:"TradeOpenOrderNotification-priceOrder"},[t._m(1),e("div",{staticClass:"TradeOpenOrderNotification-price"},[e("div",{staticClass:"TradeOpenOrderNotification-price-text"},[t._v("Цена входа")]),e("div",{staticClass:"TradeOpenOrderNotification-price-data"},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"TradeOpenOrderNotification-volume"},[e("div",{staticClass:"TradeOpenOrderNotification-volume-text"},[t._v("Обьем сделки")]),e("div",{staticClass:"TradeOpenOrderNotification-volume-data"},[t._v(t._s(t.order.volume))])])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("TP")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.stopLoss))])]),t._m(2)]),t.order.trailingStart?e("div",{staticClass:"TradeOpenOrderNotification-tsl"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing Start")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingStart))])]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item"},[e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-text"},[t._v("Trailing SL")]),e("div",{staticClass:"TradeOpenOrderNotification-tpAndsl-item-data"},[t._v(t._s(t.order.trailingSL))])]),t._m(3)]):t._e()])},wb=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradeOpenOrderNotification-titleDevider"},[e("hr")])}],_b={name:"TradeModifynOrderNotification",components:{},props:{order:{type:Object}},computed:Object(c["a"])({},Object(p["c"])({getServerTime:"serverTime/getServerTime"}))},Ab=_b,Db=(i("6bb9"),Object(C["a"])(Ab,Ob,wb,!1,null,"8c3f9e98",null)),kb=Db.exports,Ib=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SettingsList"},[e("div",{staticClass:"item titleItem"},[t._v("Показывать это уведомление:")]),t._l(t.radioButtonGroup,(function(i){return e("div",{key:i.value,staticClass:"item"},[e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.eventRadio,expression:"eventRadio"}],attrs:{type:"radio"},domProps:{value:i.value,checked:t._q(t.eventRadio,i.value)},on:{change:function(e){t.eventRadio=i.value}}}),e("span",{staticClass:"title"},[t._v(t._s(i.title))])])])})),e("div",{staticClass:"item titleItem"},[t._v("Показывать ордера и отчеты:")]),t._l(t.checkboxGroup,(function(i){return e("div",{key:i.value,staticClass:"item"},[e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.check,expression:"check"}],attrs:{type:"checkbox",disabled:i.disabled},domProps:{value:i.value,checked:Array.isArray(t.check)?t._i(t.check,i.value)>-1:t.check},on:{change:function(e){var o=t.check,n=e.target,s=!!n.checked;if(Array.isArray(o)){var r=i.value,a=t._i(o,r);n.checked?a<0&&(t.check=o.concat([r])):a>-1&&(t.check=o.slice(0,a).concat(o.slice(a+1)))}else t.check=s}}}),e("span",{staticClass:"title"},[t._v(t._s(i.title))])])])}))],2)},Bb=[],Mb=(i("4fad"),{name:"SettingsList",mixins:[],props:{},components:{},data:function(){return{mounted:!1,dataSetting:[],eventRadio:"event",check:["open","closed","editable","limit"]}},watch:{check:function(t){this.mounted&&this.saveSettingsReport(t)},eventRadio:function(t){this.redactSettings({data:t,mutation:"setSelectedViewNotification"})},"getDefaultAccount.id":{handler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.mounted=!1,t.check=["open","closed","editable","limit"],e.next=4,t.getSettingsReport();case 4:t.mounted=!0;case 5:case"end":return e.stop()}}),e)})))()},deep:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSelectedViewNotification:"periodReportsSettings/getSelectedViewNotification",getSession:"auth/getSession",getApiUri:"api/api",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{radioButtonGroup:function(){return[{value:"event",title:"По событию"},{value:"click",title:"По клику на иконку уведомлений"}]},checkboxGroup:function(){return[{value:"open",title:"Отображать открытые ордера",disabled:!0},{value:"closed",title:"Отображать закрытые ордера",disabled:!0},{value:"editable",title:"Отображать редактируемые ордера",disabled:!0},{value:"limit",title:"Отображать лимитные ордера",disabled:!0},{value:"dailySend",title:"Отображать дневные отчеты"},{value:"weeklySend",title:"Отображать недельные отчеты"},{value:"monthlySend",title:"Отображать месячные отчеты"}]}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"periodReportsSettings/redactSettings"})),{},{getSettingsReport:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$workKeys.signMessage(JSON.stringify({userId:t.getUser.id,accountId:t.getDefaultAccount.id}),t.getSession.sk);case 2:return i=e.sent,e.next=5,t.$http.post("".concat(t.getApiUri,"ReportNotification/GetSettings"),{userId:t.getUser.id,accountId:t.getDefaultAccount.id},{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":i}});case 5:o=e.sent,n=o.data,t.dataSetting=n.data,t.dataSetting[0]&&(a=t.dataSetting[0].settings,c=Object.entries(a).filter((function(t){return t[1]})),(s=t.check).push.apply(s,Object(x["a"])(c.map((function(t){return t[0]})))));case 9:case"end":return e.stop()}}),e)})))()},saveSettingsReport:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=JSON.stringify({id:null===(o=e.dataSetting[0])||void 0===o?void 0:o.id,userId:e.getUser.id,accountId:e.getDefaultAccount.id,settings:{dailySend:t.includes("dailySend"),weeklySend:t.includes("weeklySend"),monthlySend:t.includes("monthlySend")},sendSettings:null}),i.next=3,e.$workKeys.signMessage(n,e.getSession.sk);case 3:s=i.sent;try{e.$http.post("".concat(e.getApiUri,"ReportNotification/SaveSettings"),n,{headers:{"X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":s}})}catch(r){window.alert("Error save reports")}case 5:case"end":return i.stop()}}),i)})))()}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.getSelectedViewNotification&&(t.eventRadio=t.getSelectedViewNotification),e.next=3,t.getSettingsReport();case 3:t.mounted=!0;case 4:case"end":return e.stop()}}),e)})))()},destroyed:function(){}}),$b=Mb,Lb=(i("aa76"),Object(C["a"])($b,Ib,Bb,!1,null,"647552a7",null)),Fb=Lb.exports,jb={components:{DxPopup:wt["DxPopup"],SettingsList:Fb,openedOrder:tb,modifyPendingOrder:xb,closedOrder:hb,pendingOrder:yb,modifyOrder:kb,pendingClose:rb},data:function(){return{target:null,isOpenMenu:!1,lastOrders:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradeNotification:"modal/getTradeNotification",getNotifications:"notifications/getNotifications",getLastOrdersNotification:"tradeNotification/getLastOrdersNotification"})),{},{getLengthNotifications:function(){return this.getLastOrdersNotification?this.getLastOrdersNotification.length:0},iconClose:function(){return{name:"Close",color:"#8c8c8c"}},iconMenu:function(){return{name:"Menu",color:"#8c8c8c"}},positions:function(){return{my:"left bottom",at:"left top",of:this.target,offset:{x:0,y:-4}}},babyCryImg:function(){return i("9701")}}),methods:{closeModal:function(){this.$store.commit("modal/setTradeNotification",!1)},openMenu:function(){this.target=this.$refs.button.$el,this.isOpenMenu=!0},hiddenHandler:function(){this.isOpenMenu=!1}}},Rb=jb,Wb=(i("18c5"),Object(C["a"])(Rb,zC,YC,!1,null,"f2bc9c6c",null)),Nb=Wb.exports,Eb=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.open,title:t.$t("briefIntro"),width:"900",modifier:"modal--meet"},on:{close:t.onClick},scopedSlots:t._u([{key:"modal-body",fn:function(){},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary",modifier:"big"},on:{click:t.onClick}},[t._v(t._s(t.$t("contWork")))]),e("Button",{attrs:{typeBtn:"primary",modifier:"big"},on:{click:t.onClick}},[t._v(t._s(t.$t("goToPerAcc")))])],1)]},proxy:!0}])})},Ub=[],Vb={components:{Modal:Oe,Button:Pa,svgIcon:L},data:function(){return{slide1:[{text:"Настроить свой профиль через личный кабинет",link:"/personal-area"},{text:"Найти себя в списке стратегий",link:"/strategies"},{text:"Стать экспертом",link:"/"},{text:"Ивестируйте в лучших из лучших",link:"/"},{text:"Узнать как устроен проект",link:"/"}]}},props:["open"],computed:{},methods:{onClick:function(){this.$store.dispatch("modal/switchMeetingModal"),this.$store.dispatch("modal/switchSubscriptionModal")}}},Hb=Vb,Gb=(i("d72b"),Object(C["a"])(Hb,Eb,Ub,!1,null,null,null)),qb=Gb.exports,zb=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.open,title:t.$t("subscriptionWord"),width:"520",modifier:"modal--subscription"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"modal__info"},[e("System-message",{attrs:{icon:"Timer",status:"3",message:t.getSystemMessage}})],1),e("h3",{staticClass:"head"},[t._v(t._s(t.$t("respectedWord"))+", "+t._s(t.getUserDetail.firstName)+" "+t._s(t.getUserDetail.lastName)+" ! "),e("br"),t._v(" "+t._s(t.$t("yhgtfa"))+".")]),e("div",{staticClass:"divider"}),e("h4",{staticClass:"form-group-label"},[t._v(t._s(t.$t("stp")))]),e("div",{staticClass:"form-message"},[t._v(t._s(t.$t("ppaf"))+":")]),e("div",{staticClass:"subscription-price"},[e("div",{staticClass:"subscription-price__col"},[e("div",{staticClass:"subscription-price__head"},[t._v(t._s(t.$t("traderWord")))]),e("ul",{staticClass:"subscription-price__list"},[e("li",[e("strong",[t._v("$ 200")]),t._v(" "+t._s(t.$t("inYear"))+";")]),e("li",[e("strong",[t._v("$ 120")]),t._v(" "+t._s(t.$t("forHalfY"))+";")]),e("li",[e("strong",[t._v("$ 20")]),t._v(" "+t._s(t.$t("perMon"))+".")])])]),e("div",{staticClass:"subscription-price__col"},[e("div",{staticClass:"subscription-price__head"},[t._v(t._s(t.$t("investorWord")))]),e("ul",{staticClass:"subscription-price__list"},[e("li",[e("strong",[t._v("$ 200")]),t._v(" "+t._s(t.$t("inYear"))+";")]),e("li",[e("strong",[t._v("$ 120")]),t._v(" "+t._s(t.$t("forHalfY"))+";")]),e("li",[e("strong",[t._v("$ 20")]),t._v(" "+t._s(t.$t("perMon"))+".")])])])]),e("div",{staticClass:"divider"}),e("h4",{staticClass:"form-group-label"},[t._v(t._s(t.$t("comFrTrAcc")))]),e("div",{staticClass:"form-message"},[t._v(t._s(t.$t("comissForAcc"))+" "),e("strong",[t._v("$ 15")]),t._v(" "+t._s(t.$t("fromTurn"))+" "),e("strong",[t._v("$ 1000,000,000")])]),e("div",{staticClass:"divider"}),e("h4",{staticClass:"form-group-label"},[t._v(t._s(t.$t("comissTr")))]),e("div",{staticClass:"form-message"},[t._v(t._s(t.$t("comissFor"))+".")])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary",modifier:"big"},on:{click:t.close}},[t._v(t._s(t.$t("okay")))]),e("Button",{attrs:{typeBtn:"primary",modifier:"big"},on:{click:t.buy}},[t._v(t._s(t.$t("buySub")))])],1)]},proxy:!0}])})},Yb=[],Xb=function(){var t=this,e=t._self._c;return e("div",{staticClass:"system-message",class:t.getStatus},[e("div",{staticClass:"system-message__message"},[e("div",{staticClass:"system-message__title"},[t._v(t._s(t.message))]),t.descriptor?e("div",{staticClass:"system-message__text"},[t._v(t._s(t.descriptor))]):t._e()]),t.icon?e("div",{staticClass:"system-message__icon"},[e("svgIcon",{attrs:{name:t.icon}})],1):t._e()])},Qb=[],Jb={components:{svgIcon:L},props:{message:{type:String},descriptor:{type:String},status:{type:String,default:"1"},icon:{type:String,default:"Check"}},computed:{getStatus:function(){return"1"===this.status?"system-message--success":"2"===this.status?"system-message--error":"3"===this.status?"system-message--warning":"system-message--success"}}},Kb=Jb,Zb=(i("5783"),Object(C["a"])(Kb,Xb,Qb,!1,null,null,null)),tS=Zb.exports,eS={components:{Modal:Oe,Button:Pa,svgIcon:L,SystemMessage:tS},data:function(){return{expDays:14,user:null}},props:{open:{type:Boolean},accountId:{default:1}},computed:Object(c["a"])({getSystemMessage:function(){return"".concat(this.expDays," дней до окончания бесплатного периода")}},Object(p["c"])({getApiUrl:"api/api",getUserDetail:"user/getUserDetail"})),methods:{close:function(){this.$store.dispatch("modal/switchSubscriptionModal")},buy:function(){this.close(),this.$router.push("personal-area")}}},iS=eS,oS=(i("fb34"),Object(C["a"])(iS,zb,Yb,!1,null,null,null)),nS=oS.exports,sS=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamModalSettings"},[e("DxPopup",{attrs:{visible:!0,shading:!1,position:{my:"right top",at:"top right",of:"window",offset:{x:-40,y:0}},height:"48px",width:"auto","content-template":"contentModal",showTitle:!1},scopedSlots:t._u([{key:"contentModal",fn:function(){return[e("div",{class:"streamModalSettings-content streamModalSettings-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamModalSettings-close",on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close",size:32}})],1),e("div",{class:"streamModalSettings-streamStatus ".concat(t.getStatusStream)},[e("svgIcon",{attrs:{name:"Stream",size:32}})],1),e("div",{staticClass:"streamModalSettings-lastMessage"},[t.lastMsgStatus?e("VuePerfectScrollbar",{class:"streamModalSettings-lastMessage-message streamModalSettings-lastMessage-message_".concat(t.getActiveTheme),attrs:{contenteditable:"false"},on:{click:t.switchLastMsgMode}},[t.lastMessage?e("div",{staticClass:"streamModalSettings-lastMessage-wrap"},[e("div",{staticClass:"streamModalSettings-lastMessage-autor"},[e("div",{staticClass:"streamModalSettings-lastMessage-avatar"},[e("Avatar",{attrs:{src:t.lastMessage.AvatarURL,size:"1.4"}})],1),e("div",{class:"streamModalSettings-lastMessage-name_".concat(t.getActiveTheme)},[t._v(t._s(t.lastMessage.SenderFIO))])]),e("div",{class:"streamModalSettings-lastMessage-text streamModalSettings-lastMessage-text_".concat(t.getActiveTheme)},[t._v(t._s(t.lastMessage.Message))])]):t._e()]):e("VuePerfectScrollbar",{ref:"txtMsg",class:"streamModalSettings-lastMessage-edit streamModalSettings-lastMessage-edit_".concat(t.getActiveTheme),attrs:{contenteditable:!t.lastMsgStatus,placeholder:"Write a comment..."},on:{input:t.inputMsg,keydown:t.enterKey}})],1),e("div",{class:"streamModalSettings-chat ".concat(t.getChatStreamModal?"streamModalSettings-chat_".concat(t.getActiveTheme,"-isActive"):""),on:{click:t.openChat}},[e("svgIcon",{attrs:{name:"Chat",size:32}})],1),e("div",{staticClass:"streamModalSettings-viewers"},[e("div",{class:"streamModalSettings-viewers-count streamModalSettings-viewers-count_".concat(t.getActiveTheme)},[t._v(t._s(t.viewers))]),e("div",{staticClass:"streamModalSettings-viewers-icon"},[e("svgIcon",{attrs:{name:"MarketIndicator",size:32}})],1)]),e("div",{class:"streamModalSettings-selfie streamModalSettings-selfie_".concat(t.getActiveTheme," streamModalSettings-selfie_").concat(t.getActiveTheme,"-").concat(t.getSelfieModal?"isActive":""),on:{click:t.openSelfieModal}},[e("Avatar",{attrs:{src:t.getUserDetail.avatarURL}})],1)])]},proxy:!0}])})],1)},rS=[],aS=null,cS={components:{DxPopup:xo.a,svgIcon:L,Avatar:E,VuePerfectScrollbar:Xt.a},data:function(){return{lastMessage:"",lastMsgStatus:!0,textMessage:"",viewers:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({apiStreamWS:"api/apiStreamWS",getUserDetail:"user/getUserDetail",getUserStream:"userStreams/getUserStream",getChatStreamModal:"modal/getChatStreamModal",getSelfieModal:"modal/getSelfieModal",getApiStreamUrl:"api/apiStream",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatusStream:function(){return this.getUserStream?"Start"===this.getUserStream.status?"streamModalSettings-streamStatus-start_".concat(this.getActiveTheme):"streamModalSettings-streamStatus-stop_".concat(this.getActiveTheme):""}}),watch:{getStatusStream:function(t){"streamModalSettings-streamStatus-start"===t&&this.connectToChat()}},methods:{switchLastMsgMode:function(){this.lastMsgStatus=!this.lastMsgStatus},enterKey:function(t){"Enter"===t.key&&(t.preventDefault(),this.sendMessage())},inputMsg:function(t){this.textMessage=t.target.outerText},sendMessage:function(){this.textMessage&&(this.$socketStream.sendCommand({ws:"streamWs",command:{Command:"ChatMessage",StreamId:this.getUserStream.streamId,Data:{SenderFIO:"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName),Message:this.textMessage,StreamId:this.getUserStream.streamId,AvatarURL:this.getUserDetail.avatarURL,UserId:this.getUserDetail.login,IsStreamer:!0}}}),this.textMessage="",this.lastMsgStatus=!0,this.$refs.txtMsg.$el.innerHTML="")},closeModal:function(){this.$store.dispatch("modal/switchStreamSettingsModal",{status:!1,data:""})},getStatForStream:function(){var t=this;this.$http.get("".concat(this.getApiStreamUrl,"GetStream/fromsrc/").concat(this.getUserStream.streamId,"/metrics")).then((function(e){e.data.live_stream.unique_views.value&&(t.viewers=e.data.live_stream.unique_views.value)}))},connectToChat:function(){this.$socketStream.addConnection({id:"streamWs",url:this.apiStreamWS}),this.$socketStream.sendCommand({ws:"streamWs",command:{command:"Join",StreamId:this.getUserStream.streamId}}),this.$socketStream.$on("streamWs",this.setMessageHendler)},setMessageHendler:function(t){"ChatMessage"===t.Command&&(this.lastMessage=t.Data)},openSelfieModal:function(){this.$store.dispatch("modal/switchSelfieModal")},openChat:function(){this.$store.dispatch("modal/switchChatStreamModal")}},mounted:function(){var t=this;this.$socketStream.getActiveConnection().find((function(t){return"streamWs"===t}))||"Start"!==this.getUserStream.status?this.$socketStream.$on("streamWs",this.setMessageHendler):this.connectToChat(),aS=setInterval((function(){t.getStatForStream()}),1e4)},destroyed:function(){clearInterval(aS),this.getChatStreamModal&&this.openChat(),this.getSelfieModal&&this.openSelfieModal()}},lS=cS,uS=(i("a0c9"),Object(C["a"])(lS,sS,rS,!1,null,null,null)),dS=uS.exports,hS=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.open,title:t.$t("subsPay"),width:"380",modifier:"modal--subs-paid"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("System-message",{attrs:{message:t.$t("subsPaid"),status:"1",icon:"Check"}}),e("div",{staticClass:"form-message"},[e("strong",[t._v("Павлов Сергей Алексеевич")]),t._v(", "),e("br"),t._v(" "+t._s(t.$t("subsPaidTar"))+" «$ 200 "+t._s(t.$t("inYear"))+"» "),e("br"),t._v(" "+t._s(t.$t("aa"))+" 12.03.2020.")])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"primary",modifier:"big"},on:{click:t.close}},[t._v(t._s(t.$t("contWork")))]),t._v(".")],1)]},proxy:!0}])})},pS=[],gS={components:{Modal:Oe,Button:Pa,svgIcon:L,SystemMessage:tS},data:function(){return{}},props:["open"],computed:{},methods:{close:function(){this.$store.dispatch("modal/switchSubscriptionBuyModal")}}},fS=gS,mS=(i("c00f"),Object(C["a"])(fS,hS,pS,!1,null,null,null)),vS=mS.exports,yS=function(){var t=this,e=t._self._c;return e("DxPopup",{attrs:{visible:t.visibleStatus,elementAttr:t.popupChat,"close-on-outside-click":!1,"show-close-button":!1,"title-template":"videoWrap",shading:!1,minHeight:"544px",minWidth:"640px",height:"544px",width:"640px",showTitle:!0,dragEnabled:!0,resizeEnabled:!0},scopedSlots:t._u([{key:"videoWrap",fn:function(i){i.data;return[e("div",{staticClass:"chat__videoCall"},[e("div",[e("audio",{ref:"audioPlayer",attrs:{autoplay:"1"}})]),t.userJoin?e("div",{staticClass:"chat__videoCall-wrapVideo",style:t.participantArr.length>1?{height:"55%",maxHeight:"55%",minHeight:"55%"}:{height:"calc(100% - 6.4rem);"}},t._l(t.videoTracks,(function(i,o){return e("div",{key:o,class:"chat__videoCall-videoItem ".concat(t.participantArr.length>1?"chat__videoCall-videoItem_multi":"")},[e("div",{directives:[{name:"show",rawName:"v-show",value:!i.isMuted(),expression:"!track.isMuted()"}],staticClass:"chat__videoCall-video",class:t.getMinimazeTrackStatus(i)?"chat__videoCall-video-local":"",style:{padding:t.participantArr.length>1?"0.6rem":"0"},on:{click:function(e){return t.replacePlayers(i)}}},[e("video",{ref:"videoPlayer"+o,refInFor:!0,attrs:{autoplay:"",playsinline:"",height:"100%"}}),t.getParticipantAvatarAndName(i)?e("div",{staticClass:"chat__videoCall-nameMember"},[e("div",{staticClass:"chat__videoCall-name",attrs:{title:t.getParticipantAvatarAndName(i).name}},[t._v(t._s(t.getParticipantAvatarAndName(i).name))])]):t._e()]),i.isMuted()?e("div",{staticClass:"chat__videoCall-muteVideo"},[e("div",{staticClass:"chat__videoCall-avatar",class:t.getMinimazeTrackStatus(i)?"chat__videoCall-avatar-local":"",on:{click:function(e){return t.replacePlayers(i)}}},[t.getParticipantAvatarAndName(i)?e("div",{staticClass:"chat__videoCall-avatar_blur",class:t.getMinimazeTrackStatus(i)?"chat__videoCall-avatar_blur-local":""}):t._e(),t.showAvatar?e("Avatar",{attrs:{size:t.getSizeAvatar(i),src:t.getParticipantAvatarAndName(i).avatar}}):t._e()],1)]):t._e()])})),0):e("div",{staticClass:"chat__videoCall-wrap"},t._l(t.participantArr,(function(i,o){return e("div",{key:o,staticClass:"chat__videoCall-member"},[t.warningMsg?e("div",{staticClass:"chat__videoCall-warningMsg"},[e("div",{staticClass:"chat__videoCall-errorMsg-errorMsg"},[t._v("Абонент не отвечает."),e("br"),t._v("Либо он не online"),e("br"),t._v("Попробуйте перезвонить позже.")])]):e("div",{staticClass:"chat__videoCall-avatar"},[e("div",{staticClass:"chat__videoCall-avatar_blur"}),e("Avatar",{attrs:{size:"19",src:i.avatar}}),e("div",{staticClass:"chat__videoCall-name",staticStyle:{"margin-left":"0"},attrs:{title:i.username}}),t._v(t._s(i.username))],1)])})),0),t.localVideoTrack?e("div",{class:t.participantArr.length>1?"chat__videoCall-localVideo chat__videoCall-localVideo-multi":"chat__videoCall-localVideo"},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.localVideoTrack.isMuted(),expression:"!localVideoTrack.isMuted()"}],staticClass:"chat__videoCall-video-local",on:{click:function(e){return t.replacePlayers(t.track)}}},[e("video",{ref:"localVideoTrack",attrs:{autoplay:"",playsinline:"",width:"100%"}})]),t.localVideoTrack.isMuted()?e("div",{staticClass:"chat__videoCall-muteVideo"},[e("div",{staticClass:"chat__videoCall-avatar chat__videoCall-avatar-local",staticStyle:{margin:"0"},on:{click:function(e){return t.replacePlayers(t.track)}}},[e("div",{staticClass:"chat__videoCall-avatar_blur chat__videoCall-avatar_blur-local"}),t.showAvatar?e("Avatar",{attrs:{size:t.getSizeAvatar(t.localVideoTrack),src:t.getUserDetail.avatarURL}}):t._e()],1)]):t._e(),t.participantArr.length>1?e("div",{staticClass:"chat__videoCall-nameMember"},[e("div",{staticClass:"chat__videoCall-name",attrs:{title:"Вы"}},[t._v("Вы")])]):t._e()]):t._e(),e("div",{staticClass:"chat__videoCall-navigation"},[e("div",{staticClass:"chat__videoCall-navigation_acceptCall"},[e("div",{staticClass:"chat__videoCall-navigation_videoCameraButton"},[e("ButtonIconFlat",{attrs:{icon:{name:t.getAcceptCamera,color:t.getColorVideoCamIcon},modifier:{class:["videoCallButton",t.videoDevices&&t.videoDevices.length?"videoCallButton_group":""]},title:"Вкл/выкл камеру"},on:{click:t.setAcceptVideo}}),t.videoDevices&&t.videoDevices.length?e("ButtonIconFlat",{attrs:{icon:{name:"new-dropdown-arrow-up"},modifier:{class:["videoCallOption","videoCallOptionCamera"]},title:"Список видеоустройств"},on:{click:t.openSourceCamera}}):t._e()],1),e("div",{staticClass:"chat__videoCall-navigation_videoCameraButton"},[e("ButtonIconFlat",{attrs:{icon:{name:t.getAcceptAudio,color:t.getColorMicIcon},modifier:{class:["videoCallButton",t.audioDevices&&t.audioDevices.length?"videoCallButton_group":""]},title:"Вкл/выкл микрофон"},on:{click:t.setAcceptAudio}}),t.audioDevices&&t.audioDevices.length?e("ButtonIconFlat",{attrs:{icon:{name:"new-dropdown-arrow-up"},modifier:{class:["videoCallOption","videoCallOptionMic"]},title:"Список аудиоустройств"},on:{click:t.openSourceMic}}):t._e()],1),e("ButtonIconFlat",{attrs:{icon:{name:"ShareMonitor",color:t.getIconSharedColorIcon},modifier:{class:["videoCallButton"]},title:"Показать экран"},on:{click:t.getSharingDecktop}}),e("ButtonIconFlat",{attrs:{icon:{name:"Change"},modifier:{class:["videoCallButton"],style:{marginLeft:"0.8rem"}},process:t.loadEnumerateDevices,title:"Обновить список устройств"},on:{click:t.enumerateDevices}}),t.userJoin&&t.participantArr.length<2&&!t.statusAddMember?e("ButtonIconFlat",{attrs:{icon:{name:"NewUser"},modifier:{class:["videoCallButton","videoCallContacts"],style:{marginLeft:"0.8rem"}},title:"Добавить собеседника"},on:{click:t.showContacts}}):t._e(),t.statusAddMember?e("div",{staticClass:"chat__videoCall-addMember"},[e("div",{staticClass:"chat__videoCall-addMemberMsg"},[t._v(" Вызов...")])]):t._e(),t.userJoin&&t.participantArr.length<2&&!t.statusAddMember?e("ButtonIconFlat",{attrs:{icon:{name:"Copy"},modifier:{class:["videoCallButton","videoCallButtonCopy"],style:{marginLeft:"0.8rem"}},title:"Скопировать ссылку"},on:{click:t.copyPath}}):t._e(),e("DxTooltip",{attrs:{visible:t.tooltipCopy,target:".videoCallButtonCopy",container:".videoCallButtonCopy",position:"top"}},[t._v("Ссылка скопированна")])],1),e("div",{staticClass:"chat__videoCall-navigation_no-acceptCall"},[e("div",{staticClass:"chat__videoCall-navigation_no-acceptCall-text"},[t._v(t._s(t.userJoin?t.getTimerTime:"Вызов..."))]),e("ButtonIconFlat",{attrs:{icon:{name:"Call-no-accept"},modifier:{class:["acceptCallButton"]},title:"Закочить вызов"},on:{click:function(e){return t.endCall("reject")}}},[t._v(t._s(t.$t("toEnd")))])],1)]),t.errorDesctopMsg?e("div",{staticClass:"chat__videoCall-errorMsg"},[e("div",{staticClass:"chat__videoCall-errorMsg-title"},[e("div",{staticClass:"chat__videoCall-errorMsg-closeIcon",on:{click:t.clearErrorMsg}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"chat__videoCall-errorMsg-errorMsg"},[t._v(t._s(t.errorDesctopMsg))])]):t._e()])]}}])},[e("DxPosition",{attrs:{my:"center"}}),e("DxPopup",{attrs:{visible:t.showSearchContact,shading:!1,container:".chat__videoCall",position:{my:"bottom left",at:"top left",of:".videoCallContacts",offset:{y:-3}},maxHeight:"300px",maxWidth:"300px",height:"auto",width:"auto",showTitle:!1}},[e("div",{staticClass:"chat__videoCall-contacts"},[e("DxSelectBox",{directives:[{name:"debounce",rawName:"v-debounce:0.5s",value:t.setSearchUser,expression:"setSearchUser",arg:"0",modifiers:{"5s":!0}}],attrs:{items:t.searchContacts,searchEnabled:!0,"debounce-events":"input",displayExpr:"name",onItemClick:t.addMemberToCall}})],1)]),e("DxPopup",{attrs:{visible:t.videoSettings,shading:!1,container:".chat__videoCall",position:{my:"bottom left",at:"top left",of:".videoCallOptionCamera",offset:{y:-3}},maxHeight:"300px",maxWidth:"300px",height:"auto",width:"auto",showTitle:!1}},[e("div",{staticClass:"chat__videoCall-device"},[t.videoDevices&&t.videoDevices.length?e("div",{staticClass:"chat__videoCall-deviceList"},t._l(t.videoDevices,(function(i,o){var n;return e("div",{key:o,staticClass:"chat__videoCall-deviceListItem",class:(n={},Object(Vt["a"])(n,"chat__videoCall-deviceListItem-noActive",!i[1].status),Object(Vt["a"])(n,"chat__videoCall-deviceListItem-active",t.getStatusActiveDevice("video",i[0])),n),attrs:{title:i[0].label},on:{click:function(e){return t.getNewVideoLocalTrack(i[0])}}},[t._v(t._s(i[0].label))])})),0):e("div",{staticClass:"chat__videoCall-deviceError"},[t._v("Нет доступных видео устройств"),e("br"),t._v("либо запрещён доступ")])])]),e("DxPopup",{attrs:{visible:t.audioSettings,shading:!1,container:".chat__videoCall",position:{my:"bottom left",at:"top left",of:".videoCallOptionMic",offset:{y:-3}},maxHeight:"300px",maxWidth:"300px",height:"auto",width:"auto",showTitle:!1}},[e("div",{staticClass:"chat__videoCall-device"},[t.audioDevices&&t.audioDevices.length?e("div",{staticClass:"chat__videoCall-deviceList"},t._l(t.audioDevices,(function(i,o){var n;return e("div",{key:o,staticClass:"chat__videoCall-deviceListItem",class:(n={},Object(Vt["a"])(n,"chat__videoCall-deviceListItem-noActive",!i[1].status),Object(Vt["a"])(n,"chat__videoCall-deviceListItem-active",t.getStatusActiveDevice("audio",i[0])),n),attrs:{title:i[0].label},on:{click:function(e){return t.getNewAudioLocalTrack(i[0])}}},[t._v(t._s(i[0].label))])})),0):e("div",{staticClass:"chat__videoCall-deviceError"},[t._v("Нет доступных аудио устройств"),e("br"),t._v("либо запрещён доступ")])])])],1)},CS=[],bS=i("1ebc"),SS="https://chat.toptrader.org";bS["a"].init();var PS=bS["a"].isDesktopSharingEnabled();bS["a"].setLogLevel(bS["a"].logLevels.ERROR);var TS={props:{callInfo:{default:null},visibleStatus:{default:!1}},components:{Avatar:E,DxPopup:To["DxPopup"],DxPosition:To["DxPosition"],DxTooltip:Pt["DxTooltip"],DxSelectBox:Bo.a,ButtonLabel:Z,ButtonIcon:Nt},data:function(){return{warningMsg:!1,errorDesctopMsg:"",statusDesktop:PS,acceptCamera:!0,acceptAudio:!0,intervalSignal:null,options:null,callToken:null,connection:null,room:null,isJoined:!1,userJoin:!1,participantIds:new Set,participantArr:[],gudokAudio:new Audio(i("2875")),localVideoTrack:null,localAudioTrack:null,remoteTracks:{},videoTracks:[],minimazeTrack:"local",muteStatus:!0,timerRecord:null,showAvatar:!0,minutes:0,seconds:0,statusAddMember:!1,audioDevices:null,loadEnumerateDevices:!1,videoDevices:null,videoSettings:!1,audioSettings:!1,popupChat:{class:"chat__videoCallPopup"},sharingDesktopStatus:!1,idSerachUsers:null,searchText:"",searchContacts:[],showSearchContact:!1,tooltipCopy:!1}},watch:{getVideoTracksCount:function(){this.addNewPlayers()},sharingDesktopStatus:function(t){t||(this.videoDevices.length?bS["a"].createLocalTracks({devices:["video"]}).then(this.replaceVideoTrackLocal).catch((function(t){throw t})):this.room&&(this.room.removeTrack(this.localVideoTrack),this.localVideoTrack=null))},acceptCamera:function(t){t?(this.localVideoTrack.unmute(),this.addNewPlayers()):this.localVideoTrack.mute()},acceptAudio:function(t){t?this.localAudioTrack.mute:this.localAudioTrack.mute()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getCurrentVideoCall:"chat/getCurrentVideoCall",getCallFromUserInfo:"chat/getCallFromUserInfo",getCallToUserInfo:"chat/getCallToUserInfo",getVideoCallStatus:"modal/getVideoCallStatus",getUserDetail:"user/getUserDetail",getChatAuth:"chat/getChatAuth",getApiChat:"api/apiChat",getApiUrl:"api/api",getSession:"auth/getSession"})),{},{getColorVideoCamIcon:function(){return this.localVideoTrack?this.localVideoTrack&&this.acceptCamera?"#008e72":this.localVideoTrack&&!this.acceptCamera?"#8c8c8c":void 0:"#e91212"},getChooceVideoDevice:function(){var t=this;if(this.localVideoTrack||this.videoDevices.length)return this.videoDevices.find((function(e){return t.localVideoTrack.deviceId===e.deviceId}))},getColorMicIcon:function(){return this.localAudioTrack?this.localAudioTrack&&this.acceptAudio?"#008e72":this.localAudioTrack&&!this.acceptAudio?"#8c8c8c":void 0:"#e91212"},getVideoTracksCount:function(){return this.videoTracks.length},getAcceptCamera:function(){return this.acceptCamera&&this.localVideoTrack?"VideoOn":"VideoOff"},getAcceptAudio:function(){return this.acceptAudio?"MicOn":"MicOff"},getTimerTime:function(){return"".concat(this.minutes<10?"0"+this.minutes:this.minutes,":").concat(this.seconds<10?"0"+this.seconds:this.seconds)},getIconSharedColorIcon:function(){return this.statusDesktop?this.sharingDesktopStatus?"#2462db":this.sharingDesktopStatus?void 0:"#8c8c8c":"#e91212"},getFromUserAvatar:function(){if(this.getCallFromUserInfo)return"".concat(SS,"/avatar/").concat(this.getCallFromUserInfo.username)}}),methods:{setParticipant:function(){var t=this;this.room&&(this.participantArr=[],this.room.getParticipants().forEach((function(e){t.participantArr.push({username:"item._identity.user.name",avatar:"item._identity.user.avatar",role:e._role,tracks:e._tracks,id:e._id})})))},showContacts:function(){this.showSearchContact=!this.showSearchContact},filterUser:function(t){return t.filter((function(t){return"guest"!==t.username&&"admin"!==t.username}))},setMessageHendler:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t&&"result"===t.msg&&t.id===e.idSerachUsers?e.searchContacts=e.filterUser(t.result.users):t&&null!==t&&void 0!==t&&t.data&&"Drop"===t.data.action?"calling"!==e.getCurrentVideoCall.status&&"answer"!==e.getCurrentVideoCall.status||(e.statusAddMember?e.statusAddMember=!1:(e.warningMsg=!0,clearInterval(e.intervalSignal),e.intervalSignal=null,setTimeout((function(){e.endCall("reject")}),3e3))):t&&null!==t&&void 0!==t&&t.data&&"Reject"===t.data.action&&"calling"===e.getCurrentVideoCall.status&&(e.warningMsg=!0,clearInterval(e.intervalSignal),e.intervalSignal=null,setTimeout((function(){e.endCall("rejectCall")}),3e3));case 1:case"end":return i.stop()}}),i)})))()},setSearchUser:function(t){this.searchText=t,this.searchText?this.searchUsers():this.searchContacts=[]},searchUsers:function(){this.idSerachUsers=Math.random().toString(36).substring(7);var t={msg:"method",id:this.idSerachUsers,method:"spotlight",params:[this.searchText,[],{users:!0,rooms:!1}]};this.$socketStream.sendCommand({ws:"chatWS",command:t})},getCallToken:function(){var t=this;this.$http.get("".concat(this.getApiUrl,"GetCallToken?IsModerator=true"),{headers:{"Content-Type":"application/json","X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.singFP}}).then((function(e){t.callToken=e.data.token,t.goConnect()}))},buildOptions:function(){return{connection:{hosts:{domain:"jim.toptrader.ru",muc:"conference.jim.toptrader.ru",focus:"focus.jim.toptrader.ru"},serviceUrl:"wss://jim.toptrader.ru/test/xmpp-websocket-room",clientNode:"https://jim.toptrader.ru",useStunTurn:!0,deploymentInfo:{shard:!0}},conference:{enableLayerSuspension:!1,p2p:{enabled:!1}}}},goConnect:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.options=t.buildOptions({apiKey:"vpaas-magic-cookie-6b7a300233224905bcb6e4b20523193e/79df57",room:"test"}),t.connection=new bS["a"].JitsiConnection(null,null,t.options.connection),t.connection.addEventListener(bS["a"].events.connection.CONNECTION_ESTABLISHED,t.onConnectionSuccess),t.connection.addEventListener(bS["a"].events.connection.CONNECTION_FAILED,t.onConnectionFailed),t.connection.addEventListener(bS["a"].events.connection.CONNECTION_DISCONNECTED,t.disconnect),t.connection.connect(),bS["a"].createLocalTracks({devices:["video"]}).then(t.onLocalTracks).catch((function(t){throw t})),bS["a"].createLocalTracks({devices:["audio"]}).then(t.onLocalTracks).catch((function(t){throw t}));case 8:case"end":return e.stop()}}),e)})))()},onLocalTracks:function(t){var e=this;t.forEach((function(t){"video"===t.getType()&&(e.localVideoTrack=t,e.addLocalTrackUser()),"audio"===t.getType()&&(e.localAudioTrack=t)})),this.isJoined&&(this.localVideoTrack&&this.room.addTrack(this.localVideoTrack),this.localAudioTrack&&this.room.addTrack(this.localAudioTrack))},openSourceCamera:function(){this.videoSettings=!this.videoSettings},openSourceMic:function(){this.audioSettings=!this.audioSettings},getNewAudioLocalTrack:function(t){bS["a"].createLocalTracks({devices:["audio"],micDeviceId:t.deviceId}).then(this.replaceAudio).catch((function(t){throw t}))},replaceAudio:function(t){var e=this.localAudioTrack;this.localAudioTrack=t[0],this.room&&this.room.replaceTrack(e,this.localAudioTrack).then((function(){e.dispose()}))},getNewVideoLocalTrack:function(t){bS["a"].createLocalTracks({devices:["video"],cameraDeviceId:t.deviceId}).then(this.replaceVideoTrackLocal).catch((function(t){throw t}))},replaceVideoTrackLocal:function(t){var e=this,i=this.localVideoTrack;this.localVideoTrack=t[0],this.room&&(this.room.replaceTrack(i,this.localVideoTrack).then((function(){e.addLocalTrackUser(),i.dispose()})).catch((function(t){window.console.log("replaceVideoTrackLocal error",t)})),this.acceptCamera||this.localVideoTrack.mute())},getStatusActiveDevice:function(t,e){if("audio"===t){if(!this.localAudioTrack)return;return this.localAudioTrack.deviceId===e.deviceId}if(this.localVideoTrack)return this.localVideoTrack.deviceId===e.deviceId},enumerateDevices:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loadEnumerateDevices=!0,e.next=3,bS["a"].enumerateDevices((function(e){t.audioDevices=e.filter((function(t){return"audioinput"===t.kind&&t.deviceId})),t.audioDevices.length&&(t.audioDevices=t.audioDevices.map((function(t){return[t,{status:!1}]}))),t.videoDevices=e.filter((function(t){return"videoinput"===t.kind&&t.deviceId})),t.videoDevices.length&&(t.videoDevices=t.videoDevices.map((function(t){return[t,{status:!1}]}))),t.setStatusForDevices("video",t.videoDevices),t.setStatusForDevices("audio",t.audioDevices),t.loadEnumerateDevices=!1}));case 3:case"end":return e.stop()}}),e)})))()},setStatusForDevices:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,Promise.all(e.map(function(){var e=Object(a["a"])(Object(r["a"])().mark((function e(i){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,navigator.mediaDevices.getUserMedia(Object(Vt["a"])({},t,Object(Vt["a"])({},t,{deviceId:{exact:i[0].deviceId}}))).then((function(){i[1].status=!0})).catch((function(t){i[1]={status:!1,error:t}}));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return i.stop()}}),i)})))()},onConnectionSuccess:function(){var t=this;this.room=this.connection.initJitsiConference("test",this.options.conference),this.room.on(bS["a"].events.conference.TRACK_ADDED,(function(e){!e.isLocal()&&t.onRemoteTrack(e)})),this.room.on(bS["a"].events.conference.TRACK_REMOVED,(function(e){!e.isLocal()&&t.onRemoteTrackRemove(e)})),this.room.on(bS["a"].events.conference.CONFERENCE_JOINED,this.onConferenceJoined),this.room.on(bS["a"].events.conference.TRACK_MUTE_CHANGED,this.trackMuteChanged),this.room.on(bS["a"].events.conference.USER_JOINED,this.onUserJoined),this.room.on(bS["a"].events.conference.USER_LEFT,this.onUserLeft),this.room.join(),this.room.setReceiverVideoConstraint(720)},onConnectionFailed:function(){window.console.error("Connection Failed!")},onRemoteTrack:function(t){var e=t.getParticipantId();"video"===t.getType()&&this.videoTracks.push(t),this.remoteTracks[e]||(this.remoteTracks[e]=[]),this.remoteTracks[e].push(t),this.remoteTracks[e].some((function(t){return"video"===t.getType()&&!t.isMuted()}))&&(this.muteStatus=!1),this.addNewPlayers(),"audio"===t.getType()&&t.attach(this.$refs.audioPlayer),this.setParticipant(),this.participantArr.length>1&&(this.statusAddMember=!1)},onRemoteTrackRemove:function(t){var e=t.getParticipantId();if(this.remoteTracks[e]&&"video"===t.getType()){var i=this.remoteTracks[e].find((function(t){return"video"===t.getType()}));this.remoteTracks[e].splice(i,1);var o=this.videoTracks.findIndex((function(e){return e.getId()===t.getId()}));this.videoTracks.splice(o,1)}},trackMuteChanged:function(t){t.ownerEndpointId&&"video"===t.getType()&&(this.muteStatus=t.isMuted())},onUserJoined:function(t){clearInterval(this.intervalSignal),this.intervalSignal=null,this.participantIds.add(t),this.timerRecord||this.startTimer(),this.room.selectParticipants(Array.from(this.participantIds)),this.userJoin=!0},onConferenceJoined:function(){this.isJoined=!0,this.localVideoTrack&&this.room.addTrack(this.localVideoTrack),this.localAudioTrack&&this.room.addTrack(this.localAudioTrack)},onUserLeft:function(t){this.participantIds.delete(t),this.room.selectParticipants(Array.from(this.participantIds)),this.setParticipant(),this.getVideoCallStatus.data&&!this.participantArr.length&&this.endCall("accept")},disconnect:function(){this.connection.removeEventListener(bS["a"].events.connection.CONNECTION_ESTABLISHED,this.onConnectionSuccess),this.connection.removeEventListener(bS["a"].events.connection.CONNECTION_FAILED,this.onConnectionFailed),this.connection.removeEventListener(bS["a"].events.connection.CONNECTION_DISCONNECTED,this.disconnect)},videoCallOut:function(){var t=this;this.gudokAudio.play(),this.participantArr.push(this.getCallToUserInfo),this.sendSignal(0),this.getCallToken(),this.intervalSignal=setInterval((function(){t.gudokAudio.play()}),5e3),setTimeout((function(){t.intervalSignal&&clearInterval(t.intervalSignal)}),9e4)},sendSignal:function(){var t={command:"NewCall",token:this.getSession.fp,data:{from:this.getCurrentVideoCall.from,to:this.getCurrentVideoCall.to,uui:this.getChatCurrentRoom._id}};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:t})},endCall:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.userJoin||"rejectCall"===t||(o={command:"DropCall",token:e.getSession.fp,data:{from:e.getCurrentVideoCall.from,to:e.getCurrentVideoCall.to}},e.$socketStream.sendCommand({ws:"apiWS_NOTI",command:o})),"out"!==e.callInfo.mode){i.next=4;break}return i.next=4,e.sendVideoCallInfoMessage(t);case 4:if(e.room&&(e.room.leave(),e.room=null),!e.localAudioTrack){i.next=8;break}return i.next=8,e.localAudioTrack.dispose();case 8:if(!e.localVideoTrack){i.next=11;break}return i.next=11,e.localVideoTrack.dispose();case 11:e.$store.commit("modal/setVideoCallModal",null);case 12:case"end":return i.stop()}}),i)})))()},sendVideoCallInfoMessage:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o={message:{rid:e.getCurrentVideoCall.room,msg:JSON.stringify({from:"".concat(e.getUserDetail.firstName," ").concat(e.getUserDetail.lastName),status:t,time:e.getTimerTime,msg:"video_calling"})}},i.next=3,e.$http.post("".concat(e.getApiChat,"chat.sendMessage"),JSON.stringify(o),{headers:{"X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId,"Content-type":"application/json"}});case 3:case"end":return i.stop()}}),i)})))()},startTimer:function(){var t=this;this.timerRecord=setInterval((function(){59===t.seconds?(t.minutes++,t.seconds=0):t.seconds++}),1e3)},replacePlayers:function(t){var e=this;this.getMinimazeTrackStatus(t)&&(this.showAvatar=!1,this.$nextTick((function(){"local"===e.minimazeTrack?e.minimazeTrack="remote":e.minimazeTrack="local",e.showAvatar=!0})))},sharingDesktop:function(){this.statusDesktop&&(this.sharingDesktopStatus=!this.sharingDesktopStatus)},setAcceptVideo:function(){this.localVideoTrack&&(this.acceptCamera=!this.acceptCamera)},setAcceptAudio:function(){this.acceptAudio=!this.acceptAudio},getMinimazeTrackStatus:function(t){return"local"===this.minimazeTrack?t.isLocal():!t.isLocal()},getSizeAvatar:function(t){return this.getMinimazeTrackStatus(t)?"6":"19"},getParticipantAvatarAndName:function(t){var e=t.ownerEndpointId,i=this.participantArr.find((function(t){return t.id===e}));return i?{avatar:i.avatar,name:i.username}:""},addNewPlayers:function(){var t=this;this.videoTracks.length&&this.$nextTick((function(){t.videoTracks.forEach((function(e,i){t.$refs["videoPlayer"+i]&&e.attach(t.$refs["videoPlayer"+i][0])}))}))},addLocalTrackUser:function(){var t=this;this.$nextTick((function(){t.localVideoTrack.attach(t.$refs.localVideoTrack)}))},clearErrorMsg:function(){this.errorDesctopMsg=""},getSharingDecktop:function(){var t=this;this.sharingDesktopStatus?this.sharingDesktopStatus=!1:bS["a"].createLocalTracks({devices:["desktop"]}).then((function(e){t.localVideoTrack?t.replaceVideoTrackLocal(e):(t.localVideoTrack=e[0],t.room&&(t.room.addTrack(t.localVideoTrack),t.addLocalTrackUser())),t.sharingDesktopStatus=!0})).catch((function(e){t.errorDesctopMsg=e.message}))},addMemberToCall:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getInfoUser(t.itemData);case 2:o=i.sent,n={command:"NewCall",token:e.getSession.fp,data:{from:e.getUserDetail.id,to:o.customFields.platformUser,uui:e.getCurrentVideoCall.room}},e.$socketStream.sendCommand({ws:"apiWS_NOTI",command:n}),e.showContacts(),e.statusAddMember=!0;case 7:case"end":return i.stop()}}),i)})))()},getInfoUser:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.$http.get("".concat(e.getApiChat,"users.info?userId=").concat(t._id),{headers:{"X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId,"Content-type":"application/json"}}).then((function(t){o=t.data.user}));case 2:return i.abrupt("return",o);case 3:case"end":return i.stop()}}),i)})))()},copyPath:function(){var t=this,e="https://conference.toptrader.org/?room=".concat(this.getCurrentVideoCall.room);navigator.clipboard.writeText(e).then((function(){t.tooltipCopy=!0,setTimeout((function(){t.tooltipCopy=!1}),500)}))}},mounted:function(){this.$socketStream.$on("chatWS",this.setMessageHendler),this.$socketStream.$on("apiWS_NOTI",this.setMessageHendler),this.enumerateDevices(),"out"===this.callInfo.mode?this.videoCallOut():this.getCallToken()},destroyed:function(){this.$socketStream.$off("chatWS",this.setMessageHendler),this.$socketStream.$off("apiWS_NOTI",this.setMessageHendler),this.localAudioTrack&&this.localAudioTrack.dispose(),this.localVideoTrack&&this.localVideoTrack.dispose(),this.intervalSignal&&clearInterval(this.intervalSignal),this.room&&this.room.leave(),this.connection&&this.connection.disconnect(),this.$store.commit("chat/setCurrentVideoCall",null)}},xS=TS,OS=(i("3a7a"),Object(C["a"])(xS,yS,CS,!1,null,"b4d38b36",null)),wS=OS.exports,_S=function(){var t=this,e=t._self._c;return e("Modal",{class:"modal-menu-settingsQuote modal-menu-settingsQuote_".concat(t.getActiveTheme),attrs:{isOpen:t.isOpen,title:t.$t("menu_setup"),zIndex:999},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{ref:"catalogScreen",class:"modal-menu-settingsQuote__catalogs modal-menu-settingsQuote__catalogs_".concat(t.getActiveTheme)},[e("div",{staticClass:"modal-menu-settingsQuote__titles"},[e("div",{staticClass:"left-side",staticStyle:{display:"flex"}},[e("div",{staticClass:"side-title"},[t._v(t._s(t.$t("instruments_catalog")))])]),e("div",{staticClass:"modal-menu-settingsQuote__top_add"},[e("InputSearch",{attrs:{theme:t.getActiveTheme},model:{value:t.searchQuoteString,callback:function(e){t.searchQuoteString=e},expression:"searchQuoteString"}})],1)]),e("div",{staticClass:"modal-menu-settingsQuote__tabs"},[e("div",{staticClass:"buttons-group modal-menu-settingsQuote__top",class:{"modal-menu-settingsQuote__top--controls":t.getCountScreens.length>4}},[e("VuePerfectScrollbar",{attrs:{id:"groupBtnScroll",settings:t.groupSettingsScroll}},t._l(t.getArrayeTypesCatalogsQuotes,(function(i,o){return e("ButtonIconFlat",{key:o+"settingsQuote__top",class:{modalSettingsActive:o===t.getActiveScreenInfo.index},attrs:{icon:{name:""},modifier:{class:["buttonFlat-icon__standartButton","buttonFlat-icon__standartButton--32",t.activeCatalogQuotes===i?"buttonFlat-icon__standartButton-active":""],style:{minWidth:"32px",marginRight:"8px"}}},on:{toggle:function(e){return t.setNewActiveCatalogQuotes(i)}}},[e("span",[t._v(" "+t._s(i)+" "),e("span",{style:{marginLeft:"3px",color:t.activeCatalogQuotes===i?"#66CBFF":"#8c8c8c",fontWeight:500}},[t._v(t._s(t.getCountsQuotesInCatalogs[o])+" ")])])])})),1)],1)]),t.getSourcesForActiveCatalog.length&&"all"!==t.activeCatalogQuotes?e("div",{staticClass:"modal-menu-settingsQuote__tabs"},t._l(t.getSourcesForActiveCatalog,(function(i,o){return e("ButtonIconFlat",{key:i,attrs:{modifier:{class:["buttonFlat-icon__standartButton","buttonFlat-icon__standartButton--32",t.activeSourceQuotes===o?"buttonFlat-icon__standartButton-active":""],style:{minWidth:"32px",marginRight:"8px"}}},on:{click:function(e){return t.setActiveSourceQuotes(o)}}},[e("div",{staticClass:"buttonSource"},[e("img",{attrs:{src:"data:image/png;base64,".concat(t.getSourceInfo(i).logo),width:"15px",height:"15px"}}),e("span",[t._v(" "+t._s(t.getSourceInfo(i).name)+" ")])])])})),1):t._e(),e("VuePerfectScrollbar",{staticClass:"modal-menu-settingsQuote__lists",attrs:{minScrollbarLength:36,maxScrollbarLength:72},on:{"ps-scroll-y":t.setHeightForQuoteCatalogSrollTop}},[e("div",{staticClass:"modal-menu-settingsQuote__group-unscrollable"},t._l(t.getQuotesForActiveCatalog,(function(i,o){return e("div",{key:o,staticClass:"settingsQuotes-listItem"},[e("div",{staticClass:"settingsQuotes-listItem-instrument"},[e("div",{staticClass:"settingsQuotes-listItem-instrument_checkBox"},[t.checkActiveQuoteInScreen(i)?e("div",{staticClass:"settingsQuotes-listItem-instrument_countActiveQuotes"},[t._v(t._s(t.checkActiveQuoteInScreen(i)))]):e("Checkbox",{attrs:{starMode:""},on:{change:function(e){return t.addButtonOnScreen(i)}}})],1),e("div",{class:t.checkActiveQuoteInScreen(i)?"settingsQuotes-listItem-instrument_addQuoteIcon-active":"settingsQuotes-listItem-instrument_addQuoteIcon",on:{click:function(e){return t.addButtonOnScreen(i)}}},[e("svgIcon",{attrs:{name:"Add"}})],1),e("div",{staticClass:"settingsQuotes-listItem-instrument_checkBox-text"},[t._v(t._s(i.listText))])]),e("div",{staticClass:"settingsQuotes-listItem-instrumentType"},[t._v(t._s(i.groupName)+" ")])])})),0)])],1),e("div",{ref:"activeScreen",class:"modal-menu-settingsQuote__activeScreen modal-menu-settingsQuote__activeScreen_".concat(t.getActiveTheme)},[e("div",{staticClass:"modal-menu-settingsQuote__tabs"},[e("div",{staticClass:"modal-menu-settingsQuote__top"},t._l(t.getCountScreens,(function(i,o){return e("div",{key:o,staticClass:"modal-menu-settingsQuote__top_groups",class:{"modal-menu-settingsQuote__top_groups-noDelete":!t.getDeleteScreenStatus(o)},attrs:{id:o+"group"}},[e("Button-label",{attrs:{isActive:o===t.activeIndicatorScreen,modifier:"forModalSettings forModalSettings_".concat(t.getActiveTheme)},on:{tab:function(e){return t.toggleScreen(o)}}},["number"===t.getTradingTopBarSettings.screensQuotes[o].screen.type?e("div",{class:"modal-menu-settingsQuote__textModeScreen ".concat(o===t.activeIndicatorScreen?"modal-menu-settingsQuote__textModeScreen-isActive_".concat(t.getActiveTheme):"modal-menu-settingsQuote__textModeScreen_".concat(t.getActiveTheme))},[t._v("# "+t._s(o+1))]):t._e(),"color"===t.getTradingTopBarSettings.screensQuotes[o].screen.type?e("div",{staticClass:"modal-menu-settingsQuote__colorModeScreen"},[e("div",{staticClass:"modal-menu-settingsQuote__colorModeScreen-roundColor",style:{background:t.getTradingTopBarSettings.screensQuotes[o].screen.color}})]):t._e(),"avatar"===t.getTradingTopBarSettings.screensQuotes[o].screen.type?e("div",{staticClass:"modal-menu-settingsQuote__avatarModeScreen"},[e("Avatar",{attrs:{size:"2",theme:t.getActiveTheme,src:t.getTradingTopBarSettings.screensQuotes[o].screen.avatar}})],1):t._e()]),t.getDeleteScreenStatus(o)?e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["modalSettings-delScreenBtn modalSettings-delScreenBtn_".concat(t.getActiveTheme)]}},on:{toggle:function(e){return t.toggleAlert(o)}}}):t._e()],1)})),0),e("div",{staticClass:"modal-menu-settingsQuote__top_add"},[e("ButtonIconFlat",{attrs:{disable:t.getEmtySсreens||7===t.getCountScreens,icon:{name:"Add",color:"#8c8c8c"},modifier:{class:["buttonFlat-icon__standartButton","buttonFlat-icon__standartButton--32"]}},on:{toggle:t.addScreen}})],1)]),e("div",{staticClass:"modal-menu-settingsQuote__titles"},[e("div",{staticClass:"left-side",staticStyle:{display:"flex","align-items":"center",height:"3.2rem"}},[e("div",{staticClass:"side-title"},[t._v(t._s(t.$t("section")))]),t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen]?e("div",{staticClass:"side-title-exampl"},["number"===t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.type?e("div",{staticClass:"modal-menu-settingsQuote__textModeScreen",class:"modal-menu-settingsQuote__textModeScreen_".concat(t.getActiveTheme)},[t._v(t._s("#".concat(t.activeIndicatorScreen+1)))]):t._e(),"color"===t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.type?e("div",{staticClass:"modal-menu-settingsQuote__colorPicker"},[e("NewColorPicker",{attrs:{color:t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.color,top:"105px",right:"255px"},on:{changeColor:function(e){return t.setButtonColor(e)}}})],1):t._e(),"avatar"===t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.type?e("div",{staticClass:"modal-menu-settingsQuote__avatarModeScreenUpload"},[t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.avatar?e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("Avatar",{attrs:{src:t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.avatar,size:"2",theme:t.getActiveTheme}}),e("div",{staticStyle:{color:"#E91212",cursor:"pointer"},on:{click:t.removeAvatar}},[e("svgIcon",{attrs:{name:"Close"}})],1)],1):e("FileUploader",{attrs:{formats:t.formats,size:t.sizeKB},on:{input:function(e){return t.onInputCover(e)}}})],1):t._e()]):t._e()]),e("div",{staticClass:"right-side"},[e("div",{staticClass:"side-title"},[t._v(t._s(t.$t("display_by"))+":")]),t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen]?e("div",{staticClass:"menu-mode-picker"},[e("DxSelectBox",{staticClass:"menu-mode-picker__select-display",attrs:{height:"100%",width:"105px",dropDownOptions:{container:".modal-menu-settingsQuote"},"element-attr":t.attrSelectBox,useItemTextAsTitle:!0,hoverStateEnabled:!1,stylingMode:"underlined",items:t.modes,"item-template":"itemList",value:t.$t(t.modes.find((function(e){return e.mode===t.getTradingTopBarSettings.screensQuotes[t.activeIndicatorScreen].screen.type})).textList),displayExpr:t.getModeItem,onItemClick:t.select,"drop-down-button-template":"iconDropDown"},scopedSlots:t._u([{key:"itemList",fn:function(e){var i=e.data;return[t._v(t._s(t.$t(i.textList)))]}},{key:"iconDropDown",fn:function(){return[e("div",{class:"dropDownSelect__button dropDownSelect__button_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:t.settingsDropDownIcon.name.nameClose}})],1)]},proxy:!0}],null,!1,10084644)})],1):t._e()])]),t.getActiveQuoteForActiveScreen.length?t._e():e("div",{staticClass:"modal-menu-settingsQuote__emptyScreen"},[e("div",{staticClass:"modal-menu-settingsQuote__emptyScreen_icon"},[e("svgIcon",{attrs:{name:"Warning",size:72}})],1),e("div",{staticClass:"modal-menu-settingsQuote__emptyScreen_text"},[e("h3",[t._v(t._s(t.$t("nothing_here_yet")))]),e("p",[t._v(" "+t._s(t.$t("stdif")))])])]),t.getActiveQuoteForActiveScreen.length?e("VuePerfectScrollbar",{staticClass:"modal-menu-settingsQuote__lists",attrs:{id:"menuSettingsList",minScrollbarLength:36,maxScrollbarLength:72},on:{"ps-scroll-y":t.setActiveQuoteForActiveScreenSrollTop}},[e("div",{staticClass:"modal-menu-settingsQuote__group-unscrollable"},t._l(t.getActiveQuoteForActiveScreen,(function(i,o){return e("div",{key:o,staticClass:"settingsQuotes-listItem"},[e("div",{staticClass:"settingsQuotes-listItem-instrument"},[e("div",{staticClass:"settingsQuotes-listItem-instrument_checkBox settingsQuotes-listItem-instrument_checkBox-active",on:{click:function(e){return t.removeButtonOnScreen(i)}}},[e("svgIcon",{attrs:{name:"Favorite-on"}}),e("div",{staticClass:"settingsQuotes-listItem-instrument_checkBox-text"},[t._v(t._s(i.btn.listText))])],1)]),e("div",{staticClass:"settingsQuotes-listItem-instrumentType"},[t._v(t._s(i.btn.groupName))]),t.showOptionsActiveCatalog?e("div",{staticClass:"settingsQuotes-listItem-selectTimeFrame"},[e("DxSelectBox",{staticClass:"menu-mode-picker__select-time",attrs:{height:"3.2rem",hoverStateEnabled:!1,items:t.timeFrames,dropDownOptions:{container:".modal-menu-settingsQuote"},value:t.getActiveTimeFrameForButton(i.btn),stylingMode:"underlined","element-attr":t.attrSelectBox,useItemTextAsTitle:!0,"field-template":"field","item-template":"item","drop-down-button-template":"iconDropDown"},on:{itemClick:function(e){return t.selectNewOptionForQuote(e,i,"timeFrame")}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropDownSelect__content"},[e("div",{staticClass:"dropDownSelect__content-icon"},[e("svgIcon",{attrs:{name:o.iconName}})],1),e("div",{staticClass:"dropDownSelect__content-text"},[e("DxTextBox",{attrs:{value:t.$t(o.text),"read-only":!0}})],1)])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropDownSelect__contentItem"},[e("div",{staticClass:"dropDownSelect__contentItem-icon"},[e("svgIcon",{attrs:{name:o.iconName}})],1),e("div",{staticClass:"dropDownSelect__contentItem-text"},[t._v(t._s(t.$t(o.text)))])])]}},{key:"iconDropDown",fn:function(){return[e("div",{class:"dropDownSelect__button dropDownSelect__button_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:t.settingsDropDownIcon.name.nameClose}})],1)]},proxy:!0}],null,!0)})],1):t._e()])})),0)]):t._e(),e("Alert",{attrs:{enabled:t.alert,leftPosition:{left:"80px",top:"80px"},topPosition:{top:"80px"},leftTrianglePosition:{left:"100px"}}},[e("div",{staticClass:"form-label alert__text"},[t._v(t._s(t.$t("deleteGroup"))+" №"+t._s(t.alertProp)+"?")]),e("div",{staticClass:"modal-menu-settingsQuote-alertControls"},[e("ButtonIconFlat",{attrs:{modifier:{class:["buttonFlat-icon__white-button"],style:{marginRight:"0.8rem"}},typeBtn:"cancel",icon:{name:"Close"}},on:{click:function(e){t.alert=!1}}},[e("span",[t._v(t._s(t.$t("cancel")))])]),e("ButtonIconFlat",{attrs:{modifier:{class:["buttonFlat-icon__red-button"]},typeBtn:"cancel",icon:{name:"del-ok"}},on:{click:function(e){return t.deleteScreen(t.alertProp)}}},[e("span",[t._v(t._s(t.$t("delete"))+" ")])])],1)])],1)]},proxy:!0}])})},AS=[],DS=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-select-icon",class:{"dropdown-select-icon--open":t.isOpen},on:{click:t.toggle}},[e("div",{staticClass:"dropdown-select-icon--activeWrap",style:t.styleActiveWrap},[t.selected.iconName?e("ButtonIconFlat",{attrs:{modifier:t.modifier,icon:{name:t.selected.iconName,color:"#8c8c8c"}}}):e("Button-label",{class:{"button-icon--active":t.isOpen},attrs:{modifier:"flat trigger group"}},[t._v(t._s(t.selected.text))]),t._t("afterText"),t.iconDropDown.status?e("div",{staticClass:"dropdown-select-icon--activeWrap_ddIcon",style:t.iconDropDown.style},[e("svgIcon",{attrs:{name:t.isOpen?t.iconDropDown.name.nameOpen:t.iconDropDown.name.nameClose}})],1):t._e()],2),t.isOpen?e("VuePerfectScrollbar",{staticClass:"dropdown-select-icon__content",style:t.styleContent},[e("Dropdown-menu",{attrs:{isOpen:""}},t._l(t.dropdownList,(function(i,o){return e("list-item",{key:o,attrs:{iconName:i.iconName},on:{clickListItem:function(e){return t.select(i,o)}}},[t._v(t._s(t.$t(i.text)))])})),1)],1):t._e()],1)},kS=[],IS={components:{svgIcon:L,DropdownMenu:vt,listItem:le,ButtonIconFlat:Le,ButtonLabel:Z,VuePerfectScrollbar:Xt.a},data:function(){return{isOpen:!1,activeIndex:null,selected:"",list:this.arr}},props:{arr:{type:Array},open:{default:!1},defaultSelected:{default:null},styleActiveWrap:{type:Object,default:function(){return{}}},styleContent:{type:Object,default:function(){return{top:"3.6rem",left:0}}},iconDropDown:{type:Object,default:function(){return{style:{},name:{nameOpen:"new-dropdown-arrow-up",nameClose:"new-dropdown-arrow-down"},status:!1}}},modifier:{type:Object}},watch:{open:function(t){this.isOpen=t},defaultSelected:function(t){this.selected=this.list.find((function(e){return e.type===t})),this.activeIndex=this.list.findIndex((function(e){return e.type===t}))}},computed:{dropdownList:function(){var t=this;return this.list.filter((function(e){return e.index!==t.activeIndex}))}},methods:{select:function(t){var e=this;this.list=this.arr.filter((function(t,i){return i!==e.activeIndex})),this.$emit("clickIcon",t),this.$emit("toggleDropdownSelectIcon")},toggle:function(){this.isOpen=!this.isOpen,this.$emit("toggleDropdownSelectIcon")}},mounted:function(){var t=this;this.defaultSelected?(this.selected=this.list.find((function(e){return e.type===t.defaultSelected})),this.activeIndex=this.list.findIndex((function(e){return e.type===t.defaultSelected}))):(this.selected=this.list[0],this.activeIndex=0)}},BS=IS,MS=(i("0714"),Object(C["a"])(BS,DS,kS,!1,null,null,null)),$S=MS.exports,LS=function(){var t=this,e=t._self._c;return e("div",{staticClass:"selectList",style:t.styleSelectList},[e("div",{staticClass:"selectList-activeContent"},[e("div",{staticClass:"selectList-activeContent__icon"},[e("svgIcon",{attrs:{name:t.itemsList[t.activeIndex].iconName}})],1),e("div",{staticClass:"selectList-activeContent__content"},[t._v(t._s(t.$t(t.itemsList[t.activeIndex].text)))])]),e("div",{staticClass:"selectList-controllArrow"},[e("div",{staticClass:"selectList-controllArrow__up",on:{click:function(e){return t.changeActiveIndex("up")}}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-up"}})],1),e("div",{staticClass:"selectList-controllArrow__down",on:{click:function(e){return t.changeActiveIndex("down")}}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1)])])},FS=[],jS={components:{svgIcon:L},props:{styleSelectList:{type:Object,default:function(){return{}}},itemsList:{type:Array},defaultValue:{type:String}},data:function(){return{activeIndex:0}},methods:{changeActiveIndex:function(t){"up"===t?this.activeIndex!==this.itemsList.length-1?this.activeIndex++:this.activeIndex=0:0!==this.activeIndex?this.activeIndex--:this.activeIndex=this.itemsList.length-1,this.$emit("changeActiveIndex",this.itemsList[this.activeIndex])}},mounted:function(){var t=this;this.defaultValue&&(this.activeIndex=this.itemsList.findIndex((function(e){return t.defaultValue===e.type})))}},RS=jS,WS=(i("60de"),Object(C["a"])(RS,LS,FS,!1,null,null,null)),NS=WS.exports,ES=[{iconName:"M1",timeFrame:"M1",type:"M1",text:"M1",active:!1},{iconName:"M2",timeFrame:"M2",type:"M2",text:"M2",active:!1},{iconName:"M3",timeFrame:"M3",type:"M3",text:"M3",active:!1},{iconName:"M5",timeFrame:"M5",type:"M5",text:"M5",active:!1},{iconName:"M10",timeFrame:"M10",type:"M10",text:"M10",active:!1},{iconName:"M15",timeFrame:"M15",type:"M15",text:"M15",active:!1},{iconName:"M30",timeFrame:"M30",type:"M30",text:"M30",active:!1},{iconName:"M45",timeFrame:"M45",type:"M45",text:"M45",active:!1},{iconName:"H1",timeFrame:"H1",type:"H1",text:"H1",active:!1},{iconName:"H2",timeFrame:"H2",type:"H2",text:"H2",active:!1},{iconName:"H3",timeFrame:"H3",type:"H3",text:"H3",active:!1},{iconName:"H4",timeFrame:"H4",type:"H4",text:"H4",active:!1},{iconName:"H6",timeFrame:"H6",type:"H6",text:"H6",active:!1},{iconName:"H9",timeFrame:"H9",type:"H9",text:"H9",active:!1},{iconName:"D1",timeFrame:"D1",type:"D1",text:"D1",active:!1},{iconName:"W1",timeFrame:"W1",type:"W1",text:"W1",active:!1},{iconName:"MN",timeFrame:"MN",type:"MN",text:"MN",active:!1}],US=[{icon:"Chart-type-candle-1",iconName:"Chart-type-candle-1",active:!1,event:"setCahrtType",type:"candlestick",text:"candlestick"},{icon:"GR_Chart_candle-2",iconName:"GR_Chart_candle-2",active:!1,event:"setCahrtType",type:"monochrom",text:"MonochromCandles"},{icon:"hollow-candles",iconName:"hollow-candles",active:!1,event:"setCahrtType",type:"hollow",text:"monochrom"},{icon:"Chart-type-bar",iconName:"Chart-type-bar",active:!1,event:"setCahrtType",type:"stock",text:"stock"},{icon:"Chart-type-2",iconName:"Chart-type-2",active:!1,event:"setCahrtType",type:"spline",text:"spline"},{icon:"Diapason",iconName:"Diapason",active:!1,event:"setCahrtType",type:"splines",text:"splines"},{icon:"Chart-type-zone",iconName:"Chart-type-zone",active:!1,event:"setCahrtType",type:"area",text:"area"}],VS={components:{Preloader:ah,Avatar:E,InputSearch:qu,Checkbox:Ya,NewColorPicker:Ki,DxSelectBox:Io["DxSelectBox"],ListItem:le,SvgIcon:L,DxSortable:Gn.a,DxTextBox:sc["DxTextBox"],Modal:Oe,ButtonLabel:Z,ButtonIconFlat:Le,VuePerfectScrollbar:Xt.a,Alert:Ge,Button:Pa,FileUploader:We,DropdownSelectIcon:$S,SelectList:NS},data:function(){return{loaderSelectBox:!0,selectBoxRender:!1,timeFrames:ES,chartTypes:US,settingsDropDownIcon:{style:{},name:{nameOpen:"new-dropdown-arrow-up",nameClose:"new-dropdown-arrow-down"},status:!0},activeIndicatorScreen:null,activeCatalogQuotes:"Forex",activeSourceQuotes:0,searchQuoteString:"",activeQuoteForActiveScreenSrollTop:0,quoteScrolingForQuoteCatalog:0,statusSeclectListActiveScreen:!1,statusSeclectListQuoteCatalog:!1,showOptionsActiveCatalog:!0,attrSelectBox:{class:"modal-menu-settingsQuote__selectBox"},modes:[{textList:"text",mode:"number"},{textList:"color",mode:"color"},{textList:"avatar",mode:"avatar"}],formats:["image/jpg","image/jpeg","image/png"],sizeKB:7e4,alert:!1,alertProp:null,alertTriangleLeft:{},alertLeft:{}}},props:{isOpen:{type:Boolean,default:!1},groupSettingsScroll:{suppressScrollY:!0}},watch:{getActiveQuoteForActiveScreen:function(){this.getStatusSeclectListActiveScreen(),this.getStatusSeclectListQuoteCatalog()},fullModeCatalogInstrument:function(){this.getStatusSeclectListActiveScreen()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getActiveModeButtons:"headerSettings/getActiveModeButtons",getBrokers:"brokers/getBrokers",getSession:"auth/getSession",getCatalogs:"quotesCatalogs/getCatalogs",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getArrayeTypesCatalogsQuotes:function(){return Object.keys(this.getCatalogs)},getCountScreens:function(){return this.getTradingTopBarSettings.screensQuotes.length},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getActiveQuoteForActiveScreen:function(){if("number"!==typeof this.activeIndicatorScreen)return[];var t=[];return this.getTradingTopBarSettings.screensQuotes[this.activeIndicatorScreen].content.forEach((function(e){e.setButtons.forEach((function(i){t.push({btn:i,setId:e.setId})}))})),t},getActiveMultiChartQuotes:function(){return this.getTradingTopBarSettings.screensQuotes[this.activeIndicatorScreen].content.multiChartButtons},getSourcesForActiveCatalog:function(){var t=this.$store.getters["quotesCatalogs/getCatalogsByType"](this.activeCatalogQuotes),e=t.filter((function(t){return t.sourceId}));return e.length?Object(x["a"])(new Set(e.map((function(t){return t.sourceId})))):e},getQuotesForActiveCatalog:function(){var t=this;if(this.getSourcesForActiveCatalog.length&&"all"!==this.activeCatalogQuotes){var e=this.$store.getters["quotesCatalogs/getCatalogsByType"](this.activeCatalogQuotes).map((function(t){return{symbol:t.s,sourceId:t.sourceId,listText:t.s,groupName:t.groupName,timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!1,id:Math.random().toString(36).substring(7)}})).filter((function(e){return e.sourceId===t.getSourcesForActiveCatalog[t.activeSourceQuotes]})).filter((function(e){return t.searchQuoteString?e.symbol.toUpperCase().includes(t.searchQuoteString.toUpperCase()):e}));return e}var i=this.$store.getters["quotesCatalogs/getCatalogsByType"](this.activeCatalogQuotes).map((function(t){return{symbol:t.s,listText:t.s,groupName:t.groupName,timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!1,id:Math.random().toString(36).substring(7)}})).filter((function(e){return t.searchQuoteString?e.symbol.toUpperCase().includes(t.searchQuoteString.toUpperCase()):e}));return i},getCountsQuotesInCatalogs:function(){var t=[];for(var e in this.getCatalogs)t.push(this.getCatalogs[e].length);return t},"getEmtySсreens":function(){return this.getTradingTopBarSettings.screensQuotes.some((function(t){return!t.content.length}))}}),methods:{contentReadySelectBox:function(){var t=this;this.$nextTick((function(){t.loaderSelectBox=!1}))},getSourceInfo:function(t){var e=this.getBrokers.find((function(e){return e.id===t}));return e},getActiveChartTypeForButton:function(t){var e=this.chartTypes.find((function(e){return e.type===t.chartType}));return e||this.chartTypes[0]},getActiveTimeFrameForButton:function(t){var e=this.timeFrames.find((function(e){return e.type===t.timeFrame}));return e||this.timeFrames[0]},setActiveSourceQuotes:function(t){this.activeSourceQuotes=t},changeWindowSize:function(){this.getStatusSeclectListActiveScreen(),this.getStatusSeclectListQuoteCatalog()},setActiveQuoteForActiveScreenSrollTop:function(t){this.activeQuoteForActiveScreenSrollTop=t.target.scrollTop},setHeightForQuoteCatalogSrollTop:function(t){this.quoteScrolingForQuoteCatalog=t.target.scrollTop},getStatusSeclectListActiveScreen:function(){var t=this;this.$nextTick((function(){t.statusSeclectListActiveScreen=t.$refs.activeScreen.clientHeight-48-44-16<=144}))},getStatusSeclectListQuoteCatalog:function(){var t=this;this.$nextTick((function(){t.statusSeclectListQuoteCatalog=t.$refs.catalogScreen.clientHeight-48-44-16<=144}))},getDeleteScreenStatus:function(t){return this.getEmtySсreens?this.getCountScreens>=2&&0!==t:this.getCountScreens>=2},selectNewOptionForQuote:function(t,e,i){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewOptionForButtonQuoteActiveScreen",data:{setId:e.setId,keyOption:i,newValue:t.itemData.type,id:e.btn.id}})},setNewActiveCatalogQuotes:function(t){this.activeCatalogQuotes=t,this.activeSourceQuotes=0},checkActiveQuoteInScreen:function(t){if(this.getActiveQuoteForActiveScreen){var e=this.getActiveQuoteForActiveScreen.filter((function(e){return e.btn.symbol===t.symbol}));return e.length}},removeButtonOnScreen:function(t){1===this.getActiveQuoteForActiveScreen.length&&1===this.getCountScreens||(this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"deleteSetButtonsOnScreen",data:{btn:t.btn,setId:t.setId}}),this.getActiveQuoteForActiveScreen.length||this.toggleScreen(0))},addButtonOnScreen:function(t){50!==this.getActiveQuoteForActiveScreen.length&&(this.getActiveQuoteForActiveScreen.length||this.$store.commit("tradingTopBarSettings/setNewActiveScreenAndButtonQuote",this.activeIndicatorScreen),t.id=Math.random().toString(36).substring(7),this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"addQuoteButtonOnScreen",data:t}),this.$nextTick((function(){var t=document.querySelector("#menuSettingsList");t.scrollTop=t.scrollHeight})))},selectNewOptionForQuoteCatalog:function(t,e,i){this.getQuotesForActiveCatalog[e][i]=t.itemData.type},addScreen:function(){this.$store.commit("tradingTopBarSettings/addNewScreen"),this.activeIndicatorScreen=this.getCountScreens-1},toggleScreen:function(t){this.getEmtySсreens&&this.$store.commit("tradingTopBarSettings/deleteEmptyScreen"),this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewActiveScreenAndButtonQuote",data:t}),this.activeIndicatorScreen=t},toggleAlert:function(t){if(!this.getTradingTopBarSettings.screensQuotes[t].content.length)return this.$store.commit("tradingTopBarSettings/deleteEmptyScreen"),void this.toggleScreen(t-1);this.alert=!0,this.fixAlertPosition(t),this.alertProp=t+1},fixAlertPosition:function(t){switch(t){case 0:this.alertTriangleLeft={left:"18px"},this.alertLeft={left:"15px"};break;case 1:this.alertTriangleLeft={left:"96px"},this.alertLeft={left:"15px"};break;case 2:this.alertTriangleLeft={left:"18px"},this.alertLeft={left:"170px"};break;case 3:this.alertTriangleLeft={left:"96px"},this.alertLeft={left:"170px"};break;case 4:this.alertTriangleLeft={left:"116px"},this.alertLeft={left:"190px"};break;case 5:this.alertTriangleLeft={left:"136px"},this.alertLeft={left:"240px"};break;case 6:this.alertTriangleLeft={left:"195px"},this.alertLeft={left:"240px"};break}},deleteScreen:function(t){this.getEmtySсreens&&this.$store.commit("tradingTopBarSettings/deleteEmptyScreen"),this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"deleteScreen",data:t-1}),this.activeIndicatorScreen=this.getActiveScreenInfo,this.alert=!this.alert},onTaskDrop:function(t){var e=this;this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"reorderButtonsOnScreen",data:t}),this.showOptionsActiveCatalog=!1,this.$nextTick((function(){e.showOptionsActiveCatalog=!0}))},select:function(t){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setModeForScreenTopBar",data:{mode:t.itemData.mode,index:this.activeIndicatorScreen}})},setButtonColor:function(t){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setColorForScreenTopBar",data:{color:t,index:this.activeIndicatorScreen}})},getModeItem:function(t){var e=this;return t?this.$t(t.textList):this.$t(this.modes.find((function(t){return t.mode===e.getTradingTopBarSettings.screensQuotes[e.activeIndicatorScreen].screen.type})).textList)},onInputCover:function(t){if(t){var e=URL.createObjectURL(t);this.$store.dispatch("modal/switchUploadImageModal",{mode:"chartTopBar-screen",src:e,cropFactor:{width:80,height:80},ratio:1,format:t.type,nameParam:"screenNumber-".concat(this.activeIndicatorScreen),indexScreen:this.activeIndicatorScreen})}},removeAvatar:function(){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setAvatarForScreenTopBar",data:{data:"",index:this.activeIndicatorScreen}})},fixTopForColorPicker:function(t){var e,i=document.getElementById("menuSettingsList");if(!i)return"0px";i.getBoundingClientRect()&&(e=i.getBoundingClientRect().bottom);var o,n=i.clientHeight,s=document.getElementById("colorParent"+t),r=225;return s?(o=s.getBoundingClientRect().bottom,e-o>=r?"0px":e-o+r-n+"px"):void 0},setIconColor:function(t){this.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:t})},close:function(){this.$store.dispatch("modal/switchSettingsScreenQuotes")},sideScroll:function(t,e,i,o){var n=document.querySelector("#groupBtnScroll"),s=0,r=setInterval((function(){"left"===t?n.scrollLeft-=o:n.scrollLeft+=o,s+=o,s>=i&&window.clearInterval(r)}),e)}},created:function(){this.activeIndicatorScreen=this.getActiveScreenInfo},mounted:function(){var t=this;setTimeout((function(){t.selectBoxRender=!0}),10),window.addEventListener("resize",this.changeWindowSize),this.getStatusSeclectListActiveScreen(),this.getStatusSeclectListQuoteCatalog()},destroyed:function(){window.removeEventListener("resize",this.changeWindowSize),this.getEmtySсreens&&(this.$store.commit("tradingTopBarSettings/deleteEmptyScreen"),this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo.index]||this.toggleScreen(0))}},HS=VS,GS=(i("6db0"),Object(C["a"])(HS,_S,AS,!1,null,"f7de5b54",null)),qS=GS.exports,zS=function(){var t=this,e=t._self._c;return e("div",{staticClass:"selfiePopup"},[e("DxPopup",{ref:"popup",attrs:{visible:!0,shading:!1,resizeEnabled:!0,titleTemplate:"dragZone",contentTemplate:"videoBox","element-attr":{class:"selfiePopup"},copyRootClassesToWrapper:!0,width:"640px",height:"480px",minWidth:"320px",minHeight:"240px",fullScreen:t.fullScreenMode},scopedSlots:t._u([{key:"dragZone",fn:function(){return[e("div",{staticClass:"selfiePopup-wrap",on:{mouseleave:t.hideSettings}},[e("div",{class:"selfiePopup-videoPlayer ".concat(t.roundMode&&!t.fullScreenMode?"selfiePopup-videoPlayer_roundMode":"")},[e("video",{ref:"videoPlayer"})]),t.firstSetStatus?e("div",{staticClass:"selfiePopup-setFirstSet"},[e("div",{staticClass:"selfiePopup-title"},[t._v("Выбрать источник видео")]),e("div",{staticClass:"selfiePopup-selectBox"},[e("DxSelectBox",{attrs:{items:t.videoMediaDevieces,displayExpr:"label",width:"240px",onValueChanged:t.addConstrains}})],1),t.streamLocal?e("div",{staticClass:"selfiePopup-hideFirstSet"},[e("ButtonIconFlat",{attrs:{modifier:{class:["selfiePopup-hideFirstSet_button"]}},on:{toggle:t.hideFirstSet}},[t._v("OK")])],1):t._e()]):t._e(),e("div",{staticClass:"selfiePopup-setttingsWindow",on:{mouseenter:t.showSettingsBar}},[t.settings?e("div",{staticClass:"selfiePopup-setttingsBar"},[e("div",{staticClass:"selfiePopup-setttingsBar_controls"},[e("div",{staticClass:"selfiePopup-setttingsBar_controls-item",on:{click:t.setFullScreen}},[e("svgIcon",{attrs:{name:"Expand"}})],1),e("div",{staticClass:"selfiePopup-setttingsBar_controls-item",on:{click:t.setRoundMode}},[e("svgIcon",{attrs:{name:"ChangeForms"}})],1)]),e("div",{staticClass:"selfiePopup-setttingsBar_selectBox"},[e("DxSelectBox",{attrs:{items:t.videoMediaDevieces,displayExpr:"label",width:"100%",height:"32px",onValueChanged:t.addConstrains,value:t.getActiveVideoInput}})],1),e("div",{staticClass:"selfiePopup-setttingsBar_controls"},[e("div",{staticClass:"selfiePopup-setttingsBar_controls-item",staticStyle:{"margin-right":"0.8rem"},on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]):t._e()])])]},proxy:!0},{key:"videoBox",fn:function(){return[e("div",[t._v("Content Test")])]},proxy:!0}])})],1)},YS=[],XS={components:{DxPopup:To["DxPopup"],DxSelectBox:Io["DxSelectBox"],ButtonIconFlat:Le,svgIcon:L},data:function(){return{firstSetStatus:!0,settings:!1,roundMode:!1,videoMediaDevieces:null,fullScreenMode:!1,streamLocal:null,constraints:{video:!0}}},computed:{getActiveVideoInput:function(){var t=this;if(this.videoMediaDevieces){var e=this.videoMediaDevieces.find((function(e){return e.deviceId===t.constraints.video.deviceId}));return e}}},methods:{hideFirstSet:function(){this.firstSetStatus=!1,this.settings=!0},setFullScreen:function(){this.fullScreenMode=!this.fullScreenMode},setRoundMode:function(){this.roundMode=!this.roundMode},hideSettings:function(){this.settings=!1},showSettingsBar:function(){this.settings=!0},closeModal:function(){this.$store.dispatch("modal/switchSelfieModal")},enumerateDevices:function(){var t=this;navigator.mediaDevices.enumerateDevices().then((function(e){t.videoMediaDevieces=e.filter((function(t){return"videoinput"===t.kind}))}))},addConstrains:function(t){t.value.deviceId&&(this.constraints.video={deviceId:t.value.deviceId},this.getMediaStream())},getMediaStream:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.mediaDevices.getUserMedia(t.constraints);case 3:t.streamLocal=e.sent,t.addMediaStreamToPlayer(),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),window.console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()},addMediaStreamToPlayer:function(){this.$refs.videoPlayer.srcObject=this.streamLocal,this.$refs.videoPlayer.muted=!0,this.$refs.videoPlayer.play()}},mounted:function(){this.enumerateDevices()},destroyed:function(){this.streamLocal&&this.streamLocal.getTracks().forEach((function(t){t.stop()}))}},QS=XS,JS=(i("5c9d"),Object(C["a"])(QS,zS,YS,!1,null,"0fd821f0",null)),KS=JS.exports,ZS=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamPlayer"},[e("DxPopup",{ref:"popup",attrs:{visible:!0,shading:!1,resizeEnabled:!0,titleTemplate:"dragZone",contentTemplate:"videoBox",fullScreen:t.fullScreenMode,copyRootClassesToWrapper:!0,width:"1280px",height:"720px",minWidth:"320px",minHeight:"240px"},scopedSlots:t._u([{key:"dragZone",fn:function(){return[e("div",{staticClass:"streamPlayer_wrap",on:{mouseleave:function(e){t.settings=!1}}},[e("div",{staticClass:"streamPlayer-content"},[e("div",{staticClass:"streamPlayer-video",on:{mouseenter:function(e){t.settings=!0}}},[e("video",{ref:"streamVideoPlayer",staticClass:"video-js",staticStyle:{width:"100%",height:"100%"}})]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.chatStatus&&!t.getChatStreamModal,expression:"chatStatus && !getChatStreamModal"}],staticClass:"streamPlayer-chatWindow"},[e("StreamChat")],1)]),e("div",{staticClass:"streamPlayer-setttingsWindow"},[t.settings?e("div",{staticClass:"streamPlayer-setttingsBar"},[e("div",{staticClass:"streamPlayer-setttingsBar_controls"},[e("div",{staticClass:"streamPlayer-setttingsBar_controls-item",on:{click:t.setFullScreen}},[e("svgIcon",{attrs:{name:"Expand",size:24}})],1),e("div",{staticClass:"streamPlayer-setttingsBar_controls-item",on:{click:t.showChat}},[e("svgIcon",{attrs:{name:t.chatStatus?"Chat":"ChatOFF"}})],1),e("div",{staticClass:"streamPlayer-setttingsBar_controls-item",on:{click:t.openChat}},[e("svgIcon",{attrs:{name:"Send_message"}})],1)]),e("div",{staticClass:"streamPlayer-setttingsBar_selectBox"}),e("div",{staticClass:"streamPlayer-setttingsBar_controls"},[e("div",{staticClass:"streamPlayer-setttingsBar_controls-item",staticStyle:{"margin-right":"0.8rem"},on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]):t._e()])])]},proxy:!0},{key:"videoBox",fn:function(){return[e("div",[t._v("Content Test")])]},proxy:!0}])})],1)},tP=[],eP=i("f0e2"),iP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamChat"},[e("DxPopup",{ref:"streamChat",attrs:{visible:t.getVisibleStreamChat,wrapperAttr:{class:"StreamChat StreamChat_".concat(t.getActiveTheme)},position:{my:"right bottom",at:"right bottom",of:"body",offset:{x:-4,y:-6}},shading:!1,width:"360px",height:"calc(100% - 60px)"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"StreamChat-title",on:{click:t.focusPopup}},t._l(t.getTabsStreams,(function(i,o){return e("div",{key:o,staticClass:"StreamChat-autorAvatar",class:t.activeIndexTab===o?"StreamChat-autorAvatar_isActive_".concat(t.getActiveTheme):"StreamChat-autorAvatar_".concat(t.getActiveTheme),on:{click:function(e){return t.setActiveTabStream(o)}}},[e("Avatar",{attrs:{src:i.avatarURL,theme:t.getActiveTheme,size:"2.7",color:i.isActive?t.getRedColor.color:t.getBlueColor.color}})],1)})),0)]},proxy:!0},{key:"content",fn:function(){return[e("div",{key:t.updateHistoryKey,staticClass:"StreamChat-content",class:"StreamChat-content_".concat(t.getActiveTheme)},[e("VuePerfectScrollbar",{staticClass:"StreamChat-wrapMessages",attrs:{id:"container"}},t._l(t.getHistory,(function(t,i){return e("StreamChatMessage",{key:i,attrs:{messageData:t}})})),1),e("div",{staticClass:"StreamChat-textArea"},[e("DxTextArea",{attrs:{height:"64px",minHeight:32,maxHeight:64,value:t.textMessage,onEnterKey:t.sendMessage,onInput:t.setTextMessage,placeholder:"Write message"}})],1)],1)]},proxy:!0}])})],1)},oP=[],nP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamChatMessage"},[t.messageData.isStreamer?e("div",{staticClass:"streamChatMessage-wrap"},[e("div",{staticClass:"streamChatMessage-title"},[e("div",{staticClass:"streamChatMessage-title-avatar"},[e("Avatar",{attrs:{size:"2.4",theme:t.getActiveTheme,src:t.messageData.avatarURL,color:t.getRedColor.color}})],1),e("div",{staticClass:"streamChatMessage-title-name",style:{color:t.getRedColor.color}},[t._v(t._s(t.getNameSender))]),e("div",{staticClass:"streamChatMessage-title-date",class:"streamChatMessage-title-date_".concat(t.getActiveTheme)},[t._v(t._s(t.getDate))])]),e("div",{staticClass:"streamChatMessage-messageText",class:"streamChatMessage-messageText_".concat(t.getActiveTheme),style:{background:t.getRedColor.fill}},[t._v(t._s(t.messageData.message))])]):t._e(),t.messageData.isStreamer||t.messageData.userId!==t.getUserDetail.id?t._e():e("div",{staticClass:"streamChatMessage-wrap"},[e("div",{staticClass:"streamChatMessage-title"},[e("div",{staticClass:"streamChatMessage-title-date",class:"streamChatMessage-title-date_".concat(t.getActiveTheme),style:{marginRight:"auto",marginLeft:0}},[t._v(t._s(t.getDate))]),e("div",{staticClass:"streamChatMessage-title-name",style:{color:t.getBlueColor.color}},[t._v(t._s(t.getNameSender))]),e("div",{staticClass:"streamChatMessage-title-avatar"},[e("Avatar",{attrs:{size:"2.4",theme:t.getActiveTheme,src:t.messageData.avatarURL,color:t.getBlueColor.color}})],1)]),e("div",{staticClass:"streamChatMessage-messageText",class:"streamChatMessage-messageText_".concat(t.getActiveTheme),style:{background:t.getBlueColor.fill}},[t._v(t._s(t.messageData.message))])]),t.messageData.isStreamer||t.messageData.userId===t.getUserDetail.id?t._e():e("div",{staticClass:"streamChatMessage-wrap"},[e("div",{staticClass:"streamChatMessage-title"},[e("div",{staticClass:"streamChatMessage-title-avatar"},[e("Avatar",{attrs:{size:"2.4",theme:t.getActiveTheme,src:t.messageData.avatarURL}})],1),e("div",{staticClass:"streamChatMessage-title-name",class:"streamChatMessage-title-name_".concat(t.getActiveTheme)},[t._v(t._s(t.getNameSender))]),e("div",{staticClass:"streamChatMessage-title-date",class:"streamChatMessage-title-date_".concat(t.getActiveTheme)},[t._v(t._s(t.getDate))])]),e("div",{staticClass:"streamChatMessage-messageText",class:"streamChatMessage-messageText_".concat(t.getActiveTheme)},[t._v(t._s(t.messageData.message))])])])},sP=[],rP={props:{messageData:{require:!0}},components:{Avatar:E},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserDetail:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getDate:function(){return(new Date).toLocaleString("ru")},getNameSender:function(){return this.messageData.senderFIO}})},aP=rP,cP=(i("7752"),Object(C["a"])(aP,nP,sP,!1,null,null,null)),lP=cP.exports,uP={components:{DxPopup:wt["DxPopup"],DxTextArea:wt["DxTextArea"],StreamChatMessage:lP,Avatar:E,VuePerfectScrollbar:Xt.a},mixins:[qe],data:function(){return{textMessage:"",messagesHistory:{},activeIndexTab:0,updateHistoryKey:(new Date).getTime()}},watch:{getTabsStreams:function(){this.activeIndexTab>this.getTabsStreams.length-1&&(this.activeIndexTab=0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveUserStream:"userStreams/getActiveUserStream",getActiveTheme:"headerSettings/getActiveTheme",getVisibleStreamChat:"userStreams/getVisibleStreamChat",getPlayersStreams:"userStreams/getPlayersStreams",getUserDetail:"user/getUserDetail"})),{},{getElementPopup:function(){return this.$refs.streamChat.instance},getActiveStream:function(){if(this.getTabsStreams&&this.getTabsStreams.length)return this.getTabsStreams[this.activeIndexTab]},getHistory:function(){if(this.getTabsStreams&&this.getTabsStreams.length)return this.getTabsStreams[this.activeIndexTab].messages},getTabsStreams:function(){var t=this;if(this.getPlayingStreamsUnicIds&&this.getPlayingStreamsUnicIds.length){var e=[];return this.getPlayingStreamsUnicIds.forEach((function(i){e.push(Object(c["a"])(Object(c["a"])({},t.getAllPlayingStreams.find((function(t){return t.streamId===i}))),{},{messages:[]}))})),e}},getAllPlayingStreams:function(){var t=this.getPlayersStreams.filter((function(t){return t.status}));if(t.length){var e=[];return t.forEach((function(t){t.streams.forEach((function(t){e.push(t)}))})),e}},getPlayingStreamsUnicIds:function(){if(this.getAllPlayingStreams&&this.getAllPlayingStreams.length)return Array.from(new Set(this.getAllPlayingStreams.map((function(t){return t.streamId}))))}}),methods:{setActiveTabStream:function(t){this.activeIndexTab=t},focusPopup:function(){var t=this.getElementPopup.option("animation");this.getElementPopup.option("animation",null),this.getElementPopup.hide(),this.getElementPopup.show(),this.getElementPopup.option("animation",t)},setMessageHendler:function(t){"ChatMessage"===t.command&&(this.getTabsStreams[this.activeIndexTab].messages.push(t.data),this.updateHistoryKey=(new Date).getTime(),this.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight})))},sendMessage:function(){this.textMessage&&(this.$socketStream.sendCommand({ws:"streamChatWS",command:{Command:"ChatMessage",StreamId:this.getActiveStream.streamId,Data:{SenderFIO:"".concat(this.getActiveStream.firstName," ").concat(this.getActiveStream.lastName),Message:this.textMessage,AvatarURL:this.getActiveStream.avatarURL,UserId:this.getUserDetail.id,IsStreamer:!1}}}),this.textMessage="")},setTextMessage:function(t){"insertLineBreak"!==t.event.inputType&&(this.textMessage=t.event.target.value)}},mounted:function(){this.$socketStream.events.subscribe("streamChatWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("streamChatWS",this.setMessageHendler)}},dP=uP,hP=(i("9499"),Object(C["a"])(dP,iP,oP,!1,null,"ce8da2d4",null)),pP=hP.exports,gP={components:{DxPopup:To["DxPopup"],svgIcon:L,StreamChat:pP},data:function(){return{player:null,settings:!1,chatStatus:!0,fullScreenMode:!1}},computed:Object(c["a"])({},Object(p["c"])({getStreamPlayer:"modal/getStreamPlayer",getChatStreamModal:"modal/getChatStreamModal"})),methods:{setFullScreen:function(){this.fullScreenMode=!this.fullScreenMode},showSettingsBar:function(){this.settings=!this.settings},showChat:function(){this.chatStatus=!this.chatStatus},openChat:function(){this.$store.dispatch("modal/switchChatStreamModal")},closeModal:function(){this.$store.dispatch("modal/switchStreamPlayer",{status:!1,data:""})},createPlayer:function(){this.player=Object(eP["a"])(this.$refs.streamVideoPlayer,{autoplay:!0,controls:!0,poster:this.getStreamPlayer.data.logoUrl,sources:[{src:this.getStreamPlayer.data.hlsUrl,type:"application/x-mpegURL"}]})}},mounted:function(){this.createPlayer()},beforeDestroy:function(){this.player&&this.player.dispose(),this.getChatStreamModal&&this.openChat()}},fP=gP,mP=(i("02a7"),Object(C["a"])(fP,ZS,tP,!1,null,null,null)),vP=mP.exports,yP=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:!0,width:"900",title:t.$t("loadIm"),modifier:"modal--reg modal--login"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticStyle:{display:"flex"}},[e("div",{staticClass:"img-container"},[e("img",{ref:"image",attrs:{src:t.getUploadImageModal.data.src,crossorigin:""}})]),e("div",{staticStyle:{"margin-left":"10px"}},[e("img",{ref:"cropImage",staticClass:"img-preview",style:t.getStyleForPrewiew,attrs:{src:t.destination}}),e("Button",{attrs:{disable:t.statusSaveButton,process:t.statusSaveButton,typeBtn:"primary"},on:{click:t.sentCroppedFile}},[t._v(t._s(t.$t("save")))]),t.msg?e("div",{staticClass:"msg",class:t.getErrorCssClass,on:{click:t.sentCroppedFile}},[e("svgIcon",{attrs:{name:t.getErrorIcon}}),t._v(t._s(t.msg))],1):t._e()],1)])]},proxy:!0}])})},CP=[],bP=i("bab4"),SP=i.n(bP),PP={components:{Modal:Oe,Button:Pa,svgIcon:L},data:function(){return{cropper:{},destination:{},blobFile:null,image:{},msg:"",statusSaveButton:!1,errorUpload:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getApiUri:"api/api",getUser:"user/getUserDetail",getUploadImageModal:"modal/getUploadImageModal"})),{},{getErrorIcon:function(){return this.errorUpload?"Warning":"Check"},getErrorCssClass:function(){return this.errorUpload?"text-error":"text-success"},getStyleForPrewiew:function(){return"user-profile-background"===this.getUploadImageModal.data.mode?{width:"300px",height:"201px"}:"stream-logo"===this.getUploadImageModal.data.mode?{width:"320px",height:"180px"}:{width:this.getUploadImageModal.data.cropFactor.width<200?"".concat(1.5*this.getUploadImageModal.data.cropFactor.width,"px"):"".concat(this.getUploadImageModal.data.cropFactor.width,"px"),height:this.getUploadImageModal.data.cropFactor.height<200?"".concat(1.5*this.getUploadImageModal.data.cropFactor.height,"px"):"".concat(this.getUploadImageModal.data.cropFactor.height,"px")}}}),methods:{close:function(){this.$store.dispatch("modal/switchUploadImageModal",null)},sentCroppedFile:function(){var t=this;if(this.blobFile){this.statusSaveButton=!0;var e=new File([this.blobFile],this.getUploadImageModal.data.nameParam+("image/png"===this.getUploadImageModal.data.format?".png":".jpeg"),{type:this.getUploadImageModal.data.format,lastModified:Date.now()}),i=new FormData;i.append("file",e);var o={method:"POST",url:"".concat(this.getApiUri,"Image/item"),headers:{"Content-Type":"multipart/form-data","X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.singFP},data:i};this.$http(o).then(Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.getUploadImageModal.data.mode,"stream-logo"===i&&(o="".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/").concat(t.getUploadImageModal.data.nameParam).concat("image/png"===t.getUploadImageModal.data.format?".png":".jpeg"),t.$store.commit("modal/setRedyLinkToUploadImageModal",o)),"user-profile-background"!==i){e.next=6;break}return n="".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/").concat(t.getUploadImageModal.data.nameParam).concat("image/png"===t.getUploadImageModal.data.format?".png":".jpeg"),e.next=6,t.$store.dispatch("user/setCustomData",{field:"imageUserProfile",data:n});case 6:"header-button"===i&&t.$store.dispatch("headerSettings/redactSettings",{mutation:"setNewOptionsForButton",data:{param:"avatarSrc",data:"".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/").concat(t.getUploadImageModal.data.nameParam).concat("image/png"===t.getUploadImageModal.data.format?".png":".jpeg"),btn:t.getUploadImageModal.data.nameBtn}}),"logo"===i&&t.$store.dispatch("headerSettings/redactSettings",{mutation:"setLogoMode",data:{index:3,data:{mode:"image",data:"".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/").concat(t.getUploadImageModal.data.nameParam).concat("image/png"===t.getUploadImageModal.data.format?".png":".jpeg"),active:!0,textList:"Мой логотип"}}}),"chartTopBar-screen"===i&&t.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setAvatarForScreenTopBar",data:{data:"".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/").concat(t.getUploadImageModal.data.nameParam).concat("image/png"===t.getUploadImageModal.data.format?".png":".jpeg"),index:t.getUploadImageModal.data.indexScreen}}),t.statusSaveButton=!0,setTimeout((function(){t.close()}),1500);case 11:case"end":return e.stop()}}),e)})))).catch((function(){t.msg="Ошибка Загрузки попробуйте ещё раз!",t.statusSaveButton=!1,t.errorUpload=!0}))}}},mounted:function(){var t=this;this.image=this.$refs.image,this.cropper=new SP.a(this.image,{viewMode:2,zoomable:!0,scalable:!0,aspectRatio:this.getUploadImageModal.data.ratio,crop:function(){var e,i,o=t.cropper.getCroppedCanvas(null===(e=t.getUploadImageModal.data)||void 0===e?void 0:e.cropFactor);t.destination=o.toDataURL("image/png"),o.toBlob((function(e){t.blobFile=e}),null===(i=t.getUploadImageModal.data)||void 0===i?void 0:i.format,.7)}})}},TP=PP,xP=(i("6f536"),Object(C["a"])(TP,yP,CP,!1,null,null,null)),OP=xP.exports,wP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamChatModal"},[e("DxPopup",{attrs:{visible:!0,shading:!1,width:"360px",resizeEnabled:!0,height:"720px",titleTemplate:"titleModal"},scopedSlots:t._u([{key:"titleModal",fn:function(){return[e("div",{staticClass:"streamChatModal_wrap"},[e("StreamChat")],1)]},proxy:!0}])})],1)},_P=[],AP={components:{DxPopup:xo.a,StreamChat:pP}},DP=AP,kP=(i("0d53"),Object(C["a"])(DP,wP,_P,!1,null,null,null)),IP=kP.exports,BP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfileNotifications",class:t.darkClass},[e("header",[e("h3",[t._v(t._s(t.$t("notifications")))]),e("ButtonIconFlat",{staticClass:"buttonCustom readAll",attrs:{icon:t.getIconData("ReadAll")},on:{toggle:t.readAll}}),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.getIconData("Close")},on:{toggle:function(e){return t.switchNotifications(!1)}}})],1),e("div",{staticClass:"buttonsBlock"},[e("ButtonGroup",{attrs:{buttons:t.buttonsEvents,active:t.activeComponent},on:{clickHandler:t.selectingSection}})],1),e("div",{ref:"section",staticClass:"section"},[e("transition",{attrs:{name:"fade-slide",mode:"out-in"}},[e(t.activeComponent,t._b({tag:"component"},"component",t.propsData[t.activeComponent],!1))],1)],1)])},MP=[],$P=(i("8ba4"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"button-group",class:t.buttonGroupClass},t._l(t.buttons,(function(i){return e("button",{key:i.id,staticClass:"oneButtonGroup",class:{active:i.id===t.active},on:{click:function(e){return t.buttonHandler(i)}}},[i.countUnread>0?e("span",{staticClass:"unread",attrs:{title:i.countUnread}},[e("span",{staticClass:"text"},[t._v(t._s(i.countUnread))])]):t._e(),i.title?e("span",[t._v(t._s(i.title))]):t._e(),Number.isInteger(i.count)?e("span",[t._v(" ("+t._s(i.count)+")")]):t._e(),i.icon?e("svgIcon",{attrs:{name:i.icon,color:t.getColorIcon}}):t._e()],1)})),0)}),LP=[],FP={name:"ButtonGroup",mixins:[xt],props:{buttons:{type:Array,require:!0},hidden:{type:Boolean,default:!1},active:{type:String}},computed:{buttonGroupClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{hidden:this.hidden})}},methods:{buttonHandler:function(t){this.$emit("clickHandler",t)}}},jP=FP,RP=(i("52c2"),Object(C["a"])(jP,$P,LP,!1,null,"44ce5a66",null)),WP=RP.exports,NP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Transactions",class:t.darkClass},[t.isLoading?e("div",{staticClass:"Transactions-loader"},[e("DxLoadIndicator",{attrs:{width:"54px",height:"54px"}})],1):e("Accordion",{attrs:{collapsible:!0,firstHeight:!0,heightWatcher:t.maxHeightOrders,"data-source":t.arrayForAccordion,openIndex:t.openIndex,time:500},on:{setAccordionIndex:t.setAccordionIndex},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"headerBlock"},[e("div",{staticClass:"titleCount"},[e("span",{staticClass:"title"},[t._v(t._s(o.title))]),e("span",{staticClass:"count"},[t._v(t._s(o.count))])])])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"ordersContainer",style:{"--maxHeight":t.maxHeightOrders}},[e("OrdersContainer",{attrs:{prefix:"_noti",orders:o.orders}})],1)]}}])})],1)},EP=[],UP=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"accordionComponent",class:t.darkClass,style:t.styleForContainer},t._l(t.dataSource,(function(i,o){return e("div",{key:(null===i||void 0===i?void 0:i.id)||o,staticClass:"sectionAccordion",class:t.accordionIndex===o?"opened":""},[e("div",{staticClass:"headerAccordion",class:{active:t.openIndex===o},on:{click:function(e){return t.clickHandler(e,o)}}},[t._t("title",(function(){return[e("div",{staticClass:"slotHeader"},[t._v(t._s(i.title))])]}),{data:i,index:o}),t.isArrow?e("svgIcon",{attrs:{name:"Arrow-expand-bottom",color:t.getColorIcon}}):t._e()],2),e("div",{staticClass:"bodyAccordion",style:{height:t.openIndex===o?"auto":(null===i||void 0===i?void 0:i.firstHeight)+"px"}},[t._t("item",(function(){return t._l(i.list,(function(i,o){return e("div",{key:o,staticClass:"slotItem"},[t._v(t._s(i))])}))}),{data:i,index:o})],2)])})),0)},VP=[],HP={name:"Accordion",mixins:[xt],props:{dataSource:{type:Array,default:function(){return[]}},time:{type:Number,default:500},isArrow:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},heightWatcher:{type:String,default:"0"},collapsibleAll:{type:Boolean,default:!1},firstHeight:{type:Boolean,default:!1},selectorHeight:{type:String,default:""},accordionIndex:{type:Number,default:-1},openIndex:{type:Number,default:-1}},data:function(){return{firstClick:!1}},computed:{styleForContainer:function(){return{"--time":this.time+"ms"}}},watch:{heightWatcher:function(){var t=this.$refs.container,e=t.querySelector(".headerAccordion.active + .bodyAccordion");e&&(e.style.height="auto")}},methods:{clickHandler:function(t,e){var i=this.$refs.container,o=i.querySelector(".active + .bodyAccordion"),n=t.currentTarget,s=n.nextElementSibling,r=n.classList.contains("active");if(!r||this.collapsible||this.collapsibleAll){var a=i.querySelectorAll(".headerAccordion");this.collapsibleAll||a.forEach((function(t){t!==n&&t.classList.remove("active")})),r&&(this.collapsible||this.collapsibleAll)?(n.classList.remove("active"),this.$emit("setAccordionIndex",-1)):(n.classList.add("active"),this.$emit("setAccordionIndex",e));var c=i.querySelectorAll(".headerAccordion:not(.active) + .bodyAccordion"),l=null,u=this;window.requestAnimationFrame((function t(e){l||(l=e);var i=e-l;if(u.collapsibleAll?u.collapsibleAllOpenCloseHandler({el:s,progress:i,isActiveTarget:r}):u.openCloseHandler({el:s,progress:i,otherEl:c,alreadyActiveEl:o}),it.scrollHeight&&(n=t.scrollHeight)):n>t.scrollHeight&&(n=t.scrollHeight)}else t.style.height=t.scrollHeight+"px"},close:function(t,e){var i=this;t.forEach((function(t){if(t&&0!==t.getBoundingClientRect().height)if(0!==i.time){var o=+t.dataset.firstHeight,n=o||t.scrollHeight,s=n-e/i.time*n;t.style.height=(s<.5?0:s)+"px"}else t.style.height="0px"}))},openCloseHandler:function(t){var e=t.otherEl,i=t.el,o=t.progress,n=t.alreadyActiveEl;e.length!==this.dataSource.length&&this.open(i,o);var s=!this.firstHeight||this.firstClick?[n]:e;this.close(s,o)},collapsibleAllOpenCloseHandler:function(t){var e=t.el,i=t.progress,o=t.isActiveTarget;o?this.close([e],i):this.open(e,i)}}},GP=HP,qP=(i("4a29"),Object(C["a"])(GP,UP,VP,!1,null,"2bd52330",null)),zP=qP.exports,YP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrdersContainer",class:t.darkClass},[e("RecycleScroller",{ref:"scroller",staticClass:"scroller",attrs:{items:t.orders,buffer:200,"page-mode":!1,"key-field":"id","size-field":"height"},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.item;return[e(o.typeOrder,{key:o.id,tag:"component",attrs:{order:o,whereIs:t.whereIs,prefix:t.prefix},on:{openModalGraph:t.openModalGraph}})]}}])}),e("PopupGraph",{attrs:{positionPopup:t.positionPopup,"popup-visible":t.popupVisibleGraph,orderObject:t.orderObject},on:{hidden:t.closePopupGraph,close:t.closePopupGraph}})],1)},XP=[],QP=i("e508"),JP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ClosedOrder",class:t.readClass,on:{click:t.closeNotification,mouseenter:function(e){return t.hoverOrderOnChart("show")},mouseleave:function(e){return t.hoverOrderOnChart(null)}}},[!t.order.sceleton&&t.errorMessage?[e("svgIcon",{attrs:{name:"Alarm_red",color:t.getColor}}),e("div",{staticClass:"text"},[t._v("Ордер "+t._s(t.contract)+": "+t._s(t.errorMessage))])]:t.order.sceleton||t.errorMessage?e("Sceleton",{attrs:{width:"100%",height:"100%"}}):[e("div",{staticClass:"ClosedOrder-wrap"},[e("div",{staticClass:"ClosedOrder-infoSide"},[e("div",{staticClass:"ClosedOrder-avatar",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler,click:t.goToProfile}},[e("Avatar",{attrs:{size:"4.2",src:t.srcUser,theme:t.getActiveTheme}})],1),e("div",{staticClass:"ClosedOrder-info"},[e("div",{staticClass:"ClosedOrder-info-from",class:"ClosedOrder-info-from_".concat(t.getActiveTheme)},[t._v(t._s(t.nameSource))]),e("div",{staticClass:"ClosedOrder-info-common"},[e("div",{staticClass:"ClosedOrder-info-type"},[t._v("Closed order")]),e("div",{staticClass:"ClosedOrder-info-contract",class:"ClosedOrder-info-contract_".concat(t.getActiveTheme)},[t._v(t._s(t.contract))])]),e("div",{staticClass:"ClosedOrder-info-detail",style:{color:"Sell"===t.side?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Sell"===t.side?"Arrow_down_direct":"Arrow_up_direct",size:12}}),e("span",[t._v(t._s("".concat(t.side.toUpperCase()," ").concat(t.numberVolume)))])],1)])]),e("div",{staticClass:"ClosedOrder-plSide",class:"ClosedOrder-plSide_".concat(t.getActiveTheme)},[e("div",{staticClass:"ClosedOrder-plMain"},[e("div",{staticClass:"ClosedOrder-plMain-text",class:"ClosedOrder-plMain-text_".concat(t.getActiveTheme)},[t._v("P/L")]),e("div",{staticClass:"ClosedOrder-plMain-data",style:{color:t.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCryptoStatus?"₮":"$"," ").concat(t.$moneyf(t.profit,t.getCryptoStatus?4:2))))])]),e("div",{staticClass:"ClosedOrder-plDetail"},[e("div",{staticClass:"ClosedOrder-plDetail-percent",style:{color:t.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(t.getPercent)+"%")])])])])]],2)},KP=[],ZP=function(){var t=this,e=t._self._c;return e("div",{staticClass:"skeleton-box",class:t.getClass,style:t.getStyle})},tT=[],eT={name:"Sceleton",props:{variant:{type:String,default:"text",validator:function(t){return["text","circular","rectangular"].includes(t)}},width:{type:[Number,String],default:null},height:{type:[Number,String],default:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getClass:function(){return[this.variant,this.darkClass]},getWidth:function(){return"string"===typeof this.width?this.width:this.width+"px"},getHeight:function(){return"string"===typeof this.height?this.height:this.height+"px"},getStyle:function(){return{width:this.getWidth,height:this.getHeight}}})},iT=eT,oT=(i("05c4"),Object(C["a"])(iT,ZP,tT,!1,null,"03b6cd6f",null)),nT=oT.exports,sT=(i("4ec9"),{computed:{errorStatus:function(){return new Map([["UnexpectedError",this.$t("ucee")],["SyncError",this.$t("ucee")],["InvalidOperation",this.$t("invalid_operation")],["OperationIsCanceled",this.$t("npoaes")],["InsufficientEquity",this.$t("ifitatpto")],["NotAuthorized",this.$t("uina")],["InsufficientRights",this.$t("nerteto")],["ServiceUpdateFailed",this.$t("sufdtae")],["ServiceProcessingStopTimeout",this.$t("tfcasc")],["TradingAccountSaveFailed",this.$t("sttaf")],["CommandProcessingFailed",this.$t("command_processing_error")],["NotFound",this.$t("nmowf")],["NoActionRequired",this.$t("tinntpaa")],["NotImplemented",this.$t("not_implemented")],["ContractIsNotAllowed",this.$t("tbcip")],["NoPrice",this.$t("no_price")],["WorsePrice",this.$t("tpiwtr")],["NoDealerFound",this.$t("ndtptr")],["DealerIsDisabled",this.$t("dealer_disconnected")],["BelowMinVolume",this.$t("tvbmav")],["AboveMaxVolume",this.$t("tvgtmva")],["VolumeHasWrongStep",this.$t("tvinabs")],["ContractNotFound",this.$t("sotcnf")],["SLToCloseToMarket",this.$t("sitcttm")],["TPToCloseToMarket",this.$t("titctm")],["ProcessingIsForwarded",this.$t("rpirf")],["OutOfTradingSession",this.$t("non_trade_hours")],["DealerRejectedOrder",this.$t("tddnato")],["InvalidLifePeriodForPendingOrder",this.$t("tspotpolinv")],["PriceGap",this.$t("ecooiidtpg")],["PriceOutOfBounds",this.$t("tpiotc")],["QuoteNotFound",this.$t("qinf")],["PartiallyExecution",this.$t("ecosowpe")],["ShardStopped",this.$t("ttraroass")],["ConcurrencyException",this.$t("eosdafmtdhb")],["AccountNotFound",this.$t("trtawnfits")],["AssetWalletNotFound",this.$t("trewwnf")],["OperationRestrictedByGroup",this.$t("roipftcgc")],["BadRequest",this.$t("trifi")],["Overload",this.$t("tmrpm")],["ToManyTrades",this.$t("too_many_orders")],["NeedSMSEnter",this.$t("sms_confirmation_required")],["SMSCodeError",this.$t("csinc")],["AccountIsActiveAndAssigned",this.$t("taiaaaa")],["NeedAssignAccount",this.$t("ahtbltea")],["OrderProcessingIsAlreadyRunning",this.$t("toibplacbma")],["ToManyOpenOrders",this.$t("tmoo")],["ToManyPendigOrders",this.$t("tmpo")],["NoBrokerFound",this.$t("nbwtiwf")],["BrokerUserNotFound",this.$t("nuftbaawf")]])}}}),rT={inject:{setVisibleTooltipOrder:{default:function(){}}},methods:{mouseEnterFunction:function(t,e){var i=t.target.getBoundingClientRect(),o=i.top,n=i.left,s=i.right,r=Object(c["a"])(Object(c["a"])({},e),{},{coordinate:{top:o,left:n,right:s}});localStorage.setItem("dataExpertTooltip",JSON.stringify(r)),this.setVisibleTooltipOrder(!0)},mouseLeaveFunction:function(){this.setVisibleTooltipOrder(!1)},goingToProfile:function(t){localStorage.setItem("clickedNewTab","true"),"tooltip"===t&&this.$emit("mouseMoveTooltip",!1),this.setVisibleTooltipOrder(!1)}}},aT={name:"ClosedOrder",mixins:[xt,sT,rT,qe],props:{order:{type:Object},notification:{type:Boolean,default:!1},whereIs:{type:String},prefix:{type:String}},components:{DxButton:cc.a,Sceleton:nT,Avatar:E},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession"})),{},{data:function(){return this.order.data},errorMessage:function(){var t;return this.errorStatus.get(null===(t=this.data)||void 0===t?void 0:t.Status)},getColor:function(){return this.darkClass.dark?"#fa4c4a":"#E91212"},sourceOrder:function(){var t;return"sourceorder"===(null===(t=this.data)||void 0===t?void 0:t.Type)},nameSource:function(){if(this.order.userName)return this.order.userName;var t=this.order.sourceUserInfo,e=this.order.userInfo;return this.sourceOrder?"".concat(t.firstName||""," ").concat(t.lastName||""):"".concat(e.firstName||""," ").concat(e.lastName||"")},imageForSource:function(){var t,e;return this.order.avatarURL?this.order.avatarURL:this.order.userAvatarURL?this.order.userAvatarURL:(null===(t=this.order.sourceUserInfo)||void 0===t?void 0:t.avatarURL)||(null===(e=this.order.userInfo)||void 0===e?void 0:e.avatarURL)},srcUser:function(){return this.imageForSource},side:function(){var t;return(null===(t=this.data)||void 0===t?void 0:t.Side)||this.data.SourceOrder.OrderType},getColorClass:function(){return"Sell"===this.side?["red"]:["green"]},getColorValue:function(){return function(t){return t>=0?["green"]:["red"]}},colorIcon:function(){var t=this.darkClass.dark?"#fa4c4a":"#E91212",e=this.darkClass.dark?"#00ffac":"#008E72";return this.profit>=0?e:t},volume:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.Volume)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.Volume)},contract:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.Contract)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.Symbol)},numberVolume:function(){return Lm(this.volume)},dateCreated:function(){var t,e,i=(null===(t=this.data)||void 0===t?void 0:t.CreatedOrderDTUTC)||"".concat(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.CreatedDate,"Z");return i?new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(i)):null},dateClosed:function(){var t=this.order.createdDateTime;return t?(t=t.includes("Z")?t:t+"Z",new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t))):null},openPrice:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.Price)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.OpenPrice)},openPriceFormatted:function(){return Lm(this.openPrice,5)},closedPrice:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.ClosePrice)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.ClosePrice)},closedPriceFormatted:function(){return Lm(this.closedPrice,5)},sequenceId:function(){var t;return(null===(t=this.data)||void 0===t?void 0:t.SequenceId)||this.data.SourceOrder.Position},getSl:function(){var t,e,i;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.Sl)&&void 0!==t?t:null===(i=this.data.SourceOrder)||void 0===i?void 0:i.StopLoss},getTp:function(){var t,e,i;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.Tp)&&void 0!==t?t:null===(i=this.data.SourceOrder)||void 0===i?void 0:i.TakeProfit},profit:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.Profit)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.Profit)},getPercent:function(){var t;if(this.getCryptoStatus){var e=this.volume*this.openPrice;t=100*this.profit/e}else t=100*this.profit/this.volume;return Lm(t,2,!0)},getContractBySymbol:function(){var t=this;return(this.getContracts||[]).find((function(e){return e.name===t.contract}))},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getContractBySymbol)||void 0===t?void 0:t.executionGroup)},getPrecision:function(){var t;return null===(t=this.getContractBySymbol)||void 0===t?void 0:t.precision},getPip:function(){var t=this;if(this.order.sceleton)return null;var e=this.getPrecision,i={Buy:function(){return Math.round(+(t.closedPrice-t.openPrice).toFixed(e)*Ph(t.getPrecision))},Sell:function(){return Math.round(+(t.openPrice-t.closedPrice).toFixed(e)*Ph(t.getPrecision))}};return i[this.side]()},readClass:function(){var t;return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{noRead:null===(null===(t=this.order)||void 0===t?void 0:t.readedDateTime)&&!this.notification,notification:this.notification,sourceOrder:this.sourceOrder,errorMessage:this.errorMessage})},classGraph:function(){var t,e;return"graph".concat(this.prefix,"-").concat((null===(t=this.data)||void 0===t?void 0:t.OrderId)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.Id))},classForAvatar:function(){return["sourceOrderImg",{clicked:this.whereIs}]}}),methods:{hoverOrderOnChart:function(t){var e=this.order.data.Contract,i=this.order.data.OrderId;this.getSession&&Zh.emit("hoverClosedOrder",{symbol:e,id:t?i:t})},openModalGraph:function(t,e){t.stopPropagation();var i={},o=t.target.getBoundingClientRect(),n=o.top,s=o.bottom,r=document.documentElement.clientHeight;i=r-s<200?{at:"left",my:"right bottom"}:n<200?{at:"left",my:"right top"}:{at:"left",my:"right"},this.$emit("openModalGraph",{positionPopup:i,order:e})},closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)},mouseenterHandler:function(t){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.mouseEnterFunction(t,{imageForSource:this.imageForSource,nameSource:this.nameSource,numberVolume:this.numberVolume,side:this.side,getColorClass:this.getColorClass,accountId:this.order.accountId,contractName:this.contract,locationCall:"ProfileOrdersRightBar"===this.whereIs?"portfolio":null,noActiveButton:"ProfileOrdersRightBar"===this.whereIs})},mouseleaveHandler:function(){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.mouseLeaveFunction()},goToProfile:function(){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.goingToProfile(this.order.accountId)}}},cT=aT,lT=(i("7053"),Object(C["a"])(cT,JP,KP,!1,null,"1eadc36b",null)),uT=lT.exports,dT=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OpenOrder",class:t.readClass,on:{click:t.closeNotification,mouseenter:function(e){return t.hoverOrderOnChart("show")},mouseleave:function(e){return t.hoverOrderOnChart(null)}}},[!t.order.sceleton&&t.errorMessage?[e("svgIcon",{attrs:{name:"Alarm_red",color:t.getColor}}),e("div",{staticClass:"text"},[t._v("Ордер "+t._s(t.contractName)+": "+t._s(t.errorMessage))])]:t.order.sceleton||t.errorMessage?e("Sceleton",{attrs:{height:"100%",width:"100%"}}):[e("div",{staticClass:"OpenOrder-wrap"},[e("div",{staticClass:"OpenOrder-infoSide"},[e("div",{staticClass:"OpenOrder-avatar",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler,click:t.goToProfile}},[e("Avatar",{attrs:{size:"4.2",src:t.srcUser,theme:t.getActiveTheme}})],1),e("div",{staticClass:"OpenOrder-info"},[e("div",{staticClass:"OpenOrder-info-from",class:"OpenOrder-info-from_".concat(t.getActiveTheme)},[t._v(t._s(t.nameSource))]),e("div",{staticClass:"OpenOrder-info-common"},[e("div",{staticClass:"OpenOrder-info-type",class:"OpenOrder-info-type_".concat(t.getActiveTheme),style:{background:"Sell"===t.side?t.getRedColor.color:t.getGreenColor.color}},[t._v("Open order")]),e("div",{staticClass:"OpenOrder-info-contract",class:"OpenOrder-info-contract_".concat(t.getActiveTheme)},[t._v(t._s(t.contractName))])]),e("div",{staticClass:"OpenOrder-info-date",class:"OpenOrder-info-date_".concat(t.getActiveTheme)},[t._v(t._s(t.dateCreated))])])]),e("div",{staticClass:"OpenOrder-detailSide",class:"OpenOrder-detailSide_".concat(t.getActiveTheme)},[e("div",{staticClass:"OpenOrder-detailSide-mainInfo",style:{color:"Sell"===t.side?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Sell"===t.side?"Arrow_down_direct":"Arrow_up_direct",size:16}}),e("span",[t._v(t._s("".concat(t.side.toUpperCase()," ").concat(t.openPrice)))])],1),e("div",{staticClass:"OpenOrder-detailSide-volume"},[e("div",{staticClass:"OpenOrder-detailSide-volume-text",class:"OpenOrder-detailSide-volume-text_".concat(t.getActiveTheme)},[t._v("Vol.")]),e("div",{staticClass:"OpenOrder-detailSide-volume-data",style:{color:"Sell"===t.side?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(t.numberVolume))])])])])]],2)},hT=[],pT={name:"OpenOrder",mixins:[xt,sT,rT,qe],props:{order:{type:Object},notification:{type:Boolean,default:!1},whereIs:{type:String}},components:{Sceleton:nT,Avatar:E},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getCatalogs:"quotesCatalogs/getCatalogs",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts"})),{},{data:function(){return this.order.data},errorMessage:function(){return this.errorStatus.get(this.data.Status)},getColor:function(){return this.darkClass.dark?"#fa4c4a":"#E91212"},sourceOrder:function(){var t;return"sourceorder"===(null===(t=this.data)||void 0===t?void 0:t.Type)},nameSource:function(){if(this.order.userName)return this.order.userName;var t=this.order.sourceUserInfo,e=this.order.userInfo;return this.sourceOrder?"".concat(t.firstName||""," ").concat(t.lastName||""):"".concat(e.firstName||""," ").concat(e.lastName||"")},imageForSource:function(){var t,e;return this.order.avatarURL?this.order.avatarURL:this.order.userAvatarURL?this.order.userAvatarURL:(null===(t=this.order.sourceUserInfo)||void 0===t?void 0:t.avatarURL)||(null===(e=this.order.userInfo)||void 0===e?void 0:e.avatarURL)},srcUser:function(){return this.imageForSource},textOrder:function(){var t="MarketOrderModified"===this.data.NotificationType,e="modify"===this.data.Action;return t||e?"Change order":"Open order"},contractName:function(){var t;return(null===(t=this.data)||void 0===t?void 0:t.Contract)||this.data.SourceOrder.Symbol},sequenceId:function(){var t;return(null===(t=this.data)||void 0===t?void 0:t.SequenceId)||this.data.SourceOrder.Position},getSl:function(){var t,e,i;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.Sl)&&void 0!==t?t:null===(i=this.data.SourceOrder)||void 0===i?void 0:i.StopLoss},getTp:function(){var t,e,i;return null!==(t=null===(e=this.data)||void 0===e?void 0:e.Tp)&&void 0!==t?t:null===(i=this.data.SourceOrder)||void 0===i?void 0:i.TakeProfit},side:function(){var t;return(null===(t=this.data)||void 0===t?void 0:t.Side)||this.data.SourceOrder.OrderType},getColorClass:function(){return"Sell"===this.side?["red"]:["green"]},getColorNameOrder:function(){var t="MarketOrderModified"===this.data.NotificationType,e="modify"===this.data.Action;return t||e?["violet"]:this.getColorClass},quotes:function(){var t,e=this;return null!==(t=this.getCatalogs)&&void 0!==t&&t["Crypto"]?this.getCatalogs["Crypto"].find((function(t){return t.s===e.contractName})):{}},isCrypto:function(){return!!this.quotes},numberVolume:function(){var t,e,i=null!==(t=null===(e=this.data)||void 0===e?void 0:e.Volume)&&void 0!==t?t:this.data.SourceOrder.Volume;if(this.isCrypto){var o=i*this.order.data.Price;return o<.01&&(o=.01),"".concat(i," (₮").concat(this.$moneyf(o),")")}return"$ "+Lm(i,5,!0)},dateCreated:function(){var t,e=(null===(t=this.data)||void 0===t?void 0:t.CreatedOrderDTUTC)||this.order.createdDateTime;return e?new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):null},openPrice:function(){var t,e,i;return Lm(null!==(t=null===(e=this.data)||void 0===e?void 0:e.Price)&&void 0!==t?t:null===(i=this.data)||void 0===i?void 0:i.SourceOrder.OpenPrice,5)},readClass:function(){var t;return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{noRead:null===(null===(t=this.order)||void 0===t?void 0:t.readedDateTime)&&!this.notification,notification:this.notification,sourceOrder:this.sourceOrder})},classForAvatar:function(){return["sourceOrderImg",{clicked:this.whereIs}]}}),methods:{hoverOrderOnChart:function(t){if(this.getSession){var e=this.order.data.Contract,i=this.order.data.OrderId;Zh.emit("hoverOpenOrder",{symbol:e,id:t?i:t})}},closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)},mouseenterHandler:function(t){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.mouseEnterFunction(t,{imageForSource:this.imageForSource,nameSource:this.nameSource,numberVolume:this.numberVolume,side:this.side,getColorClass:this.getColorClass,accountId:this.order.accountId,contractName:this.contractName,locationCall:"ProfileOrdersRightBar"===this.whereIs?"portfolio":null,noActiveButton:"ProfileOrdersRightBar"===this.whereIs})},mouseleaveHandler:function(){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.mouseLeaveFunction()},goToProfile:function(){["ProfileOrdersRightBar","TradingStreamOrders"].includes(this.whereIs)&&this.goingToProfile(this.order.accountId)}}},gT=pT,fT=(i("e6aa"),Object(C["a"])(gT,dT,hT,!1,null,"aaf2f26e",null)),mT=fT.exports,vT=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PendingOrder",class:t.readClass,on:{click:t.closeNotification,mouseenter:function(e){return t.hoverOrderOnChart("show")},mouseleave:function(e){return t.hoverOrderOnChart(null)}}},[t.order.sceleton?e("Sceleton",{attrs:{width:"100%",height:"100%"}}):[e("svgIcon",{attrs:{name:t.getName,color:t.getColor}}),e("div",{staticClass:"contentPart"},[e("div",{staticClass:"dateText"},[t._v(t._s(t.dateCreated))]),e("div",{staticClass:"text"},[t._v(t._s(t.getText))])])]],2)},yT=[],CT={name:"PendingOrder",mixins:[xt,sT],props:{order:{type:Object},notification:{type:Boolean,default:!1}},components:{Sceleton:nT},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession"})),{},{getColor:function(){var t,e=this.darkClass.dark?"#fa4c4a":"#E91212",i=this.darkClass.dark?"#00ffac":"#008E72",o=this.darkClass.dark?"#00b9fc":"#2462db",n=null===(t=this.order.data)||void 0===t?void 0:t.NotificationType;return this.errorStatus.get(this.order.data.Status)||"PendingOrderClosed"===n?e:"PendingOrderModified"===n?o:i},getName:function(){var t,e=null===(t=this.order.data)||void 0===t?void 0:t.NotificationType;return this.errorStatus.get(this.order.data.Status)||"PendingOrderClosed"===e?"Alarm_red":"Infosmall"},getText:function(){var t,e,i;if(this.errorStatus.get(this.order.data.Status))return this.errorStatus.get(this.order.data.Status);var o=null===(t=this.order.data)||void 0===t?void 0:t.Contract;return"PendingOrderPlaced"===(null===(e=this.order.data)||void 0===e?void 0:e.NotificationType)?"Вы разместили лимитный ордер по паре ".concat(o):"PendingOrderModified"===(null===(i=this.order.data)||void 0===i?void 0:i.NotificationType)?"Изменение лимитного ордера по паре ".concat(o):"Вы закрыли лимитный ордер по паре ".concat(o)},dateCreated:function(){var t,e=null===(t=this.order)||void 0===t?void 0:t.createdDateTime;return e?new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):null},readClass:function(){var t;return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{noRead:null===(null===(t=this.order)||void 0===t?void 0:t.readedDateTime)&&!this.notification,notification:this.notification})}}),methods:{hoverOrderOnChart:function(t){var e;if(this.getSession&&(null===(e=this.getDefaultAccount)||void 0===e?void 0:e.id)===this.order.data.AccountId){var i=this.order.data.Contract,o=this.order.data.OrderId;Zh.emit("hoverPendingOrder",{symbol:i,id:t?o:t})}},closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)}}},bT=CT,ST=(i("e05f"),Object(C["a"])(bT,vT,yT,!1,null,"32e0bfa6",null)),PT=ST.exports,TT=function(){var t=this,e=t._self._c;return e("DxPopup",{attrs:{visible:t.popupVisible,"drag-enabled":!0,"close-on-outside-click":!0,"show-close-button":!0,"show-title":!0,wrapperAttr:{class:"popupGraph"},width:"573",height:"365",shadingColor:"transparent","title-template":"header",onHidden:t.onHidden},on:{hidden:function(e){return t.$emit("hidden")}},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"headerPopup",class:t.darkClass},[t._v(t._s(t.getTitleHeader)),e("span",{staticClass:"closeButton",on:{click:function(e){return t.$emit("close")}}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0}])},[e("DxPosition",{attrs:{at:t.positionPopup.at,my:t.positionPopup.my,of:t.bindingСlass}}),e("div",{staticClass:"wrapper",class:t.darkClass},[e("div",{staticClass:"orderStatisticChart"},[t.isLoading?e("div",{staticClass:"contentLoading"},[e("DxLoadIndicator",{attrs:{height:60,width:60}})],1):t.noData?e("div",{staticClass:"noData"},[e("svgIcon",{attrs:{name:"BIG_Data",viewBox:"0 0 100 100",color:t.colorIcon,size:100}}),t._v(t._s(t.$t("noData"))+"!")],1):e("div",{staticClass:"lineChartContainer"},[e("div",{staticClass:"profitStatement",class:t.profitStatementClass},[e("div",{staticClass:"profitMoney"},[t._v("$ "+t._s(t.profitMoney))]),e("div",{staticClass:"profitPercent"},[t._v(t._s(t.getPercent)+" %")])]),e("Linechart",{attrs:{fixedWidth:553,fixedHeight:309,grid:!0,margin:{top:8,right:2,bottom:8,left:2},colorWindow:"#008E72",colorText:"#fff",points:t.listPoints}})],1)])])],1)},xT=[],OT=i("4f34"),wT=i.n(OT),_T=function(){var t=this,e=t._self._c;return e("div",{staticClass:"canvas-outer",style:{display:"inline-block"}},[t.show?e("canvas",{ref:"chartCanvas",staticStyle:{width:"100%",height:"100%"}}):t._e()])},AT=[],DT={props:{lineWidth:{default:2},points:{default:null},data:{default:null},colorShadow:{default:"rgba(0, 0, 0, 0.1)"},plotShadow:{default:!1},zeroGradient:{default:"rgba(0, 222, 170, 0.41)"},firstGradient:{default:"rgba(0, 255, 220, 0)"},grid:{default:!1},resultData:{default:!1},margin:{default:function(){return{top:0,right:0,bottom:0,left:0}}},fixedWidth:{default:0},fixedHeight:{default:0},smooth:{default:!1},color:{default:"#008e72"},colorText:{default:null},colorWindow:{default:null}},data:function(){return{width:300,height:300,show:!0,heightWindow:this.resultData?13:0}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{makePath:function(t){if(t&&!(t.length<2)){var e=this.$refs.chartCanvas,i=this.getResultedSize(e);this.width=i[0],this.height=i[1];var o=this.scalePoints(t),n=e.getContext("2d");n.clearRect(0,0,this.width,this.height);var s=n.createLinearGradient(0,0,0,this.height);if(s.addColorStop(0,this.zeroGradient),s.addColorStop(1,this.firstGradient),n.beginPath(),n.fillStyle=s,this.buildCurve(o,n,this.width,this.height,!0),n.fill(),n.beginPath(),this.buildCurve(o,n),n.strokeStyle=this.color,n.lineWidth=this.lineWidth,n.stroke(),this.plotShadow){for(var r=4,a=0;ai&&(i=t[o]);for(var n=i-e,s=0==n?0:(this.height-this.margin.top-this.margin.bottom)/n,r=this.width-this.margin.left-this.margin.right,a=[],c=0;cthis.fixedHeight?this.fixedHeight-this.heightWindow:o;t.beginPath(),n<0&&(n=0),t.font="bold 7px Arial";var s=t.measureText("".concat(i.profit)).width+8,r=e[e.length-1].x-s;t.fillStyle=this.colorWindow,n=n+this.heightWindow>this.$refs.chartCanvas.offsetHeight?n-this.heightWindow:n,this.drawRadiusRect(t,r,n,s,this.heightWindow,3),t.closePath(),t.fill(),t.beginPath(),t.font="bold 7px Arial",t.fillStyle=this.colorText,t.fillText("".concat(i.profit),r+4,n+8.5)},buildLineCurve:function(t,e,i){var o=this.height;e.moveTo(t[0].x,t[0].y);for(var n=1;n1){var e=t.getContext("2d");e.scale(window.devicePixelRatio,window.devicePixelRatio)}},getResultedSize:function(t){return this.fixedWidth&&this.fixedHeight?[this.fixedWidth,this.fixedHeight]:[t.clientWidth,t.clientHeight]}},watch:{points:function(){this.makePath(this.points)},data:function(){this.makePath(this.points)},fixedWidth:function(){this.makePath(this.points)}},mounted:function(){this.fitToContainer(this.$refs.chartCanvas),this.points&&this.makePath(this.points)}},kT=DT,IT=Object(C["a"])(kT,_T,AT,!1,null,null,null),BT=IT.exports,MT={name:"PopupGraph",props:{popupVisible:{type:Boolean,default:!1},orderObject:{type:Object},positionPopup:{type:Object}},components:{DxPopup:To["DxPopup"],DxPosition:To["DxPosition"],DxLoadIndicator:OT["DxLoadIndicator"],Linechart:BT},data:function(){return{listPoints:null,isLoading:!0}},watch:{popupVisible:function(t){t&&(this.listPoints=null,this.getOrderProfitHistory(this.orderObject.id))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},colorIcon:function(){return this.darkClass.dark?"#bbcee0":"#CCCCCC"},getTitleHeader:function(){if(this.orderObject)return"".concat(this.orderObject.contractName," ").concat(new Date(this.orderObject.openDate).toLocaleString("en")," - ").concat(new Date(this.orderObject.closedDate).toLocaleString("en"))},"bindingСlass":function(){if(this.orderObject)return".graph".concat(this.orderObject.prefix,"-").concat(this.orderObject.id)},noData:function(){var t;return(null===(t=this.listPoints)||void 0===t?void 0:t.length)<2},getPercent:function(){var t,e,i=100*(null===(t=this.orderObject)||void 0===t?void 0:t.profit)/(null===(e=this.orderObject)||void 0===e?void 0:e.volume);return Lm(i,2,!0)},profitMoney:function(){var t;return null===(t=this.orderObject)||void 0===t?void 0:t.profit},profitStatementClass:function(){return{red:this.profitMoney<0}}}),methods:{getOrderProfitHistory:function(t){if(t){var e={Command:"getOrderProfitHistory",Data:{orderId:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},GetOrderProfitHistory:function(t){var e,i;this.isLoading=!1,(null===(e=t[0])||void 0===e?void 0:e.orderId)===(null===(i=this.orderObject)||void 0===i?void 0:i.id)&&(this.listPoints=t.sort((function(t,e){return t.date>e.date?1:e.date>t.date?-1:0})).map((function(t){return t.profit})))},onHidden:function(){this.isLoading=!0}},mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.isLoading=!0,this.$socketStream.$off("apiWS3",this.setMessageHandler)}},$T=MT,LT=(i("27e9"),Object(C["a"])($T,TT,xT,!1,null,"60f262a1",null)),FT=LT.exports,jT={name:"OrdersContainer",mixins:[xt],props:{orders:{type:Array,default:function(){return[]}},whereIs:{type:String,default:""},prefix:{type:String,default:""}},components:{RecycleScroller:QP["c"],ClosedOrder:uT,OpenOrder:mT,PendingOrder:PT,PopupGraph:FT},data:function(){return{order:null,positionPopup:{at:"left",my:"right"},popupVisibleGraph:!1}},computed:{orderObject:function(){if(this.order){var t,e,i=this.order.data;return{id:i.OrderId,contractName:i.Contract,openDate:i.CreatedOrderDTUTC,closedDate:this.order.createdDateTime,profit:(null===i||void 0===i?void 0:i.Profit)||(null===(t=i.SourceOrder)||void 0===t?void 0:t.Profit),volume:(null===i||void 0===i?void 0:i.Volume)||(null===(e=i.SourceOrder)||void 0===e?void 0:e.Volume),prefix:this.prefix}}}},methods:{closePopupGraph:function(){this.popupVisibleGraph=!1},openModalGraph:function(t){var e=t.positionPopup,i=t.order;this.positionPopup=e,this.order=i,this.popupVisibleGraph=!0}}},RT=jT,WT=(i("3ccc"),Object(C["a"])(RT,YP,XP,!1,null,"4379bbd1",null)),NT=WT.exports,ET={name:"Transactions",mixins:[xt],props:{type:{type:String},maxHeightOrders:{type:String}},components:{Accordion:zP,OrdersContainer:NT,DxLoadIndicator:wt["DxLoadIndicator"]},data:function(){return{orders:null,firstUse:!1,marginBottom:2,heightOpenOrder:51,heightOpenOrderProvider:51,heightClosedOrder:51,heightClosedOrderProvider:51,heightPendingOrder:40,openIndex:-1,isLoading:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getServerTime:"serverTime/getServerTime",getUserDetail:"user/getUserDetail",getSession:"auth/getSession",getApiUrl:"api/apiNoti"})),{},{isProvider:function(){return"provider"===this.type},openedOrders:function(){if(!this.orders||!this.orders)return[];var t;t=this.isProvider?this.orders.filter((function(t){return["new","modify"].includes(t.data.Action)})):this.orders.filter((function(t){return["OrderOpened","MarketOrderModified"].includes(t.data["NotificationType"])}));var e=this.isProvider?this.heightOpenOrderProvider+this.marginBottom:this.heightOpenOrder+this.marginBottom,i=this.isProvider?this.heightOpenOrderProvider:this.heightOpenOrder;return t.map((function(t,o,n){return Object(c["a"])(Object(c["a"])({},t),{},{typeOrder:"OpenOrder",height:n.length-1===o?i:e})}))},closedOrders:function(){if(!this.orders||!this.orders)return[];var t;t="provider"===this.type?this.orders.filter((function(t){return["close"].includes(t.data.Action)})):this.orders.filter((function(t){return"OrderClosed"===t.data["NotificationType"]}));var e=this.isProvider?this.heightClosedOrderProvider+this.marginBottom:this.heightClosedOrder+this.marginBottom,i=this.isProvider?this.heightClosedOrderProvider:this.heightClosedOrder;return t.map((function(t,o,n){return Object(c["a"])(Object(c["a"])({},t),{},{typeOrder:"ClosedOrder",height:n.length-1===o?i:e})}))},pendingOrders:function(){var t=this;if(!this.orders||!this.orders)return[];var e=this.getProfileAccount.map((function(t){return t.id}));return this.orders.filter((function(t){return["PendingOrderPlaced","PendingOrderClosed","PendingOrderModified"].includes(t.data["NotificationType"])&&e.includes(t.data["AccountId"])})).map((function(e,i,o){return Object(c["a"])(Object(c["a"])({},e),{},{typeOrder:"PendingOrder",height:o.length-1===i?t.heightPendingOrder:t.heightPendingOrder+t.marginBottom})}))},arrayForAccordion:function(){var t=this.openedOrders.length,e=this.closedOrders.length,i=this.pendingOrders.length,o=this.isProvider?this.heightOpenOrderProvider:this.heightOpenOrder,n=this.isProvider?2*(this.heightOpenOrderProvider+this.marginBottom):2*(this.heightOpenOrder+this.marginBottom),s=this.isProvider?this.heightClosedOrderProvider:this.heightClosedOrder,r=this.isProvider?2*(this.heightClosedOrderProvider+this.marginBottom):2*(this.heightClosedOrder+this.marginBottom),a=this.heightPendingOrder,c=2*(this.heightPendingOrder+this.marginBottom),l=0===t?0:1===t?o:n,u=0===e?0:1===e?s:r,d=0===i?0:1===i?a:c,h=[{id:"opened",title:"Открытые ордера",count:t,orders:this.isLoading?[{id:"open1",height:this.heightOpenOrder+this.marginBottom,sceleton:!0},{id:"open2",height:this.heightOpenOrder,sceleton:!0}]:this.openedOrders,firstHeight:this.isLoading?n:l},{id:"closed",title:"Закрытые ордера",count:e,orders:this.isLoading?[{id:"close1",height:this.heightClosedOrder+this.marginBottom,sceleton:!0},{id:"close2",height:this.heightClosedOrder,sceleton:!0}]:this.closedOrders,firstHeight:this.isLoading?r:u},{id:"pending",title:"Лимитные ордера",count:i,orders:this.isLoading?[{id:"pending1",height:this.heightPendingOrder+this.marginBottom,sceleton:!0},{id:"pending2",height:this.heightPendingOrder,sceleton:!0}]:this.pendingOrders,firstHeight:this.isLoading?c:d}];return"provider"===this.type&&h.splice(2,1),h},selectedItems:function(){return[]},componentName:function(){return function(t){return"opened"===t?"OpenedOrders":"closed"===t?"ClosedOrders":"PendingOrders"}}}),methods:{setAccordionIndex:function(t){this.openIndex=t},setMessageHandler:function(t){"NotificationHistory"===t.command&&this.setOrderNotifications(t.data.notifications)},setOrderNotifications:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.orders=t.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:JSON.parse(t.data)})})),e.isLoading=!1,o=[].concat(Object(x["a"])(e.openedOrders),Object(x["a"])(e.closedOrders),Object(x["a"])(e.pendingOrders)).filter((function(t){return null===t.readedDateTime})),!(o.length>0)){i.next=6;break}return i.next=6,e.$store.dispatch("notifications/saveNotificationHistory",o);case 6:case"end":return i.stop()}}),i)})))()},getOrdersNotifications:function(){this.isLoading=!0;var t=new Date(this.getServerTime.utcNow).getTime(),e={command:"NotificationHistory",data:{fromDt:new Date(t-2592e6).toISOString(),dataType:["OrderExecution"],userId:this.getUserDetail.id},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:e})}},mounted:function(){this.$socketStream.events.subscribe("apiWS_NOTI",this.setMessageHandler),this.getOrdersNotifications()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS_NOTI",this.setMessageHandler)}},UT=ET,VT=(i("13e2"),Object(C["a"])(UT,NP,EP,!1,null,"2be72cc4",null)),HT=VT.exports,GT=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Events",class:t.darkClass,style:{"--height":t.maxHeightEvents}},[e("RecycleScroller",{staticClass:"scroller",attrs:{items:t.eventsArr,buffer:200,"page-mode":!1,"key-field":"id","size-field":"height"},scopedSlots:t._u([{key:"default",fn:function(t){var i=t.item;return[e("OneSubscription",{key:i.id,attrs:{order:i}})]}}])})],1)},qT=[],zT=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneSubscription",class:t.readClass,attrs:{"data-id":t.order.id},on:{click:t.closeNotification}},[e("div",{staticClass:"photoContent"},[t.srcImg?e("img",{staticClass:"imgUser",attrs:{alt:"",src:t.srcImg}}):e("div",{staticClass:"defaultUserIcon"},[e("svgIcon",{attrs:{name:"empty-avatar",color:"#8c8c8c"}})],1),e("div",{staticClass:"userIcon",style:t.styleUserIcon},[e("svgIcon",{attrs:{name:t.nameIcon,color:t.colorIcon}})],1)]),e("div",{staticClass:"textContent"},[e("div",{staticClass:"name"},[t._v(t._s(t.nameUser)),e("span",[t._v(" "+t._s(t.date))])]),e("div",{staticClass:"description",domProps:{innerHTML:t._s(t.descriptionText)}})])])},YT=[],XT={name:"OneSubscription",mixins:[xt,qe],props:{order:{type:Object},notification:{type:Boolean,default:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({defaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",getUserID:"auth/getUserID"})),{},{iAmSource:function(){return this.order.data.IsPersonalInfo},nameUser:function(){var t,e=this.order.dataType;if(!this.iAmSource&&!["PaymentInfo","SourceInfo"].includes(e)){var i=this.order.sourceUserInfo||{},o=i.firstName,n=i.lastName;return"".concat(o||""," ").concat(n||"")}return this.iAmSource&&this.stopLossStatus?null!==(t=this.order)&&void 0!==t&&t.data.BagInfo?this.order.data.BagInfo.Name:this.order.data.SourceName:this.$t("you")},nameProvider:function(){var t=this.order.sourceUserInfo||{},e=t.firstName,i=t.lastName;return"".concat(e||""," ").concat(i||"")},isPayment:function(){var t;return"payment"===(null===(t=this.order.data)||void 0===t?void 0:t.Action)||"PaymentInfo"===this.order.dataType},textActionNew:function(){return this.iAmSource?this.$t("nyacs")[0](this.nameProvider):this.$t("incys")},textActionClose:function(){return this.iAmSource?this.$t("ctcos")[0](this.nameProvider):this.$t("ctcoys")},textActionUpdate:function(){return this.iAmSource?this.$t("ctsocsf")[0](this.nameProvider):this.$t("ctsocys")},textAutotradeFalse:function(){return this.iAmSource?this.$t("subscribed_to_signals")[0](this.nameProvider):this.$t("stys")},textAutotradeFalseClose:function(){return this.iAmSource?this.$t("unsubscribed_from_signals")[0](this.nameProvider):this.$t("ufys")},textActionPayment:function(){var t,e=null===(t=this.order.data)||void 0===t?void 0:t.Amount;if("PaymentInfo"===this.order.dataType)return this.$t("ptif")[0](e);if(this.iAmSource)return"Оплатили выставленный счет на $".concat(e,"");var i=this.order.data.Type;return"subscription"===i?this.$t("ptiffcys")[0](e):"Оплатил выставленный счет на $".concat(e," за подписку на Ваш контент")},textMaxDDAction:function(){var t=this.order.data;return this.iAmSource?"Остановка копирования ".concat(t.Contract,' по Stop Loss'):"Отменил копирование ".concat(t.Contract,' по Stop Loss')},textContentActive:function(){return this.iAmSource?"Подписались на контент “".concat(this.nameProvider,"”"):"Подписался на Ваш контент"},textContentClose:function(){return this.iAmSource?"Отписались от контента “".concat(this.nameProvider,"”"):"Отписался от Вашего контента"},textSourceInfo:function(){var t=this.order.data,e=t.StopDateTime,i=t.Contract;return e?"Вы удалили инструмент ".concat(i," из списка предоставляемых торговых сигналов"):"Вы сохранили настройки инструмента ".concat(i," для предоставления торговых сигналов")},descriptionText:function(){var t,e=null===(t=this.order.data)||void 0===t?void 0:t.Action,i=this.order.dataType;if("SourceInfo"===i)return this.textSourceInfo;if("PaymentInfo"===i)return this.textActionPayment;if("contentsubscription"===this.order.data.Type)switch(e){case"active":return this.textContentActive;case"close":return this.textContentClose;default:return""}switch(e){case"active":return!1===this.order.data.AutoTrade?this.textAutotradeFalse:this.textActionNew;case"close":return!1===this.order.data.AutoTrade?this.textAutotradeFalseClose:this.textActionClose;case"update":return this.textActionUpdate;case"payment":return this.textActionPayment;case"stopwork max dd":return this.textMaxDDAction;default:return""}},readClass:function(){var t;return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{noRead:null===this.order.readedDateTime&&!this.notification,notification:this.notification,paymentRed:"PaymentInfo"===this.order.dataType,paymentGreen:"payment"===(null===(t=this.order.data)||void 0===t?void 0:t.Action)})},nameIcon:function(){return this.isPayment?"SortDollar":"AutoFolow"},date:function(){return new Intl.DateTimeFormat("ru-RU",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(this.order.createdDateTime))},srcImg:function(){var t,e,i,o,n=this.order.dataType;return"SourceInfo"===n?null===(i=this.order.userInfo)||void 0===i?void 0:i.avatarURL:this.iAmSource||"PaymentInfo"===n?this.iAmSource&&"SubNotification"===n&&"stopwork max dd"===this.order.data.Action?null===(t=this.order.sourceUserInfo)||void 0===t?void 0:t.avatarURL:null===(e=this.order.userInfo)||void 0===e?void 0:e.avatarURL:null===(o=this.order.sourceUserInfo)||void 0===o?void 0:o.avatarURL},styleUserIcon:function(){return this.isPayment?{backgroundColor:"#fff"}:{backgroundColor:this.stopLossStatus?this.getRedColor.color:this.darkClass.dark?"#00b9fc":"#3C73F1"}},stopLossStatus:function(){var t;return"stopwork max dd"===(null===(t=this.order)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.Action)},colorIcon:function(){var t=this.darkClass.dark?"#00b9fc":"#3C73F1";return this.isPayment?t:"#fff"}}),methods:{closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)}}},QT=XT,JT=(i("1571"),Object(C["a"])(QT,zT,YT,!1,null,"a1aabcb8",null)),KT=JT.exports,ZT=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ReportNotification",style:{background:t.getProfitPeriod<0?t.getRedFill:t.getGreenFill},on:{click:t.openReportModal}},[e("div",{staticClass:"ReportNotification-indicator",style:{background:t.getProfitPeriod<0?t.getRedColor.color:t.getGreenColor.color}})])},tx=[],ex={name:"Report",mixins:[qe],props:{report:{type:Object}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getGreenFill:function(){return"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.2)"},getRedFill:function(){return"light"===this.getActiveTheme?"rgba(233, 18, 18, 0.1)":"rgba(250, 76, 74, 0.2)"},dataReport:function(){return this.report.data},getProfitPeriod:function(){return this.dataReport.Equity-this.dataReport.EquityOpen},getPeriod:function(){if(this.dataReport)return 0===this.dataReport.DataType?"day":1===this.dataReport.DataType?"week":2===this.dataReport.DataType?"month":void 0},datePeriod:function(){if(1===this.dataReport.DataType)return this.dataReport.ReportByPeriod;var t=this.dataReport.ReportByPeriod.split("."),e=Object(D["a"])(t,3),i=e[0],o=e[1],n=e[2];return"".concat(o,".").concat(i,".").concat(n)},namePeriod:function(){var t="";return 1===this.dataReport.DataType&&(t="неделю"),"Отчет за ".concat(this.datePeriod," ").concat(t)},financialResult:function(){var t=Lm(this.dataReport.CurrentProfitMoney,2,!0),e=Lm(this.dataReport.CurrentProfitProc,2,!0);return+e&&Math.abs(+e)<.001&&(e=+e<0?-.001:.001),{value:"$ ".concat(t," (").concat(e,"%) (0 pip)"),dopClass:this.dataReport.CurrentProfitMoney<0?"red":"green"}},listData:function(){return[{title:"Баланс",value:"".concat(this.getCurrencyChar," ").concat(Lm(this.dataReport.Balance,2,!0)),color:this.getBlueColor.color},{title:"Средства",value:"".concat(this.getCurrencyChar," ").concat(Lm(this.dataReport.Equity,2,!0)),color:this.getGreenColor.color},{title:"PnL",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getProfitPeriod,2)),color:this.getProfitPeriod<0?this.getRedColor.color:this.getGreenColor.color}]}}),methods:{openReportModal:function(){"day"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleDay",{dataPeriod:this.report}),"week"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleWeek",{dataPeriod:this.report}),"month"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleMonth",{dataPeriod:this.report})}}},ix=ex,ox=(i("8f7b"),Object(C["a"])(ix,ZT,tx,!1,null,"3bd89000",null)),nx=ox.exports,sx={name:"Events",mixins:[xt],props:{maxHeightEvents:{type:String}},components:{OneSubscription:KT,RecycleScroller:QP["c"],Report:nx},data:function(){return{eventsNoti:null,marginBottom:4,heightEvent:56,heightReport:60}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",getSession:"auth/getSession",getUserDetail:"user/getUserDetail"})),{},{eventsArr:function(){var t=this;if(!this.eventsNoti)return[];var e=this.eventsNoti.map((function(e,i,o){var n=10===e.dataType?t.heightReport:t.heightEvent;return o.length-1!==i&&(n+=t.marginBottom),Object(c["a"])(Object(c["a"])({},e),{},{height:n})}));return e.filter((function(e){return 10!==e.dataType||10===e.dataType&&e.data.AccountId===t.getDefaultAccount.id}))}}),methods:{setMessageHandler:function(t){"NotificationHistory"===t.command&&this.setEventNotifications(t.data.notifications)},setEventNotifications:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.eventsNoti=t.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:JSON.parse(t.data)})})),e.eventsNoti=e.eventsNoti.filter((function(t){return!!["PaymentInfo","SourceInfo"].includes(t.dataType)||"SubNotification"===t.dataType&&["subscription","contentsubscription"].includes(t.data.Type)})),o=e.eventsArr.filter((function(t){return null===t.readedDateTime})),!(o.length>0)){i.next=6;break}return i.next=6,e.$store.dispatch("notifications/saveNotificationHistory",o);case 6:case"end":return i.stop()}}),i)})))()},getEventsNotifications:function(){this.isLoading=!0;var t=new Date(this.getServerTime.utcNow).getTime(),e={command:"NotificationHistory",data:{fromDt:new Date(t-2592e6).toISOString(),dataType:["PaymentInfo","SourceInfo","SubNotification"],userId:this.getUserDetail.id},FingerPrint:this.getSession.fp};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:e})}},mounted:function(){this.$socketStream.events.subscribe("apiWS_NOTI",this.setMessageHandler),this.getEventsNotifications()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS_NOTI",this.setMessageHandler)}},rx=sx,ax=(i("4af5"),Object(C["a"])(rx,GT,qT,!1,null,"0ee55eda",null)),cx=ax.exports,lx=function(){var t=this,e=t._self._c;return e("Transactions",{attrs:{type:"provider",maxHeightOrders:t.maxHeightOrders,orders:t.orders}})},ux=[],dx={name:"Signals",props:{maxHeightOrders:{type:String},orders:{type:Array}},components:{Transactions:HT}},hx=dx,px=(i("aa9c"),Object(C["a"])(hx,lx,ux,!1,null,"346aeeac",null)),gx=px.exports,fx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Events",class:t.darkClass,style:{height:t.maxHeightEvents}},[e("VuePerfectScrollbar",t._l(t.eventsArr,(function(t,i){return e("Report",{key:i,attrs:{report:t}})})),1)],1)},mx=[],vx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ReportNotification",style:{background:t.getProfitPeriod<0?t.getRedFill:t.getGreenFill},on:{click:t.openReportModal}},[e("div",{staticClass:"ReportNotification-wrap"},[e("div",{staticClass:"ReportNotification-title",class:"ReportNotification-title_".concat(t.getActiveTheme)},[t._v(t._s(t.datePeriod))]),e("div",{staticClass:"ReportNotification-data"},t._l(t.listData,(function(i,o){return e("div",{key:o,staticClass:"ReportNotification-dataItem"},[e("div",{staticClass:"ReportNotification-dataItem-title",style:{color:t.getGrayColor.color}},[t._v(t._s(i.title))]),e("div",{staticClass:"ReportNotification-dataItem-value",style:{color:i.color}},[t._v(t._s(i.value))])])})),0)]),e("div",{staticClass:"ReportNotification-indicator",style:{background:t.getProfitPeriod<0?t.getRedColor.color:t.getGreenColor.color}})])},yx=[],Cx={name:"Report",mixins:[qe],props:{report:{type:Object}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getGreenFill:function(){return"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.2)"},getRedFill:function(){return"light"===this.getActiveTheme?"rgba(233, 18, 18, 0.1)":"rgba(250, 76, 74, 0.2)"},dataReport:function(){return this.report.data},getProfitPeriod:function(){return this.dataReport.Equity-this.dataReport.EquityOpen},getPeriod:function(){if(this.dataReport)return 0===this.dataReport.DataType?"day":1===this.dataReport.DataType?"week":2===this.dataReport.DataType?"month":void 0},datePeriod:function(){var t={day:"Отчет за ".concat(new Date(this.dataReport.ReportByPeriod).toLocaleDateString("ru")),week:"Отчет за ".concat(this.dataReport.ReportByPeriod," неделю"),month:"Отчет за ".concat(this.$t("mounthArr")[this.dataReport.ReportByPeriod-1]," ").concat(new Date(this.dataReport.MoneyChart[0].X).getFullYear())};return t[this.getPeriod]},financialResult:function(){var t=Lm(this.dataReport.CurrentProfitMoney,2,!0),e=Lm(this.dataReport.CurrentProfitProc,2,!0);return+e&&Math.abs(+e)<.001&&(e=+e<0?-.001:.001),{value:"$ ".concat(t," (").concat(e,"%) (0 pip)"),dopClass:this.dataReport.CurrentProfitMoney<0?"red":"green"}},listData:function(){return[{title:"Баланс",value:"".concat(this.getCurrencyChar," ").concat(Lm(this.dataReport.Balance,2,!0)),color:this.getBlueColor.color},{title:"Средства",value:"".concat(this.getCurrencyChar," ").concat(Lm(this.dataReport.Equity,2,!0)),color:this.getGreenColor.color},{title:"PnL",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getProfitPeriod,2)),color:this.getProfitPeriod<0?this.getRedColor.color:this.getGreenColor.color}]}}),methods:{openReportModal:function(){"day"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleDay",{dataPeriod:this.report}),"week"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleWeek",{dataPeriod:this.report}),"month"===this.getPeriod&&this.$store.commit("reportsModal/setVisibleMonth",{dataPeriod:this.report})}}},bx=Cx,Sx=(i("0a44"),Object(C["a"])(bx,vx,yx,!1,null,"6ad6f3e2",null)),Px=Sx.exports,Tx={name:"ReportsNotifications",mixins:[xt],props:{maxHeightEvents:{type:String}},components:{RecycleScroller:QP["c"],VuePerfectScrollbar:Xt.a,Report:Px},data:function(){return{eventsNoti:null,marginBottom:4,heightReport:60}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",getSession:"auth/getSession",getUserDetail:"user/getUserDetail"})),{},{eventsArr:function(){var t,e=this;if(null!==(t=this.eventsNoti)&&void 0!==t&&t.length&&10===this.eventsNoti[0].dataType){var i=this.eventsNoti.map((function(t,i,o){var n=e.heightReport;return o.length-1!==i&&(n+=e.marginBottom),Object(c["a"])(Object(c["a"])({},t),{},{height:n})}));return i.filter((function(t){return t.data.AccountId===e.getDefaultAccount.id}))}}}),methods:{setMessageHandler:function(t){"NotificationHistory"===t.command&&this.setReportNotifications(t.data.notifications)},setReportNotifications:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.length){i.next=2;break}return i.abrupt("return");case 2:if(o=t.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:JSON.parse(t.data)})})),10===o[0].dataType){i.next=5;break}return i.abrupt("return");case 5:if(e.eventsNoti=o.filter((function(t){return t.data.AccountId===e.getDefaultAccount.id})),e.eventsNoti.length){i.next=8;break}return i.abrupt("return");case 8:if(n=e.eventsArr.filter((function(t){return null===t.readedDateTime})),!(n.length>0)){i.next=12;break}return i.next=12,e.$store.dispatch("notifications/saveNotificationHistory",n);case 12:case"end":return i.stop()}}),i)})))()},getReportsNotifications:function(){this.isLoading=!0;var t=new Date(this.getServerTime.utcNow).getTime(),e={command:"NotificationHistory",data:{fromDt:new Date(t-2592e6).toISOString(),dataType:[10],userId:this.getUserDetail.id},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:e})}},mounted:function(){this.$socketStream.events.subscribe("apiWS_NOTI",this.setMessageHandler),this.getReportsNotifications()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS_NOTI",this.setMessageHandler)}},xx=Tx,Ox=(i("ba04"),Object(C["a"])(xx,fx,mx,!1,null,"00141838",null)),wx=Ox.exports,_x={name:"ProfileNotifications",mixins:[qg,xt],props:{open:{type:Boolean,default:!1}},components:{Transactions:HT,Events:cx,Signals:gx,ButtonGroup:WP,Reports:wx},data:function(){return{activeComponent:"Transactions",openPositionOrders:[],heightSection:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({statData:"notifications/statData",getSession:"auth/getSession",getApiUrl:"api/api",notifications:"notifications/getNotifications",getUser:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount"})),{},{myAccountsIDs:function(){return this.getProfileAccount.map((function(t){return t.id}))},maxHeightOrders:function(){return this.heightSection-16-111-16+"px"},maxHeightEvents:function(){return this.heightSection-16+"px"},myOrders:function(){return this.notifications.filter((function(t){return"OrderExecution"===t.dataType}))},myOrdersUnread:function(){return this.myOrders.filter((function(t){return null===t.readedDateTime})).length},alienOrders:function(){return this.notifications.filter((function(t){return"SubNotification"===t.dataType&&"sourceorder"===t.data.Type}))},alienOrdersUnread:function(){return this.alienOrders.filter((function(t){return null===t.readedDateTime})).length},reportNotification:function(){return this.notifications.filter((function(t){return[10].includes(t.dataType)}))},reportNotificationUnread:function(){return!this.reportNotification||this.reportNotification.length?0:this.reportNotification.filter((function(t){return null===t.readedDateTime})).length},eventsNotification:function(){return this.notifications.filter((function(t){return!!["PaymentInfo","SourceInfo"].includes(t.dataType)||"SubNotification"===t.dataType&&["subscription","contentsubscription"].includes(t.data.Type)}))},eventsNotificationUnread:function(){return this.eventsNotification.filter((function(t){return null===t.readedDateTime})).length},buttonsEvents:function(){return[{id:"Transactions",title:"Сделки",count:null,countUnread:this.myOrdersUnread},{id:"Events",title:"События",count:null,countUnread:this.eventsNotificationUnread},{id:"Signals",title:"Сигналы",count:null,countUnread:this.alienOrdersUnread},{id:"Reports",title:"Отчеты",count:null,countUnread:this.reportNotificationUnread}]},propsData:function(){return{Transactions:{type:"my",maxHeightOrders:this.maxHeightOrders,orders:this.myOrders},Signals:{maxHeightOrders:this.maxHeightOrders,orders:this.alienOrders},Events:{eventsNoti:this.eventsNotification,maxHeightEvents:this.maxHeightEvents},Reports:{eventsNoti:this.reportNotification,maxHeightEvents:this.maxHeightEvents}}}}),mounted:function(){this.heightSection=this.$refs.section.getBoundingClientRect().height,this.initObserver(this.onResize,this.$refs.section)},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({switchNotifications:"modal/switchNotifications"})),{},{readAll:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.notifications.filter((function(t){return null===t.readedDateTime})),!(i.length>0)){e.next=4;break}return e.next=4,t.$store.dispatch("notifications/saveNotificationHistory",i);case 4:case"end":return e.stop()}}),e)})))()},onResize:function(){this.heightSection!==this.$refs.section.getBoundingClientRect().height&&(this.heightSection=this.$refs.section.getBoundingClientRect().height)},selectingSection:function(t){this.activeComponent=t.id}})},Ax=_x,Dx=(i("e3e1"),Object(C["a"])(Ax,BP,MP,!1,null,"3772d7c8",null)),kx=Dx.exports,Ix=function(){var t=this,e=t._self._c;return e("Modal",{staticClass:"disclaimer-modal",attrs:{isOpen:t.isOpen,title:t.$t("disclaimer"),width:"520"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("p",[e("span",[t._v("Lorem ipsum dolor sit amet, consectetur adipisicing elit. A ab animi delectus deleniti dolorum earum eos est fugiat, fugit id iusto neque nihil nostrum perspiciatis, provident quod sed ut vero.")]),e("span",[t._v("Ab accusantium exercitationem facere perferendis quaerat quasi quod repudiandae suscipit tenetur. Amet aut corporis ex ipsam libero repellendus velit? Accusantium at dolor ducimus ex illo nulla quis tenetur vitae voluptatem?")]),e("span",[t._v("Autem blanditiis illum in quod! Amet animi commodi, deserunt itaque pariatur ullam velit! Autem, dolor, ea esse facere fugit id labore minima modi mollitia nisi nobis quod repudiandae tempore, totam.")]),e("span",[t._v("Architecto exercitationem incidunt quaerat repellendus voluptatum. Adipisci blanditiis debitis dolores, doloribus facilis minus natus quibusdam sapiente! A architecto, blanditiis consequuntur error hic minus ratione. Commodi debitis dolorum neque perspiciatis quaerat!")]),e("span",[t._v("Accusantium, assumenda commodi exercitationem id minima non perspiciatis quaerat, quibusdam quidem quis tempore unde vel voluptatem! Aliquam aut autem ipsum maxime, nemo nulla omnis quod reprehenderit sint, veritatis voluptatibus, voluptatum?")])])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("Button",{attrs:{typeBtn:"primary"},on:{click:t.close}},[t._v(" ok ")])]},proxy:!0}])})},Bx=[],Mx={components:{Modal:Oe,Button:Pa},props:{isOpen:{type:Boolean}},methods:{close:function(){this.$store.dispatch("modal/switchDisclaimerModal")},accept:function(){this.$store.dispatch("modal/switchDisclaimerModal")}}},$x=Mx,Lx=(i("e6b3"),Object(C["a"])($x,Ix,Bx,!1,null,null,null)),Fx=Lx.exports,jx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"orderFromNotificationsAbsolute",class:t.getActiveTheme},[t.callIn?e("inCallNotification",{on:{rejectCall:t.rejectCall,acceptCall:t.rejectCall}}):t._e(),e("transition-group",{attrs:{name:"list",tag:"div"}},t._l(t.listNotification,(function(i){return e("div",{key:i.indexId,staticClass:"containerNotification"},[e(t.componentName(i),{key:i.indexId,tag:"component",attrs:{order:i,notification:!0},on:{removeNotification:t.removeNotification}})],1)})),0)],1)},Rx=[],Wx=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"fade"}},[e("div",{ref:"toast",staticClass:"toast toast--open",style:{zIndex:3},on:{click:t.toogle}},[t._t("default")],2)])},Nx=[],Ex={name:"Toast",data:function(){return{open:!1}},props:{enabled:{type:Boolean}},watch:{enabled:function(t){this.open=t},open:function(t){var e=this;t&&setTimeout((function(){return e.open=!1}),6e3)}},methods:{toogle:function(){this.$emit("dead")}},mounted:function(){var t=this;setTimeout((function(){t.toogle()}),6e3)}},Ux=Ex,Vx=(i("3988"),Object(C["a"])(Ux,Wx,Nx,!1,null,null,null)),Hx=Vx.exports,Gx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"order-trading-outer",class:{"order-trading-outer--notification":!0},on:{mouseover:t.setAsRead}},[t.isOpen?e("div",{staticClass:"order-trading",class:[{"order-trading--nonprofit":!!t.order.profit},{"order--read":t.getReadStatus}]},[e("div",{staticClass:"order-trading__close",on:{click:t.deleteOrder}},[e("svgIcon",{attrs:{name:"Close"}})],1),"subscribe"===t.typeNotification?e("div",{staticClass:"order-trading__left"},[e("Avatar",{attrs:{size:"3.2",src:t.order.userAvatar}})],1):t._e(),e("div",{staticClass:"order-trading__body",staticStyle:{"z-index":"23"}},["subscribe"===t.typeNotification?e("div",{staticClass:"order-trading__top"},[t._v(t._s(t.$t("expertOrder"))+" "+t._s(t.order.userName))]):t._e(),"subscribe"===t.typeNotification||"order"===t.typeNotification?e("div",{staticClass:"order-trading__top"},[e("div",{staticClass:"order-trading__info"},[t._v(t._s(t.getText))]),e("div",{staticClass:"order-trading__info order__info--pair",class:{"order-trading__info--decrease":"Sell"===t.order.orderType}},[t._v(t._s(t.order.contractName))]),e("div",{staticClass:"order-trading__info"},[t._v(t._s(t.getOrderNumber))]),e("div",{staticClass:"order-trading__info"},[t._v(t._s(t.getFormatDate(t.order.createdDate)))])]):t._e(),"subscribe"===t.typeNotification||"order"===t.typeNotification?e("div",{staticClass:"order-trading__values"},[e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("typeAndVolume")))]),e("div",{staticClass:"order-trading__val order-trading__val--type",class:{"order-trading__val--decrease":"Sell"===t.order.orderType}},[e("svgIcon",{attrs:{name:t.getIconName}}),t._v(t._s(t.getValue))],1)]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("openingPrice")))]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v("S/L")]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.order.stopLoss))])]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v("T/P")]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.order.takeProfit))])]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("accountNumber")))]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.order.accountSequenceId))])])]):t._e(),t.order.closedDate?e("div",{staticClass:"order-trading__footer"},[e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("openingTime")))]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.getFormatDate(t.order.createdDate)))])]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("closingTime")))]),e("div",{staticClass:"order-trading__val"},[t._v(t._s(t.getFormatDate(t.order.closedDate)))])]),e("div",{staticClass:"order-trading__item"},[e("div",{staticClass:"order-trading__title"},[t._v(t._s(t.$t("resultWord")))]),e("div",{staticClass:"order-trading__val order-trading__val--result",class:{"order__val--decrease":!t.order.profit}},[e("span",{staticClass:"order-trading__val-mainresult"},[t._v(t._s(t.order.profit))])])])]):t._e(),t.getComment?e("div",[e("div",[e("strong"),t._v(t._s(t.$t("commentOnDeal")))]),e("div"),t._v(t._s(t.getComment))]):t._e()])]):t._e()])},qx=[],zx={name:"Order",components:{Avatar:E,svgIcon:L},props:{isOpen:{type:Boolean,default:!1},order:{type:Object},typeNotification:{type:String},notification:{type:Boolean,default:!1}},computed:{getDeal:function(){return"order"===this.typeNotification},getSubscribe:function(){return"subscribe"===this.typeNotification},getReadStatus:function(){return this.order.read},getEvent:function(){return"event"===this.typeNotification},getProfit:function(){return this.profit},getIconName:function(){return"Buy"===this.orderType?"Arrow-micro-top":"Arrow-micro-bottom"},getClosedOrder:function(){return this.closedOrder},getText:function(){return this.order.reason?"Position_Create"===this.order.reason?"Ордер открыт":"Closed"===this.order.status?"Ордер закрыт":"Position_TP"===this.order.reason&&"Closed"!==this.order.status?"Установлен TP":"Position_SL"===this.order.reason&&"Closed"!==this.order.status?"Установлен SL":void 0:this.order.closedDate?"Ордер закрыт":"Ордер открыт"},getValue:function(){return"".concat("Sell"===this.order.orderType?"SELL":"BUY"," ").concat(this.order.volume)},getComment:function(){return this.order.comment},getResult:function(){return"$ ".concat(this.result)},getResultPercent:function(){return"(".concat(this.resultPercent," %)")},getResultPip:function(){return"".concat(this.resultPip," pip")},getOrderNumber:function(){return"№".concat(this.order.sequenceId)}},methods:{setAsRead:function(){this.$emit("readNoti",this.typeNotification)},deleteOrder:function(){this.$emit("delOrder",this.order)},getFormatDate:function(t){var e=new Date(t),i=e.getFullYear(),o=e.getMonth()+1,n=e.getDate(),s=e.getHours(),r=e.getMinutes(),a=e.getSeconds(),c="".concat(n<10?"0"+n:n,".").concat(o<10?"0"+o:o,".").concat(i," ").concat(s<10?"0"+s:s,":").concat(r<10?"0"+r:r,":").concat(a<10?"0"+a:a);return c}}},Yx=zx,Xx=(i("b060"),Object(C["a"])(Yx,Gx,qx,!1,null,null,null)),Qx=Xx.exports,Jx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"event",class:{"event--read":t.getReadStatus},on:{mouseover:t.setAsRead}},[e("div",{staticClass:"event__ava"},[e("Avatar",{attrs:{src:t.getEventAva,size:"3.2"}})],1),e("div",{staticClass:"event__icon",class:{"event__icon--owner":t.getReadStatus}},[e("svgIcon",{attrs:{name:t.getEventIcon}})],1),e("div",{staticClass:"event__body"},[e("div",{staticClass:"event__row"},[e("div",{staticClass:"event__name",attrs:{title:t.getEventSource}},[t._v(t._s(t.getEventSource))]),e("div",{staticClass:"event__rating"},[e("Rating",{attrs:{value:"3.5"}})],1),e("div",{staticClass:"event__time"},[t._v(t._s(t.renderTimePast))])]),e("div",{staticClass:"event__text",domProps:{innerHTML:t._s(t.getEventText)}})])])},Kx=[],Zx={components:{Avatar:E,Rating:Fu,svgIcon:L},data:function(){return{renderTimePast:null,timer:null}},props:{event:{type:Object}},computed:{getEventAva:function(){return this.event.user.avatarURL},getEventSource:function(){return"".concat(this.event.user.firstName," ").concat(this.event.user.lastName)},getReadStatus:function(){return this.event.read},getEventIcon:function(){return"new"===this.event.action?"User-follow-autodeals-on":"update"===this.event.action?"User-follow-off":void 0},getEventText:function(){return"new"!==this.event.action||this.event.IsConfirm?"new"===this.event.action&&this.event.IsConfirm?'Вы подписались на '.concat(this.event.sourceName," по счету ").concat(this.event.account.sequenceId,"
котракт ").concat(this.event.contract):"update"!==this.event.action||this.event.IsConfirm?"update"===this.event.action&&this.event.IsConfirm?'Вы отписались от '.concat(this.event.sourceName," по счету ").concat(this.event.account.sequenceId,"
котракт ").concat(this.event.contract):void 0:''.concat(this.getEventSource," отписался от вас по счету ").concat(this.event.account.sequenceId,"
котракт ").concat(this.event.contract):''.concat(this.getEventSource," подписался на вас по счету ").concat(this.event.account.sequenceId,"
котракт ").concat(this.event.contract)}},methods:{getEventTime:function(){var t=this,e=Date.now(),i=Date.now();setInterval((function(){i=Date.now(),t.renderTimePast=t.renderTime(e,i)}),1e4)},renderTime:function(t,e){var i=e-t,o=(i/864e5).toFixed(0),n=(i/36e5).toFixed(0),s=(i/6e4).toFixed(0);return+s<1?"только что":+s<60?"".concat(s,+s<5&&+s>=2?" минуты назад":+s<2?" минута назад":" минут назад"):n<24?"".concat(n,+n<5&&n>=2?" часа назад":+n<2?" час назад":" часов назад"):"".concat(o,+o<5&&+o>=2?" дня назад":+o<2?" день назад":" дней назад")},setAsRead:function(){this.$emit("readNoti","event"),this.timer=null}},mounted:function(){var t=this;this.timer=setTimeout((function(){t.setAsRead()}),5e3),this.getEventTime()}},tO=Zx,eO=(i("d8f8"),Object(C["a"])(tO,Jx,Kx,!1,null,null,null)),iO=eO.exports,oO=function(){var t=this,e=t._self._c;return e("div",{staticClass:"eventPresignal"},[e("div",{staticClass:"eventPresignal__body"},[e("div",{staticClass:"eventPresignal__row"},[e("div",{staticClass:"eventPresignal__name",attrs:{title:1}},[t._v(t._s("Пресигнал от Робота по счету ".concat(t.event.accountId)))]),e("div",{staticClass:"eventPresignal__time"},[t._v(t._s((new Date).toLocaleString("en")))])]),e("div",{staticClass:"eventPresignal__text"},[e("p",[t._v(t._s(t.getSignalText))]),e("p",[t._v(" Объём "+t._s(t.getDeelDepo))])])])])},nO=[],sO={components:{Avatar:E,Rating:Fu,svgIcon:L},props:{event:{type:Object}},computed:{getSignalText:function(){return this.event&&this.event.values?this.event.values.SignalText:""},getDeelDepo:function(){return this.event&&this.event.values?this.event.values.DealVolumeDepo:""}}},rO=sO,aO=(i("4252"),Object(C["a"])(rO,oO,nO,!1,null,null,null)),cO=aO.exports,lO=function(){var t=this,e=t._self._c;return e("div",{staticClass:"in-call-noti"},[e("div",{staticClass:"in-call-noti__fromCall"},[e("div",{staticClass:"in-call-noti__fromCall-avatar"},[e("Avatar",{attrs:{size:"4",src:t.getAvatarUrl}})],1),e("div",{staticClass:"in-call-noti__fromCall-name"},[t._v(t._s(t.$t("callFrom"))+" "+t._s(t.getCallFromUserInfo.username))])]),e("div",{staticClass:"in-call-noti__navigation"},[e("ButtonIconFlat",{attrs:{icon:{name:t.getAcceptCamera},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_light"],style:{borderRadius:"0.6rem"}}},on:{click:t.acceptVideo}}),e("ButtonIconFlat",{attrs:{icon:{name:"IncommingCall"},modifier:{class:["buttonFlat-icon__green-button"]}},on:{click:t.acceptCall}},[t._v(t._s(t.$t("acceptCall")))]),e("ButtonIconFlat",{attrs:{icon:{name:"FinishCall"},modifier:{class:["buttonFlat-icon__red-button"]}},on:{click:t.rejectCall}},[t._v(t._s(t.$t("rejectCall")))])],1)])},uO=[],dO={components:{Avatar:E,ButtonLabel:Z,ButtonIcon:Nt},data:function(){return{acceptCamera:!0,timeOutCalling:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCallFromUserInfo:"chat/getCallFromUserInfo",getCurrentVideoCall:"chat/getCurrentVideoCall",getUserDetail:"user/getUserDetail",getSession:"auth/getSession"})),{},{getAcceptCamera:function(){return this.acceptCamera?"VideoOn":"VideoOff"},getAvatarUrl:function(){return this.getCallFromUserInfo.avatar}}),methods:{acceptVideo:function(){this.acceptCamera=!this.acceptCamera},rejectCall:function(){var t={command:"DropCall",token:this.getSession,data:{from:this.getCurrentVideoCall.from,to:this.getCurrentVideoCall.to}};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:t}),this.$store.commit("chat/setCurrentVideoCall",null),this.$store.commit("chat/setCallFromUserInfo",null),this.$emit("rejectCall")},acceptCall:function(){clearTimeout(this.timeOutCalling),this.$store.commit("chat/setCurrentVideoCall",{from:this.getCurrentVideoCall.from,to:this.getCurrentVideoCall.to,room:this.getCurrentVideoCall.room,status:"answer"}),this.$store.commit("modal/setVideoCallModal",{mode:"in",video:this.acceptCamera});var t={command:"AnswerCall",token:this.getSession,data:{from:this.getCurrentVideoCall.from,to:this.getCurrentVideoCall.to}};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:t}),this.$emit("acceptCall")}},mounted:function(){var t=this;this.timeOutCalling=setTimeout((function(){t.$emit("rejectCall")}),7e4)}},hO=dO,pO=(i("f4f9"),Object(C["a"])(hO,lO,uO,!1,null,"e073193c",null)),gO=pO.exports,fO=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PaymentInfo",on:{click:t.closeNotification}},[e("div",{staticClass:"avatarBlock"},[e("img",{staticClass:"avatar",attrs:{src:t.srcUser,alt:""}}),e("img",{staticClass:"logo",attrs:{src:t.ttLogoSrc,alt:""}})]),e("div",{staticClass:"textBlock"},[e("div",{staticClass:"topText"},[e("span",{staticClass:"title"},[t._v("Оформлена подписка")]),e("span",{staticClass:"circle"}),e("span",{staticClass:"date"},[t._v(t._s(t.dateText))])]),e("div",{staticClass:"bottomText"},[t._v("Поздравляем, Вы оформили подписку на TopTrader.")])])])},mO=[],vO={name:"PaymentInfo",components:{},props:{order:{type:Object},notification:{type:Boolean,default:!1}},mixins:[],data:function(){return{}},watch:{},computed:{srcUser:function(){return"User-profile.png"===this.order.userInfo.avatarURL?i("81bc"):this.order.userInfo.avatarURL},ttLogoSrc:function(){return i("700b")},dateText:function(){return new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(new Date(this.order.createdDateTime))}},methods:{closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)}},mounted:function(){},destroyed:function(){}},yO=vO,CO=(i("30b8"),Object(C["a"])(yO,fO,mO,!1,null,"fe05da68",null)),bO=CO.exports,SO=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneSubscriptionPay",class:t.readClass,attrs:{"data-id":t.order.id},on:{click:t.closeNotification}},[e("div",{staticClass:"OneSubscriptionPay-content"},[e("div",{staticClass:"photoContent"},[t.srcImg?e("img",{staticClass:"imgUser",attrs:{alt:"",src:t.srcImg}}):e("div",{staticClass:"defaultUserIcon"},[e("svgIcon",{attrs:{name:"empty-avatar",color:"#8c8c8c"}})],1),e("div",{staticClass:"userIcon",style:t.styleUserIcon},[e("svgIcon",{attrs:{name:"RegBill",color:t.colorIcon}})],1)]),e("div",{staticClass:"textContent"},[e("div",{staticClass:"name"},[t._v(t._s(t.nameUser)),e("span",[t._v(" "+t._s(t.date))])]),e("div",{staticClass:"OneSubscriptionPay-description",domProps:{innerHTML:t._s(t.descriptionText)}})])]),e("div",{staticClass:"OneSubscriptionPay-line"})])},PO=[],TO={name:"OneSubscription",mixins:[xt,qe],props:{order:{type:Object},notification:{type:Boolean,default:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({defaultAccount:"subscribeOrders/getDefaultAccount",getProfileAccount:"subscribeOrders/getProfileAccount",getServerTime:"serverTime/getServerTime",getUserID:"auth/getUserID"})),{},{iAmSource:function(){return this.order.data.IsPersonalInfo},getCurrencyChar:function(){return this.defaultAccount.currencyChar},nameUser:function(){var t,e=this.order.dataType;if(!this.iAmSource&&!["PaymentInfo","SourceInfo"].includes(e)){var i=this.order.sourceUserInfo||{},o=i.firstName,n=i.lastName;return"".concat(o||""," ").concat(n||"")}return this.iAmSource&&this.stopLossStatus?null!==(t=this.order)&&void 0!==t&&t.data.BagInfo?this.order.data.BagInfo.Name:this.order.data.SourceName:this.$t("you")},nameProvider:function(){var t=this.order.sourceUserInfo||{},e=t.firstName,i=t.lastName;return"".concat(e||""," ").concat(i||"")},isPayment:function(){var t;return"payment"===(null===(t=this.order.data)||void 0===t?void 0:t.Action)||"PaymentInfo"===this.order.dataType},textActionNew:function(){return this.iAmSource?this.$t("nyacs")[0](this.nameProvider):this.$t("incys")},textActionClose:function(){return this.iAmSource?this.$t("ctcos")[0](this.nameProvider):this.$t("ctcoys")},textActionUpdate:function(){return this.iAmSource?this.$t("ctsocsf")[0](this.nameProvider):this.$t("ctsocys")},textAutotradeFalse:function(){return this.iAmSource?this.$t("subscribed_to_signals")[0](this.nameProvider):this.$t("stys")},textAutotradeFalseClose:function(){return this.iAmSource?this.$t("unsubscribed_from_signals")[0](this.nameProvider):this.$t("ufys")},textActionPayment:function(){var t,e=null===(t=this.order.data)||void 0===t?void 0:t.Amount;if("PaymentInfo"===this.order.dataType)return this.$t("ptif")[0](e);if(this.iAmSource)return"Оплатили выставленный счет на $".concat(e,"");var i=this.order.data.Type;return"subscription"===i?this.$t("ptiffcys")[0](e):"Оплатил выставленный счет на $".concat(e," за подписку на Ваш контент")},textMaxDDAction:function(){var t=this.order.data;return this.iAmSource?"Остановка копирования ".concat(t.Contract,' по Stop Loss'):"Отменил копирование ".concat(t.Contract,' по Stop Loss')},textContentActive:function(){return this.iAmSource?"Подписались на контент “".concat(this.nameProvider,"”"):"Подписался на Ваш контент"},textContentClose:function(){return this.iAmSource?"Отписались от контента “".concat(this.nameProvider,"”"):"Отписался от Вашего контента"},textSourceInfo:function(){var t=this.order.data,e=t.StopDateTime,i=t.Contract;return e?"Вы удалили инструмент ".concat(i," из списка предоставляемых торговых сигналов"):"Вы сохранили настройки инструмента ".concat(i," для предоставления торговых сигналов")},descriptionText:function(){return this.iAmSource?"C Вашего счета №".concat(this.defaultAccount.sequenceId," списано ","".concat(this.getCurrencyChar," ").concat(this.order.data.AdditionalInfo)," за подписку на автокопирование на провайдера ").concat(this.nameProvider," по контракту ").concat(this.order.data.Contract,""):"На ваш счет №".concat(this.getSourceSequenceId(this.order.data.Account.Id)," будет зачислено ","".concat(this.getCurrencyChar," ").concat(this.order.data.AdditionalInfo)," за подписку на автокопирование пользователя ").concat(this.nameUser,"")},readClass:function(){var t;return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{noRead:null===this.order.readedDateTime&&!this.notification,notification:this.notification,paymentRed:"PaymentInfo"===this.order.dataType,paymentGreen:"payment"===(null===(t=this.order.data)||void 0===t?void 0:t.Action)})},nameIcon:function(){return this.isPayment?"SortDollar":"AutoFolow"},date:function(){return new Intl.DateTimeFormat("ru-RU",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(this.order.createdDateTime))},srcImg:function(){var t,e,i,o,n=this.order.dataType;return"SourceInfo"===n?null===(i=this.order.userInfo)||void 0===i?void 0:i.avatarURL:this.iAmSource||"PaymentInfo"===n?this.iAmSource&&"SubNotification"===n&&"stopwork max dd"===this.order.data.Action?null===(t=this.order.sourceUserInfo)||void 0===t?void 0:t.avatarURL:null===(e=this.order.userInfo)||void 0===e?void 0:e.avatarURL:null===(o=this.order.sourceUserInfo)||void 0===o?void 0:o.avatarURL},styleUserIcon:function(){return this.isPayment?{backgroundColor:"#fff"}:{backgroundColor:this.stopLossStatus?this.getRedColor.color:this.darkClass.dark?"#00b9fc":"#3C73F1"}},stopLossStatus:function(){var t;return"stopwork max dd"===(null===(t=this.order)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.Action)},colorIcon:function(){var t=this.darkClass.dark?"#00b9fc":"#3C73F1";return this.isPayment?t:"#fff"}}),methods:{getSourceSequenceId:function(t){var e=this.getProfileAccount.find((function(e){return e.id===t}));return null===e||void 0===e?void 0:e.sequenceId},closeNotification:function(){this.notification&&this.$emit("removeNotification",this.order.id)}}},xO=TO,OO=(i("eabf"),Object(C["a"])(xO,SO,PO,!1,null,"29821eae",null)),wO=OO.exports,_O=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UnknownOrder",on:{click:t.closeNotification}},[e("p",[t._v("Order dataType:"),e("span",[t._v(" "+t._s(t.order.dataType))])]),e("p",[t._v("NotificationType:"),e("span",[t._v(" "+t._s(t.order.data.NotificationType||t.order.data.Type))])])])},AO=[],DO={name:"UnknownOrder",props:{order:{type:Object}},methods:{closeNotification:function(){this.$emit("removeNotification",this.order.id)}}},kO=DO,IO=(i("2004"),Object(C["a"])(kO,_O,AO,!1,null,"2fe8e73b",null)),BO=IO.exports,MO={name:"ToastNotification",components:{Toast:Hx,Order:Qx,Event:iO,inCallNotification:gO,PreSignal:cO,OpenOrder:mT,ClosedOrder:uT,PendingOrder:PT,OneSubscription:KT,OneSubscriptionPay:wO,UnknownOrder:BO,PaymentInfo:bO},data:function(){return{interval:null,listNotification:[],intermediateArrayNotification:[],toast:!1,order:null,callIn:!1,notification:[],countDeadNoti:0,alertAudio:new Audio(i("9531")),chatMsgAudio:new Audio(i("047d")),openAlertAudio:new Audio(i("0bad")),inCall:new Audio(i("6869")),index:1,autotradeOrders:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({profileAccount:"subscribeOrders/getProfileAccount",getVideoCallStatus:"modal/getVideoCallStatus",getUserSettings:"userSettings/getUserSettings",getChatCurrentRoom:"chat/getChatCurrentRoom",getCurrentVideoCall:"chat/getCurrentVideoCall",getChatAuth:"chat/getChatAuth",getSession:"auth/getSession",getApiChat:"api/apiChat",getApiUrl:"api/api",getStatusCall:"chat/getStatusCall",getActiveTheme:"headerSettings/getActiveTheme",getProfileAccount:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActivePrortfolios:"expertsPortfolio/getActivePrortfolios",fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{getNotification:function(){return this.notification},getStatusSignalNotification:function(){if(this.getUserSettings)return void 0===this.getUserSettings.notiSignal||this.getUserSettings.notiSignal}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({addNewTelegramMessage:"messenger/addNewTelegramMessage",showToast:"toast/showToast"})),{},{ordersNotification:function(t){switch(t){case"OrderOpened":case"MarketOrderModified":return"OpenOrder";case"OrderClosed":return"ClosedOrder";case"PendingOrderPlaced":case"PendingOrderClosed":case"PendingOrderModified":return"PendingOrder";default:return"UnknownOrder"}},subNotification:function(t){var e=t.data,i=t.type,o=t.dataType;if("sourceorder"===i)switch(e.Action){case"new":case"modify":return"OpenOrder";case"close":return"ClosedOrder";default:return"UnknownOrder"}if("subscription"===i)switch(e.Action){case"close":case"active":case"update":case"payment":case"stopwork max dd":return"OneSubscription";case"Pay":return"OneSubscriptionPay";default:return"UnknownOrder"}if("contentsubscription"===i||"SourceInfo"===o)return"OneSubscription"},componentName:function(t){var e=t.dataType,i=t.data,o=t.data.Type;return"PaymentInfo"===e?"PaymentInfo":"OrderExecution"===e?this.ordersNotification(i.NotificationType):["SourceInfo","SubNotification"].includes(e)?this.subNotification({data:i,type:o,dataType:e}):void 0},getUserInfoForCalling:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.$http.get("".concat(e.getApiUrl,"UserSimple?login=").concat(t)).then((function(t){var i=t.data;e.$store.commit("chat/setCallFromUserInfo",{username:"".concat(i.firstName," ").concat(i.lastName),avatar:i.avatarURL})}));case 2:case"end":return i.stop()}}),i)})))()},takeACall:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.getCurrentVideoCall){i.next=8;break}return e.inCall.play(),i.next=4,e.getUserInfoForCalling(t.from);case 4:e.$store.commit("chat/setCurrentVideoCall",{from:t.from,to:t.to,room:t.uui,status:"expectation"}),e.callIn=!0,i.next=9;break;case 8:"expectation"===e.getCurrentVideoCall.status&&t.from===e.getCurrentVideoCall.from?e.inCall.play():(o={command:"RejectCall",token:e.getSession,data:{from:t.from,to:t.to}},e.$socketStream.sendCommand({ws:"apiWS_NOTI",command:o}));case 9:case"end":return i.stop()}}),i)})))()},rejectCall:function(){this.callIn=!1,this.phoneTimeOut=null,this.inCall.pause(),this.inCall.currentTime=0},myAccountsIDs:function(t){var e=this.getProfileAccount.map((function(t){return t.id}));return e.includes(t.accountId)},setMessageHandler:function(t){if("NotificationHistory"!==t.command){var e,i=JSON.parse(JSON.stringify(t.data));if(i.data)i.data=JSON.parse(i.data),"PaymentInfo"===(null===t||void 0===t||null===(e=t.data)||void 0===e?void 0:e.dataType)&&(this.$store.commit("paymentService/setInvoices",null),this.$store.commit("paymentService/setPaymentServices",null),this.$store.dispatch("paymentService/getInvoiceByFilter"),this.$store.dispatch("paymentService/getPaymentService",{id:this.getDefaultAccount.id,isUserId:!1}));this.setNotification(i)}},infoChannelHandler:function(t){this.$store.commit("userStreams/setNewDataForStream",{field:"status",data:t.data.status}),"Start"===t.data.status&&this.$store.dispatch("modal/switchStreamSettingsModal",{status:!0,data:""})},readHandlerFunction:function(){this.autotradeOrders=[]},errorMaxDDOpenOrderHandler:function(t){this.showToast({visible:!0,componentName:"MaxDDMessage",shading:!0,dopInfo:{order:t}})},errorOpenOrderHandler:function(t){var e=this,i=t.data;this.autotradeOrders.push(i);var o,n="",s="InsufficientEquity"===(null===i||void 0===i?void 0:i.Status),r=i.OpenedCount>=i.MaxOpenPositions,a="";if(s){var c,l;if(null===(c=this.getActivePrortfolios)||void 0===c||!c.length)return;if(null!==(l=this.getActivePrortfolios)&&void 0!==l&&l.length){var u=this.fullListSubscription.find((function(t){var e;return+(null===(e=t.subscription)||void 0===e?void 0:e.id)===+(null===i||void 0===i?void 0:i.SubscriptionId)})),d=u.subscription.bagId,h=this.getActivePrortfolios.find((function(t){return t.id===d}));o=h.name}a="недостаточно средств на счете для выполнения операции"}r&&(s&&(a+=", а также "),a="превышено максимально допустимое количество сделок (".concat(i.MaxOpenPositions,") по данному сигналу")),this.autotradeOrders.forEach((function(t,i){var s=e.autotradeOrders.length>1&&i-1!==e.autotradeOrders.length;n+='Вы не можете инвестировать в портфель "'.concat((null===t||void 0===t?void 0:t.BagName)||o,'" \n по сигналу ').concat(t.Symbol||t.Contract,", т.к. ").concat(a),s&&(n+="

")})),this.showToast({visible:!0,componentName:"ToastMessage",shading:!0,width:430,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",congratulationStatus:"error",functionArrayByClose:[this.readHandlerFunction],message:n,dataOrder:i}})},reportModalHandler:function(t){this.$store.commit("reportsModal/setVisible",{visible:!0,dataPeriod:[t]})},setNotification:function(t){var e,i;if(10!==t.dataType){var o,n,s,r;if("autotrade"===(null===(e=t.data)||void 0===e?void 0:e.Type)||"InsufficientEquity"===(null===(i=t.data)||void 0===i?void 0:i.Status))if("stopwork max position"!==(null===(o=t.data)||void 0===o?void 0:o.Action)&&"InsufficientEquity"!==(null===(n=t.data)||void 0===n?void 0:n.Status)||this.errorOpenOrderHandler(t),"stopwork max dd"===(null===(s=t.data)||void 0===s?void 0:s.Action)&&this.errorMaxDDOpenOrderHandler(t),"InsufficientEquity"!==(null===(r=t.data)||void 0===r?void 0:r.Status))return;if("TelegramMessage"!==t.dataType)if(null!==t&&void 0!==t&&t.action&&"Call"===t.action)this.takeACall(t);else{if(["Drop","Reject"].includes(null===t||void 0===t?void 0:t.action)){var a;if(["answer","calling"].includes(null===(a=this.getCurrentVideoCall)||void 0===a?void 0:a.status))return;return this.callIn&&this.rejectCall(),void(this.getVideoCallStatus.status||this.callIn||this.$store.commit("chat/setCurrentVideoCall",null))}this.playAudio(),t.indexId=this.index,this.intermediateArrayNotification.push(t),this.index+=1,this.$store.dispatch("notifications/addOrder",t)}else this.addNewTelegramMessage(t.data)}else this.reportModalHandler(t)},removeNotification:function(t){this.listNotification=this.listNotification.filter((function(e){return e.id!==t}))},playAudio:function(){this.getStatusSignalNotification&&(this.listNotification.length?this.openAlertAudio.play():this.alertAudio.play())}}),watch:{intermediateArrayNotification:function(){var t=this;this.intermediateArrayNotification.length?(clearInterval(this.interval),this.interval=setInterval((function(){t.listNotification.push(t.intermediateArrayNotification[0]);var e=t.intermediateArrayNotification.splice(0,1);setTimeout((function(){t.removeNotification(e[0].id)}),5e3)}),1e3)):clearInterval(this.interval)}},mounted:function(){this.$socketStream.events.subscribe("apiWS_NOTI",this.setMessageHandler)}},$O=MO,LO=(i("c356"),Object(C["a"])($O,jx,Rx,!1,null,null,null)),FO=LO.exports,jO=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.open,title:t.$t("afota"),modifier:"modal--broker-callback",width:"417"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-label"},[t._v(t._s(t.$t("yourName")))]),e("Input-text",{attrs:{placeholder:t.$t("yourName"),pattern:t.namePattern,errorText:t.$t("nameOnlyContain")},on:{patternValid:function(e){return t.validData(e)}},model:{value:t.callback.name,callback:function(e){t.$set(t.callback,"name",e)},expression:"callback.name"}})],1),e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-label"},[t._v(t._s(t.$t("contactNumber")))]),e("Input-text",{attrs:{placeholder:t.$t("phoneNumber"),pattern:t.phonePattern,errorText:t.$t("invNumbFor")},on:{patternValid:function(e){return t.validData(e)}},model:{value:t.callback.phone,callback:function(e){t.$set(t.callback,"phone",e)},expression:"callback.phone"}})],1),e("div",{staticClass:"form-message"},[t._v(t._s(t.$t("sendReqCustomShort"))+".")]),e("Status-message",{attrs:{enabled:t.status.enabled,text:t.status.text,icon:t.status.icon,typeMsg:t.status.type,opacity:t.status.opacity}})]},proxy:!0},{key:"modal-footer",fn:function(){return["2"!==t.status.type?e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:t.close}},[t._v(t._s(t.$t("cancelWord")))]),e("Button",{attrs:{typeBtn:"primary",disable:!t.valid||t.process,process:t.process}},[t._v(t._s(t.$t("sentWord")))])],1):t._e()]},proxy:!0}])})},RO=[],WO=function(){var t=this,e=t._self._c;return e("div",{staticClass:"input-text",class:{"input-text--small":t.small}},[t.label&&!t.small?e("label",{staticClass:"input-text__label"},[t._v(t._s(t.label))]):t._e(),e("span",{staticClass:"input-text__wrapper"},[t.small?t._e():e("span",{staticClass:"input-text__placeholder"},[t._v(t._s(t.placeholder))]),t.prefix&&!t.small?e("span",{staticClass:"input-text__prefix",class:{"input-text__prefix--active":t.prefixOpen},on:{click:t.togglePrefix}},[t._v(t._s(t.prefix)+" "),e("svgIcon",{attrs:{name:t.prefixArrowIcon}})],1):t._e(),t.prefix&&t.small?e("span",{staticClass:"input-text__prefix",on:{click:function(e){return t.$emit("clickPrefix")}}},[e("Button-label",{attrs:{iconName:"Arrow-dropdown-bottom",modifier:"flat reverse"}},[t._v(" "+t._s(t.prefix)+" ")])],1):t._e(),e("input",t._b({staticClass:"input-text__control input-text__control--tel",class:{"input-text__control--invalid":t.error},attrs:{type:"tel",placeholder:t.placeholderValue,pattern:"[(][0-9]{3}[)] [0-9]{3}-[0-9]{4}",autocomplete:"tel",maxlength:"15"},domProps:{value:t.val},on:{input:function(e){return t.onInput(e,t.pattern,t.model)}}},"input",t.$attrs,!1)),t.icon?e("span",{staticClass:"input-text__icon",on:{mouseover:t.hoverHandler,mouseleave:t.leaveHandler}},[e("Button-icon",{attrs:{modifier:"flat square",iconName:t.icon}})],1):t._e()]),e("span",{staticClass:"input-text__helper"},[t.error?e("span",[e("SvgIcon",{attrs:{name:"Warning"}}),e("span",[t._v(t._s(t.errorText))])],1):t._e()])])},NO=[],EO={components:{SvgIcon:L,ButtonIcon:Nt,ButtonLabel:Z},inheritAttrs:!1,data:function(){return{error:!1,val:this.model,inputType:this.type,prefixOpen:!1}},model:{prop:"model"},props:{model:{type:String},type:{type:String,default:"text"},small:{type:Boolean},label:{type:String},icon:{type:String},placeholder:{type:String},errorText:{type:String,default:"Ошибка"},errorTextServer:{type:String,default:"Ошибка сервера"},pattern:{type:String},prefix:{type:String},placeholderValue:String,mask:String},computed:{prefixArrowIcon:function(){return!0===this.prefixOpen?"Arrow-dropdown-top":"Arrow-dropdown-bottom"}},watch:{model:function(t){var e=t.replace(/\D/g,"").match(/(\d{0,3})(\d{0,3})(\d{0,4})/);this.val=e[2]?"("+e[1]+")"+e[2]+(e[3]?"-"+e[3]:""):"("+e.input+")","()"===this.val&&(this.val="")}},methods:{validate:function(t,e){if(e){var i=new RegExp(t);i.test(e)?this.error=!1:(this.error=!0,e=""),this.$emit("patternValid",i.test(e))}else this.$emit("patternValid",!1)},onInput:function(t,e,i){this.validate(e,i),this.$emit("input",t.target.value)},hoverHandler:function(){this.$emit("hover")},leaveHandler:function(){this.$emit("leave")},togglePrefix:function(){this.prefixOpen=!this.prefixOpen,this.$emit("clickPrefix")}}},UO=EO,VO=(i("c7d3"),Object(C["a"])(UO,WO,NO,!1,null,null,null)),HO=VO.exports,GO=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"fadeOut"}},[t.enabled?e("div",{staticClass:"status-message",class:t.getCssClass,style:t.getOpacity},[e("div",{staticClass:"status-message__row"},[e("div",{staticClass:"status-message__icon"},[e("SvgIcon",{attrs:{name:t.icon}})],1),t.markup?e("div",{staticClass:"status-message__text",domProps:{innerHTML:t._s(t.text)}}):e("div",{staticClass:"status-message__text"},[t._v(t._s(t.text))])]),e("div",{staticClass:"status-message__component"},[t._t("default")],2)]):t._e()])},qO=[],zO={name:"StatusMessage",components:{SvgIcon:L},props:{enabled:{type:Boolean},icon:{type:String},text:{String:String},typeMsg:{type:[String,Number],default:3},opacity:{type:String,default:"0.5"},markup:{type:Boolean}},computed:{getCssClass:function(){return 0===this.typeMsg?"status-message--error":1===this.typeMsg?"status-message--warning":2===this.typeMsg?"status-message--success":(this.typeMsg,"status-message--message")},getOpacity:function(){return"background: rgba(255, 255, 255, ".concat(this.opacity)}}},YO=zO,XO=(i("00d2"),Object(C["a"])(YO,GO,qO,!1,null,null,null)),QO=XO.exports,JO={components:{Modal:Oe,Button:Pa,InputPhone:HO,InputText:Aa,StatusMessage:QO},data:function(){return{callback:{name:"",phone:""},phonePattern:"^\\d{11}$",namePattern:"^[a-zA-Zа-яА-Я\\s-]+$",valid:!1,status:{enabled:!1,type:"0",text:"Заявка отправлена!",icon:"Warning",opacity:"1"},process:!1}},props:{open:{type:Boolean},email:{type:String},userId:{type:String}},computed:Object(c["a"])({},Object(p["c"])({getGlobalEmail:"globals/getGlobalEmail",getEmailTTApi:"api/emailTTApi",getSession:"auth/getSession"})),watch:{"callback.name":{handler:"validData"},"callback.phone":{handler:"validData"}},methods:{validData:function(t){if(t){var e=this.callback,i=e.name,o=e.phone;this.valid=!(!i||!o)}else this.valid=!1},sendData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.process=!0,i='this.getApi + "SaveCallBack"',o=t.callback,n=o.name,s=o.phone,a={contactName:n,phone:s,email:"",status:"Created",actionType:"CreateAccount",partnerID:"this.getPartner.id"},e.next=6,t.$workKeys.signMessage(JSON.stringify(a),t.getSession.sk);case 6:return c=e.sent,l={headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":c}},e.next=10,t.$http.post(i,a,l).then((function(e){t.process=!1,e&&(t.status.enabled=!0,t.status.type="2",setTimeout((function(){t.status.enabled=!1,t.close(),t.callback.name="",t.callback.phone=""}),2e3))})).catch((function(e){e.response?setTimeout((function(){t.process=!1,t.status.type="0",t.status.enabled=!0,t.status.text="Сервер не отвечает. Повторите позже."}),5e3):e.request?setTimeout((function(){t.process=!1,t.status.type="0",t.status.enabled=!0,t.status.text="Ответ не получен"}),2e3):setTimeout((function(){t.process=!1,t.status.type="0",t.status.enabled=!0,t.status.text="Что-то пошло не так..."}),2e3)}));case 10:case"end":return e.stop()}}),e)})))()},close:function(){this.$store.dispatch("modal/switchExpertsOpenTradingAccountModal")}}},KO=JO,ZO=(i("504f"),Object(C["a"])(KO,jO,RO,!1,null,null,null)),tw=ZO.exports,ew=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"dxPopup",attrs:{visible:!0,"close-on-outside-click":!1,elementAttr:t.popupAtr,"show-close-button":!1,"title-template":"videoWrap",position:t.positionPopup.position,shading:!1,minHeight:t.positionPopup.minHeight,minWidth:t.positionPopup.minWidth,width:t.positionPopup.width,height:t.positionPopup.height,showTitle:!0,dragEnabled:!0,resizeEnabled:!t.minimazeMode,fullScreen:t.fullScreen},scopedSlots:t._u([{key:"videoWrap",fn:function(i){i.data;return[e("div",{ref:"popup",class:"chatConference chatConference_".concat(t.getActiveTheme)},[e("div",{class:t.minimazeMode?"chatConference-minMode":"chatConference-fullMode"},[e("div",{class:"chatConference-title chatConference-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"chatConference-titleText"},[t._v(" Видеоконференция")]),e("div",{staticClass:"chatConference-titleControl"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-button","chatConference-button_".concat(t.getActiveTheme)],style:{marginRight:"0.6rem"}},icon:{name:t.minimazeMode?"Expand":"Unexpand"}},on:{click:t.minimazePopup}}),e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-button","chatConference-button_".concat(t.getActiveTheme)]},icon:{name:"FullScreen"}},on:{click:t.setFullScreen}})],1)]),e("div",{staticClass:"chatConference-contentWrap"},[e("div",{staticClass:"chatConference-wrap"},[e("div",{class:t.minimazeMode?"chatConference-body_minMode":"chatConference-body"},[t._l(t.getNumberPlayers,(function(i,o){return t.getNumberPlayers?e("div",{key:o,staticClass:"chatConference-row",class:t.minimazeMode?"chatConference-row_minMode":t.getClassModifier},t._l(i,(function(i,o){return e("div",{staticClass:"chatConference-localVideo",style:t.getMaxWidthModifierPlayer},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.minimazeMode||i.id===t.activeSpeaker,expression:"minimazeMode ? player.id === activeSpeaker : true"}],class:"chatConference-videoPlayerWrap chatConference-videoPlayerWrap_".concat(t.getActiveTheme," ").concat(i.id===t.activeSpeaker?"chatConference-videoPlayerWrap_active":""," ").concat(i.muteStatus?"chatConference-videoPlayerWrap_muteVideo":""," ").concat(t.minimazeMode?"chatConference-videoPlayerWrap_minMode":"")},[e("video",{directives:[{name:"show",rawName:"v-show",value:!i.muteStatus,expression:"!player.muteStatus"}],ref:i.player,refInFor:!0,attrs:{autoplay:"1"}}),e("div",{staticClass:"chatConference-videoMutedStatus",class:t.getAvatarAndNameForMuteStatus(i.id).muteAudioStatus?"chatConference-videoMutedStatus_unmute":"chatConference-videoMutedStatus_mute"},[e("div",{staticClass:"chatConference-videoMutedStatus-icon",class:i.id===t.activeSpeaker?"chatConference-videoMutedStatus-icon_green":"chatConference-videoMutedStatus-icon_blue"},[e("svgIcon",{attrs:{name:t.getAvatarAndNameForMuteStatus(i.id).muteAudioStatus?"MicOn":"MicOff"}})],1),e("div",{staticClass:"chatConference-videoMutedStatus-username"},[t._v(t._s(t.getAvatarAndNameForMuteStatus(i.id).name))])]),t.showSignal&&i.signal?e("div",{staticClass:"chatConference-videoSignalServer",style:t.getColorSignal(i.signal)},[e("svgIcon",{attrs:{name:"SortUpper",size:24}}),t._v(t._s(i.signal))],1):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:i.muteStatus,expression:"player.muteStatus"}],staticClass:"chatConference-muteVideo"},[e("div",{staticClass:"chatConference-avatar"},[e("div",{staticClass:"chatConference-avatar_blur"}),e("Avatar",{attrs:{size:"19",src:t.getAvatarAndNameForMuteStatus(i.id).avatar}})],1),e("div",{staticClass:"chatConference-name"},[t._v(t._s(t.getAvatarAndNameForMuteStatus(i.id).name))])])])])})),0):t._e()})),t.getAudioTracksLength?e("div",{staticClass:"chatConferenceAudioTrack"},t._l(t.audioTracks,(function(t,i){return e("audio",{key:i,ref:"audioPlayer"+i,refInFor:!0,attrs:{autoplay:"1"}})})),0):t._e()],2),e("div",{staticClass:"chatConference-navigation"},[e("div",{staticClass:"chatConference-navigation-controls"},[e("div",{staticClass:"chatConference-navigation_videoCameraButton"},[e("ButtonIconFlat",{attrs:{icon:{name:t.getAcceptCamera,color:t.getColorVideoCamIcon},modifier:{class:["videoCallButton","videoCallButton_".concat(t.getActiveTheme),t.videoDevices&&t.videoDevices.length?"videoCallButton_group":""]},title:"Вкл/выкл камеру"},on:{click:t.setAcceptVideo}}),t.videoDevices&&t.videoDevices.length?e("ButtonIconFlat",{attrs:{icon:{name:"new-dropdown-arrow-up"},modifier:{class:["videoCallOption","videoCallOption_".concat(t.getActiveTheme),"videoCallOptionCamera"]},title:"Список видеоустройств"},on:{click:t.openSourceCamera}}):t._e()],1),e("div",{staticClass:"chatConference-navigation_videoCameraButton"},[e("ButtonIconFlat",{attrs:{icon:{name:t.getAcceptAudio,color:t.getColorMicIcon},modifier:{class:["videoCallButton","videoCallButton_".concat(t.getActiveTheme),t.audioDevices&&t.audioDevices.length?"videoCallButton_group":""]},title:"Вкл/выкл микрофон"},on:{click:t.setAcceptAudio}}),t.audioDevices&&t.audioDevices.length?e("ButtonIconFlat",{attrs:{icon:{name:"new-dropdown-arrow-up"},modifier:{class:["videoCallOption","videoCallOption_".concat(t.getActiveTheme),"videoCallOptionMic"]},title:"Список аудиоустройств"},on:{click:t.openSourceMic}}):t._e()],1),e("ButtonIconFlat",{attrs:{icon:{name:"ShareMonitor",color:t.getIconSharedColorIcon},disabled:t.disabledSharingDesktop,modifier:{class:["videoCallButton","videoCallButton_".concat(t.getActiveTheme)]},title:"Показать экран"},on:{click:t.getSharingDecktop}}),t.isJoined?e("div",{staticClass:"chatConference-navigation-controls-item"},[e("DxTooltip",{attrs:{visible:t.tooltipCopy,target:".videoCallButtonCopy",container:".videoCallButtonCopy",position:"top"}},[t._v("Ссылка скопированна")]),e("ButtonIconFlat",{attrs:{modifier:{class:["videoCallButton","videoCallButton_".concat(t.getActiveTheme),"videoCallButtonCopy"],style:{marginLeft:"0.6rem"}},icon:{name:"Copy"}},on:{click:t.copyPath}})],1):t._e()],1),e("div",{staticClass:"chatConference-navigation-controls"},[t.isJoined?t._e():e("div",{staticClass:"chatConference-navigation-controls-item"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-greenButton"]},icon:{name:"Videoconference"}},on:{click:t.beginConference}},[t._v(t._s(t.$t("confStart")))])],1),t.isJoined?t._e():e("div",{staticClass:"chatConference-navigation-controls-item"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-redButton"]},icon:{name:"Close"}},on:{click:t.closeCoference}},[t._v(t._s(t.$t("cancelWord")))])],1),t.isJoined?e("div",{staticStyle:{"margin-right":"0.6rem"}},[t._v(t._s(t.getTimerTime))]):t._e(),t.isJoined?e("div",{staticClass:"chatConference-navigation-controls-item"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-redButton"]},icon:{name:"Close"}},on:{click:t.endCoference}},[t._v(t._s(t.$t("confEnd")))])],1):t._e()])])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.participantStatus&&!t.minimazeMode&&t.isJoined,expression:"participantStatus && !minimazeMode && isJoined"}],class:"".concat(t.mimimazeLeftSide?"chatConference-participantMinimaze chatConference-participantMinimaze_".concat(t.getActiveTheme):"chatConference-participant chatConference-participant_".concat(t.getActiveTheme))},[e("div",{class:"chatConference-title chatConference-title_".concat(t.getActiveTheme),style:{borderRadius:"0.6rem 0.6rem 0 0"}},[e("div",{staticClass:"chatConference-titleControl",style:{marginLeft:0,marginRight:"0.6rem"}},[e("ButtonIconFlat",{attrs:{modifier:{class:["chatConference-button","chatConference-button_".concat(t.getActiveTheme)],style:{marginRight:"0.6rem"}},icon:{name:t.mimimazeLeftSide?"Block-expand-left-close":"Block-expand-right-close"}},on:{click:t.hideLeftBar}})],1),e("div",{staticClass:"chatConference-titleText",class:t.mimimazeLeftSide?"chatConference-participantHide":"chatConference-participantShow",style:{marginLeft:0}},[t._v(t._s(t.$t("confParts")))])]),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.mimimazeLeftSide,expression:"!mimimazeLeftSide"}],class:"chatConference-sideBarContent chatConference-sideBarContent_".concat(t.getActiveTheme)},[e("DxAccordion",{attrs:{"data-source":t.getConferenceParticipant,multiple:!0,focusStateEnabled:!1,collapsible:!0,selectedItems:t.getConferenceParticipant},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("ChatSection",{attrs:{name:o.text,count:o.count,theme:t.getActiveTheme,width:"30rem"}})]}},{key:"item",fn:function(i){var o=i.data;return["member"===o.component?e("div",t._l(o.collection,(function(i,o){return e("div",{key:o,staticClass:"chatConference-participantItem"},[e("div",{staticClass:"chatConference-participantWrap"},[e("div",{staticClass:"chatConference-participantAvatar"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme}})],1),e("div",{staticClass:"chatConference-participantInfo"},[e("div",{class:"chatConference-participantName chatConference-participantName_".concat(t.getActiveTheme)},[t._v(t._s(i.username))]),e("div",{class:"chatConference-participantRole chatConference-participantRole_".concat(t.getActiveTheme)},[t._v(t._s(i.role))])])]),e("div",{class:"chatConference-participantControl chatConference-participantControl_".concat(t.getActiveTheme)},[t._l(i.tracks,(function(o,n){return e("div",{class:t.checkModeratorMutedStatus({id:i.id,type:o.type})?"chatConference-participantControl_disabledModerator":"",on:{click:function(e){return t.sendMuteMessage({id:i.id,track:o})}}},[e("svgIcon",{attrs:{name:t.getStatusTrack(o)}})],1)})),e("div",{staticStyle:{cursor:"pointer","margin-left":"1rem"},on:{click:function(e){return t.kickParticipant({id:i.id,username:i.username})}}},[t.getVideoConference.data.isModerator?e("svgIcon",{attrs:{name:"Close"}}):t._e()],1)],2)])})),0):e("div",[e("div",{staticClass:"chatConference-chatWrap"},[e("VuePerfectScrollbar",{ref:"scrollHistory",staticClass:"chatConference-chatHistory",attrs:{id:"scrollHistory"}},t._l(t.chatMessage,(function(i,o){return e("div",{staticClass:"chatConference-chatMessage"},[e("div",{staticClass:"chatConference-chatMessage-senderWrap"},[e("div",{staticClass:"chatConference-chatMessage-senderAvatar"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme}})],1),e("div",{class:"chatConference-chatMessage-senderInfo chatConference-chatMessage-senderInfo_".concat(t.getActiveTheme)},[t._v(t._s(i.username))])]),e("div",{class:"chatConference-chatMessageMsg chatConference-chatMessageMsg_".concat(t.getActiveTheme)},[t._v(t._s(i.msg)+" ")])])})),0),t._v(" "),e("div",{class:"chatConference-chatTextarea chatConference-chatTextarea_".concat(t.getActiveTheme)},[e("Textarea",{ref:"textarea",attrs:{placeholder:"Сообщение",theme:t.getActiveTheme},on:{enter:t.sendTextMessageToChatConference},model:{value:t.textMessage,callback:function(e){t.textMessage=e},expression:"textMessage"}})],1)],1)])]}}],null,!0)})],1)]),t.kickStatus?e("div",{staticClass:"chatConference-kickPopup"}):t._e()])])])]}}])},[e("DxPopup",{attrs:{visible:t.videoSettings,shading:!1,container:".chatConference",position:{my:"bottom left",at:"top left",of:".videoCallOptionCamera",offset:{y:-3}},maxHeight:"300px",maxWidth:"300px",height:"auto",width:"auto",showTitle:!1}},[e("div",{staticClass:"chatConference-device"},[t.videoDevices&&t.videoDevices.length?e("div",{staticClass:"chatConference-deviceList"},t._l(t.videoDevices,(function(i,o){var n;return e("div",{key:o,staticClass:"chatConference-deviceListItem",class:(n={},Object(Vt["a"])(n,"chatConference-deviceListItem-noActive",!i[1].status),Object(Vt["a"])(n,"chatConference-deviceListItem-active",t.getStatusActiveDevice("video",i[0])),n),attrs:{title:i[0].label},on:{click:function(e){return t.getNewVideoLocalTrack(i[0])}}},[t._v(t._s(i[0].label))])})),0):e("div",{staticClass:"chatConference-deviceError"},[t._v("Нет доступных видео устройств"),e("br"),t._v("либо запрещён доступ")])])]),e("DxPopup",{attrs:{visible:t.audioSettings,shading:!1,container:".chatConference",position:{my:"bottom left",at:"top left",of:".videoCallOptionMic",offset:{y:-3}},maxHeight:"300px",maxWidth:"300px",height:"auto",width:"auto",showTitle:!1}},[e("div",{staticClass:"chatConference-device"},[t.audioDevices&&t.audioDevices.length?e("div",{staticClass:"chatConference-deviceList"},t._l(t.audioDevices,(function(i,o){var n;return e("div",{key:o,staticClass:"chatConference-deviceListItem",class:(n={},Object(Vt["a"])(n,"chatConferencel-deviceListItem-noActive",!i[1].status),Object(Vt["a"])(n,"chatConference-deviceListItem-active",t.getStatusActiveDevice("audio",i[0])),n),attrs:{title:i[0].label},on:{click:function(e){return t.getNewAudioLocalTrack(i[0])}}},[t._v(t._s(i[0].label))])})),0):e("div",{staticClass:"chatConference-deviceError"},[t._v("Нет доступных аудио устройств"),e("br"),t._v("либо запрещён доступ")])])])],1)},iw=[],ow=function(){var t=this,e=t._self._c;return e("div",{class:"chat-section chat-section_".concat(t.theme),style:{width:t.width}},[e("div",{staticClass:"chat-section__head"},[e("div",{class:"chat-section__name chat-section__name_".concat(t.theme)},[t._v(t._s(t.name))]),e("div",{class:"chat-section__count chat-section__count_".concat(t.theme)},[t._v(t._s(t.count))])]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],ref:"chatSectionBody",staticClass:"chat-section__body",class:{"chat-section__body--open":t.open},style:"max-height:"+t.getSectionHeight+"px;"},[t._t("default")],2)])},nw=[],sw={props:{name:{type:String},theme:{type:String,default:"light"},width:{type:String,default:"36rem"},count:{type:Number}},data:function(){return{open:!0}},computed:{getSectionHeight:function(){}},methods:{toggleOpen:function(){this.open=!this.open}}},rw=sw,aw=(i("6ec1"),Object(C["a"])(rw,ow,nw,!1,null,"7cddbb51",null)),cw=aw.exports,lw=i("9621"),uw=i.n(lw),dw="https://chat.toptrader.org";bS["a"].init();var hw=bS["a"].isDesktopSharingEnabled();bS["a"].setLogLevel(bS["a"].logLevels.ERROR);var pw={components:{DxPopup:To["DxPopup"],DxAccordion:lw["DxAccordion"],DxTooltip:Pt["DxTooltip"],DxPosition:To["DxPosition"],ButtonLabel:Z,ButtonIcon:Nt,svgIcon:L,ChatSection:cw,Avatar:E,Textarea:ph,VuePerfectScrollbar:Xt.a},data:function(){return{statusDesktop:hw,popupAtr:{class:"conference-popup"},options:null,connection:null,remoteTracks:{},videoTracks:[],audioTracks:[],sharingDesktopStatus:!1,participantsArr:[],positionPopup:{position:{my:"center",at:"center",of:window},minWidth:"640px",minHeight:"480px",width:"70vw",height:"70vh"},chatMessage:[],widthPopup:0,ratePlayers:0,localTracks:[],activeSpeaker:"",conferenceToken:null,acceptCamera:!0,notAllowDevaice:{video:!1,audio:!1},acceptAudio:!0,fullScreen:!1,participantStatus:!0,participantIds:new Set,statusConferenceMessage:null,room:null,textMessage:"",isJoined:!1,blockedUsers:[],mutedModeratorUsers:[],kickStatus:!1,moderatorMuteStatus:{video:!1,audio:!1},showSignal:!0,timerConference:null,minutes:0,seconds:0,hours:0,minimazeMode:!1,minimazeModeSpeakerVideoMute:!1,idLocalUserInConference:null,audioDevices:null,videoDevices:null,videoSettings:!1,audioSettings:!1,loadEnumerateDevices:!1,disabledSharingDesktop:!1,tooltipCopy:!1,mimimazeLeftSide:!1}},watch:{acceptCamera:function(t){this.localTracks.forEach((function(e){"video"===e.getType()&&(t?e.unmute():e.mute())})),this.activeSpeaker||(this.minimazeModeSpeakerVideoMute=!this.localTracks.find((function(t){return"video"===t.getType()})).isMuted())},activeSpeaker:function(t){var e=this;t&&this.$nextTick((function(){e.videoTracks.forEach((function(i){i.getParticipantId()===t&&(i.attach(e.$refs.playerMinimaze),e.minimazeModeSpeakerVideoMute=i.isMuted())}))}))},sharingDesktopStatus:function(t){if(!t)if(this.videoDevices.length)bS["a"].createLocalTracks({devices:["video"]}).then(this.replaceLoacalVideoTrack).catch((function(t){throw t}));else if(this.room){var e=this.localTracks.find((function(t){return"desktop"===t.getType()}));this.room.removeTrack(this.localTracks[e]),this.localTracks.splice(e,1)}},acceptAudio:function(t){t?this.localTracks.forEach((function(t){"audio"===t.getType()&&t.unmute()})):this.localTracks.forEach((function(t){"audio"===t.getType()&&t.mute()}))},widthPopup:function(){this.setRate()},getVideoStreamsLength:function(){this.setRate(),this.addNewPlayers()},getAudioTracksLength:function(){this.addNewAudioPlayers()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatAuth:"chat/getChatAuth",getVideoConference:"modal/getVideoConferenceStatus",getUserDetail:"user/getUserDetail",getApiChat:"api/apiChat",getApiUrl:"api/api",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getConferenceParticipant:function(){return[{index:"0",text:"Участники",count:this.participantsArr.length,component:"member",collection:this.participantsArr.length?this.participantsArr:[]},{index:"1",text:"Чат",count:this.chatMessage.length,component:"message",collection:this.chatMessage.length?this.chatMessage.length:[]}]},getTimerTime:function(){return"".concat(this.hours<10?"0"+this.hours:this.hours,":").concat(this.minutes<10?"0"+this.minutes:this.minutes,":").concat(this.seconds<10?"0"+this.seconds:this.seconds)},getAcceptCamera:function(){return this.acceptCamera&&this.localTracks.find((function(t){return"video"===t.getType()}))?"VideoOn":"VideoOff"},getAcceptAudio:function(){return this.acceptAudio?"MicOn":"MicOff"},getIconSharedColorIcon:function(){return this.statusDesktop?this.sharingDesktopStatus?"light"===this.getActiveTheme?"#2462db":"#00b9fc":this.sharingDesktopStatus?void 0:"light"===this.getActiveTheme?"#8c8c8c":"#8FA8C1":"#e91212"},getColorVideoCamIcon:function(){var t=this.localTracks.find((function(t){return"video"===t.getType()}));return t?t&&this.acceptCamera?"light"===this.getActiveTheme?"#008e72":"#00ffac":t&&!this.acceptCamera?"light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1":void 0:"light"===this.getActiveTheme?"#e91212":"#fa4c4a"},getColorMicIcon:function(){var t=this.localTracks.find((function(t){return"audio"===t.getType()}));return t?t&&this.acceptCamera?"light"===this.getActiveTheme?"#008e72":"#00ffac":t&&!this.acceptCamera?"light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1":void 0:"light"===this.getActiveTheme?"#e91212":"#fa4c4a"},getVideoStreamsLength:function(){return this.videoTracks.length},getAudioTracksLength:function(){return this.audioTracks.length},getClassModifier:function(){if(this.getNumberPlayers)switch(this.getNumberPlayers.length){case 1:return"";default:return"chatConference-row-twoPlayers"}},getMaxWidthModifierPlayer:function(){return 2===this.getVideoStreamsLength?this.minimazeMode?{maxWidth:"100%"}:{maxWidth:"50%"}:this.minimazeMode?{maxWidth:"100%"}:{maxWidth:"".concat(Math.round(100/this.ratePlayers),"%")}},getAvatarUrl:function(){return"".concat(dw,"/avatar/").concat(this.getUserDetail.login)},getFullScreenStatus:function(){return this.fullScreen?"Full-screen-OFF":"Full-screen-ON"},getNumberPlayers:function(){if(this.videoTracks.length){var t=[];t.push([]);for(var e=0,i=0;i=70?{color:"green"}:e<=69&&e>=30?{color:"yellow"}:e<=29&&e>=0?{color:"red"}:void 0},speakerChanged:function(t){this.activeSpeaker=t},onUserJoined:function(t){this.participantIds.add(t),this.room.selectParticipants(Array.from(this.participantIds))},onUserLeft:function(){this.setParticipant()},setMuteFromModerator:function(t){if(t.attributes.id===this.idLocalUserInConference){var e=JSON.parse(t.attributes.track),i=e.status,o=this.localTracks.find((function(t){return t.getType()===e.type}));this.notAllowDevaice[e.type]||("audio"===e.type?this.acceptAudio=!this.acceptAudio:this.acceptCamera=!this.acceptCamera,this.moderatorMuteStatus[e.type]="mute"===i,"mute"===i?o.mute():o.unmute())}},kickLocalUser:function(){this.kickStatus=!0},getAvatarAndNameForMuteStatus:function(t){if(this.localTracks.length)return this.localTracks.find((function(e){return e.getParticipantId()===t}))?{avatar:this.getAvatarUrl,name:"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName," (Вы)"),muteAudioStatus:this.acceptAudio}:{avatar:this.participantsArr.find((function(e){return e.id===t})).avatar,name:this.participantsArr.find((function(e){return e.id===t})).username,muteAudioStatus:!this.participantsArr.find((function(e){return e.id===t})).tracks.find((function(t){return"audio"===t.type})).mute}},sendVideoConferenceInfoMessage:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={message:{rid:t.getVideoConference.data.originalRoomId,msg:JSON.stringify({conferenceId:t.getVideoConference.data.room,begin:new Date,end:null,msg:"video_conference",blockedUsers:[]})}},e.next=3,t.$http.post("".concat(t.getApiChat,"chat.sendMessage"),JSON.stringify(i),{headers:{"X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId,"Content-type":"application/json"}}).then((function(e){t.statusConferenceMessage=e.data.message._id}));case 3:case"end":return e.stop()}}),e)})))()},sendVideoConferenceEndMessage:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={roomId:t.getVideoConference.data.originalRoomId,msgId:t.statusConferenceMessage,text:JSON.stringify({conferenceId:t.getVideoConference.data.room,originalRoomId:t.getVideoConference.data.originalRoomId,begin:new Date,end:new Date,msg:"video_conference",blockedUsers:t.blockedUsers})},e.next=3,t.$http.post("".concat(t.getApiChat,"chat.update"),JSON.stringify(i),{headers:{"X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId,"Content-type":"application/json"}});case 3:case"end":return e.stop()}}),e)})))()},sendVideoConferenceAddBlockedUsers:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={roomId:t.getVideoConference.data.originalRoomId,msgId:t.statusConferenceMessage,text:JSON.stringify({conferenceId:t.getVideoConference.data.room,originalRoomId:t.getVideoConference.data.originalRoomId,begin:new Date,end:null,msg:"video_conference",blockedUsers:t.blockedUsers})},e.next=3,t.$http.post("".concat(t.getApiChat,"chat.update"),JSON.stringify(i),{headers:{"X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId,"Content-type":"application/json"}});case 3:case"end":return e.stop()}}),e)})))()},setRate:function(){this.videoTracks.length&&(1===this.videoTracks.length||2===this.videoTracks.length?this.ratePlayers=1:3===this.videoTracks.length||4===this.videoTracks.length?this.ratePlayers=2:5===this.videoTracks.length?this.ratePlayers=3:this.videoTracks.length>5&&(this.ratePlayers=Math.round((this.widthPopup-720)/340)))},addNewPlayers:function(){var t=this;this.$nextTick((function(){t.videoTracks.forEach((function(e,i){t.activeSpeaker||0!==i||e.attach(t.$refs.playerMinimaze),e.attach(t.$refs["videoPlayer"+i][0])}))}))},addNewAudioPlayers:function(){var t=this;this.$nextTick((function(){t.audioTracks.forEach((function(e,i){e.attach(t.$refs["audioPlayer"+i][0])}))}))},deleteParticipant:function(t){var e=this.participantsArr.findIndex((function(e){return e.id===t}));e>=0&&this.participantsArr.splice(e,1)},setParticipant:function(){var t=this;this.room&&(this.participantsArr=[],this.room.getParticipants().forEach((function(e){t.participantsArr.push({username:e._identity.user.name,avatar:e._identity.user.avatar,role:e._role,tracks:e._tracks.map((function(t){return{mute:t.isMuted(),type:t.getType()}})),id:e._id})})))},getStatusTrack:function(t){return"video"!==t.type||t.mute?"video"===t.type&&t.mute?"VideoOff":"audio"!==t.type||t.mute?"audio"===t.type&&t.mute?"MicOff":void 0:"MicOn":"VideoOn"},replaceLoacalVideoTrack:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,s,a,c;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(n=i.localTracks.find((function(t){return"video"===t.getType()})),s=i.localTracks.findIndex((function(t){return"video"===t.getType()})),a=i.videoTracks.findIndex((function(t){return t.getId()===n.getId()})),i.videoTracks.splice(a,1,t[0]),i.localTracks.splice(s,1,t[0]),!i.room){o.next=14;break}c=0;case 7:if(!(c1||t.getBuyOrders.length>1?e("DxAccordion",{class:"ordersPanel-accordion ordersPanel-accordion_".concat(t.getActiveTheme),attrs:{items:t.getDataOrdersForAccordion,selectedItems:[],onItemTitleClick:t.setClickTittle,collapsible:!0,focusStateEnabled:!1,"item-template":"accordionItem","item-title-template":"accordionTitle"},scopedSlots:t._u([{key:"accordionTitle",fn:function(i){var o=i.data;return[e("div",{staticClass:"ordersPanel-listOrders",attrs:{id:"title_".concat(o.type)}},[e("div",{class:"ordersPanel-listOrders__count ordersPanel-listOrders__count_".concat(t.getActiveTheme," ").concat("Sell"===o.type?"ordersPanel-listOrders__count_".concat(t.getActiveTheme,"--sell"):"ordersPanel-listOrders__count_".concat(t.getActiveTheme,"--buy"))},[t._v(t._s(o.orders.length))]),e("div",{class:"ordersPanel-listOrders__type ordersPanel-listOrders__type_".concat(t.getActiveTheme)},[t._v(t._s(o.type))]),e("div",{class:"ordersPanel-listOrders__volume ordersPanel-listOrders__volume_".concat(t.getActiveTheme),attrs:{title:o.summaryVolume()}},[t._v(t._s(o.summaryVolume()))]),e("div",{class:"ordersPanel-listOrders__openPrice ordersPanel-listOrders__openPrice_".concat(t.getActiveTheme)},[t._v(t._s(o.averPrice()))]),e("div",{class:"ordersPanel-listOrders__profit ".concat(o.summaryProfit()<0?"ordersPanel-listOrders__profit-noprofit_".concat(t.getActiveTheme):"ordersPanel-listOrders__profit-profit_".concat(t.getActiveTheme))},[t._v("$ "+t._s(o.summaryProfit()))]),e("div",{ref:"title_".concat(o.type),staticClass:"ordersPanel-listOrders__closeButton"},["owner"===t.getUserStatus.status?e("div",{class:"ordersPanel-listOrders__closeButton-wrap ordersPanel-listOrders__closeButton-wrap_".concat(t.getActiveTheme),on:{click:function(e){return e.stopPropagation(),t.setClickTittle(e,"close",o.type)}}},[e("svgIcon",{attrs:{id:"close",name:"Close",size:16}})],1):t._e(),"owner"===t.getUserStatus.status?e("div",{class:"ordersPanel-listOrders__settingsButton ordersPanel-listOrders__settingsButton_".concat(t.getActiveTheme),on:{click:function(e){return e.stopPropagation(),t.setClickTittle(e,"settings",o.type)}}},[e("svgIcon",{attrs:{id:"settings",name:"Settings",size:24}})],1):t._e()])])]}},{key:"accordionItem",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{staticClass:"ordersPanel"},t._l(o.orders,(function(i,n){return e("div",{key:n,staticClass:"ordersPanel-listOrders"},[e("div",{staticClass:"ordersPanel-listOrders__count"}),e("div",{class:"ordersPanel-listOrders__type ordersPanel-listOrders__type_".concat(t.getActiveTheme)},[t._v(t._s(i.orderType))]),e("div",{class:"ordersPanel-listOrders__volume ordersPanel-listOrders__volume_".concat(t.getActiveTheme),attrs:{title:o.summaryVolume()}},[t._v(t._s(i.volume))]),e("div",{class:"ordersPanel-listOrders__openPrice ordersPanel-listOrders__openPrice_".concat(t.getActiveTheme)},[t._v(t._s(i.openPrice))]),e("div",{class:"ordersPanel-listOrders__profit ".concat(o.summaryProfit()<0?"ordersPanel-listOrders__profit-noprofit_".concat(t.getActiveTheme):"ordersPanel-listOrders__profit-profit_".concat(t.getActiveTheme))},[t._v("$ "+t._s(i.profit))]),"owner"===t.getUserStatus.status?e("div",{staticClass:"ordersPanel-listOrders__closeButton",on:{click:function(e){return t.closeOrder(i)}}},[e("div",{class:"ordersPanel-listOrders__closeButton-wrap ordersPanel-listOrders__closeButton-wrap_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Close",size:16}})],1)]):t._e(),"owner"===t.getUserStatus.status?e("div",{class:"ordersPanel-listOrders__settingsButton ordersPanel-listOrders__settingsButton_".concat(t.getActiveTheme),on:{click:function(e){return t.newOrder(i)}}},[e("svgIcon",{attrs:{name:"Settings",size:24}})],1):t._e()])})),0)]}}],null,!1,3443180172)}):t._e()],1)]},proxy:!0}])})],1)},yw=[],Cw={components:{DxPopup:To["DxPopup"],DxAccordion:lw["DxAccordion"],svgIcon:L,VuePerfectScrollbar:Xt.a},data:function(){return{copyOrders:[],heightPopup:"auto",statusModalSettings:null}},props:{showPanel:{type:Boolean}},watch:{getCountOrders:function(t){0===t&&this.closeOrderPanel()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getOrdersPanel:"modal/getOrdersPanel",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getToken:"auth/getToken",getNewOrderModal:"modal/getNewOrderModal",defaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPopupEl:function(){return this.$refs["popup"].instance},getUserStatus:function(){return this.getOrdersPanel.data.role},getCountOrders:function(){if(this.getOrdersBySymbol)return this.getOrdersBySymbol.length},getOrdersBySymbol:function(){var t=this;if(this.copyOrders.length)return this.copyOrders.filter((function(e){return e.instrumentName===t.getOrdersPanel.data.symbol}))},getPrecision:function(){var t=this;if(this.getContracts){var e=this.getContracts.find((function(e){return e.instrumentName===t.getOrdersPanel.data.symbol}));return e?e.precision:void 0}},getSellOrders:function(){if(this.getOrdersBySymbol)return this.getOrdersBySymbol.filter((function(t){return"Sell"===t.orderType}))},getBuyOrders:function(){if(this.getOrdersBySymbol)return this.getOrdersBySymbol.filter((function(t){return"Buy"===t.orderType}))},getDataOrdersForAccordion:function(){var t=this,e=[];return this.getSellOrders.length>1&&e.push({type:"Sell",orders:this.getSellOrders,visible:this.getSellOrders.length&&1!==this.getSellOrders.length,summaryVolume:function(){return t.getSellOrders.reduce((function(t,e){return t+e.volume}),0)},averPrice:function(){return(t.getSellOrders.reduce((function(t,e){return t+e.openPrice}),0)/t.getSellOrders.length).toFixed(t.getPrecision)},summaryProfit:function(){return t.getSellOrders.reduce((function(t,e){return t+e.profit}),0).toFixed(2)}}),this.getBuyOrders.length>1&&e.push({type:"Buy",orders:this.getBuyOrders,visible:this.getBuyOrders.length&&1!==this.getBuyOrders.length,summaryVolume:function(){return t.getBuyOrders.reduce((function(t,e){return t+e.volume}),0)},averPrice:function(){return(t.getBuyOrders.reduce((function(t,e){return t+e.openPrice}),0)/t.getBuyOrders.length).toFixed(t.getPrecision)},summaryProfit:function(){return t.getBuyOrders.reduce((function(t,e){return t+e.profit}),0).toFixed(2)}}),e},getPositionForPopup:function(){return{my:"top center",at:"bottom center",of:"div[data-info='".concat(this.getOrdersPanel.data.target,"']"),offset:{x:55,y:10}}}}),methods:{setClickTittle:function(t,e,i){"close"===e&&"owner"===this.getUserStatus.status?this.closeAllOrdersByType(i):"settings"===e&&"owner"===this.getUserStatus.status&&this.settingsOrders("Sell"===i?this.getSellOrders:this.getBuyOrders)},settingsOrders:function(t){var e=t.map((function(t){return t.id}));this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.getOrdersPanel.data.symbol,payload:e})},closeAllOrdersByType:function(t){var e=this;if("owner"===this.getUserStatus.status){var i="Sell"===t?this.getSellOrders:this.getBuyOrders;i.forEach((function(t){e.closeOrder(t)}))}},closeOrderPanel:function(){this.$store.dispatch("modal/switchOrdersPanel",{status:!1,data:null})},newOrder:function(t){var e=[t.id];this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.getOrdersPanel.data.symbol,payload:e})},closeOrder:function(t){if("owner"===this.getUserStatus.status){var e={Command:"CloseTradingOrder",data:{accountId:t.accountId,id:t.id},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e})}},setMessageHandler:function(t){t&&t.command&&"AccountsDetails"===t.command?this.setDataOrdersForAccount(t.data):t&&t.command&&"BrokerPosition"===t.command&&t.data.accountId===this.getDefaultAccount.id&&(this.copyOrders=this.$orderStorage.getOrdersOnStorage())},setDataOrdersForAccount:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id})),o=i.openOrders.tradingOrders.filter((function(t){return t.contractName===e.getOrdersPanel.data.symbol}));o.length&&o.forEach((function(t){var i=e.copyOrders.find((function(e){return e.id===t.id}));i&&(i.profit=t.profit)}))}},mounted:function(){this.$socketStream.$on("apiWS",this.setMessageHandler)},created:function(){this.copyOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},bw=Cw,Sw=(i("e2a5"),Object(C["a"])(bw,vw,yw,!1,null,null,null)),Pw=Sw.exports,Tw=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"popup",attrs:{"title-template":"header","content-template":"content",visible:t.visible,width:t.width,maxWidth:t.maxWidth,height:t.height,"max-height":t.maxHeight,"min-height":t.minHeight,dragEnabled:t.dragEnabled,"drag-enabled":!1,title:t.$t(t.title),shading:t.shading,resizeEnabled:t.resizeEnabled,wrapperAttr:t.getWrapperAttr,shadingColor:t.darkTheme?"rgba(0,0,0,.5)":""},on:{shown:t.shown,hidden:function(e){return t.$emit("hidden")}},scopedSlots:t._u([{key:"header",fn:function(){return[t._t("header",(function(){return[e("div",{staticClass:"headerPopup"},[e("span",{staticClass:"title"},[t._v(t._s(t.$t(t.title)))]),t.numberSteps?e("Steps",{staticClass:"stepsPopupAuth",attrs:{numberSteps:t.numberSteps,currentStep:t.currentStep,clickableMarkerStep:t.clickableMarkerStep}}):t._e(),e("span",{staticClass:"closeButton",on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close",color:"#8C8C8C"}})],1)],1)]}),{closePopup:t.closePopup})]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"contentPopup",class:t.classesContent},[t._t("content",null,{shownProp:t.shownProp})],2)]},proxy:!0}],null,!0)})},xw=[],Ow=function(){var t=this,e=t._self._c;return e("div",{staticClass:"reg-steps"},t._l(t.numberSteps,(function(i){return e("div",{key:i,staticClass:"reg-steps__step",class:{"reg-steps__step--current":i===t.currentStep,clickable:t.clickableMarkerStep},on:{click:function(e){return t.clickHandler(i)}}})})),0)},ww=[],_w={name:"Steps",inject:{markerClickHandler:{from:"markerClickHandler",default:function(){}}},props:{clickableMarkerStep:{type:Boolean},numberSteps:{type:[Number,Boolean],default:null},currentStep:{type:[Number,Boolean],default:null}},methods:{clickHandler:function(t){this.markerClickHandler(t)}}},Aw=_w,Dw=(i("cbee"),Object(C["a"])(Aw,Ow,ww,!1,null,"3ddf69a4",null)),kw=Dw.exports,Iw={name:"CustomDxPopup",props:{title:{type:String,default:""},width:{type:[String,Number],default:300},height:{type:[String,Number],default:"auto"},shading:{type:Boolean,default:!0},resizeEnabled:{type:Boolean,default:!1},dragEnabled:{type:Boolean,default:!1},maxHeight:{type:[String,Number],default:"none"},minHeight:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"none"},visible:{type:Boolean,default:!1},numberSteps:{type:[Number,Boolean],default:null},currentStep:{type:[Number,Boolean],default:null},noPaddingContent:{type:Boolean,default:!1},dopClass:{type:String,default:""},clickableMarkerStep:{type:Boolean,default:!1}},components:{DxPopup:To["DxPopup"],Steps:kw},data:function(){return{shownProp:!1,mountComponent:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",visiblePopup:"modalSubscribe/getVisiblePopup"})),{},{darkTheme:function(){return"dark"===this.getActiveTheme},classes:function(){return"customDxPopup ".concat("dark"===this.getActiveTheme?"dark":""," ").concat(this.dopClass)},classesContent:function(){return{noPadding:this.noPaddingContent}},getWrapperAttr:function(){return{class:this.visible?this.classes+" visible":this.classes}}}),methods:{shown:function(){this.shownProp=!0},closePopup:function(){this.$emit("closePopup"),this.visiblePopup||(Ka(),this.shownProp=!1,this.$refs.popup.instance.hide())}}},Bw=Iw,Mw=(i("2c79"),i("76a6"),Object(C["a"])(Bw,Tw,xw,!1,null,"489608c8",null)),$w=Mw.exports,Lw=function(){var t=this,e=t._self._c;return e("div",{staticClass:"welcome-screen-container",class:t.darkClass},[e("div",{staticClass:"info-block"},[e("h3",{staticClass:"heading"},[t._v(t._s(t.$t("welc")))]),e("p",{staticClass:"text"},[t._v(t._s(t.$t("seeSite"))+" "+t._s(t.$t("ttWelc")))]),e("div",{staticClass:"buttons-block"},[e("DxButton",{attrs:{height:"48",type:"default",elementAttr:{class:"buttonGoToAccount"},text:t.$t("personalAccount")},on:{click:t.goToPersonalAccount}})],1)])])},Fw=[],jw={name:"WelcomeScreen",components:{DxButton:cc.a},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}}}),methods:{goToPersonalAccount:function(){this.$store.dispatch("modal/setPopupData",{visible:!1}),this.$router.push("/personal-area")},goToMyProfile:function(){}}},Rw=jw,Ww=(i("701d"),Object(C["a"])(Rw,Lw,Fw,!1,null,"6eafd46b",null)),Nw=Ww.exports,Ew=function(){var t=this,e=t._self._c;return e("div",{staticClass:"welcomeRefer"},[t._m(0),e("div",{staticClass:"welcomeRefer-content"},[e("div",{staticClass:"welcomeRefer-logo"},[e("img",{attrs:{src:i("4176")}})]),t._m(1),e("div",{staticClass:"welcomeRefer-grayText"},[t._v("Свяжитесь со мной для обсуждения деталей:")]),e("div",{staticClass:"welcomeRefer-contact"},[e("div",{staticClass:"welcomeRefer-contactName"},[t._v("Алексей Денисов ")]),e("div",{staticClass:"welcomeRefer-contactPhone"},[t._v("+ 7 (903) 808-06-26"),e("svgIcon",{attrs:{name:"Messenger-Telegramm",color:"#039BE5"}}),e("svgIcon",{attrs:{name:"Messenger-WhatsApp",color:"#00ffac"}})],1)]),e("div",{staticClass:"welcomeRefer-noMore"},[e("Checkbox",{attrs:{checked:t.noMoreStatus},on:{change:t.setNoMoreStatus}}),t._v("Больше не показывать")],1)]),e("div",{staticClass:"welcomeRefer-close",on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",color:"#345F8A"}})],1)])},Uw=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"welcomeRefer-img"},[e("img",{attrs:{src:"https://api.toptrader.ru/api/Image/item/89ade1f21eff4fc28db0c3631f002d5e/8a2d0ef600124f4ec18ae160efefc77b_jpeg.jpg",width:"100%"}})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"welcomeRefer-yellowText"},[e("p",[t._v("TopTrader приглашает трейдеров к сотрудничеству на платформе для управления нашим и привлеченным капиталлом.")]),e("p",[t._v("Получайте 100% фиксированного или SF дохода.")]),e("p",[t._v("Работает реферальная система.")])])}],Vw={data:function(){return{noMoreStatus:!1}},components:{Checkbox:Ya},methods:{close:function(){this.noMoreStatus&&localStorage.setItem("referStatus",!1),this.$emit("closeModal")},setNoMoreStatus:function(){this.noMoreStatus=!this.noMoreStatus}}},Hw=Vw,Gw=(i("ea01"),Object(C["a"])(Hw,Ew,Uw,!1,null,null,null)),qw=Gw.exports,zw=function(){var t=this,e=t._self._c;return e("div",{staticClass:"confirmationCodeRegistrationAccount"},[e("div",{staticClass:"message"},[t._v(t._s(t.$t("sendSmsBroker")))]),e("ConfirmationCodeAndTimer",{on:{timerEnd:t.endTimerCode},model:{value:t.code,callback:function(e){t.code=e},expression:"code"}}),e("ErrorText",{attrs:{text:t.$t(t.errorText),visible:Boolean(t.errorText)}}),e("div",{staticClass:"code-buttons"},[e("DxButton",{key:"buttonVarifyCodeAccounReg",attrs:{height:"32",width:"100%",type:"default",disabled:t.disabledCheckCodeButton,elementAttr:{class:"buttonVarifyCode"},text:t.$t("checkCode")},on:{click:t.sendCode}}),e("DxButton",{key:"buttonForRepeatSmsAccountReg",attrs:{height:"32",width:"100%",type:"normal",disabled:t.buttonRepeatSmsDisable,elementAttr:{class:"buttonForRepeatSms"},text:"Выслать еще",icon:t.$iconPath("Reset")},on:{click:t.getCode}})],1),e("div",{staticClass:"footer"},[e("DxButton",{key:"buttonBackRegAccount",attrs:{height:"48",type:"normal",elementAttr:{class:"buttonBack"},text:t.$t("back")},on:{click:t.goBackPreviousPage}}),e("DxButton",{key:"buttonNextAccountPassword",attrs:{height:"48",type:"default",disabled:t.disabledNextButton,elementAttr:{class:"buttonNext"},text:t.$t("cont")},on:{click:t.nextStep}})],1)],1)},Yw=[],Xw={name:"ConfirmationСodeRegistrationAccount",components:{DxButton:ac["DxButton"],ConfirmationCodeAndTimer:cl,ErrorText:gc},data:function(){return{code:"",buttonRepeatSmsDisable:!0,disabledNextButton:!0,errorText:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUri:"api/api",getNumberStepsForRegistration:"modal/getNumberStepsForRegistration"})),{},{disabledCheckCodeButton:function(){return this.code.length<4}}),methods:{endTimerCode:function(t){this.updateTimerFunc||(this.updateTimerFunc=t),this.code="",this.buttonRepeatSmsDisable=!1},getCode:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$http.get("".concat(t.getApiUri,"GetUserPinCode"),{params:{userId:1}});case 3:i=e.sent,i.data&&i.data.isOK?(t.updateTimerFunc(),t.buttonRepeatSmsDisable=!0):t.getCodeError=!0,e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),window.console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()},sendCode:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={pin:+t.code,userId:"1",password:"111111"},e.prev=1,e.next=4,t.$http.post("".concat(t.getApiUri,"VerifyUserPin"),i);case 4:o=e.sent,o.data&&"NoError"===o.data.actionStatus?(t.disabledNextButton=!1,t.errorText=""):(t.errorText="invalid_code",t.disabledNextButton=!0),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](1),t.errorText="septal";case 11:case"end":return e.stop()}}),e,null,[[1,8]])})))()},nextStep:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ComeUpWithPasswordAccount",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:3})},goBackPreviousPage:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalAccountSign",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:1})}}},Qw=Xw,Jw=(i("0b27"),Object(C["a"])(Qw,zw,Yw,!1,null,"2c9a9086",null)),Kw=Jw.exports,Zw=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ComeUpWithPasswordAccount"},[e("h3",{staticClass:"heading"},[t._v(t._s(t.$t("logPass")))]),e("PassAndConfirmPass",{attrs:{password:t.pass,passwordRepeat:t.pass2},on:{valueChanged:t.valueChangedPass,invalid:t.invalidPass}}),e("div",{staticClass:"footer"},[e("DxButton",{key:"buttonBackComeUpWithPasswordAccount",attrs:{height:"48",type:"normal",elementAttr:{class:"buttonBack"},text:t.$t("back")},on:{click:t.goBackPreviousPage}}),e("DxButton",{key:"buttonRegAccount",attrs:{height:"48",type:"default",disabled:t.disabledButtonRegistration,elementAttr:{class:"buttonNext"}},on:{click:t.register},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.$t("registration"),isLoading:t.isLoadingReg}})]},proxy:!0}])})],1)],1)},t_=[],e_={name:"ComeUpWithPasswordAccount",components:{DxButton:ac["DxButton"],PassAndConfirmPass:wc,LoadingForButton:Qc},data:function(){return{pass:"",pass2:"",isLoadingReg:!1,invalid:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])("modal",["getNumberStepsForRegistration"])),{},{disabledButtonRegistration:function(){return this.invalid}}),methods:{valueChangedPass:function(t){var e=t.value,i=t.name;this[i]=e},invalidPass:function(t){this.invalid=t},register:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"WelcomeScreen",title:"haveSuccReg",numberSteps:this.getNumberStepsForRegistration,currentStep:4,width:"600"})},goBackPreviousPage:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ConfirmationСodeRegistrationAccount",title:"registration",numberSteps:this.getNumberStepsForRegistration,currentStep:2})}}},i_=e_,o_=(i("9285"),Object(C["a"])(i_,Zw,t_,!1,null,"7b650f2a",null)),n_=o_.exports,s_=function(){var t=this,e=t._self._c;return e("DxToast",{attrs:{height:t.getHeight?t.getHeight:"auto",width:t.getWidth?t.getWidth:"auto",type:"custom",visible:t.getVisible,position:{my:"center",at:"center"},closeOnOutsideClick:t.outSideClick,displayTime:t.displayTime,onHiding:t.onHiding,shading:t.shading,shadingColor:"dark"===t.getActiveTheme?"rgba(0,0,0,0.5)":"rgba(255,255,255,0.7)",wrapperAttr:{class:"awesomeToast"}}},[[e("div",{staticClass:"contentToast",style:t.getStyle},[e(t.getComponentName,{tag:"component",attrs:{getDopInfo:t.getDopInfo}})],1)]],2)},r_=[],a_=i("f316"),c_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastSubscribePlus"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("span",[t._v(t._s(t.$t("toastSubscribePlus")[0]))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonSubscribe",attrs:{icon:{name:"Follow",color:"#8C8C8C"}},on:{toggle:t.goToSubscribe}},[t._v(t._s(t.$t("toastSubscribePlus")[1]))])],1)])},l_=[],u_={name:"ToastSubscribePlus",methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{goToSubscribe:function(){this.showToast({visible:!1}),this.$router.push({name:"Personal Area",query:{tabName:"PersonalSubscriptionOnPlatform"}})}})},d_=u_,h_=(i("8914"),Object(C["a"])(d_,c_,l_,!1,null,"c17146ea",null)),p_=h_.exports,g_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastSubscribePlus"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Alarm_red",color:"#E91212"}}),e("div",{staticClass:"message"},[e("p",[t._v(t._s(t.$t("toastCopySignals"))+" "+t._s(t.getMessage))])])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonOk",on:{toggle:t.clickOk}},[t._v(t._s(t.$t("okay")))])],1)])},f_=[],m_={name:"ToastCopySignals",props:{getDopInfo:{type:Array}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings"})),{},{getMessage:function(){var t,e=this.getDopInfo.join(", "),i="ru"===(null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code);return this.getDopInfo.length>1?"".concat(i?"по инструментам:":""," ").concat(e):"".concat(i?"по инструменту":""," ").concat(e)}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{clickOk:function(){this.showToast({visible:!1})}})},v_=m_,y_=(i("6ed7"),Object(C["a"])(v_,g_,f_,!1,null,"e1435e0e",null)),C_=y_.exports,b_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastConfirmCopySignals"},[e("div",{staticClass:"textBlock"},[e("div",{staticClass:"message"},[e("p",[t._v(t._s(t.getMessage))])])]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickOk}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[e("svgIcon",{attrs:{name:"Check",color:"#8C8C8C"}}),t._v(t._s(t.$t("Yes")))]],2),e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickClose}},[e("svgIcon",{attrs:{name:"Close",color:"#8C8C8C"}}),t._v(t._s(t.$t("No")))],1)],1)])},S_=[],P_={name:"ToastConfirmCopySignals",props:{getDopInfo:{type:Object}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{isLoading:!1}},computed:{getMessage:function(){switch(this.getDopInfo.type){case"montPriceZero":return this.$t("montPriceZero")[0](this.getDopInfo.isAllBag,this.getDopInfo.name);case"subscriptions":return this.$t("subscriptionsToast")[0](this.getDopInfo.isAllBag,this.getDopInfo.name);case"freeSignals":return this.$t("freeSignals")[0](this.getDopInfo.isAllBag,this.getDopInfo.name);case"content":return this.$t("contentToast")[0](this.getDopInfo.name);case"contentSubscription":return this.$t("contentSubscription")[0](this.getDopInfo.isAllBag,this.getDopInfo.name);case"contentDemo":return this.$t("contentDemoToast")[0](this.getDopInfo.name,this.getDopInfo.demoPeriodContentCount);case"contentDemoSubscription":return this.$t("contentDemoSubscription")[0](this.getDopInfo.name,this.getDopInfo.demoPeriodContentCount);default:return this.$t("copyTrial")[0](this.getDopInfo.isAllBag,this.getDopInfo.name,this.getDopInfo.days)}}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",getContentForCart:"cart/getContentForCart",setPopupData:"modalSubscribe/setPopupData"})),{},{clickClose:function(){this.showToast({visible:!1})},clickOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,t.getDopInfo.payNow();case 3:if(!t.getDopInfo.type.includes("content")){e.next=6;break}return e.next=6,t.getContentForCart();case 6:t.setPopupData({visiblePopup:!1}),("subscriptions"===t.getDopInfo.type||t.getDopInfo.type.includes("content"))&&t.showToast({visible:!0,shading:!0,componentName:"ToastCongratulationsSubscription",dopInfo:t.getDopInfo}),t.isLoading=!1;case 9:case"end":return e.stop()}}),e)})))()}})},T_=P_,x_=(i("9fa8"),Object(C["a"])(T_,b_,S_,!1,null,"4e489eeb",null)),O_=x_.exports,w_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastCongratulationsEdit"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("span",[t._v("Поздравляем!"),e("br"),t._v(t._s(t.getMessage))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonSubscribe",on:{toggle:t.closeToast}},[t._v("Понятно")])],1)])},__=[],A_={name:"ToastCongratulationsSubscription",props:{getDopInfo:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserInfo:"user/getUserDetail"})),{},{getMessage:function(){switch(this.getDopInfo.type){case"subscriptions":case"montPriceZero":return this.$t("montPriceZeroSuccess")[0](this.getDopInfo.name);case"freeSignals":return this.$t("freeSignalsSuccess")[0](this.getDopInfo.name);case"content":return this.$t("contentSuccess")[0](this.getDopInfo.name);case"contentSubscription":return this.$t("contentSubscriptionSuccess")[0](this.getDopInfo.name);case"contentDemo":return this.$t("contentDemoSuccess")[0](this.getDopInfo.name,this.getDopInfo.demoPeriodContentDate);case"contentDemoSubscription":return this.$t("contentDemoSubscriptionSuccess")[0](this.getDopInfo.name,this.getDopInfo.demoPeriodContentDate);default:return this.$t("copySuccess")[0](this.getDopInfo.name,this.getDopInfo.toDate)}}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getAccountsUser({guid:t.getUserInfo.id,accId:0});case 2:case"end":return e.stop()}}),e)})))()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getAccountsUser:"subscribeOrders/getAccountsUser",setPopupData:"modalSubscribe/setPopupData",showToast:"toast/showToast"})),{},{closeToast:function(){this.showToast({visible:!1}),this.setPopupData({visiblePopup:!1})}})},D_=A_,k_=(i("5f0a"),Object(C["a"])(D_,w_,__,!1,null,"9751f406",null)),I_=k_.exports,B_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastSuccessPay"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("span",[t._v(t._s(t.$t("congratulations"))+"!"),e("br"),t._v(t._s(t.getMessage))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonSuccess",on:{toggle:t.closeModal}},[t._v(t._s(t.$t("okay")))])],1)])},M_=[],$_={name:"ToastSuccessPay",props:{getDopInfo:{type:Object}},data:function(){return{period:"",successPayContent:null,subscribedSignals:null}},computed:{getMessage:function(){var t=this.$t("toastSuccessPay")[0];return this.successPayContent&&(t=this.$t("toastSuccessPay")[1](this.subscribedSignals)),t}},mounted:function(){if(this.period=this.getDopInfo.dateToPeriod,this.successPayContent=localStorage.getItem("successPayContent"),this.subscribedSignals=localStorage.getItem("subscribedSignals"),localStorage.removeItem("dateToPeriod"),localStorage.removeItem("successPayContent"),localStorage.removeItem("subscribedSignals"),!this.getDopInfo.noReplace){var t=Object.assign({},this.$route.query);delete t.payment_intent,delete t.payment_intent_client_secret,delete t.redirect_status,this.$router.replace({query:t})}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{closeModal:function(){this.showToast({visible:!1})}})},L_=$_,F_=(i("1f77"),Object(C["a"])(L_,B_,M_,!1,null,"6507e349",null)),j_=F_.exports,R_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastErrorPay"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Alarm_red",color:"#E91212"}}),e("span",[t._v(t._s(t.$t("toastErrorPay")[0])),e("br"),t._v(t._s(t.$t("toastErrorPay")[1]))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonError",on:{toggle:t.closeModal}},[t._v(t._s(t.$t("okay")))])],1)])},W_=[],N_={name:"ToastErrorPay",mounted:function(){var t=Object.assign({},this.$route.query);delete t.payment_intent,delete t.payment_intent_client_secret,delete t.redirect_status,this.$router.replace({query:t})},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{closeModal:function(){this.showToast({visible:!1})}})},E_=N_,U_=(i("b78a"),Object(C["a"])(E_,R_,W_,!1,null,"39daba4e",null)),V_=U_.exports,H_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastConfirmCopySignals"},[e("div",{staticClass:"textBlock"},[e("div",{staticClass:"message"},[e("p",[t._v(t._s(t.getMessage))])])]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickOk}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[e("svgIcon",{attrs:{name:"Check",color:"#8C8C8C"}}),t._v(t._s(t.$t("Yes")))]],2),e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickClose}},[e("svgIcon",{attrs:{name:"Close",color:"#8C8C8C"}}),t._v(t._s(t.$t("No")))],1)],1)])},G_=[],q_={name:"ToastEditConfirm",props:{getDopInfo:{type:Object}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{isLoading:!1}},computed:{getMessage:function(){switch(this.getDopInfo.type){case"signal":return this.$t("toastEditConfirm")[0](this.getDopInfo.instrumentName);case"portfolio":return this.$t("toastEditConfirm")[1];default:return""}}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{clickClose:function(){this.showToast({visible:!1})},clickOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,t.getDopInfo.payNow(t.getDopInfo.objectHttp);case 3:t.showToast({visible:!0,shading:!0,componentName:"ToastCongratulationsEdit",dopInfo:t.getDopInfo}),t.isLoading=!1;case 5:case"end":return e.stop()}}),e)})))()}})},z_=q_,Y_=(i("87ed"),Object(C["a"])(z_,H_,G_,!1,null,"4470a939",null)),X_=Y_.exports,Q_=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastCongratulationsEdit"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("span",[t._v("Поздравляем!"),e("br"),t._v(t._s(t.getMessage))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonSubscribe",on:{toggle:t.closeToast}},[t._v("Понятно")])],1)])},J_=[],K_={name:"ToastCongratulationsEdit",props:{getDopInfo:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserInfo:"user/getUserDetail"})),{},{getMessage:function(){switch(this.getDopInfo.type){case"signal":return this.$t("signalEditSuccess")[0](this.getDopInfo.instrumentName);case"portfolio":return this.$t("portfolioEditSuccess");default:return""}}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getAccountsUser({guid:t.getUserInfo.id,accId:0});case 2:case"end":return e.stop()}}),e)})))()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getAccountsUser:"subscribeOrders/getAccountsUser",setPopupData:"modalSubscribe/setPopupData",showToast:"toast/showToast"})),{},{closeToast:function(){this.showToast({visible:!1}),this.setPopupData({visiblePopup:!1})}})},Z_=K_,tA=(i("7652"),Object(C["a"])(Z_,Q_,J_,!1,null,"0495eab0",null)),eA=tA.exports,iA=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastSuccessAddToCart"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("span",[t._v(t._s(t.$t("toastSuccessAddToCart")[0](t.getText))),e("br"),t._v(t._s(t.$t("toastSuccessAddToCart")[1]))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonToast",on:{toggle:t.closeToast}},[t._v(t._s(t.$t("contWork")))]),e("ButtonIconFlat",{staticClass:"buttonToast",on:{toggle:t.goToCart}},[t._v(t._s(t.$t("goToCart")))])],1)])},oA=[],nA={name:"ToastSuccessAddToCart",props:{getDopInfo:{type:Object}},computed:{getText:function(){var t;return null!==(t=this.getDopInfo)&&void 0!==t&&t.content?this.$t("Content"):this.$t("Instruments")}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{goToCart:function(){this.$router.push({name:"Personal Area",query:{tabName:"MyFinances",financeTab:"PersonalBasket"}}),this.closeToast()},closeToast:function(){this.showToast({visible:!1})}})},sA=nA,rA=(i("d6ca"),Object(C["a"])(sA,iA,oA,!1,null,"01ba1b75",null)),aA=rA.exports,cA=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastConfirmAddToCart"},[e("div",{staticClass:"textBlock"},[e("div",{staticClass:"message"},[t._v(t._s(t.getMessage))])]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickOk}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[e("svgIcon",{attrs:{name:"Check",color:"#8C8C8C"}}),t._v("Да")]],2),e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickClose}},[e("svgIcon",{attrs:{name:"Close",color:"#8C8C8C"}}),t._v("Нет")],1)],1)])},lA=[],uA={name:"ToastConfirmAddToCart",props:{getDopInfo:{type:Object}},data:function(){return{isLoading:!1}},computed:{getMessage:function(){return"content"===this.getDopInfo.type?this.$t("subscAndToCart"):this.$t("subscPercentAndToCart")}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",setPopupData:"modalSubscribe/setPopupData"})),{},{clickClose:function(){this.showToast({visible:!1})},clickOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isLoading=!0,e.prev=1,"content"!==t.getDopInfo.type){e.next=9;break}return e.next=5,t.getDopInfo.saveContentSubscription();case 5:return e.next=7,t.getDopInfo.getContentForCart();case 7:e.next=13;break;case 9:return e.next=11,t.getDopInfo.payNow(t.getDopInfo.objectHttpPercent,"addToCart");case 11:return e.next=13,t.getDopInfo.addToCart(t.getDopInfo.objectHttpMoney);case 13:t.setPopupData({visiblePopup:!1}),t.showToast({visible:!0,shading:!0,componentName:"ToastSuccessAddToCartMoneyAndPercent",dopInfo:{type:null===(i=t.getDopInfo)||void 0===i?void 0:i.type}}),e.next=20;break;case 17:e.prev=17,e.t0=e["catch"](1),t.showToast({visible:!0,shading:!0,componentName:"ToastErrorAddToCartMoneyAndPercent"});case 20:return e.prev=20,t.isLoading=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[1,17,20,23]])})))()}})},dA=uA,hA=(i("3732"),Object(C["a"])(dA,cA,lA,!1,null,"60b2601c",null)),pA=hA.exports,gA=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastSuccessAddToCartMoneyAndPercent"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Check",color:"#008E72"}}),e("div",{staticClass:"message"},[t._v(t._s(t.getMessage))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonOk",on:{toggle:t.clickOk}},[t._v(t._s(t.$t("okay")))])],1)])},fA=[],mA={name:"ToastSuccessAddToCartMoneyAndPercent",props:{getDopInfo:{type:Object}},computed:{getMessage:function(){var t;return"content"===(null===(t=this.getDopInfo)||void 0===t?void 0:t.type)?this.$t("toastSuccessAddToCartMoneyAndPercent")[0]:this.$t("toastSuccessAddToCartMoneyAndPercent")[1]}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{clickOk:function(){this.showToast({visible:!1})}})},vA=mA,yA=(i("07bd"),Object(C["a"])(vA,gA,fA,!1,null,"a7097fe6",null)),CA=yA.exports,bA=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastErrorAddToCartMoneyAndPercent"},[e("div",{staticClass:"textBlock"},[e("svgIcon",{attrs:{name:"Alarm_red",color:"#E91212"}}),e("div",{staticClass:"message"},[t._v(t._s(t.$t("failedToPay")))])],1),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonOk",on:{toggle:t.clickOk}},[t._v(t._s(t.$t("okay")))])],1)])},SA=[],PA={name:"ToastErrorAddToCartMoneyAndPercent",methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{clickOk:function(){this.showToast({visible:!1})}})},TA=PA,xA=(i("adb1"),Object(C["a"])(TA,bA,SA,!1,null,"5f416e28",null)),OA=xA.exports,wA=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StopOrDeletePortfolioAlert",class:t.classRoot},[e("div",{staticClass:"StopOrDeletePortfolioAlert-header",class:"StopOrDeletePortfolioAlert-header_".concat(t.getActiveTheme)},[t._l(t.getDataForHeader,(function(i,o){return e("div",{key:o,staticClass:"StopOrDeletePortfolioAlert-dataContainer",class:"StopOrDeletePortfolioAlert-dataContainer_".concat(t.getActiveTheme),style:{background:i.background}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-dataContainer-title"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-dataContainer-titleText",class:"StopOrDeletePortfolioAlert-dataContainer-titleText_".concat(t.getActiveTheme)},[t._v(t._s(i.title))])]),e("div",{staticClass:"StopOrDeletePortfolioAlert-dataContainer-data",style:{color:i.color}},[t._v(t._s(i.data))])])})),e("div",{staticClass:"StopOrDeletePortfolioAlert-closeIcon"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["StopOrDeletePortfolioAlert-close","StopOrDeletePortfolioAlert-close_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.showToast({visible:!1})}}})],1)],2),e("div",{staticClass:"StopOrDeletePortfolioAlert-contetnt",class:"StopOrDeletePortfolioAlert-contetnt_".concat(t.getActiveTheme)},[e("div",{staticClass:"StopOrDeletePortfolioAlert-chartPart"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-stat",class:"StopOrDeletePortfolioAlert-stat_".concat(t.getActiveTheme)},[e("DxAccordion",{class:"StopOrDeletePortfolioAlert-accordion StopOrDeletePortfolioAlert-accordion_".concat(t.getActiveTheme),attrs:{items:t.getDataForAccordion,selectedItem:t.getDataForAccordion[0],height:"100%",collapsible:!0,focusStateEnabled:!1,hoveStateEnabled:!1,"item-template":"accordionItem","item-title-template":"accordionTitle"},scopedSlots:t._u([{key:"accordionTitle",fn:function(i){var o=i.data;return[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title",class:"StopOrDeletePortfolioAlert-accordion-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-data"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-text"},[t._v(t._s(o.title))]),"order"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-devider",class:"StopOrDeletePortfolioAlert-accordion-title-devider_".concat(t.getActiveTheme)}):t._e(),"order"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-count",style:{color:t.getBlueColor.color}},[t._v(t._s("open"===o.subType?t.getCountOpenOrders:t.getCountClosedOrders)+" ")]):t._e(),"order"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-devider",class:"StopOrDeletePortfolioAlert-accordion-title-devider_".concat(t.getActiveTheme)}):t._e(),"order"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-title-profit",style:{color:("open"===o.subType?t.profit:t.profitClose)<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf("open"===o.subType?t.profit:t.profitClose))))]):t._e()])])]}},{key:"accordionItem",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{class:"StopOrDeletePortfolioAlert-accordion-data StopOrDeletePortfolioAlert-accordion-data_".concat(t.getActiveTheme)},["stat"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-statBlock"},t._l(o.data,(function(i,o){return e("div",{key:o,staticClass:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow",class:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow-label",class:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow-label_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(t.labelsForColumns[o])))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow-data",class:"StopOrDeletePortfolioAlert-accordion-data-statBlockRow-data_".concat(t.getActiveTheme),style:{color:i.color?i.color:""}},[t._v(t._s(i.data))])])})),0):t._e(),"order"===o.type?e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlock"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderTitles",class:"StopOrDeletePortfolioAlert-accordion-data-orderTitles_".concat(t.getActiveTheme)},t._l(t.getLabelsForOrders,(function(i,o){return e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderTitles-item"},[t._v(t._s(i))])})),0),t._l(o.data,(function(i,n){return e("div",{key:n,staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-contract",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-contract_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-type",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-type_".concat(t.getActiveTheme),style:{color:"Sell"===i.orderType?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(i.orderType))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume_".concat(t.getActiveTheme)},[t._v(t._s(i.volume))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume_".concat(t.getActiveTheme),style:{color:("open"===o.subType?t.getUpdatedProfit(i,"profit"):i.profit)<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("open"===o.subType?t.getUpdatedProfit(i,"profit"):i.profit))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume",class:"StopOrDeletePortfolioAlert-accordion-data-orderBlockRow-volume_".concat(t.getActiveTheme),style:{color:("open"===o.subType?t.getUpdatedProfit(i,"profit"):i.profit)<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("open"===o.subType?t.$moneyf(t.getUpdatedProfit(i,"profitRel"),3):t.$moneyf(t.getCloseProfitRelOrder(i),3)))])])}))],2):t._e()])]}}])})],1),e("div",{staticClass:"StopOrDeletePortfolioAlert-chart",class:"StopOrDeletePortfolioAlert-chart_".concat(t.getActiveTheme)},[e("PortfolioIncome",{attrs:{configObject:t.configObject,histogramVisible:!0,labelClosed:!1,lightTheme:"light"===t.getActiveTheme},on:{updateProfit:t.updateProfit}})],1)]),t.getDopInfo.stopOut?e("div",{staticClass:"StopOrDeletePortfolioAlert-stopOut",style:{border:"1px solid ".concat(t.getRedColor.color),background:t.getRedColor.fill}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-control"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-control-text",class:"StopOrDeletePortfolioAlert-controlPart-control-text_".concat(t.getActiveTheme),style:{color:t.getRedColor.color}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-stopOut-title"},[t._v("Копирование было приостановлено принудительно по причине:")]),e("div",{staticClass:"StopOrDeletePortfolioAlert-stopOut-text"},[t._v("Достигнуто ограничение потерь")])])]),e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit",style:{background:t.getRedColor.color}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit-title",class:"StopOrDeletePortfolioAlert-controlPart-profit-title_".concat(t.getActiveTheme)},[t._v("Зафиксирован убыток:")]),e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit-data",class:"StopOrDeletePortfolioAlert-controlPart-profit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.profitClose,3)," ").concat(t.getPercentLoss,"%")))])])]):e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart",style:{border:"1px solid ".concat(t.isProfit?t.getGreenColor.color:t.getRedColor.color),background:t.isProfit?t.getGreenColor.fill:t.getRedColor.fill}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-control"},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-control-text",class:"StopOrDeletePortfolioAlert-controlPart-control-text_".concat(t.getActiveTheme)},[e("div",{staticClass:"leftText",attrs:{lang:"ru"}}),t._v("В случае остановки копирования будет получен "+t._s(t.textProfitOrLoss)+" результат и закрыто"),e("b",[t._v("  "+t._s(t.getCountOpenOrders)+" ордера(ов).  ")]),e("span",[t._v(t._s(t.textStopOrDelete)+" портфель?")])]),e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-control-buttons"},[e("ButtonIconFlat",{attrs:{modifier:{class:["StopOrDeletePortfolioAlert-controlPart-control-button","StopOrDeletePortfolioAlert-controlPart-control-button_".concat(t.getActiveTheme)]},icon:t.iconCheck,disabled:t.isLoading},on:{click:t.setStatusPortfolio}},[e("span",{style:{opacity:t.isLoading?0:1}},[t._v(t._s("".concat(t.textStopOrDelete," копирование")))]),t.isLoading?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1),e("ButtonIconFlat",{attrs:{modifier:{class:["StopOrDeletePortfolioAlert-controlPart-control-button","StopOrDeletePortfolioAlert-controlPart-control-button_".concat(t.getActiveTheme)]},icon:t.iconClose},on:{click:function(e){return t.showToast({visible:!1})}}},[t._v("Отменить")])],1)]),e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit",style:{background:t.isProfit?t.getGreenColor.color:t.getRedColor.color}},[e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit-title",class:"StopOrDeletePortfolioAlert-controlPart-profit-title_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitleProfit))]),e("div",{staticClass:"StopOrDeletePortfolioAlert-controlPart-profit-data",class:"StopOrDeletePortfolioAlert-controlPart-profit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.profitFormatted," ").concat(t.percentByInvest,"%")))])])])])])},_A=[],AA=function(){var t=this,e=t._self._c;return e("div",{ref:"chartContainer",staticClass:"PortfolioIncome",class:t.rootClass},[e("div",{staticClass:"titleWrap"},[t.getStatusTitle?e("div",{staticClass:"title",style:{fontSize:"".concat(t.getTitleFontSize,"rem")}},[t._v(t._s(t.getTextTitle)),e("span",{class:"title-nameProtfolio title-nameProtfolio_".concat(t.theme)},[t._v(t._s(t.portfolioName))]),"tax"===this.configObject.mode&&"Active"===t.getStatusPortfolio?e("span",{staticStyle:{margin:"0 0.6rem"}},[t._v(t._s("".concat(t.$t("for")," ").concat(t.getDaysInvesting," ").concat(t.$t("days")," ")))]):t._e(),e("span",{style:t.styleCloseProfit},[t._v(t._s(t.getPofitByType))]),"Active"===t.getStatusPortfolio?e("span",{staticStyle:{"margin-left":"0.8rem"}},[t._v(t._s(t.$t("allocated_funds")))]):t._e(),"Active"===t.getStatusPortfolio?e("span",{style:{marginLeft:"0.8rem",color:t.getBlueColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getAllocatedFunds,2))))]):t._e()]):t._e()]),t.isLoadingStatData?e("div",{staticClass:"loader"},[e("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:35,circle:!0}})],1):t._e(),t.isLoadingStatData||t.noStat?t._e():e("div",{staticClass:"chartContainer"},[e("div",{staticClass:"modeChart"},[t.getMetaInfoLines?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.getMetaInfoLines,verticalLinesIndicator:t.getVerticalLinesIndicator,watermark:t.portfolioName,subWatermarkData:t.getTextStatusPortfolio,watermarkData:t.getWatermarkData,typeXAxis:"dateClear",theme:t.theme,maxIndicator:{lines:[0]},minIndicator:{lines:[0]}},on:{hover:t.hoverPoint,clickPoint:t.hedlerClickChartPoint}}):t._e(),e("div",{class:"PortfolioIncome-statData PortfolioIncome-statData_".concat(t.theme)},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit&&i.visible?e("div",{key:o,class:"PortfolioIncome-currentProfit PortfolioIncome-currentProfit_".concat(t.theme),style:{color:i.data[0]<0?t.redColor:t.greenColor}},[e("div",{staticClass:"PortfolioIncome-currentProfit-arrow"},["down"===t.directions[o]?e("div",[e("svgIcon",{attrs:{name:"Arrow_down_direct"}})],1):e("div",[e("svgIcon",{attrs:{name:"Arrow_up_direct"}})],1)]),e("div",{staticClass:"PortfolioIncome-currentProfit-data",class:"PortfolioIncome-currentProfit-data_".concat(t.theme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data[0],2)," / ").concat(t.$moneyf(i.data[1],Math.abs(i.data[1])<.01?5:3)," %")))]),e("div",{staticClass:"PortfolioIncome-currentProfit-title",class:"PortfolioIncome-currentProfit-title_".concat(t.theme)},[e("div",{staticClass:"PortfolioIncome-currentProfit-text",class:"PortfolioIncome-currentProfit-text_".concat(t.theme)},[t._v(t._s(i.text))])])]):t._e()})),0),t.positionHoverWidget?e("div",{class:"PortfolioIncome-hoverWidget PortfolioIncome-hoverWidget_".concat(t.theme),style:t.positionHoverWidget,on:{click:function(e){return t.hedlerClickChartPoint(t.checkPoint)}}},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"PortfolioIncome-hoverWidgetRow PortfolioIncome-hoverWidgetRow_".concat(t.theme)},[e("div",{class:"PortfolioIncome-hoverWidgetStat PortfolioIncome-hoverWidgetStat_".concat(t.theme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e(),t.positionHoverWidgetStartStopProvider?e("div",{class:"PortfolioIncome-hoverWidgetStartStopPortfolio PortfolioIncome-hoverWidgetStartStopPortfolio_".concat(t.theme),style:t.positionHoverWidgetStartStopProvider},[e("div",{class:"PortfolioIncome-hoverWidgetStartStopPortfolio-title PortfolioIncome-hoverWidgetStartStopPortfolio-title_".concat(t.theme)},[t._v(t._s(t.portfolioName))]),e("div",{staticClass:"PortfolioIncome-hoverWidgetStartStopPortfolio-content"},t._l(t.checkStartStopPortfolio,(function(i,o){return e("div",{key:o,staticClass:"PortfolioIncome-hoverWidgetStartStopPortfolio-contentItem"},[e("div",{class:"PortfolioIncome-hoverWidgetStartStopPortfolio-contentData PortfolioIncome-hoverWidgetStartStopPortfolio-contentData_".concat(t.theme)},[t._v(t._s("createdDateTime"===i.status?"Вы начали инвестировать":"Вы прекратили инвестировать"))]),e("div",{class:"PortfolioIncome-hoverWidgetStartStopPortfolio-contentData PortfolioIncome-hoverWidgetStartStopPortfolio-contentData_".concat(t.theme)},[t._v(t._s(new Date(i.date).toLocaleString("ru")))])])})),0)]):t._e()],1),t.histogramVisible?e("div",{staticClass:"PortfolioIncome-gistogramm"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.pointsForGistogramm?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.pointsForGistogramm?e("div",{staticClass:"graphGistogtamm-wrap"},[e("div",{staticClass:"graphGistogtamm-title",class:"graphGistogtamm-title_".concat(t.theme)},[t._v(t._s(t.getStatusStatsDay?"".concat(t.$t("income_by_days"),", ").concat(t.getCurrencyChar):"".concat(t.$t("Income by hours"),", $")))]),e("div",{staticClass:"graphGistogtamm-chart"},[e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.theme,metaInfoForLines:t.getMetaInfoGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)]):t._e()],1)],1):t._e()]),!t.isLoadingStatData&&t.noStat?e("div",{class:"emptyContainer emptyContainer_".concat(t.theme)},[e("div",[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",[t._v(t._s("Active"===t.getStatusPortfolio?"Статистика по портфелю формируется":"Вы пока не инвестируете в портфель"))])]):t._e(),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.getHintText))])],1)},DA=[],kA=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrapper",staticClass:"lineEventChart"},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__fadeIn",appear:""}},[e("div",{staticClass:"lineEventChart-wrap"},[e("div",{staticClass:"lineEventChart-row"},[e("div",{staticClass:"lineEventChart-mainCanvas"},[e("canvas",{ref:"mainCanvas",attrs:{tabindex:"1"}})]),e("div",{staticClass:"lineEventChart-yCanvas",style:{width:t.widthYaxis}},[e("canvas",{ref:"yCanvas"})])]),e("div",{staticClass:"lineEventChart-row"},[e("div",{staticClass:"lineEventChart-xCanvas"},[e("canvas",{ref:"xCanvas"})]),e("div",{staticClass:"lineEventChart-control",style:{minWidth:t.widthYaxis,background:"light"===t.theme?"#fff":"#151924"}},[e("div",{staticClass:"lineEventChart-legendWrap"},[t._l(t.metaInfoForLines,(function(i,o){return e("div",{key:o,ref:"lineEventChart-legend_".concat(o),refInFor:!0,staticClass:"lineEventChart-legend",class:"lineEventChart-legend_".concat(o),style:{background:i.color},on:{mouseenter:function(e){return t.showTooltip(e,o)},mouseleave:function(e){return t.hideTooltip(o)}}})})),e("DxTooltip",{attrs:{showEvent:"mouseenter",visible:!!t.targetTooltip,position:"top",container:".app",wrapperAttr:{class:"lineEventChart"},width:"auto",height:"auto",target:t.targetTooltip},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{class:"lineEventChar-legendTooltip lineEventChar-legendTooltip_".concat(t.theme),style:{padding:"0.4rem",display:"flex",alignItems:"center",borderRadius:"0.4rem"}},[t._v(t._s(t.metaInfoForLines[t.activeIndexTooltip].title))])]},proxy:!0}])})],2)])])])])],1)},IA=[],BA=i("d5e4"),MA=(i("10d1"),i("4143")),$A=i("34d8"),LA=(i("d9e2"),i("1fe2"),i("a3a2"),i("f4dd"),i("2ca0"),i("8a79"),i("12767"),function(){function t(){Object(Qh["a"])(this,t)}return Object(Jh["a"])(t,[{key:"formatNumber",value:function(t,e,i,o){t||(t=0);var n=Math.abs(t);"price"===e&&void 0===i&&(i=0==n||n>1e4?0:n>2500?1:n>500?2:n>50?3:n>2.5?4:n>.25?5:n>.05?6:7,o=i);var s={};return void 0!==i&&(s=void 0!==o?{minimumFractionDigits:i,maximumFractionDigits:o}:{minimumFractionDigits:i,maximumFractionDigits:i}),(t+0).toLocaleString("ru",s)}},{key:"formatDateTime",value:function(t,e){if(!t)return"";if("undefined"===typeof t.getFullYear)try{t=t===parseInt(t,10)?new Date(t):this.parseTimeString(t)}catch(s){return""}if(!t||"undefined"===typeof t.getFullYear)return"";if(!e)return this.formatDateFull(t,!0,!1);if("d"===e)return this.formatDateOnly(t);if("t"===e)return this.formatTime(t,!0,!1);var i=e.startsWith("d")?this.formatDateOnly(t)+" ":"",o=e.endsWith("mil"),n=o||e.endsWith("s");return i+this.formatTime(t,n,o)}},{key:"parseTimeString",value:function(t){if(!t||t.length<8)return null;var e=t.split(/[\sT]+/);if(!e.length)return null;var i=e[0].split(/[.-]+/);if(3!=i.length)return null;var o=parseInt(i[0]),n=parseInt(i[1])-1,s=parseInt(i[2]),r=0,a=0,c=0,l=0;return 2===e.length&&(i=e[1].split(/[:.]+/),i.length>0&&(r=parseInt(i[0])),i.length>1&&(a=parseInt(i[1])),i.length>2&&(c=parseInt(i[2])),i.length>3&&(l=parseInt(i[3]))),new Date(o,n,s,r,a,c,l)}},{key:"formatServerDateTimeString",value:function(t,e){try{var i=new Date(t);if(!e)return this.formatDateFull(i,!0,!1);var o=!e||!1!==e.needSeconds,n=!(!e||!0!==e.needMils);return"time"===e.format?this.formatTime(i,o,n):"date"===e.format?this.formatDateOnly(i):this.formatDateFull(i,o,n)}catch(s){return t}}},{key:"parseDateTime",value:function(t){if(!t||t.length<8)return null;try{var e=t.split(/[\s,T]+/);if(2!=e.length)return null;var i=e[0].split(/[.-]+/);if(3!=i.length)return null;var o=e[1].split(/[.:]+/);if(o.length<2)return null;var n=o.length>3?parseInt(o[3]):0,s=o.length>2?parseInt(o[2]):0,r=parseInt(o[1]),a=parseInt(o[0]),c=parseInt(i[2]),l=parseInt(i[1]),u=parseInt(i[0]);return new Date(u,l,c,a,r,s,n)}catch(d){window.console.log("Date-time string is malformatted: [".concat(t,"]"))}}},{key:"getToday",value:function(){var t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate())}},{key:"formatDateOnly",value:function(t){return"".concat(t.getFullYear(),"-").concat(FA(t.getMonth()+1),"-").concat(FA(t.getDate()))}},{key:"formatDateFull",value:function(t,e,i){return"".concat(this.formatDateOnly(t)," ").concat(this.formatTime(t,e,i))}},{key:"formatTime",value:function(t,e,i){var o="".concat(FA(t.getHours()),":").concat(FA(t.getMinutes()));return e?(o+=":"+FA(t.getSeconds()),i?o+"."+jA(t.getMilliseconds()):o):o}},{key:"getWeekNumInYear",value:function(t){var e=new Date(t),i=new Date(e.getFullYear(),0,1);return Math.ceil(((e-i)/864e5+i.getDay()+1)/7)}}]),t}());function FA(t){return t<10?"0"+t:""+t}function jA(t){return t<10?"00"+t:t<100?"0"+t:""+t}var RA=new LA,WA=new WeakMap,NA=new WeakMap,EA=new WeakMap,UA=new WeakMap,VA=new WeakSet,HA=new WeakSet,GA=new WeakSet,qA=new WeakSet,zA=new WeakSet,YA=new WeakSet,XA=new WeakSet,QA=new WeakSet,JA=new WeakSet,KA=new WeakSet,ZA=new WeakSet,tD=function(){function t(e){Object(Qh["a"])(this,t),Object(MA["a"])(this,ZA),Object(MA["a"])(this,KA),Object(MA["a"])(this,JA),Object(MA["a"])(this,QA),Object(MA["a"])(this,XA),Object(MA["a"])(this,YA),Object(MA["a"])(this,zA),Object(MA["a"])(this,qA),Object(MA["a"])(this,GA),Object(MA["a"])(this,HA),Object(MA["a"])(this,VA),Object(BA["a"])(this,WA,{writable:!0,value:void 0}),Object(BA["a"])(this,NA,{writable:!0,value:void 0}),Object(BA["a"])(this,EA,{writable:!0,value:void 0}),Object(BA["a"])(this,UA,{writable:!0,value:void 0}),this.wctx=e;var i=e.yAxisCanvas.getContext("2d");if(this.ctx=i,this.dpr=window.devicePixelRatio,!i)throw new Error("Canvas 2D context not available.")}return Object(Jh["a"])(t,[{key:"clearCanvas",value:function(){var t=this.wctx,e=this.ctx;e.save();var i=t.yAxisCanvas.width,o=t.yAxisCanvas.height;e.fillStyle=t.eState.gridConfig.relevatColor,e.fillRect(0,0,i,o),e.restore()}},{key:"paint",value:function(){var t=this.wctx;this.newCanvasWidth&&this.newCanvasHeight&&(t.yAxisCanvas.width=this.newCanvasWidth,t.yAxisCanvas.height=this.newCanvasHeight,this.clearCanvas(),t.eState.gridEnabled&&Object($A["a"])(this,zA,nD).call(this),t.eState.maxLineIndicator&&Object($A["a"])(this,JA,cD).call(this),t.eState.minLineIndicator&&Object($A["a"])(this,YA,sD).call(this),Object($A["a"])(this,KA,lD).call(this),t.eState.currentPoint&&Object($A["a"])(this,ZA,uD).call(this))}},{key:"resize",value:function(t,e){var i=this.wctx;this.newCanvasWidth==t&&this.newCanvasHeight==e||(this.newCanvasWidth=t,this.newCanvasHeight=e,i.requestRefresh())}}]),t}();function eD(t,e){var i=e<=7&&e>=-6?RA.formatNumber(t,"money",void 0,1):t.toExponential();return i.length>10&&(i=t.toPrecision(6)),i}function iD(t,e,i,o){var n=this.wctx,s=this.ctx;s.save(),s.textBaseline="bottom",s.textAlign="center",s.font="".concat(8*this.dpr,"px Arial"),s.fillStyle=n.eState.gridConfig.labelColor;var r=o?n.yAxisCanvas.getBoundingClientRect().height-2:t-2,a=Object($A["a"])(this,VA,eD).call(this,e,i);s.fillText(a,n.yAxisCanvas.width/2,r),s.restore()}function oD(t){var e=this.wctx,i=e.getGridParms(t);if(i){var o=i.pos,n=0,s=!0;while(s){var r=o*i.space,a=t?e.mapLogicalToCanvasXCoordinate(r):e.mapLogicalToCanvasYCoordinate(r);if(t?a>e.yAxisCanvas.width:a<0)break;if(e.eState.showLabelsAxis.yAxis&&Object($A["a"])(this,HA,iD).call(this,a,r,i.decPow,t),o+=i.span,n++>100)break}}}function nD(){Object($A["a"])(this,qA,oD).call(this,!1)}function sD(){var t=this,e=this.wctx,i=this.ctx,o=[];e.eState.maxLineIndicator.lines.forEach((function(t){o.push(Math.min.apply(null,e.eState.knots[t].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[])))})),o.forEach((function(o,n){var s=t.wctx.mapLogicalToCanvasYCoordinate(o);e.eState.lastPointsOfRange[e.eState.maxLineIndicator.lines[n]]&&o===e.eState.lastPointsOfRange[e.eState.maxLineIndicator.lines[n]].y||Object($A["a"])(t,QA,aD).call(t,s,{y:o},{color:"red",fillIndicator:e.eState.metaInfoForLines[e.eState.maxLineIndicator.lines[n]].fillIndicator,label:e.eState.metaInfoForLines[e.eState.maxLineIndicator.lines[n]].label},i,e)}))}function rD(t,e,i,o,n){o.lineWidth=3,o.save(),o.fillStyle=i.fillIndicator,o.beginPath(),o.lineTo(15,t+11*this.dpr),o.lineTo(15,t+35*this.dpr),o.lineTo(n.yAxisCanvas.width,t+35*this.dpr),o.lineTo(n.yAxisCanvas.width,t+11*this.dpr),o.closePath(),o.fill(),o.beginPath(),o.lineTo(15,t+11*this.dpr),o.lineTo(15,t+35*this.dpr),o.lineTo(n.yAxisCanvas.width,t+35*this.dpr),o.lineTo(n.yAxisCanvas.width,t+11*this.dpr),o.closePath(),o.strokeStyle=i.color,o.stroke(),o.font="bold ".concat(14*this.dpr,"px Arial"),o.fillStyle=i.color,o.textBaseline="middle",o.textAlign="center",o.fillText(i.extandsIndicator,8*this.dpr+(n.yAxisCanvas.width-3*this.dpr)/2,t+25*this.dpr,n.yAxisCanvas.width-18*this.dpr),o.restore()}function aD(t,e,i,o,n){o.lineWidth=3,o.save(),o.fillStyle=i.fillIndicator,o.beginPath(),o.lineTo(0,t),o.lineTo(15,t-n.xAxisCanvas.height/2),o.lineTo(n.yAxisCanvas.width,t-n.xAxisCanvas.height/2),o.lineTo(n.yAxisCanvas.width,t+n.xAxisCanvas.height/2),o.lineTo(15,t+n.xAxisCanvas.height/2),o.closePath(),o.fill(),o.beginPath(),o.lineTo(0,t),o.lineTo(15,t-n.xAxisCanvas.height/2),o.lineTo(n.yAxisCanvas.width,t-n.xAxisCanvas.height/2),o.lineTo(n.yAxisCanvas.width,t+n.xAxisCanvas.height/2),o.lineTo(15,t+n.xAxisCanvas.height/2),o.closePath(),o.strokeStyle=i.color,o.stroke(),o.fillStyle=i.color,o.font="bold ".concat(14*this.dpr,"px Arial"),o.textBaseline="middle",o.textAlign="center";var s=0;void 0!==e.y&&e.y.toString().split(".").length&&(s=e.y.toString().split(".").at(-1).length),o.fillText(void 0!==e.y?"".concat(i.label," ").concat(Math.abs(e.y)<1?"".concat(s>5?RA.formatNumber(e.y,"money",0,5):RA.formatNumber(e.y,"money",0,s)):"".concat(RA.formatNumber(e.y,"money",0,2))):"".concat(i.label," ").concat(RA.formatNumber(e.c,"money",void 0,0)),8*this.dpr+(n.yAxisCanvas.width-8*this.dpr)/2,t,n.yAxisCanvas.width-13*this.dpr),o.restore()}function cD(){var t=this,e=this.wctx,i=this.ctx,o=[];e.eState.maxLineIndicator.lines.forEach((function(t){o.push(Math.max.apply(null,e.eState.knots[t].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[])))})),o.forEach((function(o,n){var s=t.wctx.mapLogicalToCanvasYCoordinate(o);e.eState.lastPointsOfRange[e.eState.maxLineIndicator.lines[n]]&&(o===e.eState.lastPointsOfRange[e.eState.maxLineIndicator.lines[n]].y||o<0)||Object($A["a"])(t,QA,aD).call(t,s,{y:o},e.eState.metaInfoForLines[e.eState.maxLineIndicator.lines[n]],i,e)}))}function lD(){var t=this,e=this.wctx;if(this.wctx.eState.lastPointsOfRange.length){var i=this.ctx,o=this.wctx.eState.lastPointsOfRange.map((function(e,i){if(e){if(void 0!==e.y)return{x:t.wctx.mapLogicalToCanvasXCoordinate(e.x),y:t.wctx.mapLogicalToCanvasYCoordinate(void 0!==e.y?e.y:e.c)};if(void 0===e.y){var o=t.wctx.eState.knots[i].reduceRight((function(t,e,i){return void 0!==e.y&&void 0===t&&(t=i),t}),void 0);return{x:t.wctx.mapLogicalToCanvasXCoordinate(t.wctx.eState.knots[i][o].x),y:t.wctx.mapLogicalToCanvasYCoordinate(t.wctx.eState.knots[i][o].y)}}}}));o.forEach((function(o,n){if(o){var s=t.wctx.eState.knots[n];if(1!==s.length||s[0].y){var r=t.wctx.eState.lastPointsOfRange[n];if(e.eState.roundIndicator)i.beginPath(),i.fillStyle=e.eState.metaInfoForLines[n].fill,i.arc(e.yAxisCanvas.width/2,o.y,e.yAxisCanvas.width/2,0,2*Math.PI),i.fill(),i.closePath(),i.beginPath(),i.strokeStyle=e.eState.metaInfoForLines[n].color,i.lineWidth=3,i.arc(e.yAxisCanvas.width/2,o.y,e.yAxisCanvas.width/2-2,0,2*Math.PI),i.stroke(),i.closePath();else{var a,c="line"===e.eState.metaInfoForLines[n].type?e.eState.metaInfoForLines[n]:{color:r.y<0?e.eState.metaInfoForLines[n].negative.color:e.eState.metaInfoForLines[n].positive.color,fillIndicator:e.eState.metaInfoForLines[n].fillIndicator,label:""};if(void 0!==t.wctx.eState.lastPointsOfRange[n].y)a=t.wctx.eState.lastPointsOfRange[n];else{var l=t.wctx.eState.knots[n].reduceRight((function(t,e,i){return void 0!==e.y&&void 0===t&&(t=i),t}),void 0);a=t.wctx.eState.knots[n][l]}Object($A["a"])(t,QA,aD).call(t,o.y,a,c,i,e),c.extandsIndicator&&Object($A["a"])(t,XA,rD).call(t,o.y,a,c,i,e)}}}}))}}function uD(){var t=this.wctx;if(!this.wctx.eState.roundIndicator){var e=this.ctx,i=t.eState.knots[t.eState.currentPoint.indexLine][t.eState.currentPoint.indexKnot],o={x:t.mapLogicalToCanvasXCoordinate(i.x),y:t.mapLogicalToCanvasYCoordinate(i.y)};e.save(),e.fillStyle="line"===t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].type?t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].color:i.y<0?t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].negative.color:t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].positive.color,e.fillRect(0,o.y-t.xAxisCanvas.height/2,t.yAxisCanvas.width,t.xAxisCanvas.height),e.fillStyle=t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].fillIndicator,e.font="bold ".concat(8*this.dpr,"px Arial"),e.textBaseline="middle",e.textAlign="center",e.fillText(RA.formatNumber(i.y,"money",Math.abs(i.y)>=1e4?0:2),t.yAxisCanvas.width/2,o.y,t.yAxisCanvas.width),e.restore()}}i("8bd5");var dD=new WeakMap,hD=new WeakMap,pD=new WeakMap,gD=new WeakMap,fD=new WeakSet,mD=new WeakSet,vD=new WeakSet,yD=function(){function t(e){Object(Qh["a"])(this,t),Object(MA["a"])(this,vD),Object(MA["a"])(this,mD),Object(MA["a"])(this,fD),Object(BA["a"])(this,dD,{writable:!0,value:void 0}),Object(BA["a"])(this,hD,{writable:!0,value:void 0}),Object(BA["a"])(this,pD,{writable:!0,value:void 0}),Object(BA["a"])(this,gD,{writable:!0,value:void 0}),this.wctx=e;var i=e.xAxisCanvas.getContext("2d");if(!i)throw new Error("Canvas 2D context not available.");this.ctx=i,this.dpr=window.devicePixelRatio||1}return Object(Jh["a"])(t,[{key:"clearCanvas",value:function(){var t=this.wctx,e=this.ctx;e.save();var i=t.xAxisCanvas.width,o=t.xAxisCanvas.height,n=void 0!=t.eState.relevantXMin?Math.max(0,Math.min(i,t.mapLogicalToCanvasXCoordinate(t.eState.relevantXMin))):0,s=void 0!=t.eState.relevantXMax?Math.max(n,Math.min(i,t.mapLogicalToCanvasXCoordinate(t.eState.relevantXMax))):i;n>0&&(e.fillStyle=t.eState.gridConfig.unrelevantColor,e.fillRect(0,0,n,o)),s>n&&(e.fillStyle=t.eState.gridConfig.relevatColor,e.fillRect(n,0,s-n,o)),se.xAxisCanvas.width:a<0)break;if(e.eState.showLabelsAxis.xAxis&&this.drawLabel(a,r,i.decPow,t),o+=i.span,n++>100)break}}}},{key:"drawGrid",value:function(){this.drawXYGrid(!0)}},{key:"resize",value:function(t,e){var i=this.wctx;this.newCanvasWidth==t&&this.newCanvasHeight==e||(this.newCanvasWidth=t,this.newCanvasHeight=e,i.requestRefresh())}},{key:"paint",value:function(){var t=this.wctx;this.newCanvasWidth&&this.newCanvasHeight&&(this.newCanvasWidth==t.xAxisCanvas.width&&this.newCanvasHeight==t.xAxisCanvas.height||(t.xAxisCanvas.width=this.newCanvasWidth,t.xAxisCanvas.height=this.newCanvasHeight),this.clearCanvas(),t.eState.gridEnabled&&this.drawGrid(),"sectorLine"===t.eState.typeChart&&Object($A["a"])(this,vD,SD).call(this),t.eState.currentPoint&&Object($A["a"])(this,mD,bD).call(this))}}]),t}();function CD(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"date",o=this.wctx.eState.knots[0].length&&this.wctx.eState.knots[0].length>1?this.wctx.eState.knots[0]:this.wctx.eState.knots[1];o||(o=this.wctx.eState.knots[0]);var n=o[t],s=this.wctx.eState.daysArr?this.wctx.eState.daysArr:[],r={count:t,month:Number.isInteger(t+1)?t+1:"",week:Number.isInteger(t)?s[t]:"",day:Number.isInteger(t)?t:"",date:n?new Date(n.date).toLocaleDateString("ru"):"",dateClear:new Date(t).toLocaleDateString("ru")};return r[i]}function bD(){var t=this.wctx;if(!this.wctx.eState.roundIndicator){var e=this.ctx,i=t.eState.knots[t.eState.currentPoint.indexLine][t.eState.currentPoint.indexKnot],o={x:t.mapLogicalToCanvasXCoordinate(i.x),y:t.mapLogicalToCanvasYCoordinate(i.y)};e.save(),e.fillStyle="line"===t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].type?t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].color:i.y<0?t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].negative.color:t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].positive.color,e.fillRect(o.x-t.yAxisCanvas.width/2,0,t.yAxisCanvas.width,t.xAxisCanvas.height),e.fillStyle=t.eState.metaInfoForLines[t.eState.currentPoint.indexLine].fillIndicator,e.font="bold ".concat(8*this.dpr,"px Arial"),e.textBaseline="middle",e.textAlign="center",e.fillText(new Date(i.date).toLocaleDateString("ru"),o.x,t.xAxisCanvas.height/2,t.yAxisCanvas.width),e.restore()}}function SD(){var t=this.wctx,e=this.ctx,i=t.eState.metaInfoForLines.findIndex((function(t){return t.negative&&t.positive})),o=t.eState.knots.find((function(t){return 1===t.length})),n=t.eState.knots[i];if(n&&n.length&&!n.at(-1).y){var s=n.findLast((function(t){return void 0!==t.y}));e.save(),e.textBaseline="bottom",e.font="".concat(8*this.dpr,"px Arial"),e.fillStyle=s.y=t[1]&&e.y<=t[2]&&e.y>=t[3]}},{key:"computeCenter",value:function(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}},{key:"computeIntersection",value:function(t,e){var i=t[0][0],o=t[0][1],n=t[1][0],s=t[1][1],r=e[0][0],a=e[0][1],c=e[1][0],l=e[1][1],u=((i*s-o*n)*(r-c)-(i-n)*(r*l-a*c))/((i-n)*(a-l)-(o-s)*(r-c)),d=((i*s-o*n)*(a-l)-(o-s)*(r*l-a*c))/((i-n)*(a-l)-(o-s)*(r-c));return[u,d]}}]),t}(),TD={x:0,y:1,xy:2},xD=new WeakMap,OD=new WeakMap,wD=new WeakMap,_D=new WeakMap,AD=new WeakMap,DD=new WeakMap,kD=new WeakMap,ID=new WeakMap,BD=new WeakMap,MD=new WeakMap,$D=new WeakMap,LD=new WeakMap,FD=new WeakMap,jD=new WeakMap,RD=function(){function t(e){var i=this;Object(Qh["a"])(this,t),Object(BA["a"])(this,xD,{writable:!0,value:void 0}),Object(BA["a"])(this,OD,{writable:!0,value:void 0}),Object(BA["a"])(this,wD,{writable:!0,value:void 0}),Object(BA["a"])(this,_D,{writable:!0,value:void 0}),Object(BA["a"])(this,AD,{writable:!0,value:void 0}),Object(BA["a"])(this,DD,{writable:!0,value:void 0}),Object(BA["a"])(this,kD,{writable:!0,value:!1}),Object(BA["a"])(this,ID,{writable:!0,value:void 0}),Object(BA["a"])(this,BD,{writable:!0,value:void 0}),Object(BA["a"])(this,MD,{writable:!0,value:void 0}),Object(BA["a"])(this,$D,{writable:!0,value:void 0}),Object(BA["a"])(this,LD,{writable:!0,value:!1}),Object(BA["a"])(this,FD,{writable:!0,value:!1}),Object(BA["a"])(this,jD,{writable:!0,value:void 0}),Object(Vt["a"])(this,"pointerDownEventListener",(function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||"mouse"==t.pointerType&&0!=t.button)&&!i.isPointerInResizeHandle(t)){if(i.trackPointer(t),("touch"==t.pointerType||"pen"==t.pointerType)&&1==i.pointers.size){if(i.lastTouchTime>0&&performance.now()-i.lastTouchTime<=300)return i.lastTouchTime=0,i.processDoubleClickTouch(),void t.preventDefault();i.lastTouchTime=performance.now()}i.switchMode(),t.preventDefault(),i.wctx.eState.currentPoint?(i.wctx.eState.tabPoint=i.wctx.eState.currentPoint,i.wctx.emitClickCurrentPoint()):i.wctx.eState.tabPoint=void 0}})),Object(Vt["a"])(this,"pointerUpEventListener",(function(t){i.releasePointer(t.pointerId),i.switchMode(),t.preventDefault()})),Object(Vt["a"])(this,"pointerMoveEventListener",(function(t){i.trackPointer(t),1==i.pointers.size?i.drag(t):2==i.pointers.size&&i.zooming&&i.zoom(),t.preventDefault()})),Object(Vt["a"])(this,"wheelEventListener",(function(t){var e=i.wctx,o=i.getCanvasCoordinatesFromEvent(t);if(0!=t.deltaY){var n,s,r,a=t.deltaY>0?Math.sqrt(.5):Math.SQRT2;switch(n=t.shiftKey?TD.y:t.altKey?TD.x:t.ctrlKey?TD.xy:e.eState.primaryZoomMode,n){case 0:s=a,r=1;break;case 1:s=1,r=a;break;default:s=a,r=1}e.zoom(s,r,o),e.requestRefresh(),t.preventDefault()}})),Object(Vt["a"])(this,"dblClickEventListener",(function(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||0!=t.button)){var e=i.getCanvasCoordinatesFromEvent(t);i.createKnot(e),t.preventDefault()}})),this.wctx=e,this.pointers=new Map,e.chartCanvas.addEventListener("pointerdown",this.pointerDownEventListener),e.chartCanvas.addEventListener("pointerup",this.pointerUpEventListener),e.chartCanvas.addEventListener("pointercancel",this.pointerUpEventListener),e.chartCanvas.addEventListener("pointermove",this.pointerMoveEventListener),e.chartCanvas.addEventListener("dblclick",this.dblClickEventListener),this.PointUtils=new PD}return Object(Jh["a"])(t,[{key:"dispose",value:function(){var t=this.wctx;t.chartCanvas.removeEventListener("pointerdown",this.pointerDownEventListener),t.chartCanvas.removeEventListener("pointerup",this.pointerUpEventListener),t.chartCanvas.removeEventListener("pointercancel",this.pointerUpEventListener),t.chartCanvas.removeEventListener("pointermove",this.pointerMoveEventListener),t.chartCanvas.removeEventListener("dblclick",this.dblClickEventListener),t.chartCanvas.removeEventListener("wheel",this.wheelEventListener),this.releaseAllPointers()}},{key:"processEscKey",value:function(){this.abortDragging()}},{key:"switchMode",value:function(){var t=this.wctx;this.stopDragging(),this.stopZooming(),1==this.pointers.size?(this.startDragging(),t.chartCanvas.focus()):2==this.pointers.size&&(this.startZooming(),t.chartCanvas.focus())}},{key:"trackPointer",value:function(t){var e=this.wctx,i=t.pointerId;this.pointers.has(i)||e.chartCanvas.setPointerCapture(i),this.pointers.set(i,t)}},{key:"releasePointer",value:function(t){var e=this.wctx;this.pointers.delete(t),e.chartCanvas.releasePointerCapture(t)}},{key:"releaseAllPointers",value:function(){while(this.pointers.size>0){var t=this.pointers.keys().next().value;this.releasePointer(t)}}},{key:"startDragging",value:function(){var t=this.wctx,e=this.getCanvasCoordinates(),i=t.mapCanvasToLogicalCoordinates(e),o=this.pointers.values().next().value.pointerType,n=this.findNearKnot(e,o);t.iState.selectedKnotNdx=n?n.knotNdx:n,t.iState.knotDragging=void 0!==n,t.iState.planeDragging=void 0===n,this.dragStartLPos=i,this.dragStartCPos=e,this.dragCount=0,t.iState.potentialKnotNdx=void 0,t.requestRefresh()}},{key:"abortDragging",value:function(){var t=this.wctx;t.iState.knotDragging&&this.dragCount>0&&(t.undo(),t.fireChangeEvent()),t.iState.planeDragging&&this.dragStartCPos&&this.dragStartLPos&&t.moveCoordinatePlane(this.dragStartCPos,this.dragStartLPos),this.stopDragging(),t.requestRefresh()}},{key:"findNearKnot",value:function(t,e){var i=this.wctx,o=i.findNearestKnot(t),n="touch"==e?30:15;return o&&o.distance<=n?o:void 0}},{key:"stopDragging",value:function(){var t=this.wctx;(t.iState.knotDragging||t.iState.planeDragging)&&t.requestRefresh(),this.dragStartLPos=void 0,this.dragStartCPos=void 0,t.iState.knotDragging=!1,t.iState.planeDragging=!1}},{key:"drag",value:function(t){var e=this.wctx,i=this.getCanvasCoordinates(),o=this.findNearKnot(i);if(this.wctx.eState.currentPoint!==o&&(this.wctx.eState.currentPoint=o?{indexKnot:o.knotNdx,indexLine:o.lineNdx}:o,e.emitHoverPoint(o,t),e.requestRefresh()),e.iState.knotDragging&&void 0!=e.iState.selectedKnotNdx){var n=e.mapCanvasToLogicalCoordinates(i),s=this.snapToGrid(n);e.moveKnot(e.iState.selectedKnotNdx,s),e.requestRefresh(),e.fireChangeEvent()}else e.iState.planeDragging&&this.dragStartLPos&&(e.moveCoordinatePlane(i,this.dragStartLPos),e.requestRefresh())}},{key:"startZooming",value:function(){var t=this.wctx,e=this.pointers.values(),i=e.next().value,o=e.next().value,n=this.getCanvasCoordinatesFromEvent(i),s=this.getCanvasCoordinatesFromEvent(o),r=this.PointUtils.computeCenter(n,s),a=Math.abs(n.x-s.x),c=Math.abs(n.y-s.y);this.zoomLCenter=t.mapCanvasToLogicalCoordinates(r),this.zoomStartDist=this.PointUtils.computeDistance(n,s),this.zoomStartFactorX=t.getZoomFactor(!0),this.zoomStartFactorY=t.getZoomFactor(!1);var l=Math.tan(Math.PI/8);this.zoomX=a>l*c,this.zoomY=c>l*a,this.zooming=!0}},{key:"stopZooming",value:function(){this.zooming=!1}},{key:"zoom",value:function(){var t=this.wctx,e=t.eState,i=this.pointers.values(),o=i.next().value,n=i.next().value,s=this.getCanvasCoordinatesFromEvent(o),r=this.getCanvasCoordinatesFromEvent(n),a=this.PointUtils.computeCenter(s,r),c=this.PointUtils.computeDistance(s,r),l=c/this.zoomStartDist;this.zoomX&&(e.xMax=e.xMin+t.chartCanvas.width/(this.zoomStartFactorX*l)),this.zoomY&&(e.yMax=e.yMin+t.chartCanvas.height/(this.zoomStartFactorY*l)),t.moveCoordinatePlane(a,this.zoomLCenter),t.requestRefresh()}},{key:"processDoubleClickTouch",value:function(){var t=this.getCanvasCoordinates();this.createKnot(t)}},{key:"snapToGrid",value:function(t){var e=this.wctx;return e.eState.gridEnabled&&e.eState.snapToGridEnabled?{x:this.snapToGrid2(t.x,!0),y:this.snapToGrid2(t.y,!1)}:t}},{key:"snapToGrid2",value:function(t,e){var i=5,o=this.wctx,n=o.getGridParms(e);if(!n)return t;var s=n.space*n.span,r=Math.round(t/s)*s,a=Math.abs(t-r),c=a*o.getZoomFactor(e);return c>i?t:r}},{key:"getCanvasCoordinates",value:function(){if(this.pointers.size<1)throw new Error("No active pointers.");var t=this.pointers.values().next().value;return this.getCanvasCoordinatesFromEvent(t)}},{key:"getCanvasCoordinatesFromEvent",value:function(t){var e=this.wctx;return e.mapViewportToCanvasCoordinates({x:t.clientX,y:t.clientY})}},{key:"isPointerInResizeHandle",value:function(t){var e=this.wctx,i=e.chartCanvas.parentNode;if(!(i instanceof HTMLElement))return!1;if("both"!=getComputedStyle(i).resize)return!1;var o=i.getBoundingClientRect(),n=o.right-t.clientX,s=o.bottom-t.clientY,r=18;return n>=0&&n=0&&si.c?this.mapLogicalToCanvasYCoordinate(i.o)/this.dpr:this.mapLogicalToCanvasYCoordinate(i.c)/this.dpr:this.mapLogicalToCanvasYCoordinate(i.y)/this.dpr})}else this.eventEmiter.emit("hover",t)}},{key:"reset",value:function(){this.setEditorState(this.initialEState)}},{key:"clearKnots",value:function(){this.eState.knots=[],this.resetInteractionState()}},{key:"resetHistoryState",value:function(){this.hState={undoStack:[],undoStackPos:0}}},{key:"mapLogicalToCanvasXCoordinate",value:function(t,e){var i;return i=e||this.chartCanvas,(t-this.eState.xMin)*i.width/(this.eState.xMax-this.eState.xMin)}},{key:"mapLogicalToCanvasYCoordinate",value:function(t,e){var i;return i=e||this.chartCanvas,i.height-(t-this.eState.yMin)*i.height/(this.eState.yMax-this.eState.yMin)}},{key:"mapLogicalCandleToRectCanvasCoordinate",value:function(t){var e=this.eState.xMax-this.eState.xMin,i=Math.trunc(this.chartCanvas.width/e),o=this.mapLogicalToCanvasXCoordinate(t.x)+i/2,n=this.mapLogicalToCanvasXCoordinate(t.x)-i/2,s=t.oo.relevantXMax+.1*u-(o.relevantXMin-.1*u)?(o.yMax=r+.05*l,o.yMin=a-.05*l):(o.xMax=c,o.yMax=r+.05*l,o.yMin=a-.05*l),this.moveCoordinatePlane(n,s)}}},{key:"getGridParms",value:function(t,e){var i=e||(t?166:150),o=t?this.eState.xMin:this.eState.yMin,n=i/this.getZoomFactor(t),s=Math.ceil(Math.log(n/5)/Math.LN10),r=0==o?-99:Math.log(Math.abs(o))/Math.LN10;if(!(r-s>10)){var a=Math.pow(10,s),c=n/a,l=c>2.001?5:c>1.001?2:1,u=Math.ceil(o/a),d=l*Math.ceil(u/l);return{space:a,span:l,pos:d,decPow:s}}}},{key:"requestRefresh",value:function(){!this.animationFramePending&&this.isConnected&&(requestAnimationFrame(this.animationFrameHandler),this.animationFramePending=!0)}},{key:"getMaxPointForCurrentRenge",value:function(){var t=this,e=[];return this.eState.knots.forEach((function(i){e.push(i.filter((function(e){return e.x<=t.eState.xMax&&e.x>=t.eState.xMin})))})),e=e.flat(),Math.max.apply(null,e.map((function(t){return void 0!==t.y?t.y:t.h})))}},{key:"getMinPointForCurrentRenge",value:function(){var t=this,e=[];return this.eState.knots.forEach((function(i){e.push(i.filter((function(e){return e.x<=t.eState.xMax&&e.x>=t.eState.xMin})))})),e=e.flat(),Math.min.apply(null,e.map((function(t){return void 0!==t.y?t.y:t.l})))}},{key:"getLastPointsForLine",value:function(){var t=this;this.eState.lastPointsOfRange=[],this.eState.knots.forEach((function(e){var i=null;e.forEach((function(e){e.x<=t.eState.xMax&&void 0!==e.y&&(i=e)})),t.eState.lastPointsOfRange.push(i)}))}},{key:"refresh",value:function(){this.getLastPointsForLine(),this.plotters.forEach((function(t){t.paint()})),this.yAxisPlotter.paint(),this.xAxisPlotter.paint(),this.updateCanvasCursorStyle()}},{key:"updateCanvasCursorStyle",value:function(){var t=this.iState.knotDragging||this.iState.planeDragging?"move":"auto";this.chartCanvas.style.cursor=t}},{key:"fireChangeEvent",value:function(){var t=new CustomEvent("change");this.eventTarget.dispatchEvent(t)}},{key:"findNearestKnot",value:function(t){for(var e,i,o,n=this,s=this.eState.knots,r=function(r){s[r].forEach((function(s,a){var c;if("line"===n.eState.metaInfoForLines[r].type){c=s;var l=n.mapLogicalToCanvasCoordinates(c),u=n.PointUtils.computeDistance(l,t);(void 0===e||u"),e.push(""),e.push(""),e.push(""),e.push(""),e.push("");for(var i=0;i"),e.push(t[i]),e.push(""),e.push(t[i+1]),e.push("");return e.push(""),e.push(""),e.join("")}}]),t}(),QD=i("53ca"),JD=new WeakMap,KD=new WeakMap,ZD=new WeakMap,tk=new WeakMap,ek=new WeakSet,ik=new WeakSet,ok=new WeakSet,nk=new WeakSet,sk=new WeakSet,rk=new WeakSet,ak=new WeakSet,ck=new WeakSet,lk=new WeakSet,uk=new WeakSet,dk=new WeakSet,hk=new WeakSet,pk=new WeakSet,gk=new WeakSet,fk=function(){function t(){Object(Qh["a"])(this,t),Object(MA["a"])(this,gk),Object(MA["a"])(this,pk),Object(MA["a"])(this,hk),Object(MA["a"])(this,dk),Object(MA["a"])(this,uk),Object(MA["a"])(this,lk),Object(MA["a"])(this,ck),Object(MA["a"])(this,ak),Object(MA["a"])(this,rk),Object(MA["a"])(this,sk),Object(MA["a"])(this,nk),Object(MA["a"])(this,ok),Object(MA["a"])(this,ik),Object(MA["a"])(this,ek),Object(BA["a"])(this,JD,{writable:!0,value:void 0}),Object(BA["a"])(this,KD,{writable:!0,value:void 0}),Object(BA["a"])(this,ZD,{writable:!0,value:void 0}),Object(BA["a"])(this,tk,{writable:!0,value:void 0})}return Object(Jh["a"])(t,[{key:"setWidgetContext",value:function(t){this.wctx=t;var e=t.chartCanvas.getContext("2d");if(!e)throw new Error("Canvas 2D context not available.");this.ctx=e}},{key:"resize",value:function(t,e){var i=this.wctx;this.newCanvasWidth==t&&this.newCanvasHeight==e||(this.newCanvasWidth=t,this.newCanvasHeight=e,i.requestRefresh())}},{key:"paint",value:function(){var t=this.wctx;t.eState.watermark&&Object($A["a"])(this,ok,yk).call(this),t.eState.watermarkData&&Object($A["a"])(this,ek,mk).call(this),t.eState.subWatermarkData&&Object($A["a"])(this,ik,vk).call(this),Object($A["a"])(this,dk,wk).call(this),t.eState.maxLineIndicator&&Object($A["a"])(this,uk,Ok).call(this),t.eState.minLineIndicator&&Object($A["a"])(this,lk,xk).call(this),t.eState.verticalLinesIndicator&&Object($A["a"])(this,ak,Pk).call(this),Object($A["a"])(this,sk,bk).call(this),"object"===Object(QD["a"])(t.eState.currentPoint)&&Object($A["a"])(this,rk,Sk).call(this),t.eState.tabPoint&&Object($A["a"])(this,nk,Ck).call(this)}}]),t}();function mk(){var t=this.ctx,e=this.wctx;t.font="".concat(Math.round(e.chartCanvas.width/16),"px sans-serif"),t.textAlign="center",t.textBaseline="top",t.fillStyle=e.eState.watermarkData.color,t.fillText(e.eState.watermarkData.data,e.chartCanvas.width/2,e.chartCanvas.height/2+10,e.chartCanvas.width-16)}function vk(){var t=this.ctx,e=this.wctx,i=Math.round(e.chartCanvas.width/20)>=16?Math.round(e.chartCanvas.width/20):16;t.font="".concat(i,"px sans-serif"),t.textAlign="center",t.textBaseline="ideographic",t.fillStyle="rgba(143, 168, 193, 0.1)",t.fillText(e.eState.subWatermarkData,e.chartCanvas.width/2,e.chartCanvas.height-20,e.chartCanvas.width-16)}function yk(){var t=this.ctx,e=this.wctx;t.font="".concat(Math.round(e.chartCanvas.width/8),"px sans-serif"),t.textAlign="center",t.textBaseline=e.eState.watermarkData?"ideographic":"alphabetic",t.fillStyle="rgba(143, 168, 193, 0.1)",t.fillText(e.eState.watermark,e.chartCanvas.width/2,e.eState.watermarkData?e.chartCanvas.height/2-10:e.chartCanvas.height/2,e.chartCanvas.width-16)}function Ck(){var t=this.wctx,e=this.ctx,i=t.eState.knots[t.eState.tabPoint.indexLine][t.eState.tabPoint.indexKnot],o={x:t.mapLogicalToCanvasXCoordinate(i.x),y:t.mapLogicalToCanvasYCoordinate(i.y)};e.save(),e.beginPath(),e.arc(o.x,o.y,10,0,2*Math.PI),e.fillStyle="red",e.fill(),e.restore()}function bk(){var t=this,e=this.wctx;if(e.eState.lastPointsOfRange.length){var i=this.ctx,o=this.wctx.eState.lastPointsOfRange.map((function(e){if(e)return{x:t.wctx.mapLogicalToCanvasXCoordinate(e.x),y:t.wctx.mapLogicalToCanvasYCoordinate(e.y)}}));i.save(),o.forEach((function(t,o){t&&(i.setLineDash([3,6]),i.lineWidth=1,i.beginPath(),i.strokeStyle=e.eState.metaInfoForLines[o].color,i.moveTo(t.x,t.y),i.lineTo(e.chartCanvas.width,t.y),i.stroke(),i.beginPath(),i.fillStyle=e.eState.metaInfoForLines[o].color,i.fill())})),i.restore()}}function Sk(){var t=this.wctx,e=this.ctx,i=t.eState.currentPoint.indexKnot,o=t.eState.currentPoint.indexLine,n=t.eState.knots[o][i],s={x:t.mapLogicalToCanvasXCoordinate(n.x),y:t.mapLogicalToCanvasYCoordinate(n.y)};e.save(),e.setLineDash([2,5]),e.lineWidth=1,e.beginPath(),e.strokeStyle=t.eState.metaInfoForLines[o].color,e.moveTo(s.x,s.y),e.lineTo(s.x,t.chartCanvas.height),e.stroke(),e.moveTo(s.x,s.y),e.lineTo(t.chartCanvas.width,s.y),e.stroke(),e.beginPath(),e.fillStyle=t.eState.metaInfoForLines[o].color,e.arc(s.x,s.y,8,0,2*Math.PI),e.fill(),e.restore()}function Pk(){var t=this.wctx,e=this.ctx,i=t.eState.knots;e.save(),t.eState.verticalLinesIndicator.forEach((function(o){var n;e.beginPath(),e.moveTo(t.mapLogicalToCanvasXCoordinate(o.x),0),e.lineTo(t.mapLogicalToCanvasXCoordinate(o.x),t.chartCanvas.height),e.strokeStyle=o.color,e.lineWidth=2,e.stroke(),i.forEach((function(t){n||t.forEach((function(t){n||t.x===o.x&&(n=t)}))})),n&&(e.beginPath(),e.arc(t.mapLogicalToCanvasXCoordinate(n.x),t.mapLogicalToCanvasYCoordinate(n.y),5,0,2*Math.PI),e.fillStyle=o.color,e.fill(),e.closePath())})),e.restore()}function Tk(){var t=this.wctx,e=t.eState.knots,i=this.ctx;i.save(),e.forEach((function(e,o){e.forEach((function(e){i.beginPath(),i.arc(t.mapLogicalToCanvasXCoordinate(e.x),t.mapLogicalToCanvasYCoordinate(e.y),5,0,2*Math.PI),i.fillStyle=t.eState.metaInfoForLines[o].color,i.fill()}))})),i.restore()}function xk(){var t=this,e=this.wctx,i=this.ctx,o=[];e.eState.minLineIndicator.lines.forEach((function(t){var i=e.eState.knots[t][0];e.eState.knots[t].forEach((function(t){t.y100}));i.forEach((function(i,s){2!==i.length?i.length&&i.length>4?(Object($A["a"])(t,pk,Ak).call(t,o,i,.3,!0,e.eState.metaInfoForLines[s].fill,{width:e.chartCanvas.width,height:e.chartCanvas.height},3),Object($A["a"])(t,pk,Ak).call(t,o,i,.3,!1,e.eState.metaInfoForLines[s].color,{width:e.chartCanvas.width,height:e.chartCanvas.height},e.eState.metaInfoForLines[s].lineWidth?e.eState.metaInfoForLines[s].lineWidth:3),n||Object($A["a"])(t,ck,Tk).call(t)):(Object($A["a"])(t,hk,_k).call(t,o,i,e.eState.metaInfoForLines[s],!0,{width:e.chartCanvas.width,height:e.chartCanvas.height},e.eState.metaInfoForLines[s].lineWidth?e.eState.metaInfoForLines[s].lineWidth:3),Object($A["a"])(t,hk,_k).call(t,o,i,e.eState.metaInfoForLines[s],!1,{width:e.chartCanvas.width,height:e.chartCanvas.height},e.eState.metaInfoForLines[s].lineWidth?e.eState.metaInfoForLines[s].lineWidth:3)):Object($A["a"])(t,ck,Tk).call(t)}))}function _k(t,e,i,o,n,s){t.save(),t.lineWidth=s,t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),o?(t.lineTo(e[2],n.height),t.lineTo(0,n.height),t.fillStyle=i.fill,t.fill()):(t.strokeStyle=i.color,t.stroke()),t.closePath(),t.restore()}function Ak(t,e,i,o,n,s,r){t.lineWidth=r,t.lineCap="round",t.save();for(var a=[],c=e.length,l=0;l0&&(e.fillStyle=t.eState.gridConfig.unrelevantColor,e.fillRect(0,0,n,o)),s>n&&(e.fillStyle=t.eState.gridConfig.relevatColor,e.fillRect(n,0,s-n,o)),se.chartCanvas.width:a<0)break;if(Object($A["a"])(this,Ik,Fk).call(this,o,a,t),o+=i.span,n++>100)break}}}function Rk(){Object($A["a"])(this,Bk,jk).call(this,!0),Object($A["a"])(this,Bk,jk).call(this,!1)}var Wk={props:{points:{type:Array},metaInfoForLines:{type:Array},watermark:{type:String},subWatermarkData:{type:[String,null],default:null},watermarkData:{type:[Object,null],default:null},maxIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},verticalLinesIndicator:{default:void 0},typeXAxis:{type:String,default:"date"},widthYaxis:{type:String,default:"7rem"},roundIndicator:{type:Boolean,default:!1},minIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},showLabelsAxis:{type:Object,default:function(){return{xAxis:!0,yAxis:!0}}},theme:{type:String,default:"light"}},components:{DxTooltip:Tt.a},data:function(){return{chartWrapper:null,mainCanvas:null,daysArr:this.$t("daysArr"),yCanvas:null,xCanvas:null,widget:null,eStateObject:null,targetTooltip:null,activeIndexTooltip:0}},watch:{points:function(t){t&&(this.widget?this.updateChart():this.initChart())},theme:function(){this.initChart()}},methods:{updateChart:function(){var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1),t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1);var n=i-o,s=i+.1*n,r=o-.1*n;this.eStateObject.knots=this.points,this.eStateObject.xMin=e,this.eStateObject.xMax=t,this.eStateObject.daysArr=this.daysArr,this.eStateObject.yMin=r,this.eStateObject.yMax=s,this.eStateObject.relevantXMin=e,this.eStateObject.relevantXMax=t,this.eStateObject.metaInfoForLines=this.metaInfoForLines,this.eStateObject.watermark=this.watermark,this.eStateObject.watermarkData=this.watermarkData,this.eStateObject.subWatermarkData=this.subWatermarkData,this.widget.setEditorState(this.eStateObject)},initChart:function(){this.widget&&(this.widget.setConnected(!1),this.widget=null);var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1),t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1);var n=i-o,s=i+.1*n,r=o-.1*n;this.eStateObject={typeXAxis:this.typeXAxis,knots:this.points,xMin:e,xMax:t,yMin:r,yMax:s,extendedDomain:!0,daysArr:this.daysArr,relevantXMin:e,relevantXMax:t,gridEnabled:!0,currentPoint:void 0,snapToGridEnabled:!1,maxLineIndicator:this.maxIndicator,minLineIndicator:this.minIndicator,roundIndicator:this.roundIndicator,primaryZoomMode:2,showLabelsAxis:this.showLabelsAxis,metaInfoForLines:this.metaInfoForLines,verticalLinesIndicator:this.verticalLinesIndicator,watermark:this.watermark,watermarkData:this.watermarkData,subWatermarkData:this.subWatermarkData,gridConfig:{color:"light"===this.theme?"#f2f2f2":"rgba(143, 168, 193, 0.1)",relevatColor:"light"===this.theme?"#fff":"#151924",unrelevantColor:"light"===this.theme?"#F8F8F8":"#23313f",labelColor:"light"===this.theme?"#333":"#bbcee0"}};var a=window.devicePixelRatio||1;this.mainCanvas=this.$refs.mainCanvas,this.yCanvas=this.$refs.yCanvas,this.xCanvas=this.$refs.xCanvas,this.xCanvas.height=this.$refs.xCanvas.clientHeight*a,this.widget=new XD([{name:"chartCanvas",canvas:this.mainCanvas},{name:"xAxisCanvas",canvas:this.xCanvas},{name:"yAxisCanvas",canvas:this.yCanvas}],[new $k,new fk],!0,this.eStateObject),this.widget.setEventTarget(this.mainCanvas),this.widget.wctx.eventEmiter.subscribe("clickPoint",this.hedlerClickChartPoint),this.widget.wctx.eventEmiter.subscribe("hover",this.hedlerHoverChartPoint)},hedlerHoverChartPoint:function(t){this.$emit("hover",t)},hedlerClickChartPoint:function(t){this.$emit("clickPoint",t)},showTooltip:function(t,e){this.activeIndexTooltip=e,this.metaInfoForLines[e].lineWidth=Math.round(2*this.metaInfoForLines[e].lineWidth),this.updateChart(),this.targetTooltip=t.target},hideTooltip:function(t){this.targetTooltip=null,this.metaInfoForLines[t].lineWidth=Math.round(this.metaInfoForLines[t].lineWidth/2),this.updateChart()},getExstremumPoints:function(t,e){var i,o=this.points.findIndex((function(t){return t.length}));if(o>=0)return i=this.points[o][0][e],this.points.forEach((function(o){if(o.length){var n=Math[t].apply(null,o.reduce((function(t,i){return"number"===typeof i[e]&&t.push(i[e]),t}),[]));("max"===t?n>i:n=20&&Object($A["a"])(t,tI,pI).call(t,i,e,o,e.eState.metaInfoForLines[n]))}))}function fI(t,e,i,o){var n=[];i.forEach((function(t){n.push(e.mapLogicalToCanvasXCoordinate(t.x)),n.push(e.mapLogicalToCanvasYCoordinate(t.y))})),Object($A["a"])(this,oI,mI).call(this,t,n,.3,!1,o.color,{width:e.chartCanvas.width,height:e.chartCanvas.height},o.lineWidth?o.lineWidth:3)}function mI(t,e,i,o,n,s,r){t.save(),t.lineWidth=r,t.lineCap="round";for(var a=[],c=e.length,l=0;l=20){var a=12;t.font="".concat(a*o.dpr,"px Arial"),t.textAlign="center",t.textBaseline=s.y<0?"top":"bottom",t.fillStyle=s.y<0?i.negative.color:i.positive.color;var c=0;void 0!==s.y&&s.y.toString().split(".").length&&(c=s.y.toString().split(".").at(-1).length),t.fillText(Math.abs(s.y)>1?"".concat(RA.formatNumber(s.y,"money",0,Math.abs(s.y)>1e4?0:1)):"".concat(c>5?RA.formatNumber(s.y,"money",0,5):RA.formatNumber(s.y,"money",0,c)),n.mapLogicalToCanvasXCoordinate(s.x),s.y<0?n.mapLogicalToCanvasYCoordinate(s.y)+3:n.mapLogicalToCanvasYCoordinate(s.y)-3,r)}t.strokeStyle=s.y<0?i.negative.color:i.positive.color,t.stroke()}))}var bI={props:{points:{type:Array},metaInfoForLines:{type:Array},maxIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},typeXAxis:{type:String,default:"date"},widthYaxis:{type:String,default:"7rem"},heightXaxis:{type:String,default:"2.2rem"},roundIndicator:{type:Boolean,default:!1},minIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},lastIndicator:{type:Boolean,default:!0},showLabelsAxis:{type:Object,default:function(){return{xAxis:!0,yAxis:!0}}},theme:{type:String,default:"light"},relevatColor:{default:null},unrelevantColor:{default:null}},components:{DxTooltip:Tt.a},data:function(){return{chartWrapper:null,mainCanvas:null,yCanvas:null,xCanvas:null,widget:null,eStateObject:null,targetTooltip:null,daysArr:this.$t("daysArr"),activeIndexTooltip:0}},watch:{points:function(t){t&&(this.widget?this.updateChart():this.initChart())},theme:function(){this.initChart()}},methods:{updateChart:function(){var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");t&&e&&t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1),i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1);var n=i-o,s=t-e,r=i+.15*n,a=o-.15*n,c=this.$refs.mainCanvas.clientWidth,l=Math.ceil(c/this.points[1].length)-8,u=100*l/c;this.eStateObject.knots=this.points,this.eStateObject.xMin=e-s*(u/100),this.eStateObject.xMax=t+s*(u/100),this.eStateObject.yMin=a,this.eStateObject.daysArr=this.daysArr,this.eStateObject.yMax=r,this.eStateObject.relevantXMin=e,this.eStateObject.relevantXMax=t,this.eStateObject.metaInfoForLines=this.metaInfoForLines,this.widget.setEditorState(this.eStateObject)},initChart:function(){this.widget&&(this.widget.setConnected(!1),this.widget=null);var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");t&&e&&t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1),i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1);var n=i-o,s=t-e,r=i+.15*n,a=o-.15*n,c=this.$refs.mainCanvas.clientWidth,l=Math.ceil(c/this.points[1].length)-8,u=100*l/c;this.eStateObject={typeXAxis:this.typeXAxis,knots:this.points,xMin:e-s*(u/100),xMax:t+s*(u/100),yMin:a,yMax:r,extendedDomain:!0,relevantXMin:e,relevantXMax:t,daysArr:this.daysArr,gridEnabled:!0,currentPoint:void 0,snapToGridEnabled:!1,maxLineIndicator:this.maxIndicator,minLineIndicator:this.minIndicator,lastIndicator:this.lastIndicator,roundIndicator:this.roundIndicator,primaryZoomMode:2,showLabelsAxis:this.showLabelsAxis,metaInfoForLines:this.metaInfoForLines,gridConfig:{color:"light"===this.theme?"#f2f2f2":"rgba(143, 168, 193, 0.1)",relevatColor:this.relevatColor?this.relevatColor:"light"===this.theme?"#fff":"#151924",unrelevantColor:this.unrelevantColor?this.unrelevantColor:"light"===this.theme?"#fff":"#151924",labelColor:"light"===this.theme?"#333":"#bbcee0",interval:l<35?0:l}};var d=window.devicePixelRatio||1;this.mainCanvas=this.$refs.mainCanvas,this.yCanvas=this.$refs.yCanvas,this.xCanvas=this.$refs.xCanvas,this.xCanvas.height=this.$refs.xCanvas.clientHeight*d,this.widget=new XD([{name:"chartCanvas",canvas:this.mainCanvas},{name:"xAxisCanvas",canvas:this.xCanvas},{name:"yAxisCanvas",canvas:this.yCanvas}],[new $k,new aI],!0,this.eStateObject),this.widget.setEventTarget(this.mainCanvas),this.widget.wctx.eventEmiter.subscribe("clickPoint",this.hedlerClickChartPoint),this.widget.wctx.eventEmiter.subscribe("hover",this.hedlerHoverChartPoint)},hedlerHoverChartPoint:function(t){this.$emit("hover",t)},hedlerClickChartPoint:function(t){this.$emit("clickPoint",t)},showTooltip:function(t,e){this.activeIndexTooltip=e,this.metaInfoForLines[e].lineWidth=Math.round(2*this.metaInfoForLines[e].lineWidth),this.updateChart(),this.targetTooltip=t.target},hideTooltip:function(t){this.targetTooltip=null,this.metaInfoForLines[t].lineWidth=Math.round(this.metaInfoForLines[t].lineWidth/2),this.updateChart()},getExstremumPoints:function(t,e){var i,o=this.points.findIndex((function(t){return t.length}));if(o>=0)return i=this.points[o][0][e],this.points.forEach((function(o){if(o.length){var n=Math[t].apply(null,o.reduce((function(t,i){return void 0!==i[e]&&t.push(i[e]),t}),[]));("max"===t?n>i:n=e?this.directions.splice(1,1,"up"):this.directions.splice(1,1,"down"))},getCloseProfit:function(t,e){void 0!==t&&void 0!==e&&(t>=e?this.directions.splice(0,1,"up"):this.directions.splice(0,1,"down"))},getActiveTab:function(){this.points=null,this.profitByOpenOrders=0,this.profitCloseOrders=0},countClosedOrders:function(t){var e;t&&(this.isLoadingStatData||"Stoped"!==(null===(e=this.findPortfolio)||void 0===e?void 0:e.status)||this.setPointsForChart(),this.setClosedProfit())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingStatData:"expertsPortfolio/isLoadingStatData",getStatData:"statDataForPortfolio/getStatData",getServerTime:"serverTime/getServerTime",getActiveTab:"expertsPortfolio/getActiveTab",findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},theme:function(){return this.lightTheme?"light":this.getActiveTheme},redColor:function(){return this.lightTheme?"#e91212":this.getRedColor.color},greenColor:function(){return this.lightTheme?"#008e72":this.getGreenColor.color},styleCloseProfit:function(){return{color:this.getFloatingProfit<0?this.redColor:this.greenColor}},getStat:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm.length&&this.pointsForGistogramm[1].length&&this.pointsForGistogramm[2].length){var t=this.pointsForGistogramm[1].at(-1).y,e=Math.max.apply(null,this.pointsForGistogramm[1].map((function(t){return t.y}))),i=Math.min.apply(null,this.pointsForGistogramm[1].map((function(t){return t.y}))),o=this.pointsForGistogramm[2].at(-1).y;return[{label:"P/L",symbol:this.getCurrencyChar,data:this.$moneyf(t,t<.01?5:3),color:t<0?"red":"green"},{label:this.$t("max"),symbol:this.getCurrencyChar,data:this.$moneyf(e,Math.abs(e)<.01?5:3),color:"green"},{label:this.$t("min"),symbol:this.getCurrencyChar,data:this.$moneyf(i,Math.abs(i)<.01?5:3),color:"red"},{label:this.$t("average"),symbol:this.getCurrencyChar,data:this.$moneyf(o,Math.abs(o)<.01?5:3),color:"orange"}]}},getWatermarkData:function(){return this.getCurrentProfit?{data:"".concat(this.getCurrencyChar).concat(this.$moneyf(this.getCurrentProfit[1].data[0],2)," / ").concat(this.$moneyf(this.getCurrentProfit[1].data[1],Math.abs(this.getCurrentProfit[1].data[1])<.01?5:3),"%"),color:this.getCurrentProfit[1].data[0]<0?this.getRedColor.fill:this.getGreenColor.fill}:null},getTextStatusPortfolio:function(){if(this.findPortfolio){var t={Active:this.$t("portfolio_launched"),Stoped:this.$t("portfolio_stopped"),Created:this.$t("portfolio_did_not_launch")};return t[this.findPortfolio.status].toUpperCase()}},getStatusTitle:function(){if(this.wrapperSize)return!(this.wrapperSize.width<600)},getAllocatedFunds:function(){if(this.findPortfolio)return this.findPortfolio.investMoney},getTitleFontSize:function(){if(this.wrapperSize)return this.wrapperSize.width>1e3?1.4:1.2},getFloatingProfit:function(){if(this.points&&this.points.length&&this.points[0].length)return this.points[1].at(-1).y},getCloseProfit:function(){if(this.points&&this.points.length&&this.points[0].length)return this.points[0].at(-1).y},getStatusPorvider:function(){if(this.findPortfolio)return"Signal"===this.findPortfolio.type},getProfitByOpenOrders:function(){if(this.openOrders&&this.openOrders.length)return this.openOrders.reduce((function(t,e){return t+e.profit}),0)},getPofitByCloseOrders:function(){return this.closedOrders&&this.closedOrders.length?this.closedOrders.reduce((function(t,e){return t+e.profit}),0):0},getStatusStatsDay:function(){if(this.expertsForStat&&"tax"===this.configObject.mode){var t,e=this.expertsForStat.myStat;return e.forEach((function(e){if(e.data.length&&!t){var i=e.data.filter((function(t){return 2===t.statType}));i.length>1&&(t=!0)}})),t}},getLastHoursStat:function(){if(this.expertsForStat&&"tax"===this.configObject.mode){var t=this.expertsForStat.myStat,e=[],i=this.getServerTime.utcNow;return t.forEach((function(t){if(t.data.length){var o=t.data.filter((function(t){return 1===t.statType&&new Date(i).getFullYear()===new Date(t.date).getFullYear()&&new Date(i).getMonth()===new Date(t.date).getMonth()&&new Date(i).getDate()===new Date(t.date).getDate()}));o.length&&e.push(o.at(-1))}})),e}},getSubscriptionsByBag:function(){var t=this;return this.allSubscriptionCurrentDate.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}))},getHintText:function(){return"tax"===this.configObject.mode?"Доход по открытым и закрытм сделкам с учётом коммисии провайдера или портфеля":"Усреднённый доход портфеля/провайдера по закрытым сделкам"},countClosedOrders:function(){return this.closedOrders.length},getDaysInvesting:function(){if(this.getServerTime&&this.findPortfolio){var t=this.getServerTime.utcNow,e=this.findPortfolio.startDateTime,i=e?new Date(t)-new Date(e):0,o=i?i/864e5:0;return o<864e5?Math.round(o):1}},getVerticalLinesIndicator:function(){if(this.findPortfolio&&"tax"!==this.configObject.mode){var t=[];return this.findPortfolio.chain&&this.findPortfolio.chain.forEach((function(e){var i=RI();t.push({x:new Date(new Date(e.createdDateTime).getFullYear(),new Date(e.createdDateTime).getMonth(),new Date(e.createdDateTime).getDate()).getTime(),color:i})})),this.findPortfolio.startDateTime&&t.push({x:new Date(new Date(this.findPortfolio.startDateTime).getFullYear(),new Date(this.findPortfolio.startDateTime).getMonth(),new Date(this.findPortfolio.startDateTime).getDate()).getTime(),color:RI()}),t}},getStatusPortfolio:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getMetaInfoLines:function(){if(this.points&&this.points[0].length)return[{type:"line",color:this.lightTheme?"#3C73F1":this.getBlueColor.color,fill:this.lightTheme?"rgba(36, 98, 219, 0.1)":this.getBlueColor.fill,fillIndicator:"dark"===this.theme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("poct")},{type:"line",color:this.points[1].at(-1).y>=0?this.lightTheme?"#008e72":this.getGreenColor.color:this.lightTheme?"#e91212":this.getRedColor.color,fill:this.points[1].at(-1).y>=0?this.lightTheme?"rgba(0, 142, 114, 0.1)":this.getGreenColor.fill:this.lightTheme?"rgba(233, 18, 18, 0.1)":this.getRedColor.fill,fillIndicator:"dark"===this.theme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]},getMetaInfoGistogramm:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.theme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.theme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("income")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("average")}]},getCurrentProfit:function(){if(this.points&&this.points.length){var t=this.findPortfolio.investMoney,e=this.getCloseProfit?100*this.getCloseProfit/t:0,i=this.getFloatingProfit?100*this.getFloatingProfit/t:0;return[{data:[this.getCloseProfit,e],symbol:"dollar"===this.dollarOrPercent?"$":"%",color:this.getCloseProfit<0?"red":"green",text:this.$t("poct"),visible:this.labelClosed},{data:[this.getFloatingProfit,i],symbol:"dollar"===this.dollarOrPercent?"$":"%",color:this.getFloatingProfit<0?"red":"green",text:this.$t("current_income"),visible:!0}]}},rootClass:function(){return{dark:"dark"===this.theme}},portfolioName:function(){if(this.findPortfolio)return this.findPortfolio.name},expertsForStat:function(){if(!this.isLoadingStatData)return this.getStatData},getTextTitle:function(){return"abs"===this.configObject.mode?this.getStatusPorvider?this.$t("average_provider_income"):this.$t("average_portfolio_income"):this.$t("ynift")},getPofitByType:function(){if(this.expertsForStat&&this.points&&this.points[0].length)return"".concat("percent"===this.dollarOrPercent?"%":this.getCurrencyChar," ").concat(this.$moneyf(this.points[1].at(-1).y,"percent"===this.dollarOrPercent&&Math.abs(this.points[1].at(-1).y)<1&&0!==this.points[1].at(-1).y?5:2))}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{hedlerClickChartPoint:function(t){this.$emit("setActiveDate",t)},setMessageHandler:function(t){var e=this;if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){if("tax"!==this.configObject.mode||"Stoped"===this.findPortfolio.status)return;var i=t.data[0].openOrders.tradingOrders,o=this.openOrders;if(i&&i.length&&o&&o.length){var n=i.filter((function(t){return e.getSubscriptionsByBag.some((function(e){return e.subscription.id===+t.subscriptionId}))}));n.length&&(this.profitByOpenOrders=n.reduce((function(t,e){return t+=e.profit,t}),0),this.$emit("updateProfit",{close:this.profitCloseOrders,open:this.profitByOpenOrders,orders:n}))}else this.profitByOpenOrders=0,this.$emit("updateProfit",{close:this.profitCloseOrders,open:this.profitByOpenOrders,orders:[]});this.setPointsForChart(),this.setPointsForGistogramm()}else if(null!==t&&void 0!==t&&t.command&&"BrokerPosition"===t.command&&"tax"===this.configObject.mode){var s=t.data;s.accountId===this.getDefaultAccount.id&&s.closedDate&&this.getSubscriptionsByBag.some((function(t){return t.subscription.id===+s.subscriptionId}))&&(this.profitCloseOrders+=s.profit,this.$emit("updateProfit",{close:this.profitCloseOrders,open:this.profitByOpenOrders,orders:null}),this.setPointsForChart(),this.setPointsForGistogramm())}},checkLinePortfolio:function(t){var e=[];return this.findPortfolio.chain&&this.findPortfolio.chain.length?(this.findPortfolio.chain.forEach((function(i){new Date(i.createdDateTime).getFullYear()===new Date(t).getFullYear()&&new Date(i.createdDateTime).getMonth()===new Date(t).getMonth()&&new Date(i.createdDateTime).getDate()===new Date(t).getDate()&&e.push({status:"createdDateTime",date:i.createdDateTime},{status:"stopDateTime",date:i.stopDateTime})})),new Date(this.findPortfolio.startDateTime).getFullYear()===new Date(t).getFullYear()&&new Date(this.findPortfolio.startDateTime).getMonth()===new Date(t).getMonth()&&new Date(this.findPortfolio.startDateTime).getDate()===new Date(t).getDate()&&e.push({status:"createdDateTime",date:this.findPortfolio.startDateTime}),e.sort((function(t,e){return new Date(t.date)-new Date(e.date)}))):(new Date(this.findPortfolio.startDateTime).getFullYear()===new Date(t).getFullYear()&&new Date(this.findPortfolio.startDateTime).getMonth()===new Date(t).getMonth()&&new Date(this.findPortfolio.startDateTime).getDate()===new Date(t).getDate()&&e.push({status:"createdDateTime",date:this.findPortfolio.startDateTime}),e)},hoverPoint:function(t){if(t){this.checkPoint=t;var e=this.wrapperSize.width-t.cPointX,i=this.wrapperSize.height-t.cPointY;if(this.checkStartStopPortfolio=this.checkLinePortfolio(t.point.date),this.checkStartStopPortfolio.length&&"tax"!==this.configObject.mode)return this.positionHoverWidgetStartStopProvider={top:i>40*this.checkStartStopPortfolio.length?"".concat(Math.round(t.cPointY),"px"):"".concat(Math.round(t.cPointY-40*this.checkStartStopPortfolio.length),"px"),left:"".concat(e>170?t.cPointX:t.cPointX-170,"px")},this.positionHoverWidget=null,void(this.showHoverWidget=!0);this.positionHoverWidgetStartStopProvider=null;var o=this.points[0].findIndex((function(e){return e.x===t.point.x}));this.positionHoverWidget={top:"".concat(i>70?Math.round(t.cPointY):Math.round(t.cPointY-70),"px"),left:"".concat(e>180?t.cPointX:t.cPointX-80,"px")},o>0&&(this.statsForHoverWidget=[{stat:"".concat("dollar"===this.dollarOrPercent?this.getCurrencyChar:"%"," ").concat(this.$moneyf(this.points[0][o].y,"dollar"===this.dollarOrPercent?this.points[0][o].y>1e4?0:2:5)),color:"blue"},{stat:"".concat("dollar"===this.dollarOrPercent?this.getCurrencyChar:"%"," ").concat(this.$moneyf(this.points[1][o].y,"dollar"===this.dollarOrPercent?this.points[1][o].y>=1e6?0:2:5)),color:this.points[1][o].y>=0?"green":"red"}])}else this.positionHoverWidget=null,this.positionHoverWidgetStartStopProvider=null,this.statsForHoverWidget=null,this.checkPoint=null},getStatForType:function(t){var e=t.filter((function(t){return 2===t.statType})),i=t.filter((function(t){return 1===t.statType}));return this.getStatusStatsDay?e:i},setPointsForGistogramm:function(t){var e=this;this.pointsForGistogramm=[[],[]];var i=this.combinedData();if(i){var o=0;if(i.forEach((function(t,i){var n=t.profitOpen+t.floatingProfitOpen,s=t.profitClose+t.floatingProfitClose,r=s-n;o+=r,e.pointsForGistogramm[0].push({x:i,y:r,date:t.date}),e.pointsForGistogramm[1].push({x:i,y:o/(i+1),date:t.date})})),this.pointsForGistogramm.unshift([{x:0,y:0,date:new Date}]),"tax"===this.configObject.mode){var n=i.at(-1).profitOpen+i.at(-1).floatingProfitOpen;if("first"===t&&this.expertsForStat.nowMyStat){var s=this.expertsForStat.nowMyStat.profitAbs-n;this.pointsForGistogramm[1].at(-1).y=s;var r=this.pointsForGistogramm[1].reduce((function(t,e){return t+e.y}),0);return void(this.pointsForGistogramm[2].at(-1).y=r/this.pointsForGistogramm[2].length)}var a=this.profitCloseOrders+this.profitByOpenOrders,c=a-n;this.pointsForGistogramm[1].at(-1).y=c;var l=this.pointsForGistogramm[1].reduce((function(t,e){return t+e.y}),0);this.pointsForGistogramm[2].at(-1).y=l/this.pointsForGistogramm[2].length,this.$store.commit("statDataForPortfolio/updateNowStatistic",{profitAbs:a,profitClose:this.profitCloseOrders})}}},setPointsForChart:function(t){var e=this;this.points=[[],[]];var i=this.combinedData();if(i&&(i.forEach((function(t){e.points[0].push({x:new Date(t.date).getTime(),y:t.profitClose,date:t.date}),e.points[1].push({x:new Date(t.date).getTime(),y:t.profitClose+t.floatingProfitClose,date:t.date})})),"tax"===this.configObject.mode)){var o;if("first"===t&&this.expertsForStat.nowMyStat)return this.points[1].at(-1).y=this.expertsForStat.nowMyStat.profitAbs,void(this.points[0].at(-1).y=this.expertsForStat.nowMyStat.profitClose);var n=this.$decimalAdjust("trunc",this.profitCloseOrders+this.profitByOpenOrders,-4),s=this.$decimalAdjust("trunc",this.profitCloseOrders,-4);if(this.points[1].at(-1).y=n,this.points[0].at(-1).y=s,"Stoped"===this.findPortfolio.status&&null!==(o=this.closedOrders)&&void 0!==o&&o.length){var r=this.closedOrders.reduce((function(t,e){return t+e.profit}),0);this.points[0].at(-1).y=r,this.points[1].at(-1).y=r}}},checkStopoutPortfolio:function(){if("Stoped"===this.findPortfolio.status){var t=this.findPortfolio.bagContents[0].ddPercentMax,e=this.getFloatingProfit+this.findPortfolio.investMoney;e<=t&&this.showToast({visible:!0,componentName:"StopOrDeletePortfolioAlert",shading:!0,outSideClick:!0,width:"75vw",height:"90vh",dopInfo:{stopOut:!0,namePortfolio:this.findPortfolio.name}})}},combinedData:function(){var t=this;if(this.expertsForStat){var e="tax"===this.configObject.mode?this.expertsForStat.myStat:this.expertsForStat.statSubs;if("tax"!==this.configObject.mode||(this.noStat=e.every((function(t){return!t.data.length}))&&this.getProfitByOpenOrders&&this.getPofitByCloseOrders,!this.noStat)){var i={};return e.every((function(t){return!t.data.length}))?[{date:new Date,profitOpen:0,profitClose:this.getPofitByCloseOrders,floatingProfitOpen:0,floatingProfitClose:this.getProfitByOpenOrders,equity:this.getPofitByCloseOrders+this.getProfitByOpenOrders}]:(e.forEach((function(e){if(e.data.length){var o="tax"===t.configObject.mode?t.getStatForType(e.data):e.data;o.length&&o.forEach((function(t){var e=new Date(t.date).getTime();i[e]?(i[e][0].push(t.profitOpen),i[e][1].push(t.profitClose),i[e][2].push(t.floatingProfitOpen),i[e][3].push(t.floatingProfitClose)):i[e]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]}))}})),Object.entries(i).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}})))}}},setClosedProfit:function(){"tax"===this.configObject.mode&&(this.profitCloseOrders=this.closedOrders.reduce((function(t,e){return t+e.profit}),0))},onResize:function(t){this.wrapperSize={width:t[0].contentRect.width,height:t[0].contentRect.height}}}),mounted:function(){var t=this;this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$nextTick((function(){t.observerElem=t.$refs.chartContainer})),this.isLoadingStatData||(this.setPointsForChart("first"),this.setPointsForGistogramm("first"),this.checkStopoutPortfolio(),this.openOrders&&this.openOrders.length&&(this.profitByOpenOrders=this.openOrders.at(-1).y),this.closedOrders.length&&this.setClosedProfit())},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}};function RI(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var WI=jI,NI=(i("1e92"),Object(C["a"])(WI,AA,DA,!1,null,"59eee5b7",null)),EI=NI.exports,UI={name:"StopOrDeletePortfolioAlert",components:{DxLoadIndicator:wt["DxLoadIndicator"],VuePerfectScrollbar:Xt.a,DxAccordion:wt["DxAccordion"],PortfolioIncome:EI},props:{getDopInfo:{type:Object}},mixins:[qe],data:function(){return{isLoading:!1,commonStat:null,openOrdersProfits:null,profitOpen:0,profitClose:0,labelsForColumns:["net_profit","profit_factor","fee","maximum_balance_drawdown","total_trades","post","profitable_trades","tmpt","unprofitable_trades","tmut","average_trade_profit","tpoi","apipp","average_trade_length","trading_volume"]}},watch:{getCountClosedOrders:function(t){t&&this.getDopInfo.stopOut&&this.setProfits()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({openOrders:"statDataForPortfolio/openOrders",apiUrl:"api/api",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getDefaultAccount:"subscribeOrders/getDefaultAccount",closedOrders:"statDataForPortfolio/closedOrders",findPortfolio:"expertsPortfolio/findPortfolio"})),{},{getLabelsForOrders:function(){return[this.$t("contract"),this.$t("type"),this.$t("volume"),"P/L,".concat(this.getCurrencyChar),"P/L,%"]},getCryptoStatus:function(){return"Crypto"===this.getDefaultAccount.groupType},getSubscriptionsBySource:function(){var t=this;if(this.findPortfolio&&this.allSubscriptionCurrentDate){var e=this.allSubscriptionCurrentDate,i=e.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}));return i.map((function(t){return t.subscription.id.toString()}))}},getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCountOpenOrders:function(){return this.openOrders?this.openOrders.length:0},getCountClosedOrders:function(){return this.closedOrders?this.closedOrders.length:0},getDataForAccordion:function(){return[{title:"Статистика портфеля",data:this.getStatDataForAccordion,type:"stat"},{title:"Открытые сделки",data:this.openOrders,type:"order",subType:"open"},{title:"Закрытые сделки",data:this.closedOrders,type:"order",subType:"close"}]},getStatDataForAccordion:function(){if(this.commonStat)return[{color:this.commonStat.profit<0?this.getRedColor.color:this.getGreenColor.color,data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.commonStat.profit,2))},{color:this.commonStat.profitFactor<0?this.getRedColor.color:this.getGreenColor.color,data:Math.round(this.commonStat.profitFactor)},{data:this.commonStat.comission},{color:0===this.commonStat.maxDDBalance?this.getGreenColor.color:this.getRedColor.color,data:"% ".concat(this.$moneyf(this.commonStat.maxDDBalance))},{data:this.commonStat.ordersCount},{color:100*this.commonStat.positiveOrdersCount/this.commonStat.ordersCount<30?this.getRedColor.color:100*this.commonStat.positiveOrdersCount/this.commonStat.ordersCount>30&&100*this.commonStat.positiveOrdersCount/this.commonStat.ordersCount<60?this.getOrangeColor.color:this.getGreenColor.color,data:this.commonStat.positiveOrdersCount&&this.commonStat.ordersCount?"".concat(Math.round(100*this.commonStat.positiveOrdersCount/this.commonStat.ordersCount),"%"):0},{data:this.commonStat.positiveOrdersCount},{color:this.getGreenColor.color,data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.commonStat.maxProfit,2))},{data:this.commonStat.negativeOrdersCount},{color:this.commonStat.minProfit<0?this.getRedColor.color:this.getGreenColor.color,data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.commonStat.minProfit,2))},{color:this.commonStat.avgProfit<0?this.getRedColor.color:this.getGreenColor.color,data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.commonStat.avgProfit,2))},{data:this.$moneyf(Math.round(this.commonStat.sumPipByOrders))},{data:this.$moneyf(Math.round(this.commonStat.avgPipByOrders/10))},{data:this.getFormatDate(this.commonStat.avgOrderDurationInms)},{data:"".concat(this.getCryptoStatus?"Qty":this.getCurrencyChar," ").concat(this.$moneyf(this.commonStat.sumOrderVolume))}]},getTitleProfit:function(){return this.isProfit?"Ваш доход составит:":"Ваш убыток составит:"},getDataForHeader:function(){return[{title:this.$t("portfolio"),data:this.namePortfolio,color:"#333",background:"#FFE600"},{title:this.$t("current_income"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.commonProfit)),color:this.commonProfit<0?this.getRedColor.color:this.getGreenColor.color,background:this.commonProfit<0?this.getRedColor.fill:this.getGreenColor.fill},{title:this.$t("invested"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.investMoney)),color:this.getBlueColor.color,background:this.getBlueColor.fill},{title:this.$t("for_closed_trades"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.profitClose)),color:this.profitClose>=0?this.getGreenColor.color:this.getRedColor.color,background:this.profitClose>=0?this.getGreenColor.fill:this.getRedColor.fill},{title:this.$t("percentage_successful_trades"),data:"".concat(this.$moneyf(this.percentSuccessProfitClosedOrders),"%"),color:this.percentSuccessProfitClosedOrders<0?this.getRedColor.color:this.getGreenColor.color,background:this.percentSuccessProfitClosedOrders<0?this.getRedColor.fill:this.getGreenColor.fill}]},classRoot:function(){return{loss:!this.isProfit}},rightTextClass:function(){return{red:this.profit<0,green:this.profit>=0}},investMoney:function(){return this.findPortfolio?this.findPortfolio.investMoney:0},profit:function(){return this.profitOpen},commonProfit:function(){return this.profit+this.profitClose},profitCloseCount:function(){return this.closedOrders.filter((function(t){return t.profit>=0})).length},percentSuccessProfitClosedOrders:function(){return this.profitCloseCount?100*this.profitCloseCount/this.closedOrders.length:0},profitCloseFormatted:function(){return Lm(this.profitClose,2,!0)},percentByInvest:function(){return Lm(100*this.profit/this.investMoney,1,!0)},getPercentLoss:function(){return this.profitClose?Lm(100*this.profitClose/this.investMoney,1,!0):0},isProfit:function(){return this.profit>=0},profitFormatted:function(){return Lm(this.profit,2,!0)},iconCheck:function(){return{name:"Stop",color:this.isLoading?"transparent":this.getRedColor.color}},iconClose:function(){return{name:"Close",color:"#8c8c8c"}},textStopOrDelete:function(){return this.getDopInfo.stop?"Остановить":"удалить"},textProfitOrLoss:function(){return this.isProfit?"положительный":"отрицательный"},namePortfolio:function(){return this.getDopInfo.namePortfolio},configObject:function(){return{mode:"tax"}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{updateProfit:function(t){var e=this;this.profitOpen=t.open,this.profitClose=t.close,t.orders&&t.orders.length&&(this.openOrdersProfits=t.orders.map((function(t){return{id:t.id,profit:t.profit,profitRel:e.getCryptoStatus?100*t.profit/(t.volume*t.openPrice):100*t.profit/t.volume}})))},getCloseProfitRelOrder:function(t){return this.getCryptoStatus?100*t.profit/(t.volume*t.openPrice):100*t.profit/t.volume},getUpdatedProfit:function(t,e){if(!this.openOrdersProfits)return t.profit;if(!this.openOrdersProfits.length)return 0;var i=this.openOrdersProfits.find((function(e){return e.id===t.id}));return i?i[e]:0},setProfits:function(){this.profitOpen=this.openOrders&&this.openOrders.length?this.openOrders.reduce((function(t,e){return t+e.profit}),0):0,this.profitClose=this.closedOrders&&this.closedOrders.length?this.closedOrders.reduce((function(t,e){return t+e.profit}),0):0},getFormatDate:function(t){var e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o)).concat(this.$t("d")," ").concat(Math.floor(o%1*24)).concat(this.$t("h"),"."):Math.floor(i)>=1?"".concat(Math.floor(i)).concat(this.$t("h"),"."):"".concat(Math.floor(e)).concat(this.$t("м"));return n},getStatData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({AccountId:t.getDefaultAccount.id,SubscriptionId:t.getSubscriptionsBySource}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:o=e.sent,t.$http.post("".concat(t.apiUrl,"GetAccountShortStatistic"),i,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o,"Content-type":"application/json"}}).then((function(e){t.commonStat=e.data.data[0]}));case 5:case"end":return e.stop()}}),e)})))()},setStatusPortfolio:function(){var t=this;this.isLoading=!0,this.$nextTick(Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getDopInfo.functionSetStatus();case 2:t.isLoading=!1,t.showToast({visible:!1});case 4:case"end":return e.stop()}}),e)}))))}}),mounted:function(){this.getStatData(),this.setProfits()}},VI=UI,HI=(i("6fa9"),Object(C["a"])(VI,wA,_A,!1,null,"4b53bda3",null)),GI=HI.exports,qI=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MaxDDMessage"},[e("img",{attrs:{src:t.maxddImage}}),e("div",{staticClass:"rightBlock"},[e("div",{staticClass:"heading"},[t._v("Вы достигли ограничения потери капитала по “"+t._s(t.namePortfolio)+"”")]),e("div",{staticClass:"text"},[t._v("Копирование преостановлено. В случае закрытия сделок Ваш доход составит:")]),e("div",{staticClass:"sum"},[t._v(t._s(t.profitPortfolioFormatted)+" / "+t._s(t.percent))]),e("div",{staticClass:"text"},[t._v("Закрыть сделки принудительно?")]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconCheck,disabled:t.isLoading},on:{toggle:t.stopPortfolio}},[e("span",{style:{opacity:+!t.isLoading}},[t._v("Да")]),t.isLoading?e("DxLoadIndicator",{staticClass:"loader",attrs:{height:24,width:24}}):t._e()],1),e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconClose,disabled:t.isLoading},on:{toggle:t.close}},[t._v("Нет")])],1)])])},zI=[],YI={name:"MaxDDMessage",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{getDopInfo:{type:Object,default:function(){return{userInfo:{avatarURL:"https://api.toptrader.ru/api/Image/63824938227135.04_89ade1f21eff4fc28db0c3631f002d5e.jpeg",firstName:"Alex",lastName:"Aksenov"},sourceUserInfo:{avatarURL:"https://api.toptrader.ru/api/Image/63792187305215.336_f38739f2bdd1404ea6495c7486887fa0.jpeg",firstName:"Test",lastName:"Provider"},id:"2b5ef572e9d24b228437b6f5a50a384c",userId:"89ade1f21eff4fc28db0c3631f002d5e",dataType:"SubNotification",data:{Type:"subscription",Action:"stopwork max dd",SourceAccountId:"3ea5f8bb0fb24257b8c22f0cb5a0905a",SourceName:"Test Provider",SourceUserId:"f38739f2bdd1404ea6495c7486887fa0",Contract:"BTCUSDT.a",AutoTrade:!0,IsPersonalInfo:!0,User:{Id:"89ade1f21eff4fc28db0c3631f002d5e",Login:"Splinty",Password:"51389be5a3c34ac9c68bc8897977dfab",Email:"SplintGOST387@mail.ru",Role:"User",FirstName:"Alex",LastName:"Aksenov",SecondName:null,DateOfBirth:"0001-01-01T00:00:00",DocumentType:"Passport",DocumentData:null,Phone:"+7904___3886",Gender:"Male",IsBlocked:!1,IsVerifiedEmail:!0,IsVerifiedPhone:!0,AvatarURL:"https://api.toptrader.ru/api/Image/63824938227135.04_89ade1f21eff4fc28db0c3631f002d5e.jpeg",Detail:null,Background:null,CreateDate:"2020-03-25T09:45:15"},Account:{Id:"1a0006fffd234ff1a8c0d7d1901f8184",SequenceId:93388727,Balance:16500,Equity:16361.72,ClosedProfit:0,Margin:5445.62,Credit:0,MaxLeverage:50,AssetCode:"USDT",AccountGroupCode:"CryptoDemo",Comment:null,ReadOnlyPassword:"",Owner:"89ade1f21eff4fc28db0c3631f002d5e",Inactive:!0,RegistrationDate:"2023-12-22T13:18:54.504671",BrokerId:null,IsPublish:!1,IsDefault:!1,BrokerGroup:null,AccountName:null,IsDelete:!1,Leverage:0,ParentAccountId:"ed0fc53753984745b2f3fe1e470e0dca",ProtectEquity:16335},BagInfo:{Id:"ce2100d7ca0e4a6f8aa7e69880dcfee3",AccountId:"ed0fc53753984745b2f3fe1e470e0dca",Name:"Test Provider",CreatedDateTime:"2023-12-22T13:18:53.919139",InvestBagType:2,Status:1,StopDateTime:null,AvatarURL:"https://api.toptrader.ru/api/Image/63792187305215.336_f38739f2bdd1404ea6495c7486887fa0.jpeg",InvestMoney:16500,InvestLeverage:50,StartDateTime:"2023-12-22T13:18:54.548115",ParentId:null,SubAccountId:"1a0006fffd234ff1a8c0d7d1901f8184"}},createdDateTime:"2023-12-22T13:25:15.5080408Z",readedDateTime:null,indexId:59}}}},mixins:[],data:function(){return{investPortolios:null,openOrders:null,isLoading:!1}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics"})),{},{getEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},maxddImage:function(){return i("5ce0")},iconCheck:function(){return{name:"Check",color:this.isLoading?"transparent":"#8c8c8c"}},iconClose:function(){return{name:"Close",color:"#8c8c8c"}},namePortfolio:function(){return this.getDopInfo.order.data.BagName},getListInvestPortfolios:function(){var t=this;if(this.investPortolios&&this.investPortolios[1]){var e=Object(x["a"])(new Set(this.investPortolios[1].map((function(t){return t[0]})))),i=[];return e.forEach((function(e){var o=t.investPortolios[1].filter((function(t){return t[0]===e})).map((function(t){return t[1]})),n=t.investPortolios[1].find((function(t){return t[0]===e}))[2],s=t.investPortolios[1].find((function(t){return t[0]===e}))[3],r=t.investPortolios[0]&&t.investPortolios[0].length?t.investPortolios[0].filter((function(t){return t[0]===e})).map((function(t){return t[3]})).reduce((function(t,e){return t+e}),0):0,a=t.openOrders&&t.openOrders.length?t.getProfitPrortfolio(o):0;i.push({id:e,subs:o,name:n,avatar:s,profitClose:r,profitAbs:a+r})})),i}},profitPortfolio:function(){var t=this;if(!this.investPortolios||!this.investPortolios[1])return 0;var e=this.getListInvestPortfolios.find((function(e){return e.id===t.getDopInfo.order.data.BagId}));return e.profitAbs},profitPortfolioFormatted:function(){return"$".concat(Lm(this.profitPortfolio))},percent:function(){return Lm(100*this.profitPortfolio/this.getEquityClose,2,!0)+"%"}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",changeInvestBagStatus:"expertsPortfolio/changeInvestBagStatus"})),{},{getProfitPrortfolio:function(t){var e=this.openOrders.filter((function(e){return t.some((function(t){return+e.subscriptionId===t}))}));if(!e.length)return 0;var i=e.reduce((function(t,e){return t+e.profit}),0);return i},close:function(){this.showToast({visible:!1})},getInvestorStat:function(){var t={command:"GetInvestorStatisticByContract",data:{id:this.getDefaultAccount.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHandler:function(t){if("GetInvestorStatisticByContract"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);e&&e[0]&&e[1]?this.investPortolios=JSON.parse(t.data):this.noStatStatus=!0}else"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.openOrders=t.data[0].openOrders.tradingOrders)},stopPortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,t.changeInvestBagStatus({bagId:t.getDopInfo.order.data.BagId,status:"Stoped",changeStatus:!0});case 3:t.isLoading=!1,t.close();case 5:case"end":return e.stop()}}),e)})))()}}),mounted:function(){this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.getInvestorStat()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHandler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},XI=YI,QI=(i("5bfd"),Object(C["a"])(XI,qI,zI,!1,null,"d9a6c838",null)),JI=QI.exports,KI=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToastMessage"},[t.congratulation?e("div",{staticClass:"textCongratulationBlock"},[e("svgIcon",t._b({},"svgIcon",t.congratulationIcon,!1)),e("span",[t.congratulationText?[t._v(t._s(t.congratulationText)),e("br")]:t._e(),e("span",{domProps:{innerHTML:t._s(t.message)}})],2)],1):e("div",{staticClass:"textBlock"},[e("div",{staticClass:"message"},[e("p",{domProps:{innerHTML:t._s(t.message)}})])]),t.visibleButtonAction?e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickOk}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[t.isVisibleIconButtonOk?e("svgIcon",t._b({},"svgIcon",t.buttonIconCheck,!1)):t._e(),t._v(t._s(t.textButtonOk))]],2),e("ButtonIconFlat",{staticClass:"button",attrs:{disable:t.isLoading},on:{toggle:t.clickClose}},[t.isVisibleIconButtonClose?e("svgIcon",t._b({},"svgIcon",t.buttonIconClose,!1)):t._e(),t._v(t._s(t.textButtonClose))],1)],1):t.visibleButtonOkay?e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"button",on:{toggle:t.clickClose}},[t._v(t._s(t.$t("okay")))])],1):t._e()])},ZI=[],tB={name:"ToastMessage",props:{getDopInfo:{type:Object}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{isLoading:!1}},computed:{message:function(){var t;return null===(t=this.getDopInfo)||void 0===t?void 0:t.message},visibleButtonAction:function(){var t;return null===(t=this.getDopInfo)||void 0===t?void 0:t.visibleButtonAction},visibleButtonOkay:function(){var t;return null===(t=this.getDopInfo)||void 0===t?void 0:t.visibleButtonOkay},congratulation:function(){var t;return null===(t=this.getDopInfo)||void 0===t?void 0:t.congratulation},congratulationText:function(){var t,e;return"empty"!==(null===(t=this.getDopInfo)||void 0===t?void 0:t.congratulationText)&&((null===(e=this.getDopInfo)||void 0===e?void 0:e.congratulationText)||this.$t("congratulations")+"!")},isVisibleIconButtonOk:function(){var t;return!(null!==(t=this.getDopInfo)&&void 0!==t&&t.textButtonOk)},textButtonOk:function(){var t;return(null===(t=this.getDopInfo)||void 0===t?void 0:t.textButtonOk)||this.$t("yes")},isVisibleIconButtonClose:function(){var t;return!(null!==(t=this.getDopInfo)&&void 0!==t&&t.textButtonClose)},textButtonClose:function(){var t;return(null===(t=this.getDopInfo)||void 0===t?void 0:t.textButtonClose)||this.$t("no")},congratulationIcon:function(){return{name:"error"===this.getDopInfo.congratulationStatus?"Alarm_red":"Check",color:"error"===this.getDopInfo.congratulationStatus?"#E91212":"#008E72"}},buttonIconCheck:function(){return{name:"Check",color:"#8C8C8C"}},buttonIconClose:function(){return{name:"Close",color:"#8C8C8C"}}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",setPopupData:"modalSubscribe/setPopupData"})),{},{clickClose:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.getDopInfo.functionArrayByClose){e.next=18;break}i=Object(WD["a"])(t.getDopInfo.functionArrayByClose),e.prev=2,i.s();case 4:if((o=i.n()).done){e.next=10;break}return n=o.value,e.next=8,n();case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](2),i.e(e.t0);case 15:return e.prev=15,i.f(),e.finish(15);case 18:t.showToast({visible:!1});case 19:case"end":return e.stop()}}),e,null,[[2,12,15,18]])})))()},clickOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.isLoading=!0,i=Object(WD["a"])(t.getDopInfo.functionArray),e.prev=2,i.s();case 4:if((o=i.n()).done){e.next=10;break}return n=o.value,e.next=8,n();case 8:e.next=4;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](2),i.e(e.t0);case 15:return e.prev=15,i.f(),e.finish(15);case 18:t.setPopupData({visiblePopup:!1}),t.getDopInfo.congratulationsToast?t.showToast(t.getDopInfo.congratulationsToast):t.clickClose(),t.isLoading=!1;case 21:case"end":return e.stop()}}),e,null,[[2,12,15,18]])})))()}})},eB=tB,iB=(i("2e30"),Object(C["a"])(eB,KI,ZI,!1,null,"022177b2",null)),oB=iB.exports,nB={name:"ToastComponent",components:{DxToast:a_["DxToast"],ToastSubscribePlus:p_,ToastCopySignals:C_,ToastConfirmCopySignals:O_,ToastEditConfirm:X_,ToastCongratulationsSubscription:I_,ToastCongratulationsEdit:eA,ToastSuccessPay:j_,ToastSuccessAddToCart:aA,ToastErrorPay:V_,ToastConfirmAddToCart:pA,ToastSuccessAddToCartMoneyAndPercent:CA,ToastErrorAddToCartMoneyAndPercent:OA,StopOrDeletePortfolioAlert:GI,ToastMessage:oB,MaxDDMessage:JI},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getVisible:"toast/getVisible",getActiveTheme:"headerSettings/getActiveTheme",getBackground:"toast/getBackground",getComponentName:"toast/getComponentName",getHeight:"toast/getHeight",getWidth:"toast/getWidth",getDopInfo:"toast/getDopInfo",shading:"toast/getShading",outSideClick:"toast/getOutSideClick"})),{},{getStyle:function(){return{background:this.getBackground,width:this.getWidth?"string"===typeof this.getWidth||this.getWidth instanceof String?this.getWidth:this.getWidth+"px":"auto",height:this.getHeight?"string"===typeof this.getHeight||this.getHeight instanceof String?this.getHeight:this.getHeight+"px":"auto"}},displayTime:function(){return 18e5}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{onHiding:function(t){this.outSideClick&&this.getVisible?this.showToast({visible:!1}):t.cancel=!0}})},sB=nB,rB=(i("4e46"),Object(C["a"])(sB,s_,r_,!1,null,null,null)),aB=rB.exports,cB=function(){var t=this,e=t._self._c;return e("div",{staticClass:"userProfileComparisionInstr"},[e("div",{staticClass:"userProfileComparisionInstr-title"},[e("div",{staticClass:"userProfileComparisionInstr-tabs"},t._l(t.tabButtons,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["userProfileComparisionInstr-tab ".concat(t.typeLine===i.typeLine?"userProfileComparisionInstr-tab_isActive_".concat(t.getActiveTheme):"userProfileComparisionInstr-tab_".concat(t.getActiveTheme))]}},on:{click:function(e){return t.setTypeLine(i.typeLine)}}},[t._v(t._s(i.label))])})),1)]),t.points?e("div",{staticClass:"userProfileComparisionInstr-content"},[t.points&&t.points.length?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.metaInfoForLines,watermark:t.$t("comparison_by_instruments"),typeXAxis:"dateClear",maxIndicator:!1,minIndicator:!1,theme:t.getActiveTheme}}):t._e(),t.getButtonFullHistory?e("div",{class:"userProfileComparisionInstr-historyButtonWrap"},[e("ButtonIconFlat",{attrs:{modifier:{class:[t.fullHistoryStatus?"userProfileComparisionInstr-historyButton_isActive_".concat(t.getActiveTheme):"userProfileComparisionInstr-historyButton_".concat(t.getActiveTheme)]}},on:{click:t.setFullHistory}},[t._v(t._s(t.$t("the_entire_story")))])],1):t._e(),e("div",{staticClass:"userProfileComparisionInstr-info"},t._l(t.instrumentsPicker,(function(i,o){return e("div",{key:o,staticClass:"userProfileComparisionInstr-checkerItem",on:{mouseenter:function(e){return t.setHoverStatus(i.instrument)},mouseleave:function(e){return t.setHoverStatus(null)}}},[e("Checkbox",{attrs:{checked:i.status,colorState:i.color},on:{change:function(e){return t.setStatusInstrument(o)}}}),e("div",{style:{color:i.color}},[t._v(t._s(i.instrument))]),e("div",{staticClass:"userProfileComparisionInstr-devider",style:{background:i.color}}),e("div",{style:{color:i.color}},[t._v(t._s(t.getLabel(o)))])],1)})),0)],1):e("div",{staticClass:"userProfileComparisionInstr-loader"},[e("Sceleton",{attrs:{width:"100%",height:"100%"}})],1)])},lB=[];function uB(){for(var t=0;t<100;t++){var e=Math.floor(256*Math.random()-1),i=Math.floor(256*Math.random()-1),o=Math.floor(256*Math.random()-1),n=(299*e+587*i+114*o)/1e3,s=255,r=0;return{color:"rgba(".concat(e,",").concat(i,",").concat(o,", 1)"),fill:"rgba(".concat(e,",").concat(i,",").concat(o,", 0.1)"),text:Math.abs(n-s)>Math.abs(n-r)?"rgb(255, 255, 255)":"rgb(0, 0, 0)"}}}var dB={mixins:[Xh,qe],components:{LineEventChart:Uk,Checkbox:Ya,Sceleton:nT},data:function(){return{points:null,hoverContract:null,fullHistoryStatus:!1,metaInfoForLines:null,usingTools:null,accountId:null,stat:null,stateArray:[],stateParams:2,instrumentsPicker:null,tabButtons:[{label:this.$t("current_income"),typeLine:"equity"},{label:this.$t("closed_trade"),typeLine:"profitClose"}],typeLine:"equity"}},watch:{getUsingAccountContracts:function(t){t&&(this.stateArray.push("usingAccountContracts"),this.getStatisticByContract())},getStatusStatByContract:function(t){t&&this.stateArray.push("statByContract")},getActiveTheme:function(){this.setPointsForChart()},type:function(){this.setPointsForChart()},typeLine:function(){this.setPointsForChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getUsingAccountContracts:"contracts/getUsingAccountContracts",getStatusStatByContract:"contracts/getStatusStatByContract",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getButtonFullHistory:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.tradesDays>365},getColorsForPicker:function(){var t=this;if(this.usingTools&&this.usingTools.length){var e=[];return this.usingTools.forEach((function(i,o){e.push({contract:i,color:t.getSetRandomColors[o]?t.getSetRandomColors[o]:uB()})})),e}},getDataForInfo:function(){return[{title:"".concat(this.$t("current2Word")," P/L"),data:this.getEquityClose-this.getBalanceClose,unit:"$"},{title:"".concat(this.$t("widgetProfitInfoRows0")),data:this.getCommonIncome,unit:"%"},{title:"".concat(this.$t("widgetProfitInfoRows1"),", ").concat(this.$t("chatAboutText00")),data:this.getMaxIncome,unit:"%"},{title:"".concat(this.$t("minimumIncome"),", ").concat(this.$t("chatAboutText00")),data:this.getMinIncome,unit:"%"},{title:this.$t("widgetProfitWatchMenu7"),data:this.getRangeIncome,unit:"%"}]},getPercentForAxisIndicator:function(){return this.chartCanvas.getSizeCanvas().width?9/this.chartCanvas.getSizeCanvas().width*100/100:0},getEquityClose:function(){if(this.getStatistics)return this.$pricef(this.getStatistics.accountDaily[this.getStatistics.accountDaily.length-1].equityClose)},getCommonIncome:function(){if(this.getStatByMonth){var t=this.getStatByMonth[0].balanceOpen,e=this.getStatByMonth[this.getStatByMonth.length-1].equityClose-t;return 100*e/t}},getMaxIncome:function(){if(this.getStatByMonth)return Math.max.apply(null,this.getStatByMonth.map((function(t){return t.profitRel})))},getMinIncome:function(){if(this.getStatByMonth)return Math.min.apply(null,this.getStatByMonth.map((function(t){return t.profitRel})))},getRangeIncome:function(){if(this.getStatByMonth)return this.getStatByMonth.reduce((function(t,e){return t+e.profitRel}),0)/this.getStatByMonth.length},getBalanceClose:function(){if(this.getStatistics)return this.$pricef(this.getStatistics.accountDaily[this.getStatistics.accountDaily.length-1].balanceClose)}}),methods:{getLabel:function(t){return"$".concat(this.$moneyf(this.instrumentsPicker[t].profit,2))},setFullHistory:function(){this.fullHistoryStatus=!this.fullHistoryStatus,this.points=null,this.instrumentsPicker=null,this.getStatisticByContract()},setTypeLine:function(t){this.typeLine=t,this.setPointsForChart()},getStatisticByContractByHourse:function(){var t={command:"ContractStatisticsByAccountByHourse",method:"get",data:{AccountId:this.accountId,contracts:this.usingTools,DateTime:null,LastDays:6}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},getStatisticByContract:function(){if(this.getUsingAccountContracts.length){this.$store.commit("contracts/setStatusByContractStat",!1);var t={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:this.accountId,contracts:this.getUsingAccountContracts,DateRequest:this.fullHistoryStatus?null:new Date((new Date).getTime()-31536e6)}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})}},setMessageHendler:function(t){if(t&&t.command&&"AccountsDetails"===t.command)this.getDefaultAccount.id===t.data[0].account.id&&this.setInstrumentsPicker(t.data[0].statisticByContracts);else if(t&&t.command&&"ContractStatisticsByAccount"===t.command){var e=Td(JSON.parse(t.data));e.data.length?e.data[0].accountId===this.accountId&&this.setContractsStatistics("statContract",e.data):this.$store.commit("contracts/setStatusByContractStat",!0)}},setContractsStatistics:function(t,e){var i=this;this.stat=[],this.usingTools.forEach((function(t){var o=e.filter((function(e){return e.contract===t&&"number"===typeof(null===e||void 0===e?void 0:e.profitClose)})),n="equity"===i.typeLine?o.at(-1).floatingProfitClose+o.at(-1).profitClose:o.at(-1).profitClose;i.stat.push({contract:t,profit:n,data:o.map((function(t){return[t.contract,t.floatingProfitClose,t.floatingProfitOpen,t.date,t.profitClose,t.profitOpen,t.forecast,t.volumeClose,t.volumeOpen,t.usedVolume,t.equity,t.pClosedCount,t.closedCount]}))})})),this.stat.sort((function(t,e){return e.profit-t.profit})),this.$store.commit("contracts/setStatusByContractStat",!0),this.setInstrumentsPicker()},setInstrumentsPicker:function(t){var e,i=this;this.instrumentsPicker&&this.instrumentsPicker.length&&(e=this.instrumentsPicker.filter((function(t){return t.status}))),this.instrumentsPicker=[],this.usingTools.forEach((function(o,n){var s=i.stat&&i.stat[n]?i.stat[n].data:[];if(s&&s.length){var r,a=t?t.find((function(t){return t.contract===o})):0;r=a?"equity"===i.typeLine?a.floatingProfit+a.profitClose:a.profitClose:"equity"===i.typeLine?s.at(-1)[1]+s.at(-1)[4]:s.at(-1)[4];var c=i.getColorsForPicker[n].color;i.instrumentsPicker.push({instrument:o,color:c.color,text:c.text,fill:c.fill,data:s,profit:r,status:!e||!!e.find((function(t){return t.instrument===o}))})}else{var l=i.getSetRandomColors[n]?i.getSetRandomColors[n]:uB();i.instrumentsPicker.push({instrument:o,color:l.color,text:l.text,fill:l.fill,data:s,profit:0,status:!e||!!e.find((function(t){return t.instrument===o}))})}})),this.instrumentsPicker.sort((function(t,e){return e.profit-t.profit})),this.setPointsForChart()},setHoverStatus:function(t){this.hoverContract=t,this.setPointsForChart()},setPointsForChart:function(){var t=this;if(this.instrumentsPicker&&(this.points=[],this.metaInfoForLines=[],this.instrumentsPicker.forEach((function(e){var i;i=e.data.length?e.data:[[]],e.status&&(t.metaInfoForLines.push({type:"line",color:e.color,fill:t.hoverContract===e.instrument?e.color:"rgba(0,0,0,0)",fillIndicator:"dark"===t.getActiveTheme?"#151924":"#fff",lineWidth:t.hoverContract===e.instrument?5:3,title:e.instrument,label:""}),t.points.push(i.map((function(e){return{x:new Date(e[3]).getTime(),y:"equity"===t.typeLine?e[10]:e[4],date:new Date(e[3]).getTime()}}))),t.points.at(-1).at(-1).y=e.profit)})),null!==this.hoverContract)){var e=this.metaInfoForLines.findIndex((function(e){return e.title===t.hoverContract}));e!==this.metaInfoForLines.length-1&&(this.metaInfoForLines[this.metaInfoForLines.length-1]=this.metaInfoForLines.splice(e,1,this.metaInfoForLines[this.metaInfoForLines.length-1])[0],this.points[this.points.length-1]=this.points.splice(e,1,this.points[this.points.length-1])[0])}},setStatusInstrument:function(t){this.instrumentsPicker[t].status=!this.instrumentsPicker[t].status,this.setPointsForChart()}},mounted:function(){var t=this;this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS3",this.setMessageHendler),this.accountId=this.$route.query.accountId,this.getUsingAccountContracts&&(this.usingTools=this.getUsingAccountContracts,this.getStatisticByContract()),this.$nextTick((function(){t.observerElem=t.$refs.chartWrap})),this.getUsingAccountContracts&&this.stateArray.push("usingAccountContracts"),this.getStatusStatByContract&&this.stateArray.push("statByContract")},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHendler)}},hB=dB,pB=(i("abc3"),Object(C["a"])(hB,cB,lB,!1,null,"443d8f3c",null)),gB=pB.exports,fB=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrap",staticClass:"userProfileEquityBalanceWidget-wrapper"},[e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.hintText))]),e("div",{staticClass:"userProfileEquityBalanceWidget-chat",style:{flexBasis:t.getStatusShowGistogram?"70%":"100%"}},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:t.showControlButton,showTitle:t.showTitle},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"userProfileEquityBalanceWidget-title"},[e("div",{class:"userProfileEquityBalanceWidget-contractName userProfileEquityBalanceWidget-contractName_".concat(t.getActiveTheme)},[t._v(t._s(t.configObject.contract))]),t.getStatusShowDateInTitle?e("div",{staticClass:"userProfileEquityBalanceWidget-titleDate"},[t._v(t._s(t.getStartDate)+" - "+t._s(t.getEndDate))]):t._e(),e("div",{class:"userProfileEquityBalanceWidget-periodTab ".concat("day"===t.activeType?"userProfileEquityBalanceWidget-periodTab_isActive_".concat(t.getActiveTheme):"userProfileEquityBalanceWidget-periodTab_".concat(t.getActiveTheme)),on:{click:function(e){return t.setActiveTypeStat("day")},mouseenter:function(e){return t.viewTooltip(e,"dayPercent")},mouseleave:t.hideTooltip}},[e("svgIcon",{attrs:{name:"TimePeriod_2D"}}),t._v("%")],1),e("div",{class:"userProfileEquityBalanceWidget-periodTab ".concat("month"===t.activeType?"userProfileEquityBalanceWidget-periodTab_isActive_".concat(t.getActiveTheme):"userProfileEquityBalanceWidget-periodTab_".concat(t.getActiveTheme)),on:{click:function(e){return t.setActiveTypeStat("month")},mouseenter:function(e){return t.viewTooltip(e,"monthPercent")},mouseleave:t.hideTooltip}},[e("svgIcon",{attrs:{name:"TimePeriod_2M"}}),t._v("%")],1),e("div",{class:"userProfileEquityBalanceWidget-periodTab ".concat("orders"===t.activeType?"userProfileEquityBalanceWidget-periodTab_isActive_".concat(t.getActiveTheme):"userProfileEquityBalanceWidget-periodTab_".concat(t.getActiveTheme)),style:{borderRight:"light"===t.getActiveTheme?"1px solid #f2f2f2":"1px solid #23313f"},on:{click:function(e){return t.setActiveTypeStat("orders")},mouseenter:function(e){return t.viewTooltip(e,"ordersPercent")},mouseleave:t.hideTooltip}},[e("svgIcon",{attrs:{name:"CloseOrders"}}),t._v("%")],1),e("div",{staticClass:"userProfileEquityBalanceWidget-profitOrdrsPercent",style:{color:t.getPersentProfitPrders<=30?t.getRedColor.color:t.getPersentProfitPrders>30&&t.getPersentProfitPrders<=60?t.getOrangeColor.color:t.getGreenColor.color}},[t._v("% "+t._s(t.getPersentProfitPrders))]),"normal"!==t.topBarWidgetParams.row?e("span",{style:{marginLeft:"8px",color:t.getPercentSuccessfulOrders<75?t.getPercentSuccessfulOrders>45?t.getWarningColor:t.getNegativeColor:t.getPositiveColor}},[t._v(t._s(t.$t("successful_trades_full"))+" % "+t._s(t.$pricef(t.getPercentSuccessfulOrders,1)))]):t._e(),"normal"!==t.topBarWidgetParams.row?e("span",{style:{marginLeft:"8px",color:t.getNegativeColor}},[t._v("MaxDD % "+t._s(t.$pricef(t.getMaxDD,2)))]):t._e()])]},proxy:!0},{key:"content",fn:function(){return[e("div",{class:"userProfileEquityBalanceWidget-wrap userProfileEquityBalanceWidget_".concat(t.configObject.contract)},[e("div",{staticClass:"userProfileEquityBalanceWidget"},[t.points?e("LineEventChart",{key:"".concat(t.getStatusShowStat,"_").concat(t.activeType),attrs:{points:t.points,metaInfoForLines:t.metaInfoForLines,maxIndicator:t.getMaxIndicator,minIndicator:t.getMaxIndicator,widthYaxis:t.getStatusShowStat?"7rem":"1.4rem",roundIndicator:!t.getStatusShowStat,theme:t.getActiveTheme},on:{clickPoint:t.clickPoint,hover:t.hoverPoint}}):t._e(),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.showHoverWidget?e("div",{class:"userProfileEquityBalanceWidget-hoverWidget userProfileEquityBalanceWidget-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"userProfileEquityBalanceWidget-hoverWidgetRow userProfileEquityBalanceWidget-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"userProfileEquityBalanceWidget-hoverWidgetStat userProfileEquityBalanceWidget-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()]),t.statusDayReport?e("DxPopup",{attrs:{visible:t.statusDayReport,shading:!1,width:360,maxHeight:"calc(100vh - 200px)",dragEnabled:!0,dragOutsideBoundary:!0,container:t.configObject.containerReport?t.configObject.containerReport:".userIncomeTab"},scopedSlots:t._u([{key:"title",fn:function(){return[t.statusDayReport?e("UserProfileDayReportWidget",{attrs:{contract:t.configObject.contract,statDay:t.statForWidgetReport},on:{close:t.closeReport}}):t._e()]},proxy:!0}],null,!1,2871646526)}):t._e()],1),t.getStatusShowStat?e("div",{class:"userProfileEquityBalanceWidget-statData userProfileEquityBalanceWidget-statData_".concat(t.getActiveTheme)},t._l(t.getStatForChart,(function(i,o){return e("div",{key:o,staticClass:"userProfileEquityBalanceWidget-statData-item"},[e("div",{class:"userProfileEquityBalanceWidget-statData-itemLabel userProfileEquityBalanceWidget-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"userProfileEquityBalanceWidget-statData-itemData userProfileEquityBalanceWidget-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(t.$moneyf(i.data,2)))])])})),0):t._e(),t.statusNoData?e("div",{staticClass:"userProfileEquityBalanceWidget-noDataMsg"},[e("div",{class:"userProfileEquityBalanceWidget-noDataMsg_text userProfileEquityBalanceWidget-noDataMsg_text_".concat(t.getActiveTheme)},[t._v("По данному контракту не было открытых позиций, либо данных для графика не достаточно")])]):t._e()])]},proxy:!0}])})],1),t.getStatusShowGistogram?e("div",{staticClass:"userProfileEquityBalanceWidget-gistogram"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!1},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"userProfileEquityBalanceWidget-title"},[t._v(t._s(t.getTitleForGistogram))])]},proxy:!0},{key:"content",fn:function(){return[t.pointsForGistogram?e("GistogrammEventChart",{attrs:{points:t.pointsForGistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e(),e("div",{class:"userProfileEquityBalanceWidget-statData userProfileEquityBalanceWidget-statData_".concat(t.getActiveTheme)},t._l(t.getStatForGistogram,(function(i,o){return e("div",{key:o,staticClass:"userProfileEquityBalanceWidget-statData-item"},[e("div",{class:"userProfileEquityBalanceWidget-statData-itemLabel userProfileEquityBalanceWidget-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"userProfileEquityBalanceWidget-statData-itemData userProfileEquityBalanceWidget-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v("% "+t._s(t.$moneyf(i.data,2)))])])})),0)]},proxy:!0}],null,!1,382675929)})],1):t._e()],1)},mB=[],vB=function(){var t=this,e=t._self._c;return e("div",{class:"".concat(t.wrap?"userProfileWrapWidget":"userProfileWrapWidget-nowrap"," userProfileWrapWidget_").concat(t.getActiveTheme)},[t.showTitle&&t.visibleHead?e("div",{class:"userProfileWrapWidget-head userProfileWrapWidget-head_".concat(t.getActiveTheme)},[e("div",{class:"userProfileWrapWidget-title userProfileWrapWidget-title_".concat(t.getActiveTheme)},[t._t("title")],2),t.showControlButton&&!t.topBarWidgetParams.directionModeRows?e("div",{class:"userProfileWrapWidget-control userProfileWrapWidget-control_".concat(t.getActiveTheme),on:{click:t.setFullScreenMode}},[e("svgIcon",{attrs:{name:t.getExpandButton}})],1):t._e()]):t._e(),e("div",{ref:"wrapWidget",class:"".concat(t.wrap?"userProfileWrapWidget-content":"userProfileWrapWidget-content_nowrap"," userProfileWrapWidget-content_").concat(t.getActiveTheme)},[t._t("content")],2)])},yB=[],CB={data:function(){return{elemWrap:null}},props:{visibleHead:{type:Boolean,default:!0},topBarWidgetParams:{type:Object,default:function(){return{row:"normal",col:{index:1,mode:"normal"},directionModeRows:!1}}},showTitle:{type:Boolean,default:!0},showControlButton:{type:Boolean,default:!0},wrap:{type:Boolean,default:!0},title:{type:String,default:"Balance/Equity"}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getExpandButton:function(){return"normal"===this.topBarWidgetParams.row?"Expand":"Unexpand"}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")}},mounted:function(){var t=this;this.$nextTick((function(){t.elemWrap=t.$refs.wrapWidget}))}},bB=CB,SB=(i("6193"),Object(C["a"])(bB,vB,yB,!1,null,"e8ff4e1e",null)),PB=SB.exports,TB=function(){var t=this,e=t._self._c;return e("div",{ref:"reportWrap",class:"userProfileDayReport userProfileDayReport_".concat(t.getActiveTheme),style:"left"===t.side?{left:0}:{right:0}},[e("div",{staticClass:"userProfileDayReport-wrapper"},[e("div",{class:"userProfileDayReport-title userProfileDayReport-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-titleText"},[t._v(t._s(t.$t("report"))+" "+t._s(t.getDateForDay)+" "+t._s(t.contract))]),e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["userProfileDayReport-controlButtonItem","userProfileDayReport-controlButtonItem_".concat(t.getActiveTheme)]}},on:{toggle:t.closeReport}})],1),e("div",{class:"userProfileDayReport-content userProfileDayReport-content_".concat(t.getActiveTheme)},[e("DxAccordion",{key:t.getRerenderStatus,attrs:{"data-source":t.getAccordionTabs,height:"100%",hoverStateEnabled:!1},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{class:"userProfileDayReport-titleAccordion userProfileDayReport-titleAccordion_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-textAccordionTitle"},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(o.title))]),e("div",{class:"userProfileDayReport-count userProfileDayReport-count_".concat(t.getActiveTheme)},[t._v(t._s(o.count))]),3===o.ID&&t.getSummaryProfitForClosedOrders?e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(t.getSummaryProfitForClosedOrders<0?"red":"green"),style:{marginLeft:"0.4rem"}},[t._v("$ "+t._s(t.$moneyf(t.getSummaryProfitForClosedOrders)))]):t._e()])])]}},{key:"item",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{staticClass:"userProfileDayReport-accordionWrap"},[1===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(o)))]),e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(i.data))])])})),0):t._e(),2===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v(t._s(t.$t("open_price")))])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-priceOpenTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.openPrice))])])}))],2):t._e(),3===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, %")])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s((100/(i.volume/i.profit)).toFixed(2)))])])}))],2):t._e(),4===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{staticClass:"userProfileDayReport-diagramWrapper"},[e("SectorDiagram",{attrs:{height:210,width:210,widthBorder:65,percents:t.getSectorDiagramObject}})],1),e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v(t._s(t.$t("of_total")))])]),t._l(t.getSectorDiagramObject,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.symbol))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit.toFixed(2)))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-priceOpenTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.data))])])}))],2):t._e()])]}}])})],1)])])},xB=[],OB=function(){var t=this,e=t._self._c;return e("div",{staticClass:"sectorDiagram"},[e("canvas",{ref:t.refIdCanvas,attrs:{id:t.refIdCanvas},on:{click:t.setClick}})])},wB=[],_B=function(){function t(e,i){Object(Qh["a"])(this,t),this.canvasObject=e,this.ctx=i}return Object(Jh["a"])(t,[{key:"initCanvas",value:function(t,e){this.canvasObject.style.width="".concat(t,"px"),this.canvasObject.style.height="".concat(e,"px");var i=window.devicePixelRatio,o=this.canvasObject.getBoundingClientRect();this.canvasObject.width=o.width*i,this.canvasObject.height=o.height*i,this.ctx=this.canvasObject.getContext("2d"),this.ctx.scale(i,i)}},{key:"getSizeCanvas",value:function(){return{width:this.canvasObject.getBoundingClientRect().width,height:this.canvasObject.getBoundingClientRect().height}}},{key:"getImageCanvas",value:function(){var t=this.canvasObject.toDataURL("image/png",.1);return t}},{key:"clearCanvas",value:function(){this.ctx.clearRect(0,0,this.canvasObject.width,this.canvasObject.height)}},{key:"animationCanvas",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e,i,o){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:u=function(t){var e=t-c;c=t;var r=1e3/e,d=e/1e3,h={diff:e,pTimestamp:c,timestamp:t,fps:r,secondPart:d};l++,l>i||(n.apply(o),s.apply(o,[h]),a.apply(o,[h]),requestAnimationFrame(u))},n=e.clear,s=e.update,a=e.render,c=0,l=0,requestAnimationFrame(u);case 5:case"end":return t.stop()}}),t)})));function e(e,i,o){return t.apply(this,arguments)}return e}()},{key:"getServiceData",value:function(t,e,i){var o=Math.max.apply(null,t),n=Math.min.apply(null,t);0===o&&0===n&&(o=1.15,n=-.85),o===n&&0!==o&&(o=.15*o+o,n=.15*n-n);var s,r,a=o-n;"abs"===(null===e||void 0===e?void 0:e.type)?(s=o+e.maxExpand*window.devicePixelRatio,r=n-e.minExpand*window.devicePixelRatio):(s=o+a*e.maxExpand,r=n-a*e.minExpand);var c=s-r,l=i/c;return{minPoint:r,maxPoint:s,ratio:l,range:c}}},{key:"mapLogicalToCanvasCoordinates",value:function(t){return{x:this.mapLogicalToCanvasXCoordinate(t.x),y:this.mapLogicalToCanvasYCoordinate(t.y)}}},{key:"mapCanvasToLogicalXCoordinate",value:function(t,e,i){return t.minPoint+i*(t.maxPoint-t.minPoint)/e}},{key:"mapCanvasToLogicalYCoordinate",value:function(t,e,i){return t.minPoint+(e-i)*(t.maxPoint-t.minPoint)/e}},{key:"mapCanvasToLogicalCoordinates",value:function(t){return{x:this.mapCanvasToLogicalXCoordinate(t.x),y:this.mapCanvasToLogicalYCoordinate(t.y)}}},{key:"mapLogicalToCanvasXCoordinate",value:function(t,e,i){return(i-t.minPoint)*e/(t.maxPoint-t.minPoint)}},{key:"mapLogicalToCanvasYCoordinate",value:function(t,e,i){var o=e/(t.maxPoint-t.minPoint);return e-(i-t.minPoint)*o}}]),t}(),AB=new _B,DB={props:{height:{default:160},width:{default:160},percents:{type:Array,default:function(){return[{color:"#333",data:34.35},{color:kB(),data:26.65},{color:kB(),data:18},{color:kB(),data:12},{color:kB(),data:6},{color:kB(),data:3}]}},fontSize:{default:12},widthBorder:{default:55},refIdCanvas:{default:"diagramSector"}},data:function(){return{iterCount:-1,beginArc:0,ctx:null,canvasObject:null,smartCanvas:null,userOrders:null}},methods:{setClick:function(t){window.console.log("clickEvent",t)},initCanvas:function(){this.canvasObject=this.$refs[this.refIdCanvas],this.ctx=this.canvasObject.getContext("2d"),this.smartCanvas=new _B(this.canvasObject,this.ctx),this.smartCanvas.initCanvas(this.width,this.height),AB.animationCanvas({clear:function(){},update:function(){this.iterCount<0?this.beginArc=0:this.beginArc+=this.percents[this.iterCount].data,this.iterCount++},render:function(){this.drawSector(this.beginArc,this.beginArc+this.percents[this.iterCount].data,this.percents[this.iterCount].color),this.drawText()}},this.percents.length,this)},drawSector:function(t,e,i){this.smartCanvas.ctx.save(),this.smartCanvas.ctx.beginPath(),this.smartCanvas.ctx.arc(this.width/2,this.height/2,this.width/2-this.widthBorder/2,Math.PI/180*3.6*t,Math.PI/180*3.6*e),this.smartCanvas.ctx.lineWidth=this.widthBorder,this.smartCanvas.ctx.strokeStyle=i,this.smartCanvas.ctx.stroke(),this.smartCanvas.ctx.closePath(),this.smartCanvas.ctx.restore()},drawText:function(){if(!(this.percents[this.iterCount].data<9)){var t=this.width/2,e=t-this.widthBorder/2,i=3.6*(this.beginArc?this.beginArc+this.percents[this.iterCount].data/2:(this.beginArc+this.percents[this.iterCount].data)/2),o=t+e*Math.cos(Math.PI/180*i),n=t+e*Math.sin(Math.PI/180*i);this.smartCanvas.ctx.font="bold ".concat(this.fontSize,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),this.smartCanvas.ctx.textAlign="center",this.smartCanvas.ctx.textBaseline="middle",this.smartCanvas.ctx.fillStyle="#fff",this.smartCanvas.ctx.fillText("".concat(Math.round(this.percents[this.iterCount].data),"%"),o,n),this.smartCanvas.ctx.closePath()}}},mounted:function(){var t=this;this.$nextTick((function(){t.initCanvas()}))}};function kB(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var IB=DB,BB=(i("ec1f"),Object(C["a"])(IB,OB,wB,!1,null,"24e030fd",null)),MB=BB.exports,$B={components:{DxAccordion:uw.a,SectorDiagram:MB,VuePerfectScrollbar:Xt.a},mixins:[yn,qe],props:{statDay:{type:[Object,Array]},contract:{type:String,default:""},accountId:{type:String},side:{default:"left"}},data:function(){return{accordionData:null,userOrders:null,portfolioStat:[],statContract:null,heightWrap:0}},watch:{statDay:function(){this.setDataForPortfolio()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme",getUsingAccountContracts:"contracts/getUsingAccountContracts"})),{},{getSectorDiagramObject:function(){var t=this;if(this.portfolioStat){var e=this.portfolioStat.reduce((function(t,e){return t+e.volume}),0),i=[];return this.portfolioStat.forEach((function(o,n){i.push({volume:o.volume,profit:o.profit,symbol:o.contract,color:t.getSetRandomColors[n]?t.getSetRandomColors[n].color:LB(),data:Number((100/(e/o.volume)).toFixed(2))})})),i}},getDateForDay:function(){return this.contract?new Date(this.statDay[3]).toLocaleDateString("ru"):new Date(this.statDay.statDay.date).toLocaleDateString("ru")},getRerenderStatus:function(){return this.getActiveTheme+this.heightWrap},getAccordionTabs:function(){if(this.getCloseOrdersForDay&&this.getOpenOrdersForDay&&this.getStatDataForReport&&this.getSectorDiagramObject)return[{ID:1,title:"".concat(this.$t("sftd")," ").concat(this.contract),data:this.getStatDataForReport},{ID:2,title:this.$t("open_trades"),count:this.getOpenOrdersForDay.length,data:this.getOpenOrdersForDay},{ID:3,title:this.$t("closed_trade"),count:this.getCloseOrdersForDay.length,data:this.getCloseOrdersForDay},{ID:4,title:this.$t("traded_instruments"),count:this.getSectorDiagramObject.length,data:this.getSectorDiagramObject}]},getSummaryProfitForClosedOrders:function(){if(this.getCloseOrdersForDay)return this.getCloseOrdersForDay.reduce((function(t,e){return t+e.profit}),0)},getCloseOrdersForDay:function(){var t=this;if(this.userOrders){var e=this.contract?this.statDay[3]:this.statDay.statDay.date,i=this.userOrders.closedOrders.filter((function(t){return new Date(t.closedDate).getFullYear()===new Date(e).getFullYear()&&new Date(t.closedDate).getMonth()===new Date(e).getMonth()&&new Date(t.closedDate).getDate()===new Date(e).getDate()}));return this.contract&&(i=i.filter((function(e){return e.instrumentName===t.contract}))),i}},getOpenOrdersForDay:function(){var t,e,i=this;if(this.userOrders){var o=this.contract?this.statDay[3]:this.statDay.statDay.date,n=[],s=[];null!==(t=this.userOrders)&&void 0!==t&&t.tradingOrders.length&&(n=this.userOrders.tradingOrders.filter((function(t){return new Date(t.createdDate).getFullYear()===new Date(o).getFullYear()&&new Date(t.createdDate).getMonth()===new Date(o).getMonth()&&new Date(t.createdDate).getDate()===new Date(o).getDate()}))),null!==(e=this.userOrders)&&void 0!==e&&e.closedOrders.length&&(s=this.userOrders.closedOrders.filter((function(t){return new Date(t.createdDate).getFullYear()===new Date(o).getFullYear()&&new Date(t.createdDate).getMonth()===new Date(o).getMonth()&&new Date(t.createdDate).getDate()===new Date(o).getDate()})));var r=n.concat(s);return this.contract&&(r=r.filter((function(t){return t.instrumentName===i.contract}))),r}},getStatDataForReport:function(){var t=this;return this.contract?{trading_days:{data:this.statContract?this.statContract.findIndex((function(e){return new Date(t.statDay[3]).getTime()===new Date(e[3]).getTime()})):0,color:"gray",symbol:""},balance:{data:this.$moneyf(this.statDay[4]),color:"blue",symbol:"$"},equity:{data:this.$moneyf(this.statDay[10]),color:"green",symbol:"$"},ibot:{data:this.$moneyf(this.statDay[1]),color:this.statDay[1]<0?"red":"green",symbol:"$"},volume_of_open_trades:{data:this.$moneyf(this.statDay[8]),color:"gray",symbol:""},usedVolume:{data:this.$moneyf(this.statDay[9]),color:"gray",symbol:""}}:{trading_day:{data:this.statDay.index+1,color:"gray",symbol:""},Balance:{data:this.$moneyf(this.statDay.statDay.balanceClose),color:"blue",symbol:"$"},eatbot:{data:this.$moneyf(this.statDay.statDay.equityOpen),color:"green",symbol:"$"},eateot:{data:this.$moneyf(this.statDay.statDay.equityClose),color:"green",symbol:"$"},leverage:{data:this.statDay.statDay.leverage,color:"gray",symbol:""},margin:{data:this.$moneyf(this.statDay.statDay.margin),color:"pink",symbol:"$"},income:{data:this.$moneyf(this.statDay.statDay.profitClose),color:this.statDay.statDay.profitClose<0?"red":"green",symbol:"$"},closed_trades:{data:this.$moneyf(this.statDay.statDay.closedCount),color:"grey",symbol:""},successful_trades_full:{data:this.$moneyf(this.statDay.statDay.procPosOrders),color:this.statDay.statDay.procPosOrders<=35?"red":this.statDay.statDay.procPosOrders>35&&this.statDay.statDay.procPosOrders<65?"yellow":this.statDay.statDay.procPosOrders>=65&&this.statDay.statDay.procPosOrders<75?"orange":"green",symbol:"%"},sharpe_ratio:{data:this.statDay.statDay.dailySharp,color:this.statDay.statDay.dailySharp<1?"red":"green",symbol:""},pips:{data:this.$moneyf(this.statDay.statDay.pip),color:this.statDay.statDay.pip<0?"red":"green",symbol:""},max_drawdown:{data:this.statDay.statDay.drawdownHigh.toFixed(2),color:"red",symbol:"%"}}}}),methods:{closeReport:function(){this.$emit("close")},setDataForPortfolio:function(){var t=this;this.portfolioStat=[],this.getUsingAccountContracts.forEach((function(e){t.statContract=JSON.parse(sessionStorage.getItem("statContract".concat(e)));var i=t.contract?t.statDay[3]:t.statDay.statDay.date;if(t.statContract){var o=t.statContract.find((function(t){return new Date(t[3]).getFullYear()===new Date(i).getFullYear()&&new Date(t[3]).getMonth()===new Date(i).getMonth()&&new Date(t[3]).getDate()===new Date(i).getDate()}));o&&t.portfolioStat.push({contract:o[0],profit:o[1],volume:o[7]})}}))},onResize:function(t){this.heightWrap=t[0].contentRect.height},getOrdersByDate:function(){var t={Command:"HistoryOrders",Data:{accountId:this.accountId,filter:{orderTypes:["All"],startTime:this.statDay.statDay.date,stopTime:this.statDay.statDay.date,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})}},mounted:function(){var t=this;this.$orderStorage.getOrdersOnStorage()&&(this.userOrders=this.$orderStorage.getOrdersOnStorage()),this.getUsingAccountContracts&&this.setDataForPortfolio(),this.$nextTick((function(){t.observerElem=t.$refs.reportWrap,t.initObserver()}))}};function LB(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var FB=$B,jB=(i("9c5c"),Object(C["a"])(FB,TB,xB,!1,null,null,null)),RB=jB.exports,WB={props:{topBarWidgetParams:{type:Object,default:function(){return{row:"full"}}},configObject:{type:Object},showControlButton:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0}},components:{LineEventChart:Uk,UserProfileDayReportWidget:RB,UserProfileWrapWidget:PB,GistogrammEventChart:TI,DxTooltip:Tt.a,DxPopup:To["DxPopup"]},mixins:[yn,qe,Ot],data:function(){return{points:null,activeType:"pig",pointsForGistogram:null,accountId:null,statusDayReport:!1,profitOpenOrdersContract:0,metaInfoForLines:null,resizeObserver:null,ordersByContract:null,statContracts:null,statForWidgetReport:null,statusNoData:!1,simpleChartSize:{width:0,height:0},showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},statsForHoverWidget:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatusStatByContract:"contracts/getStatusStatByContract",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders"})),{},{getStatusShowGistogram:function(){if(this.simpleChartSize)return this.simpleChartSize.height>410&&this.simpleChartSize.width>460},getPersentProfitPrders:function(){if(this.statContracts&&this.statContracts.length)return this.statContracts.at(-1)[11]&&this.statContracts.at(-1)[12]?Math.round(100*this.statContracts.at(-1)[11]/this.statContracts.at(-1)[12]):0},getStatusShowDateInTitle:function(){if(this.simpleChartSize)return this.simpleChartSize.width>410},getStatusLine:function(){if(this.statContracts&&this.statContracts.length){var t=this.statContracts[0][10],e=this.statContracts.filter((function(e){return e[10]===t}));return e.length===this.statContracts.length}},getMaxIndicator:function(){return!!this.getStatusShowStat&&("pig"===this.activeType?{lines:[2]}:{lines:[0]})},getStartDate:function(){if(this.statContracts&&this.statContracts.length)return new Date(this.statContracts[0][3]).toLocaleDateString("ru")},getEndDate:function(){if(this.statContracts&&this.statContracts.length)return new Date(this.statContracts.at(-1)[3]).toLocaleDateString("ru")},getStatusShowStat:function(){if(this.simpleChartSize)return this.simpleChartSize.height>250},getTitleForGistogram:function(){if(this.getStatByMonth)return this.getStatByMonth.length<3?this.$t("income_by_days"):this.$t("hoibm")},getStatForChart:function(){if(this.points&&this.points.length)return"pig"===this.activeType?[{label:this.$t("current_income"),data:this.points[1].at(-1).y+this.profitOpenOrdersContract,symbol:"$",color:this.profitOpenOrdersContract<0?"red":"green"},{label:this.$t("average"),data:this.points[2].at(-1).y,symbol:"$",color:"orange"},{label:this.$t("max"),data:Math.max.apply(null,this.points[1].map((function(t){return t.y}))),symbol:"$",color:Math.max.apply(null,this.points[1].map((function(t){return t.y})))<0?"red":"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[1].map((function(t){return t.y}))),symbol:"$",color:Math.min.apply(null,this.points[1].map((function(t){return t.y})))<0?"red":"green"}]:"day"===this.activeType||"month"===this.activeType?[{label:this.$t("current_income"),data:this.points[0].at(-1).y,symbol:"%",color:"green"},{label:this.$t("average"),data:this.points[1].at(-1).y,symbol:"%",color:"orange"},{label:this.$t("max"),data:Math.max.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"%",color:"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"%",color:"red"}]:[{label:"".concat(this.$t("current")," %"),data:this.points[0].at(-1).y,symbol:"%",color:"green"},{label:"".concat(this.$t("average")," %"),data:this.points[1].at(-1).y,symbol:"%",color:"orange"},{label:this.$t("max"),data:Math.max.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"%",color:"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"%",color:"red"}]},getStatForGistogram:function(){if(this.pointsForGistogram&&this.pointsForGistogram.length){var t=Math.max.apply(null,this.pointsForGistogram[1].map((function(t){return t.y}))),e=Math.min.apply(null,this.pointsForGistogram[1].map((function(t){return t.y}))),i=this.pointsForGistogram.reduce((function(t,e){return t+e.data}),0);return[{label:this.$t("current_income"),data:this.pointsForGistogram[1].at(-1).y,color:this.pointsForGistogram[1].at(-1).y<0?"red":"green"},{label:this.$t("max"),data:t,color:t<0?"red":"green"},{label:this.$t("min"),data:e,color:e<0?"red":"green"},{label:this.$t("current"),data:i/this.pointsForGistogram.length,color:"orange"}]}},getStatByDay:function(){if(this.statContracts&&this.statContracts.length){var t=this.statContracts.map((function(t,e){return{time:e,data:t[9]&&t[10]?100*t[10]/t[9]:0,date:new Date(t[3]).getTime()}}));return t}},getStatByMonth:function(){if(this.statContracts&&this.statContracts.length){for(var t=[{date:new Date(new Date(this.statContracts[0][3]).getFullYear(),new Date(this.statContracts[0][3]).getMonth()).getTime(),time:0,data:this.statContracts[0][9]&&this.statContracts[0][10]?100*this.statContracts[0][10]/this.statContracts[0][9]:0}],e=1;e=800&&this.simpleChartSize.height>=450},getEquityClose:function(){if(this.points&&this.points.length)return this.points[1].at(-1).y},getMaxDD:function(){if(this.statContracts)return Math.min.apply(null,this.statContracts.map((function(t){return t[4]})))},getOpenVolume:function(){if(this.statContracts&&this.statContracts.length)return this.statContracts[this.statContracts.length-1][8]},getProfitPercent:function(){if(this.getOpenVolume)return 100*this.getEquityClose/this.getOpenVolume},getNegativeColor:function(){return"light"===this.getActiveTheme?"#ff3232":"#da0000"},getPositiveColor:function(){return"light"===this.getActiveTheme?"#008e72":"#1ef0b1"},getWarningColor:function(){return"light"===this.getActiveTheme?"#FFC000":"#F7970F"},getPercentSuccessfulOrders:function(){if(this.ordersByContract&&this.ordersByContract.length){var t=this.ordersByContract.filter((function(t){return t.profit>0})).length;return 100*t/this.ordersByContract.length}},getBalanceClose:function(){if(this.statContracts&&this.statContracts.length)return this.statContracts[this.statContracts.length-1][2]},getMetaInfoForGistogramm:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Доход"},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Среднее значение"}]}}),watch:{getActiveTheme:function(){this.setStatForChart(this.activeType,this.statContracts),this.getPointsForGistogramm()},activeType:function(){this.setStatForChart(this.activeType,this.statContracts)},getStatusStatByContract:function(t){t&&(this.statContracts=JSON.parse(sessionStorage.getItem("statContract".concat(this.configObject.contract))),this.statContracts&&(this.setStatForChart(this.activeType,this.statContracts),this.getPointsForGistogramm(),this.statusNoData=!1))},getStatByOrders:function(t){t&&this.setOrdersByContract()}},methods:{setActiveTypeStat:function(t){t!==this.activeType?this.activeType=t:this.activeType="pig"},setOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage();this.ordersByContract=e.closedOrders.filter((function(e){return e.instrumentName===t.configObject.contract}))},setForecast:function(t){this.forecastData=t},setForecastMode:function(){this.activeType="pig"},getPointsForGistogramm:function(){var t=this;if(this.getStatByMonth){this.pointsForGistogram=[[]];var e=this.getStatByMonth.length<3?this.getStatByDay:this.getStatByMonth;e.forEach((function(e){t.pointsForGistogram.at(-1).push({x:e.time,y:e.data,date:e.date})})),this.pointsForGistogram.unshift([{x:0,y:0,date:this.pointsForGistogram[0][0].date}])}},setStatForChart:function(t,e){var i={pig:this.getPointsForChart,day:this.getPointsForChartDay,month:this.getPointsForChartMonth,orders:this.getPointsForChartOrders};i[t](e)},getPointsForChartOrders:function(t){if(t){this.points=null,this.metaInfoForLines=[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",lineWidth:3,label:"%"},{type:"line",color:"orange",fill:"rgba(0,0,0,0)",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"%",lineWidth:3}];var e=[],i=[],o=0,n=0;t.forEach((function(t){o++;var s=t[11]?100*t[11]/t[12]:0;n+=s,e.push({x:o,y:s,date:t[3]}),i.push({x:o,y:n/o,date:t[3]})})),this.points=[e,i]}},getPointsForChartMonth:function(){if(this.getStatByMonth){this.points=null,this.metaInfoForLines=[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"%",lineWidth:3},{type:"line",color:"orange",fill:"rgba(0,0,0,0)",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"%",lineWidth:3}];var t=[],e=[],i=0,o=0,n=0;this.getStatByMonth.forEach((function(s){i++,s.data>0&&o++;var r=100*o/i;n+=r,t.push({x:i,y:r,date:s.date}),e.push({x:i,y:n/i,date:s.date})})),this.points=[t,e]}},getPointsForChartDay:function(t){if(t){this.points=null,this.metaInfoForLines=[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"%",lineWidth:3},{type:"line",color:"orange",fill:"rgba(0,0,0,0)",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"%",lineWidth:3}];var e=[],i=[],o=0,n=0,s=0;t.forEach((function(t){o++;var r=t[4]-t[5];r>0&&n++;var a=100*n/o;s+=a,e.push({x:o,y:a,date:t[3]}),i.push({x:o,y:s/o,date:t[3]})})),this.points=[e,i]}},getPointsForChart:function(t){var e=this;if(t&&t.length){this.points=[[]],t.forEach((function(t,i){e.points[0].push({x:i,y:t[4],date:t[3]})})),this.points.push([]),t.forEach((function(t,i){e.points[1].push({x:i,y:t[10],date:t[3]})}));var i=[];if(this.getStatusLine)i=t.map((function(t,e){return{x:e,y:t[10],date:t[3]}}));else{var o=0;t.forEach((function(t,e){o+=t[10],i.push({x:e,y:o?o/(e+1):0,date:t[3]})}))}this.points.unshift(i),this.points[2].at(-1).y=this.points[1].at(-1).y+this.profitOpenOrdersContract,this.metaInfoForLines=[{type:"line",color:"orange",fill:"rgba(0,0,0,0)",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Среднее значение по Средствам"},{type:"line",color:this.getBlueColor.color,fill:this.getBlueColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Баланс по контракту"},{type:"line",color:this.points[2].at(-1).y>=0?this.getGreenColor.color:this.getRedColor.color,fill:this.points[2].at(-1).y>=0?this.getGreenColor.fill:this.getRedColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства по контракту"}]}},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},closeReport:function(){this.statusDayReport=!1},clickPoint:function(t){this.statForWidgetReport=this.statContracts.find((function(e){return e[3]===t.point.date})),this.statusDayReport=!0},hoverPoint:function(t){if(t){var e=this.simpleChartSize.width-t.cPointX,i=this.simpleChartSize.height-t.cPointY;this.positionHoverWidget={top:"".concat(i<80?Math.round(t.cPointY-54):Math.round(t.cPointY),"px"),left:"".concat(e>85?t.cPointX:t.cPointX-85,"px"),height:"".concat(18*("pig"===this.activeType?3:2),"px")};var o=this.points[0].findIndex((function(e){return e.date===t.point.date}));if(o)switch(this.activeType){case"pig":this.statsForHoverWidget=[{stat:"$ ".concat(this.$moneyf(this.points[1][o].y,0)),color:"blue"},{stat:"$ ".concat(this.$moneyf(this.points[2][o].y,0)),color:"green"},{stat:"$ ".concat(this.$moneyf(this.points[0][o].y,0)),color:"orange"}];break;default:this.statsForHoverWidget=[{stat:"% ".concat(this.$moneyf(this.points[1][o].y,this.points[1][o].y>=1e6?0:2)),color:"green"},{stat:"% ".concat(this.$moneyf(this.points[0][o].y,this.points[0][o].y>=1e6?0:2)),color:"orange"}];break}this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},initObserver:function(){var t=new ResizeObserver(this.onResize);t.observe(this.$refs.chartWrap),this.resizeObserver=t},onResize:function(){this.$refs.chartWrap&&(this.simpleChartSize.width=this.$refs.chartWrap.clientWidth,this.simpleChartSize.height=this.$refs.chartWrap.clientHeight)},setMessageHendler:function(t){t&&t.command&&"AccountsDetails"===t.command&&this.setFloatingProfit(t.data)},setFloatingProfit:function(t){var e=this,i=t.find((function(t){return t.account.id===e.accountId}));if(i){var o=i.openOrders.tradingOrders;o.length&&this.setStatByOrders(o)}},setStatByOrders:function(t){var e=this,i=t.filter((function(t){return t.instrumentName===e.configObject.contract}));i.length&&(this.profitOpenOrdersContract=i.reduce((function(t,e){return t+e.profit}),0),this.setStatForChart(this.activeType,this.statContracts),this.getPointsForGistogramm())},viewTooltip:function(t,e){if(e)switch(this.selector=t.target,e){case"dayPercent":this.hintText="Процент успешных ДНЕЙ по контракту ".concat(this.configObject.contract);break;case"monthPercent":this.hintText="Процент успешных МЕСЯЦЕВ по контракту ".concat(this.configObject.contract);break;case"ordersPercent":this.hintText="Процент успешных СДЕЛОК по контракту ".concat(this.configObject.contract);break;default:this.hintText=""}this.tooltipVisible=!0}},mounted:function(){var t=this;this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),sessionStorage.getItem("statContract".concat(this.configObject.contract))?(this.statContracts=JSON.parse(sessionStorage.getItem("statContract".concat(this.configObject.contract))),this.setStatForChart(this.activeType,this.statContracts),setTimeout((function(){t.getPointsForGistogramm()}),1e3)):this.statusNoData=!0,this.getStatByOrders&&this.setOrdersByContract(),this.accountId=JSON.parse(sessionStorage.getItem("userProfileInfo"))?JSON.parse(sessionStorage.getItem("userProfileInfo")).accountId:this.getDefaultAccount.id,this.$nextTick((function(){t.observerElem=t.$refs.chartWrap}))},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},NB=WB,EB=(i("3a99"),Object(C["a"])(NB,fB,mB,!1,null,"eee5eff4",null)),UB=EB.exports,VB=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",staticClass:"pigWidget"},["multi"===t.configObject.modeWidget?e("div",{staticClass:"pigWidget-tabsWrap"},t._l(t.tabs,(function(i,o){return e("div",{key:o,class:"pigWidget-tab ".concat(t.getActiveIndexTab===o?"pigWidget-tab_isActive_".concat(t.getActiveTheme):"pigWidget-tab_".concat(t.getActiveTheme)),on:{click:function(e){return t.setActiveTab(o)}}},[e("svgIcon",{attrs:{name:i.icon}})],1)})),0):t._e(),t.getActiveIndexTab?t._e():e("div",{staticClass:"pigWidget-balanceEquity",style:{padding:"multi"===t.configObject.modeWidget?"0":"0.4rem"}},[e("div",{staticClass:"pigWidget-chart"},[e("UserProfileWrapWidget",{attrs:{showTitle:!1},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{on:{click:function(e){return t.switchWidgets("portfolio")}}},[e("svgIcon",{attrs:{name:"Portfel_$"}})],1)]},proxy:!0},{key:"content",fn:function(){return[e("TestCanvasEventWidget",{attrs:{configObject:{containerReport:""}}})]},proxy:!0}],null,!1,3288719252)})],1),e("div",{ref:"gistogrammWrap",staticClass:"pigWidget-gistogram"},[e("UserProfileWrapWidget",{attrs:{showControlButton:!1},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(t._s(t.getTitleForGistogram))]},proxy:!0},{key:"content",fn:function(){return[t.pointsForGistogram?e("GistogrammEventChart",{key:t.pointsForGistogram[0][0].y,attrs:{points:t.pointsForGistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[2]},maxIndicator:{lines:[2]}},on:{hover:t.hoverPoint}}):t._e(),e("div",{class:"pigWidget-statData pigWidget-statData_".concat(t.getActiveTheme)},t._l(t.getStat,(function(i,o){return e("div",{key:o,staticClass:"pigWidget-statData-item"},[e("div",{class:"pigWidget-statData-itemLabel pigWidget-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"pigWidget-statData-itemData pigWidget-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v("% "+t._s(t.$moneyf(i.data,2)))])])})),0),null!==t.hoverIndex?e("div",{class:"pigWidget-hoverWidget pigWidget-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"pigWidget-hoverWidgetRow pigWidget-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"pigWidget-hoverWidgetLabel pigWidget-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"pigWidget-hoverWidgetStat pigWidget-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()]},proxy:!0}],null,!1,3458061340)})],1)]),1===t.getActiveIndexTab?e("div",{staticClass:"pigWidget-potrfolio"},[e("UserProfileStatContract",{attrs:{showControlTab:!1},on:{switch:t.switchWidgets}})],1):t._e()])},HB=[],GB=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CommonIncomeWidget"},[e("div",{staticClass:"CommonIncomeWidget-wrap",class:"CommonIncomeWidget-wrap_".concat(t.getActiveTheme)},[e("div",{ref:"chartWrap",staticClass:"CommonIncomeWidget-chart"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.points?e("div",{staticClass:"CommonIncomeWidget-chart-wrap"},[t.points?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,watermark:t.$t("common_income"),watermarkData:t.getWatermarkData},on:{clickPoint:t.hedlerClickChartPoint,hover:t.hoverPoint}}):t._e(),e("div",{class:"CommonIncomeWidget-statData CommonIncomeWidget-statData_".concat(t.getActiveTheme)},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit?e("div",{key:o,class:"CommonIncomeWidget-currentProfit CommonIncomeWidget-currentProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"CommonIncomeWidget-currentProfit-arrow"},[e("div",{style:{color:"down"===t.directions[o]?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directions[o],"_direct")}})],1)]),e("div",{staticClass:"CommonIncomeWidget-currentProfit-data",class:"CommonIncomeWidget-currentProfit-data_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data[0],2))))]),e("div",{staticClass:"CommonIncomeWidget-currentProfit-title",class:"CommonIncomeWidget-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CommonIncomeWidget-currentProfit-text",class:"CommonIncomeWidget-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])]):t._e()})),0),t.historyButtonStatus?e("div",{class:"CommonIncomeWidget-historyButtonWrap"},[e("ButtonIconFlat",{attrs:{modifier:{class:[t.fullHistory?"CommonIncomeWidget-historyButton_isActive_".concat(t.getActiveTheme):"CommonIncomeWidget-historyButton_".concat(t.getActiveTheme)]}},on:{click:t.setFullHistory}},[t._v(t._s(t.$t("the_entire_story")))])],1):t._e(),t.showHoverWidget?e("div",{class:"CommonIncomeWidget-hoverWidget CommonIncomeWidget-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget,on:{click:function(e){return t.hedlerClickChartPoint(t.checkPoint)}}},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"CommonIncomeWidget-hoverWidgetRow CommonIncomeWidget-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"CommonIncomeWidget-hoverWidgetStat CommonIncomeWidget-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1):e("div",{staticClass:"CommonIncomeWidget-chart-load"},[e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}})],1)])],1),e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"CommonIncomeWidget-gistogramm"},[t.pointsForGistogram?e("div",{staticClass:"CommonIncomeWidget-gistogramm-wrap"},[e("div",{staticClass:"CommonIncomeWidget-gistogramm-title",class:"CommonIncomeWidget-gistogramm-title_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("income_by_days"),", ").concat(t.getCurrencyChar)))]),e("div",{staticClass:"CommonIncomeWidget-gistogramm-chart"},[e("GistogrammEventChart",{key:t.pointsForGistogram[0][0].y,attrs:{points:t.pointsForGistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)]):e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}})],1)]),t.statusNoTrade?e("div",{staticClass:"noTradeStatus"},[t._v("По счету не было сделок. Статистика не доступна")]):t._e()],1)])},qB=[],zB={components:{LineEventChart:Uk,GistogrammEventChart:TI,TitlesForGistogram:DI,Sceleton:nT},props:{configObject:{type:Object}},mixins:[yn,qe],data:function(){return{statusNoTrade:!1,historyButtonStatus:!1,fullHistory:!1,points:null,pointsForGistogram:null,statusDayReport:!1,statDay:null,xWidthPoint:0,showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},simpleChartSize:{width:0,height:0},directions:["up","up"],statsForHoverWidget:null,checkPoint:null}},watch:{getActiveTheme:function(){this.getStatistics&&this.setPointsForChart(this.getStatistics,this.fullHistory)},getBalanceClose:function(t,e){e&&t&&(this.setPointsForChart(this.getStatistics,this.fullHistory),this.directions[0]=t=new Date(i).getTime()&&t.equityClose}));u.length>365&&!e&&(u=u.slice(-365),this.historyButtonStatus=!0),u.forEach((function(t,e){a.push({x:e,y:t.equityClose-t.equityOpen,date:t.date}),o.push({x:e,y:t.equityClose,date:t.date}),n.push({x:e,y:t.balanceClose,date:t.date}),r+=t.equityClose,l+=t.equityClose-t.equityOpen,s.push({x:e,y:r?r/(e+1):0,date:t.date}),c.push({x:e,y:l/(e+1),date:t.date})})),this.pointsForGistogram=[[{x:0,y:0,date:new Date}],a,c],this.points=[s,n,o]}else this.setNoStatPoints(t)},hedlerClickChartPoint:function(t){if(!this.checkStatusNowdate(t.point.date)){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),i=this.getStatistics.accountDaily.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),o={index:i,statDay:e};this.$emit("openReport",{stat:o,width:t.cPointX})}},hoverPoint:function(t){if(t){this.checkPoint=t;var e=this.simpleChartSize.width-t.cPointX,i=this.simpleChartSize.height-t.cPointY;this.positionHoverWidget={top:"".concat(i>54?Math.round(t.cPointY):Math.round(t.cPointY-54),"px"),left:"".concat(e>100?t.cPointX:t.cPointX-100,"px")};var o=this.getStatistics.accountDaily.find((function(e){return e.date===t.point.date})),n=this.points[0].find((function(e){return e.date===t.point.date}));o&&(this.statsForHoverWidget=[{stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(o.balanceClose)),color:"blue"},{stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(o.equityClose)),color:"green"},{stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(n.y,2)),color:"orange"}]),this.showHoverWidget=!0}else this.showHoverWidget=!1,this.checkPoint=null,this.positionHoverWidget=null,this.statsForHoverWidget=null},onResize:function(){this.$refs.chartWrap&&(this.simpleChartSize.width=this.$refs.chartWrap.clientWidth,this.simpleChartSize.height=this.$refs.chartWrap.clientHeight)}},destroyed:function(){this.widget&&(this.widget.wctx.eventEmiter.unsubscribe("clickPoint",this.hedlerClickChartPoint),this.widget.setConnected(!1))},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.chartWrap,t.getStatistics&&t.setPointsForChart(t.getStatistics)}))}},YB=zB,XB=(i("e093"),Object(C["a"])(YB,GB,qB,!1,null,"32429b2f",null)),QB=XB.exports,JB=function(){var t=this,e=t._self._c;return e("div",{ref:"wrapper",class:"userProfileStatContract ".concat("horizontalMin"===t.topBarWidgetParams.col.mode?"userProfileStatContract-minMode":""," userProfileStatContract_").concat(t.getActiveTheme)},[e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButtons:t.showControlTab,showHorizontalFull:!1},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode}},[e("div",{class:"userProfileStatContract-control userProfileStatContract-control_".concat(t.getActiveTheme)},[t.showControlTab?e("div",{staticClass:"userProfileStatContract-controlTabs"},t._l(t.dataButtons,(function(i,o){return e("div",{key:o,staticClass:"userProfileStatContract-controlTab",on:{mouseenter:function(e){return t.viewTooltip(e,i.icon)},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:i.icon},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),i.status?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:function(e){return t.setActiveComponent(o)}}})],1)})),0):t._e(),t.getUsingAccountContracts&&t.getUsingAccountContracts.length>4&&t.activeComponent&&"UserProfileGrid"===t.activeComponent.component?e("div",{staticClass:"userProfileStatContract-controlSlider"},[e("ButtonIconFlat",{attrs:{icon:{name:"Arrow-expand-left"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme)]},disabled:0===t.transformLeft},on:{toggle:t.setLeftTransform}}),e("ButtonIconFlat",{attrs:{icon:{name:"Arrow-expand-right"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme)]},disabled:Math.ceil(t.getUsingAccountContracts.length/2)-2===t.transformLeft},on:{toggle:t.setRightTransform}})],1):t._e(),t.activeComponent&&"UserProfileComparisonInstrumentsChart"===t.activeComponent.component&&t.getUsingAccountContracts?e("div",{class:"userProfileStatContract-selectContract userProfileStatContract-selectContract_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{value:t.getUsingAccountContracts[0],items:t.getUsingAccountContracts,dropDownOptions:{container:".userProfileStatContract"}},on:{valueChanged:function(e){return t.setActiveContract(e.value)}}})],1):t._e()])]),e("div",{staticClass:"userProfileStatContract-content"},[t.getShowFullModeTopBar&&t.activeComponent&&t.getContractOpenOrders?e(t.activeComponent.component,{key:"".concat(t.activeComponent.index,"_").concat(t.getContractOpenOrders.length),tag:"component",attrs:{configObject:t.activeComponent.config,recursive:!0,sizeGrid:t.sizeGrid,transform:t.transformLeft,sizeColumn:t.sizeColumn},on:{setFullScreenMode:t.setFullScreeForWidget,setNormalScreenMode:t.setNormalSizeForWidget}}):t._e()],1),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.hintText))])],1)},KB=[],ZB=function(){var t=this,e=t._self._c;return e("div",{class:"userProfileGridWidgetTopBar userProfileGridWidgetTopBar_".concat(t.getActiveTheme)},[e("div",{key:"fullMode",staticClass:"userProfileGridWidgetTopBar-fullMode"},[t.getShowFullModeTopBar?t._t("default"):t._e(),t.showControlButtons?e("div",{staticClass:"userProfileGridWidgetTopBar-groupButton"},[e("div",{class:"userProfileGridWidgetTopBar-wrapButton userProfileGridWidgetTopBar-wrapButton_".concat(t.getActiveTheme),on:{mouseenter:function(e){return t.viewTooltipHandler(e,"screen")},mouseleave:t.hideTooltip}},[t.getExpandButton.show?e("ButtonIconFlat",{attrs:{icon:{name:t.getExpandButton.icon},modifier:{class:["userProfileGridWidgetTopBar-controlButtonItem","userProfileGridWidgetTopBar-controlButtonItemExtand_".concat(t.getActiveTheme)]}},on:{toggle:t.getExpandButton.hendler}}):t._e()],1),e("div",{class:"userProfileGridWidgetTopBar-wrapButton userProfileGridWidgetTopBar-wrapButton_".concat(t.getActiveTheme),on:{mouseenter:function(e){return t.viewTooltipHandler(e,"roll")},mouseleave:t.hideTooltip}},[t.getMinimazeButton.show&&t.showHorizontalFull?e("ButtonIconFlat",{attrs:{icon:{name:t.getMinimazeButton.icon()},modifier:{class:["userProfileGridWidgetTopBar-controlButtonItem","userProfileGridWidgetTopBar-controlButtonItem_".concat(t.getActiveTheme)]}},on:{toggle:t.getMinimazeButton.hendler}}):t._e()],1)]):t._e()],2),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},tM=[],eM={mixins:[Ot],props:{topBarWidgetParams:{type:Object},showControlButtons:{type:Boolean,default:!0},showHorizontalFull:{type:Boolean,default:!0}},data:function(){return{textTooltip:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getShowFullModeTopBar:function(){return"normal"===this.topBarWidgetParams.col.mode||"horizontalFull"===this.topBarWidgetParams.col.mode||"normal"===this.topBarWidgetParams.col.mode||"fullMode"===this.topBarWidgetParams.col.mode},getExpandButton:function(){return{icon:"normal"===this.topBarWidgetParams.row?"Expand":"Unexpand",hendler:this.setRowMode,show:this.getShowFullModeTopBar&&!this.topBarWidgetParams.directionModeRows}},getMinimazeButton:function(){var t=this;return{icon:function(){return t.topBarWidgetParams.col.index&&t.topBarWidgetParams.col.index%2?"normal"===t.topBarWidgetParams.col.mode||"horizontalFull"===t.topBarWidgetParams.col.mode?"Block-expand-right-close":"Block-expand-left-close":t.topBarWidgetParams.col.index&&t.topBarWidgetParams.col.index%2?void 0:"normal"===t.topBarWidgetParams.col.mode||"horizontalFull"===t.topBarWidgetParams.col.mode?"Block-expand-left-close":"Block-expand-right-close"},hendler:this.setMinHorizontal,show:"normal"===this.topBarWidgetParams.row&&!this.topBarWidgetParams.directionModeRows}}}),methods:{setMinHorizontal:function(){"normal"===this.topBarWidgetParams.col.mode?this.$emit("setMinHorizontal"):this.$emit("setNormal")},setActiveTab:function(t){this.statusFiltredYear=null,this.statYears.forEach((function(t){t.status=!1})),this.$emit("setButtonHendler",t)},setRowMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},viewTooltipHandler:function(t,e){this.viewTooltip(t),"screen"===e&&(this.textTooltip=this.getMinimazeButton.show?this.$t("full_screen"):this.$t("collapse")),"roll"===e&&(this.textTooltip=this.getExpandButton.show?this.$t("collapse"):this.$t("maximaze"))}}},iM=eM,oM=(i("93af"),Object(C["a"])(iM,ZB,tM,!1,null,"48266142",null)),nM=oM.exports,sM=function(){var t=this,e=t._self._c;return e("UserProfileWrapWidget",{key:t.configObject.period,attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:t.showControlButton},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"userProfilePeriodChart-title",style:{width:"".concat(t.widthTitle+30,"px")},attrs:{title:"".concat(t.getTitle[0]," ").concat(t.getTitle[1]," ").concat(t.getTitle[2]," $").concat(t.$moneyf(t.getTitle[3])," %").concat(t.$pricef(t.getTitle[4],2))}},[e("div",{staticClass:"userProfilePeriodChart-titleText"},[t._v(t._s(t.getTitle[0]))]),e("div",{class:"userProfilePeriodChart-titleDate userProfilePeriodChart-titleDate_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitle[1]))]),"normal"!==t.topBarWidgetParams.row?e("div",{staticClass:"userProfilePeriodChart-titleText"},[t._v(t._s(t.getTitle[2])+" ")]):t._e(),e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getTitle[3]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getTitle[3]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v("$ "+t._s(t.$moneyf(t.getTitle[3]))+" ")])]),"normal"!==t.topBarWidgetParams.row?e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getTitle[4]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getTitle[4]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v("% "+t._s(t.$pricef(t.getTitle[4],2)))])]):t._e()])]},proxy:!0},{key:"content",fn:function(){return[t.getStatByDate&&t.getStatByDate.length?e("div",{staticClass:"userProfilePeriodChart-content"},[e("ChartWrapper",{attrs:{showTitle:!1,showLegend:"normal"!==t.topBarWidgetParams.row},on:{initCanvas:t.getCanvasesObjects},scopedSlots:t._u([{key:"legend",fn:function(){return[e("ChartLegend",{attrs:{legends:t.getChartLegend}})]},proxy:!0}],null,!1,3212719745)})],1):e("div",{staticClass:"userProfilePeriodChart-noStat"},[e("div",{class:"userProfilePeriodChart-noStatText userProfilePeriodChart-noStatText_".concat(t.getActiveTheme)},[t._v(t._s("По контракту ".concat(t.configObject.contract," не было торговли в данный период, либо статистика ещё не сформированна")))])])]},proxy:!0}])})},rM=[],aM=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrap",staticClass:"userProfileChartWrapper"},[t.showTitle?e("div",{class:"userProfileChartWrapper-title userProfileChartWrapper-title_".concat(t.getActiveTheme)},[t._t("title")],2):t._e(),e("transition",{attrs:{name:"fade"}},[t.preloadStatus?e("div",{staticClass:"userProfileChartWrapper-preloader"},[e("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:35,circle:!0}})],1):t._e()]),e("div",{staticClass:"userProfileChartWrapper-chartWrap"},[e("div",{ref:"chartWrapper",staticClass:"userProfileChartWrapper-chartWrapper"},[e("transition",{attrs:{name:"fade"}},[t.imageForChart?e("div",{key:"chartLoader",staticClass:"userProfileChartWrapper-chartLoader",staticStyle:{"background-size":"100% 100%"},style:{backgroundImage:"url(".concat(t.imageForChart,")")}}):e("div",{key:"chart",staticClass:"userProfileChartWrapper-chart"},[e("canvas",{ref:"chart"})])]),t._t("chartContent")],2),t.showYaxis?e("div",{ref:"yAxisWrapper",staticClass:"userProfileChartWrapper-Yaxis",style:{minWidth:"".concat(t.yAxisWidth,"rem")}},[e("transition",{attrs:{name:"fade"}},[t.imageForYAxis?e("div",{key:"yLoader",staticClass:"userProfileChartWrapper-Yaxis-loader",staticStyle:{"background-size":"100% 100%"},style:{backgroundImage:"url(".concat(t.imageForYAxis,")")}}):e("div",{key:"yAxis",staticClass:"userProfileChartWrapper-Yaxis-axis"},[e("canvas",{ref:"yAxis"})])])],1):t._e()]),t.showXaxis?e("div",{ref:"xAxisWrapper",staticClass:"userProfileChartWrapper-xAxisWrap"},[e("div",{staticClass:"userProfileChartWrapper-xAxis"},[e("transition",{attrs:{name:"fade"}},[t.imageForXAxis?e("div",{key:"xLoader",staticClass:"userProfileChartWrapper-xAxis-loader",staticStyle:{"background-size":"100% 100%"},style:{backgroundImage:"url(".concat(t.imageForXAxis,")")}}):e("div",{key:"xAxis",staticClass:"userProfileChartWrapper-xAxis-axis"},[e("canvas",{ref:"xAxis"})])])],1)]):t._e(),t.showLegend?e("div",{class:"userProfileChartWrapper-legend"},[t._t("legend")],2):t._e()],1)},cM=[],lM={methods:{initCanvas:function(t,e,i){this[i]=new _B(this.$refs[t],this.$refs[t].getContext("2d")),this[i].initCanvas(e.width,e.height)}}},uM={mixins:[lM,Xh,yn],components:{Preloader:ah},props:{showTitle:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},showYaxis:{type:Boolean,default:!0},yAxisWidth:{type:Number,default:6},showXaxis:{type:Boolean,default:!0},resizeStatus:{type:Object,default:function(){return{row:"normal",col:{mode:"normal"}}}}},data:function(){return{chartCanvas:null,yAxisCanvas:null,xAxisCanvas:null,imageForChart:null,imageForXAxis:null,imageForYAxis:null,preloadStatus:!0}},watch:{resizeStatus:function(){}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{onResize:function(){this.imageForChart||this.setImageToCanvas(),("fullMode"===this.resizeStatus.row&&"fullMode"===this.resizeStatus.col.mode||"normal"===this.resizeStatus.row)&&this.debouncer("initCanvasCharts",400)},setImageToCanvas:function(){this.chartCanvas&&(this.imageForChart=this.chartCanvas.getImageCanvas()),this.xAxisCanvas&&(this.imageForXAxis=this.xAxisCanvas.getImageCanvas()),this.yAxisCanvas&&(this.imageForYAxis=this.yAxisCanvas.getImageCanvas())},initCanvasCharts:function(){var t=this;this.preloadStatus=!1,"minModeLeft"!==this.resizeStatus.col.mode&&(this.imageForChart=null,this.imageForXAxis=null,this.imageForYAxis=null,this.$nextTick((function(){if(t.$refs.chartWrapper&&t.initCanvas("chart",{width:t.$refs.chartWrapper.getBoundingClientRect().width,height:t.$refs.chartWrapper.getBoundingClientRect().height},"chartCanvas"),t.showYaxis){if(!t.$refs.yAxisWrapper)return;t.initCanvas("yAxis",{width:Math.floor(t.$refs.yAxisWrapper.getBoundingClientRect().width),height:t.$refs.yAxisWrapper.getBoundingClientRect().height},"yAxisCanvas")}if(t.showXaxis){if(!t.$refs.xAxisWrapper)return;t.initCanvas("xAxis",{width:t.$refs.xAxisWrapper.getBoundingClientRect().width,height:t.$refs.xAxisWrapper.getBoundingClientRect().height},"xAxisCanvas")}t.$emit("initCanvas",{chartCanvas:t.chartCanvas,yAxisCanvas:t.yAxisCanvas,xAxisCanvas:t.xAxisCanvas})})))}},mounted:function(){var t=this;this.imageForChart=1,this.imageForXAxis=1,this.imageForYAxis=1,this.$nextTick((function(){t.observerElem=t.$refs.chartWrap}))}},dM=uM,hM=(i("8cc0"),Object(C["a"])(dM,aM,cM,!1,null,"f5de7e40",null)),pM=hM.exports,gM=function(){var t=this,e=t._self._c;return e("div",{class:"userProfileLegend userProfileLegend_".concat(t.getActiveTheme)},t._l(t.legends,(function(i,o){return e("div",{key:o,staticClass:"userProfileLegend-legendwrap"},[e("div",{staticClass:"userProfileLegend-legendItem"},[e("div",{staticClass:"userProfileLegend-legendLine",style:{background:"light"===t.getActiveTheme?i.colorLight:i.colorDark}}),e("div",{staticClass:"userProfileLegend-legendRound",style:{background:"light"===t.getActiveTheme?i.colorLight:i.colorDark}})]),e("div",{class:"userProfileLegend-legendTitle userProfileLegend-legendTitle_".concat(t.getActiveTheme)},[t._v(t._s(i.title))])])})),0)},fM=[],mM={props:{legends:{type:Array,default:function(){return[{title:"Test",colorLight:"#333",colorDark:"f2f2f2"}]}}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"}))},vM=mM,yM=(i("52d8"),Object(C["a"])(vM,gM,fM,!1,null,"aa166838",null)),CM=yM.exports,bM={data:function(){return{activePeriod:"month",widthTitle:30,chartCanvas:null,yAxisCanvas:null,xAxisCanvas:null,xPoints:[],yPoints:[],activeDate:null,activeDateByHours:null,lcoords:null,contractStat:null,contractStatByHours:null,calendarStatistic:null}},computed:{getTitle:function(){return"month"===this.activePeriod?this.getTitleForMonth:"week"===this.activePeriod?this.getTitleForWeek:"day"===this.activePeriod?this.getTitleForDay:void 0},getTitleForDay:function(){return[this.configObject.contract,new Date(this.activeDate).toLocaleDateString("ru"),"P/L",this.getEquityClose-this.getOpenEquity,100*(this.getEquityClose-this.getOpenEquity)/this.getOpenEquity]},getTitleForMonth:function(){return[this.configObject.contract,"".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()),"P/L",this.getEquityClose-this.getOpenEquity,100*(this.getEquityClose-this.getOpenEquity)/this.getOpenEquity]},getTitleForWeek:function(){return[this.configObject.contract,"Неделя ".concat(new Date(this.activeDate).getWeek()," (").concat(new Date(this.activeDate).getFullYear()," г.)"),"P/L",this.getEquityClose-this.getOpenEquity,100*(this.getEquityClose-this.getOpenEquity)/this.getOpenEquity]},getStrokeColors:function(){return{positive:"light"===this.getActiveTheme?"#008e72":"#00ffac",negative:"light"===this.getActiveTheme?"#da0000":"#ff3232"}},getFillColors:function(){return{positive:"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)",negative:"light"===this.getActiveTheme?"rgba(218, 0, 0, 0.1)":"rgba(255, 50, 50, 0.1)"}},getOpenEquity:function(){var t=this;if(this.getStatByDate&&this.getStatByDate.length){var e=this.contractStat.findIndex((function(e){return e[3]===t.getStatByDate[0][3]}));return e>0?this.contractStat[e-1][1]:this.contractStat[0][2]}},getEquityClose:function(){if(this.contractStat&&this.contractStat.length)return this.contractStat[this.contractStat.length-1][1]},activeContract:function(){return this.configObject.contract},getStatByDate:function(){return"month"===this.activePeriod?this.getStatByMonth:"week"===this.activePeriod?this.getStatByWeek:"day"===this.activePeriod?this.getStatByDay:void 0},getLastDates:function(){var t={week:this.getWeeks,month:this.getMonthes,day:this.getDays},e=t[this.activePeriod];if(e&&e.length)return e.length>5?e.slice(-5):e},getStatByDay:function(){var t=this;if(this.activeDateByHours&&this.contractStatByHours&&this.activeContract){var e=this.contractStatByHours.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDateByHours).getFullYear()&&new Date(e[3]).getMonth()===new Date(t.activeDateByHours).getMonth()&&new Date(e[3]).getDate()===new Date(t.activeDateByHours).getDate()}));return e.length?e:[]}},getStatByWeek:function(){var t=this;if(this.activeDate&&this.contractStat&&this.activeContract){var e=this.contractStat.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e[3]).getWeek()===new Date(t.activeDate).getWeek()}));return e.length?e.sort((function(t,e){return new Date(t[3]).getTime()-new Date(e[3]).getTime()})):[]}},getStatByMonth:function(){var t=this;if(this.activeDate&&this.contractStat&&this.activeContract){var e=this.contractStat.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e[3]).getMonth()===new Date(t.activeDate).getMonth()}));return e.length?e.sort((function(t,e){return new Date(t[3]).getTime()-new Date(e[3]).getTime()})):[]}},getStatisticsByDateChecker:function(){var t={month:this.getMonthes,week:this.getWeeks,day:this.getDays};return t[this.activePeriod]},getDays:function(){if(this.calendarStatistic){var t=this.calendarStatistic.map((function(t){return{title:new Date(t.date).getDate(),date:new Date(t.date),profitRel:t.proc,year:new Date(t.date).getFullYear()}}));return t}},getWeeks:function(){if(this.contractStat){for(var t=new Date(this.contractStat[0][3]).getWeek(),e=new Date(this.contractStat[0][3]).getFullYear(),i=this.contractStat[0][2],o=[{title:t,date:new Date(this.contractStat[0][3]),profitRel:SM(i,this.contractStat[0][1]),year:e}],n=1;nthis.getOpenEquity&&o!==t[t.length-1].y&&this.drawLineIndicator({x:e.mapLogicalToCanvasXCoordinate(this.xServiceObject,e.getSizeCanvas().width,n.x),y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y)},{x:e.getSizeCanvas().width,y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y),l:o},i,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},this.getStrokeColors.positive,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),s0&&t>0?100*(e-t)/t:100*(e-t)/t*-1:e-t}var PM=function(){function t(){Object(Qh["a"])(this,t)}return Object(Jh["a"])(t,[{key:"getGridParms",value:function(t,e){var i=e,o=t.minPoint,n=i/t.ratio,s=Math.ceil(Math.log(n/5)/Math.LN10),r=0==o?-99:Math.log(Math.abs(o))/Math.LN10;if(!(r-s>10)){var a=Math.pow(10,s),c=n/a,l=c>2.001?5:c>1.001?2:1,u=Math.ceil(o/a),d=l*Math.ceil(u/l);return{space:a,span:l,pos:d,decPow:s}}}}]),t}(),TM={data:function(){return{grid:new PM}},methods:{getGridParams:function(t,e){return this.grid.getGridParms(t,e)},drawXYGrid:function(t,e,i,o,n,s,r,a,c){if(e){var l=e.pos,u=0;while(1){var d=l*e.space,h=t?i.mapLogicalToCanvasXCoordinate(o,n.width,d):i.mapLogicalToCanvasYCoordinate(o,n.height,d);if(t?h>n.width:h<0)break;if("line"===s?this.drawGridLine(l,h,t,i.ctx,n,r):this.drawLabel(h,d,e.decPow,t,i.ctx,r,n,a,c),l+=e.span,u++>100)break}}},drawGridLine:function(t,e,i,o,n,s){o.save(),o.fillStyle=s,o.fillRect(i?e:0,i?0:e,i?1:n.width,i?n.height:1),o.restore()},drawLabel:function(t,e,i,o,n,s,r,a,c){n.save(),n.textBaseline="bottom",n.textAlign="left",n.font="11px",n.fillStyle=s;var l=o?t+3:"in"===a?r.width-n.measureText(this.$moneyf(e)).width:5,u=o?"in"===a?r.height:15:t-2,d=this.getLabelFormat(c,e);n.fillText(d,l,u),n.restore()},getLabelFormat:function(t,e){var i={monthValue:this.points&&this.points[e]?"".concat(new Date(this.points[e].date).getMonth()+1<10?"0".concat(new Date(this.points[e].date).getMonth()+1):new Date(this.points[e].date).getMonth()+1,".").concat(new Date(this.points[e].date).getFullYear()):e,value:e,price:this.$moneyf(e),date:new Date(e).toLocaleDateString("ru"),month:"".concat(new Date(e).getMonth()+1<10?"0".concat(new Date(e).getMonth()+1):new Date(e).getMonth()+1,".").concat(new Date(e).getFullYear()),day:this.$t("daysArr")[e]};return i[t]}}},xM={methods:{drawIndicator:function(t,e,i,o,n,s){o.beginPath(),o.fillStyle=i,o.fillRect(0,t-9,n.width,18),o.closePath(),o.textAlign="center",o.fillStyle=s||"#fff",o.fillText(e,n.width/2-3,t+4)},drawAxisIndicator:function(t,e,i,o){var n=o.width,s=t;i.beginPath(),i.moveTo(n-9,s),i.lineTo(n,s+9),i.lineTo(n,s-9),i.fillStyle=e,i.fill(),i.closePath()},drawLineIndicator:function(t,e,i,o,n,s,r,a,c,l){i.save(),i.beginPath(),i.setLineDash(c||[2,2]),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.lineWidth=a,i.strokeStyle=r,i.stroke(),i.restore(),this.drawAxisIndicator(e.y,r,i,{width:n.width,height:n.height}),this.drawIndicator(e.y,e.l,r,o,{width:s.width,height:s.height},l)}}},OM={data:function(){return{pointUtils:new PD}},methods:{drawSectors:function(t,e,i,o,n,s,r,a){e.beginPath(),e.lineWidth=s,e.lineTo(0,n.y),e.lineTo(t[0].points[0].x,t[0].points[0].y),i?(e.lineTo(t[0].points[0].x,n.y),e.fillStyle=t[0].trend<0?this.getFillColors.negative:this.getFillColors.positive,e.fill()):(e.strokeStyle=t[0].trend<0?this.getStrokeColors.negative:this.getStrokeColors.positive,e.stroke()),e.closePath(),t.forEach((function(t){e.beginPath(),e.lineWidth=s,t.points.forEach((function(t){e.lineTo(t.x,t.y)})),i?(e.fillStyle=t.trend<0?r.negative:r.positive,t.points[t.points.length-1].y===n.y&&t.points[0].y===n.y?e.closePath():t.points[t.points.length-1].y!==n.y&&t.points[0].y===n.y?(e.lineTo(t.points[t.points.length-1].x,n.y),e.closePath()):t.points[t.points.length-1].y===n.y&&t.points[0].y!==n.y?(e.lineTo(t.points[0].x,n.y),e.closePath()):t.points[t.points.length-1].y!==n.y&&t.points[0].y!==n.y&&(e.lineTo(t.points[t.points.length-1].x,n.y),e.lineTo(t.points[0].x,n.y),e.closePath()),e.fill()):(e.strokeStyle=t.trend<0?a.negative:a.positive,e.stroke())}));var c=t[t.length-1].points[t[t.length-1].points.length-1];o.status&&this.drawLineIndicator(c,{x:this.chartCanvas.getSizeCanvas().width,y:c.y,l:this.$moneyf(o.data,2)},e,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},t[t.length-1].trend<0?a.negative:a.positive,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333")},setSectors:function(t,e,i,o,n){var s=[],r=t[0].y0&&i.l!==o&&this.drawLineIndicator(n,{x:this.chartCanvas.getSizeCanvas().width,y:n.y,l:this.$moneyf(n.l,2)},e,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},this.getPossitiveColor,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),s<0&&i.l!==s&&this.drawLineIndicator(r,{x:this.chartCanvas.getSizeCanvas().width,y:r.y,l:this.$moneyf(r.l,2)},e,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},this.getNegativeColor,1,[2,2])},drawMeanLine:function(){var t=this.chartCanvas.ctx;t.save(),t.beginPath(),this.pointsForMeanLine.forEach((function(e){t.lineTo(e.x,e.y)})),t.lineWidth=2,t.strokeStyle="orange",t.stroke(),t.restore(),t.save(),this.pointsForMeanLine.forEach((function(e){t.beginPath(),t.arc(e.x,e.y,3,0,2*Math.PI),t.fillStyle="orange",t.fill()})),t.restore(),this.drawLineIndicator(this.pointsForMeanLine[this.pointsForMeanLine.length-1],{x:this.chartCanvas.getSizeCanvas().width,y:this.pointsForMeanLine[this.pointsForMeanLine.length-1].y,l:this.$moneyf(this.pointsForMeanLine[this.pointsForMeanLine.length-1].l,2)},t,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},"orange",1,[2,2],"#333333")},drawGrid:function(){var t=this.getGridParams(this.xServiceObject,this.configObject.grid.intervalGrid),e=this.getGridParams(this.yServiceObject,this.configObject.grid.intervalGrid);this.drawXYGrid(!0,t,this.chartCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.configObject.grid.labelShow&&this.drawXYGrid(!0,t,this.xAxisCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.xAxisCanvas.canvasObject.getBoundingClientRect().height},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out",this.configObject.grid.label),this.drawXYGrid(!1,e,this.chartCanvas,this.yServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.drawXYGrid(!1,e,this.yAxisCanvas,this.yServiceObject,{width:this.yAxisCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out","price")},setXData:function(){this.xServiceObject=this.chartCanvas.getServiceData(this.configObject.grid.xPoints,{maxExpand:this.configObject.grid.intervalGrid/2/this.chartCanvas.getSizeCanvas().width*100/100+4.5/this.chartCanvas.getSizeCanvas().width*100/100,minExpand:this.configObject.grid.intervalGrid/2/this.chartCanvas.getSizeCanvas().width*100/100},this.chartCanvas.getSizeCanvas().width)},setYData:function(){this.yServiceObject=this.chartCanvas.getServiceData(this.configObject.grid.yPoints,{maxExpand:.15,minExpand:.15},this.chartCanvas.getSizeCanvas().height)}}},LM=$M,FM=(i("cc02"),Object(C["a"])(LM,BM,MM,!1,null,"5d5649fc",null)),jM=FM.exports,RM={mixins:[TM,xM,OM],props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{contract:"EURUSD",widgetHeight:0,statusGistigramm:!0}}}},components:{ChartWrapper:pM,ChartLegend:CM,UserProfileWrapWidget:PB,Gistogramm:jM},data:function(){return{chartCanvas:null,lcoords:null,xAxisCanvas:null,yAxisCanvas:null,activeDate:null,xPoints:null,yPoints:null,statContracts:null,sectors:null,controlPoint:null,gistogrammCoords:null,yPointsForGistogramm:null,intervalGrid:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatusStatByContract:"contracts/getStatusStatByContract",getServerTime:"serverTime/getServerTime"})),{},{getRowStatus:function(){return this.topBarWidgetParams},getConfigObjectForGistogramm:function(){if(this.yPointsForGistogramm&&this.intervalGrid)return{period:"month",sizeColumn:this.intervalGrid,multiplay:!0,grid:{status:!0,xPoints:this.xPoints,yPoints:this.yPointsForGistogramm,intervalGrid:this.intervalGrid,label:"value",labelShow:!0}}},getLastDates:function(){if(this.getStatByDate){var t={month:this.getStatByMonth,day:this.getStatisticsByDay,week:this.getStatByWeeks,year:this.getStatByYears},e=t[this.configObject.period].length<=5?t[this.configObject.period]:t[this.configObject.period].slice(-5);return this.setStatForLastDates(e)}},getStrokeColors:function(){return{positive:"light"===this.getActiveTheme?"#008e72":"#00ffac",negative:"light"===this.getActiveTheme?"#da0000":"#ff3232"}},getFillColors:function(){return{positive:"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)",negative:"light"===this.getActiveTheme?"rgba(218, 0, 0, 0.1)":"rgba(255, 50, 50, 0.1)"}},getChartLegend:function(){return[{colorLight:"#FFC000",colorDark:"#F7970F",title:this.$t("forcMon")},{colorLight:"#3c73f1",colorDark:"#00b9fc",title:this.$t("forcDay")},{colorLight:"#008e72",colorDark:"#1ef0b1",title:"".concat(this.$t("initialEquity"),"/").concat(this.$t("currentEquity"))}]},getEquityClose:function(){if(this.statContracts)return this.statContracts[this.statContracts.length-1][1]},getTitleProfile:function(){if(this.getForecastMonth&&this.activeDate)return"".concat(this.$t("forecastWord")," ").concat(this.configObject.contract," ").concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear())},getOpenEquity:function(){if(this.getStatByDate)return this.getStatByDate[0][5]},getStartDeposit:function(){if(this.statContracts)return this.statContracts[0][5]},getStatByDate:function(){var t=this;if(this.activeDate&&this.statContracts)return this.statContracts.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e[3]).getMonth()===new Date(t.activeDate).getMonth()}))},getForecastMonth:function(){if(this.getStatByDate)return this.getFeutureProfit(this.getStatByDate,this.statContracts.length,this.getStartDeposit,this.getOpenEquity)}}),watch:{getServerTime:function(t){t&&!this.activeDate&&(this.activeDate=this.getServerTime.now)},getStatByDate:function(t){t&&this.initDataForDraw()},getActiveTheme:function(){this.initDataForDraw()},getStatusStatByContract:function(t){t&&(this.statContracts=JSON.parse(sessionStorage.getItem("statContract".concat(this.configObject.contract))),this.initDataForDraw())}},methods:{getFeutureProfit:function(t,e,i,o){var n=t[t.length-1],s=WM(n[3]),r=t[0],a=o+(o-i)*s.length/e,c=a-o,l={featureProfit:c,featureProfitPercent:100/(r[1]/c),featureEquity:a,firstDay:r,lastDay:n};return this.$emit("setForecast",l),l},getCanvasesObjects:function(t){this.chartCanvas=t.chartCanvas,this.xAxisCanvas=t.xAxisCanvas,this.yAxisCanvas=t.yAxisCanvas,this.initDataForDraw()},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},setXData:function(){for(var t=new Date(this.activeDate).daysInMonth(),e=0;ethis.getOpenEquity&&o!==t[t.length-1].y&&this.drawLineIndicator({x:e.mapLogicalToCanvasXCoordinate(this.xServiceObject,e.getSizeCanvas().width,n.x),y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y)},{x:e.getSizeCanvas().width,y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y),l:this.$moneyf(o,2)},i,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},this.getStrokeColors.positive,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),snew Date(i.date).getTime()&&(t.at(-1).date=e.openDate):t.push({contract:e.contractName,date:e.openDate})})),t=t.sort((function(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()})),t=t.map((function(t){return t.contract}));var i=this.getUsingAccountContracts.filter((function(e){return!t.some((function(t){return t===e}))}));i.forEach((function(e){t.push(e)}));var o=t.reduce((function(t,e,i){return(i+1)%2?t.splice(i?i/2:i,0,e):t.push(e),t}),[]);return o}},getStatusHorizontalFullMode:function(){return"horizontalFull"===this.topBarWidgetParams.col.mode},getShowFullModeTopBar:function(){return"normal"===this.topBarWidgetParams.col.mode||"horizontalFull"===this.topBarWidgetParams.col.mode||"normal"===this.topBarWidgetParams.col.mode||"fullMode"===this.topBarWidgetParams.col.mode}}),methods:{viewTooltip:function(t,e){if(e)switch(this.selector=t.target,e){case"Portfel_$":this.hintText=this.$t("iooac");break;case"Compare":this.hintText=this.$t("picoc");break;case"TimePeriod_2D":this.hintText=this.$t("ciioo");break;case"TimePeriod_2W":this.hintText=this.$t("ciioow");break;case"TimePeriod_2M":this.hintText=this.$t("ciioom");break;default:this.hintText=""}this.tooltipVisible=!0},setNormal:function(){this.$emit("setNormal")},setFullScreeForWidget:function(){var t=this;4===this.dataButtons.findIndex((function(t){return t.status}))&&setTimeout((function(){t.arrayTabsComponents[4].config.arrayWidgets.forEach((function(t){t.configObject.statusGistigramm=!0}))}),900)},setNormalSizeForWidget:function(){4!==this.dataButtons.findIndex((function(t){return t.status}))||this.getFullModeStatus||this.arrayTabsComponents[4].config.arrayWidgets.forEach((function(t){t.configObject.statusGistigramm=!1}))},setLeftTransform:function(){this.transformLeft&&this.transformLeft--},setRightTransform:function(){this.transformLeft!==Math.ceil(this.getUsingAccountContracts.length/2)-2&&this.transformLeft++},setActiveContract:function(t){this.activeContract=t;for(var e=2;e110?t.event.offsetY:t.event.offsetY-110,"px"),left:"".concat(s>152?t.event.offsetX+12:t.event.offsetX-152,"px")},this.statsForHoverWidget=[{label:this.$t("date"),stat:new Date(e).toLocaleDateString("ru"),color:"white"},{label:this.$t("balance"),stat:"$ ".concat(this.$moneyf(o.balanceClose,2)),color:"blue"},{label:this.$t("equity"),stat:"$ ".concat(this.$moneyf(o.balanceClose,2)),color:"green"},{label:"P/L, %",stat:"".concat(this.$moneyf(o.profitRel,2)),color:o.profitRel<0?"red":"green"},{label:"P/L, $",stat:"".concat(this.$moneyf(o.profitAbs,2)),color:o.profitRel<0?"red":"green"},{label:this.$t("average"),stat:"".concat(this.$moneyf(this.averLine[this.hoverIndex].y,2)),color:"orange"}]}}}else this.hoverIndex=null},switchWidgets:function(t){this.mode=t},setActiveTab:function(t){this.tabs.forEach((function(e,i){e.status=i===t}))},setPointForGistogram:function(){var t=this,e=[];for(var i in this.getYearsStat)this.getYearsStat[i].forEach((function(t){e.push(t)}));this.bars=[],this.averLine=[];var o=0;this.typeStat="day";var n="day"===this.typeStat?this.getStatistics.accountDaily:e;n.forEach((function(e,i){o+="day"===t.typeStat?100*(e.equityClose-e.equityOpen)/e.equityOpen:e.profitRel,t.bars.push({x:i,y:"day"===t.typeStat?100*(e.equityClose-e.equityOpen)/e.equityOpen:e.profitRel,date:e.date}),t.averLine.push({x:i,y:o/(i+1),date:e.date})})),this.pointsForGistogram=[[{x:0,y:0,date:e[0].date}],this.averLine,this.bars]},onResize:function(){this.$refs.wrap&&(this.size.width=this.$refs.wrap.clientWidth,this.size.height=this.$refs.wrap.clientHeight)}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap,t.getStatistics&&setTimeout((function(){t.setPointForGistogram()}),1e3)}))}},YM=zM,XM=(i("d47c"),Object(C["a"])(YM,VB,HB,!1,null,"a4ad786a",null)),QM=XM.exports,JM=function(){var t=this,e=t._self._c;return e("div",[e("transition",{attrs:{name:"tooltipOrder",appear:""}},[t.isVisibleTooltip?e("TooltipForOrders",t._b({on:{mouseMoveTooltip:t.mouseMoveTooltip,unMount:t.unMount}},"TooltipForOrders",t.propsTooltip,!1)):t._e()],1)],1)},KM=[],ZM=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TooltipForOrders",class:t.rootClass,style:t.styleCoordinate,on:{mouseover:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoading?e("SkeletonLoadingData",{key:"skeletonLoadingData"}):e("div",{key:"infoBlock",staticClass:"infoBlock"},[e("div",{staticClass:"data"},[e("div",{staticClass:"photoContent"},[e("img",{staticClass:"image",attrs:{alt:"",src:t.srcUser},on:{click:function(e){return t.goingToProfile("tooltip")}}}),e("ProgressRoundDiagram",{key:t.procPosOrders,attrs:{width:130,height:130,widthBorder:3,percent:t.procPosOrders}})],1),e("div",{staticClass:"name"},[t._v(t._s(t.nameSource))]),t.sequenceId?e("div",{staticClass:"sequenceId"},[t._v(t._s(t.sequenceId))]):t._e(),t.side?e("div",{staticClass:"buyOrCell"},[e("div",{staticClass:"line iconsText",class:t.getColorClass},[e("svgIcon",{attrs:{name:"Arrow-nano-top"}}),e("span",[t._v(t._s(t.side))])],1),e("div",{staticClass:"line",class:t.getColorClass},[t.numberVolume?e("span",{staticClass:"numberVolume"},[t._v("$ "+t._s(t.numberVolume))]):t._e()])]):t._e()]),e("div",{staticClass:"statistic"},[e("div",{staticClass:"centralCard"},[e("div",{staticClass:"commonBlock",class:{isPublish:t.isPublish}},[e("Chart",{attrs:{statByAccount:t.statByAccountForGraph,widthCard:263,classes:["graphBlock"],height:112}}),e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"titleText"},[t._v(t._s(t.$t("successful_trades_full")))]),e("div",{staticClass:"circleGraph"},[e("ProgressRoundDiagram",{key:t.procPosOrders,attrs:{width:52,height:52,widthBorder:3,percent:t.procPosOrders}})],1),e("div",{staticClass:"infoText"},[t._v(t._s(t.ordersCount)+" "+t._s(t.$t("of"))+" "+t._s(t.positiveOrdersCount)),e("br"),t._v(t._s(t.$t("profitable_trades2").toLowerCase()))])]),e("div",{staticClass:"profitability"},[e("div",{staticClass:"dataWrap"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("profitability")))]),e("div",{staticClass:"value",class:t.colorProfitClass_n},[t._v(t._s(t.profitability_n.valueFormatted)+"%")])])])],1),e("div",{staticClass:"averageMonth",class:{isPublish:t.isPublish}},[e("div",{staticClass:"title"},[t._v(t._s(this.$t("aipm2")))]),e("div",{staticClass:"value",class:t.valueClassProfit},[t._v(t._s(t.getMonthProfit.valueFormatted)+"%")])]),e("div",{staticClass:"maxdd",class:{isPublish:t.isPublish}},[e("div",{staticClass:"title"},[t._v("MaxDD")]),e("div",{staticClass:"value",class:t.colorDrawDownClass_n},[t._v(t._s(t.drawDown_n)+"%")])]),e("div",{staticClass:"coefSharpe",class:{isPublish:t.isPublish}},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("the_sharpe_ratio2")))]),e("div",{staticClass:"value",class:t.colorSharpClass_n},[t._v(t._s(t.sharpeRatio_n))])]),t.contracts?e("div",{staticClass:"contractBlock"},[e("ContractData",{attrs:{dataRow:t.contractFormatted,isStrategies:!0,topPosition:t.topOffset>100}})],1):t._e()])])])],1)],1)},t$=[],e$=function(){var t=this,e=t._self._c;return t.width&&t.height?e("div",{staticClass:"progressRound"},[e("canvas",{ref:t.refIdCanvas})]):t._e()},i$=[],o$={props:{height:{default:0},width:{default:0},percent:{default:95},widthBorder:{default:3},fontSize:{default:15},refIdCanvas:{default:"roundProgress"},reversMode:{default:!1}},mixins:[qe],data:function(){return{tickCount:0,ctx:null,canvasObject:null,smartCanvas:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPercent:function(){return this.percent<1?1:this.percent}}),watch:{getActiveTheme:function(){this.clearCanvas(),this.drawBagroundRing(),this.getPercent&&this.drawRing(n$(this.tickCount,this.widthBorder/2,this.width/2)),this.drawText(this.percent<1&&this.percent>0?">".concat(this.getPercent,"%"):"".concat(this.percent?this.tickCount:0,"%"))}},methods:{initCanvas:function(){this.$refs[this.refIdCanvas]&&(this.canvasObject=this.$refs[this.refIdCanvas],this.ctx=this.canvasObject.getContext("2d"),this.smartCanvas=new _B(this.canvasObject,this.ctx),this.smartCanvas.initCanvas(this.width,this.height),this.smartCanvas.animationCanvas({clear:function(){this.clearCanvas()},update:function(){this.tickCount++},render:function(){this.drawBagroundRing(),this.percent&&this.drawRing(n$(this.tickCount,this.widthBorder/2,this.width/2)),this.drawText(this.percent<1&&this.percent>0?">".concat(this.getPercent,"%"):"".concat(this.percent?this.tickCount:0,"%"))}},this.percent?this.percent:1,this))},clearCanvas:function(){this.smartCanvas.ctx.clearRect(0,0,this.smartCanvas.canvasObject.width,this.smartCanvas.canvasObject.height)},drawBagroundRing:function(){this.smartCanvas.ctx.beginPath(),this.smartCanvas.ctx.arc(this.width/2,this.height/2,this.width/2-this.widthBorder/2,0,2*Math.PI),this.smartCanvas.ctx.lineWidth=this.widthBorder-.1*this.widthBorder,this.smartCanvas.ctx.strokeStyle=this.reversMode?this.getGreenColor.color:this.getRedColor.color,this.smartCanvas.ctx.stroke(),this.smartCanvas.ctx.closePath()},drawRing:function(t){this.smartCanvas.ctx.beginPath(),this.smartCanvas.ctx.arc(this.width/2,this.height/2,this.width/2-this.widthBorder/2,-Math.PI/2+Math.PI/180*s$(this.widthBorder/2,this.width/2),t),this.smartCanvas.ctx.lineWidth=this.widthBorder,this.smartCanvas.ctx.strokeStyle=this.reversMode?this.getRedColor.color:this.getGreenColor.color,this.smartCanvas.ctx.lineCap="round",this.smartCanvas.ctx.stroke(),this.smartCanvas.ctx.closePath()},drawText:function(t){this.smartCanvas.ctx.font="bold ".concat(this.fontSize,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),this.smartCanvas.ctx.textAlign="center",this.smartCanvas.ctx.textBaseline="middle",this.smartCanvas.ctx.fillStyle=this.reversMode?this.getRedColor.color:this.getGreenColor.color,this.smartCanvas.ctx.fillText(t,this.width/2,this.height/2)}},mounted:function(){var t=this;this.$nextTick((function(){setTimeout((function(){t.initCanvas()}),1e3)}))}};function n$(t,e,i){return t<25?Math.PI/180*(3.6*(25-t)*-1+Math.PI/180*s$(e,i)):t>=25&&t<100?Math.PI/180*(3.6*(t-25)-s$(e,i)):100===t?Math.PI/180*(3.6*(t-25)+s$(e,i)):void 0}function s$(t,e){return Math.ceil(360*t/(2*Math.PI*e))}var r$=o$,a$=(i("ee6b"),Object(C["a"])(r$,e$,i$,!1,null,"de1879a4",null)),c$=a$.exports,l$=function(){var t=this,e=t._self._c;return t.statByAccount?e("div",{staticClass:"Chart",class:t.classes},[e("SimpleChart",{key:t.widthCard,attrs:{fixedWidth:t.widthCard,fixedHeight:t.height,points:t.getChartPoint.points,data:t.getChartPoint.date,margin:{top:3,right:3,bottom:0,left:3},smooth:t.getChartPoint.points.length>2,color:t.dark?"rgba(204,232,227, .2)":"#CCE8E3",zeroGradient:t.dark?"rgba(137, 239, 215, 0.23)":"rgba(137, 239, 215, 0.53)",firstGradient:"rgba(220, 255, 237, 0)"}})],1):t._e()},u$=[],d$={name:"Chart",mixins:[xt],components:{SimpleChart:BT},props:{statByAccount:{type:Object},widthCard:{type:Number},classes:{default:function(){return[]}},height:{type:Number}},computed:{getChartPoint:function(){if(this.statByAccount)return{points:this.statByAccount.accountDaily.map((function(t){return t.equityClose})),date:this.statByAccount.accountDaily.map((function(t){return t.date}))}},dark:function(){return this.darkClass.dark}}},h$=d$,p$=Object(C["a"])(h$,l$,u$,!1,null,null,null),g$=p$.exports,f$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SkeletonLoadingData",class:t.darkClass},[e("div",{staticClass:"userContent"},[e("Sceleton",{attrs:{variant:"circular",width:130,height:130}}),e("Sceleton",{staticClass:"name",attrs:{variant:"text",width:109,height:16}}),e("Sceleton",{staticClass:"byOrCell",attrs:{variant:"text",width:48,height:16}})],1),e("div",{staticClass:"statisticContent"},[e("div",{staticClass:"centralCard"},[e("div",{staticClass:"commonBlock"},[e("div",{staticClass:"successfulTransactions"},[e("Sceleton",{attrs:{variant:"text",width:"100%",height:"100%"}})],1),e("div",{staticClass:"averageAndGrowt"},[e("Sceleton",{attrs:{variant:"text",width:"100%",height:"100%"}})],1)]),e("div",{staticClass:"profitability"},[e("Sceleton",{attrs:{variant:"text",width:"100%",height:"100%"}})],1),e("div",{staticClass:"maxdd"},[e("Sceleton",{attrs:{variant:"text",width:"100%",height:"100%"}})],1),e("div",{staticClass:"coefSharpe"},[e("Sceleton",{attrs:{variant:"text",width:"100%",height:"100%"}})],1),e("div",{staticClass:"buttonBlock"},[e("Sceleton",{attrs:{variant:"text",width:"50%",height:32}}),e("Sceleton",{attrs:{variant:"text",width:"50%",height:32}})],1)])])])},m$=[],v$={name:"SkeletonLoadingData",mixins:[xt],components:{Sceleton:nT}},y$=v$,C$=(i("6fdd"),Object(C["a"])(y$,f$,m$,!1,null,"17c0bfc8",null)),b$=C$.exports,S$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ContractData",class:t.classContainer},[t.isPortfolio||t.isPortfolioUser||t.isSubscriber?e("div",{staticClass:"portfolioContracts"},[e("div",{staticClass:"contractName"},[t.isPortfolioUser?e("svgIcon",{attrs:{name:"RegPartner",size:16}}):t._e(),t._v(t._s(t.firstContract))],1),e("DxDropDownButton",{attrs:{displayExpr:"contract",items:t.itemsForDropDownButtons,dropDownOptions:t.dropDownOptions},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data,n=i.index;return[e(t.getComponent,t._b({tag:"component",attrs:{index:n,data:o,moreThanOneContracts:t.moreThanOneContracts}},"component",t.propsDropDownList[t.getComponent],!1))]}}],null,!1,2812244481)})],1):e("div",{staticClass:"contractName oneContract"},[t._v(t._s(t.dataRow.contract))])])},P$=[],T$=i("945a"),x$=i.n(T$),O$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DropDownListPortfolio",class:t.darkClass},[t.buttonDropVisible?e("div",{staticClass:"buttonDrop"},[e("span")]):e("div",{staticClass:"contract"},[e("img",{attrs:{src:t.data.avatarURL,alt:""}}),e("div",{staticClass:"contanerDrop"},[e("div",{staticClass:"name"},[t._v(t._s(t.data.name))]),e("div",{staticClass:"bottomSection"},[e("div",{staticClass:"sequenceId"},[t._v(t._s(t.data.sequenceId))]),e("div",{staticClass:"contractNameList"},[t._v(t._s(t.data.contract))])])])])])},w$=[],_$={name:"DropDownListPortfolio",mixins:[xt],props:{index:{type:Number},data:{type:Object},moreThanOneContracts:{type:Boolean}},computed:{buttonDropVisible:function(){return 0===this.index}}},A$=_$,D$=(i("1006"),Object(C["a"])(A$,O$,w$,!1,null,"466d9702",null)),k$=D$.exports,I$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DropDownListUserPortfolio",class:t.darkClass},[t.buttonDropVisible?e("div",{staticClass:"buttonDrop"},[e("span")]):e("div",{staticClass:"contract"},[e("div",{staticClass:"contractNameList"},[t._v(t._s(t.data.contract))])])])},B$=[],M$={name:"DropDownListUserPortfolio",mixins:[xt],props:{index:{type:Number},data:{type:Object},moreThanOneContracts:{type:Boolean}},computed:{buttonDropVisible:function(){return 0===this.index&&this.moreThanOneContracts}}},$$=M$,L$=(i("2805"),Object(C["a"])($$,I$,B$,!1,null,"65c2d198",null)),F$=L$.exports,j$=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DropDownListSubscriber",class:t.darkClass},[t.buttonDropVisible?e("div",{staticClass:"buttonDrop"},[e("span")]):e("div",{staticClass:"contract"},[t.index?e("div",{staticClass:"contractNameList"},[t._v(t._s(t.data.contract)),t.subscriptionSubscriber?t._e():e("span",[t._v("  "+t._s(t.dopInfo))])]):t._e()])])},R$=[],W$={name:"DropDownListSubscriber",mixins:[xt],props:{index:{type:Number},data:{type:Object},moreThanOneContracts:{type:Boolean},subscriptionSubscriber:{type:Boolean}},computed:{buttonDropVisible:function(){return 0===this.index&&this.moreThanOneContracts},dopInfo:function(){return"Percent"===this.data.priceType?this.data.price+"% SF":"$ "+this.data.price}}},N$=W$,E$=(i("2019"),Object(C["a"])(N$,j$,R$,!1,null,"9f80fd56",null)),U$=E$.exports,V$={name:"ContractData",mixins:[xt],props:{dataRow:{type:[Object,Array]},subscriber:{type:Boolean,default:!1},subscriptionSubscriber:{type:Boolean,default:!1},anchorSelector:{type:[String,Boolean],default:null},portfolio:{type:Boolean,default:!1},isStrategies:{type:Boolean,default:!1},topPosition:{type:Boolean,default:!1}},components:{DxDropDownButton:x$.a,DropDownListPortfolio:k$,DropDownListUserPortfolio:F$,DropDownListSubscriber:U$},computed:{isPortfolio:function(){return this.dataRow.portfolio||this.portfolio},isSubscriber:function(){return this.subscriber},isPortfolioUser:function(){return this.dataRow.portfolioUser||this.isStrategies||this.isSubscriber},classRoot:function(){var t,e;return this.isPortfolio?"contract_"+this.dataRow.id:this.isPortfolioUser?"userPortfolio_"+((null===(t=this.dataRow)||void 0===t?void 0:t.sourceAccountId)||(null===(e=this.dataRow)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.bagId)):this.isSubscriber?"subscriber_"+this.dataRow.accountId:""},classContainer:function(){return[this.classRoot,Object(c["a"])({},this.darkClass)]},firstContract:function(){var t;return Array.isArray(this.dataRow)?this.dataRow[0].contract:this.dataRow.sources?null===(t=this.dataRow.sources[0])||void 0===t?void 0:t.contract:void 0},contractsPortfolio:function(){if(this.isPortfolio){var t=this.dataRow.sources.map((function(t){var e;return{id:t.id,contract:t.contract,avatarURL:null===(e=t.userInfo)||void 0===e?void 0:e.avatarURL,sequenceId:t.accountSequenceId,name:"".concat(t.userInfo.firstName," ").concat(t.userInfo.lastName)}}));return(this.dataRow.sources.length>0||this.portfolio)&&t.push(t[0]),t}},contractsPortfolioUsers:function(){var t;if(this.isPortfolioUser)return t=Array.isArray(this.dataRow)?this.dataRow.map((function(t){return{id:t.id,contract:t.contract}})):(this.dataRow.sources||[]).map((function(t){return{id:t.id,contract:t.contract}})),t.length>1&&t.push(t[0]),t},dropDownOptions:function(){var t;return this.isPortfolio&&(t=150),this.isPortfolioUser&&(t=58),this.isSubscriber&&(t=95),this.subscriptionSubscriber&&(t=65),{minWidth:t,position:{my:this.topPosition?"bottom right":"top right",at:this.topPosition?"top right":"bottom right",of:this.anchorSelector||"."+this.classRoot},wrapperAttr:{class:"contractDropDown"+(this.darkClass.dark?" dark":"")}}},itemsForDropDownButtons:function(){return this.isPortfolio?this.contractsPortfolio:this.isPortfolioUser?this.contractsPortfolioUsers:void 0},moreThanOneContracts:function(){var t;return!!this.portfolio||(null===(t=this.itemsForDropDownButtons)||void 0===t?void 0:t.length)>1},getComponent:function(){return this.isPortfolio?"DropDownListPortfolio":this.isPortfolioUser?"DropDownListUserPortfolio":void 0},propsDropDownList:function(){return{DropDownListPortfolio:{},DropDownListUserPortfolio:{},DropDownListSubscriber:{subscriptionSubscriber:this.subscriptionSubscriber}}}}},H$=V$,G$=(i("9c39"),i("e833"),Object(C["a"])(H$,S$,P$,!1,null,"44d6ba8e",null)),q$=G$.exports,z$="expertsPortfolio",Y$=function(){return localStorage.getItem(z$)?JSON.parse(localStorage.getItem(z$)):[]},X$=function(t){var e=[];if(localStorage.getItem(z$)){var i=JSON.parse(localStorage.getItem(z$));if(i.find((function(e){return e.uniqueId===t.uniqueId})))return;e=[].concat(Object(x["a"])(i),[t])}else e.push(t);localStorage.setItem(z$,JSON.stringify(e))},Q$=function(t){var e=JSON.parse(localStorage.getItem(z$)),i=e.filter((function(e){return e.uniqueId!==t}));localStorage.setItem(z$,JSON.stringify(i))},J$=function(){localStorage.removeItem(z$)};function K$(t){return{serverTime:t[0],equity:t[1],balance:t[2],profit:t[3],marging:t[4],sharp:t[5],profitFactor:t[6],recoveryFactor:t[7],maxDDBalance:t[8],positiveOrdersCount:t[9],ordersCount:t[10],avgProfit:t[11],leverage:t[12],openOrdersCount:t[13],procPosOrders:t[14],subsCount:t[15],investMoney:t[16],subsUsedVolume:t[17],avgPipByOrders:t[18],tradesDays:t[19],deposits:t[20],withdraws:t[21]}}var Z$=i("4478");function tL(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",i={ru:["янв.","февр.","марта","апр.","мая","июня","июля","авг.","сент.","окт.","нояб.","дек."],en:["jan.","feb.","mar","apr.","may","jun.","jul.","aug.","sep.","oct.","nov.","dec."]};return i[e][t.getMonth()]}function eL(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"short";return t.toLocaleDateString(e,{weekday:i})}function iL(t){return t.getHours()}function oL(t){return t.getMinutes()}function nL(t){return"".concat(t.getDate(),".").concat(t.getMonth(),".").concat(t.getFullYear())}function sL(t,e,i){var o=null===t||void 0===t?void 0:t.getDate(),n=null===t||void 0===t?void 0:t.getMonth(),s=null===t||void 0===t?void 0:t.getFullYear(),r=null===e||void 0===e?void 0:e.getDate(),a=null===e||void 0===e?void 0:e.getMonth(),c=null===e||void 0===e?void 0:e.getFullYear(),l=new Date(s,n,o).getTime(),u=new Date(c,a,r).getTime();switch(i){case"more":return l>u;case"less":return l=u;case"less-equally":return l<=u;default:return null}}function rL(t){return new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(t))}function aL(t){var e=new Date(t).getHours(),i=new Date(t).getMinutes();return e=e<10?"0"+e:e,i=i<10?"0"+i:i,"".concat(e,":").concat(i)}function cL(t){var e=t.dateFrom,i=t.dateTo,o=new Date(e).getHours();o=o<10?"0"+o:o;var n=new Date(i).getHours();n=n<10?"0"+n:n;var s=new Date(e).getMinutes();s=s<10?"0"+s:s;var r=new Date(i).getMinutes();return r=r<10?"0"+r:r,"".concat(o,":").concat(s,"-").concat(n,":").concat(r)}function lL(t){var e=[];function i(t){return 60*new Date(t).getHours()+new Date(t).getMinutes()}function o(t){return function(e){var o=e.dateFrom,n=e.dateTo;return i(t.dateTo)===i(o)||i(t.dateFrom)===i(o)||i(t.dateFrom)===i(n)||i(t.dateFrom)>i(o)&&i(t.dateFrom)i(o)}}t.forEach((function(n,s){var r,a=t.filter(o(n));if(a.length>1){var l=e.map((function(t){return i(t.dateFrom)+i(t.dateTo)}));if(a.forEach((function(t){var o=l.findIndex((function(e){return i(t.dateFrom)+i(t.dateTo)===e}));o>-1&&(r=e[o])})),r){var u=a.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{ind:r.ind})}));e=[].concat(Object(x["a"])(e),Object(x["a"])(u))}else{var d=a.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{ind:s})}));e=[].concat(Object(x["a"])(e),Object(x["a"])(d))}}})),e=Object(Z$["a"])(Array,Object(x["a"])(new Set(e.map((function(t){return JSON.stringify(t)}))))).map((function(t){return JSON.parse(t)}));var n={};return e.forEach((function(t){n[t.ind]?n[t.ind]+=1:n[t.ind]=1,n[t.ind]&&(t.left=n[t.ind])})),e.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{dateFrom:new Date(t.dateFrom),dateTo:new Date(t.dateTo),width:100/n[t.ind],left:100/n[t.ind]*(t.left-1)})}))}function uL(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function dL(t){return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)}function hL(t){if(!t)return"";var e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o),"д. ").concat(Math.floor(o%1*24),"ч."):Math.floor(i)>=1?"".concat(Math.floor(i),"ч."):"".concat(Math.floor(e),"м.");return n}var pL={name:"TooltipForOrders",mixins:[xt,rT],props:{imageForSource:{type:String},nameSource:{type:String},sequenceId:{type:[Boolean,String,Number]},numberVolume:{type:[String,Number],default:""},side:{type:String},getColorClass:{type:Array},coordinate:{type:Object},accountId:{type:String},forceClosed:{type:Boolean},contractName:{type:[String,Boolean],default:null},position:{type:String,default:"left"},noActiveButton:{type:Boolean,default:!1},locationCall:{type:String,default:""},contracts:{type:[Array,Boolean]}},components:{ProgressRoundDiagram:c$,Chart:g$,SkeletonLoadingData:b$,ContractData:q$},data:function(){return{statByAccount:null,statAccountTwo:null,isLoading:!0,shortSourcesByAccounts:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getExperts:"expertsPortfolio/getExperts"})),{},{symbol:function(){return this.contractName},topOffset:function(){var t,e=100;return document.body.offsetHeight-(null===(t=this.coordinate)||void 0===t?void 0:t.top)<250&&(e=176),e},leftStyle:function(){var t,e;return["left","leftTop"].includes(this.position)?(null===(e=this.coordinate)||void 0===e?void 0:e.left)-419+"px":(null===(t=this.coordinate)||void 0===t?void 0:t.right)+"px"},topStyle:function(){var t,e;"leftTop"===this.position&&(null===(e=this.coordinate)||void 0===e||e.top);return(null===(t=this.coordinate)||void 0===t?void 0:t.top)-this.topOffset+"px"},styleCoordinate:function(){return{left:this.leftStyle,top:this.topStyle}},rootClass:function(){return Object(c["a"])({},this.darkClass)},srcUser:function(){return"User-profile.png"===this.imageForSource?i("a594"):this.imageForSource},isPublish:function(){var t;return!(this.noActiveButton&&!this.contracts)&&(null===(t=this.statByAccount)||void 0===t||null===(t=t.account)||void 0===t?void 0:t.isPublish)},classForAddCart:function(){var t="buttonCustom withText reverse";return this.alreadyInPortfolio&&(t+=" alreadyInPortfolio"),t},contractFormatted:function(){return{sourceAccountId:null,sources:this.contracts}},drawDown_n:function(){var t;return this.statAccountTwo?Lm(null===(t=this.statAccountTwo)||void 0===t?void 0:t.maxDDBalance,1,!0):0},colorDrawDownClass_n:function(){return"red"},sharpeRatio_n:function(){var t;return null===(t=this.statAccountTwo)||void 0===t?void 0:t.sharp},colorSharpClass_n:function(){return this.statAccountTwo?{red:this.sharpeRatio_n<0,green:this.sharpeRatio_n>0}:{}},profitability_n:function(){if(!this.statByAccount)return{};var t=this.statByAccount.ordersStatistics.startTradingDT,e=this.statByAccount.accountDaily.find((function(e){return new Date(t).getTime()===new Date(e.date).getTime()}));e=e||this.statByAccount.accountDaily[0];var i=e.balanceClose,o=this.statByAccount.ordersStatistics.closedProfit,n=100*o/i;return{value:n,valueFormatted:Lm(n,1,!0)}},colorProfitClass_n:function(){return{red:this.profitability_n.value<0,green:this.profitability_n.value>=0}},procPosOrders:function(){var t;return this.statAccountTwo?null===(t=this.statAccountTwo)||void 0===t?void 0:t.procPosOrders:0},ordersCount:function(){var t;return this.statAccountTwo?null===(t=this.statAccountTwo)||void 0===t?void 0:t.ordersCount:0},positiveOrdersCount:function(){var t;return this.statAccountTwo?null===(t=this.statAccountTwo)||void 0===t?void 0:t.positiveOrdersCount:0},statByAccountForGraph:function(){var t;if(this.statByAccount){var e=JSON.parse(JSON.stringify(this.statByAccount)),i=null===(t=e.ordersStatistics)||void 0===t?void 0:t.startTradingDT;if(!i)return e;var o=e.accountDaily.findIndex((function(t){return sL(new Date(t.date),new Date(i),"equally")}));return e.accountDaily=e.accountDaily.slice(o),e}},countMonth:function(){return this.statByAccount?Math.floor(this.statByAccount.ordersStatistics.tradesDays/30):0},getMonthProfit:function(){var t=this.profitability_n.value/this.countMonth;return{value:t,valueFormatted:Lm(t,1,!0)}},valueClassProfit:function(){return{red:this.getMonthProfit.value<0,green:this.getMonthProfit.value>=0}}}),watch:{statByAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!t.account.isPublish||!e.isLoading){i.next=8;break}return i.next=3,e.$http.post("".concat(e.getApiUrl,"GetShortSourcesByAccountIds"),{ids:[t.account.id],checkStat:!0});case 3:o=i.sent,n=o.data,n.status.isOK&&(s=Object(x["a"])(n.data).map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:t.data.filter((function(t){return!t.statIsOut}))})})),e.shortSourcesByAccounts=s,e.isLoading=!1),i.next=9;break;case 8:t&&!t.account.isPublish&&e.isLoading&&(e.isLoading=!1);case 9:case"end":return i.stop()}}),i)})))()}},mounted:function(){var t=this,e=Y$();if(e.length>0&&"portfolio"!==this.locationCall){var i=e.find((function(e){return e.login===t.accountId})),o=this.getExperts.find((function(e){return e.login===t.accountId}));if(i&&!o){var n={avatar:i.avatar,iAmProvider:i.iAmProvider,login:i.login,sources:i.sources,symbol:i.symbol,traderName:i.traderName,uniqueId:i.uniqueId};this.$store.commit("expertsPortfolio/addExpertInPortfolio",n)}}this.getStatByAccount(this.accountId),this.getDataForHeaderWidgets(),this.$socketStream.$on("apiWS3",this.setMessageHandler),localStorage.removeItem("clickedNewTab")},destroyed:function(){this.$emit("unMount",this.accountId),localStorage.removeItem("dataExpertTooltip"),this.$socketStream.$off("apiWS3",this.setMessageHandler)},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({addExpertInPortfolio:"expertsPortfolio/addExpertInPortfolio",showToast:"toast/showToast"})),{},{getDataForHeaderWidgets:function(){var t={command:"GetAccountDataStatisticsById",data:{id:this.accountId}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},getStatByAccount:function(t){var e={Command:"GetStatisticsByAccounts",data:{AccountIds:[t]}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},setStat:function(t){t&&t[0].account.id===this.accountId&&(this.statByAccount=t[0])},setMessageHandler:function(t){"GetStatisticsByAccounts"===(null===t||void 0===t?void 0:t.command)?this.setStat(t.data):"GetAccountDataStatisticsById"===(null===t||void 0===t?void 0:t.command)&&(this.statAccountTwo=K$(JSON.parse(t.data)))},mouseenterHandler:function(){this.$emit("mouseMoveTooltip",!0)},mouseleaveHandler:function(){this.$emit("mouseMoveTooltip",!1)},iAmProvider:function(){var t=[];if(0===this.getDefaultAccount.source.length)return[];var e=this.shortSourcesByAccounts[0].data.map((function(t){return t.contract})),i=this.getDefaultAccount.source;return this.symbol&&i.includes(this.symbol)?t.push(this.symbol):this.symbol||e.forEach((function(e){i.includes(e)&&t.push(e)})),t},addInCartProvider:function(){this.isAuth?this.alreadyInPortfolio||(this.addExpertInPortfolio({uniqueId:this.accountId+(this.symbol||"all"),login:this.accountId,avatar:this.avatar,traderName:this.traderName,sources:this.shortSourcesByAccounts[0].data,symbol:this.symbol,iAmProvider:this.iAmProvider()}),X$(Object(c["a"])(Object(c["a"])({},this.statByAccount),{},{login:this.accountId,traderName:this.traderName,avatar:this.avatar,sources:this.shortSourcesByAccounts[0].data,uniqueId:this.accountId+(this.symbol||"all"),profitOrdersPercent:this.getProfitOrdersPercent,symbol:this.symbol,iAmProvider:this.iAmProvider()})),this.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:"Пользователь “".concat(this.traderName,"” добавлен в корзину в разделе “Стратегии”")}})):this.login()}})},gL=pL,fL=(i("ef16"),Object(C["a"])(gL,ZM,t$,!1,null,"65b1ebd2",null)),mL=fL.exports,vL={name:"TooltipComponent",components:{TooltipForOrders:mL},data:function(){return{dataExpertTooltip:{},isHoverImage:!1,isHoverTooltip:!1}},computed:{isVisibleTooltip:function(){return this.isHoverImage||this.isHoverTooltip},propsTooltip:function(){return Object(c["a"])({},this.dataExpertTooltip)}},methods:{setVisibleTooltipOrder:function(t){var e=this;t?(this.dataExpertTooltip=JSON.parse(localStorage.getItem("dataExpertTooltip")),this.isHoverImage=t):setTimeout((function(){return e.isHoverImage=t}),0)},mouseMoveTooltip:function(t){var e=this;t?this.isHoverTooltip=t:setTimeout((function(){return e.isHoverTooltip=t}),0)},unMount:function(t){var e=localStorage.getItem("clickedNewTab");if(e){var i=this.$router.resolve({name:"UserProfile",query:{accountId:t}}),o=document.createElement("a");o.href=i.href,o.target="_blank",o.click(),o.remove()}}}},yL=vL,CL=(i("ff6f"),Object(C["a"])(yL,JM,KM,!1,null,null,null)),bL=CL.exports,SL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ModalPay"},[e("DxPopup",{attrs:{"content-template":"content",visible:t.getVisible,width:t.widthModal,height:t.heightModal,"max-height":"calc(100vh - 16px)",shading:!0,closeOnOutsideClick:!0,showTitle:!1,wrapperAttr:t.getWrapperAttr,shadingColor:t.darkClass.dark?"rgba(0,0,0,.5)":""},on:{hidden:t.hiddenHandler},scopedSlots:t._u([{key:"content",fn:function(){return[t.getVisible?e("PayCard",{attrs:{visibleFrame:t.visibleFrame}}):t._e()]},proxy:!0}])})],1)},PL=[],TL=(i("9911"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"PayCard"},[e("div",{staticClass:"buttonClose",on:{click:function(e){return t.setVisible(!1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconClose,!1))],1),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.visibleFrame?e("iframe",{ref:"payframe",staticStyle:{border:"0"},attrs:{width:"100%",height:"100%",allow:"payment",src:t.link},on:{load:t.loadFrameHandler}}):e(t.isComponent,{tag:"component",on:{setLink:t.setLink}})],1)],1)}),xL=[],OL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NeedPay"},[e("div",{staticClass:"imageAndTextBlock"},[e("img",{attrs:{src:t.srcImage,alt:""}}),t._m(0)]),e("div",{staticClass:"activeBlock"},[e("div",{staticClass:"selectedMonth"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowLeft},on:{toggle:function(e){return t.setMonth(-1)}}}),e("div",{staticClass:"viewMonthBlock"},[t._v(t._s(t.periodPay)+" мес.")]),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowRight},on:{toggle:function(e){return t.setMonth(1)}}})],1),e("div",{staticClass:"sumBlock"},[t._v(t._s(t.priceFormatted)+" ₽")]),e("div",{staticClass:"buttonSection"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconPay,disabled:t.loading},on:{toggle:t.startPay}},[t.loading?e("div",{staticClass:"loadingContainer"},[t.loading?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1):t._e(),e("span",{style:{opacity:t.loading?0:1}},[t._v("Оплатить")])])],1)])])},wL=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"textBlock"},[e("div",{staticClass:"text"},[t._v("Пробный период подошел к концу. Теперь Вы не сможете пользоваться копированием торговых сигналов и другими классными сервисами TopTrader.")]),e("div",{staticClass:"text last"},[t._v("Для продолжения необходимо оформить подписку.")]),e("div",{staticClass:"text test"},[e("b",{staticStyle:{color:"red"}},[t._v("Внимание!  ")]),e("br"),t._v("Платежный сервис находится в режиме тестирования. Для осуществления платежа используйте следующие тестовые и бесплатные платежные данные."),e("br"),t._v("Номер карты:  "),e("b",[t._v("4111 1111 1111 1111")]),e("br"),t._v("Период действия:  "),e("b",[t._v("12/24")]),e("br"),t._v("CVC/CVV-код:  "),e("b",[t._v("123")]),e("br"),t._v("Пароль подтв. оплаты:  "),e("b",[t._v("12345678")])])])}],_L={inject:["setVisibleFrame"],data:function(){return{serviceName:"Site Plus",currencyCode:"643",loading:!1}},computed:Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getUserPaymentServices:"paymentService/getUserPaymentServices",getPaymentReference:"paymentService/getPaymentReference",getUserInvoices:"paymentService/getUserInvoices"})),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({createUserService:"paymentService/createUserService",payInvoice:"paymentService/payInvoice",updatePaymentService:"paymentService/updatePaymentService"})),{},{createUserServiceHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l,u;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.getPaymentReference.services.find((function(e){return e.name===t.serviceName})),o=t.getPaymentReference.prices.find((function(e){return e.serviceId===i.id&&e.currencyCode===t.currencyCode})),n=t.getPaymentReference.periods.find((function(t){return t.id===o.periodId})),s=!1,t.getUserPaymentServices.length>0&&(s=t.getUserPaymentServices.find((function(e){var o=e.serviceId===i.id,n=!e.startDateTime,s=e.accountId===t.getDefaultAccount.id,r=!t.periodPayDay||e.period===t.periodPayDay;return o&&n&&s&&r}))),a=0===t.getUserPaymentServices.length||!s,c=s&&t.periodPayDay&&s.period!==t.periodPayDay,!a&&!c){e.next=12;break}return e.next=10,t.createUserService({serviceId:i.id,accountId:t.getDefaultAccount.id,amount:t.pricePay?t.pricePay:o.amount,period:t.periodPayDay?t.periodPayDay:n.period,externalId:"",autoRenewal:!1});case 10:return l=e.sent,e.abrupt("return",l.invoice);case 12:return u=t.getUserInvoices.find((function(t){return t.userServiceId===s.id})),e.abrupt("return",u);case 14:case"end":return e.stop()}}),e)})))()},startPay:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.createUserServiceHandler();case 3:return i=e.sent,o=new URL(window.location.href),e.next=7,t.payInvoice({invoiceIds:[i.id],returnUrl:"".concat(o.origin,"/loading.html")});case 7:n=e.sent,t.$emit("setLink",n.customDatas[0].value),t.setVisibleFrame(!0),t.loading=!1;case 11:case"end":return e.stop()}}),e)})))()}})},AL={name:"NeedPay",inject:["setVisibleFrame"],components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{},mixins:[xt,_L],data:function(){return{periods:[1,3,6,9,12],index:0}},watch:{},computed:{srcImage:function(){return i("46d6")},iconPay:function(){return this.loading?{name:"PayMonet",color:"transparent"}:{name:"PayMonet",color:"#8c8c8c"}},iconArrowLeft:function(){return{name:"Arrow-expand-left",color:"#8c8c8c"}},iconArrowRight:function(){return{name:"Arrow-expand-right",color:"#8c8c8c"}},periodPay:function(){return this.periods[this.index]},periodPayDay:function(){return 30*this.periodPay},pricePay:function(){var t=this,e=this.getPaymentReference.services.find((function(e){return e.name===t.serviceName})),i=this.getPaymentReference.prices.find((function(i){return i.serviceId===e.id&&i.currencyCode===t.currencyCode}));return i.amount*this.periods[this.index]},priceFormatted:function(){return Lm(this.pricePay,2,!0)}},methods:{setMonth:function(t){var e=this.index+t;e<0&&(e=this.periods.length-1),e>this.periods.length-1&&(e=0),this.index=e}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},DL=AL,kL=(i("222a"),Object(C["a"])(DL,OL,wL,!1,null,"6302e0b2",null)),IL=kL.exports,BL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ErrorPay"},[e("img",{attrs:{src:t.srcImage,alt:""}}),t._m(0)])},ML=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"textBlock"},[e("div",{staticClass:"text"},[t._v("Что-то пошло не так!"),e("br"),t._v("К сожалению, оплату подписки произвести не удалось.")]),e("div",{staticClass:"text"},[t._v("Попробуйте позже.")])])}],$L={name:"ErrorPay",components:{},props:{},mixins:[],data:function(){return{}},watch:{},computed:{srcImage:function(){return i("71d4")}},methods:{},mounted:function(){},destroyed:function(){}},LL=$L,FL=(i("2a31"),Object(C["a"])(LL,BL,ML,!1,null,"5fee2828",null)),jL=FL.exports,RL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SuccessPay"},[e("img",{attrs:{src:t.srcImage,alt:""}}),e("div",{staticClass:"textBlock"},[e("div",{staticClass:"text"},[t._v("Поздравляем, Вы оформили подписку на TopTrader по счету"),e("b",[t._v("  №"+t._s(t.getDefaultAccount.sequenceId))]),t._v("  до "+t._s(t.dateEnd))]),e("div",{staticClass:"text last"},[t._v("Теперь для Вас доступны все сервисы платформы TopTrader")])])])},WL=[],NL={name:"SuccessPay",components:{},props:{},mixins:[$n],data:function(){return{currentDate:new Date}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime"})),{},{srcImage:function(){return i("5a45")},dateEnd:function(){var t;if(this.payPeriod)return this.payPeriod.forEach((function(e){t||(t=e),new Date(e.startDateTime).getTime()>new Date(t.startDateTime).getTime()&&(t=e)})),new Date(t.stopDateTime).toLocaleDateString();var e=this.currentDate.getTime(),i=e+2592e6;return new Date(i).toLocaleDateString()}}),methods:{},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.currentDate=new Date(t.getServerTime.now);case 1:case"end":return e.stop()}}),e)})))()},destroyed:function(){},activated:function(){},deactivated:function(){}},EL=NL,UL=(i("7a0d"),Object(C["a"])(EL,RL,WL,!1,null,"28702567",null)),VL=UL.exports,HL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PendingPay"},[e("img",{attrs:{src:t.srcImage,alt:""}}),t._m(0)])},GL=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"textBlock"},[e("div",{staticClass:"text"},[t._v("Ваш платеж в обработке!")]),e("div",{staticClass:"text"},[t._v("После зачисления средств на наш счет Вы получите уведомление через СМС и на сайте TopTrader и Вам станут доступны все сервисы платформы.")])])}],qL={name:"PendingPay",components:{},props:{},mixins:[],data:function(){return{}},watch:{},computed:{srcImage:function(){return i("cf5d")}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},zL=qL,YL=(i("d741"),Object(C["a"])(zL,HL,GL,!1,null,"fc24c60a",null)),XL=YL.exports,QL=function(){var t=this,e=t._self._c;return e("div",{staticClass:"EndDemoPeriodPay"},[e("h2",{staticClass:"heading"},[t._v(t._s(t.headingText))]),e("div",{staticClass:"data"},[e("div",{staticClass:"dataAccount"},[e("img",{attrs:{src:t.srcBroker}}),e("div",{staticClass:"accountAndGroup"},[e("div",{staticClass:"group"},[t._v(t._s(t.getDefaultAccount.accountGroupCode))]),e("div",{staticClass:"account"},[t._v(t._s(t.getDefaultAccount.sequenceId))])])]),t.demoPeriodExistFinish?t._e():e("div",{staticClass:"days"},[t._v(t._s(t.days))])]),e("div",{staticClass:"bottomBlock"},[e("div",{staticClass:"selectedMonth"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowLeft},on:{toggle:function(e){return t.setMonth(-1)}}}),e("div",{staticClass:"viewMonthBlock"},[t._v(t._s(t.periodPay)+" мес.")]),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowRight},on:{toggle:function(e){return t.setMonth(1)}}})],1),e("div",{staticClass:"sumBlock"},[t._v(t._s(t.priceFormatted)+" ₽")]),e("div",{staticClass:"buttonSection"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconPay,disabled:t.loading},on:{toggle:t.startPay}},[t.loading?e("div",{staticClass:"loadingContainer"},[t.loading?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1):t._e(),e("span",{style:{opacity:t.loading?0:1}},[t._v("Оплатить")])])],1)])])},JL=[],KL={name:"EndDemoPeriodPay",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{},mixins:[xt,$n,_L],data:function(){return{periods:[1,3,6,9,12],index:0}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{pricePay:function(){var t=this,e=this.getPaymentReference.services.find((function(e){return e.name===t.serviceName})),i=this.getPaymentReference.prices.find((function(i){return i.serviceId===e.id&&i.currencyCode===t.currencyCode}));return i.amount*this.periods[this.index]},priceFormatted:function(){return Lm(this.pricePay,2,!0)},periodPay:function(){return this.periods[this.index]},periodPayDay:function(){return 30*this.periodPay},demoPeriodExistFinish:function(){if(!this.demoPeriod&&!this.payPeriod)return!0},headingText:function(){return this.demoPeriodExistFinish?"Пробный период закончился!":"Пробный период заканчивается!"},srcBroker:function(){return this.getDefaultAccount.brokerId?i("a955"):i("700b")},iconPay:function(){return this.loading?{name:"PayMonet",color:"transparent"}:{name:"PayMonet",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconArrowLeft:function(){return{name:"Arrow-expand-left",color:"#8c8c8c"}},iconArrowRight:function(){return{name:"Arrow-expand-right",color:"#8c8c8c"}},days:function(){var t,e,i=null===(t=this.remainedTime)||void 0===t?void 0:t.days,o=null===(e=this.remainedTime)||void 0===e?void 0:e.hours;return"".concat(i,"д. ").concat(o,"ч.")}}),methods:{setMonth:function(t){var e=this.index+t;e<0&&(e=this.periods.length-1),e>this.periods.length-1&&(e=0),this.index=e}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},ZL=KL,tF=(i("a031"),Object(C["a"])(ZL,QL,JL,!1,null,"71bf3d23",null)),eF=tF.exports,iF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"EndPeriodPay"},[e("h2",{staticClass:"heading"},[t._v(t._s(t.headingText))]),e("div",{staticClass:"data"},[e("div",{staticClass:"dataAccount"},[e("img",{attrs:{src:t.srcBroker}}),e("div",{staticClass:"accountAndGroup"},[e("div",{staticClass:"group"},[t._v(t._s(t.getDefaultAccount.accountGroupCode))]),e("div",{staticClass:"account"},[t._v(t._s(t.getDefaultAccount.sequenceId))])])]),t.demoPeriodExistFinish?t._e():e("div",{staticClass:"days"},[t._v(t._s(t.days))])]),e("div",{staticClass:"bottomBlock"},[e("div",{staticClass:"selectedMonth"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowLeft},on:{toggle:function(e){return t.setMonth(-1)}}}),e("div",{staticClass:"viewMonthBlock"},[t._v(t._s(t.periodPay)+" мес.")]),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconArrowRight},on:{toggle:function(e){return t.setMonth(1)}}})],1),e("div",{staticClass:"sumBlock"},[t._v(t._s(t.priceFormatted)+" ₽")]),e("div",{staticClass:"buttonSection"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.iconPay,disabled:t.loading},on:{toggle:t.startPay}},[t.loading?e("div",{staticClass:"loadingContainer"},[t.loading?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1):t._e(),e("span",{style:{opacity:t.loading?0:1}},[t._v("Оплатить")])])],1)])])},oF=[],nF={name:"EndPeriodPay",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{},mixins:[xt,$n,_L],data:function(){return{periods:[1,3,6,9,12],index:0}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{pricePay:function(){var t=this,e=this.getPaymentReference.services.find((function(e){return e.name===t.serviceName})),i=this.getPaymentReference.prices.find((function(i){return i.serviceId===e.id&&i.currencyCode===t.currencyCode}));return i.amount*this.periods[this.index]},priceFormatted:function(){return Lm(this.pricePay,2,!0)},periodPay:function(){return this.periods[this.index]},periodPayDay:function(){return 30*this.periodPay},demoPeriodExistFinish:function(){if(!this.payPeriod)return!0},headingText:function(){return this.demoPeriodExistFinish?"Подписка по счету закончилась!":"Подписка по счету заканчивается!"},srcBroker:function(){return this.getDefaultAccount.brokerId?i("a955"):i("700b")},iconPay:function(){return this.loading?{name:"PayMonet",color:"transparent"}:{name:"PayMonet",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconArrowLeft:function(){return{name:"Arrow-expand-left",color:"#8c8c8c"}},iconArrowRight:function(){return{name:"Arrow-expand-right",color:"#8c8c8c"}},days:function(){var t,e,i=null===(t=this.remainedTime)||void 0===t?void 0:t.days,o=null===(e=this.remainedTime)||void 0===e?void 0:e.hours;return"".concat(i,"д. ").concat(o,"ч.")}}),methods:{setMonth:function(t){var e=this.index+t;e<0&&(e=this.periods.length-1),e>this.periods.length-1&&(e=0),this.index=e}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},sF=nF,rF=(i("18b7"),Object(C["a"])(sF,iF,oF,!1,null,"bd0cff40",null)),aF=rF.exports,cF={name:"PayCard",inject:["setVisibleFrame"],components:{NeedPay:IL,SuccessPay:VL,PendingPay:XL,ErrorPay:jL,EndDemoPeriodPay:eF,EndPeriodPay:aF},props:{visibleFrame:{type:Boolean,default:!1}},mixins:[xt],data:function(){return{link:"",activeCard:"NeedPay",activeCardStatus:null}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getPendingStatus:"modalPay/getPendingStatus",getEndPeriodDemoStatus:"modalPay/getEndPeriodDemoStatus",getEndPeriodPayStatus:"modalPay/getEndPeriodPayStatus"})),{},{getActiveCard:function(){return this.getPendingStatus?"PendingPay":this.getEndPeriodDemoStatus||this.getEndPeriodPayStatus?this.getEndPeriodDemoStatus?"EndDemoPeriodPay":"EndPeriodPay":this.activeCard},iconClose:function(){return{name:"Close",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},isComponent:function(){return this.activeCardStatus||this.getActiveCard}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({setVisible:"modalPay/setVisible"})),{},{loadFrameHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t.$refs.payframe;try{i.contentWindow.postMessage("Pay","*"),n=null===i||void 0===i||null===(o=i.contentWindow)||void 0===o?void 0:o.location,n.href&&(s=new URLSearchParams(n.search),"ok"===s.get("stat")?(t.activeCardStatus="SuccessPay",t.setVisibleFrame(!1)):(t.activeCardStatus="ErrorPay",t.setVisibleFrame(!1)))}catch(r){window.console.log(r)}case 2:case"end":return e.stop()}}),e)})))()},setLink:function(t){this.link=t}}),mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},lF=cF,uF=(i("3d31"),Object(C["a"])(lF,TL,xL,!1,null,"0e2715cc",null)),dF=uF.exports,hF={name:"ModalPay",components:{DxPopup:To["DxPopup"],PayCard:dF},props:{},mixins:[xt,$n],provide:function(){return{setVisibleFrame:this.setVisibleFrame}},data:function(){return{visibleFrame:!1,widthModal:650,heightModal:480}},watch:{visibleFrame:function(t){var e=this;setTimeout((function(){e.widthModal=t?530:650,e.heightModal=t?670:480}),800)},getUserPaymentServices:function(t,e){t&&!e&&this.viewModalEndPeriod()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getVisible:"modalPay/getVisible",getDefaultAccount:"subscribeOrders/getDefaultAccount",getUserPaymentServices:"paymentService/getUserPaymentServices"})),{},{getWrapperAttr:function(){return{class:"vp_payModal"}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({setVisible:"modalPay/setVisible",setPendingStatus:"modalPay/setPendingStatus",setEndPeriodDemoStatus:"modalPay/setEndPeriodDemoStatus",setEndPeriodPayStatus:"modalPay/setEndPeriodPayStatus"})),{},{hiddenHandler:function(){this.setVisible(!1),this.setPendingStatus(!1),this.setEndPeriodDemoStatus(!1),this.setEndPeriodPayStatus(!1),this.visibleFrame=!1},setVisibleFrame:function(t){this.visibleFrame=t},viewModalEndPeriod:function(){if(this.payPeriod){var t,e=(null===(t=this.remainedTime)||void 0===t?void 0:t.days)||0;e<=3&&(this.setEndPeriodPayStatus(!0),this.setVisible(!0))}else if(this.demoPeriod||!this.demoPeriod&&!this.payPeriod){var i,o=(null===(i=this.remainedTime)||void 0===i?void 0:i.days)||0;o<=3&&(this.getEndedPeriod?this.setEndPeriodPayStatus(!0):this.setEndPeriodDemoStatus(!0),this.setVisible(!0))}}})},pF=hF,gF=(i("f989"),i("bca5"),Object(C["a"])(pF,SL,PL,!1,null,"f956230e",null)),fF=gF.exports,mF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ModalPayByInvoices"},[e("DxPopup",{attrs:{"content-template":"content",visible:t.visible,width:t.widthModal,height:t.heightModal,"max-height":"calc(100vh - 16px)",shading:!0,closeOnOutsideClick:!1,showTitle:!1,wrapperAttr:t.getWrapperAttr},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"ModalPayByInvoices-content"},[e("div",{staticClass:"ModalPayByInvoices-heading"},[t._v("Оплата комиссии с дохода"),e("div",{staticClass:"ModalPayByInvoices-close",on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"ModalPayByInvoices-contentWrap"},[e("div",{staticClass:"ModalPayByInvoices-img"},[e("img",{attrs:{src:i("9a91")}})]),e("div",{staticClass:"ModalPayByInvoices-table"},[e("div",{staticClass:"ModalPayByInvoices-tableInvoices"},[e("div",{staticClass:"ModalPayByInvoices-tableInvoices-row"},t._l(t.getTableTitles,(function(i,o){return e("div",{key:o,staticClass:"ModalPayByInvoices-tableInvoices-title"},[t._v(t._s(i.text))])})),0),t._l(t.getTableData,(function(i,o){return e("div",{key:o,staticClass:"ModalPayByInvoices-tableInvoices-row"},[e("div",{staticClass:"ModalPayByInvoices-tableInvoices-data"},[t._v(t._s(i.period)+" ")]),e("div",{staticClass:"ModalPayByInvoices-tableInvoices-data"},[t._v(t._s("".concat(t.getCurrancyChar," ").concat(i.profitByMonth)))]),e("div",{staticClass:"ModalPayByInvoices-tableInvoices-data"},[t._v(t._s("".concat(t.getCurrancyChar," ").concat(i.profit))+" ")])])})),e("div",{staticClass:"ModalPayByInvoices-count"},[t._v(t._s("Итого к оплате: ".concat(t.getCurrancyChar," ").concat(t.getAllFee)))])],2),e("div",{staticClass:"ModalPayByInvoices-payment"},[e("div",{staticClass:"ModalPayByInvoices-payment-title"},[t._v("Инструкция для оплаты")]),e("div",{staticClass:"ModalPayByInvoices-payment-buttons"},[e("div",{staticClass:"ModalPayByInvoices-paymentLink"},[e("img",{attrs:{src:"data:image/png;base64, ".concat(t.getLogoByBit)}}),e("a",{attrs:{href:"https://toptrader.org/ByBit_payment.pdf",target:"_blank"}},[t._v("Для клиентов ByBit")])]),e("div",{staticClass:"ModalPayByInvoices-paymentLink"},[e("img",{attrs:{src:"data:image/png;base64, ".concat(t.getLogoBitGet)}}),e("a",{attrs:{href:"https://toptrader.org/BitGet_payment.pdf",target:"_blank"}},[t._v("Для клиентов BitGet")])])])])])]),e("div",{staticClass:"ModalPayByInvoices-warningMsg"},[e("div",{staticClass:"ModalPayByInvoices-warningMsg-text",style:{color:"red"}},[t._v("При не оплате комиссии, сроком до 7 дней, автоисполнение сигналов будет прекращено")]),e("div",{staticClass:"ModalPayByInvoices-warningMsg-count",style:{color:"red"}},[t._v(t._s(t.getTextCount))])])])]},proxy:!0}])})],1)},vF=[],yF={components:{DxPopup:To["DxPopup"]},data:function(){return{visibleFrame:!1,widthModal:650,heightModal:380,visible:!1}},watch:{getInvoiceBySubscribe:function(t){t&&t.length&&(this.visible=!0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserInvoices:"paymentService/getUserInvoices",getDefaultAccount:"subscribeOrders/getDefaultAccount",getUserPaymentServices:"paymentService/getUserPaymentServices",getServerTime:"serverTime/getServerTime",getBrokers:"brokers/getBrokers"})),{},{getLogoByBit:function(){var t;if(null!==(t=this.getBrokers)&&void 0!==t&&t.length)return this.getBrokers.find((function(t){return"ByBit"===t.name})).logo},getLogoBitGet:function(){var t;if(null!==(t=this.getBrokers)&&void 0!==t&&t.length)return this.getBrokers.find((function(t){return"BitGet"===t.name})).logo},getUserServiceForSubscription:function(){var t,e=this;return null!==(t=this.getUserPaymentServices)&&void 0!==t&&t.length?this.getUserPaymentServices.filter((function(t){return 4===t.serviceId&&t.accountId===e.getDefaultAccount.id})):[]},getInvoiceBySubscribe:function(){var t,e,i=this;if(null!==(t=this.getUserServiceForSubscription)&&void 0!==t&&t.length&&null!==(e=this.getUserInvoices)&&void 0!==e&&e.length)return this.getUserInvoices.filter((function(t){return!t.paymentDateTime&&i.getUserServiceForSubscription.some((function(e){return e.id===t.userServiceId}))})).sort((function(t,e){return new Date(t.createDateTime).getTime()-new Date(e.createDateTime).getTime()}))},getAllFee:function(){var t;if(null!==(t=this.getInvoiceBySubscribe)&&void 0!==t&&t.length)return this.getInvoiceBySubscribe.reduce((function(t,e){return t+e.amount}),0)},getCurrancyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getTextCount:function(){return this.getCountDayPay?this.getCountDayPay.days>7?"Подписка на автоследование отключена":"Осталось ".concat(this.getCountDayPay.days," д. ").concat(this.getCountDayPay.hours," ч."):""},getCountDayPay:function(){var t;if(null!==(t=this.getInvoiceBySubscribe)&&void 0!==t&&t.length){var e=new Date(this.getInvoiceBySubscribe[0].createDateTime).getTime(),i=this.getServerTime?new Date(this.getServerTime.now).getTime():(new Date).getTime(),o=i-e,n=Math.floor(o/1e3/60/60/24),s=Math.floor(o/1e3/60/60)%24;return{days:n,hours:s}}},getTableData:function(){var t,e=this;if(null!==(t=this.getInvoiceBySubscribe)&&void 0!==t&&t.length){var i=[];return this.getInvoiceBySubscribe.forEach((function(t){i.push({period:e.getPeriodInvoice(t.description),profitByMonth:e.$moneyf(100/33*t.amount,2),profit:t.amount})})),i}},getTableTitles:function(){return[{text:"Период"},{text:"Доход"},{text:"Комиссия"}]},getWrapperAttr:function(){return{class:"vp_payModal"}}}),methods:{getPeriodInvoice:function(t){var e=t.split("(")[1].split(" ")[0].split(".");return"".concat(this.$t("mounthArr")[+e[1]-1]," ").concat(e[2])},closeModal:function(){this.visible=!1}}},CF=yF,bF=(i("e8a4"),Object(C["a"])(CF,mF,vF,!1,null,"3c8801b6",null)),SF=bF.exports,PF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamModalForActive",class:"StreamModalForActive_".concat(t.getActiveTheme)},[e("DxPopup",{attrs:{visible:t.visible,shading:!1,fullScreen:t.fullScreen,wrapperAttr:{class:"StreamModalForActive StreamModalForActive_".concat(t.getActiveTheme)},position:t.getPosition,width:t.getSizePopup.width,height:t.getSizePopup.height},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"StreamModalForActive-title StreamModalForActive-title_".concat(t.getActiveTheme)},[e("div",{class:"StreamModalForActive-titleLabel StreamModalForActive-titleLabel_".concat(t.getActiveTheme)},[t._v(t._s(t.titleTv))]),e("div",{staticClass:"StreamModalForActive-titleStreamIcon",style:{color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Stream"}})],1),e("div",{staticClass:"StreamModalForActive-titleControl"},[e("ButtonIconFlat",{attrs:{icon:{name:t.fullScreen?"Full-screen-OFF":"Full-screen-ON"},modifier:{class:["button","button_".concat(t.getActiveTheme)]}},on:{click:t.setFullScreen}}),e("ButtonIconFlat",{attrs:{icon:{name:t.minimazeMode?"Expand":"Unexpand"},modifier:{class:["button","button_".concat(t.getActiveTheme)]}},on:{click:t.setMinimazeMode}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"StreamModalForActive-content",class:"StreamModalForActive-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"StreamModalForActive-contentWrapper"},[e("div",{staticClass:"StreamModalForActive-frame"},[e("iframe",{attrs:{width:"100%",height:"100%",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",src:t.getLinkForStream,allowfullscreen:"",frameborder:"0",iv_load_policy:"3"}})]),e("div",{staticClass:"StreamModalForActive-controls"},[e("div",{staticClass:"StreamModalForActive-timer",class:"StreamModalForActive-timer_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Time"}}),t._v(t._s(t.getTimeStream))],1),e("div",{staticClass:"StreamModalForActive-viewers",class:"StreamModalForActive-viewers_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Show"}}),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s(t.getCrurentWatchers))]),e("span",[t._v(t._s("(".concat(t.getTotalWatchers,")")))])],1),e("div",{staticClass:"StreamModalForActive-viewers",class:"StreamModalForActive-viewers_".concat(t.getActiveTheme),style:{color:t.lastUserAction&&t.lastUserAction.isLike?t.getGreenColor.color:t.getGrayColor.color}},[e("div",{staticClass:"StreamModalForActive-viewers-icon",on:{click:function(e){return t.sendChatMessage("Like")}}},[e("svgIcon",{attrs:{name:"Like"}})],1),t._v(t._s(t.getLikes))]),e("div",{staticClass:"StreamModalForActive-viewers",class:"StreamModalForActive-viewers_".concat(t.getActiveTheme),style:{color:!t.lastUserAction||t.lastUserAction.isLike?t.getGrayColor.color:t.getRedColor.color}},[e("div",{staticClass:"StreamModalForActive-viewers-icon"},[e("svgIcon",{attrs:{name:"Disslike"}})],1),t._v(t._s(t.getDisLikes))]),e("div",{staticClass:"StreamModalForActive-stop"},[e("div",{staticClass:"StreamModalForActive-switchChat",class:"StreamModalForActive-switchChat_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[e("div",{staticClass:"StreamModalForActive-viewers-icon",on:{click:t.openChat}},[t.unReadChatMessage?e("div",{staticClass:"StreamModalForActive-unReadChatMessage",class:"StreamModalForActive-unReadChatMessage_".concat(t.getActiveTheme),style:{background:t.getBlueColor.color}}):t._e(),e("svgIcon",{attrs:{name:"OwnerChat"}})],1)]),e("ButtonIconFlat",{attrs:{icon:{name:"Stop",color:t.getRedColor.color},modifier:{class:["buttonStop","buttonStop_".concat(t.getActiveTheme)]}},on:{click:t.stopingStream}},[t._v("Остановить")])],1)])]),t.chatStatus?e("div",{key:t.updateHistoryKey,staticClass:"StreamModalForActive-chatZone"},[e("VuePerfectScrollbar",{staticClass:"StreamModalForActive-wrapMessages",attrs:{id:"container_".concat(t.idPlayer)}},t._l(t.messages,(function(t,i){return e("StreamChatMessage",{key:i,attrs:{messageData:t}})})),1),e("div",{staticClass:"StreamModalForActive-textArea",class:"StreamModalForActive-textArea_".concat(t.getActiveTheme)},[e("DxTextArea",{attrs:{height:"32px",minHeight:32,maxHeight:64,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,value:t.textMessage,onEnterKey:t.sendMessage,onInput:t.setTextMessage,placeholder:"Write message"}})],1)],1):t._e()])]},proxy:!0}])})],1)},TF=[],xF={props:{visible:{type:Boolean,default:!0}},components:{DxPopup:wt["DxPopup"],DxTextArea:wt["DxTextArea"],StreamChatMessage:lP,VuePerfectScrollbar:Xt.a},mixins:[qe],data:function(){return{fullScreen:!1,minimazeMode:!0,timer:0,infoOnStream:null,lastUserAction:null,chatStatus:!1,unReadChatMessage:!1,textMessage:"",messages:[],updateHistoryKey:null,idPlayer:(new Date).getTime()}},watch:{getServerTime:function(t){t&&(this.timer=new Date(this.getServerTime.now).getTime()-new Date(this.getActiveUserStream.startDateTime).getTime())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime",getUserDetail:"user/getUserDetail",getActiveUserStream:"userStreams/getActiveUserStream",getSubscriptionsOnChat:"userStreams/getSubscriptionsOnChat",getApiStream:"api/apiStream",getSession:"auth/getSession"})),{},{getPosition:function(){return this.minimazeMode||this.fullScreen?{my:"bottom right",at:"bottom right",of:window,offset:{x:-8,y:-370}}:"center"},getCrurentWatchers:function(){return this.infoOnStream?this.infoOnStream.currentWatcher:0},getTotalWatchers:function(){return this.infoOnStream?this.infoOnStream.totalWatcher:0},getLikes:function(){return this.infoOnStream?this.infoOnStream.like:0},getDisLikes:function(){return this.infoOnStream?this.infoOnStream.disLike:0},getTimeStream:function(){return this.getFormatDate(this.timer)},getSizePopup:function(){return this.minimazeMode||this.fullScreen?this.minimazeMode&&!this.fullScreen?{width:this.chatStatus?660:360,height:240}:!this.minimazeMode&&this.fullScreen?{width:"100vw",height:"100vh"}:void 0:{width:this.chatStatus?940:640,height:480}},titleTv:function(){return"Вы в эфире"},srcRutube:function(){var t=/^https?:\/\/(?:www\.)?rutube\.(?:ru)/;if(t.test(this.getActiveUserStream.streamURL)){var e=this.getActiveUserStream.streamURL.split("video/")[1];if(e)return"https://rutube.ru/play/embed/".concat(e,"?autoplay=1")}},srcTwitch:function(){var t=/^https?:\/\/(?:www\.)?twitch\.(?:tv)/;if(t.test(this.getActiveUserStream.streamURL)){var e=this.getActiveUserStream.streamURL.split("/").at(-1);if(e)return"https://player.twitch.tv/?channel=".concat(e,"&parent=").concat("toptrader.ru")}},getLinkForStream:function(){return"YouTube"===this.getActiveUserStream.providerType?this.srcOther:"RuTube"===this.getActiveUserStream.providerType?this.srcRutube:"Twitch"===this.getActiveUserStream.providerType?this.srcTwitch:void 0},srcOther:function(){var t=/^https?:\/\/(?:www\.)?youtube\./;if(t.test(this.getActiveUserStream.streamURL)){var e=this.getActiveUserStream.streamURL.split("v=")[1],i=this.getActiveUserStream.streamURL.split("live/")[1];if(e){var o=e.indexOf("&");return-1!=o&&(e=e.substring(0,o)),"https://www.youtube.com/embed/".concat(e,"?autoplay=1")}if(i){var n=i.indexOf("?");return-1!=n&&(i=i.substring(0,n)),"https://www.youtube.com/embed/".concat(i,"?autoplay=1")}}}}),methods:{stopingStream:function(){var t=this,e={providerType:this.getActiveUserStream.providerType,id:this.getActiveUserStream.streamId};this.$http({method:"PUT",url:"".concat(this.getApiStream,"Stream/stop"),data:e}).then((function(){t.unSubscribeUpdateStreamInfo(),t.disconnectToChat(),t.$store.commit("userStreams/setUserActiveStream",null)}))},setTextMessage:function(t){"insertLineBreak"!==t.event.inputType&&(this.textMessage=t.event.target.value)},sendMessage:function(){this.textMessage&&(this.$socketStream.sendCommand({ws:"streamChatWS",command:{Command:"ChatMessage",StreamId:this.getActiveUserStream.streamId,Data:{SenderFIO:"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName),Message:this.textMessage,AvatarURL:this.getUserDetail.avatarURL,UserId:this.getUserDetail.id,IsStreamer:!0}}}),this.textMessage="")},joinToChat:function(){var t=this;if(!this.getSubscriptionsOnChat.length||!this.getSubscriptionsOnChat.some((function(e){return e===t.getActiveUserStream.streamId}))){this.$store.commit("userStreams/addSubscriptionOnChat",this.getActiveUserStream.streamId);var e={Command:"Join",streamId:this.getActiveUserStream.streamId};this.$socketStream.sendCommand({ws:"streamChatWS",command:e})}},disconnectToChat:function(){this.$store.commit("userStreams/removeSubscriptionOnChat",this.getActiveUserStream.streamId);var t={Command:"Disconnect",streamId:this.getActiveUserStream.streamId};this.$socketStream.sendCommand({ws:"streamChatWS",command:t})},openChat:function(){this.chatStatus=!this.chatStatus},unSubscribeUpdateStreamInfo:function(){var t={Command:"ActiveStreamInfoUnSubscribe",streamId:this.getActiveUserStream.streamId};this.$socketStream.sendCommand({ws:"streamWS",command:t})},sendChatMessage:function(t){var e={Command:"ChatMessage",StreamId:this.getActiveUserStream.streamId,Data:{SenderFIO:"".concat(this.getActiveUserStream.firstName," ").concat(this.getActiveUserStream.lastName),Message:t,AvatarURL:this.getActiveUserStream.avatarURL,UserId:this.getActiveUserStream.userId,IsStreamer:!0}};this.$socketStream.sendCommand({ws:"streamChatWS",command:e})},subscribeUpdateStreamInfo:function(){var t={Command:"ActiveStreamInfoSubscribe",streamId:this.getActiveUserStream.streamId};this.$socketStream.sendCommand({ws:"streamWS",command:t})},getMetaInfoForStream:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={id:t.getActiveUserStream.streamId,userId:t.getActiveUserStream.userId},e.next=3,t.$http.post("".concat(t.getApiStream,"GetActiveStreamInfo"),JSON.stringify(i),{headers:{"Content-Type":"application/json"}}).then((function(e){t.infoOnStream=e.data,t.lastUserAction=e.data.lastUserAction}));case 3:case"end":return e.stop()}}),e)})))()},getFormatDate:function(t){var e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o)).concat(this.$t("d")," ").concat(Math.floor(o%1*24)).concat(this.$t("h"),"."):Math.floor(i)>=1?"".concat(Math.floor(i)).concat(this.$t("h"),"."):Math.floor(e)>=1?"".concat(Math.floor(e)).concat(this.$t("м")):"".concat(0,this.$t("м"));return n},setFullScreen:function(){this.fullScreen=!this.fullScreen,this.minimazeMode&&(this.minimazeMode=!1)},setMinimazeMode:function(){this.minimazeMode=!this.minimazeMode,this.fullScreen&&(this.fullScreen=!1)},setMessageHendler:function(t){var e=this;"ActiveStreamInfoSubscribe"===(null===t||void 0===t?void 0:t.command)?this.getActiveUserStream.streamId===t.data.streamId&&(this.infoOnStream=t.data.stat):"ChatMessage"===t.command&&t.streamId===this.getActiveUserStream.streamId&&(this.messages.push(t.data),this.chatStatus||(this.unReadChatMessage=!0),this.updateHistoryKey=(new Date).getTime(),this.$nextTick((function(){var t=document.querySelector("#container_".concat(e.idPlayer));t.scrollTop=t.scrollHeight})))}},mounted:function(){this.getMetaInfoForStream(),this.subscribeUpdateStreamInfo(),this.joinToChat(),this.$socketStream.events.subscribe("streamWS",this.setMessageHendler),this.$socketStream.events.subscribe("streamChatWS",this.setMessageHendler),this.getServerTime&&(this.timer=new Date(this.getServerTime.now).getTime()-new Date(this.getActiveUserStream.startDateTime).getTime())},destroyed:function(){this.$socketStream.events.unsubscribe("streamWS",this.setMessageHendler),this.$socketStream.events.unsubscribe("streamChatWS",this.setMessageHendler)}},OF=xF,wF=(i("c6efb"),Object(C["a"])(OF,PF,TF,!1,null,"9662db28",null)),_F=wF.exports,AF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamFramePlayer"},[e("DxPopup",{ref:t.idPlayer,attrs:{visible:t.visible,shading:!1,fullScreen:t.fullScreen,wrapperAttr:{class:"StreamFramePlayer StreamFramePlayer_".concat(t.getActiveTheme)},position:t.getPosition,width:t.getSizePopup.width,resizeEnabled:!0,height:t.getSizePopup.height,restorePosition:!1,minWidth:"360px",minHeight:"360px"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"StreamFramePlayer-title StreamFramePlayer-title_".concat(t.getActiveTheme),on:{click:t.focusPopup}},[t._l(t.getStreamsTabs,(function(i,o){return e("div",{key:o,staticClass:"StreamFramePlayer-autorAvatar",class:o===t.activeIndexTab?"StreamFramePlayer-autorAvatar_isActive_".concat(t.getActiveTheme):"StreamFramePlayer-autorAvatar_".concat(t.getActiveTheme),on:{click:function(e){return t.setActiveStream(o)}}},[e("Avatar",{attrs:{src:i.avatarURL?i.avatarURL:i.hostedLogo,theme:t.getActiveTheme,size:"2.7",color:i.isActive?t.getRedColor.color:t.getBlueColor.color}})],1)})),e("div",{staticClass:"StreamFramePlayer-titleControl"},[e("ButtonIconFlat",{attrs:{icon:{name:t.fullScreen?"Full-screen-OFF":"Full-screen-ON"},modifier:{class:["button","button_".concat(t.getActiveTheme)]}},on:{click:t.setFullScreen}}),e("ButtonIconFlat",{attrs:{icon:{name:t.minimazeMode?"Expand":"Unexpand"},modifier:{class:["button","button_".concat(t.getActiveTheme)]}},on:{click:t.setMinimazeMode}}),e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["button","button_".concat(t.getActiveTheme)]}},on:{click:t.closePopup}})],1)],2)]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"StreamFramePlayer-content",class:"StreamFramePlayer-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"StreamFramePlayer-contentWrapper"},[t.status?e("div",{staticClass:"StreamFramePlayer-contentWrap"},[t.getActiveStream.isActive?e("div",{staticClass:"StreamFramePlayer-frame"},[e("iframe",{key:t.activeIndexTab,attrs:{width:"100%",height:"100%",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",src:t.getLinkForStream,allowfullscreen:"",frameborder:"0",iv_load_policy:"3"}})]):e("div",{staticClass:"StreamFramePlayer-streamPreview"},[e("img",{attrs:{src:t.getActiveStream.hostedLogo}})]),e("div",{staticClass:"StreamFramePlayer-metaInfo"},[e("div",{staticClass:"StreamFramePlayer-streamName",class:"StreamFramePlayer-streamName_".concat(t.getActiveTheme)},[t._v(t._s(t.getActiveStream.name))]),t.getActiveStream.isActive?e("div",{staticClass:"StreamFramePlayer-controls"},[e("div",{staticClass:"StreamFramePlayer-timer",class:"StreamFramePlayer-timer_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Time"}}),t._v(t._s(t.getTimeStream))],1),e("div",{staticClass:"StreamFramePlayer-viewers",class:"StreamFramePlayer-viewers_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Show"}}),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s(t.getCrurentWatchers))]),e("span",[t._v(t._s("(".concat(t.getTotalWatchers,")")))])],1),e("div",{staticClass:"StreamFramePlayer-viewers",class:"StreamFramePlayer-viewers_".concat(t.getActiveTheme),style:{color:t.lastUserAction&&t.lastUserAction.isLike?t.getGreenColor.color:t.getGrayColor.color}},[e("div",{staticClass:"StreamFramePlayer-viewers-icon",on:{click:function(e){return t.setReaction(!0)}}},[e("svgIcon",{attrs:{name:"Like"}})],1),t._v(t._s(t.getLikes))]),e("div",{staticClass:"StreamFramePlayer-viewers",class:"StreamFramePlayer-viewers_".concat(t.getActiveTheme),style:{color:!t.lastUserAction||t.lastUserAction.isLike?t.getGrayColor.color:t.getRedColor.color}},[e("div",{staticClass:"StreamFramePlayer-viewers-icon",on:{click:function(e){return t.setReaction(!1)}}},[e("svgIcon",{attrs:{name:"Disslike"}})],1),t._v(t._s(t.getDisLikes))]),e("div",{staticClass:"StreamFramePlayer-switchChat",class:"StreamFramePlayer-switchChat_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[e("div",{staticClass:"StreamFramePlayer-viewers-icon",on:{click:t.openChat}},[t.unReadChatMessage?e("div",{staticClass:"StreamFramePlayer-unReadChatMessage",class:"StreamFramePlayer-unReadChatMessage_".concat(t.getActiveTheme),style:{background:t.getBlueColor.color}}):t._e(),e("svgIcon",{attrs:{name:"OwnerChat"}})],1)])]):e("div",{staticClass:"StreamFramePlayer-controls"},[e("div",{staticClass:"StreamFramePlayer-timer",class:"StreamFramePlayer-timer_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Time"}}),t._v(t._s("".concat(t.getBeginDate)))],1)])])]):t._e(),e("div",{staticClass:"StreamFramePlayer-streamStatus",class:"StreamFramePlayer-streamStatus_".concat(t.getActiveTheme),style:{background:t.getActiveStream.isActive?t.getRedColor.color:t.getBlueColor.color}},[t.lastMessage?e("div",{staticClass:"StreamFramePlayer-lastMesage"},[e("div",{staticClass:"StreamFramePlayer-lastMesage-avatar"},[e("Avatar",{attrs:{src:t.lastMessage.avatarURL,theme:t.getActiveTheme,size:"2.7"}})],1),e("div",{staticClass:"StreamFramePlayer-lastMesage-text"},[t._v(t._s(t.lastMessage.message)+" ")])]):t._e(),t.lastMessage?t._e():e("div",{staticClass:"StreamFramePlayer-streamStatus-text"},[t._v(t._s(t.getActiveStream.isActive?"Идёт трансляция ".concat(t.getStreamAuthor):"Трансляция от ".concat(t.getStreamAuthor)))])])]),t.chatStatus?e("div",{key:t.updateHistoryKey,staticClass:"StreamFramePlayer-chatZone"},[e("VuePerfectScrollbar",{staticClass:"StreamFramePlayer-wrapMessages",attrs:{id:"container_".concat(t.idPlayer)}},t._l(t.getActiveStream.messages,(function(t,i){return e("StreamChatMessage",{key:i,attrs:{messageData:t}})})),1),e("div",{staticClass:"StreamFramePlayer-textArea",class:"StreamFramePlayer-textArea_".concat(t.getActiveTheme)},[e("DxTextArea",{attrs:{height:"32px",minHeight:32,maxHeight:64,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,value:t.textMessage,onEnterKey:t.sendMessage,onInput:t.setTextMessage,placeholder:"Write message"}})],1)],1):t._e()])]},proxy:!0}])})],1)},DF=[],kF={props:{visible:{type:Boolean,default:!0},streams:{type:[Array,null]},status:{default:!1},mode:{type:String,default:"center"},position:{default:function(){return{my:"bottom right",at:"bottom right",of:window,offset:{x:-8,y:-8}}}},idPlayer:{default:(new Date).getTime()}},components:{DxPopup:wt["DxPopup"],DxTextArea:wt["DxTextArea"],VuePerfectScrollbar:Xt.a,Avatar:E,StreamChatMessage:lP},mixins:[qe,Xh],data:function(){return{fullScreen:!1,minimazeMode:!1,timer:0,infoOnStream:null,lastUserAction:null,chatStatus:!1,textMessage:"",updateHistoryKey:null,activeIndexTab:0,unReadChatMessage:!1,lastMessage:null}},watch:{getActiveStream:function(t){t&&(this.timer=new Date(this.getServerTime.now).getTime()-new Date(t.startDateTime).getTime(),this.getMetaInfoForStream(),this.subscribeUpdateStreamInfo(),this.playStream(),t.messages.length&&!this.chatStatus&&(this.unReadChatMessage=!0))},status:function(t){t||(this.disconnectToChat(),this.unSubscribeUpdateStreamInfo())},chatStatus:function(t){t&&(this.unReadChatMessage=!1,this.getActiveStream.messages.length&&this.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight})))},getServerTime:function(t){this.playStream(),t&&(this.timer=new Date(this.getServerTime.now).getTime()-new Date(this.getActiveStream.startDateTime).getTime())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getUserDetail:"user/getUserDetail",getApiStream:"api/apiStream",getSession:"auth/getSession",getSubscriptionsOnChat:"userStreams/getSubscriptionsOnChat",getUserSettings:"userSettings/getUserSettings",getPlayersStreams:"userStreams/getPlayersStreams",getServerTime:"serverTime/getServerTime"})),{},{getHistory:function(){return[]},getBeginDate:function(){var t;return"".concat(this.$t("started")," ").concat(new Date(new Date(this.getActiveStream.calendarDateTime)-6e4*(new Date).getTimezoneOffset()).toLocaleString(null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}))},getCrurentWatchers:function(){return this.infoOnStream?this.infoOnStream.currentWatcher:0},getTotalWatchers:function(){return this.infoOnStream?this.infoOnStream.totalWatcher:0},getLikes:function(){return this.infoOnStream?this.infoOnStream.like:0},getDisLikes:function(){return this.infoOnStream?this.infoOnStream.disLike:0},getElementPopup:function(){return this.$refs[this.idPlayer].instance},getStreamAuthor:function(){return this.getActiveStream.firstName&&this.getActiveStream.lastName?"".concat(this.getActiveStream.firstName," ").concat(this.getActiveStream.lastName):this.getActiveStream.name},getActiveStream:function(){return this.getStreamsTabs[this.activeIndexTab]},getStreamsTabs:function(){return this.streams.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{messages:[]})}))},getPosition:function(){return this.minimazeMode||this.fullScreen?this.position:"center"},getTimeStream:function(){return this.getFormatDate(this.timer)},getSizePopup:function(){return this.minimazeMode||this.fullScreen?this.minimazeMode&&!this.fullScreen?{width:this.chatStatus?660:360,height:240}:!this.minimazeMode&&this.fullScreen?{width:"100vw",height:"100vh"}:void 0:{width:this.chatStatus?940:640,height:480}},titleTv:function(){return this.getActiveStream.name},srcRutube:function(){var t=/^https?:\/\/(?:www\.)?rutube\.(?:ru)/;if(t.test(this.getActiveStream.streamURL)){var e=this.getActiveStream.streamURL.split("video/")[1];if(e)return"https://rutube.ru/play/embed/".concat(e,"?autoplay=1")}},srcTwitch:function(){var t=/^https?:\/\/(?:www\.)?twitch\.(?:tv)/;if(t.test(this.getActiveStream.streamURL)){var e=this.getActiveStream.streamURL.split("/").at(-1);if(e)return"https://player.twitch.tv/?channel=".concat(e,"&parent=").concat("toptrader.ru")}},getLinkForStream:function(){if(this.getActiveStream)return"YouTube"===this.getActiveStream.providerType?this.srcOther:"RuTube"===this.getActiveStream.providerType?this.srcRutube:"Twitch"===this.getActiveStream.providerType?this.srcTwitch:void 0},srcOther:function(){var t=/^https?:\/\/(?:www\.)?youtube\./;if(t.test(this.getActiveStream.streamURL)){var e=this.getActiveStream.streamURL.split("v=")[1],i=this.getActiveStream.streamURL.split("live/")[1];if(e){var o=e.indexOf("&");return-1!=o&&(e=e.substring(0,o)),"https://www.youtube.com/embed/".concat(e,"?autoplay=1")}if(i){var n=i.indexOf("?");return-1!=n&&(i=i.substring(0,n)),"https://www.youtube.com/embed/".concat(i,"?autoplay=1")}}}}),methods:{sendMessage:function(){this.textMessage&&(this.$socketStream.sendCommand({ws:"streamChatWS",command:{Command:"ChatMessage",StreamId:this.getActiveStream.streamId,Data:{SenderFIO:"".concat(this.getUserDetail.firstName," ").concat(this.getUserDetail.lastName),Message:this.textMessage,AvatarURL:this.getUserDetail.avatarURL,UserId:this.getUserDetail.id,IsStreamer:this.getActiveStream.userId===this.getUserDetail.id}}}),this.textMessage="")},setTextMessage:function(t){"insertLineBreak"!==t.event.inputType&&(this.textMessage=t.event.target.value)},openChat:function(){this.chatStatus=!this.chatStatus},closePopup:function(){this.$store.commit("userStreams/deletePlayerStream",this.idPlayer),this.getElementPopup.hide()},focusPopup:function(){var t=this.getElementPopup.option("animation");this.getElementPopup.option("animation",null),this.getElementPopup.hide(),this.getElementPopup.show(),this.getElementPopup.option("animation",t)},setMessageHendler:function(t){var e=this;"ActiveStreamInfoSubscribe"===(null===t||void 0===t?void 0:t.command)?this.getActiveStream.streamId===t.data.streamId&&this.status&&(this.infoOnStream=t.data.stat,this.lastUserAction=t.data.stat.lastUserAction):"ChatMessage"===t.command&&t.streamId===this.getActiveStream.streamId&&(this.getActiveStream.messages.push(t.data),this.chatStatus||(this.lastMessage=t.data,this.debouncer("clearLastMessage",15e3),this.unReadChatMessage=!0),this.updateHistoryKey=(new Date).getTime(),this.$nextTick((function(){var t=document.querySelector("#container_".concat(e.idPlayer));t.scrollTop=t.scrollHeight})))},clearLastMessage:function(){this.lastMessage=null},subscribeUpdateStreamInfo:function(){var t={Command:"ActiveStreamInfoSubscribe",streamId:this.getActiveStream.streamId};this.$socketStream.sendCommand({ws:"streamWS",command:t})},disconnectToChat:function(){var t=this,e=this.getPlayersStreams.filter((function(t){return t.status})),i=[];e.length&&e.forEach((function(t){t.streams.forEach((function(t){i.push(t.streamId)}))})),this.streams.forEach((function(e){if(!i.some((function(t){return t===e.streamId}))){t.$store.commit("userStreams/removeSubscriptionOnChat",e.streamId);var o={Command:"Disconnect",streamId:e.streamId};t.$socketStream.sendCommand({ws:"streamChatWS",command:o})}}))},joinToChat:function(){var t=this;this.streams.forEach((function(e){if(!t.getSubscriptionsOnChat.length||!t.getSubscriptionsOnChat.some((function(t){return t===e.streamId}))){t.$store.commit("userStreams/addSubscriptionOnChat",e.streamId);var i={Command:"Join",streamId:e.streamId};t.$socketStream.sendCommand({ws:"streamChatWS",command:i})}}))},unSubscribeUpdateStreamInfo:function(){var t={Command:"ActiveStreamInfoUnSubscribe",streamId:this.getActiveStream.streamId};this.$socketStream.sendCommand({ws:"streamWS",command:t})},setReaction:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=JSON.stringify({id:e.getActiveStream.streamId,isLike:t}),i.next=3,e.$workKeys.signMessage(o,e.getSession.sk);case 3:return n=i.sent,i.next=6,e.$http.post("".concat(e.getApiStream,"SetLikeStream"),o,{headers:{"X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n,"Content-Type":"application/json"}}).then((function(t){e.infoOnStream=t.data,e.lastUserAction=t.data.lastUserAction}));case 6:case"end":return i.stop()}}),i)})))()},getMetaInfoForStream:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={id:t.getActiveStream.streamId,userId:t.getUserDetail.id},e.next=3,t.$http.post("".concat(t.getApiStream,"GetActiveStreamInfo"),JSON.stringify(i),{headers:{"Content-Type":"application/json"}}).then((function(e){t.infoOnStream=e.data,t.lastUserAction=e.data.lastUserAction}));case 3:case"end":return e.stop()}}),e)})))()},playStream:function(){if(this.status){var t={Command:"PlayStream",streamId:this.getActiveStream.streamId,data:{userId:this.getUserDetail.id}};this.$socketStream.sendCommand({ws:"streamWS",command:t})}},setActiveStream:function(t){this.activeIndexTab=t},getFormatDate:function(t){var e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o)).concat(this.$t("d")," ").concat(Math.floor(o%1*24)).concat(this.$t("h"),"."):Math.floor(i)>=1?"".concat(Math.floor(i)).concat(this.$t("h"),"."):Math.floor(e)>=1?"".concat(Math.floor(e)).concat(this.$t("м")):"".concat(0,this.$t("м"));return n},setFullScreen:function(){this.fullScreen=!this.fullScreen,this.minimazeMode&&(this.minimazeMode=!1)},setMinimazeMode:function(){this.minimazeMode=!this.minimazeMode,this.fullScreen&&(this.fullScreen=!1)}},mounted:function(){this.$socketStream.events.subscribe("streamWS",this.setMessageHendler),this.$socketStream.events.subscribe("streamChatWS",this.setMessageHendler),this.joinToChat(),this.activeIndexTab=0,this.activeIndexTab||(this.getMetaInfoForStream(),this.subscribeUpdateStreamInfo(),this.playStream()),"minimaze"===this.mode&&(this.minimazeMode=!0),this.getServerTime&&(this.timer=new Date(this.getServerTime.now).getTime()-new Date(this.getActiveStream.startDateTime).getTime())},destroyed:function(){this.unSubscribeUpdateStreamInfo(),this.disconnectToChat(),this.$socketStream.events.unsubscribe("streamWS",this.setMessageHendler),this.$socketStream.events.unsubscribe("streamChatWS",this.setMessageHendler)}},IF=kF,BF=(i("274d"),Object(C["a"])(IF,AF,DF,!1,null,"3612cb22",null)),MF=BF.exports,$F=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ModalReports"},t._l(t.modalList,(function(i){return e("DxPopup",{key:i.id,attrs:{minWidth:"900",width:"75vw",height:"75vh",minHeight:"520",visible:i.visible,closeOnOutsideClick:!1,shading:!0,shadingColor:"dark"===t.getActiveTheme?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.5)","content-template":"content","title-template":"title"},scopedSlots:t._u([{key:"title",fn:function(){return[e("HeaderModal",{attrs:{dataReport:i.data}})]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"ModalReports-content",class:"ModalReports-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"ModalReports-contentChart"},[e("Graph",{attrs:{dataReport:i.data}})],1),e("div",{staticClass:"ModalReports-contentGistogram"},[e("Gistogramm",{attrs:{dataReport:i.data}})],1)])]},proxy:!0}],null,!0)})})),1)},LF=[],FF=function(){var t=this,e=t._self._c;return t.getDataForHeader?e("div",{staticClass:"HeaderModal",class:"HeaderModal_".concat(t.getActiveTheme)},[e("div",{staticClass:"HeaderModal-dragIcon",class:"HeaderModal-dragIcon_".concat(t.getActiveTheme)},[e("svgIcon",t._b({},"svgIcon",t.iconDrag,!1))],1),t._l(t.getDataForHeader,(function(i,o){return e("div",{key:o,staticClass:"HeaderModal-dataContainer",class:"HeaderModal-dataContainer_".concat(t.getActiveTheme),style:{background:i.background}},[e("div",{staticClass:"HeaderModal-dataContainer-title"},[e("div",{staticClass:"HeaderModal-dataContainer-titleText",class:"HeaderModal-dataContainer-titleText_".concat(t.getActiveTheme)},[t._v(t._s(i.title))])]),e("div",{staticClass:"HeaderModal-dataContainer-data",style:{color:i.color}},[t._v(t._s(i.data))])])})),e("div",{staticClass:"HeaderModal-closeIcon"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["HeaderModal-close","HeaderModal-close_".concat(t.getActiveTheme)]}},on:{click:t.closeModal}})],1)],2):t._e()},jF=[],RF={name:"HeaderModal",mixins:[qe],props:{dataReport:{type:Object}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getEquityOpenPeriod:function(){if(!this.getDataPeriod)return 0;var t=this.getDataPeriod.EquityOpen?this.getDataPeriod.EquityOpen:this.getDataPeriod.MoneyChart[0].Y2;return t},getProfitOnPeriod:function(){return this.getDataPeriod?this.getDataPeriod.Equity-this.getEquityOpenPeriod:0},getProfitOnPeriodPercent:function(){return this.getDataPeriod&&this.getProfitOnPeriod?100*this.getProfitOnPeriod/this.getEquityOpenPeriod:0},getTitlePeriod:function(){var t={day:this.datePeriod,week:"".concat(this.datePeriod," неделя"),month:this.datePeriod};return t[this.getPeriod]},getDataForHeader:function(){if(this.getDataPeriod)return[{title:this.$t("report_for"),data:this.getTitlePeriod,color:"#333",background:"#FFE600"},{title:this.$t("balance"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getDataPeriod.Balance)),color:this.getBlueColor.color,background:this.getBlueColor.fill},{title:this.$t("equity"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getDataPeriod.Equity)),color:this.getGreenColor.color,background:this.getGreenColor.fill},{title:"PnL",data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getProfitOnPeriod)),color:this.getProfitOnPeriod>=0?this.getGreenColor.color:this.getRedColor.color,background:this.getProfitOnPeriod>=0?this.getGreenColor.fill:this.getRedColor.fill},{title:"".concat(this.getTextPercentPl," %"),data:"".concat(this.$moneyf(this.getProfitOnPeriodPercent),"%"),color:this.getProfitOnPeriodPercent<0?this.getRedColor.color:this.getGreenColor.color,background:this.getProfitOnPeriodPercent<0?this.getRedColor.fill:this.getGreenColor.fill}]},getPeriod:function(){if(this.dataReport)return 0===this.dataReport.data.DataType?"day":1===this.dataReport.data.DataType?"week":2===this.dataReport.data.DataType?"month":void 0},getTextPercentPl:function(){if(this.getPeriod){var t={day:this.$t("daily_gain"),week:this.$t("weekly_growth"),month:this.$t("growth_per_month")};return t[this.getPeriod]}},iconDrag:function(){return{name:"Drag",color:"#8c8c8c"}},getDataPeriod:function(){if(this.dataReport)return this.dataReport.data},datePeriod:function(){var t;if(!this.getDataPeriod||null===(t=this.getDataPeriod)||void 0===t||!t.MoneyChart.length)return"";var e={day:"Отчет за ".concat(new Date(this.getDataPeriod.ReportByPeriod).toLocaleDateString("ru")),week:"Отчет за ".concat(this.getDataPeriod.ReportByPeriod," неделю"),month:"Отчет за ".concat(this.$t("mounthArr")[this.getDataPeriod.ReportByPeriod-1]," ").concat(new Date(this.getDataPeriod.MoneyChart[0].X).getFullYear())};return e[this.getPeriod]}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["d"])({setVisibleDay:"reportsModal/setVisibleDay",setVisibleWeek:"reportsModal/setVisibleWeek",setVisibleMonth:"reportsModal/setVisibleMonth"})),{},{closeModal:function(){switch(this.getDataPeriod.DataType){case 0:this.setVisibleDay(!1);break;case 1:this.setVisibleWeek(!1);break;default:this.setVisibleMonth(!1)}this.$store.dispatch("notifications/saveNotificationHistory",[this.dataReport])}})},WF=RF,NF=(i("7ca3"),Object(C["a"])(WF,FF,jF,!1,null,"782e2c4d",null)),EF=NF.exports,UF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Report"},[e("div",{staticClass:"contentReport"},[e("div",{staticClass:"wrapper"},t._l(t.listData,(function(i,o){return e("div",{key:o,staticClass:"item"},[e("div",{staticClass:"title"},[t._v(t._s(i.title))]),e("div",{staticClass:"value",class:i.dopClass},[t._v(t._s(i.value))])])})),0)])])},VF=[],HF={name:"Report",mixins:[],props:{dataReport:{type:Object},index:{type:Number}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{dataPeriod:function(){var t;if(this.dataReport)return null===(t=this.dataReport)||void 0===t?void 0:t.data},financialResult:function(){if(!this.dataPeriod)return{};var t=Lm(this.dataPeriod.CurrentProfitMoney,2,!0),e=Lm(this.dataPeriod.CurrentProfitProc,2,!0);return Math.abs(e)<.001&&(e=e<0?-.001:.001),{value:"$ ".concat(t," (").concat(e,"%) (0 pip)"),dopClass:this.dataPeriod.CurrentProfitMoney<0?"red":"green"}},listData:function(){return this.dataPeriod?[{title:"Всего открытых ордеров",value:this.dataPeriod.TotalOpenOrders,dopClass:""},{title:"Открытых ордеров",value:this.dataPeriod.OpenOrders,dopClass:""},{title:"Закрытых ордеров",value:this.dataPeriod.CloseOrders,dopClass:""},{title:"Размещенных лимитных ордеров",value:this.dataPeriod.PendingOrders,dopClass:""},{title:"Финансовый результат",value:this.financialResult.value,dopClass:this.financialResult.dopClass},{title:"Баланс",value:"$ "+Lm(this.dataPeriod.Balance,2,!0),dopClass:"green"},{title:"Средства",value:"$ "+Lm(this.dataPeriod.Equity,2,!0),dopClass:"green"},{title:"DD",value:Lm(this.dataPeriod.DD,2,!0),dopClass:""},{title:"Успешных сделок",value:Lm(this.dataPeriod.SuccessProc,1,!0)+"%",dopClass:"green"},{title:"Кредитное плечо",value:Lm(this.dataPeriod.Leverage,2,!0),dopClass:"red"}]:[]},iconClose:function(){return{name:"Close",color:"#8c8c8c"}}}),destroyed:function(){},methods:{hiddenHandler:function(){this.$store.commit("reportsModal/setVisible",!1)}}},GF=HF,qF=(i("0049"),Object(C["a"])(GF,UF,VF,!1,null,"b53a7362",null)),zF=qF.exports,YF=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Graph",class:"Graph_".concat(t.getActiveTheme)},[t.points?e("SectorLineEventChart",{attrs:{typeXAxis:t.getPeriod,points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,watermark:t.getTextWaterMark,watermarkData:t.getDatePeriod,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e(),e("div",{class:"Graph-statData Graph-statData_".concat(t.getActiveTheme)},[t.getCurrentProfit?e("div",{class:"Graph-currentProfit Graph-currentProfit_".concat(t.getActiveTheme),style:{color:t.getCurrentProfit.data[0]<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"Graph-currentProfit-arrow"},[e("div",[e("svgIcon",{attrs:{name:t.getCurrentProfit.data[0]<0?"Arrow_down_direct":"Arrow_up_direct"}})],1)]),e("div",{staticClass:"Graph-currentProfit-data",class:"Graph-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getCurrentProfit.data[0],2)," / ").concat(t.$moneyf(t.getCurrentProfit.data[1],Math.abs(t.getCurrentProfit.data[1])<.01?5:3)," %")))]),e("div",{staticClass:"Graph-currentProfit-title",class:"Graph-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"Graph-currentProfit-text",class:"Graph-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(t.getCurrentProfit.text))])])]):t._e()])],1)},XF=[],QF=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrapper",staticClass:"lineEventChart"},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__fadeIn",appear:""}},[e("div",{staticClass:"lineEventChart-wrap"},[e("div",{staticClass:"lineEventChart-row"},[e("div",{staticClass:"lineEventChart-mainCanvas"},[e("canvas",{ref:"mainCanvas",attrs:{tabindex:"1"}})]),e("div",{staticClass:"lineEventChart-yCanvas",style:{width:t.widthYaxis,background:"light"===t.theme?"#fff":"#151924"}},[e("canvas",{ref:"yCanvas"})])]),e("div",{staticClass:"lineEventChart-row"},[e("div",{staticClass:"lineEventChart-xCanvas"},[e("canvas",{ref:"xCanvas"})]),e("div",{staticClass:"lineEventChart-control",style:{minWidth:t.widthYaxis}},[t._l(t.metaInfoForLines,(function(i,o){return e("div",{key:o,ref:"lineEventChart-legend_".concat(o),refInFor:!0,staticClass:"lineEventChart-legend",class:"lineEventChart-legend_".concat(o),style:{background:i.color},on:{mouseenter:function(e){return t.showTooltip(e,o)},mouseleave:function(e){return t.hideTooltip(o)}}})})),e("DxTooltip",{attrs:{showEvent:"mouseenter",visible:!!t.targetTooltip,position:"top",container:".app",wrapperAttr:{class:"lineEventChart"},width:"auto",height:"auto",target:t.targetTooltip},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{class:"lineEventChar-legendTooltip lineEventChar-legendTooltip_".concat(t.theme),style:{padding:"0.4rem",display:"flex",alignItems:"center",borderRadius:"0.4rem"}},[t._v(t._s(t.metaInfoForLines[t.activeIndexTooltip].title))])]},proxy:!0}])})],2)])])])],1)},JF=[],KF=(i("71b4"),new WeakMap),ZF=new WeakMap,tj=new WeakMap,ej=new WeakMap,ij=new WeakSet,oj=new WeakSet,nj=new WeakSet,sj=new WeakSet,rj=new WeakSet,aj=new WeakSet,cj=new WeakSet,lj=new WeakSet,uj=new WeakSet,dj=new WeakSet,hj=new WeakSet,pj=new WeakSet,gj=new WeakSet,fj=new WeakSet,mj=new WeakSet,vj=function(){function t(){Object(Qh["a"])(this,t),Object(MA["a"])(this,mj),Object(MA["a"])(this,fj),Object(MA["a"])(this,gj),Object(MA["a"])(this,pj),Object(MA["a"])(this,hj),Object(MA["a"])(this,dj),Object(MA["a"])(this,uj),Object(MA["a"])(this,lj),Object(MA["a"])(this,cj),Object(MA["a"])(this,aj),Object(MA["a"])(this,rj),Object(MA["a"])(this,sj),Object(MA["a"])(this,nj),Object(MA["a"])(this,oj),Object(MA["a"])(this,ij),Object(BA["a"])(this,KF,{writable:!0,value:void 0}),Object(BA["a"])(this,ZF,{writable:!0,value:void 0}),Object(BA["a"])(this,tj,{writable:!0,value:void 0}),Object(BA["a"])(this,ej,{writable:!0,value:void 0}),this.dpr=window.devicePixelRatio,this.pointUtils=new PD,this.exchanges=[{title:"Sydney",openTime:1},{title:"ТОКИО",openTime:2},{title:"ФРАНКФУРТ",openTime:11},{title:"ЛОНДОН",openTime:12},{title:"НЬЮ-ЙОРК",openTime:16}]}return Object(Jh["a"])(t,[{key:"setWidgetContext",value:function(t){this.wctx=t;var e=t.chartCanvas.getContext("2d");if(!e)throw new Error("Canvas 2D context not available.");this.ctx=e}},{key:"resize",value:function(t,e){var i=this.wctx;this.newCanvasWidth==t&&this.newCanvasHeight==e||(this.newCanvasWidth=t,this.newCanvasHeight=e,i.requestRefresh())}},{key:"paint",value:function(){var t=this.wctx;t.eState.watermark&&Object($A["a"])(this,oj,Cj).call(this),t.eState.watermarkData&&Object($A["a"])(this,ij,yj).call(this),t.eState.dayExchengeIndicator&&Object($A["a"])(this,uj,wj).call(this),Object($A["a"])(this,fj,Ij).call(this),Object($A["a"])(this,gj,kj).call(this),Object($A["a"])(this,hj,Aj).call(this),t.eState.maxLineIndicator&&Object($A["a"])(this,dj,_j).call(this),t.eState.minLineIndicator&&Object($A["a"])(this,lj,Oj).call(this),Object($A["a"])(this,sj,Sj).call(this),Object($A["a"])(this,aj,Tj).call(this),"object"===Object(QD["a"])(t.eState.currentPoint)&&Object($A["a"])(this,rj,Pj).call(this),t.eState.tabPoint&&Object($A["a"])(this,nj,bj).call(this),Object($A["a"])(this,cj,xj).call(this)}}]),t}();function yj(){var t=this.ctx,e=this.wctx;t.font="".concat(Math.round(e.chartCanvas.width/16),"px sans-serif"),t.textAlign="center",t.textBaseline="top",t.fillStyle=e.eState.watermarkData.color,t.fillText(e.eState.watermarkData.data,e.chartCanvas.width/2,e.chartCanvas.height/2+10,e.chartCanvas.width-16)}function Cj(){var t=this.ctx,e=this.wctx;t.font="".concat(Math.round(e.chartCanvas.width/8),"px sans-serif"),t.textAlign="center",t.textBaseline=e.eState.watermarkData?"ideographic":"alphabetic",t.fillStyle="rgba(143, 168, 193, 0.1)",t.fillText(e.eState.watermark,e.chartCanvas.width/2,e.eState.watermarkData?e.chartCanvas.height/2-10:e.chartCanvas.height/2,e.chartCanvas.width-16)}function bj(){var t=this.wctx,e=this.ctx,i=t.eState.knots[t.eState.tabPoint.indexLine][t.eState.tabPoint.indexKnot],o={x:t.mapLogicalToCanvasXCoordinate(i.x),y:t.mapLogicalToCanvasYCoordinate(i.y)};e.save(),e.beginPath(),e.arc(o.x,o.y,10,0,2*Math.PI),e.fillStyle="red",e.fill(),e.restore()}function Sj(){var t=this,e=this.wctx;if(e.eState.lastPointsOfRange.length){var i=this.ctx,o=this.wctx.eState.lastPointsOfRange.map((function(e,i){if(e){if(void 0!==e.y)return{x:t.wctx.mapLogicalToCanvasXCoordinate(e.x),y:t.wctx.mapLogicalToCanvasYCoordinate(e.y)};if(void 0===e.y){var o=t.wctx.eState.knots[i].reduceRight((function(t,e,i){return void 0!==e.y&&void 0===t&&(t=i),t}),void 0);return{x:t.wctx.mapLogicalToCanvasXCoordinate(t.wctx.eState.knots[i][o].x),y:t.wctx.mapLogicalToCanvasYCoordinate(t.wctx.eState.knots[i][o].y)}}}}));i.save(),o.forEach((function(t,o){t&&(i.setLineDash([3,6]),i.lineWidth=1,i.beginPath(),i.strokeStyle=e.eState.metaInfoForLines[o].color,i.moveTo(t.x,t.y),i.lineTo(e.chartCanvas.width,t.y),i.stroke(),i.beginPath(),i.fillStyle=e.eState.metaInfoForLines[o].color,i.fill())})),i.restore()}}function Pj(){var t=this.wctx,e=this.ctx,i=t.eState.currentPoint.indexKnot,o=t.eState.currentPoint.indexLine,n=t.eState.knots[o][i],s={x:t.mapLogicalToCanvasXCoordinate(n.x),y:t.mapLogicalToCanvasYCoordinate(n.y)};e.save(),e.setLineDash([2,5]),e.lineWidth=1,e.beginPath(),e.strokeStyle=t.eState.metaInfoForLines[o].color,e.moveTo(s.x,s.y),e.lineTo(s.x,t.chartCanvas.height),e.stroke(),e.moveTo(s.x,s.y),e.lineTo(t.chartCanvas.width,s.y),e.stroke(),e.beginPath(),e.fillStyle=t.eState.metaInfoForLines[o].color,e.arc(s.x,s.y,8,0,2*Math.PI),e.fill(),e.restore()}function Tj(){var t=this,e=this.wctx,i=e.eState.metaInfoForLines.findIndex((function(t){return t.negative&&t.positive})),o=e.eState.knots.findIndex((function(t){return 1===t.length})),n=e.eState.knots[i],s=e.eState.knots[o][0].y,r=this.ctx;r.save(),n.forEach((function(i){r.beginPath(),r.arc(e.mapLogicalToCanvasXCoordinate(i.x),e.mapLogicalToCanvasYCoordinate(i.y),5*t.dpr,0,2*Math.PI),r.fillStyle=i.y1)for(var a=0;a1&&(e.eState.metaInfoForLines[o].negative||e.eState.metaInfoForLines[o].positive||t.push({settings:e.eState.metaInfoForLines[o],points:i})),t}),[]);o.length&&o.forEach((function(e){i.save(),i.beginPath(),e.points.forEach((function(e){i.lineTo(e.x?t.wctx.mapLogicalToCanvasXCoordinate(e.x):0,t.wctx.mapLogicalToCanvasYCoordinate(e.y))})),i.strokeStyle=e.settings.color,i.lineWidth=e.settings.lineWidth,i.stroke(),i.closePath(),i.restore()}))}function Ij(){var t=this.wctx,e=this.ctx,i=t.eState.knots.findIndex((function(t){return 1===t.length}));e.save(),e.beginPath(),e.lineTo(0,this.wctx.mapLogicalToCanvasYCoordinate(t.eState.knots[i][0].y)),e.lineTo(t.chartCanvas.width,this.wctx.mapLogicalToCanvasYCoordinate(t.eState.knots[i][0].y)),e.strokeStyle=t.eState.metaInfoForLines[i].color,e.lineWidth=t.eState.metaInfoForLines[i].lineWidth,e.stroke(),e.closePath(),e.restore()}function Bj(t,e,i,o,n,s){var r=this;e.beginPath(),e.lineWidth=s,e.lineTo(0,n.y),e.lineTo(t[0].points[0].x,t[0].points[0].y),i?(e.lineTo(t[0].points[0].x,n.y),e.fillStyle=t[0].trend<0?this.wctx.eState.metaInfoForLines[1].negative.fill:this.wctx.eState.metaInfoForLines[1].positive.fill,e.fill()):(e.strokeStyle=t[0].trend<0?this.wctx.eState.metaInfoForLines[1].negative.color:this.wctx.eState.metaInfoForLines[1].positive.color,e.stroke()),e.closePath(),t.forEach((function(t){e.beginPath(),e.lineWidth=s,t.points.forEach((function(t){e.lineTo(t.x,t.y)})),i?(e.fillStyle=t.trend<0?r.wctx.eState.metaInfoForLines[1].negative.fill:r.wctx.eState.metaInfoForLines[1].positive.fill,t.points[t.points.length-1].y===n.y&&t.points[0].y===n.y?e.closePath():t.points[t.points.length-1].y!==n.y&&t.points[0].y===n.y?(e.lineTo(t.points[t.points.length-1].x,n.y),e.closePath()):t.points[t.points.length-1].y===n.y&&t.points[0].y!==n.y?(e.lineTo(t.points[0].x,n.y),e.closePath()):t.points[t.points.length-1].y!==n.y&&t.points[0].y!==n.y&&(e.lineTo(t.points[t.points.length-1].x,n.y),e.lineTo(t.points[0].x,n.y),e.closePath()),e.fill()):(e.strokeStyle=t.trend<0?r.wctx.eState.metaInfoForLines[1].negative.color:r.wctx.eState.metaInfoForLines[1].positive.color,e.stroke())}))}var Mj={props:{points:{type:Array},metaInfoForLines:{type:Array},watermark:{type:String},watermarkData:{type:[Object,null],default:null},interval:{type:Number,default:155},maxIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},dayExchengeIndicator:{type:Boolean,default:!1},typeXAxis:{type:String,default:"date"},widthYaxis:{type:String,default:"7rem"},roundIndicator:{type:Boolean,default:!1},minIndicator:{type:[Object,Boolean],default:function(){return{lines:[1]}}},showLabelsAxis:{type:Object,default:function(){return{xAxis:!0,yAxis:!0}}},theme:{type:String,default:"light"}},components:{DxTooltip:Tt.a},data:function(){return{chartWrapper:null,mainCanvas:null,yCanvas:null,xCanvas:null,widget:null,eStateObject:null,targetTooltip:null,activeIndexTooltip:0,daysArr:this.$t("daysArr"),exchanges:[{title:this.$t("Sydney"),openTime:1},{title:this.$t("Tokyo"),openTime:2},{title:this.$t("Frankfurt"),openTime:11},{title:this.$t("London"),openTime:12},{title:this.$t("New_York"),openTime:16}]}},watch:{points:function(t){t&&(this.widget?this.updateChart():this.initChart())},theme:function(){this.initChart()}},methods:{updateChart:function(){var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");t&&e&&t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1),i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1);var n=i-o,s=t-e,r=i+.1*n,a=o-.1*n;this.eStateObject.knots=this.points,this.eStateObject.xMin=e-.03*s,this.eStateObject.xMax=t,this.eStateObject.yMin=a,this.eStateObject.exchanges=this.exchanges,this.eStateObject.daysArr=this.daysArr,this.eStateObject.yMax=r,this.eStateObject.watermark=this.watermark,this.eStateObject.watermarkData=this.watermarkData,this.eStateObject.relevantXMin=e,this.eStateObject.relevantXMax=t,this.eStateObject.metaInfoForLines=this.metaInfoForLines,this.widget.setEditorState(this.eStateObject)},initChart:function(){this.widget&&(this.widget.setConnected(!1),this.widget=null);var t=this.getExstremumPoints("max","x"),e=this.getExstremumPoints("min","x"),i=this.getExstremumPoints("max","y"),o=this.getExstremumPoints("min","y");t&&e&&t===e&&(t+=.1*t,e-=.1*e),t||e||(t=1,e=-1),i===o&&(i+=.1*i,o-=.1*o),i||o||(i=1,o=-1);var n=i-o,s=t-e,r=i+.1*n,a=o-.1*n;this.eStateObject={typeChart:"sectorLine",typeXAxis:this.typeXAxis,dayExchengeIndicator:this.dayExchengeIndicator,exchanges:this.exchanges,daysArr:this.daysArr,knots:this.points,xMin:e-.03*s,xMax:t,yMin:a,yMax:r,extendedDomain:!0,relevantXMin:e,relevantXMax:t,watermark:this.watermark,watermarkData:this.watermarkData,gridEnabled:!0,currentPoint:void 0,snapToGridEnabled:!1,maxLineIndicator:this.maxIndicator,minLineIndicator:this.minIndicator,roundIndicator:this.roundIndicator,primaryZoomMode:2,showLabelsAxis:this.showLabelsAxis,metaInfoForLines:this.metaInfoForLines,gridConfig:{interval:this.interval,color:"light"===this.theme?"#f2f2f2":"rgba(143, 168, 193, 0.1)",relevatColor:"light"===this.theme?"#fff":"#151924",unrelevantColor:"light"===this.theme?"#fff":"#151924",labelColor:"light"===this.theme?"#333":"#bbcee0"}};var c=window.devicePixelRatio||1;this.mainCanvas=this.$refs.mainCanvas,this.yCanvas=this.$refs.yCanvas,this.xCanvas=this.$refs.xCanvas,this.xCanvas.height=this.$refs.xCanvas.clientHeight*c,this.widget=new XD([{name:"chartCanvas",canvas:this.mainCanvas},{name:"xAxisCanvas",canvas:this.xCanvas},{name:"yAxisCanvas",canvas:this.yCanvas}],[new $k,new vj],!0,this.eStateObject),this.widget.setEventTarget(this.mainCanvas),this.widget.wctx.eventEmiter.subscribe("clickPoint",this.hedlerClickChartPoint),this.widget.wctx.eventEmiter.subscribe("hover",this.hedlerHoverChartPoint)},hedlerHoverChartPoint:function(t){this.$emit("hover",t)},hedlerClickChartPoint:function(t){this.$emit("clickPoint",t)},showTooltip:function(t,e){this.activeIndexTooltip=e,this.metaInfoForLines[e].lineWidth=Math.round(2*this.metaInfoForLines[e].lineWidth),this.updateChart(),this.targetTooltip=t.target},hideTooltip:function(t){this.targetTooltip=null,this.metaInfoForLines[t].lineWidth=Math.round(this.metaInfoForLines[t].lineWidth/2),this.updateChart()},getExstremumPoints:function(t,e){var i,o=this.points.findIndex((function(t){return t.length}));if(o>=0)return i=this.points[o][0][e],this.points.forEach((function(o){if(o.length){var n=Math[t].apply(null,o.reduce((function(t,i){return void 0!==i[e]&&t.push(i[e]),t}),[]));("max"===t?n>i:n1e4)return localStorage.removeItem("statusDisconnect"),void window.location.reload();localStorage.removeItem("statusDisconnect"),this.closeAttention()}},getSession:function(t){t||(this.acceptRules=localStorage.getItem("acceptRules"),this.$store.commit("settingsTradingChart/setDefaultMenuLeftBarTradingChart"),this.$store.commit("tradingTopBarSettings/setDefaultSettingsTradingTopBar")),t&&(this.acceptRules=!0,!this.eventsLoading&&this.getServerTime&&(this.eventsLoading=!0,this.$store.dispatch("eventsCalendar/postEvents",{from:new Date(this.serverTime.getFullYear(),this.serverTime.getMonth(),-5)})))},getServerTime:function(t){t&&this.getSession&&!this.getEventsCalendar&&!this.eventsLoading&&(this.eventsLoading=!0,this.$store.dispatch("eventsCalendar/postEvents",{from:new Date(this.serverTime.getFullYear(),this.serverTime.getMonth(),-5)}))}},methods:{closeReferModal:function(){this.referModalStatus=!1},openTopTradeStream:function(){this.getStreamsTopTraderTv()},showAttention:function(){this.showAttentionStatus=!0},closeAttention:function(){this.showAttentionStatus=!1},setAcceptRules:function(){this.acceptRules=!0},closePopup:function(){this.$store.dispatch("modal/setPopupData",{visible:!1,shading:!1})},getDataForHeaderWidgets:function(t){var e={command:"GetAccountDataStatisticsById",data:{id:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},getUserInfoAccounts:function(t){var e={command:"AccountsByUser",data:{userId:t},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e})},connectToChartWs:function(){var t={msg:"connect",version:"1",support:["1"]};this.$socketStream.sendCommand({ws:"chatWS",command:t})},logoutChat:function(){var t={massage:"bay!"};this.$http.post(this.getApiChatUrl+"logout",JSON.stringify(t),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-Type":"application/json"}})},setMessageHendler:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if("Contracts"!==(null===t||void 0===t?void 0:t.command)){i.next=4;break}e.$store.dispatch("contracts/LoadContracts",t.data),i.next=29;break;case 4:if("LastQuotes"!==(null===t||void 0===t?void 0:t.command)){i.next=8;break}e.getCatalogs.all||e.$store.dispatch("quotesCatalogs/setLastQuotes",t.data),i.next=29;break;case 8:if("ServerTime"!==(null===t||void 0===t?void 0:t.command)){i.next=12;break}e.$store.dispatch("serverTime/actionServerTime",t.data),i.next=29;break;case 12:if("GetChartGroups"!==(null===t||void 0===t?void 0:t.command)){i.next=16;break}e.$store.dispatch("settingsTradingChart/setSaveChartGroups"),i.next=29;break;case 16:if("AccountsByUser"!==(null===t||void 0===t?void 0:t.command)){i.next=24;break}return i.next=19,e.$store.dispatch("subscribeOrders/getAccountsUser",JSON.parse(t.data));case 19:o=e.getDefaultAccount,e.getDataForHeaderWidgets(o.id),e.$store.dispatch("subscription/getSubscription",{type:"Account",id:o.id,allData:!1}),i.next=29;break;case 24:if("GetAccountDataStatisticsById"!==(null===t||void 0===t?void 0:t.command)){i.next=29;break}if(n=JSON.parse(t.data),e.getDefaultAccount){i.next=28;break}return i.abrupt("return");case 28:n.at(-1)===e.getDefaultAccount.id&&e.$store.dispatch("headerSettings/dataForWidgets",JSON.parse(t.data));case 29:case"end":return i.stop()}}),i)})))()},getSaveChartGroups:function(t){var e={command:"GetChartGroups",FingerPrint:this.getSession.fp,method:"get",data:{GetAllGroups:!0,UserId:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},getStatusWS:function(t){"connect"===t.status&&"chatWS"===t.ws&&(this.statusConnectChatWS&&(this.connectToChartWs(),this.getSession?this.$store.dispatch("chat/authChatByToken",this.getToken):this.$store.dispatch("chat/authChatForGuest")),this.statusConnectChatWS=t.status),"connect"===t.status&&"apiWS_NOTI"===t.ws&&this.getSession&&this.subscribeNotification("Connect")},setLastQuotes:function(){var t={command:"LastQuotes",method:"get",data:null};this.$socketStream.sendCommand({ws:"apiWS2",command:t})},subscribeNotification:function(t){var e={command:t,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS_NOTI",command:e})},setContracts:function(){var t={command:"Contracts",method:"get"};this.$socketStream.sendCommand({ws:"apiWS",command:t})},subscribeOfServerTime:function(){var t={Command:"ServerTime",Method:"Subscribe"};this.$socketStream.sendCommand({ws:"apiWS",command:t})},getStreamsTopTraderTv:function(){var t=this,e="b26ec8fe-2f78-4c99-8962-f68257b0176b",i="72c9a0a4-c610-47b5-b434-6388034b2431",o={ids:[e,i]};this.$http.post("".concat(this.getApiStream,"SupportFunctions/allactives"),JSON.stringify(o),{headers:{"Content-type":"application/json"}}).then((function(e){t.$store.commit("userStreams/addPlayerStream",{mode:"minimaze",position:{my:"bottom right",at:"bottom right",of:"body",offset:{x:-8,y:-8}},streams:e.data,status:!0,id:"TopTraderTV"})}))},checkAuth:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$workStorage.getSession(),i){e.next=10;break}return t.setNoAuth(),o=t.$workKeys.getUUIDSession(),e.next=6,t.$workKeys.getOneUseKey();case 6:n=e.sent,t.$store.commit("auth/setHandshake",{sessionId:o,publicKey:n}),e.next=24;break;case 10:return s=i,e.next=13,t.$workKeys.signMessage(s.fp,s.sk);case 13:return a=e.sent,l=Object(c["a"])(Object(c["a"])({},s),{},{singFP:a}),t.$store.commit("auth/setSession",l),e.next=18,t.$store.dispatch("chat/authChatByToken");case 18:return t.$store.dispatch("statusRequests/loadStateRquest",{field:"authRequest",data:"ready"}),t.$store.dispatch("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"waitToSent"}),e.next=22,t.$store.dispatch("user/getUserData");case 22:t.$store.dispatch("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"waitToSent"}),t.getUserInfoAccounts(t.getUserInfo.id);case 24:case"end":return e.stop()}}),e)})))()},setNoAuth:function(){this.$store.dispatch("chat/authChatForGuest"),this.$store.dispatch("statusRequests/loadStateRquest",{field:"authRequest",data:"noSent"}),this.$store.dispatch("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"noSent"}),this.$store.dispatch("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"noSent"})},getSaveUserInfo:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!localStorage.getItem("TTUserInfo")){e.next=18;break}if(i=JSON.parse(localStorage.getItem("TTUserInfo")),!(i.token&&i.login&&i.refresh&&i.role)){e.next=15;break}return t.$store.dispatch("chat/authChatByToken",i.token),t.$store.commit("auth/setUserID",i.login),t.$store.dispatch("statusRequests/loadStateRquest",{field:"authRequest",data:"waitToSent"}),t.$store.dispatch("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"waitToSent"}),e.next=9,t.$store.dispatch("user/getUserData",i.login);case 9:t.$store.dispatch("chat/paymentsChatGroups",i.token),t.$store.dispatch("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"waitToSent"}),t.getUserInfoAccounts(t.getUserInfo.id),t.getSaveChartGroups(t.getUserInfo.id),e.next=16;break;case 15:t.$store.dispatch("auth/exitAuth");case 16:e.next=22;break;case 18:t.$store.dispatch("chat/authChatForGuest"),t.$store.dispatch("statusRequests/loadStateRquest",{field:"authRequest",data:"noSent"}),t.$store.dispatch("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"noSent"}),t.$store.dispatch("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"noSent"});case 22:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this,e=localStorage.getItem("referStatus");null!==e&&(this.referModalStatus=!e),setTimeout((function(){t.getStreamsTopTraderTv()}),5e3)},created:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.$socketStream.events.subscribe("apiWS",t.setMessageHendler),t.$socketStream.events.subscribe("apiWS_NOTI",t.setMessageHendler),t.$socketStream.$on("apiWS2",t.setMessageHendler),t.$socketStream.$on("apiWS3",t.setMessageHendler),t.$socketStream.$on("chatWS",t.setMessageHendler),t.$socketStream.$on("WSSstatus",t.getStatusWS),t.$store.dispatch("connectionStatus/subsForConnectStatus"),t.connectToChartWs(),i=new Worker("/worker.js"),e.next=11,t.$workStorage.initialStorage(i);case 11:localStorage.removeItem("quotesContracts"),t.checkAuth(),t.subscribeOfServerTime(),document.body.addEventListener("keydown",(function(t){9===t.keyCode&&document.body.classList.remove("using-mouse")})),t.setLastQuotes(),t.setContracts(),document.body.addEventListener("mousedown",(function(){document.body.classList.add("using-mouse")})),t.$store.dispatch("brokers/getListBrokers"),t.$store.dispatch("settingsTradingChart/addUserSettingsStructLeftBar"),t.$store.dispatch("settingsTradingChart/addPositionsSettings");case 21:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.logoutChat()}},wR=OR,_R=(i("5381"),Object(C["a"])(wR,n,s,!1,null,null,null)),AR=_R.exports,DR=(i("483b"),i("aeed"),i("d1d6")),kR=i.n(DR),IR=i("8c4f"),BR=function(){var t=this,e=t._self._c;return e("div",[e("Layout",{scopedSlots:t._u([{key:"left",fn:function(){return[e("UserLeftBar",{attrs:{signalsBroker:t.signalsBroker,userData:t.userData,isSignalsBroker:t.isSignalsBroker,isContentBroker:t.isContentBroker,isLoadingGetSignals:t.isLoadingGetSignals,contentSubscribed:t.contentSubscribed,activeTab:t.activeTab}})]},proxy:!0},{key:"center",fn:function(){return[e("UserCentralPart",{attrs:{loadedSessionTableData:t.loadedSessionTableData,signalsBroker:t.signalsBroker,isSignalsBroker:t.isSignalsBroker,isContentBroker:t.isContentBroker,isLoadingGetSignals:t.isLoadingGetSignals,contentSubscribed:t.contentSubscribed,userData:t.userData,activeTab:t.activeTab,symbol:t.activeContract.symbol},on:{setActiveTab:t.setActiveTab}})]},proxy:!0},{key:"right",fn:function(){return[e("UserRightBar",{attrs:{profile:"",userData:t.userData,loadedSessionTableData:t.loadedSessionTableData,activeTabProfile:t.activeTab,symbol:t.activeContract.symbol}})]},proxy:!0}])}),e("DxPopup",{attrs:{width:"740px",height:"386px",shading:!1,visible:t.statusWelcomeModal,showTitle:!1}},[e("WelcomeModals",{attrs:{routeName:"Profile"},on:{hideWelcome:t.hideWelcome}})],1)],1)},MR=[],$R=function(){var t=this,e=t._self._c;return e("div",{class:"grid grid_".concat(t.getActiveTheme)},[t.subheader?e("div",{staticClass:"grid__subheader"},[t._t("subheader")],2):t._e(),t.$slots.left?e("div",{staticClass:"grid__left",class:[{"grid__left-collapsed":!t.getLeftSideBarState}]},[t._t("left")],2):t._e(),e("div",{ref:"centerBlock",staticClass:"grid__center"},[t._t("center")],2),t.$slots.right?e("div",{staticClass:"grid__right",class:[{"grid__right-collapsed":!t.getRightSideBar}]},[t._t("right")],2):t._e(),t.visiblePopup?e("ModalPortfolioExperts",t._b({attrs:{visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}},"ModalPortfolioExperts",t.modalData,!1)):t._e()],1)},LR=[],FR=function(){var t=this,e=t._self._c;return e("CustomDxPopup",{attrs:{visible:t.visiblePopup,title:t.currentTitle,numberSteps:t.allSteps,currentStep:t.currentStep,width:850,height:668,maxHeight:"calc(100vh - 16px)",noPaddingContent:!0,clickableMarkerStep:!0},on:{hidden:t.hidden},scopedSlots:t._u([{key:"header",fn:function(i){var o=i.closePopup;return[e("HeaderPortfolioExperts",{attrs:{namePortfolio:t.namePortfolio,currentTitle:t.currentTitle,allSteps:t.allSteps,currentStep:t.currentStep,closePopup:o,portfolio:t.portfolio,infoAccount:t.infoAccount}})]}},{key:"content",fn:function(){return[e("div",{staticClass:"contentContainer"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e(t.getDataCurrentStep.componentName,t._b({tag:"component",attrs:{currentStep:t.currentStep}},"component",t.props[t.getDataCurrentStep.componentName],!1))],1)],1)]},proxy:!0}])})},jR=[],RR=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DemoPrice",class:t.darkClass},[e("div",{staticClass:"contentBlock"},[e("div",{staticClass:"text"},[e("p",{staticClass:"topText"},[t._v(t._s(t.$t("tctsyntsttt")))]),e("p",{staticClass:"price"},[t._v(t._s(t.$t("$_5_month")))]),e("p",{staticClass:"mb16"},[t._v(t._s(t.$t("ycpfiateocp")))]),e("p",[t._v(t._s(t.$t("twatcareosp")))])])]),e("div",{staticClass:"activeBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText",attrs:{icon:t.iconDataNext},on:{toggle:t.nextStep}},[t._v(t._s(t.$t("agree")))])],1)])},WR=[],NR={name:"DemoPrice",inject:["nextStep"],mixins:[xt],props:{},components:{},data:function(){return{}},computed:{iconDataNext:function(){return{name:"Arrow-expand-right",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}}}},ER=NR,UR=(i("cb10"),Object(C["a"])(ER,RR,WR,!1,null,"b9d29636",null)),VR=UR.exports,HR=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ChoiceExperts",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isVisibleGraph?e("GraphExperts",{key:"GraphExperts",attrs:{checkedExperts:t.checkedExperts,sortExperts:t.sortExperts,portfolio:t.portfolio},on:{viewGraph:t.viewGraph}}):e("div",{staticClass:"wrapExperts"},[e("TopLine",{attrs:{checkedExperts:t.checkedExperts,sortExperts:t.sortExperts,portfolio:t.portfolio,namePortfolio:t.namePortfolio,notName:t.notName,investTop:t.investTop},on:{viewGraph:t.viewGraph,notName:t.addAnimationForNotName}}),e("div",{staticClass:"wrapListExpertAndGraph"},[e("ListsExperts",{attrs:{investmentAmount:t.investmentAmount,equalToFive:t.equalToFive,checkedExperts:t.checkedExperts,sortExperts:t.sortExperts,portfolio:t.portfolio,isLoadingCreated:t.isLoadingCreated,saveInvestmentPorfolio:t.saveInvestmentPorfolio,investTop:t.investTop}}),e("CommonGraph",{attrs:{experts:t.experts}})],1)],1)],1),e("ButtonNavigationBlock",{attrs:{isVisibleDraftButton:!0,currentStep:t.currentStep,disabledNext:t.disabledNext,addInInvest:!0,isLoadingCreated:t.isLoadingCreated,namePortfolio:t.namePortfolio,portfolio:t.portfolio,saveInvestmentPortfolio:t.saveInvestmentPorfolio},on:{notName:t.addAnimationForNotName}})],1)},GR=[],qR=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ListsExperts",class:t.rootClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.sortExperts.length>0?e("transition-group",{staticClass:"experts",attrs:{name:"listExperts",tag:"div"}},t._l(t.sortExperts,(function(i){return e("div",{key:i.uniqueId,staticClass:"oneExpert",class:{disabled:t.disabled(i.uniqueId)},on:{wheel:function(t){t.stopPropagation()}}},[e("DataExpert",{attrs:{prefix:"_choiseExperts",expert:i,equalToFive:t.equalToFive,checkedExperts:t.checkedExperts,isVisibleAccountData:!0,hideCheckbox:t.portfolio||t.investTop}})],1)})),0):e("div",{staticClass:"noExperts"},[e("svgIcon",t._b({},"svgIcon",t.getIconData("BigUser"),!1)),t._v("Добавьте в портфель экспертов")],1)],1)],1)},zR=[],YR=function(){var t,e,i=this,o=i._self._c;return o("div",{staticClass:"DataExpert",class:i.darkClass},[i.expert.data.length&&!i.hideCheckbox?o("div",{staticClass:"checkboxBlock",class:{colored:i.color},style:i.styleColor},[o("DxCheckBox",{attrs:{value:i.getChecked,elementAttr:{class:"checkBoxCustom"},disabled:i.disabled,onValueChanged:i.setStatus}})],1):i._e(),i.contractMode?i._e():o("div",{staticClass:"wrapImage",on:{mouseenter:i.mouseenterHandler,mouseleave:i.mouseleaveHandler}},[o("img",{attrs:{src:i.avatar,alt:""}})]),i.noName?o("div",{staticClass:"percents",class:i.classForProfit},[i._v(i._s(i.profitValueFormatted))]):o("div",{staticClass:"nameAndAccount",class:i.nameAccountClass},[i.contractMode?i._e():o("div",{staticClass:"name"},[i._v(i._s(i.expert.traderName))]),o("div",{staticClass:"account"},[i.isVisibleAccountData?o("div",{staticClass:"wrapAccountNumber"},[o("div",{staticClass:"leftPart"},[o("img",{attrs:{src:i.srcIcon,alt:""}})]),o("div",{staticClass:"rightPart"},[o("span",{staticClass:"accountGroupCode",class:i.classGroupCode},[i._v(i._s(i.accountGroupCode))]),o("span",{staticClass:"number"},[i._v(i._s(i.accountNumber)),o("span",{staticClass:"symbol",class:{portfolio:!i.expert.symbol}},[i.expert.symbol?o("span",[i._v(i._s(i.expert.symbol))]):o("svgIcon",i._b({},"svgIcon",i.getIconData("Bag"),!1)),i.isVisibleAlarmIcon?o("span",{staticClass:"svgWrapper",class:i.classForTooltip,on:{mouseenter:function(t){return i.viewTooltip(".".concat(i.classForTooltip))},mouseleave:i.hideTooltip}},[o("svgIcon",i._b({},"svgIcon",i.getIconData("Alarm_red"),!1))],1):i._e()],1)])])]):o("div",{staticClass:"wrapAccountNumber"},[o("div",{staticClass:"contractContainer"},[o("span",{staticClass:"number"},[o("span",{staticClass:"symbol",class:{portfolio:!i.expert.symbol}},[i.expert.symbol?o("span",{style:{color:i.color}},[i._v(i._s(i.expert.symbol))]):i._e()])])]),o("div",{staticClass:"contractContainer",style:{color:i.color,marginLeft:"8px"}},[i._v(i._s("".concat(null!==(t=i.expert)&&void 0!==t&&t.symbolProfit?null===(e=i.expert)||void 0===e?void 0:e.symbolProfit:"$").concat(i.$moneyf(i.getProfitAbs,Math.abs(i.getProfitAbs)<.01&&Math.abs(i.getProfitAbs)?5:i.getProfitAbs?2:0))))])])])]),o("DxTooltip",{key:i.tooltipVisible,attrs:{visible:i.tooltipVisible,maxWidth:300,target:i.selector,position:i.positionTooltipRigthBottom,animation:i.animationConfig,wrapperAttr:i.wrapperAttr}},[i._v(i._s(i.textTooltip))])],1)},XR=[],QR={name:"DataExpert",inject:["setCheckedExperts"],mixins:[xt,Ot,rT],props:{expert:{type:Object},equalToFive:{type:Boolean},checkedExperts:{type:Array},color:{type:String},location:{type:String,default:""},prefix:{type:String,default:""},noName:{type:Boolean,default:!1},contractMode:{type:Boolean,default:!1},profit:{type:Number},isVisibleAccountData:{type:Boolean,default:!1},hideCheckbox:{type:Boolean,default:!1},portfolio:{type:Boolean},textValue:{type:String,default:"%"}},components:{DxCheckBox:Th["DxCheckBox"]},data:function(){return{}},computed:{isVisibleAlarmIcon:function(){return this.expert.iAmProvider.length>0&&"graphExpert"!==this.location},getChecked:function(){var t=this,e=this.checkedExperts.find((function(e){return t.expert.uniqueId===e.uniqueId}));return!!e&&e.status},classForTooltip:function(){return"alarm_"+this.prefix+this.expert.uniqueId},duplicateInstruments:function(){var t=this;if(this.expert.sources){var e=[],i=this.expert.sources.map((function(t){return t.contract}));return i.forEach((function(i){t.expert.iAmProvider.includes(i)&&e.push(i)})),e.join(", ")}},textTooltip:function(){return this.expert.symbol?"Вы уже являетесь провайдером по инструменту ".concat(this.expert.symbol):"Вы уже являетесь провайдером по инструментам ".concat(this.duplicateInstruments," входящих в портфель эксперта ").concat(this.expert.traderName)},styleColor:function(){return this.color?{"--color-checkbox":this.color}:{}},srcIcon:function(){return i("700b")},avatar:function(){return"User-profile.png"===this.expert.avatar?i("a594"):this.expert.avatar},accountGroupCode:function(){var t;return null===(t=this.expert)||void 0===t||null===(t=t.dailyData)||void 0===t?void 0:t.accountGroup},classGroupCode:function(){return["green",{red:"Demo"===this.accountGroupCode}]},nameAccountClass:function(){return{iAmNotProvider:0===this.expert.iAmProvider.length,portfolio:0===this.expert.iAmProvider.length&&!this.expert.symbol}},accountNumber:function(){var t;return null===(t=this.expert)||void 0===t?void 0:t.sequenceId},disabled:function(){return this.color?1===this.checkedExperts.length&&this.expert.uniqueId===this.checkedExperts[0].uniqueId:this.equalToFive&&!this.getChecked},profitValue:function(){var t=this,e=this.checkedExperts.find((function(e){return t.expert.uniqueId===e.uniqueId}));return e.profit||this.profit},getProfitAbs:function(){if(this.expert.data&&this.expert.data.length)return void 0!==this.expert.profit?this.expert.profit:this.expert.data.at(-1)[6]},profitValueFormatted:function(){return 0===this.profitValue?0:Lm(this.profitValue,1,!0)+" ".concat(this.textValue)},classForProfit:function(){return{red:this.profitValue<0,green:this.profitValue>=0}}},methods:{mouseenterHandler:function(t){this.mouseEnterFunction(t,{imageForSource:this.expert.avatar,nameSource:this.expert.traderName,accountId:this.expert.login,sequenceId:this.expert.sequenceId,noActiveButton:!0,locationCall:this.location,position:"right"})},mouseleaveHandler:function(){this.mouseLeaveFunction()},setStatus:function(t){this.setCheckedExperts(t.value,{uniqueId:this.expert.uniqueId,login:this.expert.login})}}},JR=QR,KR=(i("a769"),Object(C["a"])(JR,YR,XR,!1,null,"03541ae2",null)),ZR=KR.exports,tW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DiagramData",class:t.darkClass},[e("div",{staticClass:"diagramm"},[e("ProgressRoundDiagram",{key:t.getProfitOrdersPercent,attrs:{width:40,height:40,widthBorder:3,fontSize:10,percent:t.getPercent}})],1),e("div",{staticClass:"graphAndProfit"},[e("div",{staticClass:"chat"},[e("Chart",{attrs:{statByAccount:t.statByAccount,widthCard:438,height:50,portfolio:t.portfolio}})],1),e("div",{staticClass:"profit",class:t.colorProfitClass},[t._v(t._s(t.profitabilityFormatted)+"%")]),e("div",{staticClass:"profitMonth",class:t.valueClass},[t._v(t._s(t.getMonthProfitFormatted))])])])},eW=[],iW=function(){var t=this,e=t._self._c;return t.statByAccount?e("div",{staticClass:"Chart",class:t.classes},[e("SimpleChart",{key:t.widthCard,attrs:{fixedWidth:t.widthCard,fixedHeight:t.height,points:t.getChartPoint.points,margin:{top:3,right:3,bottom:0,left:3},smooth:t.getChartPoint.points.length>2,color:t.dark?"rgba(204,232,227, .2)":"#CCE8E3",zeroGradient:t.dark?"rgba(137, 239, 215, 0.23)":"rgba(137, 239, 215, 0.53)",firstGradient:"rgba(220, 255, 237, 0)"}})],1):t._e()},oW=[];function nW(t){var e={};return t.forEach((function(t){var i=new Date(t.date).getTime();e[i]||(e[i]=[]);var o=t.pip;e[i].push(o)})),Object.entries(e).map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return[i,o.reduce((function(t,e){return t+e}),0)]}))}var sW={name:"Chart",mixins:[xt],components:{SimpleChart:BT},props:{statByAccount:{type:Object},widthCard:{type:Number},classes:{default:function(){return[]}},height:{type:Number},symbol:{type:[String,Boolean]},portfolio:{type:Boolean}},computed:{getChartPoint:function(){if(this.statByAccount)return this.symbol||this.portfolio?{points:this.statByAccount.data.map((function(t){return t.pip})),date:this.statByAccount.data.map((function(t){return Array.isArray(t)?t[1]:t.date}))}:{points:nW(this.statByAccount.data).map((function(t){return t[1]})),date:nW(this.statByAccount.data).map((function(t){return+t[0]}))}},dark:function(){return this.darkClass.dark}}},rW=sW,aW=Object(C["a"])(rW,iW,oW,!1,null,null,null),cW=aW.exports,lW={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getSession:"auth/getSession",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus",getUserAccountsRequestStatus:"statusRequests/getUserAccountsRequestStatus",getUserDetail:"user/getUserDetail"})),{},{getStatusUser:function(){if(this.getAuthRequestStatus&&"waitToSent"!==this.getAuthRequestStatus&&"pending"!==this.getAuthRequestStatus&&this.getUserDetailRequestStatus&&"waitToSent"!==this.getUserDetailRequestStatus&&"pending"!==this.getUserDetailRequestStatus&&this.getUserAccountsRequestStatus&&"waitToSent"!==this.getUserAccountsRequestStatus&&"pending"!==this.getUserAccountsRequestStatus)return this.getSession?{user:"auth",route:"Trading",status:"owner"}:{user:"unauth",route:"Trading",status:"ghost"}}})},uW={mixins:[xt,lW],data:function(){return{disabled:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getExperts:"expertsPortfolio/getExperts",activeSubscriptionByAccount:"subscription/activeSubscriptionByAccount"})),{},{statByAccountEmpty:function(){return!this.statByAccount||!this.statByAccount.data.length},allContractsOrdersClosedProfit:function(){var t;if(null!==(t=this.dataRow)&&void 0!==t&&t.sources){var e=[],i=this.dataRow.sources.map((function(t){return t.contract})),o=this.statByAccount.data;return i.forEach((function(t){var i=o.findLast((function(e){return e.contract===t}));i&&e.push(i.pClosedCount)})),e.reduce((function(t,e){return t+e}),0)}},ordersClosedProfit:function(){var t;if((null!==(t=this.dataRow)&&void 0!==t&&t.sources||this.statByAccount)&&!this.statByAccountEmpty)return this.strategiesCards&&!this.symbol?this.allContractsOrdersClosedProfit:Array.isArray(this.statByAccount.data.at(-1))?this.statByAccount.data.at(-1)[11]:this.statByAccount.data.at(-1).pClosedCount},allContractsTotalClosedOrders:function(){var t;if(null!==(t=this.dataRow)&&void 0!==t&&t.sources){var e=[],i=this.dataRow.sources.map((function(t){return t.contract})),o=this.statByAccount.data;return i.forEach((function(t){var i=o.findLast((function(e){return e.contract===t}));i&&e.push(i.closedCount)})),e.reduce((function(t,e){return t+e}),0)}},totalClosedOrders:function(){if(!this.statByAccountEmpty)return this.strategiesCards&&!this.symbol?this.allContractsTotalClosedOrders:Array.isArray(this.statByAccount.data.at(-1))?this.statByAccount.data.at(-1)[10]:this.statByAccount.data.at(-1).closedCount},getProfitOrdersPercent:function(){return this.statByAccountEmpty||!this.totalClosedOrders?0:Math.ceil(100/(this.totalClosedOrders/this.ordersClosedProfit))},statByAccountForGraph:function(){var t;if(!this.statByAccountEmpty){var e=JSON.parse(JSON.stringify(this.statByAccount)),i=null===(t=e.ordersStatistics)||void 0===t?void 0:t.startTradingDT;if(!i)return e;var o=e.accountDaily.findIndex((function(t){return sL(new Date(t.date),new Date(i),"equally")}));return e.accountDaily=e.accountDaily.slice(o),e}},profitability:function(){if(!this.statByAccountEmpty&&this.statByAccount.data.length){var t=this.statByAccount.data.at(-1),e=Array.isArray(t),i=e?t[9]:t.usedVolume,o=e?t[6]:t.profitClose,n=100*o/i;return!i||isNaN(n)?0:n.toFixed(2)}},profitabilityFormatted:function(){return isNaN(this.profitability)?0:Lm(this.profitability,2)},colorProfitClass:function(){return{red:this.profitability<0,green:this.profitability>=0}},getMonthProfit:function(){if(this.statByAccountEmpty)return 0;if(!this.statByAccount.data.length)return 0;var t=[];this.statByAccount.data.forEach((function(e){var i=Array.isArray(e),o=new Date(i?e[1]:e.date).getMonth(),n=new Date(i?e[1]:e.date).getFullYear();t.push("".concat(o,".").concat(n))}));var e=Array.from(new Set(t));if(0===e.length)return 0;var i=this.profitability/e.length;return isNaN(i)&&(i=0),i},getMonthProfitFormatted:function(){if(!this.statByAccountEmpty){var t=this.getMonthProfit<1?1:2;return Lm(this.getMonthProfit,t)+"%"}},valueClass:function(){return{green:this.getMonthProfit>=0,red:this.getMonthProfit<0}},drawDown:function(){return 0},colorDrawDownClass:function(){if(!this.statByAccountEmpty)return{red:this.drawDown<0}},sharpeRatio:function(){var t;if(!this.statByAccountEmpty){var e=null===(t=this.statByAccount.data.at(-1))||void 0===t?void 0:t.sharp;return e&&0!==e?Lm(e,e<1?1:2):0}},colorSharpClass:function(){if(!this.statByAccountEmpty)return{red:this.sharpeRatio<0,green:this.sharpeRatio>0}},bookmarkStyle:function(){if(this.infoAccount){var t;switch(this.infoAccount.index){case 1:t=this.darkClass.dark?"#D59200":"#FFDE94";break;case 2:t=this.darkClass.dark?"#AC8068":"#E7C6B4";break;case 3:t=this.darkClass.dark?"#757474":"#CCCACA";break;default:t=this.darkClass.dark?"rgba(245,245,245, .2)":"#F5F5F5"}return{background:t}}},srcIcon:function(){return i("700b")},classGroupCode:function(){return["green",{red:"Demo"===this.accountGroupCode}]},accountGroupCode:function(){var t;return null===(t=this.statByAccount)||void 0===t||null===(t=t.dailyData)||void 0===t?void 0:t.accountGroup},accountNumber:function(){var t;return null===(t=this.statByAccount)||void 0===t||null===(t=t.account)||void 0===t?void 0:t.sequenceId},loginExpert:function(){var t;return(null===(t=this.infoAccount)||void 0===t?void 0:t.login)||this.accountId},myAccountsID:function(){return this.getProfileAccount.map((function(t){return t.id}))},disabledButtonCopy:function(){return this.myAccountsID.includes(this.loginExpert)},isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},disabledButtonAdd:function(){return this.disabled||this.disabledButtonCopy},existSignals:function(){var t=this.activeSubscriptionByAccount(this.loginExpert);return t.filter((function(t){return t.autoTrade}))},existCopy:function(){return this.existSignals.length>0},avatar:function(){var t;return(null===(t=this.infoAccount)||void 0===t?void 0:t.avatar)||this.srcUser},traderName:function(){var t;return(null===(t=this.infoAccount)||void 0===t?void 0:t.traderName)||this.nameSource},alreadyInPortfolio:function(){var t=this;if(!this.symbol){var e,i=null===(e=this.infoAccount)||void 0===e?void 0:e.login,o=this.getExperts.filter((function(t){return t.login===i}));return 0!==o.length&&o.length===o[0].sources.length}return this.getExperts.find((function(e){return e.login===t.loginExpert&&t.symbol&&(e.symbol===t.symbol||null===e.symbol)}))}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({setPopupData:"modalSubscribe/setPopupData"})),{},{login:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})}})},dW={name:"DiagramData",mixins:[xt,uW],props:{statByAccount:{type:Object},portfolio:{type:Boolean}},components:{ProgressRoundDiagram:c$,Chart:cW},computed:{dark:function(){return this.darkClass.dark},getPercent:function(){var t;return(null===(t=this.statByAccount)||void 0===t?void 0:t.profitOrdersPercent)||this.getProfitOrdersPercent}}},hW=dW,pW=(i("9063"),Object(C["a"])(hW,tW,eW,!1,null,"d598d844",null)),gW=pW.exports,fW={name:"ListsExperts",inject:["setCheckedExperts","deleteExpertLocal"],mixins:[xt],props:{investmentAmount:{type:Number},equalToFive:{type:Boolean},checkedExperts:{type:Array},sortExperts:{type:Array},portfolio:{type:Boolean},investTop:{type:Boolean},isLoadingCreated:{type:Boolean,default:!1},saveInvestmentPorfolio:{type:Function}},components:{DataExpert:ZR,DiagramData:gW},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{rootClass:function(){return Object(c["a"])({portfolio:this.portfolio||this.investTop},this.darkClass)},disabled:function(){var t=this;return function(e){return t.equalToFive&&!t.checkedExperts.find((function(t){return t.uniqueId===e}))}}}),methods:{deleteExpert:function(t){var e=t.uniqueId,i=t.login;this.$store.dispatch("expertsPortfolio/deleteExpert",e),this.setCheckedExperts(!1,{login:i,uniqueId:e}),this.deleteExpertLocal(e)}}},mW=fW,vW=(i("c68f"),Object(C["a"])(mW,qR,zR,!1,null,"1e653df0",null)),yW=vW.exports,CW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonNavigationBlock",class:t.darkClass},[t.isVisiblePrevButton?e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.getIconData("Arrow-expand-left")},on:{toggle:t.prevStep}}):t._e(),t.lastStep?e("ButtonIconFlat",{class:t.classesInvest,attrs:{disabled:t.disabledNext||t.isLoadingInvest},on:{toggle:t.startInvest}},[t.isLoadingInvest?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e(),e("span",{staticClass:"text"},[t._v(t._s(t.$t("copy")))])],1):e("ButtonIconFlat",{staticClass:"buttonCustom withText",attrs:{icon:t.getIconData("Arrow-expand-right"),disabled:t.disabledNext||t.isLoadingCreated},on:{toggle:t.nextStepHandler}},[t._v(t._s(t.$t("next")))])],1)},bW=[],SW={name:"ButtonNavigationBlock",mixins:[xt],inject:["prevStep","nextStep","invest"],props:{currentStep:{type:Number},disabledNext:{type:Boolean},lastStep:{type:Boolean,default:!1},addInInvest:{type:Boolean,default:!1},isLoadingCreated:{type:Boolean,default:!1},isLoadingInvest:{type:Boolean},portfolio:{type:Boolean,default:!1},namePortfolio:{type:String,default:""},saveInvestmentPortfolio:{type:Function},isVisibleDraftButton:{type:Boolean,default:!1},providerCopy:{type:Boolean,default:!1},findPortfolio:{type:[Object,Boolean]},additionalVerification:{type:[Function,Boolean]}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({statusCreated:"expertsPortfolio/statusCreated",getActiveTab:"expertsPortfolio/getActiveTab",createdData:"expertsPortfolio/createdData"})),{},{isVisiblePrevButton:function(){return this.currentStep>1},classesInvest:function(){var t="buttonCustom invest withText";return this.isLoadingInvest&&(t+=" hidden"),t}}),methods:{startInvest:function(){var t,e=this.portfolio?null===(t=this.findPortfolio)||void 0===t?void 0:t.id:this.createdData.bagId;this.invest(e)},nextStepHandler:function(){this.additionalVerification&&!this.additionalVerification()||(!this.addInInvest||this.namePortfolio||this.portfolio?this.nextStep():this.$emit("notName",!0))}}},PW=SW,TW=(i("2c19"),Object(C["a"])(PW,CW,bW,!1,null,"4a9e2416",null)),xW=TW.exports,OW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"GraphExperts",class:t.darkClass},[e("div",{staticClass:"topLine"},[e("div",{staticClass:"buttonContainer"},[e("span",{staticClass:"wrapSvg",on:{click:t.viewExpertsList}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("Arrow-move-left"),!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("back")))])],1)]),e("span",{staticClass:"descriptiontext"},[t._v(t._s(t.$t("profit_in"))+" pips")]),e("div",{staticClass:"svgWrapper graphTopLine",on:{mouseenter:t.viewTooltip,mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1)]),e("div",{staticClass:"graphContent"},[e("div",{staticClass:"experts",on:{wheel:function(t){t.stopPropagation()}}},[e("transition-group",{attrs:{name:"listExperts",tag:"div"}},t._l(t.expertsCompareSorted,(function(i,o){return e("div",{key:i.uniqueId,staticClass:"oneExpert"},[e("DataExpert",{attrs:{location:"graphExpert",expert:i,checkedExperts:t.checkedExpertsGraph,color:i.color,textValue:"pip",profit:i.data.at(-1).pip||i.data.at(-1)[16],noName:!0}})],1)})),0)],1),e("div",{staticClass:"graph"},[t.visibleGraph?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:t.hoverPoint}}):t._e()],1)])])},wW=[],_W={name:"GraphExperts",mixins:[xt,Ot],props:{checkedExperts:{type:Array},sortExperts:{type:Array},portfolio:{type:Boolean}},components:{DataExpert:ZR,LineEventChart:Uk},data:function(){return{checkedExpertsGraph:[],expertsCompare:[],profitExperts:[],points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1}},provide:function(){return{setCheckedExperts:this.setCheckedExperts}},computed:{expertsCompareSorted:function(){return this.expertsCompare.sort((function(t,e){return e.status-t.status}))},dopColors:function(){if(this.checkedExperts.length>5){var t=this.checkedExperts.length-5,e=[];return Array.from(new Array(t)).forEach((function(){var t=uB(),i=t.color,o=t.fill;e.push({color:i,fill:o})})),e}return[]},colors:function(){return this.darkClass.dark?[{color:"rgba(0, 185, 252, 1)",fill:"rgba(0, 185, 252, 0.1)"},{color:"rgba(0, 255, 172, 1)",fill:"rgba(0, 255, 172, 0.1)"},{color:"rgba(250, 76, 74, 1)",fill:"rgba(250, 76, 74, 0.1)"},{color:"rgba(211, 190, 0, 1)",fill:"rgba(211, 190, 0, 0.1)"},{color:"rgba(202, 117, 255, 1)",fill:"rgba(202, 117, 255, 0.1)"}].concat(Object(x["a"])(this.dopColors)):[{color:"rgba(60, 115, 241, 1)",fill:"rgba(60, 115, 241, 0.1)"},{color:"rgba(0, 142, 114, 1)",fill:"rgba(0, 142, 114, 0.1)"},{color:"rgba(233, 18, 18, 1)",fill:"rgba(233, 18, 18, 0.1)"},{color:"rgba(165, 124, 0, 1)",fill:"rgba(165, 124, 0, 0.1)"},{color:"rgba(172, 60, 241, 1)",fill:"rgba(172, 60, 241, 0.1)"}].concat(Object(x["a"])(this.dopColors))}},methods:{viewExpertsList:function(){this.$emit("viewGraph",{visible:!1,field:"isVisibleGraph"})},setCheckedExperts:function(t,e){var i=e.uniqueId,o=this.checkedExpertsGraph.find((function(t){return t.uniqueId===i}));o.status=t;var n=this.expertsCompare.find((function(t){return t.uniqueId===i}));n.status=t,this.setPointsForChart()},setPointsForChart:function(){var t=this;this.metaInfoLines=[],this.points=[],this.expertsCompare.filter((function(t){return t.status})).forEach((function(e){t.metaInfoLines.push({type:"line",color:e.color,fill:e.fill,fillIndicator:t.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""});var i=e.data.map((function(t){var e,i=null!==(e=t.pip)&&void 0!==e?e:t[16];return{x:new Date(t.date||t[1]).getTime(),y:i,date:new Date(t.date||t[1]).getTime()}}));t.points.push(i)})),setTimeout((function(){t.visibleGraph=!0}),100)},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null}},created:function(){var t=this;this.checkedExpertsGraph=this.checkedExperts.map((function(t){return{login:t.login,uniqueId:t.uniqueId,status:!0}})),this.expertsCompare=[],this.checkedExpertsGraph.forEach((function(e,i){var o=t.sortExperts.find((function(t){return t.uniqueId===e.uniqueId}));o.color=t.colors[i].color,o.fill=t.colors[i].fill,t.expertsCompare.push(o)})),this.portfolio&&(this.expertsCompare=this.expertsCompare.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:t.data.slice(t.data.findIndex((function(t){return!t.isFake})))})}))),this.setPointsForChart()}},AW=_W,DW=(i("1247"),Object(C["a"])(AW,OW,wW,!1,null,"efd23fee",null)),kW=DW.exports,IW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CommonGraph",class:t.darkClass},[e("div",{staticClass:"blockDiagramm"},[e("div",{staticClass:"wrapDiagramm"},[e("ProgressRoundDiagram",{key:t.percent,attrs:{width:80,height:80,widthBorder:10,fontSize:.001,percent:t.percent}}),e("div",{staticClass:"label"},[t._v(t._s(t.percentProfitFormatted)+"%")])],1),e("div",{staticClass:"getFinishPips",class:{red:t.getFinishPips.value<0}},[t._v(t._s(t.getFinishPips.valueFormatted)+" pip"),e("div",{staticClass:"triangle green",class:{red:t.getFinishPips.value<0}})])]),t.visibleGraph?e("LineEventChart",{attrs:{points:t.points,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",widthYaxis:"7rem",theme:t.getActiveTheme,minIndicator:{lines:[0]},maxIndicator:{lines:[0]}},on:{hover:t.hoverPoint}}):t._e()],1)},BW=[];function MW(t,e,i){var o={};t.forEach((function(t){t.forEach((function(i,n){var s=new Date(i.date).getTime();o[s]||(o[s]=[]);var r=t[n-1];o[s].push(e(i,r))}))}));var n=Object.entries(o).sort((function(t,e){return+t[0]-+e[0]}));return n.map((function(t){var e=+t[0],o=t[1].reduce((function(t,e){return t+e}),0)/(i||t[1].length),n=t[1].reduce((function(t,e){return t+e}),0);return{date:e,sumValue:n,averageValue:o}}))}function $W(t){return{accountId:t[0],date:t[1],contract:t[2],volumeOpen:t[3],volumeClose:t[4],profitOpen:t[5],profitClose:t[6],floatingProfitOpen:t[7],floatingProfitClose:t[8],usedVolume:t[9],closedCount:t[10],pClosedCount:t[11],forecast:t[12],equity:t[13],sharp:t[14],isFake:t[15],pip:t[16],margin:t[17],leverage:t[18],floatingPip:t[19],histBagId:t[20],sourceAccountId:t[21],statType:t[22],subId:t[23]}}var LW={name:"CommonGraph",components:{LineEventChart:Uk,ProgressRoundDiagram:c$},props:{experts:{type:Array}},mixins:[xt,qe],data:function(){return{points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1}},watch:{statDataGraph:function(t){t&&this.setPointsForChart()}},computed:{closedCount:function(){var t;return Array.isArray(null===(t=this.experts)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.data)||void 0===t?void 0:t[0])?this.experts.reduce((function(t,e){return t+e.data.at(-1)[10]}),0):this.experts.reduce((function(t,e){return t+e.data.reduce((function(t,e){return t+e.closedCount}),0)}),0)},pClosedCount:function(){var t;return Array.isArray(null===(t=this.experts)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.data)||void 0===t?void 0:t[0])?this.experts.reduce((function(t,e){return t+e.data.at(-1)[11]}),0):this.experts.reduce((function(t,e){return t+e.data.reduce((function(t,e){return t+e.pClosedCount}),0)}),0)},percent:function(){return 100*this.pClosedCount/this.closedCount},percentProfitFormatted:function(){return Lm(this.percent,1,!0)},statData:function(){return this.experts},statDataGraph:function(){if(this.statData&&this.statData.length){var t,e=this.statData[0].data;return Array.isArray(e[0])&&(t=this.statData.map((function(t){return{data:t.data.map((function(t){return $W(t)}))}}))),MW((t||this.statData).map((function(t){return t.data})),(function(t){return t.pip}))}},getFinishPips:function(){if(!this.statDataGraph)return 0;var t=this.statDataGraph.at(-1).sumValue;return{value:t,valueFormatted:Lm(t,2,!0)}},getMetaInfoLinesForChat:function(){return[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:this.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""}]}},methods:{setPointsForChart:function(){var t,e=this;this.statDataGraph&&(this.metaInfoLines=[],this.points=[[]],(t=this.metaInfoLines).push.apply(t,Object(x["a"])(this.getMetaInfoLinesForChat)),this.statDataGraph.forEach((function(t){e.points[0].push({x:t.date,y:t.sumValue,date:t.date})})),this.visibleGraph=!0)},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null}},mounted:function(){this.statDataGraph&&this.setPointsForChart()},destroyed:function(){}},FW=LW,jW=(i("f855"),Object(C["a"])(FW,IW,BW,!1,null,"351e149e",null)),RW=jW.exports,WW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopLine",class:t.darkClass},[e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{disabled:t.disabledCompareButton,icon:t.iconCompare},on:{toggle:function(e){return t.goToGraph("isVisibleGraph")}}},[t._v(t._s(t.$t("compare")))])],1),t.portfolio?t._e():e("NamePortfolio",{attrs:{namePortfolio:t.namePortfolio,notName:t.notName,investTop:t.investTop,checkedExperts:t.checkedExperts},on:{notName:t.setNotName}})],1)},NW=[],EW=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NamePortfolio",class:t.darkClass},[t.investTop?e("div",{staticClass:"text"},[e("div",{staticClass:"count",class:t.countClass},[t._v(t._s(t.checkedExperts.length))]),e("div",{staticClass:"topText"},[t._v("TOP")])]):t._e(),e("input",{class:t.rootClass,attrs:{type:"text",maxlength:"500",disabled:!t.redactStatus,placeholder:t.placeholderInput},domProps:{value:t.namePortfolio},on:{input:t.setNamePortfolio}}),e("ButtonIconFlat",{attrs:{icon:{name:t.redactStatus?"Check":"Pencil"},modifier:{class:["NamePortfolio-redactButton","NamePortfolio-redactButton_".concat(t.getActiveTheme)]}},on:{click:t.setRedactStatus}})],1)},UW=[],VW={name:"NamePortfolio",mixins:[xt],inject:["setNamePortfolio"],props:{namePortfolio:{type:String},notName:{type:Boolean},checkedExperts:{type:Array},investTop:{type:Boolean}},data:function(){return{redactStatus:!1}},computed:{rootClass:function(){return{shine:this.notName}},countClass:function(){return{two:this.checkedExperts.length>9}},placeholderInput:function(){return"Название портфеля"}},watch:{namePortfolio:function(t){t&&this.notName?this.$emit("notName",null):t||this.$emit("notName",!0)}},methods:{setRedactStatus:function(){this.redactStatus=!this.redactStatus}}},HW=VW,GW=(i("7b18"),Object(C["a"])(HW,EW,UW,!1,null,"b4062284",null)),qW=GW.exports,zW={name:"TopLine",components:{NamePortfolio:qW},props:{checkedExperts:{type:Array},sortExperts:{type:Array},portfolio:{type:Boolean},namePortfolio:{type:String},notName:{type:Boolean},investTop:{type:Boolean}},mixins:[xt],data:function(){return{}},watch:{},computed:{iconCompare:function(){return{name:"compareSymbolProfits",color:this.darkClass.dark?"#8FA8C1":"#8C8C8C"}},disabledCompareButton:function(){return 0===this.sortExperts.length||0===this.checkedExperts.length}},methods:{goToGraph:function(t){this.$emit("viewGraph",{visible:!0,field:t})},setNotName:function(t){this.$emit("notName",t)}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},YW=zW,XW=(i("b47a"),Object(C["a"])(YW,WW,NW,!1,null,"4b1985d0",null)),QW=XW.exports,JW={name:"ChoiceExperts",inject:["addInvest"],mixins:[xt],props:{currentStep:{type:Number},investmentAmount:{type:Number},equalToFive:{type:Boolean},checkedExperts:{type:Array},experts:{type:Array},namePortfolio:{type:String},portfolio:{type:Boolean},investTop:{type:Boolean}},components:{ButtonNavigationBlock:xW,ListsExperts:yW,GraphExperts:kW,CommonGraph:RW,TopLine:QW},data:function(){return{isVisibleGraph:!1,isVisibleGraphIncome:!1,isLoadingCreated:!1,notName:null}},computed:{sortExperts:function(){var t=this,e=JSON.parse(JSON.stringify(this.experts));return e.sort((function(e,i){return!!t.checkedExperts.find((function(t){return t.uniqueId===i.uniqueId}))-!!t.checkedExperts.find((function(t){return t.uniqueId===e.uniqueId}))}))},disabledNext:function(){return 0===this.checkedExperts.length}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{viewGraph:function(t){var e=t.visible,i=t.field;this[i]=e},saveInvestmentPorfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoadingCreated=!0,e.next=3,t.addInvest();case 3:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingCreated=!1;case 5:case"end":return e.stop()}}),e)})))()},addAnimationForNotName:function(t){this.notName=t}})},KW=JW,ZW=(i("6771"),Object(C["a"])(KW,HR,GR,!1,null,"6b823bed",null)),tN=ZW.exports,eN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ChoiceInstruments",class:t.darkClass},[t.portfolio?t._e():e("div",{staticClass:"descriptions"},[t._v(t._s(t.$t("sisotep"))),e("Avatar",{attrs:{src:t.srcAvatar,theme:t.activeTheme,size:"3.2"}}),e("NamePortfolio",{attrs:{namePortfolio:t.namePortfolio,notName:t.notName},on:{notName:t.setNotName}})],1),e("HeaderRadioButton",{attrs:{priceTypeSignals:t.priceTypeSignals}}),e("div",{staticClass:"allContainer"},[e("LineInstruments",{attrs:{value:"all",money:t.commonPrice,percent:t.commonPercent,checked:t.allChecked,priceTypeSignals:t.priceTypeSignals,portfolio:t.portfolio}})],1),e("div",{staticClass:"instrumentsList",on:{wheel:function(t){t.stopPropagation()}}},[e("transition-group",{attrs:{name:"instrumentsList"}},t._l(t.allInstrumentsSorted,(function(i){return e("LineInstruments",{key:i.contract,attrs:{value:i.contract,money:i.monthPrice,signal:i,isReal:t.getIsRealAccount,percent:i.profitPercent,checked:t.checkedInstruments[i.contract],priceTypeSignals:t.priceTypeSignals,portfolio:t.portfolio}})})),1)],1),t.onlyCheckedInstruments.length?t._e():e("NoData"),e("ResultLineInstruments",{attrs:{priceTypeSignals:t.priceTypeSignals,resultPrice:t.resultPrice,resultPercent:t.resultPercent}}),e("ButtonNavigationBlock",{attrs:{isVisibleDraftButton:!0,currentStep:t.currentStep,disabledNext:t.disabledNext,addInInvest:!0,namePortfolio:t.namePortfolio,providerCopy:t.providerCopy,isLoadingCreated:t.isLoadingCreated,saveInvestmentPortfolio:t.saveInvestmentPorfolio,portfolio:t.portfolio},on:{notName:t.setNotName}})],1)},iN=[],oN=(i("07ac"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"LineInstruments",class:t.darkClass},[e("div",{staticClass:"instruments"},[e("div",{staticClass:"contents"},[t.getEnableCopyStatus?e("CheckBoxStar",{attrs:{value:t.value,checked:t.checked,portfolio:t.portfolio}}):e("div",{staticClass:"emtyCheckBox"}),e("div",{staticClass:"title"},[t._v(t._s(t.title))])],1),e("hr")]),e("div",{staticClass:"money"},[e("div",{staticClass:"contents",class:t.moneyClassGreen},[t._v("$ "+t._s(t.money)),e("small",{staticClass:"subTitle"},[t._v(t._s(t.$t("per_month")))])]),e("hr")]),e("div",{staticClass:"percent"},[e("div",{staticClass:"contents",class:t.percentClassGreen},[t._v(t._s(t.percent)+" %")]),e("hr")])])}),nN=[],sN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckBoxStar"},[e("label",{class:{portfolio:t.portfolio}},[e("input",{staticClass:"checkInput",attrs:{type:"checkbox"},domProps:{checked:t.checked,value:t.value},on:{change:t.changeChecked}}),t.checked?e("svgIcon",t._b({},"svgIcon",t.filledStar,!1)):e("svgIcon",t._b({},"svgIcon",t.contourStar,!1))],1)])},rN=[],aN={name:"CheckBoxStar",inject:["setChecked"],mixins:[xt],props:{checked:{type:Boolean},value:{type:String},portfolio:{type:Boolean}},computed:{contourStar:function(){return{name:"Favorite-off",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},filledStar:function(){return{name:"Favorite-on",color:this.darkClass.dark?"#00b9fc":"#3C73F1"}}},methods:{changeChecked:function(t){if(!this.portfolio){var e=t.target.checked;this.setChecked({value:this.value,checked:e})}}}},cN=aN,lN=(i("e8a5a"),Object(C["a"])(cN,sN,rN,!1,null,"1c39790c",null)),uN=lN.exports,dN={name:"LineInstruments",mixins:[xt],props:{checkedSignals:{type:Object},value:{type:String},signal:{type:Object},isReal:{type:Boolean},checked:{type:Boolean},money:{type:[Number,String]},percent:{type:[Number,String]},priceTypeSignals:{type:String},portfolio:{type:Boolean}},components:{CheckBoxStar:uN},computed:{getEnableCopyStatus:function(){return!this.isReal||this.signal.enableCopy},title:function(){return"all"===this.value?this.$t("the_entire_portfolio"):this.value},moneyClassGreen:function(){return{green:this.checked&&"Money"===this.priceTypeSignals}},percentClassGreen:function(){return{green:this.checked&&"Percent"===this.priceTypeSignals}}}},hN=dN,pN=(i("9a27"),Object(C["a"])(hN,oN,nN,!1,null,"be087ec0",null)),gN=pN.exports,fN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderRadioButton",class:t.darkClass},[e("div",{staticClass:"noRadioText"},[t._v(t._s(t.$t("instrument")))]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.moneyOrPercent,expression:"moneyOrPercent"}],attrs:{type:"radio",name:"moneyOrPercent",value:"Money"},domProps:{checked:t._q(t.moneyOrPercent,"Money")},on:{change:function(e){t.moneyOrPercent="Money"}}}),e("span",{staticClass:"pseudo"}),e("span",{staticClass:"textRadio"},[t._v(t._s(t.$t("cost_$_month")))])]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.moneyOrPercent,expression:"moneyOrPercent"}],attrs:{type:"radio",name:"moneyOrPercent",value:"Percent"},domProps:{checked:t._q(t.moneyOrPercent,"Percent")},on:{change:function(e){t.moneyOrPercent="Percent"}}}),e("span",{staticClass:"pseudo"}),e("span",{staticClass:"textRadio"},[t._v(t._s(t.$t("of_the_result")))])])])},mN=[],vN={name:"HeaderRadioButton",mixins:[xt],inject:["setData"],props:{priceTypeSignals:{type:String}},components:{},data:function(){return{moneyOrPercent:this.priceTypeSignals}},watch:{moneyOrPercent:function(t){this.setData({value:t},"priceTypeSignals")}}},yN=vN,CN=(i("1d36"),Object(C["a"])(yN,fN,mN,!1,null,"07508175",null)),bN=CN.exports,SN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ResultLineInstruments",class:t.darkClass},[e("div",{staticClass:"text"},[t._v(t._s(t.$t("result")))]),e("div",{staticClass:"moneyBlock"},[e("div",{staticClass:"contents",class:t.moneyClassGreen},[t._v("$ "+t._s(t.resultPrice)),e("small",{staticClass:"subTitle"},[t._v(t._s(t.$t("per_month")))])])]),e("div",{staticClass:"percentBlock",class:t.percentClassGreen},[t._v(t._s(t.resultPercent)+" %")])])},PN=[],TN={name:"ResultLineInstruments",mixins:[xt],props:{priceTypeSignals:{type:String},resultPrice:{type:Number},resultPercent:{type:[Number,String]}},computed:{moneyClassGreen:function(){return{green:"Money"===this.priceTypeSignals}},percentClassGreen:function(){return{green:"Percent"===this.priceTypeSignals}}}},xN=TN,ON=(i("ebed"),Object(C["a"])(xN,SN,PN,!1,null,"0dc1a4dd",null)),wN=ON.exports,_N=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NoData",class:t.darkClass},[t._v("Вы не выбрали ни одного инструмента для копирования")])},AN=[],DN={name:"NoData",mixins:[xt]},kN=DN,IN=(i("b241"),Object(C["a"])(kN,_N,AN,!1,null,"3766db26",null)),BN=IN.exports,MN={name:"ChoiceInstruments",inject:["addInvest"],mixins:[xt],props:{allInstruments:{type:Array},allChecked:{type:Boolean},checkedInstruments:{type:Object},priceTypeSignals:{type:String},currentStep:{type:Number},namePortfolio:{type:String},commonPrice:{type:Number},resultPrice:{type:Number},providerCopy:{type:Boolean},resultPercent:{type:[Number,String]},commonPercent:{type:[String,Number]},onlyCheckedInstruments:{type:Array},infoAccount:{type:Object},portfolio:{type:Boolean}},components:{LineInstruments:gN,HeaderRadioButton:bN,ButtonNavigationBlock:xW,ResultLineInstruments:wN,NoData:BN,Avatar:E},data:function(){return{notName:null,isLoadingCreated:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getIsRealAccount:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},activeTheme:function(){return this.darkClass.dark?"dark":"light"},disabledNext:function(){return!Object.values(this.checkedInstruments).some(Boolean)},allInstrumentsSorted:function(){var t=this;return Object(x["a"])(this.allInstruments).sort((function(e,i){return t.checkedInstruments[i.contract]-t.checkedInstruments[e.contract]}))},srcAvatar:function(){return this.portfolio?this.findPortfolio.avatar:this.infoAccount.avatar}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{setNotName:function(t){this.notName=t},saveInvestmentPorfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoadingCreated=!0,e.next=3,t.addInvest();case 3:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingCreated=!1;case 5:case"end":return e.stop()}}),e)})))()}})},$N=MN,LN=(i("5b95"),Object(C["a"])($N,eN,iN,!1,null,"a437a2b4",null)),FN=LN.exports,jN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RiskManagementInvestCrypto",class:t.darkClass},[t.getLoadStatus?e("div",{staticClass:"RiskManagementInvestCrypto-content"},[e("CapitalAllocationCrypto",{attrs:{freeEquity:t.freeEquity,remainedFreeEquity:t.remainedFreeEquity,reserveEquity:t.reserveEquity,usedLeverage:t.usedLeverage,sumByLeverage:t.sumByLeverage,checkedSources:t.checkedSources,findPortfolio:t.findPortfolio,lastQuotesSignals:t.lastQuotesSignals,statisticForCountOrders:t.statisticForCountOrders,cryptoStatus:t.getCryptoStatusInvesting},on:{uncheckInstrument:t.uncheckInstrument}}),e("div",{staticClass:"RiskManagementInvestCrypto-table",class:"RiskManagementInvestCrypto-table_".concat(t.getActiveTheme)},[e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle",class:"RiskManagementInvestCrypto-tableTitle_".concat(t.getActiveTheme)},[e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[e("svgIcon",{attrs:{name:"Favorite-on"}})],1),e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Инструмент")]),e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Qty.")]),e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Общий объём / На сделку")])]),t.getSignalsInfo?e("VuePerfectScrollbar",{staticClass:"instrumentsList"},[e("transition-group",{attrs:{name:"instrumentsList"}},t._l(t.getSignalsInfo,(function(i,o){return e("div",{key:o,staticClass:"RiskManagementInvestCrypto-tableContent-column",class:"RiskManagementInvestCrypto-tableContent-row_".concat(t.getActiveTheme)},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-expertRow",class:"RiskManagementInvestCrypto-tableContent-expertRow_".concat(t.getActiveTheme)},[e("Avatar",{attrs:{src:t.getInfoExpert(o).avatar,theme:t.getActiveTheme,size:"2.4"}}),t._v(t._s(t.getInfoExpert(o).name))],1),e("transition-group",{attrs:{name:"instrumentsList"}},t._l(i.sort((function(e,i){return t.checkedSources[i.id]-t.checkedSources[e.id]})),(function(i,o){return e("div",{key:i.id,staticClass:"RiskManagementInvestCrypto-tableContent-row",class:"RiskManagementInvestCrypto-tableContent-row_".concat(t.getActiveTheme)},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color,cursor:"pointer"},on:{click:function(e){return t.setChecketSource(i.id)}}},[e("svgIcon",{attrs:{name:t.checkedSources[i.id]?"Favorite-on":"Favorite-off"}})],1),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color}},[t._v(t._s(i.contract))]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color}},[t._v(t._s(i.qty))]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem"},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redact",style:{color:t.getGreenColor.color}},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redactValue"},[t._v(t._s(t.checkedSources[i.id]?"".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountTransactionOnContract(i.id)*t.getVolumeOnContract)):0))]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-devider"},[t._v("/")]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redactValue"},[t._v(t._s(t.checkedSources[i.id]?"~ ".concat(t.getCurrencyChar).concat(t.$moneyf(t.getVolumeOnContract)):0))])])])])})),0)],1)})),0)],1):t._e()],1)],1):e("div",{staticClass:"RiskManagementInvestCrypto-loader"},[e("DxLoadIndicator")],1),e("div",{staticClass:"RiskManagementInvestCrypto-footer"},[e("ButtonNavigationBlock",{attrs:{isVisibleDraftButton:!0,currentStep:t.currentStep,disabledNext:t.disabledNext,addInInvest:!0,namePortfolio:t.namePortfolio,providerCopy:t.providerCopy,isLoadingCreated:t.isLoadingCreated,saveInvestmentPortfolio:t.saveInvestmentPorfolio,portfolio:t.portfolio},on:{notName:t.setNotName}})],1)])},RN=[],WN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CapitalAllocationCrypto"},[e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("available_funds")))])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-equity",style:{color:t.getBlueColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.remainedFreeEquity))))])])]),e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controls"},[e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controlWap",class:"CapitalAllocationCrypto-setInvestSum-controlWap_".concat(t.getActiveTheme),on:{mousedown:function(e){return t.downChange("throttleStatus","setEquity",[100])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("ButtonIconFlat",{attrs:{icon:t.getIconLeft,modifier:{class:["CapitalAllocationCrypto-setInvestSum-control","CapitalAllocationCrypto-setInvestSum-control_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setEquity(100)}}})],1),e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controlWap",class:"CapitalAllocationCrypto-setInvestSum-controlWap_".concat(t.getActiveTheme),on:{mousedown:function(e){return t.downChange("throttleStatus","setEquity",[-100])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("ButtonIconFlat",{attrs:{icon:t.getIconRight,modifier:{class:["CapitalAllocationCrypto-setInvestSum-control","CapitalAllocationCrypto-setInvestSum-control_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setEquity(-100)}}})],1)]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("reserved_amount")))])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-equity",class:"CapitalAllocationCrypto-equity_".concat(t.getActiveTheme),style:{color:t.getGreenColor.color}},[e("span",[t._v(t._s(t.getCurrencyChar))]),e("input",{style:{color:t.getGreenColor.color},attrs:{type:"number"},domProps:{value:t.reserveEquity},on:{change:t.setValueEquity}})])])])]),e("div",{staticClass:"CapitalAllocationCrypto-controlMoneyWrap"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("leverage_full")))]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-leverageControlContainer"},[1!==t.getMaxLeverage?e("div",{staticClass:"CapitalAllocationCrypto-redactCount",class:"CapitalAllocationCrypto-redactCount_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-redactCountControl",class:"CapitalAllocationCrypto-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addLeverage(!1)},mousedown:function(e){return t.downChange("throttleStatus","addLeverage",[!1])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"number",disabled:""},domProps:{value:t.leverageNumberBox},on:{change:t.inputLeverage}}),e("div",{staticClass:"CapitalAllocationCrypto-redactCountControl",class:"CapitalAllocationCrypto-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addLeverage(!0)},mousedown:function(e){return t.downChange("throttleStatus","addLeverage",[!0])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]):e("div",{staticClass:"CapitalAllocationCrypto-noLeverage",style:{color:t.getGreenColor.color}},[t._v("1")])])])]),e("div",{staticClass:"CapitalAllocationCrypto-amountInvest"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v("Будет инвестировано")])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-amountInvest-data",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.sumByLeverage))))])])])]),e("div",{staticClass:"CapitalAllocationCrypto-autoInvest"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v("Расчет ИИ")])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-ii"},[e("CheckBox",{attrs:{checked:t.statusII,size:32},on:{change:t.setIIStatus}}),e("div",{staticClass:"CapitalAllocationCrypto-ii-icon",style:{color:t.statusII?t.getBlueColor.color:t.getGrayColor.color}},[e("svgIcon",{attrs:{name:"Robot_Helper",size:40}})],1)],1)])])])])])},NN=[],EN={name:"CapitalAllocationCrypto",inject:["setEquity","setReserveEquity","setPercent","setLeverage","setChecketSource"],components:{CheckBox:Ya},props:{remainedFreeEquity:{type:Number},statisticForCountOrders:{default:null},reserveEquity:{type:Number},freeEquity:{type:Number},usedLeverage:{type:Number},sumByLeverage:{type:Number},checkedSources:{default:null},findPortfolio:{type:Object},lastQuotesSignals:{default:null},cryptoStatus:{type:Boolean}},data:function(){return{openCount:0,minVolumeOnOrder:100,throttleStatus:null,minInvestingSum:0,leverageNumberBox:1,statusII:!0}},mixins:[qe],watch:{usedLeverage:function(t){this.leverageNumberBox=t},checkedSources:{handler:function(){this.minInvestingSum=this.setMinInvestingSum(this.getDefaultVolumeOnContract),this.statusII&&this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum)},deep:!0},getStatusII:function(t){this.statusII=t}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},getStatusII:function(){if(this.getRecomendedSumForInvesting)return this.reserveEquity===this.getRecomendedSumForInvesting.investingSum&&this.usedLeverage===this.getRecomendedSumForInvesting.leverage},getDefaultVolumeOnContractCrypto:function(){var t=this;if(!this.checkedSources||!this.statisticForCountOrders||!this.lastQuotesSignals||!this.getContracts)return 0;var e=100,i=function(i){if(t.checkedSources[i]){var o=t.findPortfolio.sources.find((function(t){return+i===t.id})),n=t.lastQuotesSignals.find((function(t){return t.s===o.contract})).averagePrice,s=t.getContracts.find((function(t){return t.name===o.contract})).minVolume,r=n*s;r>e&&(e=r)}};for(var o in this.checkedSources)i(o);return e},getDefaultVolumeOnContract:function(){return this.cryptoStatus?this.getDefaultVolumeOnContractCrypto:1e3},getMaxLeverage:function(){return this.getDefaultAccount.maxLeverage},getRecomendedSumForInvesting:function(){if(!this.minInvestingSum)return 0;var t=0,e=1,i=0;if(i=100*this.minInvestingSum/this.freeEquity,i<10){var o=.1*this.freeEquity,n=o/this.openCount;t=this.setMinInvestingSum(Math.ceil(n))}else if(i>=10&&i<=50)t=this.minInvestingSum;else if(i>50){if(1!==this.getMaxLeverage){var s=4,r=this.getMaxLeverage>30?30:this.getMaxLeverage;while(s<=8||t>=this.minInvestingSum){s++;for(var a=this.freeEquity*(10*s/100),c=2;c<=r;c++)if(c*a>=this.minInvestingSum)return e=c,t=a,{investingSum:t,leverage:e}}}this.unCheckInstrument()}return{investingSum:t,leverage:e}},getIconLeft:function(){return{name:"Arrow-expand-left",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}},getIconRight:function(){return{name:"Arrow-expand-right",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}}}),methods:{unCheckInstrument:function(){for(var t in this.checkedSources)if(this.checkedSources[t])return void this.setChecketSource(t)},setIIStatus:function(){this.getStatusII||(this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum),this.leverageNumberBox=this.getRecomendedSumForInvesting.leverage,this.setLeverage(this.leverageNumberBox))},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},setMinInvestingSum:function(t){var e=this;if(this.statisticForCountOrders){var i=0;this.openCount=0;var o=function(o){if(e.checkedSources[o]){var n=e.statisticForCountOrders.find((function(t){return t.sourceId===+o})).openCount;e.openCount+=n,i+=n*t}};for(var n in this.checkedSources)o(n);return Math.ceil(i)}},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},setValueEquity:function(t){this.setReserveEquity(t.target.valueAsNumber)},inputLeverage:function(t){var e=Math.abs(t.target.valueAsNumber);e<=this.getMaxLeverage&&e>0&&(this.leverageNumberBox=e,this.setLeverage(this.leverageNumberBox))},addLeverage:function(t){if(t){if(this.leverageNumberBox+1>this.getMaxLeverage)return;this.leverageNumberBox++}else{if(this.leverageNumberBox-1<=0)return;this.leverageNumberBox--}this.setLeverage(this.leverageNumberBox)}},mounted:function(){this.minInvestingSum=this.setMinInvestingSum(this.getDefaultVolumeOnContract),this.reserveEquity||(this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum),this.leverageNumberBox=this.getRecomendedSumForInvesting.leverage,this.setLeverage(this.leverageNumberBox))}},UN=EN,VN=(i("aaef"),Object(C["a"])(UN,WN,NN,!1,null,"78279704",null)),HN=VN.exports,GN={name:"RiskManagementInvestCryptoPortfolio",inject:["addInvest","setChecketSource"],mixins:[xt,qe],props:{checkedSources:{type:Object},statisticForCountOrders:{default:null},reserveEquity:{type:Number},providerCopy:{type:Boolean},portfolio:{type:Boolean},sumByLeverage:{type:Number},usedLeverage:{type:Number},currentStep:{type:Number},namePortfolio:{type:String},findPortfolio:{type:Object},remainedFreeEquity:{type:Number},freeEquity:{type:Number}},components:{ButtonNavigationBlock:xW,Avatar:E,CapitalAllocationCrypto:HN,VuePerfectScrollbar:Xt.a,DxLoadIndicator:wT.a},data:function(){return{notName:null,isLoadingCreated:!1,lastQuotesSignals:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme",getApi:"api/api"})),{},{getCryptoStatusInvesting:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getLoadStatus:function(){var t;return this.lastQuotesSignals&&(null===(t=this.statisticForCountOrders)||void 0===t?void 0:t.length)&&this.statisticForCountOrders.length===this.findPortfolio.sources.length},getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},getMaxLeverage:function(){return this.getDefaultAccount.maxLeverage},getAmountVolumeQty:function(){if(this.getSignalsInfo)return this.getSignalsInfo.reduce((function(t,e){return t+e.qty}),0)},getSignalsInfo:function(){var t=this;if(this.lastQuotesSignals){var e=Object(x["a"])(new Set(this.findPortfolio.sources.map((function(t){return t.accountId})))),i={};return e.forEach((function(e){var o=[],n=t.findPortfolio.sources.filter((function(t){return t.accountId===e}));n.length&&n.forEach((function(e){var i=e.contract,n=t.getContracts.find((function(t){return t.name===i})),s=t.lastQuotesSignals.find((function(t){return t.s===i})).averagePrice,r=n.volumeStep,a=n.stepPrecision,c=t.getVolumeOnContract?t.getVolumeOnContract/s:0,l=c>=r&&c%r;c=l?+(c-l).toFixed(a):+c.toFixed(a),o.push({contract:i,minVolume:n.minVolume,maxVolume:n.maxVolume,quote:s,id:e.id,qty:c,trueStatus:t.getVolumeOnContract/s>=n.minVolume&&t.getVolumeOnContract/s<=n.maxVolume})})),i[e]=o})),i}},getCountTransaction:function(){var t=this;return this.statisticForCountOrders&&this.getCheckedInstrumentsCount?this.statisticForCountOrders.reduce((function(e,i){return t.checkedSources[i.sourceId]&&(e+=i.openCount),e}),0):0},getVolumeOnContract:function(){return this.sumByLeverage&&this.getCountTransaction?this.sumByLeverage/this.getCountTransaction:0},getIconLeft:function(){return{name:"Arrow-expand-left",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},getIconRight:function(){return{name:"Arrow-expand-right",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},disabledNext:function(){var t=this;if(!this.getSignalsInfo||!this.getLoadStatus)return!0;var e=[];for(var i in this.getSignalsInfo)this.getSignalsInfo[i].forEach((function(t){e.push(t)}));return e.some((function(e){return!e.trueStatus&&t.checkedSources[e.id]}))},getCheckedInstrumentsCount:function(){var t;return null===(t=Object.values(this.checkedSources).filter((function(t){return t})))||void 0===t?void 0:t.length}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{getInfoExpert:function(t){var e=this.findPortfolio.sources.find((function(e){return e.accountId===t}));return{avatar:e.userInfo.avatarURL,name:"".concat(e.userInfo.firstName," ").concat(e.userInfo.lastName)}},uncheckInstrument:function(){this.setChecked({value:"all",checked:!1})},getCountTransactionOnContract:function(t){if(!this.statisticForCountOrders)return 0;var e=this.statisticForCountOrders.find((function(e){return e.sourceId===t}));return e?e.openCount:0},setValueEquity:function(t){this.setReserveEquity(t.target.valueAsNumber)},setLastQuotes:function(){var t={command:"LastQuotes",method:"get",data:null};this.$socketStream.sendCommand({ws:"apiWS2",command:t})},setNotName:function(t){this.notName=t},setMessageHandler:function(t){"LastQuotes"===t.command&&(this.lastQuotesSignals=t.data)},saveInvestmentPorfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoadingCreated=!0,e.next=3,t.addInvest();case 3:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingCreated=!1;case 5:case"end":return e.stop()}}),e)})))()}}),mounted:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler),this.setLastQuotes()},destroyed:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler)}},qN=GN,zN=(i("88d3"),Object(C["a"])(qN,jN,RN,!1,null,"2c635bc0",null)),YN=zN.exports,XN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RiskManagementInvestCrypto",class:t.darkClass},[t.getLoadStatus?e("div",{staticClass:"RiskManagementInvestCrypto-content"},[e("CapitalAllocationCrypto",{attrs:{freeEquity:t.freeEquity,remainedFreeEquity:t.remainedFreeEquity,reserveEquity:t.reserveEquity,usedLeverage:t.usedLeverage,sumByLeverage:t.sumByLeverage,onlyCheckedInstruments:t.checkedInstruments,lastQuotesSignals:t.lastQuotesSignals,statisticForCountOrders:t.statisticForCountOrders,cryptoStatus:t.getCryptoStatusInvesting},on:{uncheckInstrument:t.uncheckInstrument}}),e("div",{staticClass:"RiskManagementInvestCrypto-table",class:"RiskManagementInvestCrypto-table_".concat(t.getActiveTheme)},[e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle",class:"RiskManagementInvestCrypto-tableTitle_".concat(t.getActiveTheme),style:{gridTemplateColumns:t.getCryptoStatusInvesting?"2.4rem 1fr 1fr 1fr":"2.4rem 1fr 1fr"}},[e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[e("CheckBoxStar",{attrs:{checked:t.allChecked,value:"all",portfolio:t.portfolio}})],1),e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Инструмент")]),t.getCryptoStatusInvesting?e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Qty.")]):t._e(),e("div",{staticClass:"RiskManagementInvestCrypto-tableTitle-item"},[t._v("Общий объём / На сделку")])]),t.getSignalsInfo?e("VuePerfectScrollbar",{staticClass:"instrumentsList"},[e("transition-group",{attrs:{name:"instrumentsList"}},t._l(t.getSignalsInfo,(function(i,o){return e("div",{key:i.contract,staticClass:"RiskManagementInvestCrypto-tableContent-row",class:"RiskManagementInvestCrypto-tableContent-row_".concat(t.getActiveTheme),style:{background:i.trueStatus?"none":t.getRedColor.fill,gridTemplateColumns:t.getCryptoStatusInvesting?"2.4rem 1fr 1fr 1fr":"2.4rem 1fr 1fr"}},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color}},[e("CheckBoxStar",{attrs:{value:i.contract,checked:t.checkedInstruments[i.contract],portfolio:t.portfolio}})],1),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color}},[t._v(t._s(i.contract))]),t.getCryptoStatusInvesting?e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem",style:{color:t.getBlueColor.color}},[t._v(t._s(i.qty))]):t._e(),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem"},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redact",style:{color:t.getGreenColor.color}},[e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redactValue"},[t._v(t._s(t.checkedInstruments[i.contract]?"".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountTransactionOnContract(i.contract)*t.getVolumeOnContract)):0))]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-devider"},[t._v("/")]),e("div",{staticClass:"RiskManagementInvestCrypto-tableContent-rowItem-redactValue"},[t._v(t._s(t.checkedInstruments[i.contract]?"~ ".concat(t.getCurrencyChar).concat(t.$moneyf(t.getVolumeOnContract)):0))])])])])})),0)],1):t._e(),e("div",{staticClass:"RiskManagementInvestCrypto-amount",class:"RiskManagementInvestCrypto-amount_".concat(t.getActiveTheme),style:{gridTemplateColumns:t.getCryptoStatusInvesting?"2.4rem 1fr 1fr 1fr":"2.4rem 1fr 1fr"}},[e("div",{staticClass:"RiskManagementInvestCrypto-amount-item",class:"RiskManagementInvestCrypto-amount-item_".concat(t.getActiveTheme)},[t._v("ИТОГ:")]),e("div",{staticClass:"RiskManagementInvestCrypto-amount-item"},[t._v(t._s(t.onlyCheckedInstruments.length))]),t.getCryptoStatusInvesting?e("div",{staticClass:"RiskManagementInvestCrypto-amount-item",style:{color:t.getBlueColor.color}},[t._v(t._s(t.$moneyf(Math.round(t.getAmountVolumeQty))))]):t._e(),e("div",{staticClass:"RiskManagementInvestCrypto-amount-item",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.sumByLeverage))))])])],1)],1):e("div",{staticClass:"RiskManagementInvestCrypto-loader"},[e("DxLoadIndicator")],1),e("div",{staticClass:"RiskManagementInvestCrypto-footer"},[e("ButtonNavigationBlock",{attrs:{isVisibleDraftButton:!0,currentStep:t.currentStep,disabledNext:t.disabledNext,addInInvest:!0,namePortfolio:t.namePortfolio,providerCopy:t.providerCopy,isLoadingCreated:t.isLoadingCreated,saveInvestmentPortfolio:t.saveInvestmentPorfolio,portfolio:t.portfolio},on:{notName:t.setNotName}})],1)])},QN=[],JN=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CapitalAllocationCrypto"},[e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("available_funds")))])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-equity",style:{color:t.getBlueColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.remainedFreeEquity))))])])]),e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controls"},[e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controlWap",class:"CapitalAllocationCrypto-setInvestSum-controlWap_".concat(t.getActiveTheme),on:{mousedown:function(e){return t.downChange("throttleStatus","setEquity",[t.cryptoStatus?100:1e3])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("ButtonIconFlat",{attrs:{icon:t.getIconLeft,modifier:{class:["CapitalAllocationCrypto-setInvestSum-control","CapitalAllocationCrypto-setInvestSum-control_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setEquity(t.cryptoStatus?100:1e3)}}})],1),e("div",{staticClass:"CapitalAllocationCrypto-setInvestSum-controlWap",class:"CapitalAllocationCrypto-setInvestSum-controlWap_".concat(t.getActiveTheme),on:{mousedown:function(e){return t.downChange("throttleStatus","setEquity",[t.cryptoStatus?-100:-1e3])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("ButtonIconFlat",{attrs:{icon:t.getIconRight,modifier:{class:["CapitalAllocationCrypto-setInvestSum-control","CapitalAllocationCrypto-setInvestSum-control_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setEquity(t.cryptoStatus?-100:-1e3)}}})],1)]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("reserved_amount")))])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-equity",class:"CapitalAllocationCrypto-equity_".concat(t.getActiveTheme),style:{color:t.getGreenColor.color}},[e("span",[t._v(t._s(t.getCurrencyChar))]),e("input",{style:{color:t.getGreenColor.color},attrs:{type:"number"},domProps:{value:t.reserveEquity},on:{change:t.setValueEquity}})])])])]),e("div",{staticClass:"CapitalAllocationCrypto-controlMoneyWrap"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("leverage_full")))]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-leverageControlContainer"},[1!==t.getMaxLeverage?e("div",{staticClass:"CapitalAllocationCrypto-redactCount",class:"CapitalAllocationCrypto-redactCount_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-redactCountControl",class:"CapitalAllocationCrypto-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addLeverage(!1)},mousedown:function(e){return t.downChange("throttleStatus","addLeverage",[!1])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"number",disabled:""},domProps:{value:t.leverageNumberBox},on:{change:t.inputLeverage}}),e("div",{staticClass:"CapitalAllocationCrypto-redactCountControl",class:"CapitalAllocationCrypto-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addLeverage(!0)},mousedown:function(e){return t.downChange("throttleStatus","addLeverage",[!0])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]):e("div",{staticClass:"CapitalAllocationCrypto-noLeverage",style:{color:t.getGreenColor.color}},[t._v("1")])])])]),e("div",{staticClass:"CapitalAllocationCrypto-amountInvest"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v("Будет инвестировано")])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-amountInvest-data",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.sumByLeverage))))])])])]),e("div",{staticClass:"CapitalAllocationCrypto-autoInvest"},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap",class:"CapitalAllocationCrypto-dataWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-label",class:"CapitalAllocationCrypto-dataWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v("Расчет ИИ")])]),e("div",{staticClass:"CapitalAllocationCrypto-dataWrap-data"},[e("div",{staticClass:"CapitalAllocationCrypto-ii"},[e("CheckBox",{attrs:{checked:t.statusII,size:32},on:{change:t.setIIStatus}}),e("div",{staticClass:"CapitalAllocationCrypto-ii-icon",style:{color:t.statusII?t.getBlueColor.color:t.getGrayColor.color}},[e("svgIcon",{attrs:{name:"Robot_Helper",size:40}})],1)],1)])])])])])},KN=[],ZN={name:"CapitalAllocationCrypto",inject:["setEquity","setReserveEquity","setPercent","setLeverage","setChecked"],components:{CheckBox:Ya},props:{remainedFreeEquity:{type:Number},statisticForCountOrders:{default:null},reserveEquity:{type:Number},freeEquity:{type:Number},usedLeverage:{type:Number},sumByLeverage:{type:Number},onlyCheckedInstruments:{default:null},lastQuotesSignals:{default:null},cryptoStatus:{type:Boolean}},data:function(){return{openCount:0,minVolumeOnOrder:100,throttleStatus:null,minInvestingSum:0,leverageNumberBox:1,statusII:!0}},mixins:[qe],watch:{usedLeverage:function(t){this.leverageNumberBox=t},onlyCheckedInstruments:{handler:function(){this.minInvestingSum=this.setMinInvestingSum(this.getDefaultVolumeOnContract),this.statusII&&this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum)},deep:!0},getStatusII:function(t){this.statusII=t}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},getStatusII:function(){if(this.getRecomendedSumForInvesting)return this.reserveEquity===this.getRecomendedSumForInvesting.investingSum&&this.usedLeverage===this.getRecomendedSumForInvesting.leverage},getDefaultVolumeOnContractCrypto:function(){var t=this;if(!this.onlyCheckedInstruments||!this.statisticForCountOrders||!this.lastQuotesSignals||!this.getContracts)return 0;var e=100,i=function(i){if(t.onlyCheckedInstruments[i]){var o=t.lastQuotesSignals.find((function(t){return t.s===i})).averagePrice,n=t.getContracts.find((function(t){return t.name===i})),s=n?n.minVolume:1,r=o*s;r>e&&(e=r)}};for(var o in this.onlyCheckedInstruments)i(o);return e},getDefaultVolumeOnContract:function(){return this.cryptoStatus?this.getDefaultVolumeOnContractCrypto:1e3},getMaxLeverage:function(){return this.getDefaultAccount.maxLeverage},getRecomendedSumForInvesting:function(){if(!this.minInvestingSum)return 0;var t=0,e=1,i=0;if(i=100*this.minInvestingSum/this.freeEquity,i<10){var o=.1*this.freeEquity,n=o/this.openCount;t=this.setMinInvestingSum(Math.ceil(n))}else if(i>=10&&i<=50)t=this.minInvestingSum;else if(i>50){if(1!==this.getMaxLeverage){var s=4,r=this.getMaxLeverage>30?30:this.getMaxLeverage;while(s<=8||t>=this.minInvestingSum){s++;for(var a=this.freeEquity*(10*s/100),c=2;c<=r;c++)if(c*a>=this.minInvestingSum)return e=c,t=a,{investingSum:t,leverage:e}}}this.unCheckInstrument()}return{investingSum:t,leverage:e}},getIconLeft:function(){return{name:"Arrow-expand-left",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}},getIconRight:function(){return{name:"Arrow-expand-right",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}}}),methods:{unCheckInstrument:function(){for(var t in this.onlyCheckedInstruments)if(this.onlyCheckedInstruments[t])return void this.setChecked({value:t,checked:!1})},setIIStatus:function(){this.getStatusII||(this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum),this.leverageNumberBox=this.getRecomendedSumForInvesting.leverage,this.setLeverage(this.leverageNumberBox))},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},setMinInvestingSum:function(t){var e=this;if(this.statisticForCountOrders){var i=0;this.openCount=0;var o=function(o){if(e.onlyCheckedInstruments[o]){var n=e.statisticForCountOrders.find((function(t){return t.contractName===o})).openCount;e.openCount+=n,i+=n*t}};for(var n in this.onlyCheckedInstruments)o(n);return Math.ceil(i)}},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},setValueEquity:function(t){this.setReserveEquity(t.target.valueAsNumber)},inputLeverage:function(t){var e=Math.abs(t.target.valueAsNumber);e<=this.getMaxLeverage&&e>0&&(this.leverageNumberBox=e,this.setLeverage(this.leverageNumberBox))},addLeverage:function(t){if(t){if(this.leverageNumberBox+1>this.getMaxLeverage)return;this.leverageNumberBox++}else{if(this.leverageNumberBox-1<=0)return;this.leverageNumberBox--}this.setLeverage(this.leverageNumberBox)}},mounted:function(){this.minInvestingSum=this.setMinInvestingSum(this.getDefaultVolumeOnContract),this.reserveEquity||(this.setReserveEquity(this.getRecomendedSumForInvesting.investingSum),this.leverageNumberBox=this.getRecomendedSumForInvesting.leverage,this.setLeverage(this.leverageNumberBox))}},tE=ZN,eE=(i("bfaf"),Object(C["a"])(tE,JN,KN,!1,null,"f6659f30",null)),iE=eE.exports,oE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"GradientSlider",class:t.rootClass,style:t.rootStyle},[e("div",{ref:"track",staticClass:"track"},[e("div",{ref:"thumb",staticClass:"thumb",on:{pointerdown:t.pointerdownHandler}},[t._v(t._s(t.thumbView))]),t.route?e("div",{staticClass:"route"}):t._e()]),t.range?e("div",{staticClass:"range"},t._l(t.getRangeArray,(function(i,o){return e("div",{key:i,staticClass:"sector"},[0===o?e("span",[t._v(t._s(t.range[0]))]):t._e(),e("span",{staticClass:"value"},[t._v(t._s(i))])])})),0):t._e()])},nE=[],sE={name:"GradientSlider",components:{},props:{positionSliderPercent:{type:Number,default:0},trackColor:{type:String},thumbColor:{type:String},route:{type:Boolean,default:!1},routeColor:{type:String,default:""},range:{type:[Array,Boolean]},thumbValue:{type:[String,Number]}},mixins:[xt],data:function(){return{trackEl:null,thumbEl:null,maxPosition:null,currentPosition:null,firstCoordinate:null,processPointer:!1}},watch:{positionSliderPercent:function(t){if(!this.processPointer){var e=this.maxPosition*t/100;this.thumbEl.style.transform="translate3d(".concat(e,"px, 0, 0)")}}},computed:{rootClass:function(){return Object(c["a"])({processPointer:this.processPointer},this.darkClass)},thumbView:function(){return this.thumbValue||0===this.thumbValue?this.thumbValue:this.positionSliderPercent.toFixed(1)},rootStyle:function(){return{"--position":this.positionSliderPercent+"%","--trackColor":this.trackColor,"--thumbColor":this.thumbColor,"--route-width":100-this.positionSliderPercent+"%","--route-color":this.routeColor}},getRangeArray:function(){if(this.range)return this.range.slice(1)}},methods:{pointerdownHandler:function(t){this.$emit("setPressed",!0),this.processPointer=!0,this.firstCoordinate=t.pageX,this.currentPosition=new WebKitCSSMatrix(getComputedStyle(this.thumbEl).transform).m41,document.body.style.cursor="grabbing",document.onpointermove=this.pointerMoveHandler,document.onpointerup=this.pointerUpHandler},pointerMoveHandler:function(t){var e=t.pageX,i=this.currentPosition+(e-this.firstCoordinate),o=100*i/this.maxPosition;o>100&&(o=100),o<0&&(o=0),this.$emit("setPercent",o),i<=0?this.thumbEl.style.transform="translate3d(0, 0, 0)":i>=this.maxPosition?this.thumbEl.style.transform="translate3d(".concat(this.maxPosition,"px, 0, 0)"):this.thumbEl.style.transform="translate3d(".concat(i,"px, 0, 0)")},pointerUpHandler:function(){document.body.style.cursor=null,document.onpointermove=null,document.onpointerup=null,this.firstCoordinate=null,this.currentPosition=null,this.processPointer=!1,this.$emit("setPressed",!1)}},mounted:function(){this.trackEl=this.$refs.track,this.thumbEl=this.$refs.thumb,this.maxPosition=this.trackEl.getBoundingClientRect().width-40;var t=this.maxPosition*this.positionSliderPercent/100;this.thumbEl.style.transform="translate3d(".concat(t,"px, 0, 0)")},destroyed:function(){}},rE=sE,aE=(i("1b72"),Object(C["a"])(rE,oE,nE,!1,null,"10531471",null)),cE=aE.exports,lE={name:"RiskManagementInvestCrypto",inject:["addInvest","setEquity","setPercent","setReserveEquity","setData"],mixins:[xt,qe],props:{allInstruments:{type:Array},statisticForCountOrders:{default:null},reserveEquity:{type:Number},sumByLeverage:{type:Number},usedLeverage:{type:Number},allChecked:{type:Boolean},checkedInstruments:{type:Object},onlyCheckedInstruments:{type:Array},priceTypeSignals:{type:String},currentStep:{type:Number},namePortfolio:{type:String},commonPrice:{type:Number},resultPrice:{type:Number},providerCopy:{type:Boolean},resultPercent:{type:[Number,String]},commonPercent:{type:[String,Number]},infoAccount:{type:Object},portfolio:{type:Boolean},findPortfolio:{type:Object},remainedFreeEquity:{type:Number},freeEquity:{type:Number},checkedExperts:{type:Array},experts:{type:Array}},components:{ButtonNavigationBlock:xW,CheckBoxStar:uN,RadioButton:$a,DxNumberBox:wt["DxNumberBox"],GradientSlider:cE,Avatar:E,CapitalAllocationCrypto:iE,VuePerfectScrollbar:Xt.a,DxLoadIndicator:wT.a},data:function(){return{notName:null,leverageNumberBox:1,isLoadingCreated:!1,lastQuotesSignals:null,signalsInfo:null,throttleStatus:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme",getApi:"api/api"})),{},{getCryptoStatusInvesting:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getLoadStatus:function(){return this.lastQuotesSignals&&this.allInstruments.length&&this.statisticForCountOrders},getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},getMaxLeverage:function(){return this.getDefaultAccount.maxLeverage},getAmountVolumeQty:function(){if(this.getSignalsInfo)return this.getSignalsInfo.reduce((function(t,e){return t+e.qty}),0)},getSignalsInfo:function(){return this.getCryptoStatusInvesting?this.getCryptoInfoSignals:this.getForexInfoSignals},getCountTransaction:function(){var t=this;return this.statisticForCountOrders&&this.getCheckedInstrumentsCount?this.statisticForCountOrders.reduce((function(e,i){return t.checkedInstruments[i.contractName]&&(e+=i.openCount),e}),0):0},getVolumeOnContract:function(){return this.sumByLeverage&&this.getCountTransaction?this.sumByLeverage/this.getCountTransaction:0},getIconLeft:function(){return{name:"Arrow-expand-left",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},getIconRight:function(){return{name:"Arrow-expand-right",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},disabledNext:function(){var t=this;return!this.getSignalsInfo||!this.getLoadStatus||this.getSignalsInfo.some((function(e){return!e.trueStatus&&t.checkedInstruments[e.contract]}))},allInstrumentsSorted:function(){var t=this;return Object(x["a"])(this.allInstruments).sort((function(e,i){return t.checkedInstruments[i.contract]-t.checkedInstruments[e.contract]}))},getForexInfoSignals:function(){var t=this,e=[];return this.allInstrumentsSorted.forEach((function(i){var o=t.getContracts.find((function(t){return t.name===i.contract}));e.push({contract:i.contract,minVolume:o.minVolume,maxVolume:o.maxVolume,trueStatus:!t.checkedInstruments[i.contract]||t.getVolumeOnContract>=o.minVolume&&t.getVolumeOnContract<=o.maxVolume})})),e.sort((function(t,e){return t.trueStatus-e.trueStatus})).sort((function(e,i){return t.checkedInstruments[i.contract]-t.checkedInstruments[e.contract]}))},getCryptoInfoSignals:function(){var t=this;if(this.lastQuotesSignals){var e=[];return this.allInstrumentsSorted.forEach((function(i){var o=t.getContracts.find((function(t){return t.name===i.contract}));if(o){var n=t.lastQuotesSignals.find((function(t){return t.s===i.contract})).averagePrice,s=o.volumeStep,r=o.stepPrecision,a=t.getVolumeOnContract?t.getVolumeOnContract/n:0,c=a>=s&&a%s;a=c?+(a-c).toFixed(r):+a.toFixed(r),e.push({contract:i.contract,minVolume:o.minVolume,maxVolume:o.maxVolume,quote:n,qty:t.checkedInstruments[i.contract]?a:0,trueStatus:!t.checkedInstruments[i.contract]||t.getVolumeOnContract/n>=o.minVolume&&t.getVolumeOnContract/n<=o.maxVolume})}})),e.sort((function(t,e){return t.trueStatus-e.trueStatus})).sort((function(e,i){return t.checkedInstruments[i.contract]-t.checkedInstruments[e.contract]}))}},getCheckedInstrumentsCount:function(){var t;return null===(t=Object.values(this.checkedInstruments).filter((function(t){return t})))||void 0===t?void 0:t.length},getCheckedInstrument:function(){return this.providerCopy?this.checkedInstruments:this.experts},srcAvatar:function(){return this.portfolio?this.findPortfolio.avatar:this.infoAccount.avatar}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{uncheckInstrument:function(){this.setChecked({value:"all",checked:!1})},getCountTransactionOnContract:function(t){if(!this.statisticForCountOrders)return 0;var e=this.statisticForCountOrders.find((function(e){return e.contractName===t}));return e?e.openCount:0},setValueEquity:function(t){this.setReserveEquity(t.target.valueAsNumber)},setLastQuotes:function(){var t={command:"LastQuotes",method:"get",data:null};this.$socketStream.sendCommand({ws:"apiWS2",command:t})},setNotName:function(t){this.notName=t},setMessageHandler:function(t){"LastQuotes"===t.command&&(this.lastQuotesSignals=t.data)},saveInvestmentPorfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoadingCreated=!0,e.next=3,t.addInvest();case 3:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingCreated=!1;case 5:case"end":return e.stop()}}),e)})))()}}),mounted:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler),this.setLastQuotes()},destroyed:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler)}},uE=lE,dE=(i("daf2"),Object(C["a"])(uE,XN,QN,!1,null,"5adc1e92",null)),hE=dE.exports,pE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CapitalAllocation",class:t.darkClass},[e("UseCapitalPercent",{attrs:{positionSliderPercent:t.positionSliderPercent,usedLeverage:t.usedLeverage,reserveEquity:t.reserveEquity,remainedFreeEquity:t.remainedFreeEquity,valueLeverage:t.valueLeverage,sumByLeverage:t.sumByLeverage,countContract:t.checkedExperts.length}}),e("transition",{attrs:{name:"fade"}},[t.error?e("div",{staticClass:"errorNextStep"},[t._v("Минимальная сумма инвестирования $ "+t._s(t.minInvestFormatted))]):t._e()]),e("ButtonNavigationBlock",{attrs:{currentStep:t.currentStep,disabledNext:t.disabledNext,additionalVerification:t.additionalVerification}})],1)},gE=[],fE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UseCapitalPercent",class:t.rootClass,style:t.styleRoot},[e("div",{staticClass:"containerBorder"},[e("div",{staticClass:"freeAndReserveEquity"},[e("div",{staticClass:"freeEquity"},[e("span",{staticClass:"label"},[t._v(t._s(t.$t("available_funds")))]),t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.freeEquityFormatted)))]),e("div",{staticClass:"buttonsEquity"},[e("div",{staticClass:"topButton",on:{click:function(e){return t.setEquity(1e3)},pointerdown:function(e){return t.mousedownHandler(e,1e3)},pointerup:t.mouseupHandler}},[e("svgIcon",t._b({},"svgIcon",t.iconLeft,!1))],1),e("div",{staticClass:"bottomButton",on:{click:function(e){return t.setEquity(-1e3)},pointerdown:function(e){return t.mousedownHandler(e,-1e3)},pointerup:t.mouseupHandler}},[e("svgIcon",t._b({},"svgIcon",t.iconRight,!1))],1)]),e("div",{staticClass:"reserveEquity"},[e("span",{staticClass:"label"},[t._v(t._s(t.$t("reserved_amount")))]),t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.reserveEquityFormatted)))]),e("PieCss",{attrs:{positionSliderPercent:t.positionSliderPercent}})],1),e("div",{staticClass:"sliderContainer"},[e("div",{staticClass:"meter"},[e("div",{staticClass:"progress",style:{width:t.positionSliderPercent+"%"}})]),e("div",{staticClass:"titleSlider"},[t._v(t._s(t.$t(t.providerCopy?"wpofdyptiii":"wpofdyptiit")))]),e("div",{staticClass:"wrapper"},[e("div",{staticClass:"numberBoxContainer"},[e("DxNumberBox",{attrs:{width:"115",height:"34",min:0,max:100,"show-spin-buttons":!0,value:t.positionSliderPercent,step:.1,format:"#0.# '%'",elementAttr:{class:"numberBox"}},on:{valueChanged:t.changeValue}})],1),e("GradientSlider",{staticClass:"percentValueSlider",attrs:{positionSliderPercent:t.positionSliderPercent,trackColor:t.trackPercentColor,thumbColor:t.thumbPercentColor,thumbValue:t.thumbValuePercent,route:!0,routeColor:t.routeColor,range:t.rangePercent},on:{setPercent:t.setPercent,setPressed:t.setPressedPercent}})],1)])]),e("div",{staticClass:"containerBorder flex-grow"},[t.rangeLeverage?e("div",{staticClass:"sliderContainer leverage"},[e("div",{staticClass:"titleSlider"},[t._v(t._s(t.$t("leverage_full")))]),e("div",{staticClass:"wrapper"},[e("div",{staticClass:"numberBoxContainer"},[e("DxNumberBox",{attrs:{width:"115",height:"34",format:"#0",min:1,max:t.maxLeverage,"show-spin-buttons":!0,step:1,elementAttr:{class:"numberBox"},value:t.leverageNumberBox},on:{valueChanged:t.changeValueLeverage}})],1),e("GradientSlider",{ref:"sliderLeverage",attrs:{positionSliderPercent:t.usedLeverage,trackColor:t.linearTrackLeverage,thumbColor:t.linearTrackLeverage,range:t.rangeLeverage,thumbValue:t.thumbValueLeverage},on:{setPercent:t.setLeverage,setPressed:t.setPressed}})],1)]):t._e(),e("div",{staticClass:"sumWithLeverage"},[e("span",{staticClass:"floatingTitle"},[t._v(t._s(t.$t("iail")))]),t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.sumByLeverageFormatted)))]),e("div",{staticClass:"sumWithLeverage sumContract"},[e("span",{staticClass:"floatingTitle"},[t._v(t._s(t.$t(t.providerCopy?"afpdai":"afpdap")))]),t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.sumByOneContract)))])])])},mE=[],vE=i("7ea3"),yE=i.n(vE),CE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PieCss",class:t.darkClass},[e("div",{staticClass:"pie",style:t.pieStyle})])},bE=[],SE={name:"PieCss",components:{},props:{positionSliderPercent:{type:Number}},mixins:[xt],data:function(){return{}},watch:{},computed:{pieStyle:function(){return{"--percent":this.positionSliderPercent,"--b":"15px"}}}},PE=SE,TE=(i("cf17"),Object(C["a"])(PE,CE,bE,!1,null,"53fdb600",null)),xE=TE.exports,OE={name:"UseCapitalPercent",inject:["setLeveragePercent","setPercent","setEquity"],mixins:[xt],props:{positionSliderPercent:{type:Number},usedLeverage:{type:Number},reserveEquity:{type:Number},remainedFreeEquity:{type:Number},valueLeverage:{type:Number},sumByLeverage:{type:Number},countContract:{type:Number},providerCopy:{type:Boolean}},components:{DxNumberBox:vE["DxNumberBox"],GradientSlider:cE,PieCss:xE},data:function(){return{trackEl:null,thumbEl:null,currentPosition:null,firstCoordinate:null,processPointer:!1,stepEdit:0,isDown:!1,intervalId:null,timeInterval:null,leverageNumberBox:1,pressedLeverage:!1,pressedPercent:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{styleRoot:function(){var t;switch(!0){case this.valueLeverage>=1&&this.valueLeverage<5:t=this.darkClass.dark?"#00ffac":"#008E72";break;case this.valueLeverage>=5&&this.valueLeverage<10:t="orange";break;default:t=this.darkClass.dark?"#FF3B05":"#960000"}return{"--color":t}},rootClass:function(){return Object(c["a"])({},this.darkClass)},getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},maxLeverage:function(){return this.getDefaultAccount.maxLeverage},linearTrackLeverage:function(){return"linear-gradient(90deg, #027000 0.75%, #42A554 15.75%, #FEE400 33.75%, #F26C0A 58.25%, #960000 96.75%)"},trackPercentColor:function(){return this.darkClass.dark?"#23313f":"#DBDBDB"},thumbPercentColor:function(){return"#fff"},routeColor:function(){return this.darkClass.dark?"#00b9fc":"#3C73F1"},rangePercent:function(){return["0%","25%","50%","75%","100%"]},rangeLeverage:function(){if(1===this.maxLeverage)return!1;if(2==this.maxLeverage)return[1,2];if(3===this.maxLeverage)return[1,2,3];if(5===this.maxLeverage)return[1,2,3,4,5];var t=this.maxLeverage/4;return[1,1*t,2*t,3*t,4*t]},thumbValuePercent:function(){return 0===this.positionSliderPercent?0:this.positionSliderPercent.toFixed(1)},thumbValueLeverage:function(){return this.valueLeverage},freeEquityFormatted:function(){return Lm(this.remainedFreeEquity,2,!0)},reserveEquityFormatted:function(){return Lm(this.reserveEquity,2,!0)},sumByLeverageFormatted:function(){return Lm(this.sumByLeverage,2,!0)},sumByOneContract:function(){return Lm(this.sumByLeverage/this.countContract,2,!0)},iconLeft:function(){return{name:"Arrow-expand-left",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconRight:function(){return{name:"Arrow-expand-right",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}}}),watch:{isDown:function(t){var e=this;t?this.intervalId=setInterval((function(){e.setEquity(e.stepEdit)}),130):clearInterval(this.intervalId)},valueLeverage:function(t){this.pressedLeverage&&(this.leverageNumberBox=t)}},mounted:function(){var t=this.usedLeverage*(this.maxLeverage-1)/100+1;this.leverageNumberBox=+t.toFixed(1)},methods:{changeValue:function(t){if(!this.pressedPercent&&t.event){var e=Math.round(10*t.value)/10;this.setPercent(e)}},changeValueLeverage:function(t){if(!this.pressedLeverage){this.leverageNumberBox=t.value;var e=this.$refs.sliderLeverage.$el.getBoundingClientRect().width,i=e-40,o=i/this.maxLeverage,n=100*o/i,s=(t.value-1)*n;t.value===this.maxLeverage&&(s=100),this.setLeverage(s)}},setLeverage:function(t){this.setLeveragePercent(t)},mousedownHandler:function(t,e){var i=this;t.preventDefault(),this.timeInterval=setTimeout((function(){i.stepEdit=e,i.isDown=!0}),700)},mouseupHandler:function(t){t.preventDefault(),this.isDown=!1,clearTimeout(this.timeInterval)},setPressed:function(t){this.pressedLeverage=t},setPressedPercent:function(t){this.pressedPercent=t}}},wE=OE,_E=(i("b0f8"),Object(C["a"])(wE,fE,mE,!1,null,"7cd051ac",null)),AE=_E.exports,DE={name:"CapitalAllocation",mixins:[xt],props:{currentStep:{type:Number},checkedExperts:{type:Array},positionSliderPercent:{type:Number},usedLeverage:{type:Number},reserveEquity:{type:Number},remainedFreeEquity:{type:Number},valueLeverage:{type:Number},sumByLeverage:{type:Number}},components:{ButtonNavigationBlock:xW,UseCapitalPercent:AE},data:function(){return{error:!1}},computed:{disabledNext:function(){return 0===this.checkedExperts.length},minInvest:function(){return 1e3*this.checkedExperts.length},minInvestFormatted:function(){return Lm(this.minInvest,2,!0)}},watch:{sumByLeverage:function(t){this.error=t=this.minInvest}}},kE=DE,IE=(i("7557"),i("eb3c"),Object(C["a"])(kE,pE,gE,!1,null,"6bcdc9d9",null)),BE=IE.exports,ME=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CapitalAllocationInstruments",class:t.darkClass},[e("UseCapitalPercent",{attrs:{useCapitalPercent:t.useCapitalPercent,investmentAmount:t.investmentAmount,percentageCapitalUse:t.percentageCapitalUse,positionSliderPercent:t.positionSliderPercent,usedLeverage:t.usedLeverage,reserveEquity:t.reserveEquity,remainedFreeEquity:t.remainedFreeEquity,valueLeverage:t.valueLeverage,sumByLeverage:t.sumByLeverage,countContract:t.onlyCheckedInstruments.length,providerCopy:t.providerCopy}}),e("transition",{attrs:{name:"fade"}},[t.error?e("div",{staticClass:"errorNextStep"},[t._v("Минимальная сумма инвестирования $ "+t._s(t.minInvestFormatted))]):t._e()]),e("ButtonNavigationBlock",{attrs:{currentStep:t.currentStep,additionalVerification:t.additionalVerification}})],1)},$E=[],LE={name:"CapitalAllocationInstruments",mixins:[xt],props:{currentStep:{type:Number},cryptoStatus:{type:Boolean},percentageCapitalUse:{type:Number},investmentAmount:{type:Number},checkedInstruments:{type:Object},onlyCheckedInstruments:{type:Array},priceTypeSignals:{type:String},resultPrice:{type:Number},resultPercent:{type:[Number,String]},portfolio:{type:Boolean},useCapitalPercent:{type:Object},positionSliderPercent:{type:Number},usedLeverage:{type:Number},reserveEquity:{type:Number},remainedFreeEquity:{type:Number},valueLeverage:{type:Number},sumByLeverage:{type:Number},providerCopy:{type:Boolean}},components:{UseCapitalPercent:AE,ButtonNavigationBlock:xW},data:function(){return{error:!1}},computed:{minInvest:function(){return 1e3*this.onlyCheckedInstruments.length},minInvestFormatted:function(){return Lm(this.minInvest,2,!0)}},watch:{sumByLeverage:function(t){this.error=t=this.minInvest}}},FE=LE,jE=(i("ce2e"),Object(C["a"])(FE,ME,$E,!1,null,"02a2158a",null)),RE=jE.exports,WE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RiskManagement",class:t.darkClass},[e("div",{staticClass:"commonSum"},[e("span",{staticClass:"title"},[t._v(t._s(t.$t("you_are_investing")))]),e("span",{staticClass:"amount"},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.sumByLeverageFormatted)))])]),e("div",{staticClass:"investmentParameters"},[e(t.investMethodComponent,t._b({tag:"component",attrs:{hideTooltip:t.hideTooltip,viewTooltipHandler:t.viewTooltipHandler}},"component",t.propsComponentsMethod[t.investMethodComponent],!1))],1),e("LossLimitation",{attrs:{sumByLeverage:t.sumByLeverage,ddPercentMax:t.ddPercentMax,hideTooltip:t.hideTooltip,viewTooltipHandler:t.viewTooltipHandler,currencyChar:this.getCurrencyChar}}),e("ButtonNavigationBlock",{attrs:{currentStep:t.currentStep}}),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTooltipLeftTop,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},NE=[],EE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LossLimitation",class:t.darkClass},[e("header",[t._v(t._s(t.$t("ltloc"))),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltip)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"contentLoss"},[e("div",{staticClass:"numberBoxBlock"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("suspend_when_reached")))]),e("DxNumberBox",{attrs:{width:"180",height:"70",min:t.min,max:100,"show-spin-buttons":!0,value:t.ddPercentMax,step:t.step,elementAttr:{class:"numberBox"},format:"#0.# '%'"},on:{valueChanged:function(e){return t.changedValue(e)}}})],1),e("div",{staticClass:"remained",style:t.remainedStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("funds_left")))]),e("div",{staticClass:"value green"},[t._v(t._s(t.remainsFormatted))])]),e("div",{staticClass:"loss",style:t.lossStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("loss")))]),e("div",{staticClass:"value red"},[t._v(t._s(t.lossFormatted))])])])])},UE=[],VE={name:"LossLimitation",mixins:[xt],inject:["setData"],props:{hideTooltip:{type:Function},viewTooltipHandler:{type:Function},ddPercentMax:{type:Number},sumByLeverage:{type:Number},currencyChar:{type:String}},components:{DxNumberBox:vE["DxNumberBox"]},data:function(){return{step:1,min:.1}},computed:{iconDataFaq:function(){return{name:"FAQ-16",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},textTooltip:function(){return this.$t("swrtpoafatl")},loss:function(){return this.sumByLeverage*this.ddPercentMax/100},lossFormatted:function(){return"".concat(this.currencyChar," ").concat(Lm(Math.floor(this.loss),2,!0))},remains:function(){return this.sumByLeverage-this.loss},remainsFormatted:function(){return"".concat(this.currencyChar," ").concat(Lm(Math.floor(this.remains),2,!0))},remainedStyle:function(){return{"--width-remained":100*this.remains/this.sumByLeverage+"%"}},lossStyle:function(){return{"--width-loss":100*this.loss/this.sumByLeverage+"%"}}},methods:{changedValue:function(t){if(t.event){var e=t.value;switch(!0){case!e:this.step=.1,e=.1;break;case e<=1&&1===this.step:this.step=.1;break;case e%1!==0&&e>1:this.step=1,e=Math.trunc(e)+1;break}this.setData({value:e},"ddPercentMax")}}}},HE=VE,GE=(i("0c5f"),Object(C["a"])(HE,EE,UE,!1,null,"0c7c1a66",null)),qE=GE.exports,zE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InvestmentMethod",class:t.darkClass},[e("header",[t._v(t._s(t.$t("investment_method"))),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltip)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"contentInvest",class:{investTop:t.investTop}},[t.investTop?t._e():e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.investType,expression:"investType"}],attrs:{type:"radio",name:"investMethod",value:"Fixed"},domProps:{checked:t._q(t.investType,"Fixed")},on:{change:function(e){t.investType="Fixed"}}}),e("span",{staticClass:"pseudo"}),e("span",{staticClass:"textRadio"},[t._v(t._s(t.$t("fixed")))])]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.investType,expression:"investType"}],attrs:{type:"radio",name:"investMethod",value:"Dynamic"},domProps:{checked:t._q(t.investType,"Dynamic")},on:{change:function(e){t.investType="Dynamic"}}}),e("span",{staticClass:"pseudo"}),e("span",{staticClass:"textRadio"},[t._v(t._s(t.$t("dynamic")))])]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.investType,expression:"investType"}],attrs:{type:"radio",name:"investMethod",value:"Active"},domProps:{checked:t._q(t.investType,"Active")},on:{change:function(e){t.investType="Active"}}}),e("span",{staticClass:"pseudo"}),e("span",{staticClass:"textRadio"},[t._v(t._s(t.$t("active")))])])])])},YE=[],XE={name:"InvestmentMethod",mixins:[xt],inject:["setData"],props:{hideTooltip:{type:Function},viewTooltipHandler:{type:Function},valueTransactions:{type:String},investTop:{type:Boolean}},data:function(){return{investType:this.valueTransactions}},computed:{iconDataFaq:function(){return{name:"FAQ-16",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},textTooltip:function(){switch(this.valueTransactions){case"Fixed":return this.$t("fimafviattt");case"Dynamic":return this.$t("dimtvoticrt");case"Active":return this.$t("aimasnotiaf");default:return""}}},watch:{investType:function(t){this.setData({value:t},"valueTransactions")}}},QE=XE,JE=(i("5266"),Object(C["a"])(QE,zE,YE,!1,null,"1818d68f",null)),KE=JE.exports,ZE=function(){var t=this,e=t._self._c;return e("div",{staticClass:"FixedMethod",class:t.darkClass},[e("div",{staticClass:"volume"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("volume_per_trade")))]),e("div",{staticClass:"numberBoxBlock"},[e("DxNumberBox",{attrs:{width:"134",height:"48",min:1e3,max:t.maxValueLot,"show-spin-buttons":!0,value:t.valueLot,step:1e3,format:"'$' ###",elementAttr:{class:"numberBox"}},on:{valueChanged:function(e){return t.setData(e,"valueLot")}}})],1),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipValueLot)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"percent",class:{error:t.infoPercent>=1}},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("percentage_of_trade")))]),e("div",{staticClass:"value"},[t._v(t._s(t.infoPercentFormatted)+" %")]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipPercent)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1)]),e("div",{staticClass:"commonCount",style:t.commonCountStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("cnot")))]),e("div",{staticClass:"value"},[t._v(t._s(t.estimatedNumber))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipEstimatedNumber)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1)]),e("div",{staticClass:"providerCount",style:t.providerCountStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.titleProviderCount))]),e("div",{staticClass:"value"},[t._v(t._s(t.transactionsPerProvider))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipTransactionsPerProvider)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1)])])},tU=[],eU={name:"FixedMethod",mixins:[xt],inject:["setData"],props:{hideTooltip:{type:Function},viewTooltipHandler:{type:Function},valueLot:{type:Number},maxValueLot:{type:Number},investmentAmount:{type:Number},checkedExperts:{type:Array},providerCopy:{type:Boolean}},components:{DxNumberBox:vE["DxNumberBox"]},data:function(){return{minValueLot:1e3}},computed:{iconDataFaq:function(){return{name:"FAQ-16",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},titleProviderCount:function(){return this.providerCopy?this.$t("trades_per_instrument"):this.$t("trades_per_provider")},textTooltipValueLot:function(){return this.$t("aoafptcatti")},textTooltipPercent:function(){return this.$t("spotafatwtv")},textTooltipTransactionsPerProvider:function(){return this.providerCopy?this.$t("notateiitp"):this.$t("notatepitp")},textTooltipEstimatedNumber:function(){return this.$t("notciawtcao")},infoPercent:function(){return 100*this.valueLot/this.investmentAmount},infoPercentFormatted:function(){return Lm(this.infoPercent,2)},estimatedNumber:function(){var t=Math.floor(this.investmentAmount/this.valueLot);return t-t%this.checkedExperts.length},transactionsPerProvider:function(){return Math.floor(this.investmentAmount/this.valueLot/this.checkedExperts.length)},commonCountStyle:function(){var t=Math.floor(this.investmentAmount/this.minValueLot);return{"--width-common-count":100*this.estimatedNumber/t+"%"}},providerCountStyle:function(){var t=Math.floor(this.investmentAmount/1e3/this.checkedExperts.length);return{"--width-provider-count":100*this.transactionsPerProvider/t+"%"}}}},iU=eU,oU=(i("10ae"),Object(C["a"])(iU,ZE,tU,!1,null,"37390d38",null)),nU=oU.exports,sU=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DynamicMethod",class:t.darkClass},[e("div",{staticClass:"percent",class:{error:t.percent>=1}},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("percentage_of_trade")))]),e("div",{staticClass:"numberBoxBlock"},[e("DxNumberBox",{attrs:{width:"134",height:"48",format:"#0.## '%'",min:t.minPercent,max:t.maxPercent,"show-spin-buttons":!0,value:t.percent,step:t.minPercent,elementAttr:{class:"numberBox"}},on:{valueChanged:function(e){return t.setData(e,"percent")}}})],1),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipPercent)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"valumeTransaction"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("cvpt"))+", $")]),e("div",{staticClass:"value"},[t._v("$ "+t._s(t.dynamicVolumeFormatted))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipValueLot)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"calcCount",style:t.calcCountStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("cnot")))]),e("div",{staticClass:"value"},[t._v(t._s(t.estimatedNumber))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipEstimatedNumber)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"commonCount",style:t.commonCountStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.titleCommonCount))]),e("div",{staticClass:"value"},[t._v(t._s(t.countTransactionByProviderFormatted))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipTransactionsPerProvider)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)])])},rU=[],aU={name:"DynamicMethod",mixins:[xt],inject:["setData"],props:{hideTooltip:{type:Function},viewTooltipHandler:{type:Function},investmentAmount:{type:Number},minPercent:{type:Number},maxPercent:{type:Number},percent:{type:Number},checkedExperts:{type:Array},providerCopy:{type:Boolean}},components:{DxNumberBox:vE["DxNumberBox"]},data:function(){return{}},computed:{iconDataFaq:function(){return{name:"FAQ-16",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},titleCommonCount:function(){return this.providerCopy?this.$t("cnotpi"):this.$t("cnotpp")},textTooltipPercent:function(){return this.$t("spotafatwtv")},textTooltipValueLot:function(){return this.$t("aoafptcatti")},textTooltipEstimatedNumber:function(){return this.$t("notciawtcao")},textTooltipTransactionsPerProvider:function(){return this.providerCopy?this.$t("notateiitp"):this.$t("notatepitp")},dynamicVolume:function(){return+this.percent/100*this.investmentAmount},dynamicVolumeFormatted:function(){return Lm(this.dynamicVolume,2,!0)},estimatedNumber:function(){var t=Math.floor(this.investmentAmount/this.dynamicVolume);return t-t%this.checkedExperts.length},maxCountTransactionByProvider:function(){return this.investmentAmount/1e3/this.checkedExperts.length},countTransactionByProvider:function(){return this.investmentAmount/this.dynamicVolume/this.checkedExperts.length},countTransactionByProviderFormatted:function(){return Lm(Math.floor(this.countTransactionByProvider),2,!0)},commonCountStyle:function(){return{"--width-common-count":100*this.countTransactionByProvider/this.maxCountTransactionByProvider+"%"}},calcCountStyle:function(){var t=Math.floor(this.investmentAmount/1e3);return{"--width-calc-count":100*this.estimatedNumber/t+"%"}}}},cU=aU,lU=(i("2110"),Object(C["a"])(cU,sU,rU,!1,null,"18c232cd",null)),uU=lU.exports,dU=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ActiveMethod",class:t.darkClass},[e("div",{staticClass:"investingCapital",style:t.investCapitalStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("calculated_capital")))]),e("div",{staticClass:"value"},[t._v(t._s("".concat(t.currencyChar," ").concat(t.investmentAmountCalc)))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipAmountCalc)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1)]),e("div",{staticClass:"providers"},[e("div",{staticClass:"title"},[t._v(t._s(t.providerCopy?t.$t("provider"):t.$t("providers")))]),t.providerCopy?e("div",{staticClass:"valueProviderCopy"},[e("img",{staticClass:"avatar",attrs:{src:t.infoAccount.avatar,alt:""}}),e("div",{staticClass:"nameProvider"},[t._v(t._s(t.infoAccount.traderName))])]):e("div",{staticClass:"value"},[t._v(t._s(t.checkedExperts.length)+" - "),e("div",{staticClass:"avatarsProvider"},[t._l(t.avatars,(function(t){return e("img",{attrs:{src:t,alt:""}})})),t.dopAvatars?e("div",{staticClass:"dopCircle",class:{twoNumber:t.dopAvatars>9}},[e("span",[t._v("+"+t._s(t.dopAvatars))])]):t._e()],2)]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipCountProviders)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"transactionPerProvider"},[e("div",{staticClass:"title"},[t._v(t._s(t.transactionPerProviderTitle))]),e("div",{staticClass:"numberBoxBlock"},[e("DxNumberBox",{attrs:{width:"180",height:"70",min:1,max:t.maxCountTransaction,"show-spin-buttons":!0,value:t.countTransaction,step:1,elementAttr:{class:"numberBox"}},on:{valueChanged:function(e){return t.setData(e,"countTransaction")}}})],1),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipTransactionsPerProvider)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),e("div",{staticClass:"commonCount",style:t.commonCountStyle},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("total_contracts")))]),e("div",{staticClass:"value"},[t._v(t._s(t.commonCountTransaction))]),e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipEstimatedNumber)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)]),t.getCryptoStatus?e("div",{staticClass:"volume"},["USDT"===t.activeTypeVolume?e("div",{staticClass:"volumeWrap"},[e("div",{staticClass:"title"},[t._v(t._s("".concat(t.$t("volume_per_contract"),", ").concat(t.currencyChar)))]),e("div",{staticClass:"value"},[t._v(t._s("".concat(t.currencyChar," ").concat(t.volumeByTransactionFormatted)))])]):t._e(),"Qty"===t.activeTypeVolume?e("div",{staticClass:"volumeWrap"},[e("div",{staticClass:"title"},[t._v(t._s("".concat(t.$t("volume_per_contract"),", Qty")))]),t.getVolumeByQty?e("VuePerfectScrollbar",{staticClass:"valueCrypto"},t._l(t.getVolumeByQty,(function(i,o){return e("div",{key:o,staticClass:"valueCrypto-row",class:"valueCrypto-row_".concat(t.getActiveTheme)},[e("div",[t._v(t._s(i.contract))]),e("div",[t._v(t._s(i.volume))])])})),0):t._e()],1):t._e(),e("div",{staticClass:"svgWrapper"},[e("DxSelectBox",{attrs:{width:"77",height:"24",activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setVolumeType,items:t.typeVolumes,value:t.activeTypeVolume},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"ActiveMethod-volumeType",class:t.darkClass},[t._v(t._s(o))])]}}],null,!1,3711977057)}),e("div",{staticClass:"svgWrapper-svg",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.textTooltipValueLot)},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFaq,!1))],1)],1)]):e("div",{staticClass:"volume"},[e("div",{staticClass:"title"},[t._v(t._s("".concat(t.$t("volume_per_contract"),", ").concat(t.currencyChar)))]),e("div",{staticClass:"value"},[t._v(t._s("".concat(t.currencyChar," ").concat(t.volumeByTransactionFormatted)))])])])},hU=[],pU={name:"ActiveMethod",mixins:[xt],inject:["setData"],props:{hideTooltip:{type:Function},viewTooltipHandler:{type:Function},investmentAmount:{type:Number},investmentAmountFormatted:{type:String},checkedExperts:{type:Array},findPortfolio:{type:Object},countTransaction:{type:Number},providerCopy:{type:Boolean},infoAccount:{type:Object},sumByLeverage:{type:Number},currencyChar:{type:String}},components:{DxNumberBox:wt["DxNumberBox"],DxSelectBox:wt["DxSelectBox"],VuePerfectScrollbar:Xt.a},data:function(){return{typeVolumes:["USDT","Qty"],activeTypeVolume:"USDT",lastQuotes:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},iconDataFaq:function(){return{name:"FAQ-16",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},getVolumeByQty:function(){return this.providerCopy?this.getVolumeByQtyProvide:this.getVolumeByQtyPortfolio},getVolumeByQtyProvide:function(){var t=this;if(this.lastQuotes)return this.checkedExperts.map((function(e){return{contract:e.contract,volume:t.getSignalVolumeForCrypto(e.contract,t.volumeByTransaction)}}))},getVolumeByQtyPortfolio:function(){var t=this;if(this.lastQuotes)return this.findPortfolio.sources.map((function(e){return{contract:e.contract,volume:t.getSignalVolumeForCrypto(e.contract,t.volumeByTransaction)}}))},transactionPerProviderTitle:function(){return this.providerCopy?this.$t("trades_per_instrument"):this.$t("trades_per_provider")},textTooltipAmountCalc:function(){return this.$t("pottnotbtvp")},textTooltipCountProviders:function(){return this.$t("nopitp")},textTooltipTransactionsPerProvider:function(){return this.providerCopy?this.$t("notateiitp"):this.$t("notatepitp")},textTooltipEstimatedNumber:function(){return this.$t("notciawtcao")},textTooltipValueLot:function(){return this.$t("aoafptcatti")},maxCountTransaction:function(){return Math.floor(this.sumByLeverage/this.checkedExperts.length/1e3)},volumeByTransaction:function(){var t=this.checkedExperts.length,e=Math.floor(this.sumByLeverage/(t*this.countTransaction));return e-e%1e3},volumeByTransactionFormatted:function(){return Lm(this.volumeByTransaction,0,!0)},commonCountTransaction:function(){return Lm(this.countTransaction*this.checkedExperts.length,0,!0)},avatars:function(){var t=this.checkedExperts.map((function(t){return"User-profile.png"===t.avatar?i("81bc"):t.avatar}));return t.slice(0,12)},dopAvatars:function(){return this.checkedExperts.length>12&&this.checkedExperts.length-12},percentByCapital:function(){var t=this.countTransaction*this.checkedExperts.length;return this.volumeByTransaction*t*100/this.sumByLeverage},investmentAmountCalc:function(){return Lm(this.volumeByTransaction*(this.countTransaction*this.checkedExperts.length),2,!0)},investCapitalStyle:function(){return{"--width-invest-capital":this.percentByCapital+"%"}},commonCountStyle:function(){var t=this.maxCountTransaction*this.checkedExperts.length,e=this.countTransaction*this.checkedExperts.length;return{"--width-common-count":100*e/t+"%"}}}),methods:{getSignalVolumeForCrypto:function(t,e){var i=this.getContracts.find((function(e){return e.name===t})),o=i.minVolume,n=i.maxVolume,s=i.volumeStep,r=i.stepPrecision,a=this.lastQuotes.find((function(e){return e.s===t})).averagePrice,c=e/a,l=c>=s&&c%s;return l?c-l>=o?c-l<=n?+(c-l).toFixed(r):n:o:c>=o?c<=n?+c.toFixed(r):n:o},setLastQuotes:function(){var t={command:"LastQuotes",method:"get",data:null};this.$socketStream.sendCommand({ws:"apiWS2",command:t})},setVolumeType:function(t){this.activeTypeVolume=t.value,"Qty"!==this.activeTypeVolume||this.lastQuotes||this.setLastQuotes()},setMessageHandler:function(t){"LastQuotes"===t.command&&(this.lastQuotes=t.data)}},mounted:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler),this.countTransaction>this.maxCountTransaction&&this.setData({value:this.maxCountTransaction},"countTransaction")},destroyed:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler)}},gU=pU,fU=(i("f942"),Object(C["a"])(gU,dU,hU,!1,null,"ea1ad308",null)),mU=fU.exports,vU={name:"RiskManagementInvest",inject:["setData"],mixins:[xt,Ot],props:{investmentAmount:{type:Number},valueTransactions:{type:String},valueLot:{type:Number},percent:{type:Number},noLimit:{type:Boolean},valueCount:{type:Number},ddPercentMax:{type:Number},currentStep:{type:Number},minPercent:{type:Number},maxPercent:{type:Number},checkedExperts:{type:Array},findPortfolio:{type:Object},countTransaction:{type:Number},providerCopy:{type:Boolean,default:!1},infoAccount:{type:Object,default:function(){return{}}},investTop:{type:Boolean},sumByLeverage:{type:Number}},components:{DxNumberBox:vE["DxNumberBox"],DxCheckBox:Th["DxCheckBox"],ButtonNavigationBlock:xW,LossLimitation:qE,InvestmentMethod:KE,FixedMethod:nU,DynamicMethod:uU,ActiveMethod:mU},data:function(){return{textTooltip:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){return this.getDefaultAccount.currencyChar},maxValueLot:function(){var t=Math.floor(this.investmentAmount/this.checkedExperts.length);return t-t%1e3},investMethodComponent:function(){return this.valueTransactions+"Method"},investmentAmountFormatted:function(){return Lm(Math.floor(this.investmentAmount),2,!0)},propsComponentsMethod:function(){return{FixedMethod:{investmentAmount:this.investmentAmount,valueLot:this.valueLot,maxValueLot:this.maxValueLot,checkedExperts:this.checkedExperts,providerCopy:this.providerCopy},DynamicMethod:{investmentAmount:this.investmentAmount,minPercent:this.minPercent,maxPercent:this.maxPercent,percent:this.percent,checkedExperts:this.checkedExperts,providerCopy:this.providerCopy},ActiveMethod:{investmentAmount:this.investmentAmount,investmentAmountFormatted:this.investmentAmountFormatted,checkedExperts:this.checkedExperts,countTransaction:this.countTransaction,providerCopy:this.providerCopy,infoAccount:this.infoAccount,sumByLeverage:this.sumByLeverage,currencyChar:this.getCurrencyChar,findPortfolio:this.findPortfolio}}},infoPercent:function(){return 100*this.valueLot/this.investmentAmount},infoPercentFormatted:function(){return Lm(this.infoPercent,2)},estimatedNumber:function(){return Math.floor(this.investmentAmount/this.valueLot)},visibilityByTransaction:function(){return"volume"===this.valueTransactions.value},classForDinamicVolume:function(){return{green:this.infoPercent<=20,orange:this.infoPercent>20&&this.percent<30,red:this.infoPercent>=30}},dinamicVolume:function(){return+this.percent/100*this.investmentAmount},disabledButtonCount:function(){return this.noLimit},getValueTransactions:function(){var t=0;return"volume"===this.valueTransactions.value&&(t=1),this.transactionsItems[t]},sumByLeverageFormatted:function(){return Lm(this.sumByLeverage,2,!0)}}),methods:{viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)}}},yU=vU,CU=(i("6c47"),Object(C["a"])(yU,WE,NE,!1,null,"2832e85f",null)),bU=CU.exports,SU=function(){var t=this,e=t._self._c;return e("div",{staticClass:"YourChoice",class:t.rootClass},[e("div",{staticClass:"YourChoice-content"},[e("div",{staticClass:"YourChoice-maxDDWrap",class:"YourChoice-maxDDWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-maxDDWrap-label",class:"YourChoice-maxDDWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("ltloc")))])]),e("div",{staticClass:"YourChoice-maxDDWrap-dataItem",class:"YourChoice-maxDDWrap-dataItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-label",class:"YourChoice-maxDDWrap-dataItem-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s("".concat(t.$t("loss"),", %")))])]),e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-data"},[e("div",{staticClass:"YourChoice-maxDDWrap-lossControl"},[e("div",{staticClass:"YourChoice-maxDDWrap-lossControl-input"},[e("Checkbox",{attrs:{checked:t.saveLossStatus,size:32,colorState:t.getBlueColor.color},on:{change:t.setSaveLossStatus}})],1),e("div",{staticClass:"YourChoice-maxDDWrap-redact"},[e("div",{staticClass:"YourChoice-tableContent-rowItem-redactCount",class:"YourChoice-tableContent-rowItem-redactCount_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-tableContent-rowItem-redactCountControl",class:"YourChoice-tableContent-rowItem-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addMaxDDPercent(!1)},mousedown:function(e){return t.downChange("throttleStatus","addMaxDDPercent",[!1])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{disabled:""},domProps:{value:"".concat(t.ddPercentMax," %")}}),e("div",{staticClass:"YourChoice-tableContent-rowItem-redactCountControl",class:"YourChoice-tableContent-rowItem-redactCountControl_".concat(t.getActiveTheme),on:{click:function(e){return t.addMaxDDPercent(!0)},mousedown:function(e){return t.downChange("throttleStatus","addMaxDDPercent",[!0])},mouseup:function(e){return t.clearThrottle("throttleStatus")},mouseleave:function(e){return t.clearThrottle("throttleStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])])])])]),e("div",{staticClass:"YourChoice-maxDDWrap-lossDataWrap"},[e("div",{staticClass:"YourChoice-maxDDWrap-dataItem",style:{border:"1px solid ".concat(t.saveLossStatus?t.getGreenColor.color:t.getRedColor.color)}},[e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-label",class:"YourChoice-maxDDWrap-dataItem-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("funds_left")))])]),e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-data",style:{color:t.saveLossStatus?t.getGreenColor.color:t.getRedColor.color}},[e("div",{staticClass:"YourChoice-maxDDWrap-option"},[t._v(t._s(t.saveLossStatus?"".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.remains)):"".concat(t.getCurrencyChar," 0")))])])]),e("div",{staticClass:"YourChoice-maxDDWrap-dataItem",style:{border:"1px solid ".concat(t.getRedColor.color)}},[e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-label",class:"YourChoice-maxDDWrap-dataItem-label_".concat(t.getActiveTheme)},[e("span",[t._v(t._s(t.$t("loss")))])]),e("div",{staticClass:"YourChoice-maxDDWrap-dataItem-itemData",style:{color:t.getRedColor.color}},[e("div",{staticClass:"YourChoice-maxDDWrap-option"},[t._v(t._s(t.saveLossStatus?"".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.loss)):"".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.reserveEquity))))])])])])]),t.portfolio?t._e():e("div",{staticClass:"YourChoice-commisionWrap",class:"YourChoice-commisionWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-maxDDWrap-label",class:"YourChoice-maxDDWrap-label_".concat(t.getActiveTheme)},[e("span",[t._v("Настройка комиссии исполнения портфеля")])]),t.commonPrice||t.commonPercent?e("div",{staticClass:"YourChoice-commision"},[e("div",{staticClass:"YourChoice-commisionTableTitle",class:"YourChoice-commisionTableTitle_".concat(t.getActiveTheme),style:{gridTemplateColumns:"repeat(".concat(t.commonPrice&&t.commonPercent?3:2,", 1fr)")}},[e("div",{staticClass:"YourChoice-commisionTableTitle-item"},[t._v("Инструменты")]),t.resultPrice?e("div",{staticClass:"YourChoice-commisionTableTitle-item"},[t.resultPercent?e("RadioButton",{attrs:{theme:t.getActiveTheme,value:t.priceTypeSignals,modelValue:"Money"},on:{change:function(e){return t.setData({value:"Money"},"priceTypeSignals")}}}):t._e(),e("span",[t._v(t._s("Стоимость ".concat(t.getCurrencyChar,"/мес"))+".")])],1):t._e(),t.resultPercent?e("div",{staticClass:"YourChoice-commisionTableTitle-item"},[t.resultPrice?e("RadioButton",{attrs:{theme:t.getActiveTheme,value:t.priceTypeSignals,modelValue:"Percent"},on:{change:function(e){return t.setData({value:"Percent"},"priceTypeSignals")}}}):t._e(),t._v("% от результата")],1):t._e()]),e("div",{staticClass:"YourChoice-commisionTable",style:{gridTemplateColumns:"repeat(".concat(t.commonPrice&&t.commonPercent?3:2,", 1fr)")}},[e("div",{staticClass:"YourChoice-commisionTable-item",style:{color:t.getGrayColor.color}},[t._v(t._s(t.getCheckedInstruments))]),t.resultPrice?e("div",{staticClass:"YourChoice-commisionTable-item",style:{color:t.getBlueColor.color}},[t._v(t._s(t.$moneyf(t.resultPrice)))]):t._e(),t.resultPercent?e("div",{staticClass:"YourChoice-commisionTable-item",style:{color:t.getBlueColor.color}},[t._v(t._s(t.resultPercent))]):t._e()])]):t._e()]),"Money"===t.priceTypeSignals?e("div",{staticClass:"YourChoice-warningTypeMoney",class:"YourChoice-warningTypeMoney_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-warningTypeMoney-title",class:"YourChoice-warningTypeMoney-title_".concat(t.getActiveTheme)},[t._v("Оплата подписки автокопирования")]),e("div",{staticClass:"YourChoice-warningTypeMoney-content",class:"YourChoice-warningTypeMoney-content_".concat(t.getActiveTheme)},[e("p",[t._v("Вы Выбрали копирование и фиксированную стоимость услуг. Стоимость автокопирования составляет"),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.resultPrice))))])]),e("p",[t._v("Подтвердите списание с Вашего торгового счета сумму"),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.resultPrice))))]),t._v("перед началом автокопирования.")])])]):e("div",{staticClass:"YourChoice-warningTypeMoney",class:"YourChoice-warningTypeMoney_".concat(t.getActiveTheme)},[e("div",{staticClass:"YourChoice-warningTypeMoney-title",class:"YourChoice-warningTypeMoney-title_".concat(t.getActiveTheme)},[t._v("Оплата подписки автокопирования")]),e("div",{staticClass:"YourChoice-warningTypeMoney-content",class:"YourChoice-warningTypeMoney-content_".concat(t.getActiveTheme)},[t.portfolio?e("p",[t._v("Оплата процента от результата (SF)"),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.portfolio?"33":t.resultPercent," %")))])]):e("p",[t._v("Вы Выбрали копирование с оплатой процента от результата (SF)"),e("span",{style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.portfolio?"33":t.resultPercent," %")))])]),e("p",[t._v("Продолжая, Вы соглашаетесь на списание с вашего счета процента от результата один раз в сутки по итогам закрытых сделок.")])])])]),e("ButtonNavigationBlock",{attrs:{lastStep:"",currentStep:t.currentStep,isLoadingInvest:t.isLoadingInvest,portfolio:t.portfolio,providerCopy:t.providerCopy,findPortfolio:t.findPortfolio}})],1)},PU=[],TU={name:"YourChoice",mixins:[xt,qe],inject:["setData"],props:{currentStep:{type:Number},ddPercentMax:{type:Number},commonPrice:{type:Number},commonPercent:{type:[String,Number]},resultPrice:{type:Number},resultPercent:{type:Number},priceTypeSignals:{type:[String,Boolean]},checkedInstruments:{type:Object},isLoadingInvest:{type:Boolean,default:!1},portfolio:{type:Boolean},providerCopy:{type:Boolean},sumByLeverage:{type:Number},reserveEquity:{type:Number},findPortfolio:{type:Object}},data:function(){return{saveLossStatus:!1}},components:{ButtonNavigationBlock:xW,Checkbox:Ya,RadioButton:$a},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{loss:function(){return this.reserveEquity*this.ddPercentMax/100},remains:function(){return this.reserveEquity-this.loss},remainsFormatted:function(){return"".concat(this.getCurrencyChar," ").concat(Math.floor(this.remains))},rootClass:function(){return Object(c["a"])({},this.darkClass)},getCheckedInstruments:function(){return Object.values(this.checkedInstruments).filter((function(t){return t})).length},getCurrencyChar:function(){return this.getDefaultAccount.currencyChar}}),methods:{setSaveLossStatus:function(){this.saveLossStatus=!this.saveLossStatus,this.saveLossStatus?this.setData({value:10},"ddPercentMax"):this.setData({value:0},"ddPercentMax")},addMaxDDPercent:function(t){t?this.ddPercentMax+1<=90&&this.setData({value:this.ddPercentMax+1},"ddPercentMax"):this.ddPercentMax-1>0&&this.setData({value:this.ddPercentMax-1},"ddPercentMax")},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null}},mounted:function(){this.resultPrice||this.setData({value:"Percent"},"priceTypeSignals")}},xU=TU,OU=(i("cf66"),Object(C["a"])(xU,SU,PU,!1,null,"17f979be",null)),wU=OU.exports,_U=function(){var t=this,e=t._self._c;return e("div",{staticClass:"HeaderPortfolioExperts",class:t.darkClass},[e("div",{staticClass:"title"},[t._v(t._s(t.currentTitle))]),e("ButtonsNavigation",{attrs:{allSteps:t.allSteps,currentStep:t.currentStep}}),e("div",{staticClass:"HeaderPortfolioExperts-redactName"},[e("div",{staticClass:"HeaderPortfolioExperts-avatars"},t._l(t.srcAvatars,(function(i,o){return e("div",{key:o,staticClass:"HeaderPortfolioExperts-avatarItem"},[e("Avatar",{attrs:{src:i,theme:t.activeTheme,size:"3.2"}})],1)})),0),e("NamePortfolio",{attrs:{namePortfolio:t.namePortfolio,notName:t.notName},on:{notName:t.setNotName}})],1),e("span",{staticClass:"closeButton",on:{click:t.closePopup}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("Close"),!1))],1)],1)},AU=[],DU=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonsNavigation"},t._l(t.allSteps,(function(i){return e("OneButton",{key:i,attrs:{step:i,currentStep:t.currentStep}})})),1)},kU=[],IU=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneButton",class:t.rootClass,on:{click:t.clickHandler}},[t._v(t._s(t.step))])},BU=[],MU={name:"OneButton",mixins:[xt],inject:["setCurrentStep"],props:{step:{type:Number},currentStep:{type:Number}},computed:{rootClass:function(){return Object(c["a"])({green:this.step0}})},qU={provide:function(){return{setChecked:this.setChecked}},data:function(){return{priceTypeSignals:"Money",statisticForCountOrders:null,allInstruments:[],allChecked:!this.symbol,checkedInstruments:{}}},computed:{getOnlyCheckedInstruments:function(){return this.checkedInstruments?Object.values(this.checkedInstruments).filter((function(t){return t})):[]},commonPrice:function(){return 0===this.allInstruments.length?0:this.allInstruments.reduce((function(t,e){return t+e.monthPrice}),0)},commonPercent:function(){if(0===this.allInstruments.length)return 0;var t=this.allInstruments.reduce((function(t,e){return t+e.profitPercent}),0);return t/this.allInstruments.length},resultPrice:function(){var t=this;return 0===this.allInstruments.length?0:this.allChecked?this.commonPrice:this.allInstruments.reduce((function(e,i){return t.checkedInstruments[i.contract]?e+i.monthPrice:e}),0)},resultPercent:function(){var t=this;if(!this.allInstruments.length||!this.getOnlyCheckedInstruments.length)return 0;var e=this.allInstruments.reduce((function(e,i){return t.checkedInstruments[i.contract]?e+i.profitPercent:e}),0);return e/this.getOnlyCheckedInstruments.length},stepsProviderCopy:function(){return[{componentName:"RiskManagementInvestCrypto",titlePopup:"Настройка автокопирования"},{componentName:"YourChoice",titlePopup:"Настройка автокопирования"}]},propsProviderCopy:function(){return{ChoiceInstruments:{allChecked:this.allChecked,allInstruments:this.allInstruments,checkedInstruments:this.checkedInstruments,priceTypeSignals:this.priceTypeSignals,namePortfolio:this.namePortfolio,commonPrice:this.commonPrice,commonPercent:this.commonPercent,resultPrice:this.resultPrice,resultPercent:this.resultPercent,providerCopy:this.providerCopy,onlyCheckedInstruments:this.getOnlyCheckedInstruments,infoAccount:this.infoAccount,portfolio:this.portfolio},RiskManagementInvestCrypto:{usedLeverage:this.usedLeverage,sumByLeverage:this.sumByLeverage,reserveEquity:this.reserveEquity,allChecked:this.allChecked,allInstruments:this.allInstruments,checkedInstruments:this.checkedInstruments,priceTypeSignals:this.priceTypeSignals,namePortfolio:this.namePortfolio,resultPrice:this.resultPrice,resultPercent:this.resultPercent,providerCopy:this.providerCopy,onlyCheckedInstruments:this.getOnlyCheckedInstruments,infoAccount:this.infoAccount,portfolio:this.portfolio,freeEquity:this.freeEquity,remainedFreeEquity:this.remainedFreeEquity,statisticForCountOrders:this.statisticForCountOrders},CapitalAllocationInstruments:{checkedInstruments:this.checkedInstruments,useCapitalPercent:this.useCapitalPercent,onlyCheckedInstruments:this.getOnlyCheckedInstruments,priceTypeSignals:this.priceTypeSignals,resultPrice:this.resultPrice,resultPercent:this.resultPercent,portfolio:this.portfolio,usedLeverage:this.usedLeverage,reserveEquity:this.reserveEquity,remainedFreeEquity:this.remainedFreeEquity,sumByLeverage:this.sumByLeverage,providerCopy:this.providerCopy},RiskManagementInvest:{valueTransactions:this.valueTransactions,ddPercentMax:this.ddPercentMax,checkedExperts:this.getOnlyCheckedInstruments,providerCopy:this.providerCopy,infoAccount:this.infoAccount,sumByLeverage:this.sumByLeverage},YourChoice:{commonPrice:this.commonPrice,commonPercent:this.commonPercent,ddPercentMax:this.ddPercentMax,resultPrice:this.resultPrice,resultPercent:this.resultPercent,checkedInstruments:this.checkedInstruments,valueTransactions:this.valueTransactions,isLoadingInvest:this.isLoadingInvest,portfolio:this.portfolio,checkedExperts:this.getOnlyCheckedInstruments,providerCopy:this.providerCopy,reserveEquity:this.reserveEquity,sumByLeverage:this.sumByLeverage,findPortfolio:this.findPortfolio,priceTypeSignals:this.priceTypeSignals}}}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBagContent:"expertsPortfolio/saveInvestBagContent"})),{},{getStatisticForCountOrders:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$workKeys.signMessage("accountId=".concat(t.infoAccount.login),t.getSession.sk);case 2:i=e.sent,t.$http.get("".concat(t.getApiUri,"GetOrderCountByAverageTimeLiveByAccount/?accountId=").concat(t.infoAccount.login),{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":i}}).then((function(e){t.statisticForCountOrders=[],t.allInstruments.forEach((function(i){var o=e.data.data.find((function(t){return t.contractName===i.contract}));o?t.statisticForCountOrders.push({contractName:o.contractName,openCount:o.openCount,timeLive:o.timeLive}):t.statisticForCountOrders.push({contractName:i.contract,openCount:30,timeLive:1})}))})).catch((function(){t.setDefaultCount(30)}));case 4:case"end":return e.stop()}}),e)})))()},setDefaultCount:function(t){this.statisticForCountOrders=this.allInstruments.map((function(e){return{contractName:e.contract,openCount:t,timeLive:1}}))},setChecked:function(t){var e=this,i=t.value,o=t.checked;if("all"===i)return this.allChecked=o,void Object.keys(this.checkedInstruments).forEach((function(t){e.$set(e.checkedInstruments,t,o)}));!o&&this.allChecked&&(this.allChecked=!1),this.$set(this.checkedInstruments,i,o),this.allChecked=Object.values(this.checkedInstruments).every(Boolean)},getAllProvidersByContract:function(t){var e={Command:"GetSourcesById",data:{Type:"Account",Id:t}};this.$socketStream.sendCommand({ws:"apiWS",command:e})},createdHandlerForInstruments:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.portfolio){e.next=5;break}return t.allInstruments=Object(x["a"])(t.findPortfolio.sources),t.allInstruments.forEach((function(e){e.enableCopy=!0,t.$set(t.checkedInstruments,e.contract,!t.symbol||t.symbol===e.contract)})),t.getStatisticForCountOrders(),e.abrupt("return");case 5:t.getAllProvidersByContract(t.infoAccount.login);case 6:case"end":return e.stop()}}),e)})))()},saveContentProvider:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=[],n=Object.entries(e.checkedInstruments).reduce((function(t,e){var i=Object(D["a"])(e,2),o=i[0],n=i[1];return n&&t.push(o),t}),[]),n.forEach((function(i){var n=e.allInstruments.find((function(t){return t.contract===i})),s="Money"===e.priceTypeSignals?n.monthPrice:n.profitPercent,r=(e.getCreatedPortfoliosNoSorted||[{}]).find((function(e){return e.id===t})),a="Stoped"===(null===r||void 0===r?void 0:r.status),c=r?r.bagContents.find((function(t){return t.sourceId===n.id})):{id:0},l=Object.values(e.checkedInstruments).filter(Boolean),u=e.ddPercentMax?e.reserveEquity-e.reserveEquity*e.ddPercentMax/100:0;o.push({id:a?0:c.id,sourceId:n.id,signalVolume:e.getSignalVolume(n.contract),signalVolumeType:"Money",maxOpenPositions:e.getMaxOpenPositions(n.contract),price:s,priceType:e.priceTypeSignals,ddMin:0,ddMax:u,bagId:t,investMoney:e.reserveEquity/l.length,period:30})})),i.next=5,e.saveInvestBagContent(o);case 5:case"end":return i.stop()}}),i)})))()}}),mounted:function(){if(this.providerCopy&&(this.namePortfolio=this.portfolio?this.findPortfolio.name:this.infoAccount.traderName),this.investTop){var t=this.symbol&&"all"!==this.symbol?this.symbol:"";this.namePortfolio="Топ ".concat(this.expertsByFindPortfolio.length," ").concat(t)}}},zU={methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",clearExperts:"expertsPortfolio/clearExperts",clearStatus:"expertsPortfolio/clearStatus"})),{},{addInvest:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n="Stoped"===(null===(o=e.findPortfolio)||void 0===o?void 0:o.status),Object.values(e.checkedSources).every((function(t){return t}))){i.next=4;break}return i.next=4,e.redactBagContent();case 4:return i.next=6,e.saveInvestBag({name:e.namePortfolio.trim(),investLeverage:Math.ceil(e.usedLeverage),investMoney:e.reserveEquity,investBagType:e.providerCopy?"Signal":e.isInvestTop?"InvestTop":"Invest",avatarURL:e.providerCopy?e.infoAccount.avatar:"",id:n?null:t,parentId:n?e.findPortfolio.id:null});case 6:if(s=i.sent,s.requestStatus.isOK){i.next=10;break}return window.console.log("%cError","font-size: 20px; font-weight: 700; color: blue;"),i.abrupt("return");case 10:if(e.providerCopy){i.next=15;break}return i.next=13,e.saveContentPortfolio((n?null:t)||s.id);case 13:i.next=17;break;case 15:return i.next=17,e.saveContentProvider((n?null:t)||s.id);case 17:return i.abrupt("return",(n?null:t)||s.id);case 18:case"end":return i.stop()}}),i)})))()},invest:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,c;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(s="Stoped"===(null===(o=e.findPortfolio)||void 0===o?void 0:o.status),a=e.stopInvest(),!a){i.next=4;break}return i.abrupt("return");case 4:return e.isLoadingInvest=!0,i.next=7,e.addInvest(t);case 7:return c=i.sent,i.next=10,e.$store.dispatch("expertsPortfolio/beginInvest",{bagId:(s?null:t)||c,status:"Active",changeStatus:!0});case 10:e.providerCopy?e.clearStatus():e.clearExperts(),e.$store.commit("expertsPortfolio/setActiveTab",c),e.closeModal(),e.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,message:"".concat(e.$t("yhsiitp")," “").concat(e.namePortfolio||(null===(n=e.findPortfolio)||void 0===n?void 0:n.name)||e.$t("new_portfolio"),"”. \n ").concat(e.$t("ycstpsamiit"))}}),e.portfolio&&e.setUpdatingDataPortfolio(),e.isLoadingInvest=!1;case 16:case"end":return i.stop()}}),i)})))()}})},YU={name:"ModalPortfolioExperts",mixins:[GU,qU,zU],props:{visiblePopup:Boolean,closeModal:Function,portfolio:{type:Boolean,default:!1},symbol:{type:String},expertsByFindPortfolio:{type:Array,default:function(){return[]}},providerCopy:{type:Boolean,default:!1},investTop:{type:Boolean,default:!1},infoAccount:{type:Object,default:function(){return{}}},findPortfolioSelected:{type:[Boolean,Object]}},components:{CustomDxPopup:$w,DemoPrice:VR,ChoiceExperts:tN,ChoiceInstruments:FN,CapitalAllocation:BE,CapitalAllocationInstruments:RE,RiskManagementInvest:bU,YourChoice:wU,HeaderPortfolioExperts:HU,RiskManagementInvestCrypto:hE,RiskManagementInvestCryptoPortfolio:YN},data:function(){return{currentStep:1,ddPercentMax:0,namePortfolio:"",usedLeverage:0,freeEquity:0,remainedFreeEquity:0,reserveEquity:0,lastQuotesSignals:null}},provide:function(){return{prevStep:this.prevStep,nextStep:this.nextStep,setData:this.setData,invest:this.invest,setNamePortfolio:this.setNamePortfolio,addInvest:this.addInvest,setCurrentStep:this.setCurrentStep,setLeverage:this.setLeverage,setPercent:this.setPercent,setEquity:this.setEquity,setReserveEquity:this.setReserveEquity}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUri:"api/api",getSession:"auth/getSession",getDefaultAccount:"subscribeOrders/getDefaultAccount",createdData:"expertsPortfolio/createdData",selectedExpertsSources:"expertsPortfolio/selectedExpertsSources",findExpert:"expertsPortfolio/findExpert",statusCreated:"expertsPortfolio/statusCreated",findPortfolioStore:"expertsPortfolio/findPortfolio",getActiveTab:"expertsPortfolio/getActiveTab",getContracts:"contracts/getContracts",getCreatedPortfoliosNoSorted:"expertsPortfolio/getCreatedPortfoliosNoSorted"})),{},{getIsRealAccount:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},getCryptoStatusInvesting:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},findPortfolio:function(){return this.findPortfolioSelected||this.findPortfolioStore},isInvestTop:function(){var t;return!(!this.portfolio||"InvestTop"!==(null===(t=this.findPortfolio)||void 0===t?void 0:t.type))||this.investTop},steps:function(){return this.providerCopy?this.stepsProviderCopy:this.stepsPortfolio},allSteps:function(){return this.steps.filter((function(t){return"DemoPrice"!==t.componentName})).length},getDataCurrentStep:function(){return this.steps[this.currentStep-1]},currentTitle:function(){return this.getDataCurrentStep.titlePopup},equalToFive:function(){return!1},props:function(){return this.providerCopy?this.propsProviderCopy:this.propsPortfolio},isChangePortfolioCheckUsers:function(){return this.portfolio&&this.expertsByFindPortfolio.length!==this.checkedExperts.length},maxLeverage:function(){return this.getDefaultAccount.maxLeverage},sumByLeverage:function(){return Math.round(this.reserveEquity*this.usedLeverage)}}),methods:{setLeverage:function(t){this.usedLeverage=t},setLastQuotes:function(){var t={command:"LastQuotes",method:"get",data:null};this.$socketStream.sendCommand({ws:"apiWS2",command:t})},hidden:function(){this.$emit("hidden"),this.currentStep=1},prevStep:function(){this.currentStep-=1},nextStep:function(){this.currentStep!==this.steps.length&&(this.currentStep+=1)},setCurrentStep:function(t){if(this.portfolio||this.namePortfolio.trim()){var e=this.providerCopy?this.getOnlyCheckedInstruments.length:this.checkedExperts.length;!e&&t>this.currentStep||(this.currentStep=t)}else this.currentStep=2},setData:function(t,e){if(null!==t&&void 0!==t&&t.component){var i=t.component.option("min"),o=t.component.option("max"),n=t.component.option("step"),s=t.value;if(o&&s>o)return t.component.option("value",o),void(this[e]=o);if(null===s||s=r&&l%r;return u?l-u>=n?l-u<=s?+(l-u).toFixed(a):s:n:l>=n?l<=s?+l.toFixed(a):s:n},getSignalVolume:function(t){var e=Math.floor(this.sumByLeverage/this.getCountOrders());return this.getCryptoStatusInvesting?this.getSignalVolumeForCrypto(t,e):e-e%1e3},getSignalVolumeForCrypto:function(t,e){var i=this.getContracts.find((function(e){return e.name===t})),o=i.minVolume,n=i.maxVolume,s=i.volumeStep,r=i.stepPrecision,a=this.lastQuotesSignals.find((function(e){return e.s===t})).averagePrice,c=e/a,l=c>=s&&c%s;return l?c-l>=o?c-l<=n?+(c-l).toFixed(r):n:o:c>=o?c<=n?+c.toFixed(r):n:o},geTradingAccounts:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l,u,d;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({accountId:t.getDefaultAccount.id,useSubAccounts:!0}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:return o=e.sent,e.next=6,t.$http.post("".concat(t.getApiUri,"GetTradingAccounts"),i,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}});case 6:n=e.sent,s=n.data,a=s.find((function(t){return!t.parentAccountId})),c=a.equity,l=t.getCreatedPortfoliosNoSorted.length?t.getCreatedPortfoliosNoSorted.filter((function(t){return"Active"===t.status})):[],u=l.length?l.reduce((function(t,e){return t+e.investMoney}),0):0,d=Math.floor(c-u),t.freeEquity=d>=0?d:0,t.remainedFreeEquity=Math.floor(c-u);case 14:case"end":return e.stop()}}),e)})))()},setMessageHandler:function(t){var e=this;"LastQuotes"===t.command?this.lastQuotesSignals=t.data:"GetSourcesById"===t.command&&(this.allInstruments=t.data.data,this.allInstruments.forEach((function(t){t.enableCopy=!0,e.$set(e.checkedInstruments,t.contract,!e.symbol||e.symbol===t.contract)})),this.getStatisticForCountOrders())},setEquity:function(t){var e=this.remainedFreeEquity+t;if(e&&!(e<0)){this.remainedFreeEquity=e>this.freeEquity?this.freeEquity:e;var i=this.reserveEquity+-1*t;this.reserveEquity=i>0?i:0}},setReserveEquity:function(t){if(t){var e=this.freeEquity-Math.abs(t);e>0?(this.reserveEquity=Math.abs(t),this.remainedFreeEquity=e):(this.remainedFreeEquity=0,this.reserveEquity=this.freeEquity)}else this.remainedFreeEquity=this.freeEquity,this.reserveEquity=0},setPercent:function(t){this.reserveEquity=Math.round(this.freeEquity*t/100),this.remainedFreeEquity=this.freeEquity-this.reserveEquity},getCountOrders:function(){var t=this;if(!this.statisticForCountOrders||!this.getOnlyCheckedInstruments.length)return 0;var e=0,i=function(i){if(t.checkedInstruments[i]){var o=t.statisticForCountOrders.find((function(t){return t.contractName===i}));e+=o.openCount}};for(var o in this.checkedInstruments)i(o);return e}},created:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.geTradingAccounts();case 2:if(!t.providerCopy){e.next=7;break}return e.next=5,t.createdHandlerForInstruments();case 5:e.next=8;break;case 7:t.createdHandlerForPortfolio();case 8:case"end":return e.stop()}}),e)})))()},mounted:function(){this.$socketStream.events.subscribe("apiWS2",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.getCryptoStatusInvesting&&this.setLastQuotes()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS2",this.setMessageHandler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},XU=YU,QU=(i("6a93"),Object(C["a"])(XU,FR,jR,!1,null,"83d7b1e2",null)),JU=QU.exports,KU={provide:function(){return{openModalCopyProvider:this.openModalCopyProvider}},data:function(){return{visiblePopup:!1,modalData:{}}},methods:{hidden:function(){this.visiblePopup=!1},openModalCopyProvider:function(t){this.modalData=t,this.visiblePopup=!0}}},ZU=function(t,e){var i;return function(){var o=arguments,n=this;clearInterval(i),i=setTimeout((function(){t.apply(n,o)}),e)}},tV={mixins:[KU,qg],props:{right:{type:Boolean,default:!0},left:{type:Boolean,default:!0},subheader:{type:Boolean,default:!1}},components:{ModalPortfolioExperts:JU},data:function(){return{centerBlockNode:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getRightSideBar:"userSettings/getRightSideBar",getLeftSideBar:"userSettings/getLeftSideBar",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getLeftSideBarState:function(){return!!this.$route.path.startsWith("/personal-area")||this.getLeftSideBar}}),methods:{onResize:ZU((function(){var t=this.centerBlockNode.clientWidth;this.$store.commit("user/setWidthCentralBlock",t)}),100)},mounted:function(){this.centerBlockNode=this.$refs.centerBlock,this.initObserver(this.onResize,this.centerBlockNode)}},eV=tV,iV=(i("1f75"),Object(C["a"])(eV,$R,LR,!1,null,"cce07f16",null)),oV=iV.exports,nV=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradingRightBar trading-notifications profile-notifications--open",class:"profile-notifications--open"},[e("div",{staticClass:"TradingRightBar-head",class:"TradingRightBar-head_".concat(t.getActiveTheme)},[e("Trading-notifications-top-bar",{directives:[{name:"show",rawName:"v-show",value:!t.getChatCurrentRoom||t.getChatCurrentRoom&&"ChatByContract"===t.activeComponent,expression:"!getChatCurrentRoom || (getChatCurrentRoom && activeComponent === 'ChatByContract')"}],attrs:{profile:t.profile,verticalButton:!t.getRightSideBar,activeTabProfile:t.activeTabProfile},on:{activeComponents:function(e){return t.setActiveComponents(e)},setTab:t.setTab}}),e("Chat-return",{directives:[{name:"show",rawName:"v-show",value:t.getChatCurrentRoom&&"ChatByContract"!==t.activeComponent,expression:"getChatCurrentRoom && activeComponent !== 'ChatByContract'"}]})],1),e("div",{staticClass:"TradingRightBar-body",class:"TradingRightBar-body_".concat(t.getActiveTheme)},[e("div",{ref:"container",staticClass:"notifications"},[t.getRightSideBar?e(t.activeComponent,t._b({tag:"component",attrs:{symbol:t.symbol,expand:t.openWidgetTV,options:t.videoOptions,profile:t.profile},on:{switchExpand:t.toggleWidgetTV}},"component",t.propsComponent[t.activeComponent],!1)):t._e()],1),t.visiblePopup?e("ModalPortfolioExperts",t._b({attrs:{visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}},"ModalPortfolioExperts",t.modalData,!1)):t._e()],1)])},sV=[],rV=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrdersRightBar"},[t.isVisiblePortfolioOrders?e("PortfolioOrders",t._b({},"PortfolioOrders",t.propsPortfolioOrders,!1)):t.profile?e("ProfileOrdersRightBar",t._b({},"ProfileOrdersRightBar",t.propsProfileOrders,!1)):e("TradingStreamOrders",t._b({},"TradingStreamOrders",t.propsTradingOrders,!1))],1)},aV=[],cV=function(){var t=this,e=t._self._c;return e("div",{ref:"section",staticClass:"TradingStreamOrders"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.ordersFormatted?e("div",{staticClass:"ordersBlock"},[e("MarketSentiment",{key:t.symbol,attrs:{symbol:t.symbol}}),e("OrdersContainer",{key:t.ordersFormatted.length+"OrdersContainer",attrs:{whereIs:"TradingStreamOrders",orders:t.ordersFormatted}})],1):e("div",{key:"loading",staticClass:"loadingData"},t._l(t.sceletonCount,(function(i){return e("Sceleton",{key:i,staticClass:"sceletonClosedOrder",attrs:{height:t.sceletonHeight}})})),1)])],1)},lV=[],uV=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatisticsBlock",class:t.rootClass,style:t.styleRoot},[e("div",{staticClass:"floatLabel"},[t._v("Настроение рынка")]),e("ButtonIconFlat",{staticClass:"buttonCustom buttonCollapse",attrs:{icon:t.getIconData("Arrow-expand-top")},on:{toggle:t.toggleExpand}}),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.expand?e("div",{key:"expand",staticClass:"expand"},[e("div",{staticClass:"sellBlock"},[e("div",{staticClass:"beastPercentBlock"},[e("div",{staticClass:"beast"},[e("svgIcon",t._b({},"svgIcon",t.getDataIconBear,!1))],1),e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.ordersSellPercent)+"%")]),e("div",{staticClass:"text"},[t._v("SELL")])])]),e("div",{staticClass:"peopleBlock"},t._l(t.usersImageByOrdersSell,(function(i,o){return e("img",{key:o,attrs:{src:t.srcUser(i)},on:{mouseenter:function(e){return t.mouseenterHandler(e,i)},mouseleave:function(e){return t.mouseleaveHandler(i)},click:function(e){return t.goToProfile(i)}}})})),0)]),e("div",{staticClass:"semicircle"},[e("Gaudge",{key:t.keyForCanvas,attrs:{configObject:t.getConfigGaudge}})],1),e("div",{staticClass:"byBlock"},[e("div",{staticClass:"beastPercentBlock"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.ordersBuyPercent)+"%")]),e("div",{staticClass:"text"},[t._v("BUY")])]),e("div",{staticClass:"beast"},[e("svgIcon",t._b({},"svgIcon",t.getDataIconBull,!1))],1)]),e("div",{staticClass:"peopleBlock"},t._l(t.usersImageByOrdersBuy,(function(i,o){return e("img",{key:o,attrs:{src:t.srcUser(i)},on:{mouseenter:function(e){return t.mouseenterHandler(e,i)},mouseleave:function(e){return t.mouseleaveHandler(i)},click:function(e){return t.goToProfile(i)}}})})),0)])]):e("div",{key:"collapsed",staticClass:"collapsed"},[e("div",{staticClass:"sellCollapsed"},[e("div",{staticClass:"beast"},[e("svgIcon",t._b({},"svgIcon",t.getDataIconBear,!1))],1),e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.ordersSellPercent)+"%")]),e("div",{staticClass:"text"},[t._v("SELL")])])]),e("div",{staticClass:"indicator",style:t.sliderStyle},[e("div",{staticClass:"realSize"},[e("div",{staticClass:"caret"},[t._v(t._s(this.textPercent))])])]),e("div",{staticClass:"byCollapsed"},[e("div",{staticClass:"percent"},[e("div",{staticClass:"num"},[t._v(t._s(t.ordersBuyPercent)+"%")]),e("div",{staticClass:"text"},[t._v("BUY")])]),e("div",{staticClass:"beast"},[e("svgIcon",t._b({},"svgIcon",t.getDataIconBull,!1))],1)])])])],1)},dV=[],hV=function(){var t=this,e=t._self._c;return e("div",{staticClass:"gauge__container"},[e("canvas",{ref:"gauge_canvas",staticClass:"gauge__canvas"})])},pV=[],gV={mixins:[lM],data:function(){return{degress:32,animateMove:"right",percentOffset:57,countPercent:0,reverseAnimation:!0,gaugeObject:null}},props:{configObject:{type:Object,default:function(){return{size:{width:600,height:300},offset:20,reverse:!1,colorArrow:"red",percentTitle:52,precision:0,percent:52,min:0,max:100,isShowMinMax:!0,isShowDescription:!0,speed:50,colorDescription:"red",listColors:["#000","#6bc4f1","#6bc4f1","#fee601","#6bc4f1","#ff2826"],description:"Test",colorMin:"#11936b",colorMax:"#ff2826"}}}},watch:{getSize:function(){this.initGauge()},getOffset:function(){this.animationChangeOffset()}},computed:{getTitleForRound:function(){return this.configObject.percent===this.configObject.percentTitle?this.countPercent:this.configObject.percentTitle/this.configObject.percent*this.countPercent>this.configObject.percentTitle?this.configObject.percentTitle:this.configObject.percentTitle/this.configObject.percent*this.countPercent},getSize:function(){return this.configObject.size},getOffset:function(){return this.configObject.offset},getSpeed:function(){return this.configObject.speed||50},getDegress:function(){var t=180;return t*(this.countPercent/100)},getMin:function(){return this.configObject.min},getColorDescription:function(){return this.configObject.colorDescription||this.getColorArrow},getMax:function(){return this.configObject.max},getColorMin:function(){return this.configObject.colorMin||this.getListColors[0]},getColorMax:function(){return this.configObject.colorMax||this.getListColors[this.getListColors.length-1]},getCurrentProcent:function(){var t=(this.getDegress/180).toFixed(2);return+(100*+t).toFixed(0)},getColorArrow:function(){return this.configObject.colorArrow||"#0b8d6a"},getListColors:function(){return this.configObject.reverse?this.configObject.listColors.reverse():this.configObject.listColors}},methods:{getOffsetPin:function(t,e,i){return{x:t*Math.cos(i)-e*Math.sin(i),y:e*Math.cos(i)+t*Math.sin(i)}},clearCanvas:function(t){t.clearRect(0,0,this.gaugeObject.getSizeCanvas().width,this.gaugeObject.getSizeCanvas().height)},initGauge:function(){this.countPercent=0,this.initCanvas("gauge_canvas",this.configObject.size,"gaugeObject"),this.gaugeObject.animationCanvas({clear:function(){this.gaugeObject.clearCanvas()},update:function(){this.countPercent>=this.configObject.percent||(this.countPercent+=.2)},render:function(){this.draw(this.countPercent)}},1e3,this)},draw:function(){var t=this.gaugeObject.ctx,e=this.getSize.width/this.getSize.height;this.clearCanvas(t);var i=this.getSize.width*(e<2?.1:.1-1.5*e/100),o=this.getSize.width/2,n=this.getSize.height-.2*this.getSize.height,s=e>2?this.getSize.height-2*i:o-i,r=s-i/2,a=s-i,c=this.getDegress*(Math.PI/180),l=o-a*Math.cos(c),u=n-a*Math.sin(c);this.drawGradient(t,o,a),this.drawVolumeArc(t,i,o,n,s),this.drawLineMiddleLine(t,o,n,l,u,i),this.drawRoundPercent(t,o-r*Math.cos(c),n-r*Math.sin(c),i,this.countPercent),this.configObject.isShowMinMax&&this.drawStartEndDescription(t,Math.round(.5*i),o-r,this.getSize.height,o+r,this.getSize.height),this.configObject.isShowDescription&&this.drawStartMiddleDescription(t,this.configObject.description,14)},drawGradient:function(t,e,i){if(t&&e&&i){var o=e-i,n=i,s=e+i,r=i;if(!(o<0||n<0||s<0||r<0)){var a=t.createLinearGradient(o,n,s,r),c=this.getListColors.length-1,l=1/c;this.getListColors.reduce((function(t,e){return a.addColorStop(t,e),t+=l,t}),0),t.fillStyle=a}}},drawRoundPercent:function(t,e,i,o){o<=0||(t.save(),t.beginPath(),t.arc(e,i,o/2+o/2*.5,0,2*Math.PI),t.strokeStyle="white",t.lineWidth=5,t.stroke(),t.fill(),t.beginPath(),t.fillStyle="white",t.font="bold ".concat(Math.round(.5*o),"px Arial"),t.textAlign="center",t.textBaseline="middle",t.fillText("".concat(this.$moneyf(this.getTitleForRound,this.configObject.precision)),e,i,o),t.restore())},drawStartMiddleDescription:function(t,e,i){t.beginPath(),t.fillStyle=this.getColorDescription,t.font="bold ".concat(i,"px Arial"),t.textBaseline="bottom",t.fillText(e,this.getSize.width/2,this.getSize.height-3),t.fill()},drawStartEndDescription:function(t,e,i,o,n,s){t.beginPath(),t.textAlign="center",t.fillStyle=this.getListColors[0],t.font="bold ".concat(e,"px Arial"),t.textBaseline="bottom",t.fillText(this.getMin,i,o),t.fill(),t.beginPath(),t.fillStyle=this.getListColors[this.getListColors.length-1],t.fillText(this.getMax,n,s),t.fill()},changeDeggres:function(){"right"===this.animateMove?(this.configObject.percent+=1,this.draw(this.ctx),this.configObject.percent>=100&&(this.animateMove="left")):"left"===this.animateMove&&(this.configObject.percent-=1,this.draw(this.ctx),this.configObject.percent<=0&&(this.animateMove="right"))},drawVolumeArc:function(t,e,i,o,n){n-e<=0||e<=0||(t.beginPath(),t.arc(i,o,n,0,Math.PI,!0),t.arc(i-(n-.5*e),o,.5*e,Math.PI,0,!0),t.arc(i,o,n-e,Math.PI,0,!1),t.arc(i+(n-.5*e),o,.5*e,Math.PI,0,!0),t.fill(),t.closePath())},drawLineMiddleLine:function(t,e,i,o,n,s){if(!(s<=0)){var r=o-e,a=n-i,c=Math.atan2(a,r),l=Math.sqrt(r*r+a*a),u=.125*l,d={x:l-s/2,y:0},h={x:d.x-.3*d.x,y:u},p={x:h.x,y:.33*h.y},g={x:0,y:p.y},f={x:0,y:-p.y},m={x:p.x,y:-p.y},v={x:h.x,y:-u};t.save(),t.translate(e,i),t.rotate(c),t.beginPath(),t.lineCap="round",t.moveTo(d.x,d.y),t.lineTo(h.x,h.y),t.lineTo(p.x,p.y),t.lineTo(g.x,g.y),t.lineTo(f.x,f.y),t.lineTo(m.x,m.y),t.lineTo(v.x,v.y),t.closePath(),t.fill(),t.setTransform(1,0,0,1,0,0),t.restore(),t.beginPath(),t.arc(e,i,s/4,0,2*Math.PI),t.fill(),t.lineWidth=3,t.strokeStyle="white",t.stroke(),t.closePath()}},animationChangeOffset:function(){var t=this,e=setInterval((function(){+t.configObject.percent!==+t.getOffset?(t.configObject.percent=t.configObject.percent=100&&(t.animateMove="left")):"left"===t.animateMove&&(t.configObject.percent-=1,t.draw(),t.configObject.percent<=0&&(t.animateMove="right"))}),80))}},mounted:function(){var t=this;this.$nextTick((function(){t.initGauge()}))}},fV=gV,mV=(i("b11b"),Object(C["a"])(fV,hV,pV,!1,null,null,null)),vV=mV.exports,yV={name:"StatisticsBlock",mixins:[xt,rT],props:{ordersBuy:{type:Array,default:function(){return[]}},ordersSell:{type:Array,default:function(){return[]}},keyForCanvas:{type:Boolean,default:!1}},components:{Gaudge:vV},data:function(){return{expand:!1}},computed:{getDataIconBear:function(){return{name:"Bear",color:this.darkClass.dark?"#fa4c4a":"#E91212"}},getDataIconBull:function(){return{name:"Bull",color:this.darkClass.dark?"#00ffac":"#008E72"}},usersImageByOrdersBuy:function(){return this.ordersBuy.slice(0,6)},usersImageByOrdersBuyExpand:function(){return this.usersImageByOrdersBuy.slice(0,4)},usersImageByOrdersSell:function(){return this.ordersSell.slice(0,6)},usersImageByOrdersSellExpand:function(){return this.usersImageByOrdersSell.slice(0,4)},ordersBuyPercent:function(){var t=100*this.ordersBuy.length/(this.ordersBuy.length+this.ordersSell.length);return isNaN(t)?0:Math.round(t)},styleRoot:function(){var t="rgba(254,232,0,.15)";if(this.ordersBuyPercent<40){var e="linear-gradient(180deg, #FFF 0%, #FAE7E7 83.33%)",i="linear-gradient(180deg, #314456 0%, #632D2D 100%)";t=this.darkClass.dark?i:e}if(this.ordersBuyPercent>60){var o="linear-gradient(180deg, #FFF 0%, #DDF8E8 83.33%)",n="linear-gradient(180deg, #314456 0%, #286156 100%)";t=this.darkClass.dark?n:o}return{background:t}},ordersSellPercent:function(){var t=100-this.ordersBuyPercent;return isNaN(t)?0:t},textPercent:function(){return Math.max(this.ordersBuyPercent,this.ordersSellPercent)},percent:function(){return this.ordersBuyPercent},sliderStyle:function(){return{"--percent":this.percent+"%"}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{collapse:!this.expand})},getConfigGaudge:function(){return{size:{width:130,height:80},offset:20,reverse:!1,colorArrow:"blue",min:0,max:100,percent:this.percent||1,percentTitle:this.textPercent,precision:0,isShowMinMax:!1,isShowDescription:!1,speed:50,colorDescription:this.darkClass.dark?"#bbcee0":"#8c8c8c",listColors:this.darkClass.dark?["#FF5757","#FFD53F","#FFEC27","#DBF631","#00D3AA"]:["#ff2826","#EBB700","#FFE900","#A5B92B","#008E72"],description:"",colorMin:this.darkClass.dark?"#FF5757":"#ff2826",colorMax:this.darkClass.dark?"#008E72":"#11936b"}},srcUser:function(){return function(t){var e,o=(null===t||void 0===t?void 0:t.userAvatar)||(null===(e=t.userInfo)||void 0===e?void 0:e.avatarURL);return o&&"User-profile.png"!==o?o:i("81bc")}}},methods:{toggleExpand:function(){this.expand=!this.expand},mouseenterHandler:function(t,e){var i;this.mouseEnterFunction(t,{imageForSource:e.userAvatar||(null===(i=e.userInfo)||void 0===i?void 0:i.avatarURL),nameSource:e.userName||"".concat(e.userInfo.firstName||""," ").concat(e.userInfo.lastName||""),numberVolume:e.volume||null,side:e.orderType||e.operationTrend,getColorClass:"Sell"===(e.orderType||e.operationTrend)?["red"]:["green"],accountId:e.accountId})},mouseleaveHandler:function(){this.mouseLeaveFunction()},goToProfile:function(t){this.goingToProfile(t.accountId)}}},CV=yV,bV=(i("46fe"),Object(C["a"])(CV,uV,dV,!1,null,"1e6a7d38",null)),SV=bV.exports;function PV(t){var e=t.orders,i=t.myProfile,o=t.sizeFieldClosed,n=t.sizeFieldOpen,s=t.marginBottom;return e.map((function(t){var e="Closed"===t.status?"ClosedOrder":"OpenOrder",r="Closed"===t.status?o:n;return{id:t.id,typeOrder:e,height:r+s,createdDateTime:t.closedDate,userName:t.userName,avatarURL:t.userAvatar||t.userAvatarURL,accountId:t.accountId,originalObject:t,data:{AccountId:t.accountId,OrderId:t.id,Contract:t.contractName,Side:t.orderType,CreatedOrderDTUTC:t.openDate,SequenceId:t.sequenceId,Volume:t.volume,Price:t.openPrice,ClosePrice:t.closePrice,Sl:t.stopLoss,Tp:t.takeProfit,Profit:t.profit,Type:i?null:"sourceorder"}}}))}var TV={components:{OrdersContainer:NT,StatisticsBlock:SV,MarketSentiment:Vp,Sceleton:nT},props:{symbol:{type:String}},data:function(){return{orders:null,marginBottom:2,heightOpenOrderProvider:51,heightClosedOrderProvider:51,warningMessage:!1,sectionHeight:null,keyForCanvas:!1}},watch:{symbol:function(){this.getLastOrdersByInstrument(this.symbol)}},computed:{getOrdersByContract:function(){if(this.orders){var t=this.orders.filter((function(t){if("Position_PoClose"!==t.reason&&"Position_PoCreate"!==t.reason)return t}));return t}},openedOrders:function(){if(this.getOrdersByContract)return this.getOrdersByContract.filter((function(t){return"Opened"===t.status}))},ordersBuy:function(){if(this.openedOrders)return this.openedOrders.filter((function(t){return"Buy"===t.orderType}))},ordersSell:function(){if(this.openedOrders)return this.openedOrders.filter((function(t){return"Sell"===t.orderType}))},ordersFormatted:function(){if(this.getOrdersByContract){var t=PV({orders:this.getOrdersByContract,myProfile:!1,marginBottom:this.marginBottom,sizeFieldClosed:this.heightClosedOrderProvider,sizeFieldOpen:this.heightOpenOrderProvider});return t}},sceletonHeight:function(){return this.heightClosedOrderProvider},sceletonCount:function(){if(!this.sectionHeight)return 0;var t=this.heightClosedOrderProvider;return Math.floor(((null===this||void 0===this?void 0:this.sectionHeight)-16)/t)}},methods:{setMessageHandler:function(t){"BrokerAllPosition"===(null===t||void 0===t?void 0:t.command)?this.setNotification(t.data):"LastOrdersByFilter"===(null===t||void 0===t?void 0:t.command)&&(this.warningMessage=Boolean(!t.data||!t.data.length),this.orders=t.data)},setNotification:function(t){t.instrumentName===this.symbol&&(this.warningMessage=!1,"Opened"===t.status&&"Position_Create"===t.reason&&this.orders.unshift(t),"Closed"===t.status&&(this.orders=this.orders.filter((function(e){return e.sequenceId!==t.sequenceId})),this.orders.unshift(t)))},getLastOrdersByInstrument:function(t){var e={Command:"LastOrdersByFilter",Data:{SkipCount:0,TakeCount:100,FromDate:"",Contracts:[t],UseInstrumentInfo:!1}};this.$socketStream.sendCommand({ws:"apiWS",command:e})}},activated:function(){this.keyForCanvas=!this.keyForCanvas},mounted:function(){this.sectionHeight=this.$refs.section.clientHeight,this.$socketStream.$on("apiWS",this.setMessageHandler),this.getLastOrdersByInstrument(this.symbol)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},xV=TV,OV=(i("b246"),Object(C["a"])(xV,cV,lV,!1,null,"16bae3ec",null)),wV=OV.exports,_V=function(){var t=this,e=t._self._c;return e("div",{ref:"section",staticClass:"ProfileOrdersRightBar",class:t.rootClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoading?e("div",{key:"loading",staticClass:"loadingData"},t._l(t.sceletonCount,(function(i){return e("Sceleton",{key:i,staticClass:"sceletonClosedOrder",attrs:{height:t.sceletonHeight}})})),1):t.isVisibleClosedOrders?e("div",{staticClass:"ordersBlock"},[e("StatisticsBlock",{attrs:{expand:t.expand,activeContract:t.symbol,activeTabProfile:t.activeTabProfile},on:{toggleExpand:t.toggleExpand}}),e("OrdersContainer",{key:"OrdersContainer",ref:"ordersContainer",attrs:{whereIs:"ProfileOrdersRightBar",prefix:"_profileOrders",orders:t.orders}})],1):e("div",{key:"noDataOrders",staticClass:"noData"},[e("svgIcon",t._b({},"svgIcon",t.getIconData("BIG_Data"),!1)),e("div",{staticClass:"noDataText"},[t._v("У пользователя за последний месяц"),e("br"),t._v("ордеров нет")])],1)])],1)},AV=[],DV=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatisticsBlock",class:t.rootClass},[e("ButtonIconFlat",{staticClass:"buttonCustom buttonCollapse",attrs:{icon:t.getIconData("Arrow-expand-top")},on:{toggle:function(e){return t.$emit("toggleExpand")}}}),e("div",{staticClass:"expanded",class:{expandedState:t.expand}},[t.pointsSuccessfulMonth&&t.pointsSuccessfulTransactions?e("div",{staticClass:"chartSuccessful"}):t._e(),e("div",{staticClass:"svgWrapper successStatics",on:{mouseenter:function(e){return t.viewTooltip(".successStatics")},mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1),e("div",{staticClass:"leftCircleGraph"},[e("ProgressRoundDiagram",{key:t.successfulTransactionPercent,attrs:{width:76,height:76,widthBorder:10,fontSize:13,percent:t.successfulTransactionPercent}})],1),e("div",{staticClass:"rightPercentBlock"},[e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"dataPercent",class:t.getClassSuccessfulTransaction},[e("svgIcon",t._b({},"svgIcon",t.getDataIconArrowSuccessfulTransaction,!1)),t._v(t._s(t.successfulTransactionPercent)+"%")],1),e("div",{staticClass:"text"},[t._v(t._s("".concat(t.$t("successful_trades_full")," ").concat(t.getTitle[0]))+" ")])]),e("div",{staticClass:"successfulMonths"},[e("div",{staticClass:"dataPercent",class:t.getClassPositiveMonth},[e("svgIcon",t._b({},"svgIcon",t.getDataIconArrowPositiveMonth,!1)),t._v(t._s(t.getPositiveMonth)+"%")],1),e("div",{staticClass:"text"},[t._v(t._s("".concat(t.$t("successful_months")," ").concat(t.getTitle[1])))])])])]),e("transition",{attrs:{name:"fade"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.expand,expression:"!expand"}],key:"collapsed",staticClass:"collapsed"},[e("div",{staticClass:"successfulTransactionsCollapse"},[e("div",{staticClass:"text"},[e("div",[t._v(t._s(t.$t("successful_trades_full")))]),e("div",[t._v(t._s(t.getTitle[0]))])]),e("div",{staticClass:"dataPercent",class:t.getClassSuccessfulTransaction},[t._v(t._s(t.successfulTransactionPercent)+"%")])]),e("div",{staticClass:"successfulMonthsCollapse"},[e("div",{staticClass:"text"},[e("div",[t._v(t._s(t.$t("successful_months")))]),e("div",[t._v(t._s(t.getTitle[1]))])]),e("div",{staticClass:"dataPercent",class:t.getClassPositiveMonth},[t._v(t._s(t.getPositiveMonth)+"%")])])])]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Lorem ipsum dolor sit amet")])],1)},kV=[],IV=function(){var t=this,e=t._self._c;return e("div",{class:"simpleChart".concat(t.getClass)},[e("ChartWrapper",{ref:"chartWrapper",attrs:{showYaxis:!0,yAxisWidth:1.4,showXaxis:!1,showTitle:!1,resizeStatus:t.resizeStatus},on:{initCanvas:t.getCanvasesObjects}})],1)},BV=[],MV={methods:{drawSpline:function(t,e,i,o,n,s,r){t.lineWidth=r,t.lineCap="round",t.save();for(var a=[],c=e.length,l=0;l4?(e.drawSpline(e.chartCanvas.ctx,n,.3,!0,t[o][0].fill,{width:e.chartCanvas.canvasObject.getBoundingClientRect().width,height:e.chartCanvas.canvasObject.getBoundingClientRect().height}),e.drawSpline(e.chartCanvas.ctx,n,.3,!1,t[o][0].stroke,{width:e.chartCanvas.canvasObject.getBoundingClientRect().width,height:e.chartCanvas.canvasObject.getBoundingClientRect().height})):(e.drawSimpleLine(e.chartCanvas.ctx,n,t[o][0],!0,{width:e.chartCanvas.canvasObject.getBoundingClientRect().width,height:e.chartCanvas.canvasObject.getBoundingClientRect().height},3),e.drawSimpleLine(e.chartCanvas.ctx,n,t[o][0],!1,{width:e.chartCanvas.canvasObject.getBoundingClientRect().width,height:e.chartCanvas.canvasObject.getBoundingClientRect().height},3))})),this.configObject.indicators.length&&this.configObject.indicators.forEach((function(t){e[t]()}))},drawSimpleLine:function(t,e,i,o,n,s){4===e.length?(t.save(),t.lineWidth=s,t.beginPath(),t.moveTo(e[0],e[1]),t.lineTo(e[2],e[3]),o?(t.lineTo(e[2],n.height),t.lineTo(0,n.height),t.fillStyle=i.fill,t.fill()):(t.strokeStyle=i.stroke,t.stroke()),t.closePath(),t.restore()):(t.beginPath(),t.arc(t.canvas.clientWidth/2,e[1],5,0,2*Math.PI),t.fillStyle=i.stroke,t.fill(),t.closePath())},drawGrid:function(){var t=this.getGridParams(this.xServiceObject,66),e=this.getGridParams(this.yServiceObject,50);this.drawXYGrid(!0,t,this.chartCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line",this.configObject.grid.gridColor),this.drawXYGrid(!1,e,this.chartCanvas,this.yServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line",this.configObject.grid.gridColor),this.drawXYGrid(!0,t,this.chartCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"label",this.configObject.grid.labelColor,"in","month"),this.drawXYGrid(!1,e,this.chartCanvas,this.yServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"label",this.configObject.grid.labelColor,"in","price")},carrentDataIndicator:function(){var t=this;this.canvasCoords.forEach((function(e,i){var o=[];e.forEach((function(t){o.push(t.x),o.push(t.y)})),t.lcoords[i].length&&t.drawLineIndicator([o[o.length-2],o[o.length-1],t.lcoords[i][t.lcoords[i].length-1].y],i,!1)}))},maxDataIndicator:function(){var t=this;this.lcoords.forEach((function(e,i){var o=e.findIndex((function(t){return t.y===Math.max.apply(null,e.map((function(t){return t.y})))}));t.drawLineIndicator([t.canvasCoords[i][o].x,t.canvasCoords[i][o].y,t.lcoords[i][o].y],i,!0)}))},minDataIndicator:function(){var t=this;this.lcoords.forEach((function(e,i){var o=e.findIndex((function(t){return t.y===Math.min.apply(null,e.map((function(t){return t.y})))}));t.drawLineIndicator([t.canvasCoords[i][o].x,t.canvasCoords[i][o].y,t.lcoords[i][o].y],i,!0)}))},formatLabel:function(t,e){var i=e<=7&&e>=-6?t.toFixed(Math.max(0,-e)):t.toExponential();return i.length>10&&(i=t.toPrecision(6)),i},drawLineIndicator:function(t,e,i){this.chartCanvas.ctx.save(),this.chartCanvas.ctx.setLineDash([3,7]),this.chartCanvas.ctx.lineWidth=1,i&&(this.chartCanvas.ctx.beginPath(),this.chartCanvas.ctx.lineTo(t[0],t[1]),this.chartCanvas.ctx.lineTo(this.chartCanvas.canvasObject.getBoundingClientRect().width,t[1]),this.chartCanvas.ctx.strokeStyle=this.points[e][0].stroke,this.chartCanvas.ctx.stroke(),this.chartCanvas.ctx.closePath()),this.chartCanvas.ctx.restore(),this.yAxisCanvas.ctx.save(),this.yAxisCanvas.ctx.font="12px Arial",this.yAxisCanvas.ctx.beginPath(),this.yAxisCanvas.ctx.fillStyle=this.points[e][0].fill,this.yAxisCanvas.ctx.arc(this.yAxisCanvas.canvasObject.getBoundingClientRect().width/2,t[1],6,0,2*Math.PI),this.yAxisCanvas.ctx.fill(),this.yAxisCanvas.ctx.arc(this.yAxisCanvas.canvasObject.getBoundingClientRect().width/2,t[1],6,0,2*Math.PI),this.yAxisCanvas.ctx.lineWidth=2,this.yAxisCanvas.ctx.strokeStyle=this.points[e][0].stroke,this.yAxisCanvas.ctx.stroke(),this.yAxisCanvas.ctx.restore()},roundedRect:function(t,e,i,o,n,s){t.moveTo(e,i+s),t.arcTo(e,i+n,e+s,i+n,s),t.arcTo(e+o,i+n,e+o,i+n-s,s),t.arcTo(e+o,i,e+o-s,i,s),t.arcTo(e,i,e,i+s,s)}},mounted:function(){var t=this;this.$nextTick((function(){t.points&&t.drawChart()}))}},LV=$V,FV=(i("9a6a"),Object(C["a"])(LV,IV,BV,!1,null,"75e59fa6",null)),jV=FV.exports,RV={name:"StatisticsBlock",mixins:[xt,Ot],props:{expand:{type:Boolean},activeContract:{type:String},activeTabProfile:{type:String},portfolio:{type:Boolean},successfulPercentProps:{type:Number,default:0},successfulMonthProps:{type:Number,default:0}},components:{ProgressRoundDiagram:c$,ButtonIconFlat:Le,SimpleLineChart:jV},data:function(){return{widthCard:344,fixedHeight:96,ordersByContract:null,tooltipVisible:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStat:"statistic/getStatistics",getStatByMonth:"statistic/getStatByMonth",getStatByOrders:"contracts/getStatByOrders",isLoadingStatData:"expertsPortfolio/isLoadingStatData",getStatData:"statDataForPortfolio/getStatData",findPortfolio:"expertsPortfolio/findPortfolio"})),{},{getTitle:function(){return this.portfolio?[this.$t("by_portfolio"),this.$t("by_portfolio")]:this.portfolio||"UserProfileTradingTab"!==this.activeTabProfile?this.portfolio||"UserProfileTradingTab"===this.activeTabProfile?void 0:[this.$t("by account"),this.$t("by account")]:[this.activeContract,this.activeContract]},getLineChartConfig:function(){return{type:"line",expandX:{maxExpand:0,minExpand:0},theme:this.getActiveTheme,baseLine:null,expandY:{maxExpand:.2,minExpand:.2},indicators:["carrentDataIndicator"],size:{width:this.widthCard,height:this.fixedHeight},grid:{status:!1,label:{status:!0,units:"%"}},modifier:{class:[],style:{},id:""}}},expertsForStat:function(){if(!this.isLoadingStatData&&this.portfolio)return"Active"===this.findPortfolio.status?this.getStatData.myStat:this.getStatData.statSubs;if(!this.portfolio){if("UserProfileTradingTab"===this.activeTabProfile)return JSON.parse(sessionStorage.getItem("statContract".concat(this.activeContract)));if(this.getStatByMonth&&this.getStatByMonth.length)return this.getStatByMonth}},combinedDataProfitMonths:function(){if(this.expertsForStat){var t={};this.portfolio?this.expertsForStat.forEach((function(t){t.data.length&&t.data.forEach(i)})):"UserProfileTradingTab"===this.activeTabProfile?this.expertsForStat.forEach(o):this.expertsForStat.forEach(n);var e=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]}));return e.map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return 1===o.length?[+i,o[0]]:[+i,o.reduce((function(t,e){return t+e}),0)/o.length]}))}function i(e){var i=new Date(e.date).getTime(),o=100*e.profitClose/e.usedVolume;!isNaN(o)&&e.usedVolume||(o=0),t[i]||(t[i]=[]),t[i].push(o)}function o(e){var i=new Date(e[3]).getTime(),o=100*e[4]/e[9];!isNaN(o)&&e[9]||(o=0),t[i]||(t[i]=[]),t[i].push(o)}function n(e){var i=new Date(e.date).getTime(),o=e.profitRel;t[i]||(t[i]=[]),t[i].push(o)}},pointsSuccessfulMonth:function(){if(this.combinedDataProfitMonths){var t=[],e={};this.combinedDataProfitMonths.forEach((function(t){var i=Object(D["a"])(t,2),o=i[0],n=i[1],s=new Date(o),r="".concat(s.getMonth(),".").concat(s.getFullYear());e[r]||(e[r]=[]),e[r].push(n)}));var i=Object.entries(e),o=0;return i.forEach((function(e,i){var n=e[1].reduce((function(t,e){return t+e}),0)/e.length,s=e[0].split("."),r=new Date(s[1],s[0],1);n>=0&&(o+=1);var a=100*o/(i+1);t.push({time:r.getTime(),data:a.toFixed(1)})})),[{fill:"rgba(0, 142, 114, 0.1)",stroke:"#008E72"}].concat(t)}},combinedDataSuccessTransaction:function(){var t=this;if(this.expertsForStat){var e={};this.portfolio?this.expertsForStat.forEach((function(t){"empty"!==t.data&&t.data.forEach(o)})):"UserProfileTradingTab"===this.activeTabProfile?this.expertsForStat.forEach(n):this.expertsForStat.forEach(s);var i=Object.entries(e).sort((function(t,e){return+t[0]-+e[0]}));return i.map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1],s=n[0].reduce((function(t,e){return t+e}),0)/n[0].length,r=n[1].reduce((function(t,e){return t+e}),0)/n[1].length,a=100*s/r;return!isNaN(a)&&r||(a=0),[+o,"UserProfileTradingTab"===t.activeTabProfile?+a.toFixed(1):Math.round(n[0])]}))}function o(t){var i=new Date(t.date).getTime();e[i]||(e[i]=[[],[]]),e[i][0].push(t.pClosedCount),e[i][1].push(t.closedCount)}function n(t){var i=new Date(t[3]).getTime();e[i]||(e[i]=[[],[]]),e[i][0].push(t[11]),e[i][1].push(t[12])}function s(t){var i=new Date(t.date).getTime();e[i]||(e[i]=[[],[]]),e[i][0].push(t.procPosOrders)}},pointsSuccessfulTransactions:function(){if(this.combinedDataSuccessTransaction){var t=this.combinedDataSuccessTransaction.map((function(t){return{time:t[0],data:t[1]}}));return[{fill:"rgba(36, 98, 219, 0.1)",stroke:"#2462db"}].concat(Object(x["a"])(t))}},getPositiveMonth:function(){var t;return this.portfolio?this.successfulMonthProps:+(null===(t=this.pointsSuccessfulMonth)||void 0===t||null===(t=t.at(-1))||void 0===t?void 0:t.data)},getClassPositiveMonth:function(){return{red:this.getPositiveMonth<0,green:this.getPositiveMonth>=0}},getSuccessfulTransaction:function(){if(this.getStat&&!this.portfolio){var t=this.getStat.ordersStatistics,e=t.closedOrdersCount,i=t.positiveOrders;return 0===i?0:(100*i/e).toFixed(2)}},getPercentSuccessfulOrders:function(){if(this.ordersByContract){if(!this.ordersByContract.length)return 0;var t=this.ordersByContract.filter((function(t){return t.profit>0})).length;return 100*t/this.ordersByContract.length}},successfulTransactionPercent:function(){return this.portfolio?this.successfulPercentProps:this.pointsSuccessfulTransactions?+this.pointsSuccessfulTransactions.at(-1).data:0},getClassSuccessfulTransaction:function(){var t=this.portfolio?this.successfulPercentProps:this.getSuccessfulTransaction;return{red:t<30,green:t>=30}},getDataIconArrowSuccessfulTransaction:function(){var t=this.portfolio?this.successfulPercentProps:this.getSuccessfulTransaction,e=t>30?"Arrow-nano-top":"Arrow-nano-bottom",i=t>30?"#008E72":"#e91212";return this.darkClass.dark&&(i=t>0?"#00ffac":"#fa4c4a"),{name:e,color:i}},getDataIconArrowPositiveMonth:function(){var t=this.getPositiveMonth>0?"Arrow-nano-top":"Arrow-nano-bottom",e=this.getPositiveMonth>0?"#008E72":"#e91212";return this.darkClass.dark&&(e=this.getPositiveMonth>0?"#00ffac":"#fa4c4a"),{name:t,color:e}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{collapse:!this.expand})},dark:function(){return this.darkClass.dark}}),watch:{getStatByOrders:function(t){t&&this.setOrdersByContract()},activeContract:function(){this.setOrdersByContract()}},mounted:function(){this.getStatByOrders&&this.setOrdersByContract()},methods:{openTooltip:function(){this.tooltipVisible=!0},hiddenTooltip:function(){this.tooltipVisible=!1},setOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage();this.ordersByContract=e.closedOrders.filter((function(e){return e.instrumentName===t.activeContract}))}}},WV=RV,NV=(i("9c25"),Object(C["a"])(WV,DV,kV,!1,null,"76a4e069",null)),EV=NV.exports,UV={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUser:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount"})),{},{myProfile:function(){var t=this,e=this.getProfileAccount.find((function(e){return e.id===t.$route.query.accountId}));return!!e},loadingProfile:function(){return!this.getUser.id||0===this.getProfileAccount.length}})};i("f00c");function VV(t){return t.$orderStorage.getOrdersOnStorage()||[]}function HV(t){return Object.keys(VV(t)).length?VV(t)["tradingOrders"]:[]}function GV(t){return Object.keys(VV(t)).length?VV(t).accountId:null}function qV(t){return Object.keys(VV(t)).length?VV(t)["closedOrders"]:[]}var zV={name:"ProfileOrdersRightBar",mixins:[UV,xt,lW],props:{loadedSessionTableData:{type:Boolean},activeTabProfile:{type:String},symbol:{type:String,default:""}},components:{Sceleton:nT,OrdersContainer:NT,StatisticsBlock:EV},data:function(){return{mounted:!1,dataClosedPosition:[],dataOpenPosition:[],currentDate:new Date,marginBottom:2,heightOpenOrder:37,heightOpenOrderProvider:41,heightClosedOrder:65,heightClosedOrderProvider:76,expand:!0,sectionHeight:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatByOrders:"contracts/getStatByOrders"})),{},{isLoading:function(){var t;return"unauth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)?!this.getStatByOrders:this.loadingProfile},formattedClosedOrders:function(){if(this.dataClosedPosition&&this.dataClosedPosition.length){var t=this.myProfile?this.heightClosedOrder:this.heightClosedOrderProvider;return PV({orders:this.dataClosedPosition,myProfile:this.myProfile,marginBottom:this.marginBottom,sizeFieldClosed:t})}},ordersOpenAndClosedLastMonth:function(){var t=this;if(0!==this.dataClosedPosition.length||0!==this.dataOpenPosition.length){var e=[].concat(Object(x["a"])(this.dataClosedPosition),Object(x["a"])(this.dataOpenPosition)),i=e.filter((function(e){return e.contractName===t.symbol}));if(0!==i.length){var o=i.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{sortDate:"Closed"===t.status?t.closedDate:t.openDate})}));return o=o.sort((function(t,e){return new Date(e.sortDate).getTime()-new Date(t.sortDate).getTime()})),o=o.length>50?o.slice(0,50):o,o}}},formattedOpenAndClosedOrders:function(){if(this.ordersOpenAndClosedLastMonth&&0!==this.ordersOpenAndClosedLastMonth.length){var t=this.myProfile?this.heightClosedOrder:this.heightClosedOrderProvider,e=this.myProfile?this.heightOpenOrder:this.heightOpenOrderProvider;return PV({orders:this.ordersOpenAndClosedLastMonth,myProfile:this.myProfile,marginBottom:this.marginBottom,sizeFieldClosed:t,sizeFieldOpen:e})}},orders:function(){return"UserProfileTradingTab"!==this.activeTabProfile?this.formattedClosedOrders:this.formattedOpenAndClosedOrders},sceletonCount:function(){if(!this.sectionHeight)return 0;var t=this.heightClosedOrderProvider;return Math.floor(((null===this||void 0===this?void 0:this.sectionHeight)-16)/t)},sceletonHeight:function(){return this.heightClosedOrderProvider},isVisibleOrders:function(){var t;return(null===(t=this.orders)||void 0===t?void 0:t.length)>0},isVisibleClosedOrders:function(){return this.isVisibleOrders&&!this.isLoading},rootClass:function(){return Object(c["a"])({mounted:this.mounted},this.darkClass)}}),watch:{loadedSessionTableData:function(){this.dataClosedPosition=qV(this),this.dataOpenPosition=HV(this)}},mounted:function(){var t=this;this.mounted=!0,this.$nextTick((function(){var e;t.sectionHeight=null===(e=t.$refs.section)||void 0===e?void 0:e.clientHeight})),this.$orderStorage.getOrdersOnStorage()&&(this.dataClosedPosition=qV(this),this.dataOpenPosition=HV(this))},methods:{toggleExpand:function(){this.expand=!this.expand}}},YV=zV,XV=(i("b00f"),Object(C["a"])(YV,_V,AV,!1,null,"a34d4a34",null)),QV=XV.exports,JV=function(){var t=this,e=t._self._c;return e("div",{ref:"section",staticClass:"PortfolioOrders"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoadingOrders?e("div",{key:"loading",staticClass:"loadingData"},[e("Sceleton",{staticClass:"topSceleton",attrs:{height:96}}),t._l(t.sceletonCount,(function(i){return e("Sceleton",{key:i,staticClass:"sceletonOrder",attrs:{height:t.heightClosedOrderProvider}})}))],2):e("div",{staticClass:"ordersBlock"},[e("StatisticsBlock",{attrs:{expand:t.expand,portfolio:!0,successfulPercentProps:t.successfulPercentProps,successfulMonthProps:t.successfulMonthProps,activeTabProfile:t.activeTabProfile},on:{toggleExpand:t.toggleExpand}}),e("OrdersContainer",{key:"OrdersContainer",ref:"ordersContainer",attrs:{whereIs:"ProfileOrdersRightBar",prefix:"_profileOrders",orders:t.orders}})],1)])],1)},KV=[];function ZV(t){if(t.length){var e=t.at(-1)[9],i=t.at(-1)[6];if(0===e)return 0;var o=100*i/e;return isNaN(o)?0:o}}function tH(t){if(t.length){var e=[];return t.forEach((function(t){var i=new Date(t[1]).getMonth(),o=new Date(t[1]).getFullYear();e.push("".concat(i,".").concat(o))})),Array.from(new Set(e))}}function eH(t){return t.map((function(t){return new Date(t[1]).getTime()}))}function iH(t){var e=t.at(-1)[8],i=t.at(-1)[9],o=100*e/i;return isNaN(o)||!i?0:o}var oH={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getStatData:"statDataForPortfolio/getStatData"})),{},{getStatusBag:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getStatForPrtfolio:function(){if(this.getStatData)return"Active"===this.getStatusBag?this.getStatData.myStat:this.getStatData.statSubs},commonStatData:function(){var t=this;if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var e=[];return this.getStatForPrtfolio.forEach((function(i){t.modalComponent&&t.checkedExpertsGraph.find((function(t){return t.login===i.login})).status,e.push(i.data)})),e}},combinedDataDollar:function(){var t=this;if(this.commonStatData&&this.commonStatData.length){var e={};if(this.commonStatData.forEach((function(t){t.length&&t.forEach((function(t){var i=new Date(t.date).getTime();e[i]?e[i].push(t.profitClose):e[i]=[t.profitClose]}))})),Object.entries(e).length){var i=Object.entries(e).sort((function(t,e){return+t[0]-+e[0]}));return i.map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1];return 1===n.length?[+o,n[0]]:[+o,"Active"===t.getStatusBag?n.reduce((function(t,e){return t+e}),0):n.reduce((function(t,e){return t+e}),0)/n.length]}))}}},combinedData:function(){var t=this;if(this.commonStatData&&this.commonStatData.length){var e={};this.commonStatData.forEach((function(t){t.length&&t.forEach((function(t){var i=new Date(t.date).getTime(),o=100*t.profitClose/t.usedVolume;!isNaN(o)&&t.usedVolume||(o=0),e[i]?e[i].push(o):e[i]=[o]}))}));var i=Object.entries(e).sort((function(t,e){return+t[0]-+e[0]}));return i.map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1];return 1===n.length?[+o,n[0]]:[+o,"Active"===t.getStatusBag?n.reduce((function(t,e){return t+e}),0):n.reduce((function(t,e){return t+e}),0)/n.length]}))}},averageIncome:function(){return this.combinedData&&this.combinedData.length?this.combinedData.at(-1)[1]:0},averageIncomeDollar:function(){return this.combinedDataDollar&&this.combinedDataDollar.length?this.combinedDataDollar.at(-1)[1]:0},averageIncomeFormatted:function(){return Lm(this.averageIncome,2)},incomeClass:function(){return{red:this.averageIncome<0,green:this.averageIncome>=0}},calcMaxDD:function(){var t,e;if(this.combinedData.forEach((function(t,i,o){var n=Object(D["a"])(t,2),s=n[1];if(0!==i){var r,a=s,c=o[i-1][1];r=a>=c?0:a-c,(!e||r=0)return 0;var i=100*e.dropDown/e.profitOpen;return i>0?-1*i:i},maxDDFormatted:function(){return Lm(this.calcMaxDD,2)},maxDDClass:function(){return{red:this.calcMaxDD<0}},totalClosedOrders:function(){if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push(e.data.at(-1).closedCount)})),t.reduce((function(t,e){return t+e}),0)}},ordersClosedProfit:function(){var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push(e.data.at(-1).pClosedCount)})),t.reduce((function(t,e){return t+e}),0)},getProfitOrdersPercent:function(){return this.totalClosedOrders?+(100/(this.totalClosedOrders/this.ordersClosedProfit)).toFixed(1):0},getProfitOrdersDollar:function(){if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push(e.data.at(-1).profitClose)})),t.reduce((function(t,e){return t+e}),0)/t.length}},profitabilityPortfolio:function(){var t=[];this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push(ZV(e.data))}));var e=t.reduce((function(t,e){return t+e}),0);return e/this.expertsForStat.length},getCountMonthPortfolio:function(){if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push.apply(t,Object(x["a"])(tH(e.data)))})),t.length?Array.from(new Set(t)):[]}},monthProfitPortfolio:function(){if(!this.getCountMonthPortfolio||!this.getCountMonthPortfolio.length)return 0;var t=this.profitabilityPortfolio/this.getCountMonthPortfolio.length;return(isNaN(t)||0===this.getCountMonthPortfolio.length)&&(t=0),t},monthProfitPortfolioFormatted:function(){var t=this.monthProfitPortfolio<1?1:2;return Lm(this.monthProfitPortfolio,t)+"%"},valueClassMontPortfolio:function(){return{green:this.monthProfitPortfolio>=0,red:this.monthProfitPortfolio<0}},getCountDaysPortfolio:function(){if(!this.getStatForPrtfolio||!this.getStatForPrtfolio.length)return 0;var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push.apply(t,Object(x["a"])(eH(e.data)))})),Array.from(new Set(t))},dayProfitPortfolio:function(){if(!this.getStatForPrtfolio||!this.getStatForPrtfolio.length)return 0;var t=this.profitabilityPortfolio/this.getCountDaysPortfolio.length;return isNaN(t)&&(t=0),t},dayProfitPortfolioFormatted:function(){return Lm(this.dayProfitPortfolio,2)+"%"},valueClassDayPortfolio:function(){return{green:this.dayProfitPortfolio>=0,red:this.dayProfitPortfolio<0}},currentIncomePortfolio:function(){if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var t=[];return this.getStatForPrtfolio.forEach((function(e){e.data.length&&t.push(iH(e.data))})),t.reduce((function(t,e){return t+e}),0)/this.getStatForPrtfolio.length}},currentIncomePortfolioFormatted:function(){return this.currentIncomePortfolio?Lm(this.currentIncomePortfolio,2)+" %":"0 %"},valueClassCurrentIncomePortfolio:function(){return{green:this.currentIncomePortfolio>=0,red:this.currentIncomePortfolio<0}},getChartPoints:function(){if(this.getStatForPrtfolio&&this.getStatForPrtfolio.length){var t={};if(this.getStatForPrtfolio.forEach((function(e){e.data.length&&e.data.forEach((function(e){var i=new Date(e.date).getTime(),o=100*e.pClosedCount/e.closedCount;(0===e.closedCount||isNaN(o))&&(o=0),t[i]?t[i].push(o):t[i]=[o]}))})),Object.entries(t).length){var e=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]}));return e.map((function(t){return t[1].reduce((function(t,e){return t+e}),0)/t[1].length}))}}},ratioSharpPortfolio:function(){if(!this.commonStatData||!this.commonStatData.length)return 0;var t=[];return this.commonStatData.forEach((function(e){e.length&&t.push(e.at(-1).sharp)})),t.reduce((function(t,e){return t+e}),0)/t.length},ratioSharpPortfolioFormatted:function(){return Lm(this.ratioSharpPortfolio,2)},successfulDays:function(){if(!this.combinedData||!this.combinedData.length)return 0;var t=0;return this.combinedData.forEach((function(e){var i=Object(D["a"])(e,2),o=i[1];o>=0&&(t+=1)})),100*t/this.combinedData.length},successfulDaysFormatted:function(){return 0===this.successfulDays?"0":Lm(this.successfulDays,2)+" %"},successfulMonth:function(){if(!this.combinedData)return 0;var t=0,e={};this.combinedData.forEach((function(t){var i=Object(D["a"])(t,2),o=i[0],n=i[1],s=new Date(o),r="".concat(s.getMonth(),".").concat(s.getFullYear());e[r]?e[r].push(n):e[r]=[n]}));var i=Object.values(e);return i.forEach((function(e){var i=e.reduce((function(t,e){return t+e}),0)/e.length;i>=0&&(t+=1)})),100*t/i.length},successfulMonthFormatted:function(){return 0===this.successfulMonth?"0":Lm(this.successfulMonth,2)+" %"}})},nH={name:"PortfolioOrders",mixins:[oH],props:{activeTabProfile:{type:String}},components:{OrdersContainer:NT,StatisticsBlock:EV,Sceleton:nT},data:function(){return{marginBottom:2,heightClosedOrderProvider:76,heightOpenOrderProvider:41,expand:!0,sectionHeight:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingStatData:"expertsPortfolio/isLoadingStatData",getStatData:"statDataForPortfolio/getStatData",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",isLoadingOrders:"statDataForPortfolio/isLoadingOrders"})),{},{sceletonCount:function(){if(!this.sectionHeight)return 0;var t=this.heightClosedOrderProvider;return Math.floor(((null===this||void 0===this?void 0:this.sectionHeight)-16)/t)},expertsForStat:function(){if(!this.isLoadingStatData)return this.getStatData},successfulPercentProps:function(){return this.isLoadingStatData?0:this.getProfitOrdersPercent},successfulMonthProps:function(){return this.isLoadingStatData?0:Lm(this.successfulMonth,1)},orders:function(){var t=[].concat(Object(x["a"])(this.openOrders),Object(x["a"])(this.closedOrders));return t=t.sort((function(t,e){return new Date(e.createdDate).getTime()-new Date(t.createdDate).getTime()})),PV({orders:t,myProfile:!1,marginBottom:this.marginBottom,sizeFieldClosed:this.heightClosedOrderProvider,sizeFieldOpen:this.heightOpenOrderProvider})}}),mounted:function(){this.sectionHeight=this.$refs.section.clientHeight},methods:{toggleExpand:function(){this.expand=!this.expand}}},sH=nH,rH=(i("eddb9"),Object(C["a"])(sH,JV,KV,!1,null,"54f1167e",null)),aH=rH.exports,cH={name:"OrdersRightBar",props:{loadedSessionTableData:{type:Boolean},activeTabProfile:{type:String},symbol:{type:String,default:""},profile:{type:Boolean}},components:{TradingStreamOrders:wV,ProfileOrdersRightBar:QV,PortfolioOrders:aH},computed:{isVisiblePortfolioOrders:function(){return this.profile&&"UserProfileMyInvestments"===this.activeTabProfile},propsPortfolioOrders:function(){return{activeTabProfile:this.activeTabProfile}},propsProfileOrders:function(){return{loadedSessionTableData:this.loadedSessionTableData,activeTabProfile:this.activeTabProfile,symbol:this.symbol}},propsTradingOrders:function(){return{symbol:this.symbol}}}},lH=cH,uH=(i("4d3d"),Object(C["a"])(lH,rV,aV,!1,null,null,null)),dH=uH.exports,hH=function(){var t=this,e=t._self._c;return e("div",{class:"stream stream_".concat(t.getActiveTheme)},[e("div",{staticClass:"stream-navigation"},[e("ButtonFlatIcon",{attrs:{icon:{name:"Stream"},modifier:{class:["stream-navigation-online","StreamsOnline"===t.activeComponent?"stream-navigation-online_isActive_".concat(t.getActiveTheme):"stream-navigation-online_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({name:"StreamsOnline"})}}}),e("ButtonFlatIcon",{attrs:{icon:{name:"CalendarEvents"},modifier:{class:["stream-navigation-button","StreamsEvents"===t.activeComponent&&"Symbol"===t.modeEvents?"stream-navigation-button_isActive_".concat(t.getActiveTheme):"stream-navigation-button_".concat(t.getActiveTheme)],style:{width:"3.2rem",height:"3.2rem"}}},on:{click:function(e){return t.setActiveComponent({name:"StreamsEvents",mode:"Symbol"})}}}),e("ButtonFlatIcon",{attrs:{modifier:{class:["stream-navigation-button","StreamsEvents"===t.activeComponent&&"UserId"===t.modeEvents?"stream-navigation-button_isActive_".concat(t.getActiveTheme):"stream-navigation-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({name:"StreamsEvents",mode:"UserId"})}}},[t._v(t._s(t.$t("myStreams")))]),e("ButtonFlatIcon",{attrs:{icon:{name:"Stream"},modifier:{class:["stream-navigation-button","StreamStartSettings"===t.activeComponent?"stream-navigation-button_isActive_".concat(t.getActiveTheme):"stream-navigation-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({name:"StreamStartSettings"})}}},[t._v(t._s(t.$t("startYourStream")))]),e("div",{staticClass:"stream-navigation-help",class:"stream-navigation-help_".concat(t.getActiveTheme)},[e("a",{staticStyle:{cursor:"pointer"},attrs:{href:"https://about.toptrader.ru/docs/instruction_streaming.pdf",target:"_blank"}},[e("svgIcon",{attrs:{name:"Instruction"}})],1)])],1),e(t.activeComponent,{tag:"component",attrs:{mode:t.modeEvents},on:{createStream:t.createStream}})],1)},pH=[],gH=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamsOnline"},[e("div",{staticClass:"StreamsOnline_filter"},[e("StreamCalendarFilter",{attrs:{filter:t.filter},on:{setFilterItem:t.setActiveFilter}})],1),t.onlineStreams&&t.onlineStreams.length?e("div",{staticClass:"StreamsOnline-streams"},t._l(t.onlineStreams,(function(i,o){return e("StreamAccordionItem",{key:o,attrs:{streamData:i},on:{stopStream:t.getOnlineStreams}})})),1):t._e(),e("Preloader",{attrs:{enabled:t.loadStatus,icon:!0}}),t.onlineStreams&&t.onlineStreams.length||t.loadStatus?t._e():e("div",{staticClass:"StreamsOnline-emtyStreams"},[t._v("Сейчас нет активных стримов!")])],1)},fH=[],mH=function(){var t=this,e=t._self._c;return e("div",{class:"streamAccordionItem streamAccordionItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamAccordionItem-preview",class:t.getActiveTheme},[e("div",{staticClass:"streamAccordionItem-preview_streamLogo",class:t.getActiveTheme},[e("div",{staticClass:"streamAccordionItem-preview_streamLogo-img",class:t.getActiveTheme},[e("img",{attrs:{src:t.streamData.hostedLogo,width:"100%",height:"100%"}})]),"Start"===t.streamData.status?e("div",{staticClass:"streamAccordionItem-preview_streamLogo-playerSkin",class:t.getActiveTheme,on:{click:t.openPlayer}},[e("svgIcon",{attrs:{name:"new-icn-play",size:36}})],1):t._e()]),e("div",{staticClass:"streamAccordionItem-preview_infoWrap",class:t.getActiveTheme},[e("div",{staticClass:"streamAccordionItem-preview_infoWrap-user",class:t.getActiveTheme},[e("div",{staticClass:"streamAccordionItem-preview_infoWrap-user_avatar",class:t.getActiveTheme},[e("avatar",{attrs:{size:"1.7",src:t.getUserAvatar,theme:t.getActiveTheme}})],1),e("div",{class:"streamAccordionItem-preview_infoWrap-user_name streamAccordionItem-preview_infoWrap-user_name_".concat(t.getActiveTheme)},[t._v(t._s(t.getNameUser))])]),e("div",{staticClass:"streamAccordionItem-preview_infoWrap-textInfo"},[e("div",{class:"streamAccordionItem-preview_infoWrap-textInfo_title streamAccordionItem-preview_infoWrap-textInfo_title_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamAccordionItem-preview_infoWrap-textInfo_name"},[t._v(t._s(t.streamData.name))]),e("div",{attrs:{id:"streamDescription_".concat(t.streamData.streamId)},on:{mouseenter:t.showTooltipDescription,mouseleave:t.showTooltipDescription}},[e("svgIcon",{attrs:{name:"StatsText",size:15}}),e("DxTooltip",{attrs:{visible:t.descriptionStream,target:"#streamDescription_".concat(t.streamData.streamId),position:"top",container:".streamAccordionItem"}},[t._v(t._s(t.streamData.description))])],1)]),e("div",{staticClass:"streamAccordionItem-preview_infoWrap-textInfo_additionInfo"},[e("div",{staticClass:"streamAccordionItem-preview_infoWrap-textInfo_startDate",class:t.getActiveTheme},[t._v(t._s(t.getBeginDate))]),e("div",{class:"streamAccordionItem-preview_infoWrap-textInfo_tags streamAccordionItem-preview_infoWrap-textInfo_tags_".concat(t.getActiveTheme),attrs:{title:t.getTags}},[t._v(t._s(t.getTags))])])])]),t.streamData.isActive?e("div",{staticClass:"streamAccordionItem-preview_viewControl"},[t.streamData.userId!==t.getUserDetail.id?e("div",{staticClass:"streamAccordionItem-preview_play"},[e("ButtonIconFlat",{attrs:{icon:{name:"Play",color:t.getStatusSinglePlay?t.getGreenColor.color:t.getGrayColor.color},modifier:{class:["streamAccordionItem-buttonIcon","streamAccordionItem-buttonIcon_".concat(t.getActiveTheme)]}},on:{click:t.openPlayer}})],1):e("div",{staticClass:"streamAccordionItem-preview_play"},[e("ButtonIconFlat",{attrs:{icon:{name:"Stop",color:t.getRedColor.color},modifier:{class:["streamAccordionItem-buttonIcon","streamAccordionItem-buttonIcon_".concat(t.getActiveTheme)]}},on:{click:t.stopingStream}})],1)]):t._e(),t.streamData.isActive?t._e():e("div",{staticClass:"streamAccordionItem-preview_control"},[t.streamData.userId!==t.getUserDetail.id?e("ButtonIconFlat",{attrs:{icon:{name:"Add"},modifier:{class:["streamAccordionItem-buttonIcon","streamAccordionItem-buttonIcon_".concat(t.getActiveTheme)]}}}):e("div",{staticClass:"streamAccordionItem-preview_control"},[t.getActiveUserStream?t._e():e("div",{attrs:{id:"streamButton_".concat(t.streamData.streamId)},on:{mouseenter:t.showTooltipStream,mouseleave:t.showTooltipStream}},[e("ButtonIconFlat",{attrs:{icon:{name:"Stream"},modifier:{class:["streamAccordionItem-buttonIcon","streamAccordionItem-buttonIcon_".concat(t.getActiveTheme),"streamAccordionItem-buttonIcon_green_".concat(t.getActiveTheme)]}},on:{toggle:t.openStartPageStream}})],1),e("DxTooltip",{attrs:{visible:t.tooltipStream,target:"#streamButton_".concat(t.streamData.streamId),position:"top",container:".streamAccordionItem"}},[t._v(t._s(t.$t("startedStream")))]),e("div",{attrs:{id:"deleteButton_".concat(t.streamData.streamId)},on:{mouseenter:t.showTooltipDelete,mouseleave:t.showTooltipDelete}},[e("ButtonIconFlat",{attrs:{icon:{name:"Delete"},modifier:{class:["streamAccordionItem-buttonIcon","streamAccordionItem-buttonIcon_".concat(t.getActiveTheme),"streamAccordionItem-buttonIcon_red_".concat(t.getActiveTheme)]}},on:{toggle:t.showDeleteTooltipWarning}})],1),e("DxTooltip",{attrs:{visible:t.tooltipDelete,target:"#deleteButton_".concat(t.streamData.streamId),position:"top",container:".streamAccordionItem"}},[t._v(t._s(t.$t("deleteStream")))]),e("DxTooltip",{attrs:{visible:t.deleteStreamWarningTooltip,target:"#deleteButton_".concat(t.streamData.streamId),"content-template":"contentDeleteTooltip",position:"top",container:".streamAccordionItem"},scopedSlots:t._u([{key:"contentDeleteTooltip",fn:function(){return[e("div",{staticClass:"streamAccordionItem-deleteTooltipWarning"},[e("div",{staticClass:"streamAccordionItem-deleteTooltipWarning_title"},[t._v(t._s(t.$t("warnTooltipDeleteStream")))]),t.errorDeleteStream?e("div",{staticClass:"streamAccordionItem-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v("Ошибка сервера. Попробуйте повторить запрос позже.")],1):t._e(),e("div",{staticClass:"streamAccordionItem-deleteTooltipWarning_controls"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["streamAccordionItem-buttonIconWithText","streamAccordionItem-buttonIconWithText_".concat(t.getActiveTheme)]}},on:{toggle:t.showDeleteTooltipWarning}},[t._v(t._s(t.$t("cancel")))]),e("ButtonIconFlat",{attrs:{icon:{name:"Delete"},modifier:{class:["streamAccordionItem-buttonIconWithText","streamAccordionItem-buttonIconWithText_".concat(t.getActiveTheme)],style:{width:"10rem"}},process:t.loadDeleteStreamRequest},on:{toggle:t.deleteStream}},[t._v(t._s(t.$t("delete")))])],1)])]},proxy:!0}],null,!1,1536224913)})],1)],1)])])},vH=[],yH={components:{avatar:E,ButtonIconFlat:Le,DxTooltip:Pt["DxTooltip"]},props:{streamData:{default:null}},mixins:[qe],data:function(){return{userInfo:null,tooltipStream:!1,tooltipDelete:!1,deleteStreamWarningTooltip:!1,loadDeleteStreamRequest:!1,errorDeleteStream:!1,descriptionStream:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getApiStream:"api/apiStream",getUserDetail:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme",getUserSettings:"userSettings/getUserSettings",getActiveUserStream:"userStreams/getActiveUserStream",getPlayersStreams:"userStreams/getPlayersStreams"})),{},{getBeginDate:function(){var t,e;return this.streamData.isActive?"".concat(this.$t("started")," ").concat(new Date(new Date(this.streamData.startDateTime)-6e4*(new Date).getTimezoneOffset()).toLocaleString(null===(e=this.getUserSettings.lang)||void 0===e?void 0:e.code)):"".concat(this.$t("started")," ").concat(new Date(new Date(this.streamData.calendarDateTime)-6e4*(new Date).getTimezoneOffset()).toLocaleString(null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code))},getStatusSinglePlay:function(){var t=this;if(this.getPlayersStreams&&this.getPlayersStreams.length&&this.getPlayersStreams&&this.getPlayersStreams.length){var e=this.getPlayersStreams.filter((function(t){return 1===t.streams.length&&t.status}));return e.length?e.some((function(e){return e.streams[0].streamId===t.streamData.streamId})):void 0}},getUserAvatar:function(){return this.streamData.avatarURL?this.streamData.avatarURL:this.streamData.hostedLogo},getNameUser:function(){return this.streamData.firstName&&this.streamData.lastName?"".concat(this.streamData.firstName," ").concat(this.streamData.lastName):this.streamData.name},getTags:function(){return"string"!==this.streamData.tag?"#".concat(this.streamData.tag):""}}),methods:{showTooltipDescription:function(){this.descriptionStream=!this.descriptionStream},openPlayer:function(){this.getStatusSinglePlay||this.$store.commit("userStreams/addPlayerStream",{streams:[this.streamData],status:!0,id:(new Date).getTime()})},showDeleteTooltipWarning:function(){this.deleteStreamWarningTooltip=!this.deleteStreamWarningTooltip},openStartPageStream:function(){"Wowza"===this.streamData.providerType?(window.open("https://stream.toptrader.org/publish?stream=".concat(this.streamData.streamId,"&u=").concat(this.userInfo.login),"_blank"),this.$store.dispatch("modal/switchStreamSettingsModal",{status:!0,data:""})):this.$emit("startStream",this.streamData)},showTooltipStream:function(){this.tooltipStream=!this.tooltipStream},showTooltipDelete:function(){this.tooltipDelete=!this.tooltipDelete},stopingStream:function(){var t=this,e={providerType:this.streamData.providerType,id:this.streamData.streamId};this.$http({method:"PUT",url:"".concat(this.getApiStream,"Stream/stop"),data:e}).then((function(){t.$store.commit("userStreams/setUserActiveStream",null),t.$emit("stopStream"),t.showDeleteTooltipWarning()})).catch((function(){t.loadDeleteStreamRequest=!1,t.errorDeleteStream=!0,t.deleteStreamWarningTooltip=!1,t.$nextTick((function(){t.deleteStreamWarningTooltip=!0}))}))},deleteStream:function(){var t=this;this.loadDeleteStreamRequest=!0;var e={providerType:this.streamData.providerType,id:this.streamData.streamId};this.$http({method:"DELETE",url:"".concat(this.getApiStream,"Stream/streamid"),data:e}).then((function(){t.$emit("deleteStream"),t.showDeleteTooltipWarning()})).catch((function(){t.loadDeleteStreamRequest=!1,t.errorDeleteStream=!0,t.deleteStreamWarningTooltip=!1,t.$nextTick((function(){t.deleteStreamWarningTooltip=!0}))}))}}},CH=yH,bH=(i("eab0"),Object(C["a"])(CH,mH,vH,!1,null,"a61b9048",null)),SH=bH.exports,PH=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamCalendarFilter"},[e("div",{staticClass:"streamCalendarFilter-wrapper"},t._l(t.getFilters,(function(i,o){return i.showStatus?e("div",{key:o,class:"streamCalendarFilter-filterItem streamCalendarFilter-filterItem_".concat(t.getActiveTheme," ").concat(i.activeStatus?"streamCalendarFilter-filterItem-isActive_".concat(t.getActiveTheme):""),on:{click:function(e){return t.setActiveFilter(i.type)}}},[t._v(t._s(t.$t(i.name)))]):t._e()})),0)])},TH=[],xH={props:{filter:{type:String}},data:function(){return{filters:[{name:"",type:"Symbol",activeStatus:!0},{name:"allStreams",type:"",activeStatus:!1}]}},watch:{getActiveSymbol:function(){"Symbol"===this.getFilters.find((function(t){return t.activeStatus})).type&&this.$emit("setFilterItem","Symbol")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getActiveTheme:"headerSettings/getActiveTheme",getSession:"auth/getSession"})),{},{getActiveSymbol:function(){return this.getSelectedButtonForActiveScreen.symbol},getFilters:function(){var t=this;return this.filters.map((function(e){return{name:"Symbol"===e.type?t.getActiveSymbol:t.$t(e.name),type:e.type,activeStatus:e.activeStatus,showStatus:"UserId"!==e.type||!!t.getSession}}))}}),methods:{setActiveFilter:function(t){this.filters.forEach((function(e){e.type===t?e.activeStatus=!0:e.activeStatus=!1})),this.$emit("setFilterItem",t)},inintialActiveFilter:function(t){this.filters.forEach((function(e){e.type===t?e.activeStatus=!0:e.activeStatus=!1}))}},created:function(){this.inintialActiveFilter(this.filter?this.filter:"Symbol")}},OH=xH,wH=(i("7196"),Object(C["a"])(OH,PH,TH,!1,null,null,null)),_H=wH.exports,AH={components:{StreamAccordionItem:SH,StreamCalendarFilter:_H,Preloader:ah},data:function(){return{onlineStreams:[],filter:"Symbol",loadStatus:!1}},watch:{getSymbol:function(){this.getOnlineStreams()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({apiStream:"api/apiStream",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen"})),{},{getSymbol:function(){return this.getSelectedButtonForActiveScreen.symbol}}),methods:{setActiveFilter:function(t){this.filter=t,this.getOnlineStreams()},getOnlineStreams:function(){var t=this;this.loadStatus=!0;var e={UserId:null,Contracts:"Symbol"===this.filter?[this.getSymbol]:null};this.$http.post("".concat(this.apiStream,"Stream/activestreams"),JSON.stringify(e),{headers:{"Content-Type":"application/json"}}).then((function(e){t.onlineStreams=e.data,t.loadStatus=!1}))}},mounted:function(){this.getOnlineStreams()}},DH=AH,kH=(i("0930"),Object(C["a"])(DH,gH,fH,!1,null,null,null)),IH=kH.exports,BH=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamEvents"},["Symbol"===t.mode?e("div",{staticClass:"StreamEvents_celendarFilter"},[e("StreamCalendarFilter",{attrs:{filter:t.filter},on:{setFilterItem:t.setActiveFilter}})],1):t._e(),e("div",{staticClass:"StreamEvents_calendarWrapper"},[e("StreamCalendar",{key:t.updateCalendar,attrs:{selectedDate:t.selectedDate?new Date(t.selectedDate):new Date,filter:t.filter},on:{setDateEventCalendar:t.viewCalendarEvents}})],1),t.streamsByDate&&t.streamsByDate.length?e("div",{staticClass:"stream_accordionEventsWrapper"},t._l(t.streamsByDate,(function(i,o){return e("StreamAccordionItem",{key:o,attrs:{streamData:i},on:{deleteStream:t.deleteStream,stopStream:t.stopStream,startStream:t.startStream}})})),1):t._e(),t.startingStream?e("StreamStartModal",{attrs:{stream:t.startingStream},on:{startingStream:t.startStreamLastStep,updateStream:t.updateStreamSettings,close:t.closeStartModal}}):t._e()],1)},MH=[],$H=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StreamStartModal"},[e("DxPopup",{attrs:{visible:!0,shading:!1,width:"500px",height:"400px"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"StreamStartModal-title",class:"StreamStartModal-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"StreamStartModal-title-drag",style:{color:t.getGrayColor.color}},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"StreamStartModal-title-name"},[t._v(t._s(t.getNameStream))]),e("div",{staticClass:"StreamStartModal-title-date"},[t._v(t._s(t.getBeginDate))]),e("div",{staticClass:"StreamStartModal-title-close",style:{color:t.getRedColor.color},on:{click:t.closeModal}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"StreamStartModal-priview",class:"StreamStartModal-priview_".concat(t.getActiveTheme)},[e("div",{staticClass:"StreamStartModal-inputLink",class:"StreamStartModal-inputLink_".concat(t.getActiveTheme)},[e("div",{staticClass:"StreamStartModal-inputLink-label"},[t._v("Ссылка на стрим")]),e("div",{staticClass:"StreamStartModal-inputLink-input"},[e("input",{ref:"inputLink",attrs:{type:"text",disabled:!t.redactStatus},domProps:{value:t.stream.streamURL},on:{input:t.setStreamURL}})]),e("div",{staticClass:"StreamStartModal-inputLink-buttons"},[t.redactStatus?e("ButtonIconFlat",{attrs:{icon:{name:"Check"},modifier:{class:["StreamStartModal-inputLink-button","StreamStartModal-inputLink-button_".concat(t.getActiveTheme)]}},on:{click:t.redactLink}}):e("ButtonIconFlat",{attrs:{icon:{name:"Pencil"},modifier:{class:["StreamStartModal-inputLink-button","StreamStartModal-inputLink-button_".concat(t.getActiveTheme)]}},on:{click:t.setRedactStatus}})],1)]),t.link?e("div",{staticClass:"StreamStartModal-framePriview"},[e("div",{staticClass:"StreamStartModal-frameStream"},[e("iframe",{attrs:{width:"100%",height:"100%",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",src:t.link,allowfullscreen:"",frameborder:"0",iv_load_policy:"3"}})]),e("div",{staticClass:"StreamStartModal-startStream"},[e("ButtonIconFlat",{attrs:{icon:{name:"Stream",color:t.getGreenColor.color},modifier:{class:["StreamStartModal-startStream-button","StreamStartModal-startStream-button_".concat(t.getActiveTheme)]}},on:{click:t.startingStream}},[t._v("Выйти в эфир")])],1)]):e("div",{staticClass:"StreamStartModal-framePriview"},[e("div",{staticClass:"StreamStartModal-errorLink",style:{color:t.getRedColor.color}},[t._v("Ссылка на трансляцию иммет неверный формат, попробуйте изменить её.")]),e("div",{staticClass:"StreamStartModal-streamLogo"},[e("div",{staticClass:"StreamStartModal-streamLogo-img"},[e("img",{attrs:{width:"100%",src:t.stream.hostedLogo}})])])])])]},proxy:!0}])})],1)},LH=[],FH=(i("ad1f"),{props:{stream:{type:Object}},components:{DxPopup:wt["DxPopup"]},mixins:[qe],data:function(){return{link:"",redactStatus:!1,redactStreamURL:""}},watch:{redactStatus:function(t){t&&this.$refs.inputLink.focus()},stream:function(){this.setPreviewStream()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme",getApiStream:"api/apiStream"})),{},{getNameStream:function(){return this.stream.name},getBeginDate:function(){var t;return"".concat(this.$t("started")," ").concat(new Date(new Date(this.stream.calendarDateTime)-6e4*(new Date).getTimezoneOffset()).toLocaleString(null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code))}}),methods:{setPreviewStream:function(){"YouTube"===this.stream.providerType?this.link=this.srcOther(this.stream.streamURL):"RuTube"===this.stream.providerType?this.link=this.srcRutube(this.stream.streamURL):"Twitch"===this.stream.providerType&&(this.link=this.srcTwitch(this.stream.streamURL))},closeModal:function(){this.$emit("close")},setRedactStatus:function(){this.redactStatus=!0},setStreamURL:function(t){this.redactStreamURL=t.target.value},redactLink:function(){var t=this;if(this.redactStreamURL){var e=structuredClone(this.stream);e.streamURL=this.redactStreamURL,this.$http({method:"PUT",url:"".concat(this.getApiStream,"Stream/save"),data:e}).then((function(i){i.data.isOK&&(t.$emit("updateStream",e),t.redactStatus=!1)}))}else this.redactStatus=!1},startingStream:function(){var t=this,e={providerType:this.stream.providerType,id:this.stream.streamId};this.$http({method:"PUT",url:"".concat(this.getApiStream,"Stream/start"),data:e}).then((function(e){if(e.data.isOK){var i=structuredClone(t.stream);i.startDateTime=e.data.started,t.$store.commit("userStreams/setUserActiveStream",i),t.$emit("startingStream")}}))},srcTwitch:function(t){var e=/^https?:\/\/(?:www\.)?twitch\.(?:tv)/;if(e.test(t)){var i=t.split("/").at(-1);if(i)return"https://player.twitch.tv/?channel=".concat(i,"&parent=").concat("toptrader.ru")}},srcRutube:function(t){var e=/^https?:\/\/(?:www\.)?rutube\.(?:ru)/;if(e.test(t)){var i=t.split("video/")[1];if(i)return"https://rutube.ru/play/embed/".concat(i,"?autoplay=1")}},srcOther:function(t){var e=/^https?:\/\/(?:www\.)?youtube\./,i=/^https?:\/\/(?:www\.)?youtu\.(?:be\/)/;if(e.test(t)){var o=t.split("v=")[1],n=t.split("live/")[1];if(o){var s=o.indexOf("&");return-1!=s&&(o=o.substring(0,s)),"https://www.youtube.com/embed/".concat(o,"?autoplay=1")}if(n){var r=n.indexOf("?");return-1!=r&&(n=n.substring(0,r)),"https://www.youtube.com/embed/".concat(n,"?autoplay=1")}}else if(i.test(t)){var a=t.split("/")[3];return"https://www.youtube.com/embed/".concat(a,"?autoplay=1")}}},mounted:function(){this.setPreviewStream()}}),jH=FH,RH=(i("2e04"),Object(C["a"])(jH,$H,LH,!1,null,null,null)),WH=RH.exports,NH=function(){var t=this,e=t._self._c;return e("div",{key:t.showCalendar,class:"streamCalendar streamCalendar_".concat(t.getActiveTheme)},[e("DxCalendar",{attrs:{width:"360px",height:"360px","cell-template":"cell",value:t.selectedDate},scopedSlots:t._u([{key:"cell",fn:function(i){var o=i.data;i.index;return[e("div",{staticClass:"streamCalendar-cellWrap",on:{click:function(e){t.getInfoByStreams(t.checkStreamsToday(o.date),o.date)}}},[t.checkStreamsToday(o.date).length?e("div",{class:"streamCalendar-cellItem-stream streamCalendar-cellItem-stream_".concat(t.getActiveTheme),style:{color:t.checkActiveStreamsToday(o.date)?t.getRedColor.color:t.getGrayColor.color}},[e("svgIcon",{attrs:{name:"Stream",size:24}})],1):e("div",{class:"streamCalendar-cellItem"},[t._v(t._s(o.text))])])]}}])})],1)},EH=[],UH=i("86e0"),VH=i.n(UH),HH=i("52d2"),GH=i("0218"),qH=i("9e40"),zH={components:{DxCalendar:VH.a},props:{filter:{defaul:null},selectedDate:{default:null}},mixins:[qe],data:function(){return{showCalendar:!0,streams:[]}},watch:{getActiveLang:function(){var t=this;this.showCalendar=!1,this.$nextTick((function(){Object(qH["c"])(t.getActiveLang),t.showCalendar=!0}))},filter:function(t){null!==t&&this.getStreamEvents(t)},getActiveSymbol:function(){"Symbol"===this.filter&&this.getStreamEvents(this.filter)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getApiStream:"api/apiStream",getActiveTheme:"headerSettings/getActiveTheme",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getUserDetail:"user/getUserDetail"})),{},{getActiveSymbol:function(){return this.getSelectedButtonForActiveScreen.symbol},getActiveLang:function(){var t;if(this.getUserSettings)return null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code}}),methods:{getInfoByStreams:function(t,e){this.$emit("setDateEventCalendar",{streams:t,selectedDate:e})},checkStreamsToday:function(t){return this.streams.length?this.streams.filter((function(e){var i=e.isActive?e.startDateTime:e.calendarDateTime;return new Date(t).getFullYear()===new Date(i).getFullYear()&&new Date(t).getMonth()===new Date(i).getMonth()&&new Date(t).getDate()===new Date(i).getDate()})):[]},checkActiveStreamsToday:function(t){var e=this.checkStreamsToday(t);return e.some((function(t){return t.isActive}))},initMessages:function(){Object(qH["b"])(HH),Object(qH["b"])(GH)},getStreamEvents:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o={date:null},o.searchType=t?"Symbol"===t?"ByContract":"ByUser":"ByDate",t&&(o[t]="Symbol"===t?e.getActiveSymbol:e.getUserDetail.id),n={SearchString:JSON.stringify(o),FilleActives:!0},i.next=6,e.$http.post("".concat(e.getApiStream,"Stream/sourceinfo"),JSON.stringify(n),{headers:{"Content-Type":"application/json"}}).then((function(t){"UserId"===e.filter?(t.data.fromStore.length&&(e.streams=t.data.fromStore),t.data.fromActives.length&&(e.streams=e.streams.concat(t.data.fromActives.filter((function(t){return t.userId===e.getUserDetail.id}))))):(t.data.fromStore.length&&(e.streams=t.data.fromStore.filter((function(t){return t.userId!==e.getUserDetail.id}))),t.data.fromActives.length&&(e.streams=e.streams.concat(t.data.fromActives.filter((function(t){return t.userId!==e.getUserDetail.id}))))),e.showCalendar=!e.showCalendar,e.getInfoByStreams(e.checkStreamsToday(e.selectedDate),e.selectedDate)}));case 6:case"end":return i.stop()}}),i)})))()},initeCalendarByDate:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getStreamEvents(t.filter);case 2:t.getInfoByStreams(t.checkStreamsToday(t.selectedDate),t.selectedDate);case 3:case"end":return e.stop()}}),e)})))()},formatMessage:qH["a"]},created:function(){this.getActiveLang&&Object(qH["c"])(this.getActiveLang),this.initMessages(),this.filter&&this.getStreamEvents(this.filter)}},YH=zH,XH=(i("43f6"),Object(C["a"])(YH,NH,EH,!1,null,null,null)),QH=XH.exports,JH=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamAccordion",class:t.getActiveTheme},[t.showAccordion?e("DxAccordion",{attrs:{"data-source":t.getItemsForAccordion,multiple:!0,focusStateEnabled:!1,collapsible:!0,selectedItems:t.getItemsForAccordion,width:"360px"},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"streamAccordion-title",class:t.getActiveTheme},[e("div",{staticClass:"streamAccordion-title_text",class:t.getActiveTheme},[t._v(t._s(t.$t(o.text))+" "+t._s(o.count))])])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",t._l(o.collection,(function(i,o){return e("StreamAccordionItem",{key:o,attrs:{streamData:i},on:{deleteStream:t.deleteStream}})})),1)]}}],null,!1,830352084)}):t._e()],1)},KH=[],ZH={components:{DxAccordion:lw["DxAccordion"],StreamAccordionItem:SH},props:{streamsData:{default:null}},data:function(){return{typeStreams:[{type:"Free",text:"freeAccess",collection:[],count:0},{type:"Subs",text:"bySubscription",collection:[],count:0}],showAccordion:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getItemsForAccordion:function(){var t=this;if(this.streamsData)return this.streamsData.forEach((function(e){var i=t.typeStreams.findIndex((function(i){return i.type===t.getTypeStream(e)}));t.typeStreams[i].collection.push(e),++t.typeStreams[i].count})),this.typeStreams.forEach((function(e,i){e.count||t.typeStreams.splice(i,1)})),this.typeStreams}}),methods:{getTypeStream:function(t){return"Public"===t.visibility?"Free":"Private"===t.visibility?"Subs":void 0},deleteStream:function(){this.$emit("deleteStream")}}},tG=ZH,eG=(i("2d64"),Object(C["a"])(tG,JH,KH,!1,null,null,null)),iG=eG.exports,oG={props:{mode:{default:"Symbol"}},components:{StreamAccordionItem:SH,StreamCalendarFilter:_H,StreamStartModal:WH,StreamCalendar:QH,StreamAccordion:iG},data:function(){return{filter:"Symbol",startingStream:null,streamsByDate:null,selectedDate:null,eventAccordionStatus:!1,updateCalendar:!0}},watch:{mode:function(t){this.filter="Symbol"===t?"Symbol":"UserId"},getActiveUserStream:function(){this.updateCalendar=!this.updateCalendar}},computed:Object(c["a"])({},Object(p["c"])({getActiveUserStream:"userStreams/getActiveUserStream"})),methods:{setActiveFilter:function(t){this.filter=t},deleteStream:function(){var t=this;this.filter=null,setTimeout((function(){t.filter="UserId"}))},startStream:function(t){this.startingStream=t},stopStream:function(){var t=this;this.$store.commit("userStreams/setUserActiveStream",null),this.startingStream=null,this.filter=null,setTimeout((function(){t.filter="UserId"}))},startStreamLastStep:function(){var t=this;this.startingStream=null,setTimeout((function(){t.filter="UserId"}))},closeStartModal:function(){this.startingStream=null},viewCalendarEvents:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:e.streamsByDate=t.streams,e.selectedDate=t.selectedDate,t.streams.length?(e.eventAccordionStatus=!0,e.eventAccordionStatus=!1,e.$nextTick((function(){e.eventAccordionStatus=!0}))):e.eventAccordionStatus=!1;case 3:case"end":return i.stop()}}),i)})))()},updateStreamSettings:function(t){var e=this.streamsByDate.findIndex((function(e){return e.streamId===t.streamId}));-1!==e&&(this.streamsByDate.splice(e,1,t),this.startingStream=t)}},mounted:function(){"Symbol"===this.mode?this.filter="Symbol":this.filter="UserId"}},nG=oG,sG=(i("14da"),Object(C["a"])(nG,BH,MH,!1,null,null,null)),rG=sG.exports,aG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamStartSettings",class:"streamStartSettings_".concat(t.getActiveTheme)},[e("div",{class:"streamStartSettings-wrap streamStartSettings-wrap_".concat(t.getActiveTheme)},["Wowza"===t.activeStreamProvider?e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("resolution"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{class:"streamStartSettings-setting-dropDown streamStartSettings-setting-dropDown_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.resolution,value:t.getResolution,onValueChanged:t.setResolution,displayExpr:"name",valueExpr:"name",focusStateEnabled:!0,hoverStateEnabled:!1,dropDownOptions:{container:".streamStartSettings"}}})],1)])]):e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v("Стрим провайдер:")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{class:"streamStartSettings-setting-dropDown streamStartSettings-setting-dropDown_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.streamingProviders,"field-template":"field",valueExpr:"name",value:t.streamingProviders[0].name,onValueChanged:t.setStreamProvider,focusStateEnabled:!1,activeStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".streamStartSettings"}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"streamStartSettings-settingProvider-field"},[e("DxTextBox",{attrs:{text:o.name,visible:!1}}),e("div",{staticClass:"streamStartSettings-settingProvider-field-icon",style:{color:o.color}},[e("svgIcon",{attrs:{name:o.icon}})],1),e("div",{staticClass:"streamStartSettings-settingProvider-field-text",class:"streamStartSettings-settingProvider-field-text_".concat(t.getActiveTheme)},[t._v(t._s(o.name))])],1)]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"streamStartSettings-settingProvider-listItem",class:"streamStartSettings-settingProvider-listItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamStartSettings-settingProvider-listItem-icon",style:{color:o.color}},[e("svgIcon",{attrs:{name:o.icon}})],1),e("div",{staticClass:"streamStartSettings-settingProvider-listItem-text",class:"streamStartSettings-settingProvider-listItem-text_".concat(t.getActiveTheme)},[t._v(t._s(o.name))])])]}}])})],1)])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v("Ссылка на трансляцию:")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{class:"streamStartSettings-setting-input streamStartSettings-setting-input_".concat(t.getActiveTheme," ").concat(t.errorsStatuses.name?"streamStartSettings-setting-input_error":"")},[e("input",{attrs:{placeholder:"Введите ссылку"},domProps:{value:t.requestPayload.streamURL},on:{change:function(e){return t.setRequestPayloadParam(e.target.value,"streamURL")}}})]),t.errorsStatuses.name?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("fieldIsRequired")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("streamName"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{class:"streamStartSettings-setting-input streamStartSettings-setting-input_".concat(t.getActiveTheme," ").concat(t.errorsStatuses.name?"streamStartSettings-setting-input_error":"")},[e("input",{attrs:{placeholder:t.$t("enterTheTitle")},domProps:{value:t.requestPayload.name},on:{change:function(e){return t.setRequestPayloadParam(e.target.value,"name")}}})]),t.errorsStatuses.name?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("fieldIsRequired")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("description"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{class:"streamStartSettings-setting-textarea streamStartSettings-setting-textarea_".concat(t.getActiveTheme," ").concat(t.errorsStatuses.description?"streamStartSettings-setting-textarea_error":"")},[e("textarea",{attrs:{rows:"5",placeholder:t.$t("enterTheDescription")},domProps:{value:t.requestPayload.description},on:{change:function(e){return t.setRequestPayloadParam(e.target.value,"description")}}})]),t.errorsStatuses.description?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("fieldIsRequired")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("dateOfBeginning"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{staticClass:"streamStartSettings-setting_beginDate"},[!t.getPlanDate||t.streamNowStatus?e("ButtonIconFlat",{attrs:{modifier:{class:["streamStartSettings-buttonText","streamStartSettings-buttonText_".concat(t.getActiveTheme),"".concat(t.streamNowStatus?"streamStartSettings-buttonText_".concat(t.getActiveTheme,"-isActive"):"")]}},on:{toggle:t.setStreamNowStatus}},[t._v(t._s(t.$t("startnNow")))]):t._e(),!t.getPlanDate||t.streamNowStatus?e("div",{staticClass:"streamStartSettings-setting_beginDate-setDate"},[e("ButtonIconFlat",{attrs:{disabled:t.streamNowStatus,modifier:{class:["streamStartSettings-buttonText","streamStartSettings-buttonText_".concat(t.getActiveTheme)]}},on:{toggle:t.showPlanCalendar}},[t._v(t._s(t.$t("schedule")))])],1):t._e(),t.getPlanDate&&!t.streamNowStatus?e("div",{staticClass:"streamStartSettings-setting_startDate"},[e("div",{staticClass:"streamStartSettings-setting_startDate-date",style:{color:t.getBlueColor.color}},[t._v(t._s(t.getPlanDate))]),e("div",{staticClass:"streamStartSettings-setting_beginDate-setDate"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["streamStartSettings-buttonIcon","streamStartSettings-buttonIcon_".concat(t.getActiveTheme)]}},on:{toggle:t.showPlanCalendar}})],1)]):t._e()],1),t.errorsStatuses.startDateTime?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("dateOfTheBroadcast")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("tagsContracts"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{staticClass:"streamStartSettings-setting-contracts"},[e("div",{class:"streamStartSettings-setting-contracts_tagBox streamStartSettings-setting-contracts_tagBox_".concat(t.getActiveTheme," ").concat(t.errorsStatuses.tag?"streamStartSettings-setting-contracts_tagBox_error":"")},[e("DxTagBox",{attrs:{items:t.getNamesContracts,"search-enabled":!0,hoverStateEnabled:!1,dropDownOptions:{container:".streamStartSettings-wrap"},"tag-template":"tag","item-template":"user",placeholder:t.$t("selectContract"),showClearButton:!1,value:t.getTagsContracts},on:{valueChanged:t.changeTagsList},scopedSlots:t._u([{key:"tag",fn:function(i){var o=i.data;return[e("div",{staticClass:"streamStartSettings-setting-contracts_tagBox-tagName"},[e("div",{class:"streamStartSettings-setting-contracts_tagBox-tagName_name_".concat(t.getActiveTheme)},[t._v(t._s(o))]),e("div",{staticClass:"streamStartSettings-setting-contracts_tagBox-tagName_remove",on:{click:function(e){return t.deleteContractTag(o)}}},[e("svgIcon",{attrs:{name:"Close",size:15}})],1)])]}},{key:"user",fn:function(i){var o=i.data;return[e("div",{class:"streamStartSettings-setting-contracts_tagBox-contract_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}])})],1),e("ButtonIconFlat",{attrs:{icon:{name:"Add",color:t.getBlueColor.color},modifier:{class:["streamStartSettings-buttonIcon","streamStartSettings-buttonIcon_".concat(t.getActiveTheme)]}},on:{toggle:t.openCatalogInstrumentModal}})],1),t.errorsStatuses.tag?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("fieldIsRequired")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-rowSetting"},[e("div",{class:"streamStartSettings-labelSetting streamStartSettings-labelSetting_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("streamLogo"))+":")]),e("div",{staticClass:"streamStartSettings-setting"},[e("div",{staticClass:"streamStartSettings-settingImageRow"},[e("div",{staticClass:"streamStartSettings-settingImage"},[e("ImageLoad",{attrs:{modeUpload:"stream-logo",fileName:"stream-logo_".concat((new Date).getTime()),editable:!!t.linkToLogo,cropFactor:{width:640,height:360}}})],1),e("div",{staticClass:"streamStartSettings-settingPreview"},[t.linkToLogo?e("img",{attrs:{width:"100%",src:t.linkToLogo}}):t._e()])]),t.errorsStatuses.hostedLogo&&!t.logoUrl?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("fieldIsRequired")))],1):t._e()])]),e("div",{staticClass:"streamStartSettings-validationInfo"},[e("div",{staticClass:"streamStartSettings-validationInfo-icon",class:"streamStartSettings-validationInfo-icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"validation-info",size:55}})],1),e("div",{staticClass:"streamStartSettings-validationInfo-text",class:"streamStartSettings-validationInfo-text_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("warnFillFields")))])])]),e("div",{ref:"calendarPopup",class:"streamStartSettings-setDatePopup streamStartSettings-setDatePopup_".concat(t.getActiveTheme)},[t.planDateCalendar?e("DxPopup",{attrs:{visible:!0,closeOnOutsideClick:t.closePopupCalendarOutSide,shading:!1,showTitle:!1,position:{my:"top right",at:"top right",of:".streamStartSettings-setting_beginDate-setDate"},container:".streamStartSettings-setDatePopup",width:"auto",height:"auto",contentTemplate:"contentPopup"},scopedSlots:t._u([{key:"contentPopup",fn:function(){return[e("StreamSettingsPlanCalendar",{on:{setPlanDate:t.setStartDate}})]},proxy:!0}],null,!1,1026591341)}):t._e()],1),t.serverError?e("div",{staticClass:"streamStartSettings-errorStatus"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v("Ошибка сервера. Попробуйте повторить запрос позже")],1):t._e(),t.successStatus?e("div",{staticClass:"streamStartSettings-successStatus"},[e("svgIcon",{attrs:{name:"checkcircleblack",size:12}}),t._v("Стрим успешно создан и добавлен в календарь!")],1):t._e(),e("div",{staticClass:"streamStartSettings-controlsWrap"},[t.publishPageUrl?t._e():e("div",{staticClass:"streamStartSettings-control"},[e("ButtonIconFlat",{attrs:{icon:{name:"Stream"},process:t.creatStreamLoadStatus,disabled:t.creatStreamLoadStatus,modifier:{class:["streamStartSettings-buttonIconWithText","streamStartSettings-buttonIconWithText_".concat(t.getActiveTheme)],style:{width:"13.7rem",height:"3.2rem"}}},on:{toggle:t.createStream}},[t._v(t._s(t.$t("createStream")))])],1),t.publishPageUrl?e("div",{staticClass:"streamStartSettings-control"},[e("ButtonIconFlat",{attrs:{icon:{name:"Stream"},modifier:{class:["streamStartSettings-buttonIconWithText","streamStartSettings-buttonIconWithText_startPublish"]}},on:{toggle:t.openPublishPage}},[t._v(t._s(t.$t("publicationPageGo")))])],1):t._e()]),t.statusChooseContractModal?e("ChooseContracts",{attrs:{isOpen:t.statusChooseContractModal,contractList:t.tagList},on:{addContract:t.addContractToTagList,deleteContact:t.deleteContractTag,addAllContractsByCatalog:t.addAllContractsByCatalog,deleteAllContractsByCatalog:t.deleteAllContractsByCatalog,closePopup:t.closePopupChooseContracts}}):t._e()],1)},cG=[],lG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"streamSettingsPlanCalendar",class:"streamSettingsPlanCalendar_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamSettingsPlanCalendar-content",class:"streamSettingsPlanCalendar-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"streamSettingsPlanCalendar-content_label"},[t._v(t._s(t.$t("dateOfBeginning")))]),e("div",{class:"streamSettingsPlanCalendar-content_calendar streamSettingsPlanCalendar-content_calendar_".concat(t.getActiveTheme)},[e("DxCalendar",{attrs:{width:"282px",height:"268px","disabled-dates":t.setDisabledDates},model:{value:t.timeStart.date,callback:function(e){t.$set(t.timeStart,"date",e)},expression:"timeStart.date"}})],1),e("div",{staticClass:"streamSettingsPlanCalendar-content_label"},[t._v(t._s(t.$t("timeOfBeginning")))]),e("div",{staticClass:"streamSettingsPlanCalendar-content_time"},[e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control"},[e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control--left",on:{click:t.decrementHours}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1),e("div",{class:"streamSettingsPlanCalendar-content_time-control--input streamSettingsPlanCalendar-content_time-control--input_".concat(t.getActiveTheme)},[t.showHoursInput?e("input",{attrs:{type:"text"},domProps:{value:t.getVisibleHours},on:{change:function(e){return t.setHoursStartTime(e.target.value)}}}):t._e()]),e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control--right",on:{click:t.incrementHours}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1),e("div",{staticClass:"streamSettingsPlanCalendar-content_time-devide"},[t._v(":")])]),e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control"},[e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control--left",on:{click:t.decrementMinutes}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1),e("div",{class:"streamSettingsPlanCalendar-content_time-control--input streamSettingsPlanCalendar-content_time-control--input_".concat(t.getActiveTheme)},[t.showMinutesInput?e("input",{attrs:{type:"text"},domProps:{value:t.getVisibleMinutes},on:{change:function(e){return t.setMinutesStartTime(e.target.value)}}}):t._e()]),e("div",{staticClass:"streamSettingsPlanCalendar-content_time-control--right",on:{click:t.incrementMinutes}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1)])]),t.errorDate?e("div",{staticClass:"streamSettingsPlanCalendar-content-errorDate"},[e("svgIcon",{attrs:{name:"Warning",size:12}}),t._v(t._s(t.$t("scheduledDateMust")))],1):t._e()]),e("div",{class:"streamSettingsPlanCalendar-footer streamSettingsPlanCalendar-footer_".concat(t.getActiveTheme)},[e("ButtonIconFlat",{attrs:{icon:{name:"Stream"},modifier:{class:["streamSettingsPlanCalendar-buttonIconWithText","streamSettingsPlanCalendar-buttonIconWithText_".concat(t.getActiveTheme)]}},on:{toggle:t.setDate}},[t._v(t._s(t.$t("schedule")))])],1)])},uG=[],dG={components:{DxCalendar:UH["DxCalendar"],svgIcon:L,ButtonIconFlat:Le},data:function(){return{showHoursInput:!0,showMinutesInput:!0,timeStart:{date:new Date,hours:(new Date).getHours(),minutes:(new Date).getMinutes()},errorDate:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getNowDateUTC:function(){var t;return null!==(t=this.getServerTime)&&void 0!==t&&t.utcNow?new Date(this.getServerTime.utcNow):new Date},getVisibleHours:function(){return this.timeStart.hours<10?"0".concat(this.timeStart.hours):this.timeStart.hours},getVisibleMinutes:function(){return this.timeStart.minutes<10?"0".concat(this.timeStart.minutes):this.timeStart.minutes}}),methods:{setDisabledDates:function(t){return new Date(t.date).getTime()=24||+t<0?(this.showHoursInput=!1,this.$nextTick((function(){e.$set(e.timeStart,"hours",(new Date).getHours()),e.showHoursInput=!0}))):this.timeStart.hours=+t},setMinutesStartTime:function(t){var e=this;isNaN(+t)||+t>=60||+t<0?(this.showMinutesInput=!1,this.$nextTick((function(){e.$set(e.timeStart,"minutes",(new Date).getMinutes()),e.showMinutesInput=!0}))):this.timeStart.minutes=+t},setDate:function(){var t=new Date(new Date(this.timeStart.date).getFullYear(),new Date(this.timeStart.date).getMonth(),new Date(this.timeStart.date).getDate(),this.timeStart.hours,this.timeStart.minutes);t.getTime()<(new Date).getTime()?this.errorDate=!0:this.$emit("setPlanDate",t)}}},hG=dG,pG=(i("e6e1"),Object(C["a"])(hG,lG,uG,!1,null,null,null)),gG=pG.exports,fG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ChooseContracts"},[e("DxPopup",{attrs:{visible:t.isOpen,shading:!1,width:"410",height:"400"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"ChooseContracts-title",class:"ChooseContracts-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"ChooseContracts-title-name"},[t._v("Каталог контрактов")]),e("div",{staticClass:"ChooseContracts-title-close",style:{color:t.getRedColor.color},on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"ChooseContracts-content",class:"ChooseContracts-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"ChooseContracts-content_left",class:"ChooseContracts-content_left_".concat(t.getActiveTheme)},t._l(t.getCatalogs,(function(i,o){return e("div",{key:o,staticClass:"ChooseContracts-catalogsItems",class:t.isActive===o?"ChooseContracts-catalogsItems_isActive_".concat(t.getActiveTheme):"ChooseContracts-catalogsItems_".concat(t.getActiveTheme),attrs:{itemData:i.length.toString()},on:{click:function(e){return t.setCatalog(o)}}},[e("div",{staticClass:"ChooseContracts-catalogsItems_name"},[t._v(t._s("all"===o?t.$t("all"):o))]),e("div",{staticClass:"ChooseContracts-catalogsItems_count",class:t.isActive===o?"ChooseContracts-catalogsItems_count_isActive_".concat(t.getActiveTheme):"ChooseContracts-catalogsItems_count_".concat(t.getActiveTheme)},[t._v(t._s(i.length))]),e("div",{staticClass:"ChooseContracts-catalogsItems_icon"},[e("svgIcon",{attrs:{name:"Arrow-expand-right"}})],1)])})),0),e("div",{staticClass:"ChooseContracts-content_right"},[e("div",{staticClass:"ChooseContracts-tableContracts"},[e("div",{staticClass:"ChooseContracts-tableContracts-head",class:"ChooseContracts-tableContracts-head_".concat(t.getActiveTheme)},[e("div",{staticClass:"ChooseContracts-tableContracts_row",class:"ChooseContracts-tableContracts_row_".concat(t.getActiveTheme)},[e("div",{staticClass:"ChooseContracts-tableContracts_cell"},[e("Checkbox",{attrs:{checked:t.getCheckAllActiveCatalogs,value:"1"},on:{change:function(e){return t.setAllContractsByCatalog(e)}}})],1),e("div",{staticClass:"ChooseContracts-tableContracts_cell"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"ChooseContracts-tableContracts_cell"},[t._v(t._s(t.$t("type")))])])]),e("div",{staticClass:"ChooseContracts-tableContracts-body"},[e("VuePerfectScrollbar",{staticClass:"ChooseContracts-tableContracts-scrollArea"},t._l(t.activeCatalogItems,(function(i,o){return e("div",{key:o,staticClass:"ChooseContracts-tableContracts_row",class:"ChooseContracts-tableContracts_row_".concat(t.getActiveTheme)},[e("div",{staticClass:"ChooseContracts-tableContracts_cell"},[e("Checkbox",{attrs:{checked:i.active,value:"1"},on:{change:function(e){return t.setActive(e,i)}}})],1),e("div",{staticClass:"ChooseContracts-tableContracts_cell",class:"ChooseContracts-tableContracts_cell_".concat(t.getActiveTheme)},[t._v(t._s(i.s))]),e("div",{staticClass:"ChooseContracts-tableContracts_cell",class:"ChooseContracts-tableContracts_cell_".concat(t.getActiveTheme)},[t._v(t._s(i.groupName))])])})),0)],1)])])])]},proxy:!0}])})],1)},mG=[],vG={components:{DxPopup:wt["DxPopup"],Checkbox:Ya,VuePerfectScrollbar:Xt.a},props:{isOpen:{type:Boolean},contractList:{type:Array}},mixins:[qe],data:function(){return{activeIndex:null,isActive:"all",activeCatalogItems:[]}},watch:{getCountActiveContracts:function(){this.setCatalog(this.isActive)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllQuotes:"quotesCatalogs/getAllQuotes",getCatalogs:"quotesCatalogs/getCatalogs",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getActiveCatalog:function(){return this.$store.getters["quotesCatalogs/getCatalogsByType"](this.isActive)},getCountActiveContracts:function(){return this.contractList.length},getCheckAllActiveCatalogs:function(){var t=this;if(this.getCountActiveContracts)return this.getActiveCatalog.every((function(e){return t.activeCatalogItems.some((function(t){return e.s===t.s&&t.active}))}))},getActiveQuote:function(){return this.$store.getters["quotesCatalogs/getCatalogsByType"]("active")},rowActive:function(t){return t===this.activeIndex}}),methods:{close:function(){this.$store.dispatch("modal/switchChartTradingModalCat",null)},setCatalog:function(t){var e=this;this.isActive=t,this.activeCatalogItems=[],this.getActiveCatalog&&this.getActiveCatalog.forEach((function(t){var i;i=e.contractList.filter((function(e){return e===t.s})),e.activeCatalogItems.push({s:t.s,groupName:t.groupName,active:!!i.length})}))},setAllQuotesToActive:function(t){var e=this;this.getActiveCatalog.forEach((function(i){e.setActive(t,i)}))},setAllContractsByCatalog:function(t){t?this.$emit("addAllContractsByCatalog",this.getActiveCatalog.map((function(t){return t.s}))):this.$emit("deleteAllContractsByCatalog",{contracts:this.getActiveCatalog.map((function(t){return t.s})),catalog:this.isActive})},closePopup:function(){this.$emit("closePopup")},setActive:function(t,e){t?this.$emit("addContract",e.s):this.$emit("deleteContact",e.s),this.setCatalog(this.isActive)}},mounted:function(){this.setCatalog(this.isActive)}},yG=vG,CG=(i("de1a"),Object(C["a"])(yG,fG,mG,!1,null,"4eebde90",null)),bG=CG.exports,SG=function(){var t=this,e=t._self._c;return e("label",{staticClass:"ImageLoad",class:t.classImgLoad},[e("div",{staticClass:"photoIcon"},[e("svgIcon",{attrs:{name:"Photo",color:"#CCCCCC"}})],1),t.editable?t._e():e("div",{staticClass:"descriptionText"},[t._v(t._s(t.$t(t.emtyText)))]),e("input",{staticClass:"inputFile",attrs:{type:"file",accept:"image/*"},on:{change:t.openModalUploadImage}})])},PG=[],TG={name:"ImageLoad",mixins:[xt],props:{editable:{type:Boolean,default:!1},modeUpload:{default:"user-profile-background"},cropFactor:{default:function(){return{width:1074,height:720}}},fileName:{default:""},emtyText:{default:"uploadYourPhoto"}},computed:{classImgLoad:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{editable:this.editable})}},methods:{openModalUploadImage:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:o=t.target.files[0],n=URL.createObjectURL(o),e.$store.dispatch("modal/switchUploadImageModal",{mode:e.modeUpload,nameParam:e.fileName?e.fileName:e.modeUpload,src:n,cropFactor:e.cropFactor,ratio:16/9,format:o.type});case 3:case"end":return i.stop()}}),i)})))()}}},xG=TG,OG=(i("ef0e9"),Object(C["a"])(xG,SG,PG,!1,null,"1c381d3f",null)),wG=OG.exports,_G={components:{ImageLoad:wG,DxSelectBox:wt["DxSelectBox"],DxTagBox:wt["DxTagBox"],DxPopup:wt["DxPopup"],DxTextBox:wt["DxTextBox"],CheckBox:Ya,ChooseContracts:bG,StreamSettingsPlanCalendar:gG},mixins:[qe],data:function(){return{streamingProviders:[{name:"YouTube",icon:"Youtube-Red",color:"#981FAC"},{name:"Twitch",icon:"Twitch",color:"#981FAC"},{name:"Rutube",icon:"RuTube",color:"#000"}],linkToLogo:null,activeStreamProvider:"YouTube",resolution:[{name:"640x480",size:{width:640,height:480}},{name:"1280x720",size:{width:1280,height:720}},{name:"1920x1080",size:{width:1920,height:1080}}],publishPageUrl:"",creatStreamLoadStatus:!1,errorsStatuses:{name:!1,description:!1,startDateTime:!1,tag:!1,hostedLogo:!1},serverError:!1,successStatus:!1,streamNowStatus:!1,requestPayload:{height:480,width:640,name:"",recording:!1,startDateTime:null,description:"",tag:"",visibility:"Public",streamURL:"",userId:"",hostedLogo:null,providerType:"YouTube",contracts:null},planDateCalendar:!1,logoUrl:null,privateStatus:!1,tagList:[],statusChooseContractModal:!1,formats:["image/jpg","image/jpeg","image/png"],sizeKB:2500}},watch:{getUploadImageModal:{handler:function(t){t&&t.link&&(this.linkToLogo=t.link,this.requestPayload.hostedLogo=this.linkToLogo)},deep:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getUserDetail:"user/getUserDetail",getSession:"auth/getSession",getApiStream:"api/apiStream",getServerTime:"serverTime/getServerTime",getSelfieModal:"modal/getSelfieModal",getActiveTheme:"headerSettings/getActiveTheme",getUploadImageModal:"modal/getUploadImageModal"})),{},{getNamesContracts:function(){if(this.getContracts)return Object(x["a"])(new Set(this.getContracts.reduce((function(t,e){return t.push(e.name),t}),[])))},getTagsContracts:function(){return this.tagList},getUploadImageLink:function(){return this.getUploadImageModal.data},getResolution:function(){var t=this;this.requestPayload.width&&this.requestPayload.height||(this.requestPayload.width=640,this.requestPayload.height=480);var e=this.resolution.findIndex((function(e){return e.size.width===t.requestPayload.width&&e.size.height===t.requestPayload.height}));return e>-1?this.resolution[this.resolution.findIndex((function(e){return e.size.width===t.requestPayload.width&&e.size.height===t.requestPayload.height}))].name:this.resolution[0].name},getPlanDate:function(){if(this.requestPayload.startDateTime)return new Date(this.requestPayload.startDateTime).toLocaleString("ru")}}),methods:{showPlanCalendar:function(){this.planDateCalendar=!this.planDateCalendar},closePopupCalendarOutSide:function(t){this.$refs.calendarPopup.contains(t.target)||(this.planDateCalendar=!1)},onInput:function(t){var e=this,i=new FileReader;i.addEventListener("load",(function(){e.logoUrl=i.result}),!1),i.readAsDataURL(t)},setRequestPayloadParam:function(t,e){this.requestPayload[e]=t},setStreamNowStatus:function(){this.streamNowStatus=!this.streamNowStatus,this.requestPayload.startDateTime=this.streamNowStatus?(new Date).toISOString():""},setStartDate:function(t){this.requestPayload.startDateTime=t?t.toISOString():t,this.showPlanCalendar()},setPrivateStatus:function(){this.privateStatus=!this.privateStatus,this.privateStatus?this.requestPayload.visibility="Private":this.requestPayload.visibility="Public"},setStreamProvider:function(t){this.activeStreamProvider=t.value,this.requestPayload.providerType=this.activeStreamProvider},setResolution:function(t){var e=this.resolution.find((function(e){return e.name===t.value})).size;this.requestPayload.width=e.width,this.requestPayload.height=e.height},addContractToTagList:function(t){this.tagList.push(t)},changeTagsList:function(t){this.tagList=t.value,this.setTags(this.tagList)},addAllContractsByCatalog:function(t){this.tagList=Object(x["a"])(new Set(this.tagList.concat(t)))},deleteAllContractsByCatalog:function(t){var e=this.$store.getters["quotesCatalogs/getCatalogsByType"](t.catalog);this.tagList=this.tagList.filter((function(i){return!t.contracts.some((function(t){return t.s===i}))&&!e.some((function(t){return t.s===i}))}))},openCatalogInstrumentModal:function(){this.statusChooseContractModal=!0},closePopupChooseContracts:function(){this.statusChooseContractModal=!1},deleteContractTag:function(t){this.tagList.splice(this.tagList.findIndex((function(e){return e===t})),1),this.setTags(this.tagList)},setTags:function(t){this.requestPayload.tag=t.join("#"),this.requestPayload.contracts=t},closeStartSettings:function(){this.$emit("closeStartSettings")},controlRequestObject:function(t){var e=[];for(var i in t)t[i]||"boolean"===typeof t[i]||e.push(i);return e},openPublishPage:function(){window.open(this.publishPageUrl,"_blank").focus(),this.$emit("createStream")},createNewStream:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify(t.requestPayload),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:o=e.sent,t.$http.post(t.getApiStream+"Stream/create",i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(){t.serverError=!1,t.successStatus=!0,t.creatStreamLoadStatus=!1,t.$emit("createStream")})).catch((function(){t.serverError=!0,t.creatStreamLoadStatus=!1}));case 5:case"end":return e.stop()}}),e)})))()},createStream:function(){var t=this;this.requestPayload.userId=this.getUserDetail.id;var e=this.controlRequestObject(this.requestPayload);if(e.length){var i=function(i){e.some((function(t){return t===i}))?t.errorsStatuses[i]=!0:t.errorsStatuses[i]=!1};for(var o in this.errorsStatuses)i(o)}else{for(var n in this.errorsStatuses)this.errorsStatuses[n]=!1;this.creatStreamLoadStatus=!0,this.createNewStream()}}}},AG=_G,DG=(i("c957"),Object(C["a"])(AG,aG,cG,!1,null,"9b0dd36a",null)),kG=DG.exports,IG={components:{StreamsOnline:IH,StreamsEvents:rG,StreamStartSettings:kG,ButtonFlatIcon:Le},mixins:[qe],data:function(){return{activeComponent:"StreamsOnline",modeEvents:null}},watch:{},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getSession:"auth/getSession",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen"})),methods:{setActiveComponent:function(t){this.activeComponent=t.name,t.mode&&(this.modeEvents=t.mode)},createStream:function(){this.setActiveComponent({name:"StreamsEvents",mode:"UserId"})}}},BG=IG,MG=(i("d64f"),Object(C["a"])(BG,hH,pH,!1,null,null,null)),$G=MG.exports,LG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Quotas",class:t.darkClass},[e("div",{staticClass:"topBar"},[e("div",{ref:"container",staticClass:"adaptiveBlockContainer"},[t.refContainer?e("AdaptiveLineButtons",{attrs:{idDropDown:"quotas",dopClassFirst:"firstQuotes",tabsSet:t.buttonsArray,refTabWrapper:t.refContainer,maxHeightDropDownList:200,widthDropDownList:100},on:{setActiveTab:t.setActiveTab},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.data;return[e("svgIcon",t._b({directives:[{name:"show",rawName:"v-show",value:"Favorite"===o.value,expression:"data.value === 'Favorite'"}]},"svgIcon",t.iconFavorite,!1)),e("div",{directives:[{name:"show",rawName:"v-show",value:"Favorite"!==o.value,expression:"data.value !== 'Favorite'"}],staticClass:"contactValue"},[t._v(t._s(o.value))])]}}],null,!1,33848784)}):t._e()],1),e("div",{staticClass:"searchBlock"},[e("input",{key:"input",attrs:{type:"text",placeholder:t.$t("search")+"..."},domProps:{value:t.search},on:{input:t.changeSearch}}),e("svgIcon",t._b({},"svgIcon",t.iconSearch,!1))],1)]),e("div",{staticClass:"contractList",style:{"--columnSize":t.columnSize}},[e("div",{staticClass:"headerTable"},t._l(t.titles,(function(i,o){return e("div",{key:o,staticClass:"cell"},[t._v(t._s(i))])})),0),e("DxSortable",{attrs:{data:t.contractsListFiltered},on:{"drag-start":function(e){return t.onDragStart(e)},reorder:function(e){return t.onReorder(e)},add:function(e){return t.onAdd(e)}}},[t._l(t.contractsListFiltered,(function(i){return e("OneContract",{key:i.s,attrs:{contractData:i,quote:t.quotes[i.s],prevQuote:t.prevQuotes[i.s],columnSize:t.columnSize,selectedInstrument:t.selectedInstrument},on:{setFavorite:t.setFavorite}})})),t.isVisibleContract?t._e():e("div",{staticClass:"noData"},[t._v(t._s(t.$t("not_found")))])],2)],1)])},FG=[],jG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneContract",class:t.darkClass,style:t.rootStyle},[e("div",{staticClass:"contract"},[e("svgIcon",t._b({},"svgIcon",t.iconDrag,!1)),e("span",{ref:"img",on:{click:t.saveOrDeleteFavorite}},[e("svgIcon",t._b({},"svgIcon",t.iconFavorite,!1))],1),t._v(t._s(t.contractData.s))],1),e("div",{staticClass:"bid",class:t.bidClass},[t._v(t._s(t.quote["bid"]||t.contractData["b"]))]),e("div",{staticClass:"ask",class:t.askClass},[t._v(t._s(t.quote["ask"]||t.contractData["a"]))]),e("div",{staticClass:"chg",class:t.percentClass},[t._v(t._s(t.getPercent)+"%")]),t.isTrading?e("div",{staticClass:"buttonClick",on:{click:t.switchNewOrderModal}},[e("svgIcon",t._b({},"svgIcon",t.iconOpenOrder,!1))],1):t._e(),t.isTrading?e("div",{staticClass:"buttonClick",on:{click:t.toggleNewChart}},[e("svgIcon",t._b({},"svgIcon",t.iconOpenChart,!1))],1):t._e()])},RG=[];function WG(t){return NG.apply(this,arguments)}function NG(){return NG=Object(a["a"])(Object(r["a"])().mark((function t(e){var i,o,n,s,c,l,u,d,h,p,g,f,m,v,y,C,b,S,P,T,x;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=e.elementFly,o=e.targetFly,n=e.calcSize,s=void 0===n?25:n,c=e.ratioTime,l=void 0===c?1.3:c,u=e.offsetLeft,d=void 0===u?0:u,h=e.topOffset,p=void 0===h?15:h,g=e.cb,f=void 0===g?function(){}:g,m=i.cloneNode(!0),v=i.getBoundingClientRect(),y=o.getBoundingClientRect(),C={position:"fixed",width:v.width+"px",height:v.height+"px",borderRadius:"50%",left:v.left+"px",top:v.top+"px",margin:0,zIndex:12},Object.assign(m.style,C),document.body.appendChild(m),b=v.top-y.bottom+(y.height+v.height)/2-p,S=y.left-v.right+v.width+d,P=Math.sqrt(Math.pow(b,2)+Math.pow(S,2)),T=Math.floor(P*l),x=null,setTimeout((function(){window.requestAnimationFrame(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(i){var o,n,a,c;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(x||(x=i),o=i-x,n=o/T,a=b*n*-1,c=S*n,!(b*nthis.quote["bid"]},greenClassBid:function(){return!this.prevQuote["bid"]||!this.quote["bid"]||this.prevQuote["bid"]<=this.quote["bid"]},redClassAsk:function(){return!!this.prevQuote["ask"]&&this.prevQuote["ask"]>this.quote["ask"]},greenClassAsk:function(){return!this.prevQuote["ask"]||!this.quote["ask"]||this.prevQuote["ask"]<=this.quote["ask"]},bidClass:function(){return{red:this.redClassBid,green:this.greenClassBid}},askClass:function(){return{red:this.redClassAsk,green:this.greenClassAsk}},getDelta:function(){var t=this.quote.bid||this.contractData.b,e=this.quote.open||this.contractData.o;if(t&&e)return t-e},getPercent:function(){if(!this.getDelta)return 0;var t=this.quote.bid||this.contractData.b;return EG("ceil",100/(t/this.getDelta),-2)},percentClass:function(){return{red:this.getPercent<0,green:this.getPercent>=0}},rootStyle:function(){return{"--columnSize":this.columnSize,"--fz":this.isTrading?"11px":"12px"}},isTrading:function(){return"Trading"===this.$route.meta.componentName}}),mounted:function(){},destroyed:function(){},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"quotesFavoriteSettings/redactSettings"})),{},{saveOrDeleteFavorite:function(){var t=this;this.isFavorite?this.redactSettings({data:this.contractData.s,mutation:"deleteQuoteFavorite"}):(this.redactSettings({data:this.contractData.s,mutation:"addNewQuoteFavorite"}),this.$nextTick((function(){WG({elementFly:t.$refs.img,targetFly:document.querySelector(".firstQuotes"),offsetLeft:10,calcSize:0})}))),this.$emit("setFavorite",{contractData:this.contractData,isFavorite:this.isFavorite})},switchNewOrderModal:function(){this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.contractData.s,type:"MomentOrder"})},toggleNewChart:function(){var t={symbol:this.contractData.s,listText:this.contractData.s,groupName:this.contractData.groupName,timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!1,id:Math.random().toString(36).substring(7)};this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"addQuoteButtonOnScreen",data:t});var e=this.getTradingTopBarSettings.screensQuotes[0].content.find((function(e){return e.setButtons[0].id===t.id}));this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewSelectButtonInScreen",data:e.setId,role:this.getStatusUser.status})}})},VG=UG,HG=(i("225a"),Object(C["a"])(VG,jG,RG,!1,null,"2e1b45ee",null)),GG=HG.exports,qG={name:"Quotas",mixins:[xt],props:{},components:{AdaptiveLineButtons:Jg,OneContract:GG,DxSortable:Gn.a},data:function(){return{contracts:{},selectedInstrument:"",refContainer:null,prevQuotes:{},quotes:{},search:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCatalogs:"quotesCatalogs/getCatalogs",getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary",findPortfolio:"expertsPortfolio/findPortfolio",getQuoteFavorites:"quotesFavoriteSettings/getQuoteFavorites",getSortedSignals:"quotesFavoriteSettings/getSortedSignals"})),{},{iconSearch:function(){return{name:"Search",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},catalogs:function(){var t=Object(c["a"])({},this.getCatalogs);return delete t.all,Object.entries(t)},catalogNames:function(){return this.catalogs.map((function(t){return t[0]}))},catalogContracts:function(){return this.catalogs.map((function(t){return t[1]})).flat()},buttonsArray:function(){var t=this,e=this.catalogNames.map((function(e){return{value:e,isActive:e===t.selectedInstrument}})),i={value:"Favorite",isActive:"Favorite"===this.selectedInstrument};return[i].concat(Object(x["a"])(e))},contractsList:function(){return this.contracts[this.selectedInstrument]},contractsListFiltered:function(){var t=this;return this.search?this.contractsList.filter((function(e){return e.s.toLowerCase().includes(t.search.toLowerCase())})):this.contractsList},isVisibleContract:function(){var t;return(null===(t=this.contractsListFiltered)||void 0===t?void 0:t.length)>0},symbols:function(){var t;if((null===(t=this.contractsList)||void 0===t?void 0:t.length)>0){var e,i=[],o="Trading"===this.$route.meta.componentName,n="Investing"===this.$route.meta.componentName;o&&(i=this.getUserQuotesLibrary),n&&"Active"===(null===(e=this.findPortfolio)||void 0===e?void 0:e.status)&&(i=this.findPortfolio.sources.map((function(t){return t.contract})),i=Object(x["a"])(new Set(i)));var s=this.contractsList.map((function(t){return t.s}));return Object(x["a"])(new Set([].concat(Object(x["a"])(s),Object(x["a"])(i))))}},iconFavorite:function(){return{name:"Favorite-off",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},isTrading:function(){return"Trading"===this.$route.meta.componentName},titles:function(){var t=[this.$t("instruments"),"Bid","Ask","Chg,%",null,null];return this.isTrading?t:t.slice(0,4)},columnSize:function(){return this.isTrading?"1fr 65px 65px 50px 32px 32px":"1fr 80px 80px 60px"}}),watch:{symbols:function(t){t&&localStorage.setItem("quotesContracts",JSON.stringify(t)),this.search="",this.subscribeOfQuotes()},selectedInstrument:function(t){var e=this;if(!this.contracts[t]){var i=[],o=structuredClone(this.getCatalogs[t]);this.getQuoteFavorites.length>0&&"Favorite"===t&&(i=this.catalogContracts.filter((function(t){return e.getQuoteFavorites.includes(t.s)})));var n="Favorite"===t?i:o,s=this.getSortedSignals[t];if((null===s||void 0===s?void 0:s.length)>0){var r=[];s.forEach((function(t){var e=n.findIndex((function(e){return e.s===t}));-1!==e&&(r.push(n[e]),n.splice(e,1))})),n=[].concat(r,Object(x["a"])(n))}this.$set(this.contracts,t,n)}}},mounted:function(){this.refContainer=this.$refs.container,this.selectedInstrument=this.catalogNames[0],this.$socketStream.$on("apiWS2",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS2",this.setMessageHandler),localStorage.removeItem("quotesContracts")},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"quotesFavoriteSettings/redactSettings"})),{},{setActiveTab:function(t){this.selectedInstrument=t.value},subscribeOfQuotes:function(){if(this.symbols){this.quotes={};var t={command:"Quotes",method:"Subscribe",data:{Quotes:this.symbols}};this.$socketStream.sendCommand({ws:"apiWS2",command:t})}},setMessageHandler:function(t){var e=this;"Quotes"===t.command&&t.data.forEach((function(t){e.quotes[t.s]?(e.prevQuotes[t.s]?(e.prevQuotes[t.s]["bid"]=e.quotes[t.s]["bid"],e.prevQuotes[t.s]["ask"]=e.quotes[t.s]["ask"]):e.$set(e.prevQuotes,t.s,{bid:e.quotes[t.s]["bid"],ask:e.quotes[t.s]["ask"]}),e.quotes[t.s]["bid"]=t.b,e.quotes[t.s]["ask"]=t.a,e.quotes[t.s]["open"]=t.o):e.$set(e.quotes,t.s,{bid:t.b,ask:t.a,open:t.o})}))},changeSearch:function(t){this.search=t.target.value},onDragStart:function(t){t.itemData=t.fromData[t.fromIndex]},onReorder:function(t){var e=this.contracts[this.selectedInstrument][t.fromIndex];this.contracts[this.selectedInstrument].splice(t.fromIndex,1),this.contracts[this.selectedInstrument].splice(t.toIndex,0,e);var i=this.contracts[this.selectedInstrument].map((function(t){return t.s}));this.redactSettings({data:[this.selectedInstrument,i],mutation:"addIndex"})},setFavorite:function(t){var e=t.contractData,i=t.isFavorite;this.contracts["Favorite"]&&(i?this.contracts["Favorite"].push(e):this.contracts["Favorite"]=this.contracts["Favorite"].filter((function(t){return t.s!==e.s})))}})},zG=qG,YG=(i("1a5a"),Object(C["a"])(zG,LG,FG,!1,null,"c404825c",null)),XG=YG.exports,QG=function(){var t=this,e=t._self._c;return e("div",{ref:"section",staticClass:"TrendTradingWidget",class:t.darkClass},[t.isVisibleStatisticBlock?e("StatisticsBlock",{attrs:{ordersBuy:t.ordersBuy,ordersSell:t.ordersSell}}):t._e(),t.isInvestPortfolios?e("InvestPortfolioBar",{attrs:{tabsComponent:t.tabsComponent,idContract:t.idContract,mountedFetch:t.mountedFetch,loadStatus:t.isLoading,setView:t.setView,setActiveTab:t.setActiveTab}}):e("TradingFavoritesAndProvidersBar",{attrs:{tabsComponentTrading:t.tabsComponentTrading,setViewTrading:t.setViewTrading}}),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoading||t.fetchLoading?e("div",{key:"loading",staticClass:"loadingData"},t._l(t.sceletonCount,(function(i){return e("Sceleton",{key:i,staticClass:"sceleton",attrs:{height:t.heightExpert}})})),1):e("div",{staticClass:"containerForExperts"},[t.providersList.flat().length?e("VuePerfectScrollbar",{staticClass:"providersBlock"},t._l(t.providersList,(function(i,o){return e("div",{key:i.sequenceId+String(o),staticClass:"providerItem"},[e("keep-alive",[e(t.componentView,t._b({tag:"component",attrs:{expert:i},on:{openModalSelected:t.openModalSelected}},"component",t.propsComponent[t.componentView],!1))],1)],1)})),0):e("div",{staticClass:"noData"},[e("svgIcon",t._b({},"svgIcon",t.iconData,!1)),e("div",{staticClass:"text"}),t._v("No data")],1)],1)]),t.popupVisible?e("DxPopup",{attrs:{visible:t.popupVisible,"drag-enabled":!1,closeOnOutsideClick:!0,"show-title":!1,position:t.positionPopupSelectionPortfolio,shading:!1,width:348,height:"auto",container:"body",wrapperAttr:t.wrapperAttrPopup},on:{hidden:t.hidePopup}},[e("PortfolioSelection",{attrs:{location:t.getLocation,portfolio:t.getPortfolioOnlyStatusCreated,refFunctionAddToDraft:t.refFunctionAddToDraft,imgFly:t.imgFly,login:t.login,nameProvider:t.nameProvider,symbol:t.contract},on:{hiddenModal:t.hidePopup}})],1):t._e()],1)},JG=[],KG=function(){var t=this,e=t._self._c;return e("div",{staticClass:"oneProvider",class:t.rootClass},[e("div",{staticClass:"dataExpertBlock"},[e("div",{staticClass:"favoriteButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t(t.isFavorite?"rpff":"aptf"),150)},mouseleave:t.hideTooltip,click:t.saveOrDeleteFavorite}},[e("svgIcon",t._b({},"svgIcon",t.iconFavorite,!1))],1),e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{ref:"img",staticClass:"image",on:{click:t.goToProfile}},[e("Avatar",{attrs:{src:t.photoExpert,size:"4.5",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"contentExpert"},[e("div",{staticClass:"nameExpert"},[t._v(t._s(t.nameExpert))]),e("div",{staticClass:"signalAndPrice",class:{isProvider:t.isProvider}},[e("div",{staticClass:"signal"},[t._v(t._s(t.symbol))])])])]),e("div",{staticClass:"profitRoiWrap",style:{background:t.getLemonColor.gradient}},[e("div",{staticClass:"profitRoiWrap-title",style:{color:t.getGrayColor.color}},[t._v("ROI")]),e("div",{staticClass:"profitRoiWrap-data",style:{color:t.getLemonColor.color}},[t._v(t._s("".concat(Math.trunc(t.getProfitOrdersPercent),"%")))])]),e("div",{staticClass:"activeButtonBlock"},[e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t("ctpt"))},mouseleave:t.hideTooltip}},[t.isProvider?t._e():e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconCopy,disabled:t.disabledButtons},on:{click:t.startCopy}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:250,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))])],1)},ZG=[];function tq(t){return Object(c["a"])({id:0,sourceId:0,signalVolume:1e3,signalVolumeType:"Money",maxOpenPositions:1,price:0,priceType:"Percent",ddMin:0,ddMax:20,bagId:0,investMoney:0,period:30},t)}var eq={name:"OneProvider",inject:["openModalCopyProvider"],mixins:[xt,qe,lW,rT,$n,Ot],props:{expert:{type:Object,default:function(){return{}}},symbol:{type:String},allSources:{type:Array},priceData:{type:Array},isTrading:{type:Boolean}},components:{DxLoadIndicator:OT["DxLoadIndicator"],Avatar:E},data:function(){return{isLoadingGetPortfolios:!1,profitOrders:0,isLoadingStart:!1,text:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBrokers:"brokers/getBrokers",getDefaultAccount:"subscribeOrders/getDefaultAccount",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getProfileAccount:"subscribeOrders/getProfileAccount",activeSubscriptionByAccount:"subscription/activeSubscriptionByAccount",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated",isProvider:"subscribeOrders/isProvider",getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{findFavorites:function(){var t=this;return this.getAllFavorites.find((function(e){return e.contract===t.expert.contract&&e.accountId===t.expert.accountId}))},isFavorite:function(){return!!this.findFavorites},dark:function(){return this.darkClass.dark},iconFavorite:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00b9fc":"#3c73f1";return{name:"Favorite-on",color:this.isFavorite?e:t}},iconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},existCopy:function(){var t=this.activeSubscriptionByAccount(this.expert.accountId);return t.filter((function(t){return t.autoTrade})).length>0},nameExpert:function(){var t=this.expert.userInfo,e=t.firstName,i=t.lastName;return"".concat(e||""," ").concat(i||"")},photoExpert:function(){return"User-profile.png"===this.expert.userInfo.avatarURL?i("81bc"):this.expert.userInfo.avatarURL},getBrokerImage:function(){var t=this,e=this.getBrokers.find((function(e){return e.id===t.expert.brokerId}));return e&&e.logo?"data:image/jpeg;base64,".concat(e.logo):i("700b")},greenColor:function(){return{green:"Demo"!==this.expert.accountGroup}},getColorClass:function(){return"Sell"===this.expert.operationTrend?["red"]:["green"]},rootClass:function(){return["provider_".concat(this.expert.sequenceId),Object(c["a"])({},this.darkClass)]},myAccountsID:function(){return this.getProfileAccount.map((function(t){return t.id}))},disabledButtons:function(){return this.myAccountsID.includes(this.expert.accountId)},getProfitOrdersPercent:function(){return this.expert.totalOrders?100*this.expert.positiveOrders/this.expert.totalOrders:0},iconAdd:function(){return{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},pips:function(){return{value:this.expert.pip,valueFormatted:Lm(this.expert.pip,2,!0)}},price:function(){var t=this.expert.accountId,e=this.expert.contract,i=(this.priceData||[]).find((function(i){return(null===i||void 0===i?void 0:i.accountId)===t&&(null===i||void 0===i?void 0:i.contract)===e}));return i?{monthPrice:i.monthPrice,profitPercent:i.profitPercent}:{monthPrice:0,profitPercent:0}}}),watch:{},created:function(){},destroyed:function(){},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",setPopupData:"modalSubscribe/setPopupData",getListsPortfolio:"expertsPortfolio/getListsPortfolio",saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",setVisible:"modalPay/setVisible",redactSettings:"favoriteSettings/redactSettings"})),{},{login:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},mouseenterHandler:function(t){this.mouseEnterFunction(t,{imageForSource:this.photoExpert,nameSource:this.nameExpert,side:this.expert.operationTrend,getColorClass:this.getColorClass,accountId:this.expert.accountId})},mouseleaveHandler:function(){this.mouseLeaveFunction()},goToProfile:function(){this.goingToProfile(this.expert.accountId)},startCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=13;break}return t.isLoadingStart=!0,e.next=10,t.pendingStatus(i.id);case 10:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 13:t.openModalCopyProvider({providerCopy:!0,symbol:t.expert.contract,infoAccount:{avatar:t.photoExpert,traderName:t.nameExpert,login:t.expert.accountId,sequenceId:t.expert.sequenceId}});case 14:case"end":return e.stop()}}),e)})))()},findAccount:function(){var t=this;if(this.allSources){var e=this.allSources.find((function(e){return e.accountId===t.expert.accountId}));return{contracts:e.data,accountId:e.accountId,sourceIds:e.data.map((function(t){return t.id})),contractsName:e.data.map((function(t){return t.contract}))}}},addInCartProviderHandler:function(t){if(!this.isTrading){var e=this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}));e.length>0?this.addInCartProvider(t):this.addToDraft()}},addInCartProvider:function(t){this.isAuth?this.$emit("openModalSelected",{target:t.closest(".oneProvider"),refFunctionAddToDraft:this.addToDraft,login:this.expert.accountId,nameProvider:this.nameExpert,contract:this.symbol}):this.login()},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return t.isLoadingGetPortfolios=!0,e.next=6,t.addInvest();case 6:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingGetPortfolios=!1,o=new Audio,o.src=i("2e5e"),o.play();case 11:case"end":return e.stop()}}),e)})))()},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.symbol,o=t.findAccount(),n=o.contracts,s=n.find((function(e){return e.contract===t.symbol})),a=[s.id],e.next=6,t.saveInvestBag({name:i,investLeverage:1,investMoney:0,investBagType:"Invest",avatarURL:t.photoExpert});case 6:if(c=e.sent,!c.requestStatus.isOK){e.next=12;break}return l=[],a.forEach((function(t){l.push(tq({sourceId:t,bagId:c.id}))})),e.next=12,t.saveInvestBagContent(l);case 12:case"end":return e.stop()}}),e)})))()},showTooltip:function(t,e){this.text=e,this.viewTooltip(t)},redactHandlerAdd:function(){this.redactSettings({data:{type:"OneProvider",contract:[this.expert.contract],accountGroupCode:this.expert.accountGroup,accountId:this.expert.accountId,sequenceId:this.expert.sequenceId,nameExpert:this.nameExpert,avatarURL:this.expert.userInfo.avatarURL,brokerId:this.expert.brokerId,procPosOrders:this.getProfitOrdersPercent,monthPrice:this.price.monthPrice,profitPercent:this.price.profitPercent,myAccount:this.getDefaultAccount.id},mutation:"addNewFavorite"})},saveOrDeleteFavorite:function(){if(this.isAuth)if(this.isFavorite)this.redactSettings({data:{contract:this.expert.contract,accountId:this.expert.accountId,myAccount:this.getDefaultAccount.id},mutation:"deleteFavorite"});else{if("UserProfile"===this.$route.meta.componentName)return void this.redactHandlerAdd();WG({elementFly:this.$refs.img,targetFly:document.querySelector(".favoriteTab"),offsetLeft:10,calcSize:20,cb:this.redactHandlerAdd})}else this.login()}})},iq=eq,oq=(i("b635"),Object(C["a"])(iq,KG,ZG,!1,null,"1fdfc7ca",null)),nq=oq.exports,sq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneProviderInvest",class:t.darkClass},[e("div",{staticClass:"dataExpertBlock"},[e("div",{staticClass:"favoriteButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t(t.isFavorite?"rpff":"aptf"),150)},mouseleave:t.hideTooltip,click:t.saveOrDeleteFavorite}},[e("svgIcon",t._b({},"svgIcon",t.iconFavorite,!1))],1),e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{ref:"img",staticClass:"image",on:{click:t.goToProfile}},[e("Avatar",{attrs:{src:t.photoExpert,size:"4.5",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"contentExpert"},[e("div",{staticClass:"nameExpert"},[t._v(t._s(t.nameExpert))]),e("div",{staticClass:"signalAndPrice",class:{isProvider:t.isProvider}},[e("div",{staticClass:"signal"},[t._v(t._s(t.expert.contract))])])])]),e("div",{staticClass:"profitRoiWrap",style:{background:t.getLemonColor.gradient}},[e("div",{staticClass:"profitRoiWrap-title",style:{color:t.getGrayColor.color}},[t._v("ROI")]),e("div",{staticClass:"profitRoiWrap-data",style:{color:t.getLemonColor.color}},[t._v(t._s("".concat(Math.trunc(t.expert.procPosOrders),"%")))])]),e("div",{staticClass:"activeButtonBlock"},[t.isProvider?t._e():e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t("copy"),"none")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconDataCopy,disabled:t.disabledButtons},on:{toggle:t.openModal}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1),e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t("atmi"),"none")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{disabled:t.isLoadingGetPortfolios||t.disabledButtons||t.getIsReal,icon:t.isLoadingGetPortfolios?{}:t.iconDraft},on:{toggle:t.addInCartProviderHandler}},[t.isLoadingGetPortfolios?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:t.maxWidth,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))])],1)},rq=[],aq={name:"OneProviderInvest",inject:["openModalCopyProvider"],mixins:[rT,lW,xt,Ot,$n,qe],props:{expert:{type:Object,default:function(){return{}}},allSources:{type:Array},priceData:{type:Array},symbol:{type:String}},components:{DxLoadIndicator:OT["DxLoadIndicator"],Avatar:E},data:function(){return{isLoadingGetPortfolios:!1,isLoadingStart:!1,text:"",maxWidth:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBrokers:"brokers/getBrokers",getProfileAccount:"subscribeOrders/getProfileAccount",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated",activeSubscriptionByAccount:"subscription/activeSubscriptionByAccount",isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount",getFavoritesByContract:"favoriteSettings/getFavoritesByContract",getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{findFavorites:function(){var t=this;return this.getAllFavorites.find((function(e){return e.contract===t.expert.contract&&e.accountId===t.expert.accountId}))},getIsReal:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},isFavorite:function(){return!!this.findFavorites},isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},nameExpert:function(){return this.expert.userName},photoExpert:function(){return"User-profile.png"===this.expert.avatarURL?i("81bc"):this.expert.avatarURL},getBrokerImage:function(){var t=this,e=this.getBrokers.find((function(e){return e.id===t.expert.brokerId}));return e&&e.logo?"data:image/jpeg;base64,".concat(e.logo):i("700b")},greenColor:function(){return{green:"Demo"!==this.expert.accountGroupCode}},existCopy:function(){var t=this.activeSubscriptionByAccount(this.expert.accountId);return t.filter((function(t){return t.autoTrade})).length>0},myAccountsID:function(){return this.getProfileAccount.map((function(t){return t.id}))},disabledButtons:function(){return!!this.isLoadingStart||this.myAccountsID.includes(this.expert.accountId)},iconDataCopy:function(){return this.isLoadingStart?{}:{name:this.existCopy?"Settings":"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconDraft:function(){return{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconFavorite:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00b9fc":"#3c73f1";return{name:"Favorite-on",color:this.isFavorite?e:t}},myPrice:function(){var t,e,i=this,o=this.priceData.find((function(t){var e=t.accountId===i.expert.accountId,o=t.contract===i.expert.contract;return e&&o})),n=null!==(t=null===o||void 0===o?void 0:o.monthPrice)&&void 0!==t?t:0,s=null!==(e=null===o||void 0===o?void 0:o.profitPercent)&&void 0!==e?e:0;return{monthPrice:n,profitPercent:s}},myPriceFormatted:function(){return"$ ".concat(this.myPrice.monthPrice," / ").concat(this.myPrice.profitPercent,"%")}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast",setPopupData:"modalSubscribe/setPopupData",setPopupModalData:"modal/setPopupData",setVisible:"modalPay/setVisible",redactSettings:"favoriteSettings/redactSettings",getAccountCloseOrderStatisticByContract:"expertsPortfolio/getAccountCloseOrderStatisticByContract"})),{},{goToProfile:function(){this.goingToProfile(this.expert.accountId)},mouseenterHandler:function(t){var e=this.findAccount(),i=e.contracts;this.mouseEnterFunction(t,{imageForSource:this.expert.avatarURL,nameSource:this.nameExpert,accountId:this.expert.accountId,sequenceId:this.expert.sequenceid,noActiveButton:!0,contracts:i})},mouseleaveHandler:function(){this.mouseLeaveFunction()},login:function(){this.setPopupModalData({visiblePopup:!0,modalComponentName:"ModalLogin",titlePopup:"sign_in"})},openModal:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=13;break}return t.isLoadingStart=!0,e.next=10,t.pendingStatus(i.id);case 10:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 13:t.openModalCopyProvider({providerCopy:!0,infoAccount:{avatar:t.expert.avatarURL,traderName:t.expert.userName,login:t.expert.accountId,sequenceId:t.expert.sequenceid},symbol:t.expert.contract});case 14:case"end":return e.stop()}}),e)})))()},findAccount:function(){var t=this;if(this.allSources){var e=this.allSources.find((function(e){return e.accountId===t.expert.accountId}));return{contracts:e.data,accountId:e.accountId,sourceIds:e.data.map((function(t){return t.id})),contractsName:e.data.map((function(t){return t.contract}))}}},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.nameExpert,o=t.findAccount(),n=o.contracts,s=n.find((function(e){return e.contract===t.expert.contract})),a=[s.id],e.next=6,t.saveInvestBag({name:i,investLeverage:1,investMoney:0,investBagType:"Invest",avatarURL:t.photoExpert});case 6:if(c=e.sent,!c.requestStatus.isOK){e.next=12;break}return l=[],a.forEach((function(t){l.push(tq({sourceId:t,bagId:c.id}))})),e.next=12,t.saveInvestBagContent(l);case 12:case"end":return e.stop()}}),e)})))()},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return t.isLoadingGetPortfolios=!0,e.next=6,t.addInvest();case 6:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingGetPortfolios=!1,o=new Audio,o.src=i("2e5e"),o.play();case 11:case"end":return e.stop()}}),e)})))()},addInCartProviderHandler:function(t){var e=this,i=this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}));i.length>0?this.addInCartProvider(t):WG({elementFly:this.$refs.img,targetFly:document.querySelector(".TopButtonsBlock"),offsetLeft:10,calcSize:0,cb:function(){return e.addToDraft(!0)}})},addInCartProvider:function(t){this.isAuth?this.$emit("openModalSelected",{target:t.closest(".OneProviderInvest"),refFunctionAddToDraft:this.addToDraft,login:this.expert.accountId,nameProvider:this.nameExpert,contract:this.expert.contract,imgFly:this.$refs.img}):this.login()},showTooltip:function(t,e,i){this.text=e,this.maxWidth=i,this.viewTooltip(t)},redactHandlerAdd:function(){this.redactSettings({data:{contract:this.expert.contract,accountGroupCode:this.expert.accountGroupCode,accountId:this.expert.accountId,sequenceId:this.expert.sequenceid,nameExpert:this.nameExpert,avatarURL:this.expert.avatarURL,brokerId:this.expert.brokerId,procPosOrders:this.expert.procPosOrders,monthPrice:this.myPrice.monthPrice,profitPercent:this.myPrice.profitPercent,myAccount:this.getDefaultAccount.id},mutation:"addNewFavorite"})},saveOrDeleteFavorite:function(){this.isFavorite?this.redactSettings({data:{contract:this.expert.contract,accountId:this.expert.accountId,myAccount:this.getDefaultAccount.id},mutation:"deleteFavorite"}):"Investing"===this.$route.meta.componentName?WG({elementFly:this.$refs.img,targetFly:document.querySelector(".favoriteTab"),offsetLeft:10,calcSize:20,cb:this.redactHandlerAdd}):this.redactHandlerAdd()}})},cq=aq,lq=(i("0a19"),Object(C["a"])(cq,sq,rq,!1,null,"1c7c9f48",null)),uq=lq.exports,dq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PortfolioSelection",class:t.darkClass},[e("div",{staticClass:"newPortfolio",class:{loading:t.isLoading},on:{click:t.addToDraft}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",[t._v("Добавить в новый портфель")])],1),t.isVisiblePortfolios?e("Accordion",{attrs:{collapsible:!0,"data-source":t.accordionData,openIndex:t.openIndex,time:500},on:{setAccordionIndex:t.setAccordionIndex},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"newPortfolio"},[t._v("Добавить к существующему")])]},proxy:!0},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"wrapPortfolio",on:{wheel:function(t){t.stopPropagation()}}},t._l(o.portfolios,(function(i){return e("Portfolio",{key:i.id,attrs:{location:t.location,nameProvider:t.nameProvider,portfolio:i,symbol:t.symbol,login:t.login,imgFly:t.imgFly},on:{hiddenModal:t.hiddenModal}})})),1)]}}],null,!1,101542413)}):t._e()],1)},hq=[],pq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Portfolio",class:t.rootClass,on:{click:t.addExistPortfolio}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("div",{staticClass:"portfolioContent"},[e("div",{staticClass:"avatarsBlock"},[t._l(t.avatarsSlice,(function(t){return e("img",{key:t,attrs:{src:t}})})),t.dopAvatars?e("div",{staticClass:"dopAvatar"},[t._v("+"+t._s(t.dopAvatars))]):t._e()],2),e("span",{staticClass:"text"},[t._v(t._s(t.portfolio.name))])])],1)},gq=[],fq={name:"Portfolio",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{portfolio:{type:Object},login:{type:String},symbol:{type:String,default:""},nameProvider:{type:String},imgFly:{type:Node},location:{type:String}},mixins:[xt],data:function(){return{isLoading:!1}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",sourcesByAccount:"expertsPortfolio/sourcesByAccount"})),{},{rootClass:function(){return Object(c["a"])({loading:this.isLoading},this.darkClass)},avatars:function(){var t=this.portfolio.sources.map((function(t){var e=t.userInfo.avatarURL;return"User-profile.png"===e&&(e=i("81bc")),e}));return Array.from(new Set(t))},avatarsSlice:function(){return this.avatars.slice(0,3)},dopAvatars:function(){var t=this.avatars.length-3;return!(t<=0)&&t}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast"})),{},{lockAdd:function(){var t=this,e=this.portfolio.sources,i=!1,o="";if(this.symbol){var n=e.find((function(e){return e.accountId===t.login&&e.contract===t.symbol}));n&&(i=!0),o="Сигнал провайдера ".concat(this.nameProvider," по контракту ").concat(this.symbol," уже добавлен в портфель “").concat(this.portfolio.name,"”.")}else{var s=e.find((function(e){return e.accountId===t.login}));s&&(i=!0),o="Сигналы провайдера ".concat(this.nameProvider," уже добавлены в портфель “").concat(this.portfolio.name,"”.")}return!!i&&(this.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",congratulationStatus:"error",message:o}}),!0)},addExistPortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,c;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.lockAdd(),!t.isLoading&&!i){e.next=3;break}return e.abrupt("return");case 3:return t.isLoading=!0,e.next=6,t.$http.post("".concat(t.getApiUrl,"GetShortSourcesByAccountIds"),{ids:[t.login],checkStat:!0});case 6:if(o=e.sent,n=o.data,s=n.data[0].data.filter((function(t){return!t.statIsOut})),t.symbol&&"all"!==t.symbol&&(s=s.filter((function(e){return e.contract===t.symbol}))),c=s.map((function(e){return tq({sourceId:e.id,bagId:t.portfolio.id})})),"portfolios"!==t.location){e.next=15;break}WG({elementFly:t.imgFly,targetFly:document.querySelector(".prov_".concat(t.portfolio.id)),offsetLeft:20,calcSize:"portfolios"===t.location?0:25,cb:function(){var e=Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.investFunction(c);case 2:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),e.next=17;break;case 15:return e.next=17,t.investFunction(c);case 17:case"end":return e.stop()}}),e)})))()},investFunction:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.saveInvestBagContent(Object(x["a"])(t));case 2:o=e.nameProvider,n=e.portfolio.name,e.showToast({visible:!0,componentName:"ToastMessage",shading:!0,outSideClick:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:"Сигналы провайдера ".concat(o," успешно добавлены в портфель “").concat(n,"”.")}}),e.$emit("hiddenModal");case 6:case"end":return i.stop()}}),i)})))()}}),mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},mq=fq,vq=(i("73f5"),Object(C["a"])(mq,pq,gq,!1,null,"669c489f",null)),yq=vq.exports,Cq={name:"PortfolioSelection",components:{Accordion:zP,Portfolio:yq,DxLoadIndicator:OT["DxLoadIndicator"]},props:{portfolio:{type:Array},refFunctionAddToDraft:{type:Function,default:function(){}},login:{type:String},symbol:{type:String,default:""},nameProvider:{type:String},imgFly:{type:Node},location:{type:String,default:"tops"}},mixins:[xt],data:function(){return{isLoading:!1,openIndex:-1}},watch:{},computed:{portfolioFiltered:function(){return this.portfolio.filter((function(t){return"Invest"===t.type}))},accordionData:function(){return[{portfolios:this.portfolioFiltered}]},isVisiblePortfolios:function(){var t;return(null===(t=this.portfolio)||void 0===t?void 0:t.length)>0}},methods:{setAccordionIndex:function(t){this.openIndex=t},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoading){e.next=2;break}return e.abrupt("return");case 2:if(t.isLoading=!0,"portfolios"!==t.location){e.next=7;break}return i=document.querySelector(".AdaptiveLineButtons"),WG({elementFly:t.imgFly,targetFly:document.querySelector(".AdaptiveLineButtons"),calcSize:0,offsetLeft:(null===i||void 0===i?void 0:i.clientWidth)||0,cb:function(){var e=Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.refFunctionAddToDraft();case 2:t.hiddenModal();case 3:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),e.abrupt("return");case 7:return e.next=9,t.refFunctionAddToDraft();case 9:t.hiddenModal();case 10:case"end":return e.stop()}}),e)})))()},hiddenModal:function(){this.$emit("hiddenModal")}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},bq=Cq,Sq=(i("bea0"),Object(C["a"])(bq,dq,hq,!1,null,"9f9e2d50",null)),Pq=Sq.exports,Tq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopInvest",class:t.darkClass},[e("div",{staticClass:"logoTop"},[e("div",{staticClass:"countText"},[t._v("TOP "+t._s(t.countTop))]),e("div",{staticClass:"brokerName"},[t._v(t._s(t.getTitleTop))])]),e("div",{staticClass:"pipsAndProfit",class:{isProvider:t.isProvider}},[e("div",{staticClass:"percentPrice"},[t._v("SF 33%")]),e("div",{staticClass:"pip"},[t._v(t._s(t.getPipTop))])]),e("div",{staticClass:"diagram"},[e("ProgressRoundDiagram",{attrs:{width:45,height:45,widthBorder:5,fontSize:9,percent:t.percent}})],1),e("div",{staticClass:"activeButtonBlock"},[t.isProvider?t._e():e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){t.mouseEnterHandler(e,t.$t("copy"))},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconDataCopy,disable:t.isLoadingCreated||t.isLoadingStart},on:{toggle:t.startCopyHandler}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1),e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){t.mouseEnterHandler(e,t.$t("atmi"))},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconDataAdd,disable:t.getIsReal},on:{toggle:t.addToDraft}},[t.isLoadingCreated?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))])],1)},xq=[];function Oq(t,e){var i=[],o=wq(t,e),n=_q(t,o),s=Object.values(n);return s.flat().forEach((function(t){i.push.apply(i,Object(x["a"])(Object.values(t)))})),Aq(i.flat(),t.length)}function wq(t,e){var i={};return t.forEach((function(t){var o=e.find((function(e){return e.accountId===t.accountId}));o&&(i[t.accountId+t.contract]=o.data.filter((function(e){return t.contract===e.contract})))})),i}function _q(t,e){var i={};return t.forEach((function(t){i[t.accountId+t.contract]||(i[t.accountId+t.contract]=[]);var o=e[t.accountId+t.contract].filter((function(e){return e.contract===t.contract}));i[t.accountId+t.contract].push(Object(Vt["a"])({},t.contract,o))})),i}function Aq(t){var e={};return t.forEach((function(t){var i=new Date(t.date).getTime();e[i]||(e[i]=[[],[],[]]);var o=100*t.profitClose/t.usedVolume;t.usedVolume||(o=0),e[i][0].push(o),e[i][1].push(t.profitOpen),e[i][2].push(t.profitClose)})),Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1],n=o[0].filter((function(t){return t}));return[i,n.length?o[0].reduce((function(t,e){return t+e}),0)/n.length:0,o[1].reduce((function(t,e){return t+e}),0),o[2].reduce((function(t,e){return t+e}),0)]}))}var Dq={inject:["openModalCopyProvider"],mixins:[lW,$n],data:function(){return{shortSources:[],isLoadingCreated:!1,isLoadingStart:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{name:function(){var t,e="all"!==this.selectedContract?this.selectedContract:"";return"Топ ".concat(null===(t=this.portfolioForSlider)||void 0===t?void 0:t.length," ").concat(e||"")},isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},logins:function(){return this.portfolioForSlider.map((function(t){return t.accountId}))}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast",setVisible:"modalPay/setVisible",createUserService:"paymentService/createUserService",payInvoice:"paymentService/payInvoice"})),{},{login:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},getShortSources:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.post("".concat(t.getApiUrl,"GetShortSourcesByAccountIds"),{ids:t.logins,checkStat:!0});case 2:return i=e.sent,o=i.data,n=Object(x["a"])(o.data).map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:t.data.filter((function(t){return!t.statIsOut}))})})),t.shortSources=n,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})))()},iAmProvider:function(t){var e=[];if(0===this.getDefaultAccount.source.length)return[];var i=this.getDefaultAccount.source;return i.includes(t)&&e.push(t),e},expertsForTop:function(t){var e=this,i=wq(this.portfolioForSlider,this.statDataReadyMadeSolution),o=_q(this.portfolioForSlider,i);return this.portfolioForSlider.map((function(i){var n=o[i.accountId+i.contract].find((function(t){return!!t[i.contract]}));return{accountGroupCode:i.accountGroupCode,data:n[i.contract],avatar:i.avatarURL,iAmProvider:e.iAmProvider(i.contract),login:i.accountId,profitOrdersPercent:i.procPosOrders,sequenceId:i.sequenceid,symbol:i.contract,traderName:i.userName,sources:t.filter((function(t){return t.uniqueId==="".concat(i.accountId).concat(i.contract)})),uniqueId:"".concat(i.accountId).concat(i.contract),status:!0}}))},startCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=13;break}return t.isLoadingStart=!0,e.next=10,t.pendingStatus(i.id);case 10:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 13:return t.isLoadingStart=!0,e.next=16,t.getShortSources();case 16:o=e.sent,n=o.filter((function(e){return t.logins.includes(e.accountId)})),s=[],t.portfolioForSlider.forEach((function(t){var e=n.find((function(e){return e.accountId===t.accountId})),i=e.data.find((function(e){return e.contract===t.contract}));s.push({id:i.id,contract:t.contract,uniqueId:"".concat(t.accountId).concat(t.contract)})})),t.openModalCopyProvider({investTop:!0,symbol:t.selectedContract,expertsByFindPortfolio:t.expertsForTop(s)}),t.isLoadingStart=!1;case 22:case"end":return e.stop()}}),e)})))()},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.name,o=t.shortSources.filter((function(e){return t.logins.includes(e.accountId)})),n=[],t.portfolioForSlider.forEach((function(t){var e=o.find((function(e){return e.accountId===t.accountId})),i=e.data.find((function(e){return e.contract===t.contract}));n.push(i.id)})),e.next=6,t.saveInvestBag({name:i,investMoney:0,investLeverage:1,investBagType:"InvestTop"});case 6:if(s=e.sent,!s.requestStatus.isOK){e.next=12;break}return a=[],n.forEach((function(t){a.push(tq({sourceId:t,priceType:"Money",bagId:s.id}))})),e.next=12,t.saveInvestBagContent(a);case 12:case"end":return e.stop()}}),e)})))()},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return t.isLoadingCreated=!0,e.next=6,t.getShortSources();case 6:return e.next=8,t.addInvest();case 8:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:"Портфель ".concat(t.name," добавлен в раздел “Инвестиции”.")}}),t.isLoadingCreated=!1,o=new Audio,o.src=i("2e5e"),o.play();case 13:case"end":return e.stop()}}),e)})))()}})},kq={name:"TopInvest",components:{ProgressRoundDiagram:c$,DxLoadIndicator:OT["DxLoadIndicator"]},props:{expert:{type:Array},instrumentType:{type:String}},mixins:[xt,Ot,Dq],data:function(){return{text:"",statDataReadyMadeSolution:[]}},watch:{statDataReadyMadeSolution:function(t){var e=Array.from(new Set(this.expert.map((function(t){return t.accountId}))));t.length===e.length&&this.startCopy()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getTitleTop:function(){return"CFD"===this.instrumentType?"Crypto":"Forex"},getIsReal:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},topData:function(){return this.expert},countTop:function(){return this.topData.length},portfolioForSlider:function(){return this.expert},getPipTop:function(){var t=this.topData.reduce((function(t,e){return t+e.pip}),0);return Lm(t,2,!0)+" pip"},iconUnion:function(){return{name:"Union",color:this.darkClass.dark?"#bbcee0":"#ccc"}},iconDataCopy:function(){return this.isLoadingStart?{}:{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconDataAdd:function(){return this.isLoadingCreated?{}:{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},allTransactions:function(){return this.topData.reduce((function(t,e){return t+e.closedCount}),0)},profitTransaction:function(){return this.topData.reduce((function(t,e){return t+e.pClosedCount}),0)},percent:function(){return 100*this.profitTransaction/this.allTransactions},accountsArr:function(){return Array.from(new Set(this.topData.map((function(t){return t.accountId}))))}}),methods:{mouseEnterHandler:function(t,e){this.text=e,this.viewTooltip(t)},setStat:function(t){this.statDataReadyMadeSolution.push({accountId:t.dailyData.accountId,data:t.data})},getStatByContract:function(t){var e=new Date,i=e.getFullYear()-1,o=e.getMonth(),n=e.getDay(),s=new Date(i,o,n),r={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:null,DateRequest:s,forChart:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:r})},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)&&this.isLoadingStart){var e=Td(JSON.parse(t.data));this.setStat(e)}},startCopyHandler:function(){var t=this;this.statDataReadyMadeSolution.length?this.startCopy():(this.isLoadingStart=!0,this.accountsArr.forEach((function(e){t.getStatByContract(e)})))}},mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},Iq=kq,Bq=(i("82f7"),Object(C["a"])(Iq,Tq,xq,!1,null,"6ac8c2aa",null)),Mq=Bq.exports,$q=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InvestPortfolioBar",class:t.darkClass},[e("div",{staticClass:"topProvidersText"},[e("div",{staticClass:"buttonTabs",class:{active:"OneProviderInvest"===t.tabsComponent},on:{click:function(e){return t.setTabs("OneProviderInvest")}}},[e("svgIcon",t._b({},"svgIcon",t.iconDataProvider,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("providers2")))])],1),e("div",{staticClass:"buttonTabs",class:{active:"TopInvest"===t.tabsComponent},on:{click:function(e){return t.setTabs("TopInvest")}}},[e("svgIcon",t._b({},"svgIcon",t.iconDataTops,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("tops")))])],1),e("div",{staticClass:"buttonTabs favoriteTab",class:{active:"FavoriteProvider"===t.tabsComponent},on:{click:function(e){return t.setTabs("FavoriteProvider")}}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFavorites,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("favorites"))+" "),e("span",[t._v(t._s(t.getAllFavorites.length))])])],1)]),"FavoriteProvider"!==t.tabsComponent?e("div",{staticClass:"choiceBrokerAndContract"},[e("div",{ref:"container",staticClass:"adaptiveBlockContainer"},[t.refContainer?e("AdaptiveLineButtons",{attrs:{idDropDown:"topPortfolios",tabsSet:t.buttonsArray,refTabWrapper:t.refContainer,maxHeightDropDownList:200,widthDropDownList:100},on:{setActiveTab:t.setActiveTab},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.data;return[e("div",{staticClass:"contactValue"},[t._v(t._s(o.value))])]}}],null,!1,1021827701)}):t._e()],1)]):t._e()])},Lq=[],Fq={name:"InvestPortfolioBar",components:{DxSelectBox:Bo.a,AdaptiveLineButtons:Jg},props:{tabsComponent:{type:String},setView:{type:Function},setActiveTab:{type:Function},mountedFetch:{type:Boolean},idContract:{type:String},loadStatus:{type:Boolean}},mixins:[xt],data:function(){return{symbolList:null,refContainer:null,selectedTrading:null}},watch:{tabsComponent:function(){!this.symbolList&&Object.keys(this.getCatalogs).length>1&&(this.setSymbolList(),this.selectedTrading=this.getCryptoStatus?this.arrayTrading[1]:this.arrayTrading[0])},loadStatus:function(){var t=this;this.$nextTick((function(){t.refContainer=t.$refs.container}))},mountedFetch:function(t){t||(this.setSymbolList(),this.selectedTrading=this.getCryptoStatus?this.arrayTrading[1]:this.arrayTrading[0])},getDefaultAccount:function(){var t=this;this.$nextTick((function(){t.refContainer=t.$refs.container}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary",getCatalogs:"quotesCatalogs/getCatalogs",getDefaultAccount:"subscribeOrders/getDefaultAccount",getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},iconDataProvider:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00ffac":"#008E72";return{name:"Provider",color:"OneProviderInvest"===this.tabsComponent?e:t}},iconDataTops:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00ffac":"#008E72";return{name:"Tops2",color:"TopInvest"===this.tabsComponent?e:t}},iconDataFavorites:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00b9fc":"#3c73f1";return{name:"Favorite-off",color:"FavoriteProvider"===this.tabsComponent?e:t}},dropDownOptionsClass:function(){var t="dropDownTrading";return this.darkClass.dark&&(t+=" dark"),t},arrayTrading:function(){return this.symbolList?Object.keys(this.symbolList).map((function(t){return{title:t,value:t}})):[]},symbolListForex:function(){var t=this,e=this.getCatalogs["Forex"].map((function(t){return t.s})),i=this.getUserQuotesLibrary.reduce((function(i,o){if(e.includes(o)){var n={id:o,value:o,type:"Forex",isActive:o===t.idContract};return i.push(n),i}return i}),[]);return[{id:"all",value:"all",type:"Forex"}].concat(Object(x["a"])(i))},buttonsArray:function(){var t,e,i=this;return null!==(t=this.selectedTrading)&&void 0!==t&&t.value?!this.getCryptoStatus&&this.symbolListForex.length>2?this.symbolListForex.map((function(t){return Object(c["a"])(Object(c["a"])({isActive:t.id===i.idContract},t),{},{value:"all"===t.value?"Все":t.value,instrumentType:"ForexSpot"})})):this.symbolList[null===(e=this.selectedTrading)||void 0===e?void 0:e.value].map((function(t){var e=i.getCatalogs[t.type][0].instrumentType;return Object(c["a"])(Object(c["a"])({isActive:t.id===i.idContract},t),{},{value:"all"===t.value?"Все":t.value,instrumentType:e})})):[]}}),methods:{setTabs:function(t){var e=this;this.setView(t),this.$nextTick((function(){e.refContainer=e.$refs.container}))},setSymbolList:function(){var t=this,e={};Object.keys(this.getCatalogs).forEach((function(i){"all"!==i&&(e[i]=t.getCatalogs[i].map((function(t){return{id:t.s,value:t.s,type:i}})),e[i]=[{id:"all",value:"all",type:i}].concat(Object(x["a"])(e[i])))})),this.symbolList=Object(c["a"])({Forex:e.Forex},e)},valueChangedSelect:function(t){if(t.event){this.selectedTrading=t.value;var e=this.getCatalogs[t.value.title][0].instrumentType;this.setActiveTab({id:"all",instrumentType:e})}}},mounted:function(){var t=this;this.loadStatus&&this.$nextTick((function(){t.refContainer=t.$refs.container}))}},jq=Fq,Rq=(i("e19c"),Object(C["a"])(jq,$q,Lq,!1,null,"161cf688",null)),Wq=Rq.exports,Nq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradingFavoritesAndProvidersBar",class:t.darkClass},[e("div",{staticClass:"buttonTabs",class:{active:"OneProvider"===t.tabsComponentTrading},on:{click:function(e){return t.setViewTrading("OneProvider")}}},[e("svgIcon",t._b({},"svgIcon",t.iconDataProvider,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("providers2")))])],1),e("div",{staticClass:"buttonTabs favoriteTab",class:{active:"FavoriteProvider"===t.tabsComponentTrading},on:{click:function(e){return t.setViewTrading("FavoriteProvider")}}},[e("svgIcon",t._b({},"svgIcon",t.iconDataFavorites,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("favorites"))+" "),e("span",[t._v(t._s(t.getAllFavorites.length))])])],1)])},Eq=[],Uq={name:"TradingFavoritesAndProvidersBar",components:{},props:{tabsComponentTrading:{type:String},setViewTrading:{type:Function}},mixins:[xt],data:function(){return{}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{iconDataProvider:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00ffac":"#008E72";return{name:"Provider",color:"OneProvider"===this.tabsComponentTrading?e:t}},iconDataFavorites:function(){var t=this.darkClass.dark?"#bbcee0":"#8c8c8c",e=this.darkClass.dark?"#00b9fc":"#3c73f1";return{name:"Favorite-off",color:"FavoriteProvider"===this.tabsComponentTrading?e:t}}}),methods:{},mounted:function(){},destroyed:function(){}},Vq=Uq,Hq=(i("58ab"),Object(C["a"])(Vq,Nq,Eq,!1,null,"241745e2",null)),Gq=Hq.exports,qq=function(){var t=this,e=t._self._c;return e("div",{staticClass:"FavoriteProvider",class:t.darkClass},[e("div",{staticClass:"dataExpertBlock"},[e("div",{staticClass:"favoriteButton",on:{mouseenter:function(e){t.showTooltip(e,t.$t("rpff"),150)},mouseleave:t.hideTooltip,click:t.deleteFavorite}},[e("svgIcon",t._b({},"svgIcon",t.iconFavorite,!1))],1),e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{ref:"img",staticClass:"image",on:{click:t.goToProfile}},[e("Avatar",{attrs:{src:t.photoExpert,size:"4.5",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"contentExpert"},[e("div",{staticClass:"nameExpert"},[t._v(t._s(t.nameExpert))]),e("div",{staticClass:"signalAndPrice",class:{isProvider:t.isProvider}},[e("div",{staticClass:"signal"},[t._v(t._s(t.expert.contract))])])])]),e("div",{staticClass:"profitRoiWrap",style:{background:t.getLemonColor.gradient}},[e("div",{staticClass:"profitRoiWrap-title",style:{color:t.getGrayColor.color}},[t._v("ROI")]),e("div",{staticClass:"profitRoiWrap-data",style:{color:t.getLemonColor.color}},[t._v(t._s("".concat(Math.trunc(t.procPosOrders),"%")))])]),e("div",{staticClass:"activeButtonBlock"},[t.isProvider?t._e():e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconCopy,disabled:!1},on:{mouseenter:function(e){t.showTooltip(e,t.$t("copy"),150)},mouseleave:t.hideTooltip,toggle:t.startCopy}},[t._e()],1),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{disabled:!1,icon:t.iconAdd},on:{mouseenter:function(e){return t.showTooltip(e,t.buttonTextPlus,230)},mouseleave:t.hideTooltip,toggle:t.buttonPlusClickHandler}},[t._e()],1)],1),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:t.maxWidth,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))])],1)},zq=[],Yq={name:"FavoriteProvider",inject:["openModalCopyProvider"],components:{ProgressRoundDiagram:c$,DxLoadIndicator:OT["DxLoadIndicator"],Avatar:E},props:{expert:{type:Object},isTrading:{type:Boolean},allSources:{type:Array}},mixins:[rT,Ot,xt,lW,$n,qe],data:function(){return{text:"",maxWidth:0,isLoadingStart:!1,isLoadingGetPortfolios:!1}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBrokers:"brokers/getBrokers",isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated"})),{},{isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},iconFavorite:function(){return{name:"Favorite-on",color:this.darkClass.dark?"#00b9fc":"#3c73f1"}},greenColor:function(){return{green:"Demo"!==this.accountGroup}},photoExpert:function(){return"User-profile.png"===this.expert.avatarURL?i("81bc"):this.expert.avatarURL},nameExpert:function(){return this.expert.nameExpert},getBrokerImage:function(){var t=this,e=this.getBrokers.find((function(e){return e.id===t.expert.brokerId}));return e&&e.logo?"data:image/jpeg;base64,".concat(e.logo):i("700b")},accountGroup:function(){return this.expert.accountGroupCode},sequenceId:function(){return this.expert.sequenceId},procPosOrders:function(){return this.expert.procPosOrders},monthPrice:function(){return this.expert.monthPrice},profitPercent:function(){return this.expert.profitPercent},iconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconAdd:function(){return{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},buttonTextPlus:function(){return this.isTrading?this.$t("aapttcatit"):this.$t("atmi")}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"favoriteSettings/redactSettings",setPopupModalData:"modal/setPopupData",setVisible:"modalPay/setVisible",saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast"})),{},{mouseenterHandler:function(t){this.mouseEnterFunction(t,{imageForSource:this.photoExpert,nameSource:this.expert.nameExpert,sequenceId:this.expert.sequenceId,accountId:this.expert.accountId,noActiveButton:!0})},mouseleaveHandler:function(){this.mouseLeaveFunction()},goToProfile:function(){var t;this.goingToProfile(null===(t=this.expert)||void 0===t?void 0:t.accountId)},deleteFavorite:function(){this.redactSettings({data:{contract:this.expert.contract,accountId:this.expert.accountId,myAccount:this.getDefaultAccount.id},mutation:"deleteFavorite"})},showTooltip:function(t,e,i){this.text=e,this.maxWidth=i,this.viewTooltip(t)},login:function(){this.setPopupModalData({visiblePopup:!0,modalComponentName:"ModalLogin",titlePopup:"sign_in"})},startCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=13;break}return t.isLoadingStart=!0,e.next=10,t.pendingStatus(i.id);case 10:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 13:t.openModalCopyProvider({providerCopy:!0,symbol:t.expert.contract,infoAccount:{avatar:t.expert.avatarURL,traderName:t.expert.nameExpert,login:t.expert.accountId,sequenceId:t.expert.sequenceId}});case 14:case"end":return e.stop()}}),e)})))()},buttonPlusClickHandler:function(t){this.isTrading||this.addInCartProviderHandler(t)},addInCartProviderHandler:function(t){var e=this,i=this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}));i.length>0?this.addInCartProvider(t):WG({elementFly:this.$refs.img,targetFly:document.querySelector(".TopButtonsBlock"),offsetLeft:10,calcSize:0,cb:function(){return e.addToDraft(!0)}})},addInCartProvider:function(t){this.isAuth?this.$emit("openModalSelected",{target:t.closest(".FavoriteProvider"),refFunctionAddToDraft:this.addToDraft,login:this.expert.accountId,nameProvider:this.nameExpert,contract:this.expert.contract,imgFly:this.$refs.img}):this.login()},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return t.isLoadingGetPortfolios=!0,e.next=6,t.addInvest();case 6:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:t.$t("tcphbattps")}}),t.isLoadingGetPortfolios=!1,o=new Audio,o.src=i("2e5e"),o.play();case 11:case"end":return e.stop()}}),e)})))()},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.nameExpert,o=t.findAccount(),n=o.contracts,s=n.find((function(e){return e.contract===t.expert.contract})),a=[s.id],e.next=6,t.saveInvestBag({name:i,investLeverage:1,investMoney:0,investBagType:"Invest",avatarURL:t.photoExpert});case 6:if(c=e.sent,!c.requestStatus.isOK){e.next=12;break}return l=[],a.forEach((function(t){l.push(tq({sourceId:t,bagId:c.id}))})),e.next=12,t.saveInvestBagContent(l);case 12:case"end":return e.stop()}}),e)})))()},findAccount:function(){var t=this;if(this.allSources){var e=this.allSources.find((function(e){return e.accountId===t.expert.accountId}));return{contracts:e.data,accountId:e.accountId,sourceIds:e.data.map((function(t){return t.id})),contractsName:e.data.map((function(t){return t.contract}))}}}}),mounted:function(){},destroyed:function(){}},Xq=Yq,Qq=(i("ae77"),Object(C["a"])(Xq,qq,zq,!1,null,"d3087022",null)),Jq=Qq.exports;function Kq(t){var e=[];return t[0].forEach((function(i){e.push([]),i[2]?(i[2].forEach((function(i){e.at(-1).push(Zq(i[0],i[1],t[1]))})),e.at(-1).push(Zq(i[0],i[1],t[1]))):e.at(-1).push(Zq(i[0],i[1],t[1]))})),e}function Zq(t,e,i){return{bagContents:e.map((function(t){return tz(t)})),sources:e.reduce((function(t,e){var o=ez(e,i);return t.push(o),t}),[]),id:t[0],accountId:t[1],name:t[2],createdDateTime:t[3],investBagType:t[4],status:t[5],stopDateTime:t[6],avatarURL:t[7],investMoney:t[8],startDateTime:t[9],parentId:t[10],investLeverage:t[11],subAccountId:t[12]}}function tz(t){return{id:t[0],sourceId:t[1],signalVolume:t[2],signalVolumeType:t[3],maxOpenPositions:t[4],price:t[5],priceType:t[6],ddPercentMin:t[7],ddPercentMax:t[8],bagId:t[9],investMoney:t[10],isDemo:t[11],period:t[12]}}function ez(t,e){var i=e.find((function(e){return t[1]===e[0]}));return iz(i)}function iz(t){return{id:t[0],accountId:t[1],contract:t[2],comment:t[3],stopDateTime:t[4],monthPrice:t[5],profitPercent:t[6],userInfo:oz(t[7]),accountSequenceId:t[8],accountGroupCode:t[9]}}function oz(t){return{id:t[0],email:t[1],role:t[2],firstName:t[3],lastName:t[4],avatarURL:t[9]}}var nz={name:"TrendTradingWidget",mixins:[xt],components:{OneProvider:nq,StatisticsBlock:SV,RecycleScroller:QP["c"],Sceleton:nT,DxPopup:To["DxPopup"],OneProviderInvest:uq,PortfolioSelection:Pq,TopInvest:Mq,InvestPortfolioBar:Wq,TradingFavoritesAndProvidersBar:Gq,FavoriteProvider:Jq,VuePerfectScrollbar:Xt.a},props:{symbol:{type:String,default:"EURUSD"},activeTabProfile:{type:String},loadStatus:{type:Boolean}},data:function(){return{target:null,refFunctionAddToDraft:null,imgFly:null,contract:null,login:"",nameProvider:"",popupVisible:!1,positionPopup:{},popupData:{},allProviderBySymbol:null,topTradersList:null,allSources:null,allSourcesFavorites:null,priceData:null,allAccountsId:null,sectionHeight:null,heightExpert:72,countTops:[3,5,10,15,20,30,50,100],idContract:"all",instrumentType:"ForexSpot",tabsComponent:"OneProviderInvest",tabsComponentTrading:"OneProvider",fetchLoading:!1,mountedFetch:!0}},watch:{getInstrumentBySymbol:function(t){!this.isInvestPortfolios&&t&&this.getAllProvidersByContract()},getDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!t||e.isInvestPortfolios){i.next=4;break}e.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:null===(o=e.getDefaultAccount)||void 0===o?void 0:o.id,filter:["Active","Created"]}),i.next=9;break;case 4:if(!t||!e.isInvestPortfolios){i.next=9;break}return e.getCryptoStatus?e.instrumentType="CFD":e.instrumentType="ForexSpot",i.next=8,e.fetchHandler();case 8:e.mountedFetch=!1;case 9:case"end":return i.stop()}}),i)})))()},tabsComponent:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if("FavoriteProvider"!==t||e.allSourcesFavorites){i.next=5;break}return i.next=3,e.getShortSourcesByAccountIds({logins:e.providersList.map((function(t){return t.accountId})),onlyReturn:!0,checkStat:!0});case 3:o=i.sent,e.allSourcesFavorites=o;case 5:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getContracts:"contracts/getContracts",getSession:"auth/getSession",getProfileAccount:"subscribeOrders/getProfileAccount",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated",getDefaultAccount:"subscribeOrders/getDefaultAccount",getFavoritesByContract:"favoriteSettings/getFavoritesByContract",getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{getCountPortfolios:function(){return this.getCreatedPortfoliosNoSorted.length},getInstrumentBySymbol:function(){var t=this;if(this.getContracts)return this.getContracts.find((function(e){return e.name===t.symbol})).instrumentName},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},iconData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},isInvestPortfolios:function(){return"Investing"===this.$route.meta.componentName},isTrading:function(){return"Trading"===this.$route.meta.componentName},ordersBuy:function(){if(this.allProviderBySymbol)return this.allProviderBySymbol.filter((function(t){return"Buy"===t.operationTrend}))},ordersSell:function(){if(this.allProviderBySymbol)return this.allProviderBySymbol.filter((function(t){return"Sell"===t.operationTrend}))},isLoading:function(){return this.isInvestPortfolios?!this.topTradersList||!this.allSources:!this.allProviderBySymbol},sceletonCount:function(){if(!this.sectionHeight)return 0;var t=this.heightExpert;return Math.floor(((null===this||void 0===this?void 0:this.sectionHeight)-16)/t)},favoritesList:function(){return this.getAllFavorites},providersList:function(){var t=this;if(this.isInvestPortfolios){if("FavoriteProvider"===this.tabsComponent)return Object(x["a"])(this.favoritesList).sort((function(t,e){return e.procPosOrders-t.procPosOrders}));if("OneProviderInvest"===this.tabsComponent)return this.topTradersList?this.topTradersList.slice(0,50):[];var e=[],i=!1;return this.countTops.forEach((function(o){if(!i){var n=t.topTradersList.slice(0,o);e.push(n),n.length>=t.topTradersList.length&&(i=!0)}})),e}return"FavoriteProvider"===this.tabsComponentTrading?this.favoritesList:Object(x["a"])(this.allProviderBySymbol||[]).sort((function(t,e){var i=t.totalOrders?100*t.positiveOrders/t.totalOrders:0,o=e.totalOrders?100*e.positiveOrders/e.totalOrders:0;return o-i}))},wrapperAttrPopup:function(){var t="topPopupPortfolio";return this.darkClass.dark&&(t+=" dark"),{class:t}},positionPopupSelectionPortfolio:function(){if(!this.target)return{};var t=this.target.getBoundingClientRect().top,e=t<270;return{my:e?"top center":"bottom center",at:e?"top center":"bottom center",of:this.target}},getLocation:function(){var t;return"Trading"===(null===(t=this.$route.meta)||void 0===t?void 0:t.componentName)?null:"portfolios"},componentView:function(){return this.isTrading?this.tabsComponentTrading:this.isInvestPortfolios?this.tabsComponent:"OneProvider"},isVisibleStatisticBlock:function(){var t;return(null===(t=this.providersList)||void 0===t?void 0:t.flat().length)&&!this.isInvestPortfolios},propsComponent:function(){return{OneProvider:{symbol:this.symbol,allSources:this.allSources,isInvestPortfolios:this.isInvestPortfolios,priceData:this.priceData,isTrading:this.isTrading},OneProviderInvest:{allSources:this.allSources,priceData:this.priceData,symbol:this.idContract},FavoriteProvider:{isTrading:this.isTrading,allSources:this.allSourcesFavorites},TopInvest:{instrumentType:this.instrumentType}}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio",getShortSourcesByAccountIds:"expertsPortfolio/getShortSourcesByAccountIds"})),{},{fetchHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.fetchLoading=!0,i=JSON.stringify({ProcPosOrdersFrom:0,ProcPosOrdersTo:100,contract:"all"===t.idContract?null:t.idContract,instrumentType:t.instrumentType,limit:100}),e.next=4,t.$workKeys.signMessage(i,t.getSession.sk);case 4:return o=e.sent,e.next=7,t.$http.post("".concat(t.getApiUrl,"GetTopAccountsByFilter"),i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}});case 7:return n=e.sent,s=n.data,t.topTradersList=s.data,e.next=12,t.getStatForSource();case 12:t.fetchLoading=!1;case 13:case"end":return e.stop()}}),e)})))()},getAllProvidersByContract:function(){if(this.getContracts){this.allProviderBySymbol=null;var t={Command:"GetSourcesById",data:{Type:"Instrument",Id:this.getInstrumentBySymbol,RequestId:"TrendTradingWidget",NotEmptyData:!0}};this.$socketStream.sendCommand({ws:"apiWS",command:t})}},getStatForSource:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getShortSourcesByAccountIds({logins:t.providersList.map((function(t){return t.accountId})),onlyReturn:!0,checkStat:!0});case 2:return i=e.sent,e.next=5,t.getShortSourcesByAccountIds({logins:t.providersList.map((function(t){return t.accountId})),onlyReturn:!0,checkStat:!1});case 5:o=e.sent,t.allSources=i,t.priceData=o;case 8:case"end":return e.stop()}}),e)})))()},setMessageHandler:function(t){"GetSourcesById"===(null===t||void 0===t?void 0:t.command)?"TrendTradingWidget"===t.data.requestId&&(this.allProviderBySymbol=t.data.data,this.getStatForSource()):"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&this.getListsPortfolio(Kq(JSON.parse(t.data)))},openModalSelected:function(t){this.target=t.target,this.refFunctionAddToDraft=t.refFunctionAddToDraft,this.login=t.login,this.nameProvider=t.nameProvider,this.contract=t.contract,this.imgFly=t.imgFly,this.popupVisible=!0},hidePopup:function(){this.popupVisible=!1},setView:function(t){this.tabsComponent=t},setViewTrading:function(t){this.tabsComponentTrading=t},setActiveTab:function(t){this.idContract=t.id,this.instrumentType=t.instrumentType,this.fetchHandler()}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$socketStream.$on("apiWS",t.setMessageHandler),t.$socketStream.$on("apiWS3",t.setMessageHandler),t.sectionHeight=t.$refs.section.clientHeight,!t.isInvestPortfolios||!t.getDefaultAccount){e.next=10;break}return t.getCryptoStatus?t.instrumentType="CFD":t.instrumentType="ForexSpot",e.next=7,t.fetchHandler();case 7:t.mountedFetch=!1,e.next=11;break;case 10:!t.isInvestPortfolios&&t.getDefaultAccount&&t.getContracts&&(t.getAllProvidersByContract(),t.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:null===(i=t.getDefaultAccount)||void 0===i?void 0:i.id,filter:["Active","Created"]}));case 11:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)}},sz=nz,rz=(i("02188"),i("a5a0"),Object(C["a"])(sz,QG,JG,!1,null,"39d4e44a",null)),az=rz.exports,cz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrdersBook"},[e("div",{staticClass:"OrdersBook-trend"},[e("div",{staticClass:"OrdersBook-trend-title",style:{border:"solid 1px ".concat(t.getGreenColor.color),color:t.getGreenColor.color}},[t._v("Покупка")]),e("div",{staticClass:"OrdersBook-trend-wrapIndicator"},[e("div",{staticClass:"OrdersBook-trend-indicator",class:"OrdersBook-trend-indicator_".concat(t.getActiveTheme),style:{background:t.getGreenColor.color,width:"".concat(t.getBidIndicatorWidth,"%")}},[t._v(t._s("".concat(Math.round(t.getBidIndicatorWidth),"%")))]),e("div",{staticClass:"OrdersBook-trend-indicator",class:"OrdersBook-trend-indicator_".concat(t.getActiveTheme),style:{background:t.getRedColor.color,width:"".concat(t.getOfferIndicatorWidth,"%")}},[t._v(t._s("".concat(Math.round(t.getOfferIndicatorWidth),"%")))])]),e("div",{staticClass:"OrdersBook-trend-title",style:{border:"solid 1px ".concat(t.getRedColor.color),color:t.getRedColor.color}},[t._v("Продажа")])]),e("div",{staticClass:"OrdersBook-orderBookTitle",class:"OrdersBook-orderBookTitle_".concat(t.getActiveTheme),style:{color:t.getGrayColor.color}},[e("div",{staticClass:"OrdersBook-orderBookTitle-item"},[t._v("Цена")]),e("div",{staticClass:"OrdersBook-orderBookTitle-item"},[t._v(t._s("Объём ".concat(t.getSymbolByContract)))]),e("div",{staticClass:"OrdersBook-orderBookTitle-item"},[t._v("Стоимость(USDT)")])]),t.offerOrders&&t.offerOrders.length?e("div",{staticClass:"OrdersBook-orderBook"},t._l(t.offerOrders,(function(i,o){return e("div",{key:o,staticClass:"OrdersBook-orderBook-rowWpap"},[e("div",{staticClass:"OrdersBook-orderBook-row"},[e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getRedColor.color}},[t._v(t._s(i.price))]),e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getGrayColor.color}},[t._v(t._s(i.vol))]),e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getRedColor.color}},[t._v(t._s(t.$moneyf(i.price*i.vol,2)))])]),e("div",{staticClass:"OrdersBook-orderBook-rowIndicator",style:{background:t.getRedColor.fill,width:"".concat(t.getWidthIndicatorBar("offer",i.vol),"%")}})])})),0):t._e(),t.bidOrders&&t.bidOrders.length?e("div",{staticClass:"OrdersBook-orderBook"},t._l(t.bidOrders,(function(i,o){return e("div",{key:o,staticClass:"OrdersBook-orderBook-rowWpap"},[e("div",{staticClass:"OrdersBook-orderBook-row"},[e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getGreenColor.color}},[t._v(t._s(i.price))]),e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getGrayColor.color}},[t._v(t._s(i.vol))]),e("div",{staticClass:"OrdersBook-orderBook-rowItem",style:{color:t.getGreenColor.color}},[t._v(t._s(t.$moneyf(i.price*i.vol,2)))])]),e("div",{staticClass:"OrdersBook-orderBook-rowIndicator",style:{background:t.getGreenColor.fill,width:"".concat(t.getWidthIndicatorBar("bid",i.vol),"%")}})])})),0):t._e()])},lz=[],uz={mixins:[qe],props:{symbol:{default:""}},data:function(){return{offerOrders:null,maxOfferValue:0,bidOrders:null,maxBidValue:0,currentQuote:0}},watch:{symbol:function(){this.offerOrders=null,this.maxOfferValue=0,this.bidOrders=null,this.maxBidValue=0,this.currentQuote=0,this.subsOrderBook()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts",getTradingInstruments:"contracts/getTradingInstruments",getTradingAssets:"contracts/getTradingAssets"})),{},{getSymbolByContract:function(){var t=this;if(!this.getInstrumentByContract)return"";var e=this.getTradingInstruments.find((function(e){return e.name===t.getInstrumentByContract})).baseAssetName;return e},getInstrumentByContract:function(){var t=this;return this.getContracts?this.getContracts.find((function(e){return e.name===t.symbol})).instrumentName:""},getAllBidVolume:function(){var t;return null!==(t=this.bidOrders)&&void 0!==t&&t.length?this.bidOrders.reduce((function(t,e){return t+e.vol}),0):0},getAllOfferVolume:function(){var t;return null!==(t=this.offerOrders)&&void 0!==t&&t.length?this.offerOrders.reduce((function(t,e){return t+e.vol}),0):0},getAllVolume:function(){return this.getAllOfferVolume+this.getAllBidVolume},getBidIndicatorWidth:function(){return this.getAllOfferVolume!==this.getAllBidVolume&&this.getAllVolume?100*this.getAllBidVolume/this.getAllVolume:50},getOfferIndicatorWidth:function(){return this.getAllOfferVolume!==this.getAllBidVolume&&this.getAllVolume?100-this.getBidIndicatorWidth:50}}),methods:{subsOrderBook:function(){var t={Command:"DoMs",method:"Subscribe",data:{Quotes:[this.getInstrumentByContract]}};this.$socketStream.sendCommand({ws:"apiWS4",command:t})},setMessageHendler:function(t){var e=this;if("DoMs"===(null===t||void 0===t?void 0:t.command))t.data.doMs[0].cnt===this.getInstrumentByContract&&(this.offerOrders=t.data.doMs.filter((function(t){return"Offer"===t.side})).sort((function(t,e){return t.price-e.price})),this.bidOrders=t.data.doMs.filter((function(t){return"Bid"===t.side})).sort((function(t,e){return e.price-t.price})),this.maxOfferValue=t.data.stat[0].maxValue,this.maxBidValue=t.data.stat[1].maxValue);else if("Quotes"===(null===t||void 0===t?void 0:t.command)){var i=t.data,o=i.find((function(t){return t.s===e.symbol}));o&&(this.currentQuote=o.b)}},getWidthIndicatorBar:function(t,e){var i="offer"===t?this.maxOfferValue:this.maxBidValue;return 100*e/i}},mounted:function(){this.subsOrderBook(),this.$socketStream.events.subscribe("apiWS4",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS2",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS4",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS2",this.setMessageHendler)}},dz=uz,hz=(i("594d"),Object(C["a"])(dz,cz,lz,!1,null,"005d25ab",null)),pz=hz.exports,gz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profile-module",class:t.darkClass},[e("div",{staticClass:"profile-module__header",class:"".concat(t.partHeader?"profile-module__header--part":""," profile-module__header_").concat(t.getActiveTheme)},[t._t("header")],2),t.$slots.body&&t.$slots.body.length?e("div",{staticClass:"profile-module__body"},[t._t("body")],2):t._e(),t.$slots.chart&&t.$slots.chart.length?e("div",{staticClass:"profile-module__chart"},[t._t("chart")],2):t._e(),t.$slots.footer&&t.$slots.footer.length?e("div",{staticClass:"profile-module__footer"},[t._t("footer")],2):t._e()])},fz=[],mz={props:{partHeader:{type:Boolean}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}}})},vz=mz,yz=(i("eccc"),Object(C["a"])(vz,gz,fz,!1,null,null,null)),Cz=yz.exports,bz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"trading-notifications-top-bar",style:{flexDirection:t.verticalButton?"column":"row"}},[e("div",{staticClass:"trading-notifications-top-bar__left",style:{flexDirection:t.verticalButton?"column":"row"}},[e("ButtonIconFlat",{attrs:{icon:t.iconButtonClose,modifier:t.classesButtonClose},on:{click:t.toggleVisibleRightBar}}),e("div",{directives:[{name:"show",rawName:"v-show",value:t.getRightSideBar||t.verticalButton,expression:"getRightSideBar || verticalButton"}],staticClass:"trading-notifications-top-bar__left-selectButtons",style:{flexDirection:t.verticalButton?"column":"row",marginTop:t.verticalButton?"0.4rem":"0"}},t._l(t.getCheckedTabs,(function(i,o){return e("ButtonIconFlat",{key:o,staticStyle:{position:"relative"},attrs:{icon:{name:i.icon},modifier:t.classesButtonTabs(i)},on:{click:function(e){return t.setTab("topBarBtns",i,o)},mouseenter:function(e){return t.showTooltip(e,i.tooltipText)},mouseleave:t.hideTooltip}},[i.notification?e("div",{class:"buttons-group-notistatus buttons-group-notistatus_".concat(t.getActiveTheme)}):t._e()])})),1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.getRightSideBar||t.verticalButton,expression:"getRightSideBar || verticalButton"}],staticClass:"trading-notifications-top-bar__right"},[e("div",{staticClass:"trading-notifications-top-bar__left-selectButtons",style:{flexDirection:t.verticalButton?"column":"row",marginTop:t.verticalButton?"0.4rem":"0"}},t._l(t.ownerBtns,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{icon:{name:i.icon},modifier:t.classesButtonTabs(i)},on:{click:function(e){return t.setTab("ownerBtns",i,o)},mouseenter:function(e){return t.showTooltip(e,i.tooltipText)},mouseleave:t.hideTooltip}},[i.notification?e("div",{class:"buttons-group-notistatus buttons-group-notistatus_".concat(t.getActiveTheme)}):t._e()])})),1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.tooltipText))])],1)},Sz=[],Pz=[{index:0,isActive:!0,icon:"Instrument-open-orders-colorblind",component:"OrdersRightBar",text:"tradingNotiTopBarBtns1",checked:!0,notification:!1,tooltipText:"Ордера"},{index:1,isActive:!1,icon:"ProwTop",component:"TrendTradingWidget",text:"tradingNotiTopBarBtns8",checked:!0,notification:!1,tooltipText:"Провайдеры"},{index:2,isActive:!1,icon:"Quotation",component:"Quotas",text:"",checked:!0,notification:!1,tooltipText:"Котировки"},{index:3,isActive:!1,icon:"Stream",component:"Stream",text:"tradingNotiTopBarBtns0",checked:!0,notification:!1,tooltipText:"Стримы"},{index:4,isActive:!1,icon:"Chat",component:"Chat",text:"tradingNotiTopBarBtns3",checked:!0,notification:!1,tooltipText:"5"},{index:5,isActive:!1,icon:"News",component:"NewsNotification",text:"tradingNotiTopBarBtns2",checked:!0,notification:!1,tooltipText:"Новости"},{index:6,isActive:!1,icon:"TV",text:"tradingNotiTopBarBtns5",component:"WidgetTV",checked:!0,notification:!1,tooltipText:"7"},{index:7,isActive:!1,icon:"Chat",component:"ChatWithProvider",checked:!0,notification:!1,tooltipText:"8"},{index:8,isActive:!1,icon:"MarketChat",component:"ChatByContract",checked:!0,notification:!1,tooltipText:"Чаты контактов"},{index:9,isActive:!1,icon:"Groups",component:"GroupTab",checked:!0,notification:!1,tooltipText:"Чат"},{index:10,isActive:!1,icon:"OrdersBook",component:"OrdersBook",text:"",checked:!0,notification:!1,tooltipText:"Стакан цен"}],Tz=[{index:0,isActive:!1,icon:"Messenger-Telegramm",component:"TelegramComponent",checked:!0,notification:!1,tooltipText:"Telegramm"},{index:1,isActive:!1,icon:"Messenger-Youtube",component:"YoutubeComponent",checked:!0,notification:!1,tooltipText:"Youtube"},{index:2,isActive:!1,icon:"OwnerChat",component:"Chat",text:"tradingNotiTopBarBtns1",checked:!1,notification:!1,tooltipText:"Чат"}],xz={name:"TradingNotificationsTopBar",mixins:[lW,Ot],props:{verticalButton:{type:Boolean,default:!1},profile:{type:Boolean},activeTabProfile:{type:String}},components:{ButtonIconFlat:Le},data:function(){return{tooltipText:"",ownerBtns:Tz,topBarBtns:Pz}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getRightSideBar:"userSettings/getRightSideBar",findPortfolio:"expertsPortfolio/findPortfolio"})),{},{getCurrentRoute:function(){var t;return null===(t=this.$route.meta)||void 0===t?void 0:t.componentName},mapTabsButtons:function(){var t=["Quotas","Stream"];return{Trading:["TrendTradingWidget","OrdersRightBar","OrdersBook"].concat(t,["NewsNotification"]),UserProfile:["TrendTradingWidget","Stream"],Investing:["TrendTradingWidget","Stream"]}},buttonsByTabProfile:function(){return this.mapTabsButtons[this.getCurrentRoute]},getCheckedTabs:function(){var t=this;return this.buttonsByTabProfile.map((function(e,i){var o=t.topBarBtns.find((function(t){return t.component===e}));return o.index=i,o.isActive=!1,0===i&&(o.isActive=!0),o}))},iconButtonClose:function(){return{name:"".concat(this.getRightSideBar?"Block-expand-right-close":"Block-expand-left-close")}},classesButtonClose:function(){return{class:["buttonFlat-icon",this.verticalButton?"trading-notifications-top-bar__showRightBarButton-vertical":"trading-notifications-top-bar__showRightBarButton","trading-notifications-top-bar__showRightBarButton_".concat(this.getActiveTheme)]}}}),watch:{buttonsByTabProfile:function(){"Trading"!==this.$route.meta.componentName&&this.getStatusUser&&this.setTab("topBarBtns",this.getCheckedTabs[0],!1)},findPortfolio:function(){"UserProfileTradingTab"!==this.activeTabProfile&&"Trading"!==this.$route.meta.componentName&&this.setTab("topBarBtns",this.getCheckedTabs[0],!1)}},methods:{classesButtonTabs:function(t){return this.verticalButton?{class:["buttonFlat-icon","trading-notifications-top-bar__groupButtonVertical","trading-notifications-top-bar__groupButtonVertical_".concat(this.getActiveTheme),t.isActive?"trading-notifications-top-bar__groupButtonVertical--active_".concat(this.getActiveTheme):""]}:{class:["buttonFlat-icon","trading-notifications-top-bar__groupButton","trading-notifications-top-bar__groupButton_".concat(this.getActiveTheme),t.isActive?"trading-notifications-top-bar__groupButton--active_".concat(this.getActiveTheme):""]}},setNotiForChat:function(t){"changed"===(null===t||void 0===t?void 0:t.msg)&&"stream-notify-user"===(null===t||void 0===t?void 0:t.collection)&&(this.ownerBtns[2].isActive||(this.ownerBtns[2].notification=!0))},disabledActiveStatus:function(){this.topBarBtns.forEach((function(t){t.isActive=!1})),this.ownerBtns.forEach((function(t){t.isActive=!1}))},setTab:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this[t].findIndex((function(t){return t.component===e.component}));this[t][o].notification=!1,this.disabledActiveStatus(),this[t][o].isActive=!0,this.$emit("setTab",{component:e.component}),!this.getRightSideBar&&this.verticalButton&&i&&this.toggleVisibleRightBar()},toggleVisibleRightBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"rightSidebar",key:"visible",data:!this.getRightSideBar})},emitActiveComponents:function(){this.$emit("activeComponents",this.getCheckedTabs)},showTooltip:function(t,e){this.tooltipText=e,this.viewTooltip(t)}},mounted:function(){this.emitActiveComponents(),"Trading"===this.$route.meta.componentName&&this.setTab("topBarBtns",this.getCheckedTabs[0],!1,2),this.$socketStream.$on("chatWS",this.setNotiForChat)},destroyed:function(){this.$socketStream.$off("chatWS",this.setNotiForChat)}},Oz=xz,wz=(i("6160"),Object(C["a"])(Oz,bz,Sz,!1,null,null,null)),_z=wz.exports,Az=function(){var t=this,e=t._self._c;return e("div",{staticClass:"test"},[e("div",{staticClass:"cnt-svgIcn setting-in-news-bar",on:{click:function(e){return t.viewModal()}}},[e("svgIcon",{attrs:{name:"Settings",viewBox:"0 0 24 24"}})],1),t.modalVisible?e("div",{staticClass:"modal-to-bar-news"},[e("div",{staticClass:"text-in-modal-news-var"},[t._v(t._s(t.$t("newsNoti0")))]),e("DxDateBox",{attrs:{"display-format":"EEEE, MMM dd",lang:"ru"},model:{value:t.from,callback:function(e){t.from=e},expression:"from"}}),e("div",{staticClass:"text-in-modal-news-var"},[t._v(t._s(t.$t("newsNoti1")))]),e("DxDateBox",{attrs:{"display-format":"EEEE, MMM dd",lang:"ru"},model:{value:t.to,callback:function(e){t.to=e},expression:"to"}}),e("div",{staticClass:"sort-un-modal"},[e("div",{staticClass:"text-in-modal-news-var"},[t._v(t._s(t.$t("newsNoti2")))]),e("input",{staticClass:"checkBox-for-sort",attrs:{type:"checkbox",name:""},domProps:{checked:t.sorted},on:{click:function(e){return t.sortedNews()}}})])],1):t._e(),e("div",{staticClass:"news-container-bar"},t._l(t.newsCurrentSymbol,(function(i,o){return e("div",{staticClass:"news-in-bar"},[e("div",{staticClass:"news-in-bar-title"},[t._v(t._s(i.eventName))]),e("div",{staticClass:"cnt-for-add-to-chart"},[e("div",{staticClass:"news-in-bar-date"},[t._v(t._s(t.getFormatDate(i.releaseDT)))]),e("button",{staticClass:"button-to-add-chart",class:t.getItem(i),on:{click:function(e){return t.changeNewsOnChart(i)}}},[t._v("+")])]),e("div",{staticClass:"news-in-bar-line",class:i.importance}),e("div",{staticClass:"news-in-bar-params"},[e("div",{staticClass:"bar-params"},[e("div",{staticClass:"text-in-params-title"},[t._v(t._s(t.$t("newsNoti3"))+":")]),e("div",{staticClass:"bar-params-prev"},[t._v(t._s(i.previousValue||"—")+" ")])]),e("div",{staticClass:"bar-params"},[e("div",{staticClass:"text-in-params-title"},[t._v(t._s(t.$t("newsNoti4"))+":")]),e("div",{staticClass:"bar-params-current"},[t._v(t._s(i.actualValue||"—"))])]),e("div",{staticClass:"bar-params"},[e("div",{staticClass:"text-in-params-title"},[t._v(t._s(t.$t("newsNoti5"))+": ")]),e("div",{staticClass:"bar-params-next"},[t._v(t._s(i.forecastValue||"—"))])])])])})),0)])},Dz=[],kz=i("e96d"),Iz=i.n(kz),Bz={created:function(){Object(qH["b"])(GH),Object(qH["c"])("ru")},components:{svgIcon:L,DxDateBox:Iz.a},mounted:function(){this.getNews(),this.getTimeFrame()},watch:{symbol:function(){this.symbol&&this.allNews&&(this.getFormatedNews(this.allNews),this.arrNewsOnChart=[],this.modalVisible=!1,this.sorted=!1)},from:function(t){this.getNews(t,this.to)},to:function(t){this.getNews(this.from,t)},arrNewsOnChart:function(){}},computed:Object(c["a"])({},Object(p["c"])({apiUri:"api/api"})),props:{symbol:{type:String}},data:function(){return{allNews:void 0,newsCurrentSymbol:[],from:new Date,to:new Date,modalVisible:!1,arrNewsOnChart:[]}},methods:{viewModal:function(){this.modalVisible=!this.modalVisible},getFormatDate:function(t){return new Date(t).toLocaleString("ru",{year:"numeric",month:"long",day:"numeric"})},getTimeFrame:function(){this.timeFrame=60},getNews:function(t,e){var i=this;this.getTimeFrame(),this.sorted=!1;var o={currentDay:!t&&!e};t&&(o.from=t),e&&(o.to=e),this.$http.post(this.apiUri+"kb/GetCalendar",JSON.stringify(o),{headers:{"Content-Type":"application/json"}}).then((function(t){i.allNews=t.data,i.getFormatedNews(t.data)}))},getItem:function(t){if(this.arrNewsOnChart.length)return this.arrNewsOnChart.find((function(e){return e.id===t.id}))?"active":void 0},changeNewsOnChart:function(t){if(this.getTimeFrame(),!this.arrNewsOnChart.length)return this.arrNewsOnChart.push(t),void this.getGroupeddNews(this.arrNewsOnChart);if(this.arrNewsOnChart.find((function(e){return e.id===t.id}))){if(this.arrNewsOnChart=this.arrNewsOnChart.reduce((function(e,i){return i.id!==t.id&&e.push(i),e}),[]),!this.arrNewsOnChart.length)return void this.getGroupeddNews(this.allNews);this.getGroupeddNews(this.arrNewsOnChart)}else this.arrNewsOnChart.push(t),this.getGroupeddNews(this.arrNewsOnChart)},sortedNews:function(){if(!this.newsCurrentSymbol)return!0;if(this.sorted=!this.sorted,this.sorted){var t=this.newsCurrentSymbol.reduce((function(t,e){return"high"===e.importance&&t.push(e),t}),[]),e=this.newsCurrentSymbol.reduce((function(t,e){return"medium"===e.importance&&t.push(e),t}),[]),i=this.newsCurrentSymbol.reduce((function(t,e){return"low"===e.importance&&t.push(e),t}),[]);this.newsCurrentSymbol=[].concat(Object(x["a"])(t),Object(x["a"])(e),Object(x["a"])(i))}else this.getNews()},getGroupeddNews:function(t){var e=this;if(t&&Array.isArray(t)){var i=t.reduce((function(i,o){var n={timeFrameCandle:Mz(new Date(o.releaseDate),e.timeFrame).getTimeWithoutUTC(),news:[]};return t.forEach((function(t){var i=Mz(new Date(t.releaseDate),e.timeFrame).getTimeWithoutUTC();i===n.timeFrameCandle&&e.symbol.indexOf(t.currencyCode)>=0&&n.news.push(t)})),!i.find((function(t){return t.timeFrameCandle===n.timeFrameCandle}))&&n.news.length&&i.push(n),i}),[]);this._d=i}},getFormatedNews:function(t){var e=this,i=[];t.forEach((function(t){e.symbol.indexOf(t.currencyCode)>=0&&i.push(t)})),this.newsCurrentSymbol=i}}};function Mz(t,e){var i=new Date(t);return 1440===e?new Date(i.getFullYear(),i.getMonth(),i.getDate()):e>=60?new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(i.getHours()/(e/60))*(e/60)):e<60?new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),Math.floor(i.getMinutes()/e)*e):void 0}var $z=Bz,Lz=(i("641b"),Object(C["a"])($z,Az,Dz,!1,null,null,null)),Fz=Lz.exports,jz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widget-provider",class:t.darkClass},[e("div",{ref:"topMenu",staticClass:"topMenu"},[e("DxSelectBox",{attrs:{width:"102",height:"32",placeholder:t.activeExpertsCounts.toString(),value:t.currencyPair,items:t.getUserQuotesLibrary,elementAttr:{class:"selectWidgetProvider currencySelect"}},on:{"value-changed":t.changeCurrentQuotes}}),e("DxSelectBox",{attrs:{width:"62",height:"32",placeholder:t.activeExpertsCounts.toString(),value:t.activeExpertsCounts,items:t.arrCounts,elementAttr:{class:"selectWidgetProvider"}},on:{"value-changed":t.onClickListItemExpertCount}}),e("Button-icon",{staticClass:"customButton buttonSettings",attrs:{isActive:t.modalEditExperts,iconName:"Settings",modifier:"flat square"},on:{toggle:t.openEditExpertModal}}),e("Button-icon",{staticClass:"customButton buttonAdd",attrs:{iconName:"AddProvider",modifier:"flat square"},on:{toggle:t.openAddExpertModal}})],1),e("div",{style:t.styleForContainerWidget},t._l(t.getVisibleProviders,(function(i,o){return e("ProviderItem",{key:o,attrs:{provider:i,contract:t.contract,usingTools:t.usingTools},on:{readyTrend:t.setTrend}})})),1),e("ModalEditExperts",{attrs:{isOpen:t.modalEditExperts,listProviders:t.getRedactList},on:{close:t.closeEditExpertModal,addProvider:t.openAddExpertModal,saveRedactList:t.saveRedactList,changeCheck:function(e){return t.onChangeSelectedExperts(e)},resetList:function(e){return t.resetList(e)}}}),e("ModalAddExperts",{attrs:{isOpen:t.modalAddExperts,modalEditExperts:t.modalEditExperts,listProviders:t.getAddList},on:{close:t.closeAddExpertModal,checkExpert:function(e){return t.onChangeAddProviderList(e)},addProviders:t.addProviders,resetList:function(e){return t.resetList(e)}}}),e("Modal-filter",{attrs:{isOpen:t.getFilterModal.status},on:{close:t.toggleModalFilter,acceptFilter:function(e){return t.setFilter(e)}}})],1)},Rz=[],Wz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profile-widget",class:{"profile-widget--isOpen":t.isExpand}},[e("div",{staticClass:"profile-widget__header"},[e("div",{staticClass:"buttons-group buttons-group--flat buttons-group--bar profile-widget__bar"},[t._t("header-left"),t.title?e("Label-bar",{attrs:{modifier:"flat"}},[t._v(" "+t._s(t.title)+" ")]):t._e(),t._t("header-right"),e("Button-icon",{attrs:{modifier:"flat square",iconName:t.iconName},on:{toggle:t.onToggle}})],2)]),e("transition",{attrs:{name:"widget-slideUpDown"}},[e("div",[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isExpand,expression:"isExpand"}],staticClass:"profile-widget__body"},[t._t("body")],2),t.$slots.footer&&t.isExpand?e("div",{staticClass:"profile-widget__footer"},[t._t("footer")],2):t._e()])])],1)},Nz=[],Ez={components:{ButtonIcon:Nt,LabelBar:Ce,svgIcon:L,GroupButtons:pe},props:{expand:{type:Boolean,default:!1},title:{type:String,Default:"Widget name"}},computed:{isExpand:function(){return this.expand},iconName:function(){return this.isExpand?"Arrow-expand-top":"Arrow-expand-bottom"}},methods:{onToggle:function(){this.$emit("toggleWidget")}}},Uz=Ez,Vz=(i("32e4"),Object(C["a"])(Uz,Wz,Nz,!1,null,null,null)),Hz=Vz.exports,Gz=function(){var t=this,e=t._self._c;return t.showComponent?e("div",{staticClass:"widgetProvider",class:Object(c["a"])({"widget-provider-item--short":t.shortMode},t.darkClass)},[e("h3",{staticClass:"widgetProvider-userInfo"},[t._v(t._s(t.provider.userInfo.firstName+" "+t.provider.userInfo.lastName))]),e("div",{staticClass:"widgetProvider-widgetContent widgetContent"},[e("User",{staticClass:"widgetContent-avatarProvider",attrs:{ava:t.provider.userInfo.avatarURL,online:"",favorites:"on",data:t.getUserData,star:!1}}),e("div",{staticClass:"widgetContent-avatarBroker"},[e("Avatar",{attrs:{src:t.getBrokerImage,size:"1.6"}})],1),e("div",{staticClass:"widgetContent-typeAccount"},[t._v(t._s(t.provider.accountGroup)),e("span",[t._v(t._s(t.provider.sequenceId))])]),e("div",{staticClass:"widgetContent-cellOrBy",class:t.classGetTrend(t.getTrend)},[e("svgIcon",{attrs:{name:t.iconGetTradeName(t.getTrend),size:16}}),t._v(t._s(t.getTrend&&t.getTrend.data))],1),e("div",{staticClass:"widgetContent-sumInfo"},[e("div",{staticClass:"widgetContent-sumInfo__priceAndPercent"},[e("div",{staticClass:"price"},[t._v("$ "+t._s(t.provider.monthPrice||0))]),e("svgIcon",{attrs:{name:"line",size:16,color:"#B2B2B2"}}),e("div",{staticClass:"percent"},[t._v("% "+t._s(t.provider.profitPercent||0))])],1),e("div",{staticClass:"widgetContent-sumInfo__money"},[t._v("$ "+t._s(t.getEquity))])]),e("div",{staticClass:"widgetContent-circleDiagram"},[t.statProvider.length?e("Circle-progress",{attrs:{progress:t.profitOrders,size:"36"}}):t._e()],1),e("div",{staticClass:"widgetContent-buttonBlock"},[e("span",{staticClass:"svgContainer"},[e("svgIcon",{attrs:{name:"Favorite-off",color:t.getIconData().color}})],1),e("ButtonIconFlat",{staticClass:"buttonSettings",attrs:{icon:t.getIconData(t.iconName)},on:{toggle:t.toggleFollowModal}})],1)],1),e("div",{staticClass:"widgetProvider-chart"},[e("SimpleChart",{attrs:{points:t.getPoint.point,data:t.getPoint.data,fixedWidth:360,fixedHeight:40,color:t.getEquity>0?"#90F2BF":"#FF9696",zeroGradient:t.getEquity>0?"#c6ffe6":"#fcc1c1",firstGradient:t.getEquity>0?"#c6ffe6":"#fcc1c1"}})],1)]):t._e()},qz=[],zz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"circle-progress",class:t.getActiveTheme,style:"width:"+t.width+"px;"},[e("svg",{staticClass:"circle-progress__circle",attrs:{width:t.size,height:t.size}},[e("circle",{staticClass:"circle-progress__bg",attrs:{cx:t.size/2,cy:t.size/2,r:t.size/2-t.stroke,"stroke-width":t.stroke}}),e("circle",{directives:[{name:"show",rawName:"v-show",value:t.progress>0,expression:"progress > 0"}],staticClass:"circle-progress__progress",attrs:{cx:t.size/2,cy:t.size/2,r:t.size/2-t.stroke,"stroke-dasharray":t.computedProgress,"stroke-linecap":"round","stroke-dashoffset":"0","stroke-width":t.stroke}})]),e("div",{staticClass:"circle-progress__text",attrs:{title:t.progressValue+" усп. сделок",id:"circle-progress__text"}},[t._v(t._s(t.progressValue))])])},Yz=[],Xz={name:"CircleProgress",components:{svgIcon:L},data:function(){return{width:this.size,height:this.size,progressValue:"1 %"}},props:{progress:{default:0},size:{default:"34"},stroke:{type:[String,Number],default:2}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{styleSize:function(){return"width: ".concat(this.width,"rem; height: ").concat(this.height,"rem;")},computedProgress:function(){var t=2*Math.PI*(+this.size/2),e=+this.progress*t/100,i=t-e;return+this.progress>0?"".concat(e," ").concat(i):0===+this.progress?"0 ".concat(t):""}}),methods:{progressText:function(){var t=this,e=1,i=setInterval((function(){e<+t.progress?(t.progressValue=e.toString()+"%",e+=1):clearInterval(i)}),50)}},mounted:function(){this.progressText()}},Qz=Xz,Jz=(i("d49c"),Object(C["a"])(Qz,zz,Yz,!1,null,null,null)),Kz=Jz.exports,Zz=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widget-provider-info"},[e("div",{staticClass:"widget-provider-info__header"},[t.getActiveBroker.length?e("Broker",{attrs:{name:t.getActiveBroker[0].name,ava:t.sampleAva}}):t._e(),e("Button",{attrs:{typeBtn:"secondary"}},[t._v(t._s(t.$t("detalizedWord")))])],1),e("div",{staticClass:"widget-provider-info__chart"},[e("Widget-chart-card",{attrs:{val1:t.getEquity,val2:t.getPercentEquity,title:t.$t("totalIncomeWord"),point:t.getPointForChart.point,data:t.getPointForChart.data}})],1),t.getWigdgetProfitArr.length?e("div",{staticClass:"widget-provider-info__body"},t._l(t.getWigdgetProfitArr,(function(t,i){return e("Widget-profit-row",{key:i,attrs:{val:t.value,title:t.title,arrow:t.arrow,sign:t.sign}})})),1):t._e()])},tY=[],eY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"buttons-group buttons-action",class:"buttons-action--".concat(t.color)},[t.trigger?e("div",{staticClass:"hidden-hd"},[e("Button-icon",{attrs:{modifier:"flat square group",iconName:"Change"}})],1):t._e(),e("Button",{attrs:{typeBtn:"secondary",modifier:"group"}},[t._t("default")],2),e("Button-icon",{attrs:{modifier:"flat square group",iconName:"Info"}})],1)},iY=[],oY={components:{Button:Pa,ButtonIcon:Nt},props:{color:{type:String,required:!1,default:"red"},trigger:{type:Boolean}}},nY=oY,sY=(i("a2ad"),Object(C["a"])(nY,eY,iY,!1,null,null,null)),rY=sY.exports,aY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widget-chart-card"},[e("div",{staticStyle:{display:"flex","justify-content":"start",width:"100%","align-items":"center","padding-right":"10px"}},[e("div",{staticClass:"widget-chart-card__title"},[t._v(t._s(t.title))]),e("div",{staticClass:"widget-chart-card__values",staticStyle:{display:"flex","align-items":"center","margin-left":"auto"}},[t.val1?e("div",{staticClass:"widget-chart-card__val widget-chart-card__val--val1",class:{"widget-chart-card__val--decrease":t.getStyleDecrease(t.val1)}},[e("svgIcon",{attrs:{name:t.getStyleDecrease(t.val1)?"Arrow-score-decrease":"Arrow-score-increase"}}),t._v(t._s(t.getVal1))],1):t._e(),t.val2?e("div",{staticClass:"widget-chart-card__val",class:{"widget-chart-card__val--decrease":t.getStyleDecrease(t.val2)}},[t._v(t._s(t.getVal2))]):t._e(),t.val3?e("div",{staticClass:"widget-chart-card__val",class:{"widget-chart-card__val--decrease":t.getStyleDecrease(t.val3)}},[t._v(t._s(t.getVal3))]):t._e()])]),e("div",{staticClass:"widget-chart-card__chart"},[e("div",{staticClass:"widget-chart-card__chart-wrapper"},[e("simpleChart",{attrs:{fixedWidth:335,fixedHeight:90,points:t.point,data:t.data,margin:{top:3,right:3,bottom:3,left:3},smooth:t.smooth,color:t.val1>0?"#00AD88":"#DA0000",zeroGradient:t.val1>0?"#EBFFF3":"#FFF2F2",firstGradient:t.val1>0?"#90F2BF":"#fcc1c1"}})],1)])])},cY=[],lY={components:{svgIcon:L,simpleChart:BT},props:{title:{default:""},sign:{default:"$"},val1:{default:0},val2:{default:0},val3:{default:0},point:{default:[]},data:{default:[]},smooth:{default:!0}},computed:{getVal1:function(){return"".concat(this.sign," ").concat(this.val1)},getVal2:function(){return"".concat(this.val2," %")},getVal3:function(){return"".concat(this.val3," pip")}},methods:{getStyleDecrease:function(t){return+t<0}}},uY=lY,dY=(i("b91a"),Object(C["a"])(uY,aY,cY,!1,null,null,null)),hY=dY.exports,pY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widget-profit-row"},[e("div",{staticClass:"widget-profit-row__icon"},[e("svgIcon",{attrs:{name:"Info"}})],1),e("div",{staticClass:"widget-profit-row__title"},[t._v(t._s(t.title))]),e("div",{staticClass:"widget-profit-row__val",class:t.arrow?t.getStyleDecrease(t.val):""},[t.arrow?e("svgIcon",{attrs:{name:t.getTypeValue(t.val)?"Arrow-score-decrease":"Arrow-score-increase"}}):t._e(),e("span",[t._v(t._s(t.getVal))])],1)])},gY=[],fY={components:{svgIcon:L},props:{title:{type:String},val:{default:0},sign:{default:"%"},arrow:{default:!0},tooltip:{type:String,default:"text"}},computed:{getValue:function(){return String(this.val).replace(/(\d)(?=(\d{3})+$)/g,"$1,")},getVal:function(){return"".concat(this.sign," ").concat(this.getValue)}},methods:{getStyleDecrease:function(t){return+t<0?"widget-profit-row__val--decrease":"widget-profit-row__val--increase"},getTypeValue:function(t){return+t<0}}},mY=fY,vY=(i("67a2"),Object(C["a"])(mY,pY,gY,!1,null,null,null)),yY=vY.exports,CY=function(){function t(){Object(Qh["a"])(this,t),this.locale="ru",this.statistic=null,this.statisticByContract=null,this.weekdays={ru:["ВС","ПН","ВТ","СР","ЧТ","ПТ","СБ"]}}return Object(Jh["a"])(t,[{key:"storeStat",value:function(t){this.statistic=t}},{key:"storeStatByContract",value:function(t){this.statisticByContract=t}},{key:"getStat",value:function(){return this.statistic}},{key:"getStatByContract",value:function(){return this.statisticByContract}},{key:"getStatByYears",value:function(t){if(!t.length)return[];var e=[];e.push({year:new Date(t[0].date).getFullYear(),date:t[0].date,equityOpen:this.getStartDeposit(),profitAbs:SY(this.getStartDeposit(),t[0].equityClose).profitAbs,profitRel:SY(this.getStartDeposit(),t[0].equityClose).profitRel});for(var i=1;i=0?(e[s].balanceClose=t[n].balanceClose,e[s].equityClose=t[n].equityClose,e[s].profitAbs=SY(e[s].equityOpen,e[s].equityClose).profitAbs,e[s].profitRel=SY(e[s].equityOpen,e[s].equityClose).profitRel,e[s].procPosOrders=t[n].procPosOrders,e[s].pClosedCount=t[n].pClosedCount):e.push({date:t[n].date,month:new Date(t[n].date).getMonth(),balanceOpen:t[n-1].balanceClose,balanceClose:t[n].balanceClose,equityOpen:t[n].equityOpen,equityClose:t[n].equityClose,profitAbs:SY(t[n].equityOpen,t[n].equityClose).profitAbs,profitRel:SY(t[n].equityOpen,t[n].equityClose).profitRel,procPosOrders:t[n].procPosOrders,pClosedCount:t[n].pClosedCount,forecastForDay:PY(new Date(t[n].date).daysInMonth(),o,i,t[n].equityOpen)})},s=1;s2?this.providerStat[this.providerStat.length-1].equity.toFixed(2):this.providerStat[0].equity.toFixed(2)},getStatByYear:function(){if(this.providerStat.length)return TY.storeStatByContract(this.providerStat),TY.getYearsStatByContracts()},getMonthCount:function(){if(this.getStatByYear)return this.getStatByYear.reduce((function(t,e){return t+e.monthes.length}),0)},getAverYearProfit:function(){if(this.getStatByYear)return this.getStatByYear.reduce((function(t,e){return t+e.profitAbs}),0)/this.getStatByYear.length},getAverMonthProfit:function(){if(this.getStatByYear){var t=this.getStatByYear.reduce((function(t,e){return t+e.monthes.reduce((function(t,e){return t+e.profitAbs}),0)}),0);return(t/this.getMonthCount).toFixed(2)}},getProfitMonthesPercent:function(){if(this.getStatByYear){var t=0;return this.getStatByYear.forEach((function(e){e.monthes.forEach((function(e){e.profitAbs>0&&t++}))})),Math.ceil(100/(this.getMonthCount/t))}},getPercentEquity:function(){if(this.getEquity&&null!==this.dailyData)return(100/(this.dailyData.equityClose/this.getEquity)).toFixed(2)},getWigdgetProfitArr:function(){return this.providerStat.length&&null!==this.dailyData?[{id:0,title:ya("widgetProfitInfoArr0",ma),value:this.providerStat.length,arrow:!1,sign:"д."},{id:1,title:ya("widgetProfitInfoArr1",ma),value:this.providerStat.reduce((function(t,e){return t+e.closeOrders}),0),arrow:!1,sign:""},{id:2,title:ya("widgetProfitInfoArr2",ma),value:this.providerStat.reduce((function(t,e){return t+e.closeSuccessOrders}),0),arrow:!1,sign:""},{id:3,title:ya("widgetProfitInfoArr3",ma),value:this.getEquity,arrow:!0,sign:"$"},{id:4,title:ya("widgetProfitInfoArr4",ma),value:Math.max.apply(null,this.providerStat.map((function(t){return t.equity}))),arrow:!0,sign:"$"},{id:5,title:ya("widgetProfitInfoArr5",ma),value:this.getAverYearProfit,arrow:!0,sign:"$"},{id:6,title:ya("widgetProfitInfoArr6",ma),value:this.getAverMonthProfit,arrow:!0,sign:"$"},{id:7,title:ya("widgetProfitInfoArr7",ma),value:this.getProfitMonthesPercent}]:[]}}),methods:{update:function(){this.widgetProfitRows.forEach((function(t){t.title=ya("widgetProfitInfoRows"+t.index,ma)})),this.getWigdgetProfitArr.forEach((function(t){t.title=ya("widgetProfitInfoArr"+t.id,ma)}))}},mounted:function(){var t=this;this.update(),pa.$on("changeLanguageCode",(function(){t.update(),t.$forceUpdate()}))},destroyed:function(){var t=this;pa.$off("changeLanguageCode",(function(){t.update(),t.$forceUpdate()}))}},OY=xY,wY=(i("6c4a"),Object(C["a"])(OY,Zz,tY,!1,null,null,null)),_Y=wY.exports,AY={name:"ProviderItem",components:{User:hd,CircleProgress:Kz,Rating:Fu,ButtonIcon:Nt,svgIcon:L,WidgetProviderInfo:_Y,SimpleChart:BT,Avatar:E},props:{shortMode:{type:Boolean,default:!1},investingMode:{type:Boolean},modalEvent:{type:String},provider:{type:Object},contract:{default:"EURUSD.a"},usingTools:{default:null}},data:function(){return{showComponent:!0,open:!1,isFollow:!1,profitOrders:0,statProvider:[],dataDaily:null,showIconFollow:!0,pointForChart:{point:[],data:[]}}},watch:{modalEvent:function(){var t=this;this.showComponent=!1,this.$nextTick((function(){t.showComponent=!0}))},usingTools:function(){this.getPigForProvider()},provider:function(){this.getPigForProvider(),this.setIconFollow()},contract:function(){this.open=!1},getContract:function(){this.setIconFollow()},getProfileAccount:function(){this.setIconFollow()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getListingAccount:"subscribeOrders/getListingAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getProviderSubscribePay:"subscribeOrders/getProviderSubscribePay",getApiUri:"api/api",getSession:"auth/getSession",getUserDetail:"user/getUserDetail",getBrokers:"brokers/getBrokers",getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getColorIcon:function(){return"dark"===this.getActiveTheme?"#8FA8C1":"#8C8C8C"},isSubscriptionsExist:function(){return this.getProviderSubscribePay.includes(this.provider.accountId)},getIconData:function(){var t=this;return function(e){return{name:t.isSubscriptionsExist?"Settings":e,color:t.getColorIcon}}},classGetTrend:function(){return function(t){return{red:"Sell"===(null===t||void 0===t?void 0:t.data)}}},getBrokerImage:function(){var t=this,e=this.getBrokers.find((function(e){return e.id===t.provider.brokerId})),o=e&&e.logo?"data:image/jpeg;base64,".concat(e.logo):i("700b");return o},getPoint:function(){return this.pointForChart},getUsingContracts:function(){var t=this;if(this.usingTools)return this.usingTools.find((function(e){return e.accountId===t.provider.accountId}))},getContract:function(){var t=this;if(this.getUsingContracts&&this.getContracts){var e=this.getUsingContracts.allContracts.find((function(e){return e===t.contract}));if(e)return e;var i,o=this.getContracts.filter((function(e){return e.sourceSymbol===t.contract}));return o.forEach((function(e){i=t.getUsingContracts.allContracts.find((function(t){return t===e.name}))})),i}},getIconFollow:function(){return this.isFollow?"Settings":"Add"},getEquity:function(){return this.statProvider.length?this.statProvider.length>2?this.statProvider[this.statProvider.length-1].equity.toFixed(2):this.statProvider[0].equity.toFixed(2):0},getUserData:function(){return{login:this.provider.accountId,userId:this.provider.userInfo.id}},getTrend:function(){if(this.statProvider.length)return{status:!0,data:this.statProvider[this.statProvider.length-1].operationTrend}},iconName:function(){return this.isFollow?"Settings":"Copy"},iconGetTradeName:function(){return function(t){return"Sell"===(null===t||void 0===t?void 0:t.data)?"Arrow-nano-bottom":"Arrow-nano-top"}}}),methods:{toggleFollowModal:function(){this.isSubscriptionsExist},getPointForChart:function(){this.statProvider?this.pointForChart={point:this.statProvider.map((function(t){return t.equity})),data:this.statProvider.map((function(t){return t.date}))}:this.pointForChart={point:[],data:[]}},setIconFollow:function(){var t=this,e=this.haveSubscribe(this.provider.accountId);this.isFollow=!!e,this.showIconFollow=!1,this.$nextTick((function(){t.showIconFollow=!0}))},haveSubscribe:function(t){var e=this;if(this.getProfileAccount.length&&this.getContract){var i,o=this.getProfileAccount.find((function(t){return t.id===(e.getListingAccount?e.getListingAccount.id:e.getDefaultAccount.id)}));return o&&null!==o.subscriptions&&(i=o.subscriptions.find((function(i){return t===i.sourceAccountId&&i.contract===e.getContract}))),i}},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setDataProvider(e)}},setDataProvider:function(t){t&&Array.isArray(t.data)&&t.data.length&&null!==t.dailyData&&t.dailyData.accountId===this.provider.accountId&&(this.statProvider=t.data,this.dataDaily=t.dailyData,this.getDataProvider(),this.getPointForChart())},getDataProvider:function(){var t=this.statProvider.reduce((function(t,e){return t+e.closeOrders}),0),e=this.statProvider.reduce((function(t,e){return t+e.closeSuccessOrders}),0);this.profitOrders=t&&e?Math.ceil(100/(t/e)):0},getPigForProvider:function(){if(this.getContract){var t={command:"ContractStatisticsByAccount",data:{AccountId:this.provider.accountId,contracts:[this.getContract]},method:"get"};this.$socketStream.sendCommand({ws:"apiWS3",command:t})}},onClick:function(){this.open=!this.open},show:function(){this.open=!0},hide:function(){this.open=!1}},mounted:function(){this.getPigForProvider(),this.getProfileAccount.length&&this.setIconFollow(),this.$socketStream.$on("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},DY=AY,kY=(i("14fb"),Object(C["a"])(DY,Gz,qz,!1,null,"ccecb7b2",null)),IY=kY.exports,BY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown",class:{"dropdown--open":t.isOpenDropdown}},[e("div",{ref:"trigger",staticClass:"dropdown__trigger",style:{width:t.triggerWidth},on:{click:t.toggle}},[t._t("trigger")],2),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isOpenDropdown,expression:"isOpenDropdown"}],staticClass:"dropdown__content",class:{"dropdown__content--open":t.isOpen},style:{top:t.offsetTop,left:t.offsetRight}},[t._t("content")],2)])},MY=[],$Y={data:function(){return{open:this.isOpen,height:""}},props:{isOpen:{type:Boolean,default:!1},width:{type:String,required:!1},top:{type:String,required:!1,default:""},right:{type:String,required:!1,default:""}},watch:{isOpen:function(t){this.open=t}},computed:{offsetTop:function(){return this.top?this.top:"".concat(this.height+4,"px")},offsetRight:function(){if(this.right)return this.right},triggerWidth:function(){return"".concat(this.width,"px")},isOpenDropdown:function(){return this.isOpen}},methods:{toggle:function(){this.open=!this.open,this.triggerClass()},triggerClass:function(){this.isOpen?this.$refs.trigger.childNodes[0].classList.add("button-label--active"):this.$refs.trigger.childNodes[0].classList.remove("button-label--active")}},mounted:function(){this.height=this.$refs.trigger.offsetHeight}},LY=$Y,FY=(i("15d7"),Object(C["a"])(LY,BY,MY,!1,null,null,null)),jY=FY.exports,RY=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"expertPopup",attrs:{visible:t.isOpen,width:420,height:"auto","drag-enabled":!1,"title-template":"header","content-template":"content",wrapperAttr:{class:"AddExpertPopup"}},on:{hidden:t.close},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"headerAddExperts"},[t.modalEditExperts?e("Button-icon",{staticClass:"buttonBackAddExperts",attrs:{iconName:"Arrow-move-left",modifier:"flat"},on:{toggle:t.close}}):t._e(),e("span",{staticClass:"titleAddExperts"},[t._v(t._s(t.titleAddExperts))]),e("Button-icon",{staticClass:"buttonCloseAddExperts",attrs:{iconName:"Close",modifier:"flat"},on:{toggle:t.closeModal}})],1)]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"wrapContentAddExperts"},[e("div",{staticClass:"inputBlockAddExperts"},[e("Input-search",{model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),e("DxScrollView",{key:t.currentPage+t.search,attrs:{height:"50vh"}},t._l(t.getExpertsPerPage,(function(i){return e("List-item",{key:i.id},[e("ProviderItem",{attrs:{provider:i,shortMode:!0,two:""},on:{change:function(e){return t.changeList(i)}}})],1)})),1),e("div",{staticClass:"footerAddExperts"},[e("div",{staticClass:"paginationAddExperts"},[e("Provider-pagination",{attrs:{pages:t.getCountPages,current:t.currentPage},on:{currentPage:function(e){return t.changePage(e)}}})],1),e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:function(e){return t.resetList("add")}}},[t._v(t._s(t.$t("resetWord")))]),e("Button",{attrs:{typeBtn:"primary"},on:{click:t.addProviders}},[t._v(t._s(t.$t("save")))])],1)])],1)]},proxy:!0}])})},WY=[],NY=i("5a1f"),EY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"provider-item"},[e("div",{staticClass:"provider-item__body"},[e("div",{staticClass:"provider-item__checkbox"},[(t.two,e("Checkbox",{attrs:{checked:t.provider.checked,name:"selExperts[]"},on:{change:t.onChange}}))],1),e("div",{staticClass:"provider-item__profile"},[e("User",{attrs:{ava:t.provider.userInfo.avatarURL,online:"",favorites:"on",name:t.provider.userInfo.firstName+" "+t.provider.userInfo.lastName,data:t.getUserData}})],1),e("div",{staticClass:"provider-item__datas"},[e("div",{staticClass:"provider-item__progress"},[e("Circle-progress",{attrs:{progress:"97",size:"32"}})],1),e("div",{staticClass:"provider-item__info info"},[e("div",{staticClass:"info__pair"},[t._v(t._s(t.provider.contract))]),e("div",{staticClass:"info__value info__value--up"},[e("div",{staticClass:"info__icon"},[e("svgIcon",{attrs:{name:"Arrow-nano-top"}})],1),e("div",{staticClass:"info__text"},[t._v("1.34567")])])]),e("div",{staticClass:"provider-item__chart-bg"},[e("svg",{attrs:{width:"70",height:"29",viewBox:"0 0 70 29",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("g",{attrs:{filter:"url(#filter0_i)"}},[e("path",{attrs:{d:"M0 18.7439V29H70V0L66.9118 3.18293L62.7941 9.54878L61.9706 11.3171L60.7353 9.19512L59.5 14.5L57.0294 7.07317L56 11.3171L54.1471 9.19512L51.8824 20.5122L50.2353 18.7439L49.4118 20.5122L48.5882 18.7439L46.5294 20.8659L40.1471 10.9634L39.3235 13.439L36.4412 10.9634L35.2059 14.5L33.3529 12.378L31.5 17.6829L29.4412 16.9756L28 22.2805L25.1176 17.6829L24.5 19.4512L21.8235 16.9756L20.7941 18.7439L19.5588 16.9756L16.0588 22.9878L14.6176 20.5122L13.5882 24.7561L6.58824 17.6829L5.14706 18.7439L4.11765 17.6829L2.26471 20.1585L0 18.7439Z",fill:"#EBFFF3"}})]),e("defs",[e("filter",{attrs:{id:"filter0_i",x:"0",y:"0",width:"70",height:"29",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB"}},[e("feFlood",{attrs:{"flood-opacity":"0",result:"BackgroundImageFix"}}),e("feBlend",{attrs:{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}}),e("feColorMatrix",{attrs:{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}}),e("feOffset",{attrs:{dy:"1"}}),e("feComposite",{attrs:{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}}),e("feColorMatrix",{attrs:{type:"matrix",values:"0 0 0 0 0.592157 0 0 0 0 1 0 0 0 0 0.827451 0 0 0 1 0"}}),e("feBlend",{attrs:{mode:"normal",in2:"shape",result:"effect1_innerShadow"}})],1)])])])])])])},UY=[],VY={components:{Avatar:E,Toggle:qo,svgIcon:L,Rating:Fu,CircleProgress:Kz,User:hd,Checkbox:Ya},props:{provider:{type:Object},two:{type:Boolean}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserDetail:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount",getListingAccount:"subscribeOrders/getListingAccount",getApiUri:"api/api",getSession:"auth/getSession"})),{},{getUserData:function(){return{login:this.provider.accountId,userId:this.provider.userInfo.id}}}),methods:{onChange:function(){this.$emit("change")}}},HY=VY,GY=(i("eeb2"),Object(C["a"])(HY,EY,UY,!1,null,null,null)),qY=GY.exports,zY=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widget-pagination"},[e("div",{staticClass:"buttons-group"},[e("Button-icon",{attrs:{iconName:"Arrow-move-left",modifier:"flat square group"},on:{toggle:t.prevPage}}),e("Label-bar",{attrs:{modifier:"flat group"}},[e("strong",[t._v(t._s(t.currentPage))]),t._v(" из "),e("strong",[t._v(t._s(t.pages))])]),e("Input-text",{attrs:{small:"",placeholderValue:t.$t("goToWord")},on:{input:function(e){return t.goToPage(e)}},model:{value:t.toPage,callback:function(e){t.toPage=t._n(e)},expression:"toPage"}}),e("Button-icon",{attrs:{iconName:"Arrow-move-right",modifier:"flat square group"},on:{toggle:t.nextPage}})],1)])},YY=[],XY={components:{ButtonIcon:Nt,GroupButtons:pe,InputText:Aa,LabelBar:Ce},data:function(){return{toPage:"",currentPage:1}},props:{current:{type:[Number,String],default:1},pages:{type:[Number,String],default:1}},watch:{toPage:function(t){Number.isInteger(t)&&t>0&&t<=this.pages?(this.goToPage(t),this.currentPage=t):this.toPage=""},currentPage:function(t){t>this.pages&&(this.currentPage=this.pages),this.toPage=t}},computed:{maxValue:function(){return this.pages}},methods:{prevPage:function(){var t=parseInt(this.currentPage);1===t?this.currentPage=1:this.currentPage-=1,this.$emit("currentPage",this.currentPage)},nextPage:function(){var t=parseInt(this.currentPage);t===this.pages?this.currentPage=this.pages:this.currentPage+=1,this.$emit("currentPage",this.currentPage)},goToPage:function(t){this.currentPage=t,this.$emit("currentPage",this.currentPage)}},mounted:function(){this.currentPage=+this.current}},QY=XY,JY=(i("b3f1"),Object(C["a"])(QY,zY,YY,!1,null,null,null)),KY=JY.exports,ZY={components:{Modal:Oe,ButtonIcon:Nt,InputSearch:qu,VuePerfectScrollbar:Xt.a,ListItem:le,Button:Pa,ProviderItem:qY,ProviderPagination:KY,DxPopup:To["DxPopup"],DxScrollView:NY["DxScrollView"]},props:{isOpen:{default:!1},listProviders:{default:function(){return[]}},modalEditExperts:{type:Boolean}},data:function(){return{search:"",currentPage:1,pages:[]}},computed:{filteredList:function(){var t=this;return this.listProviders.filter((function(e){var i=e.userInfo.firstName.toLowerCase().includes(t.search.toLowerCase()),o=e.userInfo.lastName.toLowerCase().includes(t.search.toLowerCase());return i||o}))},titleAddExperts:function(){return this.listProviders?"".concat(this.$t("addExpertsWord")," (").concat(this.listProviders.length,")"):""},getCountCoeff:function(){return 8},getCountPages:function(){return Math.ceil(this.filteredList.length/this.getCountCoeff)},getExpertsPerPage:function(){var t=1===this.currentPage?0:this.getCountCoeff*this.currentPage-this.getCountCoeff,e=t+this.getCountCoeff;return this.filteredList.slice(t,e)}},methods:{close:function(){this.$emit("close")},closeModal:function(){this.$refs.expertPopup.instance.hide()},changeList:function(t){this.$emit("checkExpert",t)},addProviders:function(){this.$emit("addProviders")},resetList:function(t){this.$emit("resetList",t)},changePage:function(t){this.currentPage=t}}},tX=ZY,eX=(i("8790"),Object(C["a"])(tX,RY,WY,!1,null,null,null)),iX=eX.exports,oX=function(){var t=this,e=t._self._c;return e("DxPopup",{attrs:{visible:t.isOpen,width:420,height:"auto","drag-enabled":!1,"content-template":"content",title:t.titleEditExperts,wrapperAttr:{class:"editExpertPopup"}},on:{hidden:t.close},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"contentPopup"},[e("div",{staticClass:"bodyPopupExperts"},[e("div",{staticClass:"buttonAddProvider"},[e("Button-label",{attrs:{iconName:"Add",modifier:"flat"},on:{tab:t.addProvider}},[t._v(t._s(t.$t("addExpertWord")))])],1),e("DxScrollView",{attrs:{height:"50vh"}},[e("DxSortable",{attrs:{data:t.listProviders},on:{"drag-start":function(e){return t.onListDragStart(e)},reorder:function(e){return t.onListDrop(e)}}},t._l(t.listProviders,(function(i,o){return e("List-item",{key:o,attrs:{draggable:""}},[e("ProviderItem",{attrs:{provider:i,two:""},on:{change:function(e){return t.changeCheck(i)}}})],1)})),1)],1)],1),e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:t.resetList}},[t._v(t._s(t.$t("resetWord")))]),e("Button",{attrs:{typeBtn:"primary"},on:{click:t.saveRedactList}},[t._v(t._s(t.$t("save")))])],1)])]},proxy:!0}])})},nX=[],sX={name:"ModalEditExperts",components:{ButtonLabel:Z,DxSortable:Gn.a,ListItem:le,ProviderItem:qY,Button:Pa,DxPopup:To["DxPopup"],DxScrollView:NY["DxScrollView"]},props:{listProviders:{default:function(){}},isOpen:{default:!1},contract:{default:"EURUSD.a"}},computed:{titleEditExperts:function(){return this.listProviders?"".concat(this.$t("aboutLeftHowMenuListItem5")," ").concat(this.contract," (").concat(this.listProviders.length,")"):""}},methods:{close:function(){this.$emit("close")},addProvider:function(){this.$emit("addProvider")},saveRedactList:function(){this.$emit("saveRedactList")},changeCheck:function(t){this.$emit("changeCheck",t)},resetList:function(){this.$emit("resetList","redact")},onListDragStart:function(t){t.itemData=t.fromData[t.fromIndex]},onListDrop:function(t){t.fromData.splice(t.fromIndex,1),t.toData.splice(t.toIndex,0,t.itemData)}}},rX=sX,aX=(i("66b2a"),Object(C["a"])(rX,oX,nX,!1,null,null,null)),cX=aX.exports,lX=function(){var t=this,e=t._self._c;return e("div",[e("Modal",{attrs:{isOpen:t.isOpen,title:t.$t("expFilt")},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"modal__row modal-row"},[e("div",{staticClass:"modal-row__label form-label"},[e("div",{staticClass:"form-label__text"},[t._v(t._s(t.$t("accountTypeWord")))]),e("div",{staticClass:"form-label__icon"},[e("Tooltip",{scopedSlots:t._u([{key:"content",fn:function(){return[t._v(t._s(t.$t("accountTypeWord")))]},proxy:!0}])},[e("SvgIcon",{attrs:{name:"Info"}})],1)],1)]),e("div",{staticClass:"radio-button-group"},[e("Radio-button",{attrs:{value:"all",modelValue:t.filter.accountType},model:{value:t.filter.accountType,callback:function(e){t.$set(t.filter,"accountType",e)},expression:"filter.accountType"}},[t._v(t._s(t.$t("allWord")))]),e("Radio-button",{attrs:{value:"Real"},model:{value:t.filter.accountType,callback:function(e){t.$set(t.filter,"accountType",e)},expression:"filter.accountType"}},[t._v("Real")]),e("Radio-button",{attrs:{value:"Demo"},model:{value:t.filter.accountType,callback:function(e){t.$set(t.filter,"accountType",e)},expression:"filter.accountType"}},[t._v("Demo")])],1)]),e("div",{staticClass:"modal__row modal-row modal-row--range"},[e("div",{staticClass:"modal-row__label form-label"},[e("div",{staticClass:"form-label__text"},[t._v(t._s(t.$t("tradingByStrat")))]),e("div",{staticClass:"form-label__icon"},[e("Tooltip",{scopedSlots:t._u([{key:"content",fn:function(){return[t._v(t._s(t.$t("tradingByStrat")))]},proxy:!0}])},[e("SvgIcon",{attrs:{name:"Info"}})],1)],1)]),e("div",{staticClass:"range-group"},[e("div",{staticClass:"range__inputs"},[t.showInput?e("Input-number",{attrs:{value:t.filter.rangeProfitDays,placeholderValue:"from, days",step:1,small:""},on:{input:function(e){return t.setRangeValue(e,"rangeProfitDays")}}}):t._e()],1)])]),e("div",{staticClass:"modal__row modal-row modal-row--range"},[e("div",{staticClass:"modal-row__label form-label"},[e("div",{staticClass:"form-label__text"},[t._v(t._s(t.$t("succesDealsWord"))+", %")]),e("div",{staticClass:"form-label__icon"},[e("Tooltip",{scopedSlots:t._u([{key:"content",fn:function(){return[t._v(t._s(t.$t("succesDealsWord"))+", %")]},proxy:!0}])},[e("SvgIcon",{attrs:{name:"Info"}})],1)],1)]),e("div",{staticClass:"range-group"},[e("Range-slider",{attrs:{range:t.filter.rangeProfitOrders},on:{setRange:function(e){return t.setOrdersRange(e)}}})],1)]),e("div",{staticClass:"modal__row modal-row modal-row--range"},[e("div",{staticClass:"modal-row__label form-label"},[e("div",{staticClass:"form-label__text"},[t._v(t._s(t.$t("subsCostWord")))]),e("div",{staticClass:"form-label__icon"},[e("Tooltip",{scopedSlots:t._u([{key:"content",fn:function(){return[t._v(t._s(t.$t("subsCostPerMonthWord")))]},proxy:!0}])},[e("SvgIcon",{attrs:{name:"Info"}})],1)],1)]),e("div",{staticClass:"range-group"},[e("div",{staticClass:"range__inputs"},[t.showInput?e("Input-number",{attrs:{value:t.filter.rangePriceSubs[0],placeholderValue:"from, $",step:1,small:""},on:{input:function(e){return t.setRangeValue(e,t.filter.rangePriceSubs,0)}}}):t._e(),t.showInput?e("Input-number",{attrs:{value:t.filter.rangePriceSubs[1],placeholderValue:"to, $",step:1,small:""},on:{input:function(e){return t.setRangeValue(e,t.filter.rangePriceSubs,1)}}}):t._e()],1)])])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons"},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:t.clearFilter}},[t._v(t._s(t.$t("resetWord")))]),e("Button",{attrs:{typeBtn:"primary"},on:{click:t.acceptFilter}},[t._v(t._s(t.$t("applyWord")))])],1)]},proxy:!0}])}),t.getBrokersModalStatus?e("ModalBrokers",{attrs:{isOpen:t.getBrokersModalStatus},on:{acceptBrokers:function(e){return t.setSelectedBrokers(e)}}}):t._e()],1)},uX=[],dX=function(){var t=this,e=t._self._c;return e("div",{staticClass:"range-slider"},[e("vue-range-slider",{ref:"rangeSlider",attrs:{min:t.min,max:t.max,formatter:t.formatter,"tooltip-merge":t.tooltipMerge,"enable-cross":t.enableCross,dotSize:24,height:"4",bgStyle:t.bgStyle,"tooltip-style":t.tooltipStyle,"process-style":t.processStyle},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)},hX=[],pX=i("b8c8"),gX={components:{VueRangeSlider:pX["a"]},data:function(){return{value:this.range}},props:{range:{type:Array,required:!0,default:[0,100]},format:{type:String,default:"%"},minVal:{type:Number,default:0},maxVal:{type:Number,default:100}},watch:{value:function(t){this.setRange(t)}},methods:{setRange:function(t){this.$emit("setRange",t)}},created:function(){var t=this;this.min=this.minVal,this.max=this.maxVal,this.enableCross=!1,this.tooltipMerge=!1,this.formatter=function(e){return"".concat(e).concat(t.format)},this.bgStyle={"background-color":"#E6E6E6","border-radius":"4px","box-shadow":"inset 0px 1px 1px rgba(0, 0, 0, 0.1)"},this.tooltipStyle={"background-color":"transparent",border:"none",color:"#333","font-size":"1.4rem","letter-spacing":"0.2px"},this.processStyle={"background-color":"#1A54C7"}}},fX=gX,mX=(i("efe8"),Object(C["a"])(fX,dX,hX,!1,null,"7b00654f",null)),vX=mX.exports,yX={components:{Modal:Oe,RangeSlider:vX,Button:Pa,DropdownButton:Au,RadioButton:$a,SvgIcon:L,Tooltip:Na,InputNumber:Xd},props:["isOpen"],data:function(){return{filter:{rangeProfit:null,rangeProfitDays:null,rangeMaxDD:null,rangeProfitOrders:[20,100],rangePriceSubs:[null,null],accountType:"all",selectedBrokers:[]},showInput:!0}},computed:Object(c["a"])({},Object(p["c"])({getBrokersModalStatus:"modal/getBrokersModalStatus",getBrokers:"brokers/getBrokers"})),methods:{close:function(){this.$emit("close")},setRangeValue:function(t,e,i){void 0!==i&&this.$set(e,i,t),this.$set(this.filter,e,t)},setProfitRange:function(t){this.range1=t},setDDRange:function(t){this.range2=t},setOrdersRange:function(t){this.filter.rangeProfitOrders=t},setOldRange:function(t){this.range4=t},clearFilter:function(){var t=this;this.$set(this.filter.rangeProfitOrders,0,20),this.$set(this.filter.rangeProfitOrders,1,100),this.$set(this.filter,"rangeProfit",null),this.filter.rangeProfitDays=null,this.$set(this.filter,"rangeMaxDD",null),this.$set(this.filter,"accountType","all"),this.$set(this.filter,"selectedBrokers",[]),this.$set(this.filter.rangePriceSubs,0,null),this.$set(this.filter.rangePriceSubs,1,null),this.$emit("acceptFilter",this.filter),this.showInput=!1,this.$nextTick((function(){t.showInput=!0}))},acceptFilter:function(){this.$emit("acceptFilter",this.filter),this.close()},setSelectedBrokers:function(t){this.selectedBrokers=t},openBrokersModal:function(t){this.$store.dispatch("modal/switchBrokersModal",t)}}},CX=yX,bX=(i("35670"),Object(C["a"])(CX,lX,uX,!1,null,null,null)),SX=bX.exports,PX={name:"WidgetProvider",props:{contract:{default:"EURUSD",type:String},activeTab:{default:0},expand:{default:!0},tabsComponent:{type:Boolean,default:!1},styleForContainer:{type:Object,default:function(){return{}}}},components:{ButtonIcon:Nt,ProfileWidget:Hz,ProviderItem:IY,ListItem:le,DropdownMenu:vt,Dropdown:jY,ButtonLabel:Z,ModalAddExperts:iX,ModalEditExperts:cX,WidgetPagination:KY,ModalFilter:SX,DxSelectBox:Bo.a},data:function(){return{LangChangeTaker:pa,open:!1,isFollow:!1,activeExpertsCounts:5,arrCounts:[],allProviderBySymbol:null,providerBySymbol:null,redactListprovider:null,addListProviders:null,trendsExperts:[],modalAddExperts:!1,modalEditExperts:!1,filter:{accountType:"all",rangeProfitOrders:[20,100],rangeProfitDays:null,rangePriceSubs:[null,null]},mouseEnterCheck:!1,usingTools:null,currencyPair:this.contract,topRefHeight:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserDetail:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount",getListingAccount:"subscribeOrders/getListingAccount",getUISettings:"userSettings/getUserSettings",getFilterModal:"modal/getFilterModalStatus",getApiUri:"api/api",getSession:"auth/getSession",getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary",getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getVisibleProviders:function(){return this.allProviderBySymbol},getRedactList:function(){return this.redactListprovider},getAddList:function(){return this.addListProviders},isExpand:function(){return this.expand},getContract:function(){return this.contract},styleForContainerWidget:function(){return Object(c["a"])(Object(c["a"])({},this.styleForContainer),{},{maxHeight:parseInt(this.styleForContainer.maxHeight)-this.topRefHeight+"px"})}}),watch:{getProfileAccount:function(){this.getAllProvidersByContract(this.contract)},currencyPair:function(){this.getAllProvidersByContract(this.currencyPair)}},methods:{toggleModalFilter:function(){this.$store.dispatch("modal/switchFilterModal")},setTrend:function(t){this.trendsExperts.push(t)},getUsingContractsByAccount:function(t){var e=this,i=t.map((function(t){return t.accountId}));this.$http.post(this.getApiUri+"AccountContracts",JSON.stringify({accountsIds:i}),{headers:{"Content-Type":"application/json"}}).then((function(t){e.usingTools=t.data}))},setFilter:function(t){this.filter=t,this.getAllProvidersByContract(this.contract)},openEditExpertModal:function(){this.modalEditExperts=!0},closeEditExpertModal:function(){this.modalEditExperts=!1},onClickListItemExpertCount:function(t){this.activeExpertsCounts=t.value},setMessageHandler:function(t){"GetSourcesById"===(null===t||void 0===t?void 0:t.command)&&(this.setProviderByContracts(t.data.data),this.getUsingContractsByAccount(t.data))},setProviderByContracts:function(t){t.length||(this.providerBySymbol=[],this.allProviderBySymbol=[],this.setRedactList(),this.setAddList()),this.allProviderBySymbol=this.getSession?TX(this.getProfileAccount,t):t,this.getProvidersByInstruement(this.contract)},getAllProvidersByContract:function(t){var e={Command:"GetSourcesById",data:{Type:"Instrument",Id:t}};this.$socketStream.sendCommand({ws:"apiWS",command:e})},getProvidersByInstruement:function(){var t=this.filtredProviders(this.allProviderBySymbol,this.filter);t.length>20?this.providerBySymbol=t.slice(0,20):this.providerBySymbol=t,this.getProvidersCounts(),this.setRedactList(),this.setAddList()},getProvidersCounts:function(){this.providerBySymbol&&(this.arrCounts=OX(this.providerBySymbol),this.providerBySymbol.length>20&&this.arrCounts.push("Все"),this.providerBySymbol.length<=this.activeExpertsCounts&&"string"!==typeof this.activeExpertsCounts||this.providerBySymbol.length>this.activeExpertsCounts&&this.providerBySymbol.length<5?this.activeExpertsCounts=this.providerBySymbol.length:this.providerBySymbol.length>this.activeExpertsCounts&&this.providerBySymbol.length>5&&(this.activeExpertsCounts=5))},filtredProviders:function(t,e){if(t.length<2)return t;var i=t;for(var o in e)"accountType"===o&&"all"!==e[o]?i=this.filterByTypeAccount(i,e[o]):"rangeProfitOrders"===o?i=this.filterByProfitsOrders(i,e[o]):"rangeProfitDays"===o&&null!==e[o]?i=this.filterByDay(i,e[o]):"rangePriceSubs"===o&&(i=this.filterByPrice(i,e[o]));return i},filterByPrice:function(t,e){return null===e[0]&&null!==e[1]?t.filter((function(t){return t.price<=e[1]})):null===e[1]&&null!==e[0]?t.filter((function(t){return t.price>=e[0]})):null===e[0]&&null===e[1]?t:t.filter((function(t){return t.price<=e[1]&&t.price>=e[0]}))},filterByTypeAccount:function(t,e){return t.filter((function(t){return t.accountGroup===e}))},filterByProfitsOrders:function(t,e){return t.filter((function(t){return 100/(t.totalOrders/t.positiveOrders)>=e[0]}))},filterByDay:function(t,e){return t.filter((function(t){return t.tradeDays>=e}))},resetList:function(t){"add"===t?this.addListProviders.forEach((function(t){t.checked=!1})):this.redactListprovider.forEach((function(t){t.checked=!1}))},setRedactList:function(){var t=this;this.redactListprovider=[],this.providerBySymbol.length&&(this.redactListprovider=this.providerBySymbol.concat(),this.redactListprovider.forEach((function(e){t.$set(e,"checked",!0)})))},setAddList:function(){var t=this;this.addListProviders=xX(this.providerBySymbol,this.allProviderBySymbol),this.addListProviders.forEach((function(e){t.$set(e,"checked",!1)}))},openAddExpertModal:function(){this.modalAddExperts=!0},closeAddExpertModal:function(){this.modalAddExperts=!1},onChangeAddProviderList:function(t){var e=this;this.addListProviders.forEach((function(i,o){i.id===t.id&&i.accountId===t.accountId&&e.$set(e.addListProviders[o],"checked",!t.checked)}))},onChangeSelectedExperts:function(t){var e=this;this.redactListprovider.forEach((function(i,o){i.id===t.id&&i.accountId===t.accountId&&e.$set(e.redactListprovider[o],"checked",!t.checked)}))},addProviders:function(){var t=this;this.addListProviders.filter((function(t){return!0===t.checked})).forEach((function(e){t.providerBySymbol.unshift(e)})),this.setRedactList(),this.setAddList(),this.closeAddExpertModal(),this.getProvidersCounts()},saveRedactList:function(){this.providerBySymbol=this.redactListprovider.filter((function(t){return!0===t.checked})),this.setRedactList(),this.setAddList(),this.closeEditExpertModal(),this.getProvidersCounts()},switchExpand:function(){this.$emit("switchExpand")},changeCurrentQuotes:function(t){this.currencyPair=t.value},showCompareModal:function(){this.$store.dispatch("modal/switchCompareProvidersModal",this.providerBySymbol)},showFilterModal:function(){this.toggleModalFilter()}},mounted:function(){var t,e=this;this.topRefHeight=(null===(t=this.$refs)||void 0===t||null===(t=t.topMenu)||void 0===t?void 0:t.clientHeight)||0,this.$socketStream.$on("apiWS",this.setMessageHandler),this.getAllProvidersByContract(this.contract),pa.$on("changeLanguageCode",(function(){e.$forceUpdate()}))},created:function(){var t=this;document.addEventListener("click",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("click",t.clickOutside)})),document.addEventListener("keydown",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("keydown",t.clickOutside)}))},destroyed:function(){var t=this;this.$socketStream.$off("apiWS",this.setMessageHandler),pa.$off("changeLanguageCode",(function(){t.$forceUpdate()}))}};function TX(t,e){return e.filter((function(e){return!t.some((function(t){return e.userInfo.id===t.userId}))}))}function xX(t,e){return e.filter((function(e){return!t.some((function(t){return e.id===t.id}))}))}function OX(t){var e=[3,5,10,15,20],i=[],o=0,n=e[o];return t.forEach((function(t,s){s>=n&&o0?e("div",{class:"chat-contact__counter chat-contact__counter_".concat(t.getActiveTheme),staticStyle:{"margin-left":"auto"}},[e("svgIcon",{attrs:{name:"OwnerChat"}}),t._v(t._s(t.getUnreadMessage))],1):t._e(),t.getPaidType?e("div",{staticStyle:{color:"#ccc"}},[e("svgIcon",{attrs:{name:t.getPaidStatus,size:20}})],1):t._e(),t.disableNotifications?e("div",{class:"chat-contact__status chat-contact__status_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"VolumeOFF"}})],1):t._e(),"c"!==this.getTypeGroup&&"p"!==this.getTypeGroup||!this.getChatCurrentRoom||!this.isOwner||this.getStatusArchive?t._e():e("div",{class:"chat-contact__status chat-contact__status_".concat(t.getActiveTheme),style:{color:"dark"===t.getActiveTheme?"#00B9FC":"#3C73F1"},on:{click:function(e){return t.startVideoConference("control")}}},[e("svgIcon",{attrs:{name:"Videoconference"}})],1),"d"===t.getTypeGroup&&t.getChatCurrentRoom&&!this.getHelpGroupStatus?e("div",{class:"chat-contact__status chat-contact__status_".concat(t.getActiveTheme),style:{color:"dark"===t.getActiveTheme?"#00ffac":"#008e72"},on:{click:t.videoCall}},[e("svgIcon",{attrs:{name:"OutgoingCall"}})],1):t._e(),"private"===t.mode?e("div",{class:"chat-contact__menu chat-contact__menu_".concat(t.getActiveTheme),style:"d"===t.getTypeGroup?{marginLeft:"auto"}:""},[e("div",{on:{click:t.toggleConfigMenu}},[e("svgIcon",{attrs:{name:"Menu-dot"}})],1)]):t._e()]),e("div",{staticClass:"chat-contact__menuConfig"},[t.chatContact?e("DxPopup",{attrs:{visible:t.configMenu,container:".chat__wrapper",closeOnOutsideClick:!0,position:{my:"top right",at:"bottom right",of:t.chatContact},fullScreen:!1,shading:!1,showTitle:!1,width:"195px",height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"chat-contact_menuPopupWrap"},["d"!==t.getTypeGroup||t.getHelpGroupStatus?t._e():e("div",{class:"chat-contact_menuPopupItem chat-contact_menuPopupItem_".concat(t.getActiveTheme)},[e("div",{class:"chat-contact_menuPopupIcon chat-contact_menuPopupIcon_".concat(t.getActiveTheme),style:{color:"dark"===t.getActiveTheme?"#00ffac":"#008e72"}},[e("svgIcon",{attrs:{name:"OutgoingCall"}})],1),e("div",{class:"chat-contact_menuPopupText chat-contact_menuPopupText_".concat(t.getActiveTheme)},[t._v("Позвонить")])]),t._l(t.getConfigMenu,(function(i,o){return i.status?e("div",{class:"chat-contact_menuPopupItem chat-contact_menuPopupItem_".concat(t.getActiveTheme),on:{click:i.hendler}},[e("div",{class:"chat-contact_menuPopupIcon chat-contact_menuPopupIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:i.iconName}})],1),e("div",{class:"chat-contact_menuPopupText chat-contact_menuPopupText_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])]):t._e()})),t.getStatusConfigMenu&&!t.getStatusArchive?e("div",{class:"chat-contact_menuPopupItem chat-contact_menuPopupItem_".concat(t.getActiveTheme)},[e("div",{class:"chat-contact_menuPopupIcon chat-contact_menuPopupIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"new-bell"}})],1),e("div",{class:"chat-contact_menuPopupText chat-contact_menuPopupText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("modalServicesBtns5")))]),e("div",{staticClass:"chat-contact_menuPopupToggle"},[e("Toggle",{attrs:{value:!t.disableNotifications},on:{toggle:t.setNotiStatus}})],1)]):t._e()],2)]},proxy:!0}],null,!1,3170384350)}):t._e()],1)])},RX=[],WX="https://chat.toptrader.org",NX={components:{DxPopup:To["DxPopup"],User:hd,ButtonIcon:Nt,DropdownMenu:vt,ListItemMenu:dt,ListItem:le,Toggle:qo},props:{roomObject:{type:Object},mode:{type:String,default:"private"},listStatusUsers:{type:Array},theardsRoom:{type:Array},additioanalInfo:{default:null}},data:function(){return{ureadMessage:null,subsIds:[],chatContact:null,typingObject:{user:"",status:!1},showAvatar:!0,configMenu:!1,invateThreads:null,alertAudio:new Audio(i("047d")),countInvits:0,userPrivateGroupMenu:[],nameRoom:null,countMembers:0,disableNotifications:!1,blockedStatus:!1,favoriteStatus:"",userInfo:null,customFieldsGroup:null}},watch:{getChatCurrentRoom:function(t){this.subsIds.length&&this.unsubsNotificationForRoom(),t&&this.subsNotificationForRoom()},getStatusUser:function(){this.getChatCurrentRoom&&this.getInfoUser()},additioanalInfo:function(t){t&&this.setAdditionalInfo()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatApiUrl:"api/apiChat",getApiUrl:"api/api",getChatAuth:"chat/getChatAuth",getUserDetail:"user/getUserDetail",getChatCurrentRoom:"chat/getChatCurrentRoom",getCurrentVideoCall:"chat/getCurrentVideoCall",getChatCurrentThread:"chat/getChatCurrentThread",getUserPaymentServices:"paymentService/getUserPaymentServices",getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getUnreadMessage:function(){return this.getChatCurrentRoom?0:this.ureadMessage},getStatusArchive:function(){return!!this.roomObject&&this.roomObject.archived},getStatusConfigMenu:function(){return!this.roomObject||this.roomObject.u._id===this.getChatAuth.userId},getPaidStatus:function(){var t,e,i=this;if("light"===this.getActiveTheme){if(this.roomObject&&null!==(t=this.roomObject)&&void 0!==t&&null!==(t=t.customFields)&&void 0!==t&&t.paidGroup){if(this.getUserPaymentServices&&this.getUserPaymentServices.length){var o=this.getUserPaymentServices.filter((function(t){return t.externalId===i.roomObject.rid}));return o.length?o.some((function(t){return new Date(i.getServerTime.now).getTime()0?e("ButtonIconFlat",{attrs:{icon:{name:"Send",color:"light"===t.getActiveTheme?"#2462db":"#00b9fc"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme)],style:{borderRadius:"0.4rem",borderRight:"none",boxShadow:"0px 3px 3px rgb(0 0 0 / 5%), 0px 0px 2px rgb(0 0 0 / 35%)"}}},on:{click:t.sentMessage}}):t._e(),t.focus?e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme)],style:{borderRadius:"0.4rem",borderRight:"none",marginTop:"0.8rem",boxShadow:"0px 3px 3px rgb(0 0 0 / 5%), 0px 0px 2px rgb(0 0 0 / 35%)"}}},on:{click:t.clear}}):t._e()],1),t.attachMenu?e("div",{staticStyle:{position:"absolute",top:"-9.5rem","z-index":"1",width:"15rem"}},[e("DropdownMenu",{staticStyle:{"max-width":"15rem"},attrs:{isOpen:!0}},t._l(t.getMenu,(function(i,o){return e("ListItemMenu",{attrs:{theme:t.getActiveTheme,iconName:i.icon},on:{click:i.event}},[t._v(t._s(i.text))])})),1)],1):t._e()],1),"no-join"!==t.joinStatus&&t.getSession?t._e():e("div",{staticClass:"chat-control-button",class:"chat-control-button_".concat(t.getActiveTheme)},[e("Button",{attrs:{iconName:"Add"},on:{click:t.joinToChannel}},[t._v(t._s(t.$t("sttc")))])],1)])},JX=[],KX=function(){var t=this,e=t._self._c;return e("div",{class:"chat-recent chat-recent_".concat(t.theme)},[e("div",{staticClass:"chat-recent-msg"},[e("div",{class:"chat-recent_user chat-recent_user_".concat(t.theme)},[t._v(t._s(t.name)),e("div",{staticClass:"chat-recent_close",on:{click:t.clearRecentMsg}},[e("svgIcon",{attrs:{name:"Close",size:25}})],1)]),e("div",{class:"chat-recent_wrap chat-recent_wrap_".concat(t.theme)},[t.userMessage.attachments&&t.userMessage.attachments[0].image_url?e("div",{staticClass:"chat-recent__multimedia"},[e("div",{staticClass:"chat-recent__multimedia-img"},[e("img",{staticStyle:{"max-width":"100%"},attrs:{src:t.chatLink+t.userMessage.attachments[0].image_url}})])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments[0].video_url?e("div",{staticClass:"chat-recent__multimedia"},[e("div",{staticClass:"chat-recent__multimedia-img"},[e("video",{ref:"videoPlayer",staticClass:"video-js",staticStyle:{height:"100%"}})])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments[0].audio_url?e("div",{staticClass:"chat-recent__multimedia"},[e("audio",{attrs:{controls:""}},[e("source",{attrs:{src:t.chatLink+t.userMessage.attachments[0].audio_url,type:"audio/mpeg"}})])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments[0].title_link?e("div",{staticClass:"chat-recent__multimedia"},[e("div",{staticClass:"chat-recent__fileBox"},[t.userMessage.attachments[0].image_url||t.userMessage.attachments[0].audio_url||t.userMessage.attachments[0].video_url?t._e():e("div",{staticClass:"chat-recent__fileBox-name-file"},[t._v(t._s(t.userMessage.attachments[0].title))])])]):t._e(),t.userMessage.msg?e("div",{staticClass:"chat-recent-text"},[t._v(t._s(t.getTextMsg))]):t._e()])])])},ZX=[],tQ={components:{svgIcon:L,videoJs:eP["a"]},props:{userMessage:{type:Object},name:{default:""},theme:{type:String,default:"light"}},data:function(){return{chatLink:"https://chat.toptrader.org"}},computed:{getTextMsg:function(){return this.userMessage.urls?this.userMessage.msg.split(" ").splice(2).join(" "):this.userMessage.msg}},methods:{clearRecentMsg:function(){this.$store.commit("chat/setRecentMessage",null)}}},eQ=tQ,iQ=(i("ee61"),Object(C["a"])(eQ,KX,ZX,!1,null,null,null)),oQ=iQ.exports,nQ="https://chat.toptrader.org",sQ={components:{ButtonIcon:Nt,ButtonLabel:Z,Button:Pa,Textarea:ph,svgIcon:L,DropdownMenu:vt,ListItemMenu:dt,ChatRecent:oQ},props:{joinStatus:{type:String},theardsRoom:{type:Array},listUsers:{type:Array},additioanalInfo:{default:null}},data:function(){return{text:"",textarea:{height:3.2,width:30.4},focus:!1,attachMenu:!1,invateThreads:null,statusSendInvate:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getChatAuth:"chat/getChatAuth",getChatCurrentThread:"chat/getChatCurrentThread",getRecentMessage:"chat/getRecentMessage",getUserDetail:"user/getUserDetail",getApiChatUrl:"api/apiChat",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getMenu:function(){return[{index:"0",text:this.$t("take_photo_video"),icon:"Webcamera",event:this.openVideo},{index:"1",text:this.$t("record_audio"),icon:"MicOn",event:this.openAudio},{index:"2",text:this.$t("attach_file"),icon:"Documents",event:this.openAttach}]},getMutedStatus:function(){var t=this;if(this.getChatCurrentRoom.muted)return this.getChatCurrentRoom.muted.some((function(e){return e===t.getUserDetail.login}))},getBlockedStatus:function(){if(this.additioanalInfo)return this.additioanalInfo.blocked},getReadOnlyStatus:function(){return this.getChatCurrentRoom.ro&&this.getChatCurrentRoom.u.username!==this.getUserDetail.login},getBlockerStatus:function(){if(this.additioanalInfo)return this.additioanalInfo.blocker},getInvateStatus:function(){if((this.getChatCurrentRoom||void 0!==!this.getChatCurrentRoom.customFields.inviteStatus)&&"d"!==this.getChatCurrentRoom.t)return this.getChatCurrentRoom.customFields.inviteStatus},getUserName:function(){var t=this;if(this.listUsers&&this.getRecentMessage){var e=this.listUsers.find((function(e){return e._id===t.getRecentMessage.u._id}));return e.name}}}),watch:{focus:function(t){t?(this.textarea.height=7.2,this.textarea.width=27.4):(this.textarea.height=3.2,this.textarea.width=30.4)}},methods:{onFocus:function(){this.focus=!0,this.$emit("chatFocus",this.focus)},openAttachMenu:function(){this.attachMenu=!this.attachMenu},openAttach:function(){this.$emit("openAttach"),this.openAttachMenu()},openVideo:function(){this.$emit("openVideo"),this.openAttachMenu()},openAudio:function(){this.$emit("openAudio"),this.openAttachMenu()},sentMessage:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.getMutedStatus&&t.text){e.next=2;break}return e.abrupt("return");case 2:if(t.getSession){e.next=6;break}t.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"}),e.next=13;break;case 6:return i={message:{rid:t.getChatCurrentRoom._id,msg:t.text}},t.getChatCurrentThread&&(i.message["tshow"]=!1,i.message["tmid"]=t.getChatCurrentThread),t.getRecentMessage&&(i.message["msg"]="[ ](".concat(nQ,"/channel/TestInviteGroup?msg=").concat(t.getRecentMessage._id,") ").concat(t.text)),e.next=11,t.$http.post("".concat(t.getApiChatUrl,"chat.sendMessage"),JSON.stringify(i),{headers:{"X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId,"Content-type":"application/json"}}).then((function(e){e.data.success&&(t.$emit("sendMessage"),t.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight})))}));case 11:t.getRecentMessage&&t.$store.commit("chat/setRecentMessage",null),t.clear();case 13:case"end":return e.stop()}}),e)})))()},joinToChannel:function(){var t=this;if(this.getSession){var e={roomId:this.getChatCurrentRoom._id};this.$http.post("".concat(this.getApiChatUrl,"channels.join"),JSON.stringify(e),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-type":"application/json"}}).then((function(){t.$emit("joinGroup")}))}else this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},getListUsersForChannel:function(){var t=this;this.$http.get("".concat(this.getApiChatUrl,"channels.members?roomId=").concat(this.getChatCurrentRoom._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.$emit("membersRoom",e.data.members)}))},clear:function(){this.text="",this.$refs.textarea.clean(),this.focus=!1,this.$emit("chatFocus",this.focus)}}},rQ=sQ,aQ=(i("1006a"),Object(C["a"])(rQ,QX,JX,!1,null,null,null)),cQ=aQ.exports,lQ=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat__messages",on:{dragenter:t.dragenterZone}},[t.dropZoneActiveStatus?e("div",{ref:"dropZone",class:"chat__messages_dropZone chat__messages_dropZone_".concat(t.getActiveTheme),on:{dragleave:t.dragleaveZone,drop:t.onDropFile,dragover:t.dragOverHandler}},[e("Preloader",{attrs:{enabled:t.preloaderStatus,circle:!0,icon:!0,opacity:"0.6"}}),t.preloaderStatus?t._e():e("div",{class:"chat__messages_dropZone-content chat__messages_dropZone-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"chat__messages_dropZone-content_icon"},[e("svgIcon",{attrs:{name:t.iconDropZone,size:100}})],1),e("div",{staticClass:"chat__messages_dropZone-content_text"},[t._v(t._s(t.$t(t.message)))]),t.noSendedFiles.length&&!t.serverError?e("div",{staticClass:"chat__messages_dropZone-content_noSended"},[t._l(t.noSendedFiles,(function(i,o){return e("div",{staticClass:"chat__messages_dropZone-content_noSended-item"},[t._v(t._s(i))])})),e("div",{staticClass:"chat__messages_dropZone-content_noSended-info"},[t._v(t._s(t.$t("noSendedFilesInfoChat")))])],2):t._e()])],1):t._e(),e("VuePerfectScrollbar",{staticClass:"chat-messages__scroll",attrs:{id:"container"}},[t.discusMessage?e("div",{class:"descution_message descution_message_".concat(t.getActiveTheme)},[e("div",{staticClass:"chat-message__user"},[e("Avatar",{staticStyle:{"margin-right":"1rem"},attrs:{src:t.getAvaForUserDiscusMsg,theme:t.getActiveTheme}}),e("div",{staticClass:"chat-message__info"},[e("div",{class:"chat-message__nameUser chat-message__nameUser_".concat(t.getActiveTheme)},[t._v(t._s(t.getNameUserForDiscusMsg))]),e("div",{class:"chat-message__time chat-message__time_".concat(t.getActiveTheme),staticStyle:{"margin-left":"0"}},[t._v(t._s(t.getDateDiscusMsg))])])],1),t._v(t._s(t.discusMessage.msg))]):t._e(),t._l(t.messages,(function(i,o){return e("div",[t.messages&&t.getIsOrder(i)?e("div",{style:{marginBottom:"8px"}},[e("Order",{attrs:{withoutShadow:!0,isShowSymbol:!0,withoutClose:!0,order:t.getIsOrder(i)}})],1):t._e(),i&&!t.getIsOrder(i)&&t.getInfoMesssageStatus(i)?e("ChatMessage",{key:o,attrs:{userMessage:i,usersStatuses:t.statusUsersRoom,users:t.listUsers,owners:t.ownersRoom,theardsRoom:t.theardsRoom,joinStatus:t.joinStatus,room:""},on:{createDirect:t.createDirectRoom}}):t._e()],1)}))],2)],1)},uQ=[],dQ=function(){var t=this,e=t._self._c;return isNaN(Date.parse(new Date(+t.userMessage._id)))&&(t.getChatCurrentThread?t.userMessage.tmid:!t.userMessage.tmid)?e("div",{staticClass:"chat-message",class:t.getClassMsg,on:{mouseover:function(e){t.actionMenu=!0},mouseleave:function(e){t.actionMenu=!1}}},[t.getTextMessage&&t.getTextMessage.status&&"i"===t.getTextMessage.status?e("div",{class:"chat-message__informMessage chat-message__informMessage_".concat(t.getActiveTheme)},[e("div",{staticClass:"chat-message__informMessage-wrap"},[e("div",{class:"chat-message__informMessage-icon chat-message__informMessage-icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"informMessage",size:10}})],1),e("div",{class:"chat-message__informMessage-date chat-message__informMessage-date_".concat(t.getActiveTheme)},[t._v(t._s(t.getDateAndTimeMessage))])]),e("div",{class:"chat-message__informMessage-msg chat-message__informMessage-msg_".concat(t.getActiveTheme),attrs:{title:t.getTextMessage.text}},[t._v(t._s(t.getTextMessage.text))])]):t._e(),t.getTextMessage&&t.getTextMessage.status&&"a"===t.getTextMessage.status?e("div",{class:"chat-message__informMessage ".concat(t.getEndStatusConference?"chat-message__informMessage-conferneceEnd_".concat(t.getActiveTheme):"chat-message__informMessage-conferneceActive_".concat(t.getActiveTheme))},[t.getEndStatusConference?t._e():e("div",{staticClass:"chat-message__informMessage-confernceWrap"},[e("div",{staticClass:"chat-message__informMessage-icon"},[e("div",{class:"chat-message__informMessage-directName chat-message__informMessage-directName_".concat(t.getActiveTheme),attrs:{title:t.getUserName}},[t._v(t._s(t.getUserName))]),e("div",{class:"chat-message__informMessage-conferenceInfo chat-message__informMessage-conferenceInfo_".concat(t.getActiveTheme),attrs:{title:t.getUserName}},[t._v("Запустил(а) видеоконференцию")])]),e("div",{class:"chat-message__informMessage-conferneceDate chat-message__informMessage-conferneceDate_".concat(t.getActiveTheme)},[e("div",[t._v(t._s(t.getDateAndTimeMessage))])])]),t.getEndStatusConference?t._e():e("div",{staticClass:"chat-message__informMessage-confAdd"},[t.getJoinConferenceStatus?e("div",{staticClass:"chat-message__informMessage-confAdd-button",attrs:{title:"Присоедениться"}},[e("ButtonIconFlat",{attrs:{icon:{name:"Videoconference"},modifier:{class:["chat-message__informMessage-conferneceJoin_".concat(t.getActiveTheme)]}},on:{click:t.joinToConference}},[t._v("Присоедениться")])],1):t._e()]),t.getEndStatusConference?e("div",{class:"chat-message__informMessage-conferenceEndInfo chat-message__informMessage-conferenceEndInfo_".concat(t.getActiveTheme)},[e("span",{staticStyle:{"padding-top":"0.6rem"}},[t._v("Видеоконференция окончена")]),e("svgIcon",{attrs:{name:"VideoOff"}})],1):t._e()]):t._e(),"c"!==t.getTypeRoom&&"p"!==t.getTypeRoom||t.getTextMessage.status?t._e():e("div",{staticClass:"chat-message__userAvatar"},[e("div",{staticClass:"chat-message__user"},[e("Avatar",{attrs:{src:t.getAvaForUser,size:"3",online:t.getStatusUser,theme:t.getActiveTheme}})],1)]),t.getTextMessage.status?t._e():e("div",{staticClass:"chat-message__contentPart",style:"d"===t.getTypeRoom?{maxWidth:"calc(100% - 2.4rem)"}:{maxWidth:"calc(100% - 6.2rem)"}},[t.fullMultiMedia?e("div",{staticClass:"chat-message-showFullImage",on:{click:t.setStatusFullMultiMedia}},[e("div",{staticClass:"chat-message-showFullImage-wrap"},[e("div",{staticClass:"chat-message-showFullImage-multimedia"},[e("img",{staticStyle:{"max-width":"100%"},attrs:{src:t.chatLink+t.userMessage.attachments[0].image_url}})]),t.userMessage.msg?e("div",{staticClass:"chat-message-showFullImage-text"},[t._v(t._s(t.userMessage.msg))]):t._e(),e("div",{staticClass:"chat-message-showFullImage-nav"},[e("div",{staticClass:"chat-message-showFullImage-navItem"},[e("div",{staticStyle:{"margin-right":"1rem"}},[t._v(t._s(t.$t("save_on_computer")))]),e("a",{attrs:{href:t.chatLink+t.userMessage.attachments[0].image_url}},[e("svgIcon",{attrs:{name:"Save",size:30}})],1)])])])]):t._e(),e("div",{staticClass:"chat-message__userDirect"},[e("div",{class:"chat-message__userDirect-directName chat-message__userDirect-directName_".concat(t.getActiveTheme),attrs:{title:t.getUserName}},[t._v(t._s(t.getUserName))]),e("div",{class:"chat-message__userDirect-time chat-message__userDirect-time_".concat(t.getActiveTheme),staticStyle:{"margin-top":"0.2rem"}},[t._v(t._s(t.getDateAndTimeMessage))])]),t.userMessage.attachments&&t.userMessage.attachments.length&&t.userMessage.attachments[0].image_url?e("div",{staticClass:"chat-message__multimedia_img"},[e("div",{staticClass:"chat-message__multimedia_img-file"},[e("img",{staticStyle:{"max-width":"100%"},attrs:{src:t.chatLink+t.userMessage.attachments[0].image_url}})]),e("div",{staticClass:"chat-message__multimedia_img-hover",on:{click:t.setStatusFullMultiMedia}},[e("svgIcon",{attrs:{name:"Zoom-in",size:50}})],1)]):t._e(),t.userMessage.attachments&&t.userMessage.attachments.length&&t.userMessage.attachments[0].video_url?e("div",{staticClass:"chat-message__multimedia_video"},[e("div",{staticClass:"chat-message__multimedia-file"},[e("video",{ref:"videoPlayer",staticClass:"video-js"})])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments.length&&t.userMessage.attachments[0].audio_url?e("div",{staticClass:"chat-message__multimedia_audio"},[e("audio",{attrs:{controls:""}},[e("source",{attrs:{src:t.chatLink+t.userMessage.attachments[0].audio_url,type:"audio/mpeg"}})])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments.length&&t.userMessage.attachments[0].title_link?e("div",{class:"chat-message__multimedia_fileBox chat-message__multimedia_fileBox_".concat(t.getActiveTheme)},[e("div",{class:"chat-message__fileBox chat-message__fileBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"chat-message__fileBox-name-file"},[t._v(t._s(t.userMessage.attachments[0].title))]),e("a",{attrs:{href:t.chatLink+t.userMessage.attachments[0].title_link}},[e("svgIcon",{attrs:{name:"fileDownload",size:20}})],1)])]):t._e(),t.userMessage.attachments&&t.userMessage.attachments.length&&t.userMessage.attachments[0].author_name?e("div",{staticClass:"chat-message__recent"},[e("div",{class:"chat-message__recentMsg chat-message__recentMsg_".concat(t.getActiveTheme)},[e("div",{staticClass:"chat-message__recentMsg-msg"},[e("div",{staticClass:"chat-message__recentMsg-msg-text"},[t._v(t._s(t.userMessage.attachments[0].text))]),t.userMessage.attachments.length&&t.userMessage.attachments[0].attachments.length?e("div",{staticClass:"chat-message__recentMsg-msg-multimedia"},[t.userMessage.attachments[0].attachments[0].image_url||t.userMessage.attachments[0].attachments[0].audio_url||t.userMessage.attachments[0].attachments[0].video_url?t._e():e("div",{staticClass:"chat-message__recentMsg-msg-multimediaTitle"},[t._v(t._s(t.userMessage.attachments[0].attachments[0].title))]),t.userMessage.attachments[0].attachments[0].image_url?e("div",{staticClass:"chat-message__recentMsg-msg-multimediaImg"},[e("img",{attrs:{src:"data:".concat(t.userMessage.attachments[0].attachments[0].image_type,";base64, ").concat(t.userMessage.attachments[0].attachments[0].image_preview)}})]):t._e(),t.userMessage.attachments[0].attachments[0].audio_url?e("div",{staticClass:"chat-message__recentMsg-msg-multimediaAudio"},[e("audio",{attrs:{controls:""}},[e("source",{attrs:{src:t.chatLink+t.userMessage.attachments[0].attachments[0].audio_url,type:t.userMessage.attachments[0].attachments[0].audio_type}})])]):t._e(),t.userMessage.attachments[0].attachments[0].video_url?e("div",{staticClass:"chat-message__recentMsg-msg-multimediaAudio"},[e("video",{attrs:{controls:""}},[e("source",{attrs:{src:t.chatLink+t.userMessage.attachments[0].attachments[0].video_url,type:t.userMessage.attachments[0].attachments[0].video_type}})])]):t._e()]):t._e()])]),e("div",{class:"chat-message__recentText chat-message__recentText_".concat(t.getActiveTheme)},[t._v(t._s(t.getRecentMsg(t.userMessage.msg)))])]):t._e(),t.updateMode||t.getTextMessage.status?t._e():e("div",{ref:"messageText",class:"chat-message__text chat-message__text_".concat(t.getActiveTheme," ").concat(t.bigText&&!t.showText?"chat-message__text--over":""),domProps:{innerHTML:t._s(t.getTextMessage)}}),t.updateMode?e("div",{staticClass:"chat-message__textUpdate",model:{value:t.redactText,callback:function(e){t.redactText=e},expression:"redactText"}},[e("div",{staticClass:"chat-message__textUpdate-textArea"},[e("DxTextArea",{model:{value:t.redactText,callback:function(e){t.redactText=e},expression:"redactText"}})],1),e("Button-icon",{attrs:{iconName:"Send",modifier:"flat square"},on:{toggle:t.setUpdateMessage}})],1):t._e(),t.bigText?e("div",{class:"chat-message__text-expander chat-message__text-expander_".concat(t.getActiveTheme," ").concat(t.showText?"chat-message__text-expander--open":""),on:{click:t.toggleText}},[e("svgIcon",{attrs:{name:t.showText?"Arrow-expand-top":"Arrow-expand-bottom"}}),t._v(t._s(t.showText?t.$t("rollUp"):t.$t("expand")))],1):t._e(),e("div",{staticClass:"chat-message__controls"},[t.getStatusAddThread&&t.getStatusRecent?e("div",{class:"chat-message__actionsSvg chat-message__actionsSvg_".concat(t.getActiveTheme),on:{click:t.openThread}},[this.userMessage.t?t._e():e("svgIcon",{attrs:{name:"commentChat",size:24}}),e("div",{class:"chat-message__dCount chat-message__dCount_".concat(t.getActiveTheme)},[t._v(t._s(this.userMessage.tcount))])],1):t._e(),e("div",{class:"chat-message__actionsSvg chat-message__actionsSvg_".concat(t.getActiveTheme),staticStyle:{display:"flex"}},[t.getEmojiStatus?e("div",{ref:"smile",on:{click:t.toggleEmoji}},[e("svgIcon",{attrs:{name:"smile",size:20}})],1):t._e(),t.userMessage.reactions?e("div",{staticClass:"chat-message__controls-smile"},t._l(t.userMessage.reactions,(function(i,o){return e("div",[t._v(t._s(t.getViewEmoji(o))+" "+t._s(i.usernames.length))])})),0):t._e(),e("DxPopup",{attrs:{visible:t.openEmoji,closeOnOutsideClick:!0,fullScreen:!1,shading:!1,showTitle:!1,width:"32px",height:"auto"}},[t._l(t.emojiList,(function(i,o){return e("List-item",{key:o,on:{clickListItem:function(e){return t.setReaction(i.command)}}},[e("span",{domProps:{innerHTML:t._s(i.code)}})])}))],2)],1),t.getMutedStatus?e("div",{class:"chat-message__actionsSvg chat-message__actionsSvg_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"mic-no-accept",size:19}})],1):t._e()])]),t.getTextMessage.status?t._e():e("div",{staticClass:"chat-message__menuPart"},[t.getStatusMessageControlMenu?e("div",{class:"chat-message__menuPart-icon chat-message__menuPart-icon_".concat(t.getActiveTheme),on:{click:t.toggleOptionList}},[e("svgIcon",{attrs:{name:"Menu-dot"}})],1):t._e(),e("Dropdown-menu",{ref:"messDropdown",staticClass:"chat-message__dropdown-opt",class:{"chat-message__dropdown-opt--posUp":t.dropdownPos},attrs:{isOpen:t.optionListOpen}},[t._l(t.getOptionsList,(function(i,o){return e("div",{key:o},[i.status?e("List-item",{attrs:{iconName:i.icon},on:{clickListItem:i.event}},[t._v(t._s(i.text))]):t._e()],1)})),t.ownerGoup&&!t.owner&&"d"!==t.getTypeRoom?e("ListItem",{attrs:{iconName:"mic-no-accept",text:"Заглушить"}},[e("template",{slot:"after"},[e("Toggle",{attrs:{value:t.getMutedStatus},on:{toggle:t.setMuteStatus}})],1)],2):t._e()],2)],1)]):t._e()},hQ=[],pQ=i("b8f5"),gQ=i.n(pQ),fQ={components:{svgIcon:L,User:hd,ButtonIcon:Nt,DropdownMenu:vt,ListItem:le,Textarea:ph,DxTextArea:gQ.a,DxPopup:To["DxPopup"],Toggle:qo,Avatar:E},props:{status:{type:String,default:"pending",validator:function(t){return-1!==["pending","sent","read",""].indexOf(t)}},joinStatus:{type:String},new:{type:Boolean,default:!0},usersStatuses:{type:Object},users:{type:Array},owners:{type:Array,default:function(){return[]}},userMessage:{type:Object},theardsRoom:{type:Array}},data:function(){return{bigText:!1,chatLink:"https://chat.toptrader.org",showText:!1,openEmoji:!1,dropdownUp:!1,videoPlayer:null,optionsVideoPlayer:{controls:!0},emojiList:[{code:"👍",view:"👍",command:":thumbsup:"},{code:"👎",view:"👎",command:":thumbsdown:"},{code:"👏",view:"👏",command:":clap:"},{code:"😀",view:"😀",command:":grinning:"},{code:"🙂",view:"🙂",command:":slight_smile:"},{code:"😐",view:"😐",command:":neutral_face:"},{code:"🙁",view:"🙁",command:":slight_frown:"}],optionListOpen:!1,dropdownPos:!1,redactText:null,updateMode:!1,actionMenu:!1,fullMultiMedia:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserDetail:"user/getUserDetail",getSession:"auth/getSession",getChatCurrentRoom:"chat/getChatCurrentRoom",getVideoConference:"modal/getVideoConferenceStatus",getChatCurrentThread:"chat/getChatCurrentThread",getApiChat:"api/apiChat",getApiUrl:"api/api",getChatAuth:"chat/getChatAuth",getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getOptionsList:function(){return[{id:"0",text:this.$t("profile"),icon:"User",event:this.goToProfile,status:!this.owner&&"d"!==this.getTypeRoom},{id:"1",text:this.$t("delete_message"),icon:"Delete",event:this.deleteMessage,status:this.deleteStatus},{id:"2",text:this.$t("edit"),icon:"Pencil",event:this.setUpdateMessage,status:this.updateStatus},{id:"3",text:this.$t("reply"),icon:"Format-quote",event:this.openRecent,status:this.getStatusRecent},{id:"4",text:this.$t("write"),icon:"Chat-comment",event:this.createDirectRoom,status:!this.owner&&"d"!==this.getTypeRoom},{id:"5",text:this.$t("remove_from_group"),icon:"deleteUserGroupChat",event:this.kickUser,status:this.ownerGoup&&"d"!==this.getTypeRoom&&this.getUserJoinStatusToGroup&&!this.owner},{id:"6",text:this.$t("complain"),icon:"Report-alert",event:"block",status:!this.owner&&"d"!==this.getTypeRoom}]},getEndStatusConference:function(){var t;return!(!this.IsJsonString(this.userMessage.msg)||"video_conference"!==(null===(t=this.IsJsonString(this.userMessage.msg))||void 0===t?void 0:t.msg))&&(JSON.parse(this.userMessage.msg).end||(new Date).getTime()-new Date(JSON.parse(this.userMessage.msg).begin).getTime()>18e6)},getJoinConferenceStatus:function(){var t,e,i=this;return this.IsJsonString(this.userMessage.msg)&&"video_conference"===(null===(t=this.IsJsonString(this.userMessage.msg))||void 0===t?void 0:t.msg)&&!this.getVideoConference.data&&(null===(e=this.IsJsonString(this.userMessage.msg))||void 0===e||!e.blockedUsers||!this.IsJsonString(this.userMessage.msg).blockedUsers.some((function(t){return t==="".concat(i.getUserDetail.firstName," ").concat(i.getUserDetail.lastName)})))},getStatusMessageControlMenu:function(){if(this.getOptionsList)return this.getOptionsList.some((function(t){return t.status}))},getStatusUser:function(){var t=this;return!(!this.usersStatuses||!this.usersStatuses.online)&&this.usersStatuses.online.some((function(e){return e._id===t.userMessage.u._id}))},getStatusAddThread:function(){return("c"===this.getChatCurrentRoom.t||"p"===this.getChatCurrentRoom.t)&&!this.getChatCurrentThread&&this.getSession&&"join"===this.joinStatus},getStatusRecent:function(){return this.getSession&&"join"===this.joinStatus&&!(this.userMessage.attachments&&this.userMessage.attachments.length&&this.userMessage.attachments[0].author_name)&&!this.userMessage.t},getEmojiStatus:function(){return!this.owner&&this.getSession&&"join"===this.joinStatus},getMutedStatus:function(){var t=this;if(this.getChatCurrentRoom.muted)return this.getChatCurrentRoom.muted.some((function(e){return e===t.userMessage.u.username}))},ownerGoup:function(){var t=this;return this.owners.some((function(e){return t.getUserDetail.login===e}))},isOwnerRoom:function(){var t=this;return this.owners.some((function(e){return t.userMessage.u.username===e}))},owner:function(){if(this.getUserDetail&&this.getUserDetail.login)return this.getUserDetail.login===this.userMessage.u.username},checkDelOrUpdateStatus:function(){return new Date(this.getServerTime.utcNow).getTime()-new Date(new Date(this.userMessage.ts).getTime()+6e4*new Date(this.userMessage.ts).getTimezoneOffset()).getTime()<36e5},updateStatus:function(){return this.userMessage.u.username===this.getUserDetail.login&&this.checkDelOrUpdateStatus&&!this.userMessage.t&&(!this.userMessage.attachments||!this.userMessage.attachments.length)},commentStatus:function(){return!this.userMessage.t&&this.userMessage.tcount},deleteStatus:function(){var t=this;return this.owners.some((function(e){return e===t.getUserDetail.login}))||this.userMessage.u.username===this.getUserDetail.login&&this.checkDelOrUpdateStatus},getUserName:function(){var t=this;if(this.users){var e=this.users.find((function(e){return e._id===t.userMessage.u._id}));return e?"".concat(e.username===this.getUserDetail.login?this.$t("you"):e.name," ").concat(this.isOwnerRoom?this.$t("owner"):""):this.userMessage.u.username}},getUserJoinStatusToGroup:function(){var t=this;if(this.users)return this.users.some((function(e){return e._id===t.userMessage.u._id}))},getDateAndTimeMessage:function(){return this.userMessage.ts?this.userMessage.ts.$date?new Date(this.userMessage.ts.$date).toLocaleString("ru"):new Date(this.userMessage.ts).toLocaleString("ru"):(new Date).toLocaleString("ru")},getTypeRoom:function(){if(this.getChatCurrentRoom)return this.getChatCurrentRoom.t},getIconStatus:function(){return"read"===this.status?"Msg-read":"Msg-send-delivered"},getAvaForUser:function(){return"".concat(this.chatLink,"/avatar/").concat(this.userMessage.u.username)},getTextMessage:function(){var t,e;if(!this.userMessage.t)return this.userMessage.urls&&this.userMessage.urls.length&&this.userMessage.attachments&&this.userMessage.attachments.length?"":this.IsJsonString(this.userMessage.msg)&&"video_calling"===(null===(t=this.IsJsonString(this.userMessage.msg))||void 0===t?void 0:t.msg)?{status:"i",text:"Видео звонок от ".concat(this.IsJsonString(this.userMessage.msg).from," ").concat(this.IsJsonString(this.userMessage.msg).time)}:this.IsJsonString(this.userMessage.msg)&&"video_conference"===(null===(e=this.IsJsonString(this.userMessage.msg))||void 0===e?void 0:e.msg)?{status:"a",text:"Видеоконферентцию"}:this.parseTextMessage(this.userMessage.msg);switch(this.userMessage.t){case"uj":return{status:"i",text:this.userMessage.u.username+" "+this.$t("hjtg")};case"au":return{status:"i",text:this.getNameForUser(this.userMessage.msg)?"".concat(this.getNameForUser(this.userMessage.msg)," ").concat(this.$t("added_to_group")):"".concat(this.userMessage.msg," ").concat(this.$t("added_to_group"))};case"ru":return{status:"i",text:this.userMessage.msg+" "+this.$t("removed_from_group")};case"ul":return{status:"i",text:this.userMessage.msg+" "+this.$t("left_the_group")};case"room_changed_description":return{status:"i",text:this.$t("taat")+" "+this.userMessage.msg};case"room_changed_avatar":return{status:"i",text:this.$t("acga")};case"r":return{status:"i",text:this.$t("acgnt")+" "+this.userMessage.msg};case"user-muted":return{status:"i",text:this.userMessage.msg+" "+this.$t("blocked")};case"user-unmuted":return{status:"i",text:this.userMessage.msg+" "+this.$t("hjtg")}}},getClassStatus:function(){return"sent"===this.status?"chat-message__status--sent":"chat-message__status--delivered"},getClassMsg:function(){return this.owner||!this.new||this.getTextMessage?this.owner||this.new?!this.getTextMessage.status||"i"!==this.getTextMessage.status&&"a"!==this.getTextMessage.status?void 0:"chat-message--info":"chat-message--other":"chat-message--other-new"}}),methods:{toggleText:function(){this.showText=!this.showText},kickUser:function(){var t=this,e={roomId:this.getChatCurrentRoom._id,userId:this.userMessage.u._id};this.$http.post("".concat(this.getApiChat).concat("c"===this.getTypeRoom?"channels":"groups",".kick"),JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(){t.toggleOptionList()}))},joinToConference:function(){var t=JSON.parse(this.userMessage.msg);this.$store.commit("modal/setVideoConferenceModal",{room:t.conferenceId,isModerator:!1})},goToProfile:function(){var t=this;this.$http.get("".concat(this.getApiChat,"users.info?userId=").concat(this.userMessage.u._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-type":"application/json"}}).then((function(e){var i;null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&null!==(i=i.user)&&void 0!==i&&null!==(i=i.customFields)&&void 0!==i&&i.platformUser&&t.$http.get("".concat(t.getApiUrl,"UserAccount?userId=").concat(encodeURIComponent(e.data.user.customFields.platformUser))).then((function(i){var o=i.data.accountsData.find((function(t){return t.isDefault})),n=t.$router.resolve({name:"Profile",query:{accountId:o?o.id:i.data.accountsData[0].id,userId:e.data.user.customFields.platformUser}});window.open(n.href,"_blank"),t.toggleOptionList()}))}))},IsJsonString:function(t){try{JSON.parse(t)}catch(e){return!1}return JSON.parse(t)},parseTextMessage:function(t){var e=t.split(" "),i=[];return e.forEach((function(t,e){(t.includes("http://")||t.includes("https://"))&&i.push({url:'').concat(t,""),index:e})})),i.length?(i.forEach((function(t){return e.splice(t.index,1,t.url)})),e.join(" ")):t},getViewEmoji:function(t){var e=this.emojiList.find((function(e){return e.command===t}));return e?e.view:this.emojiList[this.emojiList.length-1].view},setReaction:function(t){var e={msg:"method",method:"setReaction",id:(new Date).getTime().toString(),params:[t,this.userMessage._id]};this.$socketStream.sendCommand({ws:"chatWS",command:e}),this.toggleEmoji()},getRecentMsg:function(t){return t.split(" ").splice(2).join(" ")},getUserNameForRecentMsg:function(t){if(!this.users)return t.author_name;var e=this.users.find((function(e){return e.username===t.author_name}));return e?e.name:t.author_name},openThread:function(){this.$store.commit("chat/setChatCurrentThread",this.userMessage._id)},openRecent:function(){this.$store.commit("chat/setRecentMessage",this.userMessage),this.toggleOptionList()},setMuteStatus:function(){var t=this,e={message:JSON.stringify({msg:"method",method:this.getMutedStatus?"unmuteUserInRoom":"muteUserInRoom",params:[{rid:this.getChatCurrentRoom._id,username:this.userMessage.u.username}],id:"23"})};this.$http.post(this.getApiChat+"".concat(this.getMutedStatus?"method.call/unmuteUserInRoom":"method.call/muteUserInRoom"),JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(){t.toggleOptionList()}))},setStatusFullMultiMedia:function(){this.fullMultiMedia=!this.fullMultiMedia},getNameForUser:function(t){if(this.users){var e=this.users.find((function(e){return e.username===t}));return e?e.name:""}},deleteMessage:function(){var t=this,e={roomId:this.getChatCurrentRoom._id,msgId:this.userMessage._id};this.$http.post(this.getApiChat+"chat.delete",JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(){return t.toggleOptionList()}))},setUpdateMessage:function(){var t=this;if(!this.updateMode)return this.updateMode=!this.updateMode,this.redactText=this.userMessage.msg,void this.toggleOptionList();var e={roomId:this.getChatCurrentRoom._id,msgId:this.userMessage._id,text:this.redactText};this.$http.post(this.getApiChat+"chat.update",JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(){t.redactText=null,t.updateMode=!1}))},createDirectRoom:function(){var t=this,e={usernames:"".concat(this.userMessage.u.username,",").concat(this.getUserDetail.login)};this.$http.post(this.getApiChat+"im.create",JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.$emit("createDirect",e.data.room)}))},toggleEmoji:function(){this.openEmoji=!this.openEmoji;var t=this.$refs.smile.getBoundingClientRect().top>window.innerHeight/2;this.dropdownUp=!!t},clickOutside:function(t){this.$el.contains(t.target)&&27!==t.keyCode||(this.openEmoji=!1,this.optionListOpen=!1)},toggleOptionList:function(){var t=this;this.optionListOpen=!this.optionListOpen,this.$nextTick((function(){var e=t.$parent.$el.clientHeight,i=t.$refs.messDropdown.$el.getBoundingClientRect().bottom,o=t.$refs.messDropdown.$el.getBoundingClientRect().height;i>e?(t.dropdownPos=!0,t.$refs.messDropdown.$el.style.top=-o-4+"px"):t.dropdownPos=!1}))}},created:function(){var t=this;document.addEventListener("click",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("click",t.clickOutside)})),document.addEventListener("keydown",this.clickOutside),this.$on("hook:beforeDestroy",(function(){return document.removeEventListener("keydown",t.clickOutside)}))},mounted:function(){this.$refs.messageText&&(this.bigText=this.$refs.messageText.getBoundingClientRect().height>80),this.userMessage.attachments&&this.userMessage.attachments.length&&this.userMessage.attachments[0].video_url&&(this.videoPlayer=Object(eP["a"])(this.$refs.videoPlayer,this.optionsVideoPlayer),this.videoPlayer.src("".concat(this.chatLink).concat(this.userMessage.attachments[0].video_url)))}},mQ=fQ,vQ=(i("3a4d"),Object(C["a"])(mQ,dQ,hQ,!1,null,null,null)),yQ=vQ.exports,CQ=function(){var t=this,e=t._self._c;return e("div",{staticClass:"content-order-info",class:"".concat(t.getActiveTheme," ").concat(!t.withoutShadow&&"shadow-order")},[t.withoutClose?t._e():e("div",{staticClass:"btn-close",class:t.getActiveTheme,on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",size:14}})],1),e("div",{style:{display:"flex",marginRight:"8px"}},[e("div",{staticClass:"content-order-info__avatar",class:t.getActiveTheme},["User-profile.png"===t.order.userAvatar?e("svgIcon",{attrs:{name:"empty-avatar",size:24}}):t._e(),"User-profile.png"!==t.order.userAvatar?e("img",{attrs:{src:t.order.userAvatar}}):t._e()],1),e("div",{staticClass:"content-order-info__item-start",style:{marginRight:"8px",width:"100%"}},[e("div",{staticClass:"content-order-item__name",class:t.getActiveTheme},[t._v(t._s(t.order.userName))]),e("div",{staticClass:"content-order-item__status",style:{color:t.getColor}},[t._v(t._s(t.descriptionInModalStatus?"".concat(t.descriptionInModalStatus):"Closed"===t.order.status?"Closed order":"Open order")+" ")])])]),e("div",{staticClass:"content-order-info__item-start",style:{marginRight:"16px"}},[e("div",{staticClass:"content-order-item__box",style:{marginBottom:"1.8px"}},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme},[t._v("Price open:")]),e("div",{staticClass:"content-order-item__value",class:t.getActiveTheme},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"content-order-item__box"},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme},[t._v("Date:")]),e("div",{staticClass:"content-order-item__value",class:t.getActiveTheme},[t._v(t._s("".concat(new Date(t.order.openDate).toLocaleDateString()," ").concat(t.getTime)))])])]),e("div",{staticClass:"content-order-info__order-type",style:{color:t.getColor}},[e("svgIcon",{attrs:{name:"Buy"===t.order.orderType?"Arrow-nano-top":"Arrow-nano-bottom"}}),e("div",{staticClass:"content-order-info__type"},[t._v(t._s(t.order.orderType))]),e("div",{staticClass:"content-order-info__volume"},[t._v(t._s(t.order.volume)),t.isShowSymbol?e("div",[t._v(t._s(t.order.contractName))]):t._e()])],1)])},bQ=[],SQ={name:"CloseOrderInfo",mixins:[],components:{svgIcon:L,DxDraggable:Se.a},props:{order:{type:Object,required:!0},type:{default:""},descriptionInModalStatus:{default:void 0},withoutShadow:{default:!1},withoutClose:{default:!1},isShowSymbol:{default:!1}},mounted:function(){},destroyed:function(){},methods:{close:function(){this.$emit("closeModal")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getColor:function(){var t={dark:{Buy:"#1EF0B1",Sell:"#FF3232"},light:{Buy:"#008E72",Sell:"#E91212"}};return t[this.getActiveTheme][this.order.orderType]},getTime:function(){var t="".concat(new Date(this.order.createdDate).getHours()).length<2?"0".concat(new Date(this.order.createdDate).getHours()):"".concat(new Date(this.order.createdDate).getHours()),e="".concat(new Date(this.order.createdDate).getMinutes()).length<2?"0".concat(new Date(this.order.createdDate).getMinutes()):"".concat(new Date(this.order.createdDate).getMinutes());return"".concat(t,":").concat(e)}}),watch:{},data:function(){return{}}},PQ=SQ,TQ=(i("805a4"),Object(C["a"])(PQ,CQ,bQ,!1,null,null,null)),xQ=TQ.exports,OQ=[".jpg",".jpeg",".gif",".png",".pdf",".docx",".doc",".zip",".rar",".mp3",".mp4",".avi",".wav",".mpeg",".mpg",".mov",".bmp",".pot",".potx",".pps",".ppt",".psd",".rtf",".txt",".tif",".tiff",".vob",".wma",".xls",".xlsx"],wQ="https://chat.toptrader.org",_Q={props:{mode:{type:String,default:"private"},theardsRoom:{type:Array},joinStatus:{type:String},listUsers:{default:null},countNewMessage:{type:Number}},components:{VuePerfectScrollbar:Xt.a,ChatMessage:yQ,Order:xQ,Avatar:E,svgIcon:L,Preloader:ah},data:function(){return{message:"chatSendFile",serverError:!1,iconDropZone:"Plus",allowFiles:OQ,messages:null,statusUsersRoom:null,subsIds:[],idHistoryPrivateGroup:"",ownersRoom:[],discusMessage:null,dropZoneActiveStatus:!1,timerForDropLeave:null,preloaderStatus:!1,noSendedFiles:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getChatCurrentThread:"chat/getChatCurrentThread",getChatAuth:"chat/getChatAuth",getApiChatUrl:"api/apiChat",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getDateDiscusMsg:function(){if(this.discusMessage)return this.discusMessage.tlm?new Date(this.discusMessage.tlm.$date).toLocaleString("ru"):new Date(this.discusMessage.ts.$date).toLocaleString("ru")},getNameUserForDiscusMsg:function(){var t=this;if(this.discusMessage&&this.listUsers)return this.listUsers.find((function(e){return e._id===t.discusMessage.u._id})).name},getAvaForUserDiscusMsg:function(){if(this.discusMessage)return"".concat(wQ,"/avatar/").concat(this.discusMessage.u.username)}}),watch:{getChatCurrentRoom:function(){this.getHistoryRoom()},getChatCurrentThread:function(t){t||(this.discusMessage=null),this.getHistoryRoom()},countNewMessage:function(){this.getHistoryRoom()}},methods:{getInfoMesssageStatus:function(t){return"private"===this.mode||("private"!==this.mode&&!t.t||void 0)},getIsOrder:function(t){if(t){if(this.isJson(t.msg)){var e=JSON.parse(t.msg);if("number"===typeof e||!e)return;return e.orderType=e.orderType?"Sell":"Buy",!!e.openPrice&&e}return!1}},isJson:function(t){try{JSON.parse(t)}catch(e){return!1}return!0},returnDefaultStatus:function(){this.dropZoneActiveStatus=!1,this.preloaderStatus=!1,this.message="chatSendFile",this.iconDropZone="Plus",this.serverError=!1,this.noSendedFiles=[]},checkExtentionFiles:function(t){var e=t.name.split("."),i=".".concat(e[e.length-1]);return this.allowFiles.some((function(t){return t===i}))},sendFile:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=new FormData,o.append("file",t),e.preloaderStatus=!0,i.next=5,e.$http.post("".concat(e.getApiChatUrl,"rooms.upload/").concat(e.getChatCurrentRoom._id),o,{headers:{"X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId,"Content-Type":"multipart/form-data"}}).catch((function(){e.serverError=!0}));case 5:case"end":return i.stop()}}),i)})))()},previewFile:function(t){var e=new FileReader;e.readAsDataURL(t),e.onloadend=function(){var t=document.createElement("img");t.src=e.result,document.getElementById("gallery").appendChild(t)}},onDropFile:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.preventDefault(),o=Object(x["a"])(t.dataTransfer.files),!(o.length>5)){i.next=7;break}return e.iconDropZone="Warning",e.message="maxFileCountSendFileChart",setTimeout((function(){e.returnDefaultStatus()}),2e3),i.abrupt("return");case 7:return i.next=9,Promise.all(o.map(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(i,n){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.checkExtentionFiles(i)&&i.size<=5e7)){t.next=5;break}return t.next=3,e.sendFile(i,n,o.length);case 3:t.next=6;break;case 5:e.noSendedFiles.push(i.name);case 6:case"end":return t.stop()}}),t)})));return function(e,i){return t.apply(this,arguments)}}())).then((function(){if(e.serverError)return e.preloaderStatus=!1,e.message="errorSendFileChart",e.iconDropZone="Warning",void setTimeout((function(){e.returnDefaultStatus()}),2e3);e.noSendedFiles.length?(e.preloaderStatus=!1,e.message="noSendedFilesChat",e.iconDropZone="Warning",setTimeout((function(){e.returnDefaultStatus()}),2e3)):e.returnDefaultStatus()})).catch((function(){e.preloaderStatus=!1,e.message="errorSendFileChart",e.iconDropZone="Warning",setTimeout((function(){e.returnDefaultStatus()}),2e3)}));case 9:case"end":return i.stop()}}),i)})))()},dragenterZone:function(){this.dropZoneActiveStatus=!0},dragleaveZone:function(t){var e=this;this.timerForDropLeave&&clearTimeout(this.timerForDropLeave),this.timerForDropLeave=setTimeout((function(){e.$refs.dropZone.contains(t.target)&&(e.dropZoneActiveStatus=!1)}),1e3)},dragOverHandler:function(t){t.preventDefault(),this.timerForDropLeave&&clearTimeout(this.timerForDropLeave),this.dropZoneActiveStatus=!0},getRolesRoom:function(){var t={msg:"method",method:"getRoomRoles",id:"getRolesRoom",params:[this.getChatCurrentRoom._id]};this.$socketStream.sendCommand({ws:"chatWS",command:t})},getStatusUsersForChannel:function(){var t=this;this.$http.get(this.getApiChatUrl+"channels.online?query=".concat(JSON.stringify({_id:this.getChatCurrentRoom._id})),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.statusUsersRoom=e.data}))},getStatusUsersPrivateGroup:function(){var t=this;this.$http.get(this.getApiChatUrl+"groups.online?query=".concat(JSON.stringify({_id:this.getChatCurrentRoom._id})),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.statusUsersRoom=e.data}))},setReadMessage:function(){var t={message:JSON.stringify({msg:"method",method:"readMessages",params:[this.getChatCurrentRoom._id],id:Math.random().toString(36).substring(7)})};this.$http.post("".concat(this.getApiChatUrl,"method.call/readMessages"),JSON.stringify(t),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-Type":"application/json"}}).then((function(){}))},getHistoryForDirectRoom:function(){var t=this;this.$http.get("".concat(this.getApiChatUrl,"im.history?roomId=").concat(this.getChatCurrentRoom._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.messages=e.data.messages.reverse(),t.$emit("membersRoom",t.listUsers),t.$emit("readyStatus","ready"),t.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))}))},getHistoryRoomForChannel:function(){var t=this;this.$http.get("".concat(this.getApiChatUrl,"channels.history?roomId=").concat(this.getChatCurrentRoom._id,"&count=100"),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.messages=e.data.messages.reverse(),t.getStatusUsersForChannel(),t.$emit("readyStatus","ready"),t.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))}))},getHistoryRoomForThread:function(){var t=this,e={message:JSON.stringify({msg:"method",method:"getThreadMessages",params:[{tmid:this.getChatCurrentThread}],id:"57"})};this.$http.post("".concat(this.getApiChatUrl,"method.call/getThreadMessages"),JSON.stringify(e),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.messages=JSON.parse(e.data.message).result.reverse(),t.discusMessage=t.messages[t.messages.length-1],t.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))}))},getHistoryRoomForPrivateGroup:function(){var t=this;this.$http.get("".concat(this.getApiChatUrl,"groups.history?roomId=").concat(this.getChatCurrentRoom._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.messages=e.data.messages.reverse(),t.getStatusUsersPrivateGroup(),t.$emit("readyStatus","ready"),t.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))}))},getHistoryRoom:function(){"c"!==this.getChatCurrentRoom.t||this.getChatCurrentThread?"p"!==this.getChatCurrentRoom.t||this.getChatCurrentThread?"d"!==this.getChatCurrentRoom.t||this.getChatCurrentThread?this.getChatCurrentThread&&this.getHistoryRoomForThread():this.getHistoryForDirectRoom():this.getHistoryRoomForPrivateGroup():this.getHistoryRoomForChannel()},setMessageHendler:function(t){t&&"changed"===t.msg&&"stream-room-messages"===t.collection?this.addNewMessage(t.fields):t&&"changed"===t.msg&&"stream-notify-room"===t.collection?this.getHistoryRoom():t&&"changed"===t.msg&&"stream-notify-logged"===t.collection?this.setNewStatusUser(t.fields):t&&"result"===t.msg&&t.id===this.idHistoryPrivateGroup?(this.messages=t.result.messages.reverse(),this.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))):t&&"result"===t.msg&&"getRolesRoom"===t.id&&this.getOwnersRoom(t.result)},getOwnersRoom:function(t){var e=this;this.ownersRoom=[],t.forEach((function(t){t.roles.some((function(t){return"owner"===t}))&&e.ownersRoom.push(t.u.username)}))},setNewStatusUser:function(t){if(this.statusUsersRoom){var e=this.statusUsersRoom.online.findIndex((function(e){return t.args[0][0]===e._id}));1===t.args[0][2]&&e>0||(1===t.args[0][2]&&e<0?this.statusUsersRoom.online.push({_id:t.args[0][0],username:t.args[0][1]}):1!==t.args[0][2]&&e>0&&this.statusUsersRoom.online.splice(e,1))}},createDirectRoom:function(t){this.$emit("createNewRoom",t)},addNewMessage:function(t){var e=this;if(t.args.some((function(t){return t.editedAt})))this.getHistoryRoom();else{var i=this.messages.findIndex((function(e){return e._id===t.args[0]._id}));i>0||0===i?(t.args[0].ts=t.args[0].ts.$date,this.messages.splice(i,1,t.args[0])):t.args.forEach((function(t){var i=t.ts.$date;t.ts=i,e.messages.push(t),e.$nextTick((function(){var t=document.querySelector("#container");t.scrollTop=t.scrollHeight}))})),this.setReadMessage()}}},mounted:function(){this.$socketStream.$on("chatWS",this.setMessageHendler),this.getHistoryRoom(),this.setReadMessage(),this.getRolesRoom()},destroyed:function(){this.$emit("readMessage"),this.$socketStream.$off("chatWS",this.setMessageHendler)}},AQ=_Q,DQ=(i("8af1"),Object(C["a"])(AQ,lQ,uQ,!1,null,null,null)),kQ=DQ.exports,IQ=i("8468"),BQ=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat__nav"},[e("DxSelectBox",{directives:[{name:"debounce",rawName:"v-debounce:1s",value:t.setSearchUser,expression:"setSearchUser",arg:"1s"}],attrs:{items:t.searchContacts,grouped:!0,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,"drop-down-button-template":"searchIcon",dropDownOptions:t.dropDownOptions,"item-template":"user","field-template":"fieldUser","search-enabled":!0,noDataText:t.getNoDataText(),elementAttr:t.getSelectBoxAttr,"debounce-events":"input"},on:{itemClick:t.setItemSerchList},scopedSlots:t._u([{key:"searchIcon",fn:function(t){return Object(IQ["a"])(t),[e("div",{staticStyle:{display:"none"}})]}},{key:"group",fn:function(i){var o=i.data;return[e("div",[t._v(t._s(o.key))])]}},{key:"fieldUser",fn:function(i){i.data;return[e("DxTextBox",{attrs:{placeholder:t.getPlaceholderText(),"show-clear-button":!0,value:t.searchText}})]}},{key:"user",fn:function(i){var o=i.data;return[e("div",{staticClass:"chat__searchItem"},[e("User",{attrs:{name:o.name,online:"online"===o.status,ava:t.getAvatarUrl(o)}},[o.t?e("svgIcon",{attrs:{name:"filled-group"}}):t._e()],1)],1)]}}])}),e("div",{staticClass:"chat_nav_btns",staticStyle:{display:"flex",width:"7rem","justify-content":"space-between"}},[e("ButtonIconFlat",{attrs:{icon:{name:"Add"},modifier:{class:["buttonFlat-icon","buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(this.getActiveTheme)],style:{boxShadow:"0px 0px 5px 0px rgba(0, 0, 0, 0.1)",borderRadius:"0.6rem"}}},on:{toggle:t.createRoom}}),"/chat"!==t.getActiveRoute?e("ButtonIconFlat",{attrs:{icon:{name:"InNewWindow"},modifier:{class:["buttonFlat-icon","buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(this.getActiveTheme)],style:{boxShadow:"0px 0px 5px 0px rgba(0, 0, 0, 0.1)",borderRadius:"0.6rem"}}},on:{click:t.openChatNewWindow}}):t._e()],1)],1)},MQ=[],$Q="https://chat.toptrader.org",LQ={components:{DxSelectBox:Bo.a,DxTextBox:rc.a,svgIcon:L,vueDebounce:kR.a,User:hd,ButtonIconFlat:Le},data:function(){return{searchText:"",idSerachUsers:"",searchContacts:[],statusSearchInput:!1,dropDownOptions:{container:".chat__nav-selectBox",elementAttr:{id:"popuSearch-id",class:"chat__nav-popupSearch",position:{my:"left top",at:"center",offset:"50 50",of:window}},width:345}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserDetail:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme",getApiChat:"api/apiChat",getChatAuth:"chat/getChatAuth"})),{},{getClearButton:function(){return Boolean(this.searchText)},getSelectBoxAttr:function(){return{id:"chat__nav-selectBoxId",class:"chat__nav-selectBox chat__nav-selectBox_".concat(this.getActiveTheme)}},getActiveRoute:function(){return this.$route.path}}),methods:{getNoDataText:function(){return this.$t("tanuw")},getPlaceholderText:function(){return this.$t("sfagoc")},createRoom:function(){this.$emit("createNewRoom")},showSearchInput:function(){this.statusSearchInput=!this.statusSearchInput},searchUsers:function(){this.idSerachUsers=Math.random().toString(36).substring(7);var t={msg:"method",id:this.idSerachUsers,method:"spotlight",params:[this.searchText,["guest","admin"],{users:!0,rooms:!0}]};this.$socketStream.sendCommand({ws:"chatWS",command:t})},setMessageHendler:function(t){if(t&&"result"===t.msg&&t.id===this.idSerachUsers){if(!t.result.users.length&&!t.result.rooms.length)return void(this.searchContacts=[]);this.searchContacts=[{key:"Люди",items:this.filterUser(t.result.users)},{key:"Группы",items:t.result.rooms}]}},getAvatarUrl:function(t){return t.t?"".concat($Q,"/avatar/room/").concat(t._id):"".concat($Q,"/avatar/").concat(t.username)},filterUser:function(t){return t.filter((function(t){return"guest"!==t.username&&"admin"!==t.username}))},openChatNewWindow:function(){var t=this.$router.resolve({name:"Chat",query:{roomId:""}}),e="scrollbars=no,resizable=yes,left=100,top=100,status=no,location=no,toolbar=no,menubar=no,\n width=370,height=700";window.open(t.href,"Чат",e)},setSearchUser:function(t){this.searchText=t,this.searchText?this.searchUsers():this.searchContacts=[]},setItemSerchList:function(t){t.itemData.t?this.$emit("openChat",{rid:t.itemData._id}):this.createDirectRoom(t)},createDirectRoom:function(t){var e=this,i={usernames:"".concat(t.itemData.username,",").concat(this.getUserDetail.login)};this.$http.post(this.getApiChat+"im.create",JSON.stringify(i),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(t){e.$emit("openChat",t.data.room)}))}},mounted:function(){this.$socketStream.$on("chatWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.$off("chatWS",this.setMessageHendler)}},FQ=LQ,jQ=(i("b1a6"),Object(C["a"])(FQ,BQ,MQ,!1,null,"4ce4742e",null)),RQ=jQ.exports,WQ=function(){var t=this,e=t._self._c;return e("div",{class:"chat__aboutGroup chat__aboutGroup_".concat(t.getActiveTheme)},["access"===t.accessStatus?e("div",{class:"chat__aboutGroup-closeIcon chat__aboutGroup-closeIcon_".concat(t.getActiveTheme),on:{click:t.closeAboutGroup}},[e("svgIcon",{attrs:{name:"Close"}})],1):t._e(),e("div",{staticClass:"chat__aboutGroup-mainBlock"},[e("div",{staticClass:"chat__aboutGroup-mainBlock-avatar"},[e("Avatar",{attrs:{size:"7",src:t.getAvatarGroup,theme:t.getActiveTheme}}),t.getChatCurrentRoom.customFields.paidGroup?e("div",{class:"chat__aboutGroup-mainBlock-avatar-icon chat__aboutGroup-mainBlock-avatar-icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:t.getStatusPaidGroup}})],1):t._e()],1),e("div",{staticClass:"chat__aboutGroup-mainBlock-name"},[e("div",{class:"chat__aboutGroup-mainBlock-name_icon chat__aboutGroup-mainBlock-name_icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"c"===t.getTypeRoom?"Groups":"Lock-ON"}})],1),e("div",{class:"chat__aboutGroup-mainBlock-name_text chat__aboutGroup-mainBlock-name_text_".concat(t.getActiveTheme)},[t._v(t._s(t.getChatCurrentRoom.name))])]),t.getChatCurrentRoom.customFields.paidGroup&&t.getChatCurrentRoom.customFields.paidGroup.addMySubs?e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd"},[e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd_icon"},[e("svgIcon",{attrs:{name:"Check"}})],1),e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd_text"},[t._v(t._s(t.$t("chatAboutText05")))])]):t._e(),t.statusSendInvate?e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd"},[e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd_icon"},[e("svgIcon",{attrs:{name:"Check"}})],1),e("div",{staticClass:"chat__aboutGroup-mainBlock-subsAdd_text"},[t._v(t._s(t.$t("chatAboutText06"))+"."),e("br"),t._v(t._s(t.$t("chatAboutText07"))+".")])]):t._e(),t.getTypePaidGroup&&!t.getStatusOwnerGroup?e("div",{staticStyle:{display:"flex","flex-direction":"column","align-items":"center"}},[e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup"},[e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup_price"},[t._v(t._s(t.getChatCurrentRoom.customFields.paidGroup.price)+" T-COIN/"+t._s(t.getPaidPeriod))]),"access"===t.getDemoPariodStatus?e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup_demo"},[t._v(t._s(t.$t("chatAboutText08"))+": "+t._s(t.getChatCurrentRoom.customFields.paidGroup.demo)+" "+t._s(t.$t("chatAboutText09")))]):t._e(),"expired"===t.getDemoPariodStatus&&"access"!==t.accessStatus?e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup_demo"},[t._v(t._s(t.$t("chatAboutText10")))]):t._e(),"process"===t.getDemoPariodStatus?e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup_demo"},[t._v(t._s(t.$t("chatAboutText11"))+"."),e("br"),t._v(t._s(t.$t("chatAboutText12"))+": "+t._s(t.getDemoPeriodExpiredDate))]):t._e(),"expired"!==t.getDemoPariodStatus&&"no-demo"!==t.getDemoPariodStatus||"access"!==t.accessStatus?t._e():e("div",{staticClass:"chat__aboutGroup-mainBlock-priceGroup_demo"},[t._v(t._s(t.$t("chatAboutText13"))+"."),e("br"),t._v(t._s(t.$t("chatAboutText14"))+": "+t._s(t.getPeriodExpiredDate))])]),t.invoiceForPayment||"access"===t.accessStatus?t._e():e("div",{staticClass:"chat__aboutGroup-mainBlock-subsButton"},[t.invoiceForPayment?t._e():e("Button",{attrs:{disabled:t.statusSendInvate},on:{click:t.subsOnGroup}},[t._v(t._s(t.getTextSubsButton))])],1),!t.invoiceForPayment||"access"===t.accessStatus||"expired"!==t.getDemoPariodStatus&&"no-demo"!==t.getDemoPariodStatus?t._e():e("div",{staticClass:"chat__aboutGroup-mainBlock-subsButton"},[e("Button",{attrs:{disabled:t.statusSendInvate,modifier:"green"},on:{click:t.paymentInvoice}},[t._v(t._s(t.$t("chatAboutText15")))])],1)]):t._e(),t.getTypePaidGroup||t.getStatusOwnerGroup?t._e():e("div",[e("div",{staticClass:"chat__aboutGroup-mainBlock-subsButton"},["join"===t.joinStatus||t.getInvateStatus?t._e():e("ButtonIconFlat",{attrs:{modifier:{class:["chat__aboutGroup-button","chat__aboutGroup-button_".concat(t.getActiveTheme)]}},on:{click:t.joinToGroup}},[t._v(t._s(t.$t("chatAboutText16")))]),"join"!==t.joinStatus&&t.getInvateStatus?e("ButtonIconFlat",{attrs:{disabled:t.statusSendInvate,modifier:{class:["chat__aboutGroup-button","chat__aboutGroup-button_".concat(t.getActiveTheme)]}},on:{click:t.createRequestInvate}},[t._v(t._s(t.$t("chatAboutText17")))]):t._e(),"join"===t.joinStatus?e("ButtonIconFlat",{attrs:{disabled:t.statusSendInvate,modifier:{class:["chat__aboutGroup-button","chat__aboutGroup-button_".concat(t.getActiveTheme)]}},on:{click:t.leaveGroup}},[t._v(t._s(t.$t("chatAboutText18")))]):t._e()],1)])]),e("div",{staticClass:"chat__aboutGroup-infoBlock"},[e("div",{staticClass:"chat__aboutGroup-stat"},[e("div",{class:"chat__aboutGroup-statTitle chat__aboutGroup-statTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chatAboutText19")))]),e("div",{staticClass:"chat__aboutGroup-statData"},[e("div",{staticClass:"chat__aboutGroup-contact"},[t.user?e("div",{staticClass:"chat__aboutGroup-contact_infoUser"},[e("div",{staticClass:"chat__aboutGroup-contact_avatar"},[e("Avatar",{attrs:{size:"4.4",src:t.getUserAvatar,theme:t.getActiveTheme}})],1),e("div",{staticClass:"chat__aboutGroup-contact_name"},[e("div",{class:"chat__aboutGroup-contact_name-name chat__aboutGroup-contact_name-name_".concat(t.getActiveTheme)},[t._v(t._s(t.user.name))]),e("div",{class:"chat__aboutGroup-contact_name-date chat__aboutGroup-contact_name-date_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chatAboutText20"))+" "+t._s(new Date(t.user.createdAt).toLocaleString("ru")))])])]):t._e()])])]),e("div",{staticClass:"chat__aboutGroup-stat"},[e("div",{class:"chat__aboutGroup-statTitle chat__aboutGroup-statTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chatAboutText21")))]),e("div",{staticClass:"chat__aboutGroup-statData"},[e("div",{staticClass:"chat__aboutGroup-statistic"},[e("div",{staticClass:"chat__aboutGroup-statistic_row"},[e("div",{staticClass:"chat__aboutGroup-statistic_item"},[e("div",{class:"chat__aboutGroup-statistic_item-metric chat__aboutGroup-statistic_item-metric_".concat(t.getActiveTheme)},[t._v(t._s(t.getChatCurrentRoom.usersCount))]),e("div",{class:"chat__aboutGroup-statistic_item-title chat__aboutGroup-statistic_item-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chatAboutText22")))])]),e("div",{staticClass:"chat__aboutGroup-statistic_item"},[e("div",{class:"chat__aboutGroup-statistic_item-metric chat__aboutGroup-statistic_item-metric_".concat(t.getActiveTheme)},[t._v(t._s(t.getCreateGroupDate))]),e("div",{class:"chat__aboutGroup-statistic_item-title chat__aboutGroup-statistic_item-title_".concat(t.getActiveTheme)},[t._v("Дата создания")])])])])])]),t.getTagsGroup?e("div",{staticClass:"chat__aboutGroup-stat"},[e("div",{class:"chat__aboutGroup-statTitle chat__aboutGroup-statTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("chatAboutText23")))]),e("div",{staticClass:"chat__aboutGroup-statData"},[e("div",{class:"chat__aboutGroup-tags chat__aboutGroup-tags_".concat(t.getActiveTheme)},[t._v(t._s(t.getTagsGroup))])])]):t._e()])])},NQ=[],EQ="https://chat.toptrader.org",UQ={components:{Avatar:E,svgIcon:L,Button:Pa},props:{theardsRoom:{type:Array},joinStatus:{type:String},accessStatus:{type:[String,Boolean]},openMode:{type:String}},data:function(){return{LangChangeTaker:pa,user:null,invateThreads:null,statusSendInvate:!1,invoiceForPayment:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getPaymentReference:"paymentService/getPaymentReference",getChatApiUrl:"api/apiChat",getChatAuth:"chat/getChatAuth",getUserDetail:"user/getUserDetail",getApiUrl:"api/api",getSession:"auth/getSession",getUserPaymentServices:"paymentService/getUserPaymentServices",getUserInvoices:"paymentService/getUserInvoices",getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getDemoPeriodExpiredDate:function(){var t=this;if("process"===this.getDemoPariodStatus){var e=this.getUserPaymentServices.find((function(e){return e.externalId===t.getChatCurrentRoom._id&&1===e.periodId}));return new Date(e.activeDueDateTime).toLocaleString("ru")}},getPeriodExpiredDate:function(){var t=this;if("process"!==this.getDemoPariodStatus&&"no-access"!==this.accessStatus){var e=this.getUserPaymentServices.filter((function(e){return e.externalId===t.getChatCurrentRoom._id&&1!==e.periodId})),i=e.find((function(e){return new Date(e.activeDueDateTime).getTime()>new Date(t.getServerTime.now).getTime()}));return new Date(i.activeDueDateTime).toLocaleString("ru")}},getDemoPariodStatus:function(){var t=this;if(!this.getTypePaidGroup||!this.getUserPaymentServices)return"no-demo";if(!this.getUserPaymentServices.length&&this.getTypePaidGroup)return"access";var e=this.getUserPaymentServices.filter((function(e){return e.externalId===t.getChatCurrentRoom._id}));if(!e.length)return"access";var i=e.find((function(t){return 1===t.periodId}));return i?new Date(i.activeDueDateTime).getTime()>new Date(this.getServerTime.now).getTime()?"process":new Date(i.activeDueDateTime).getTime()=0&&(t.miliSeconds--,t.miliSeconds<0&&(t.miliSeconds=99,t.seconds--))}),10)}))},clearFoto:function(){this.videoPlayer&&this.videoPlayer.reset(),this.errorCodec&&(this.errorCodec=!1),this.modeRecordVideo&&(this.modeRecordVideo=!1),this.mediaRecorder=null,this.mode="videoStream"},getMediaDevices:function(){var t=this;window.navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then((function(e){t.streamObject=e,t.video.srcObject=e,t.video.muted=!0,t.video.play(),t.errorSetupCam=!1})).catch((function(){t.errorSetupCam=!0}))},beginStreaming:function(){this.streaming||(this.height=this.video.videoHeight/(this.video.videoWidth/this.width),this.streaming=!0)}},mounted:function(){this.video=document.getElementById("videoPreview"),this.canvas=document.getElementById("canvas"),this.photo=document.getElementById("photo")},destroyed:function(){this.streamObject&&this.streamObject.getTracks().forEach((function(t){t.stop()}))},beforeDestroy:function(){this.videoPlayer&&this.videoPlayer.dispose()}},wJ=OJ,_J=(i("4ff9"),Object(C["a"])(wJ,TJ,xJ,!1,null,null,null)),AJ=_J.exports,DJ=function(){var t=this,e=t._self._c;return e("Modal",{staticClass:"chat-audioMessage",attrs:{isOpen:!0,width:"320",title:t.$t("audio_message")},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return["start"===t.mode?e("div",{staticClass:"chat-videoMessage-start"},[e("ButtonIconFlat",{attrs:{icon:{name:"MicOn"},modifier:{class:["chat-videoMessage_buttonFoto","chat-videoMessage_buttonFoto-green"]}},on:{click:t.recordAudio}},[t._v(t._s(t.$t("start_recording")))])],1):t._e(),"record"===t.mode?e("div",{staticClass:"chat-videoMessage-timer",staticStyle:{display:"flex","justify-content":"space-between","align-items":"center",width:"100%"}},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["chat-videoMessage_buttonFoto","chat-videoMessage_buttonFoto-red"]}},on:{click:t.stopRecordAudio}},[t._v(t._s(t.$t("stop_recording")))]),e("div",{class:"chat-audioMessage-timer chat-audioMessage-timer_".concat(t.getActiveTheme)},[t._v(t._s(t.getTimerTime))])],1):t._e(),"player"===t.mode?e("div",{staticClass:"chat-videoMessage-startt"},[e("av-waveform",{attrs:{"audio-src":t.audioFileSrc,"canv-width":300,"canv-height":50,"played-line-color":"dark"===t.getActiveTheme?"#00b9fc":"#2462db","noplayed-line-color":"dark"===t.getActiveTheme?"#bbcee0":"#8c8c8c"}})],1):t._e()]},proxy:!0},"player"===t.mode?{key:"modal-footer",fn:function(){return[e("div",{staticClass:"chat-audioMessage-buttons"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["chat-videoMessage_buttonFoto","chat-videoMessage_buttonFoto-red"]}},on:{click:t.clearAudio}},[t._v(t._s(t.$t("cancel")))]),e("ButtonIconFlat",{attrs:{icon:{name:"Send"},modifier:{class:["chat-videoMessage_buttonFoto","chat-videoMessage_buttonFoto-blue"]}},on:{click:t.sendAudio}},[t._v(t._s(t.$t("send")))])],1)]},proxy:!0}:null],null,!0)})},kJ=[],IJ={components:{Modal:Oe,ButtonLabel:Z},data:function(){return{errorSetupMic:!1,streamObject:null,recorder:null,seconds:0,minutes:0,miliSeconds:0,audioFileSrc:0,timerRecord:null,recordedChunks:[],mode:"start",types:["audio/basic","audio/L24","audio/mp4","audio/aac","audio/mpeg","audio/ogg","audio/vorbis","audio/x-ms-wma","audio/x-ms-wax","audio/vnd.rn-realaudio","audio/vnd.wave","audio/webm"]}},computed:Object(c["a"])({getTimerTime:function(){return"".concat(this.minutes<10?"0"+this.minutes:this.minutes,":").concat(this.seconds<10?"0"+this.seconds:this.seconds,":").concat(this.miliSeconds<10?"0"+this.miliSeconds:this.miliSeconds)}},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getActiveTheme:"headerSettings/getActiveTheme",getChatAuth:"chat/getChatAuth",getApiChatUrl:"api/apiChat"})),methods:{close:function(){this.$emit("close")},getSuport:function(){this.types.filter((function(t){return MediaRecorder.isTypeSupported(t)}))},recordAudio:function(){var t=this;this.mode="record",this.startTimer(),this.recorder=new MediaRecorder(this.streamObject),this.recorder.ondataavailable=function(e){return t.handleDataAvailable(e)},this.recorder.start(),this.recorder.onerror=function(t){throw t.error||new Error(t.name)},this.recorder.onstop=function(){window.webkitURL?t.audioFileSrc=window.webkitURL.createObjectURL(new Blob(t.recordedChunks,{type:"audio/mpeg"})):window.URL&&window.URL.createObjectURL&&(t.audioFileSrc=window.URL.createObjectURL(t.recordedChunks)),t.mode="player"}},stopRecordAudio:function(){clearInterval(this.timerRecord),this.recorder.stop()},clearAudio:function(){this.mode="start",this.seconds=0,this.minutes=0,this.miliSeconds=0},sendAudio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=new File([new Blob(t.recordedChunks,{type:"audio/mpeg"})],"".concat(t.getChatCurrentRoom._id).concat(t.getChatAuth.userId,".mp3"),{type:"audio/mpeg"}),o=new FormData,o.append("file",i),t.$http.post("".concat(t.getApiChatUrl,"rooms.upload/").concat(t.getChatCurrentRoom._id),o,{headers:{"X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId,"Content-Type":"multipart/form-data"}}).then((function(){return t.$emit("close")}));case 4:case"end":return e.stop()}}),e)})))()},handleDataAvailable:function(t){this.recordedChunks.length&&(this.recordedChunks=[]),this.recordedChunks.push(t.data)},startTimer:function(){var t=this;this.timerRecord=setInterval((function(){59===t.seconds&&(t.minutes++,t.seconds=0,t.miliSeconds=0),99===t.miliSeconds&&(t.seconds++,t.miliSeconds=0),t.miliSeconds++}),10)},getMediaDevices:function(){var t=this;window.navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){t.streamObject=e,t.errorSetupMic=!1})).catch((function(){t.errorSetupMic=!0}))}},mounted:function(){this.getMediaDevices()},destroyed:function(){this.streamObject&&this.streamObject.getTracks().forEach((function(t){t.stop()}))}},BJ=IJ,MJ=(i("812d"),Object(C["a"])(BJ,DJ,kJ,!1,null,null,null)),$J=MJ.exports,LJ=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:!0,title:"Настройки группы",width:"700",marginTop:-50},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"form-wrap"},[e("div",{staticClass:"form-avatarWrap"},[e("div",[e("div",{staticClass:"profile-card__avatar",staticStyle:{position:"relative",height:"10.6rem"}},[e("div",{staticClass:"profile-card__changer",class:{"profile-card__changer--visible":!t.avatarUrl}},[e("div",{staticClass:"buttons-group"},[e("File-uploader",{attrs:{formats:t.formats,size:t.sizeKB},on:{input:function(e){return t.onInput(e)}}})],1)]),e("Avatar",{attrs:{size:"10.6",src:t.avatarUrl}})],1),e("div",{staticClass:"form-desc",staticStyle:{"text-align":"center"}},[t._v("Аватар группы")])])]),e("div",{staticClass:"from-optionsWrap"},[e("div",{staticClass:"form-group",staticStyle:{position:"relative"}},[e("DxTextBox",{attrs:{placeholder:t.getChatCurrentRoom.name,elementAttr:t.textBoxValidatorAttr},model:{value:t.nameRoom,callback:function(e){t.nameRoom=e},expression:"nameRoom"}},[e("DxValidator",[e("DxPatternRule",{attrs:{pattern:t.namePattern,message:"Некорректные символы в названии"}}),e("DxAsyncRule",{attrs:{"validation-callback":t.chekExistRoom,message:"Группа с таким именем уже зарегистрированна на сервере"}})],1)],1),e("div",{staticClass:"form-desc"},[t._v("В названии допускается использование латинских символов и цифр без пробелов.")]),e("div",{staticClass:"form-labelForSelectBox"},[t._v("Редактировать название группы")])],1),t.getChatCurrentRoom.customFields&&t.getChatCurrentRoom.customFields.paidGroup?e("div",{staticClass:"form-group"},[e("div",{staticClass:"form-paidGroup"},[e("div",{staticClass:"form-paidGroup-item"},[e("div",{staticClass:"form-paidGroup-input",staticStyle:{display:"flex","align-items":"center"}},[e("div",{staticStyle:{"margin-right":"8px","font-size":"18px"}},[t._v("$")]),e("DxTextBox",{model:{value:t.pricePaidRoom,callback:function(e){t.pricePaidRoom=e},expression:"pricePaidRoom"}},[e("DxValidator",{on:{validated:t.checkPriceRoom}},[e("DxPatternRule",{attrs:{pattern:t.patternPrice,message:"Цена указана некорректно"}})],1)],1)],1),e("div",{staticClass:"form-paidGroup-text"},[t._v("Абонентская плата")])]),e("div",{staticClass:"form-paidGroup-item"},[e("div",{staticClass:"form-paidGroup-input"},[e("DxSelectBox",{attrs:{items:t.paidPeriod,"value-expr":"text","display-expr":"text"},model:{value:t.activePaidPeriod,callback:function(e){t.activePaidPeriod=e},expression:"activePaidPeriod"}})],1),e("div",{staticClass:"form-paidGroup-text"},[t._v("Расчетный период")])]),e("div",{staticClass:"form-paidGroup-item"},[e("div",{staticClass:"form-paidGroup-input"},[e("DxNumberBox",{attrs:{min:0,max:365,step:1,"show-spin-buttons":!0},model:{value:t.demoPeriod,callback:function(e){t.demoPeriod=e},expression:"demoPeriod"}})],1),e("div",{staticClass:"form-paidGroup-text"},[t._v("Дней беспланого периода")])])])]):t._e(),e("div",{staticClass:"form-group",staticStyle:{position:"relative"}},[e("div",{staticStyle:{display:"flex"}},[e("div",{staticStyle:{"flex-grow":"1"}},[e("DxTagBox",{attrs:{items:t.getNamesContracts,value:t.tagList,"search-enabled":!0,elementAttr:t.tagBoxAttr,"item-template":"user",placeholder:"Выбрать контракты",showClearButton:!1,noDataText:"Контракта с задаными параметрами нет"},on:{valueChanged:t.changeTagsList},scopedSlots:t._u([{key:"tag",fn:function(i){var o=i.data;return[e("div",{staticClass:"tag-item"},[e("div",{staticClass:"tag-item-name"},[t._v(t._s(o))]),e("div",{staticClass:"tag-item-remove",on:{click:function(e){return t.deleteContractTag(o)}}},[e("svgIcon",{attrs:{name:"Close",size:15}})],1)])]}},{key:"user",fn:function(i){var o=i.data;return[e("div",{staticClass:"chat-contact"},[t._v(t._s(o))])]}}])})],1),e("div",{staticStyle:{"margin-left":"0.8rem"}},[e("ButtonIcon",{attrs:{iconName:"Add",modifier:"bigHeight",color:"#000"},on:{toggle:t.openCatalogInstrumentModal}})],1)]),e("div",{staticClass:"form-labelForSelectBox"},[t._v("Добавить теги контрактов")]),e("div",{staticClass:"form-desc"},[t._v("Вы можете выбрать контракты, обсуждение которых планируется в группе. Теги помогают пользователям быстрее найти Ваш канал и популяризируют его.")])])])])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons",staticStyle:{"justify-content":"center"}},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:t.close}},[t._v("Отмена")]),e("Button",{attrs:{typeBtn:"primary",disable:t.statusExistRoom},on:{click:t.saveSettings}},[t._v("Сохранить настройки")])],1)]},proxy:!0}])})},FJ=[],jJ="https://chat.toptrader.org",RJ={components:{Modal:Oe,FileUploader:We,ButtonLabel:Z,Avatar:E,DxTextBox:rc.a,DxValidator:KQ["DxValidator"],DxPatternRule:KQ["DxPatternRule"],DxAsyncRule:KQ["DxAsyncRule"],DxTagBox:XQ.a,ButtonIcon:Nt,DxNumberBox:yE.a,DxSelectBox:Bo.a,Button:Pa,svgIcon:L},data:function(){return{formats:["image/jpg","image/jpeg","image/png"],sizeKB:7e4,avatarUrl:null,namePattern:/^(\d|\w)+$/,statusExistRoom:!1,patternPrice:/^[0-9]+$/,errorPriceRoom:!1,nameRoom:"",tagList:[],room:null,selectBoxAttr:{id:"selectBoxId",class:"selectBox"},textBoxValidatorAttr:{id:"textBoxValidatorId",class:"textBoxValidator"},tagBoxAttr:{id:"tagBoxId",class:"tagBox"},demoPeriod:0,paidPeriod:[{text:"Месяц",type:30},{text:"Квартал",type:90},{text:"Полугодие",type:180},{text:"9 месяцев",type:270},{text:"Год",type:360}],activePaidPeriod:"Месяц",pricePaidRoom:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getPaymentReference:"paymentService/getPaymentReference",getPaymentChatGroupUser:"chat/getPaidChatGroupUser",getChatApiUrl:"api/apiChat",getChatAuth:"chat/getChatAuth",getApiUrl:"api/api",getUserDetail:"user/getUserDetail",getContracts:"contracts/getContracts",getSession:"auth/getSession"})),{},{getAvatarURL:function(){return"".concat(jJ,"/avatar/room/").concat(this.getChatCurrentRoom._id)},getNamesContracts:function(){if(this.getContracts)return this.getContracts.reduce((function(t,e){return t.push(e.instrumentName),t}),[])},getChangePrice:function(){var t=this;if(this.getChatCurrentRoom.customFields&&this.getChatCurrentRoom.customFields.paidGroup)return this.getChatCurrentRoom.customFields.paidGroup.price!==this.pricePaidRoom||this.getChatCurrentRoom.customFields.paidGroup.demo!==this.demoPeriod||this.getChatCurrentRoom.customFields.paidGroup.period!==this.paidPeriod.find((function(e){return e.text===t.activePaidPeriod})).type}}),methods:{close:function(){this.$emit("close")},checkPriceRoom:function(t){this.errorPriceRoom=!t.isValid},openCatalogInstrumentModal:function(){this.$store.dispatch("modal/switchChartTradingModalCat",{mode:"chat",listContracts:this.tagList})},deleteContractTag:function(t){this.tagList.splice(this.tagList.findIndex((function(e){return e===t})),1)},addCustomFields:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i={roomId:t.getChatCurrentRoom._id,customFields:{inviteStatus:t.getChatCurrentRoom.customFields.inviteStatus,paidGroup:{price:+t.pricePaidRoom,period:t.paidPeriod.find((function(e){return e.text===t.activePaidPeriod})).type,demo:+t.demoPeriod,addMySubs:t.getChatCurrentRoom.customFields.paidGroup.addMySubs}}},e.next=3,t.$http.post("".concat(t.getChatApiUrl,"channels.setCustomFields"),JSON.stringify(i),{headers:{"Content-Type":"application/json","X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId}}).then((function(){t.updatePaymentChatGroup()}));case 3:case"end":return e.stop()}}),e)})))()},saveSettings:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.nameRoom||t.nameRoom===t.getChatCurrentRoom.name||!t.statusExistRoom){e.next=2;break}return e.abrupt("return");case 2:if(!t.getChangePrice){e.next=5;break}return e.next=5,t.addCustomFields();case 5:i={systemMessages:[],rid:t.getChatCurrentRoom._id},t.avatarUrl!==t.getAvatarURL&&(i["roomAvatar"]=t.avatarUrl),t.nameRoom&&t.nameRoom!==t.getChatCurrentRoom.name&&(i["roomName"]=t.nameRoom),"#"+t.tagList.join("#")!==t.getChatCurrentRoom.description&&(i["roomDescription"]="#"+t.tagList.join("#")),t.$http.post("".concat(t.getChatApiUrl,"rooms.saveRoomSettings"),JSON.stringify(i),{headers:{"Content-Type":"application/json","X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId}}).then((function(e){t.$emit("updateSettingsGroup",e.data),e.data&&e.data.success&&t.close()}));case 10:case"end":return e.stop()}}),e)})))()},updatePaymentChatGroup:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.getPaymentChatGroupUser.find((function(e){return e.groupId===t.getChatCurrentRoom._id})),i){e.next=3;break}return e.abrupt("return");case 3:return i.monthPrice=+t.pricePaidRoom,i.demoPeriod=+t.demoPeriod,i.periodId=t.getPaymentReference?+t.getPaymentReference.periods.find((function(e){return e.period===t.paidPeriod.find((function(e){return e.text===t.activePaidPeriod})).type})).id:2,e.next=8,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 8:o=e.sent,t.$http.post("".concat(t.getApiUrl,"Subscription/Save/ChatGroup"),JSON.stringify(i),{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(){t.$store.dispatch("chat/paymentsChatGroups",t.getSession)}));case 10:case"end":return e.stop()}}),e)})))()},chekExistRoom:function(t){var e=this;this.statusExistRoom=!0;var i={message:JSON.stringify({msg:"method",method:"roomNameExists",params:[t.value],id:(new Date).getTime().toString()})};return new Promise((function(o){e.$http.post(e.getChatApiUrl+"method.call/roomNameExists",JSON.stringify(i),{headers:{"Content-Type":"application/json","X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId}}).then((function(i){i&&i.data&&!JSON.parse(i.data.message).result&&(e.nameRoom=t.value,e.statusExistRoom=!1),o(i&&i.data&&!JSON.parse(i.data.message).result)}))}))},onInput:function(t){var e=this,i=new FileReader;i.addEventListener("load",(function(){e.avatarUrl=i.result}),!1),i.readAsDataURL(t)},changeTagsList:function(t){this.tagList=t.value}},mounted:function(){var t=this;this.avatarUrl=this.getAvatarURL,this.getChatCurrentRoom.description&&(this.tagList=this.getChatCurrentRoom.description.split("#").filter((function(t){return t}))),this.getChatCurrentRoom.customFields&&this.getChatCurrentRoom.customFields.paidGroup&&(this.demoPeriod=this.getChatCurrentRoom.customFields.paidGroup.demo,this.activePaidPeriod=this.paidPeriod.find((function(e){return e.type===t.getChatCurrentRoom.customFields.paidGroup.period})).text,this.pricePaidRoom=this.getChatCurrentRoom.customFields.paidGroup.price)}},WJ=RJ,NJ=(i("ba89"),Object(C["a"])(WJ,LJ,FJ,!1,null,null,null)),EJ=NJ.exports,UJ=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:!0,width:"450",title:t.$t("send_file")},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticClass:"modalUploadFileForChart",class:"modalUploadFileForChart_".concat(t.getActiveTheme)},[e("DxFileUploader",{attrs:{uploadMode:"useButtons",multiple:!1,selectButtonText:t.$t("select_a_file"),"allowed-file-extensions":t.allowFiles,maxFileSize:5e7,uploadFile:t.sendFile,uploadButtonText:t.$t("send_file"),invalidMaxFileSizeMessage:"Файл превышает максимально допустимый размер для отправки",invalidFileExtensionMessage:"Файлы в данном формате запрещены к отправке",labelText:t.$t("or_drag_file")}})],1)]},proxy:!0}])})},VJ=[],HJ=i("81f7"),GJ={components:{Modal:Oe,DxFileUploader:HJ["DxFileUploader"]},data:function(){return{allowFiles:OQ}},computed:Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getChatAuth:"chat/getChatAuth",getApiChatUrl:"api/apiChat",getActiveTheme:"headerSettings/getActiveTheme"})),methods:{close:function(){this.$emit("close")},sendFile:function(t,e){var i=this,o=new FormData;o.append("file",t),this.$http.post("".concat(this.getApiChatUrl,"rooms.upload/").concat(this.getChatCurrentRoom._id),o,{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-Type":"multipart/form-data"}}).then((function(){e(100),i.$emit("close")}))}}},qJ=GJ,zJ=(i("edd6"),Object(C["a"])(qJ,UJ,VJ,!1,null,null,null)),YJ=zJ.exports,XJ=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:!0,title:"Удалить",width:"500",modifier:"modal--newChatGroup"},on:{close:t.closeModal},scopedSlots:t._u([{key:"modal-body",fn:function(){return[t._v("Внимание!!! После удаления вся история переписки будет стёрта с сервера без возможности восстановления!")]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"modal__buttons",staticStyle:{"justify-content":"center"}},[e("Button",{attrs:{typeBtn:"secondary"},on:{click:t.closeModal}},[t._v("Отмена")]),e("Button",{attrs:{typeBtn:"primary",modifier:"red",process:t.loadRequestForCreateRoom},on:{click:t.removeRoom}},[t._v("Удалить")])],1)]},proxy:!0}])})},QJ=[],JJ={components:{Modal:Oe,Button:Pa},props:{idRoom:{default:0}},computed:Object(c["a"])({},Object(p["c"])({getChatApiUrl:"api/apiChat",getChatAuth:"chat/getChatAuth",getUserDetail:"user/getUserDetail",getChatCurrentRoom:"chat/getChatCurrentRoom"})),methods:{closeModal:function(){this.$emit("close")},removeRoom:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i={roomId:t.idRoom},t.$http.post("".concat(t.getChatApiUrl).concat("c"===t.getChatCurrentRoom.t?"channels":"groups",".delete"),JSON.stringify(i),{headers:{"Content-Type":"application/json","X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId}}).then((function(){t.$store.dispatch("chat/toggleChat",null),t.$emit("removeRoom"),t.closeModal()}));case 2:case"end":return e.stop()}}),e)})))()}}},KJ=JJ,ZJ=(i("f0e8"),Object(C["a"])(KJ,XJ,QJ,!1,null,null,null)),tK=ZJ.exports,eK={props:{symbol:{type:String},roomId:{type:String}},components:{ChatTabs:FX,ChatSection:cw,ChatContact:VX,ChatControl:cQ,ChatThread:XX,ChatNavmenu:RQ,Preloader:ah,ChatAboutGroup:GQ,VuePerfectScrollbar:Xt.a,ChatHistoryRoom:kQ,ModalAddNewChatRoom:iJ,ModalAddNewUserToChatRoom:cJ,ModalListMembersChatList:mJ,ModalInvitedUserRoomChat:PJ,ModalVideoMessageForChat:AJ,ModalAudioMessageForChat:$J,ModalUploadFileForChat:YJ,ModalAdminGroupForChat:EJ,ModalRemoveRoomForChat:tK,User:hd,DxAccordion:lw["DxAccordion"],Button:Pa},name:"Chat",data:function(){return{countNewMessage:1,userRooms:null,listUsers:null,accessStatus:"",joinStatus:"",errorServer:"",accordionAttr:{id:"chat__accordion",class:"chat__accordion"},statusPreloader:!1,scrollbarSettings:{suppressScrollX:!0},statusJoin:!1,statusWS:!0,listStatusUsers:null,idListRoomsMsg:"",chatControlFocus:!1,modalCreateRooms:!1,modalAddUsersToRoom:!1,modalListUserRoom:!1,modalUploadFile:!1,modalRemoveDirectRoom:!1,modalInvUsersPayload:null,modalVideoMessage:!1,modalAudioMessage:!1,modalAdminGroup:!1,listChannelsByTags:null,ownerStatus:!1,threadsRoom:null,ownerGroup:!1,idRoomDirectRoom:null,additionalInfoForGroup:null,currentRoom:null,directMessageNoti:0,groupMessageNoti:0,statusOpenAboutGroup:!1,openAboutGroupMode:"",rejectCall:"",helpRoom:null,acceptInCall:!1}},watch:{getUserDirectRooms:function(t){t&&this.getUsersStatus()},getChatCurrentRoom:function(t){t&&"update"!==t?(this.setCurrentRoomData(),this.groupMessageNoti=0,this.directMessageNoti=0):t||(this.threadsRoom=null,this.listUsers=null,this.accessStatus=!1,this.statusOpenAboutGroup=!1,this.getListRooms())},symbol:function(t){t&&this.getListChannelsByTags()},getChatAuth:function(){this.getChatCurrentRoom?this.openChat({rid:this.getChatCurrentRoom._id},"update"):this.getListRooms()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTab:"chat/getActiveTab",getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary",getContracts:"contracts/getContracts",getChatCurrentRoom:"chat/getChatCurrentRoom",getCurrentVideoCall:"chat/getCurrentVideoCall",getChatCurrentThread:"chat/getChatCurrentThread",getChatAuth:"chat/getChatAuth",getApiChat:"api/apiChat",getSession:"auth/getSession",getUserDetail:"user/getUserDetail",getUserPaymentServices:"paymentService/getUserPaymentServices",getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getHelpContanct:function(){return this.helpRoom?[this.helpRoom]:[{alert:!1,customFields:null,fname:"help",ls:new Date,name:"help",open:!0,rid:null,t:"d",u:{username:"help",_id:"puucssJZ4mhXs9v7s"},unread:0,_id:"puucssJZ4mhXs9v7s"}]},getPaymentServiseStatus:function(){var t=this;if(this.getChatCurrentRoom&&this.getUserPaymentServices&&this.getUserPaymentServices.length){var e=this.getUserPaymentServices.filter((function(e){return e.externalId===t.getChatCurrentRoom._id}));return e.length?e.some((function(e){return new Date(t.getServerTime.now).getTime()0},getStatusUnreadMessageFotGroups:function(){if(this.getUserGroups)return this.getUserGroups.some((function(t){return t.unread}))||this.groupMessageNoti>0},getUserFavoriteDirectRooms:function(){var t=this;if(this.userRooms)return this.userRooms.filter((function(e){return"d"===e.t&&e.name!==t.getUserDetail.login&&e.f&&e.open})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)}))},getUserDirectRoomsArchive:function(){var t=this;if(this.userRooms)return this.userRooms.filter((function(e){return"d"===e.t&&e.name!==t.getUserDetail.login&&!e.open})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)}))},getUserGroupsSubs:function(){var t=this;if(this.userRooms&&this.getContracts)return this.userRooms.filter((function(e){return("p"===e.t||"c"===e.t)&&(!t.getContracts.some((function(t){return t.instrumentName===e.name}))||e.f)&&"general"!==e.name&&(!e.roles||!e.roles.some((function(t){return"owner"===t})))&&!e.archived})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)}))},getUserGroups:function(){var t=this;if(this.userRooms&&this.getContracts){var e=this.userRooms.filter((function(e){return("p"===e.t||"c"===e.t)&&!t.getContracts.some((function(t){return t.instrumentName===e.name}))&&"general"!==e.name&&e.roles&&e.roles.some((function(t){return"owner"===t}))&&e.f&&!e.archived})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)})),i=this.userRooms.filter((function(e){return("p"===e.t||"c"===e.t)&&!t.getContracts.some((function(t){return t.instrumentName===e.name}))&&"general"!==e.name&&e.roles&&e.roles.some((function(t){return"owner"===t}))&&!e.f&&!e.archived})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)}));return e.concat(i)}},getUserArchiveGroups:function(){if(this.userRooms)return this.userRooms.filter((function(t){return t.archived&&t.roles&&t.roles.some((function(t){return"owner"===t}))})).sort((function(t,e){return new Date(e._updatedAt)-new Date(t._updatedAt)}))},getUserChannelsOfInstruments:function(){var t=this;if(this.getUserQuotesLibrary&&this.userRooms)return this.userRooms.filter((function(e){return"c"===e.t&&t.getUserQuotesLibrary.some((function(t){return e.name===t}))}))},getUserRooms:function(){return[{index:"0",text:this.$t("subscribed_to_groups"),count:this.getUserGroupsSubs?this.getUserGroupsSubs.length:0,collection:this.getUserGroupsSubs?this.getUserGroupsSubs:[]},{index:"1",text:this.$t("my_groups"),count:this.getUserGroups?this.getUserGroups.length:0,collection:this.getUserGroups?this.getUserGroups:[]},{index:"2",text:this.$t("groups_archive"),count:this.getUserArchiveGroups?this.getUserArchiveGroups.length:0,collection:this.getUserArchiveGroups?this.getUserArchiveGroups:[]}]},getUserContacts:function(){return[{index:"0",text:this.$t("favorites"),count:this.getUserFavoriteDirectRooms?this.getUserFavoriteDirectRooms.length:0,collection:this.getUserFavoriteDirectRooms?this.getUserFavoriteDirectRooms:[]},{index:"1",text:this.$t("contacts"),count:this.getUserDirectRooms?this.getUserDirectRooms.length:0,collection:this.getUserDirectRooms?this.getUserDirectRooms:[]},{index:"3",text:this.$t("black_list"),count:this.getUserDirectRoomsBlocked?this.getUserDirectRoomsBlocked.length:0,collection:this.getUserDirectRoomsBlocked?this.getUserDirectRoomsBlocked:[]}]},getHelpGroups:function(){return[{idnex:"0",text:this.$t("support"),count:1,collection:this.getHelpContanct}]},getUserInstruments:function(){if(this.getUserChannelsOfInstruments&&this.listChannelsByTags)return[{idnex:"0",text:this.$t("agbi"),count:this.listChannelsByTags.length,collection:this.listChannelsByTags},{idnex:"1",text:this.$t("tools"),count:this.getUserChannelsOfInstruments.length,collection:this.getUserChannelsOfInstruments}]}}),methods:{sendMessage:function(){this.countNewMessage++},setPaymentService:function(){this.setAccessStatusForRoom(),"access"===this.accessStatus&&"no-join"===this.joinStatus&&this.joinToChannel()},joinToChannel:function(){var t=this,e={roomId:this.getChatCurrentRoom._id};this.$http.post("".concat(this.getApiChat,"channels.join"),JSON.stringify(e),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId,"Content-type":"application/json"}}).then((function(){t.getListUsersForGroups()}))},setCurrentRoomData:function(){var t=this;this.getTheardsListForChatRoom(this.getChatCurrentRoom._id).then((function(){"c"===t.getChatCurrentRoom.t?(t.ownerGroup=t.getChatCurrentRoom.u.username===t.getUserDetail.login,t.getListUsersForGroups()):"d"===t.getChatCurrentRoom.t?(t.accessStatus="access",t.joinStatus="join",t.statusPreloader=!1,t.ownerGroup=!1,"d"===t.getChatCurrentRoom.t&&t.getListUsersForDirectRoom()):"p"===t.getChatCurrentRoom.t&&(t.accessStatus="access",t.joinStatus="join",t.ownerGroup=t.getChatCurrentRoom.u.username===t.getUserDetail.login,t.getListUsersForGroups())})).catch((function(){t.errorServer=t.$t("septal"),setTimeout((function(){t.statusPreloader=!1}),3e3)}))},setRedyStatus:function(t){"ready"===t&&(this.statusPreloader=!1)},setAccessStatusForRoom:function(){if(this.ownerGroup)return this.accessStatus="access",void(this.statusPreloader=!1);this.getChatCurrentRoom.customFields&&(this.getChatCurrentRoom.customFields.inviteStatus||this.getChatCurrentRoom.customFields.paidGroup)?this.getChatCurrentRoom.customFields.inviteStatus&&!this.getChatCurrentRoom.customFields.paidGroup?this.accessStatus="join"===this.joinStatus?"access":"no-access":this.getChatCurrentRoom.customFields.paidGroup&&!this.getChatCurrentRoom.customFields.inviteStatus?this.accessStatus=this.getPaymentServiseStatus?"access":"no-access":this.getChatCurrentRoom.customFields.paidGroup&&this.getChatCurrentRoom.customFields.inviteStatus&&("join"===this.joinStatus?this.accessStatus=this.getPaymentServiseStatus?"access":"no-access":this.accessStatus="no-access"):this.accessStatus="access",this.statusPreloader=!1},getListRooms:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.getChatAuth){e.next=2;break}return e.abrupt("return");case 2:if(!t.getChatCurrentRoom){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,t.$http.get(t.getApiChat+"subscriptions.get",{headers:{"Content-Type":"application/json","X-Auth-Token":t.getChatAuth.authToken,"X-User-Id":t.getChatAuth.userId}}).then((function(e){t.userRooms=e.data.update,t.helpRoom=t.userRooms.find((function(t){return"d"===t.t&&"help"===t.name}))}));case 6:case"end":return e.stop()}}),e)})))()},createDirectRoom:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o={usernames:"".concat(t.name,",").concat(e.getUserDetail.login)},i.next=3,e.$http.post(e.getApiChat+"im.create",JSON.stringify(o),{headers:{"Content-Type":"application/json","X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId}}).then((function(t){n=t.data.room}));case 3:return i.abrupt("return",n);case 4:case"end":return i.stop()}}),i)})))()},openChat:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(i.currentRoom=null,t){o.next=5;break}i.$store.dispatch("chat/toggleChat",null),o.next=13;break;case 5:if(t.rid){o.next=9;break}return o.next=8,i.createDirectRoom(t);case 8:t=o.sent;case 9:return i.statusPreloader=!0,i.getChatCurrentRoom&&i.$store.dispatch("chat/toggleChat",e),o.next=13,i.$http.get("".concat(i.getApiChat,"rooms.info/?roomId=").concat(t.rid),{headers:{"Content-Type":"application/json","X-Auth-Token":i.getChatAuth.authToken,"X-User-Id":i.getChatAuth.userId}}).then((function(e){i.getSubsOne(t.rid).then((function(){return i.$store.dispatch("chat/toggleChat",e.data.room)}))})).catch((function(){i.errorServer=i.$t("septal"),setTimeout((function(){i.statusPreloader=!1}),3e3)}));case 13:case"end":return o.stop()}}),o)})))()},openAboutGroup:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,i.openChat(t,"update");case 2:i.openAboutGroupMode=e,i.statusOpenAboutGroup=!i.statusOpenAboutGroup;case 4:case"end":return o.stop()}}),o)})))()},getListUsersForGroups:function(){var t=this;this.$http.get("".concat(this.getApiChat).concat("c"===this.getChatCurrentRoom.t?"channels":"groups",".members?roomId=").concat(this.getChatCurrentRoom._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.listUsers=e.data.members,t.joinStatus=t.listUsers.some((function(e){return e.username===t.getUserDetail.login}))?"join":"no-join",t.setAccessStatusForRoom()}))},getListUsersForDirectRoom:function(){var t=this;this.$http.get("".concat(this.getApiChat,"im.members?roomId=").concat(this.getChatCurrentRoom._id),{headers:{"X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.listUsers=e.data.members}))},setStatusModalListUserRoom:function(t,e){this.ownerStatus=!!t&&t.owner,e&&(this.currentRoom=e),this.modalListUserRoom=!this.modalListUserRoom},setStatusModalCreateRooms:function(){this.modalCreateRooms=!this.modalCreateRooms},setStatusModalRemoveDirectRoom:function(t){this.idRoomDirectRoom=t,this.modalRemoveDirectRoom=!this.modalRemoveDirectRoom},setStatusModalUploadFile:function(){this.modalUploadFile=!this.modalUploadFile},setStatusModalAdminGroup:function(){this.modalAdminGroup=!this.modalAdminGroup},setStatusModalAddNewUserToChatRoom:function(t){t&&(this.currentRoom=t),this.modalAddUsersToRoom=!this.modalAddUsersToRoom},setStatusModalVideoMessage:function(){this.modalVideoMessage=!this.modalVideoMessage},setStatusModalAudioMessage:function(){this.modalAudioMessage=!this.modalAudioMessage},openModalInvUsers:function(t){this.modalInvUsersPayload=t},subsByUserLogged:function(){var t={msg:"sub",id:Math.random().toString(36).substring(7),name:"stream-notify-logged",params:["user-status",!1]};this.$socketStream.sendCommand({ws:"chatWS",command:t})},getListChannelsByTags:function(){var t=this;this.getChatAuth&&this.$http.get("".concat(this.getApiChat,'channels.list?query={"description": { "$regex" : "').concat(this.symbol,'" }}'),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){if(e.data.channels.length){var i=e.data.channels.filter((function(e){return!t.userRooms.some((function(t){return e._id===t.rid}))}));i.length?t.listChannelsByTags=i.map((function(t){return{rid:t._id,name:t.name,t:t.t,description:t.description,userCounts:t.userCounts,u:t.u,customFields:t.customFields,_updatedAt:t._updatedAt}})):t.listChannelsByTags=[]}else t.listChannelsByTags=[]}))},getSubsOne:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.additionalInfoForGroup=null,i.next=3,e.$http.get("".concat(e.getApiChat,"subscriptions.getOne?roomId=").concat(t),{headers:{"X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId,"Content-type":"application/json"}}).then((function(t){e.additionalInfoForGroup=t.data.subscription?t.data.subscription:t.data}));case 3:case"end":return i.stop()}}),i)})))()},getUsersStatus:function(){var t=this;this.$http.get("".concat(this.getApiChat,"users.presence"),{headers:{"Content-Type":"application/json","X-Auth-Token":this.getChatAuth.authToken,"X-User-Id":this.getChatAuth.userId}}).then((function(e){t.listStatusUsers=e.data.users}))},setMessageHendler:function(t){var e=this;t&&"changed"===t.msg&&"stream-notify-logged"===t.collection?this.setNewStatusUser(t.fields):t&&"changed"===t.msg&&"stream-notify-user"===t.collection?this.setNotificetionNewMessage(t.fields):t&&"changed"===t.msg&&"stream-room-messages"===t.collection&&t.fields.args.forEach((function(t){"au"!==t.t&&"ru"!==t.t&&"ul"!==t.t&&"uj"!==t.t||e.getListUsersForGroups()}))},setNotificetionNewMessage:function(t){var e,i;"c"===(null===(e=t.args[0])||void 0===e?void 0:e.payload.type)?++this.groupMessageNoti:"d"===(null===(i=t.args[0])||void 0===i?void 0:i.payload.type)&&++this.directMessageNoti},acceptCall:function(){clearTimeout(this.phoneTimeOut),this.acceptInCall=!0},endingCall:function(){this.modeCall="",this.videoCallIn=!1,this.rejectCall="",this.userInfoForCalling=null,this.acceptInCall=!1,this.$store.commit("chat/setCurrentVideoCall",null)},setVideoCallOut:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getUserInfoForCalling(e.getChatCurrentRoom.uids.find((function(t){return t!==e.getChatAuth.userId})));case 2:e.modeCall=t.mode,e.videoCallIn=!0;case 4:case"end":return i.stop()}}),i)})))()},rejectCallOutCall:function(){this.userInfoForCalling=null,this.videoCallIn=!1,this.modeCall=""},rejectCallInnerCall:function(t){this.userInfoForCalling=null,this.videoCallIn=!1,this.rejectCall=t},setNewStatusUser:function(t){var e=this;if(this.listStatusUsers){var i=this.listStatusUsers.find((function(e){return t.args[0][0]===e._id}));i?this.listStatusUsers.forEach((function(i,o){i._id===t.args[0][0]&&e.$set(e.listStatusUsers[o],"status",1===t.args[0][2]?"online":"offline")})):this.listStatusUsers.push({_id:t.args[0][0],status:1===t.args[0][2]?"online":"offline",username:t.args[0][1]})}},getTheardsListForChatRoom:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.$http.get(e.getApiChat+"chat.getThreadsList/?rid=".concat(t),{headers:{"Content-Type":"application/json","X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId}}).then((function(t){e.threadsRoom=t.data.threads}));case 2:case"end":return i.stop()}}),i)})))()},chatFocus:function(t){this.chatControlFocus=t},getStatusSocket:function(t){this.statusWS="connect"===t}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.roomId){e.next=5;break}t.openChat({rid:t.roomId}),t.getListChannelsByTags(),e.next=8;break;case 5:return e.next=7,t.getListRooms();case 7:t.getListChannelsByTags();case 8:t.subsByUserLogged(),t.$socketStream.$on("chatWS",t.setMessageHendler),t.$socketStream.$on("WSSstatus",t.getStatusSocket);case 11:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.$off("chatWS",this.setMessageHendler),this.$socketStream.$off("WSSstatus",this.getStatusSocket)}},iK=eK,oK=(i("3a00"),Object(C["a"])(iK,DX,kX,!1,null,"dfa2a49c",null)),nK=oK.exports,sK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-return"},[e("div",{staticClass:"chat-return__left"},[e("div",{class:"chat-return__link chat-return__link_".concat(t.getActiveTheme),on:{click:t.closeChat}},[e("svgIcon",{attrs:{name:"Arrow-move-left"}}),t._v(t._s(t.$t("back")))],1)]),"/chat"!==t.getActiveRoute?e("div",{staticClass:"buttons-group"},[e("ButtonIconFlat",{attrs:{icon:{name:"InNewWindow"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme)],style:{borderRight:"none"}}},on:{click:t.openChatNewWindow}})],1):t._e()])},rK=[],aK={components:{ButtonIcon:Nt,ButtonLabel:Z,Toggle:qo,svgIcon:L},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getActiveRoute:function(){return this.$route.path}}),methods:{getText1:function(){return this.$t("mute_sound")},getText2:function(){return this.$t("post_a_chat")},getText3:function(){return this.$t("hide_chat")},closeChat:function(){this.$store.dispatch("chat/toggleChat",null),this.$store.commit("chat/setChatCurrentThread",null)},openChatNewWindow:function(){var t=this.$router.resolve({name:"Chat",query:{roomId:this.getChatCurrentRoom._id}}),e="scrollbars=no,resizable=yes,left=100,top=100,status=no,location=no,toolbar=no,menubar=no,\n width=370,height=700";window.open(t.href,"Чат",e)}}},cK=aK,lK=(i("48b1"),Object(C["a"])(cK,sK,rK,!1,null,null,null)),uK=lK.exports,dK=function(){var t=this,e=t._self._c;return e("ProfileWidget",{ref:"tv",attrs:{title:"TV",expand:t.expand},on:{toggleWidget:t.switchExpand},scopedSlots:t._u([{key:"header-left",fn:function(){},proxy:!0},{key:"header-right",fn:function(){},proxy:!0},{key:"body",fn:function(){return[e("div",{staticClass:"widget-tv"},[e("video",{ref:"videoPlayer",staticClass:"video-js"})])]},proxy:!0}])})},hK=[],pK={components:{ProfileWidget:Hz},props:{options:{type:Object,default:function(){return{plugins:{videoJsResolutionSwitcher:{default:"hight",dynamicLabel:!0}}}}},expand:{default:!1}},data:function(){return{player:null,updateSrc:null}},watch:{options:function(){this.player=Object(eP["a"])(this.$refs.videoPlayer)},expand:function(t){!0===t?this.play():this.pause()}},methods:{switchExpand:function(){this.$emit("switchExpand")},play:function(){this.player.play()},pause:function(){this.player.pause()}},mounted:function(){this.player=Object(eP["a"])(this.$refs.videoPlayer,this.options)},beforeDestroy:function(){this.player&&this.player.dispose()}},gK=pK,fK=(i("bde1"),Object(C["a"])(gK,dK,hK,!1,null,null,null)),mK=fK.exports,vK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"YoutubeComponent",class:t.darkClass},[e("div",{staticClass:"inputBlock"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.youtubeLink,expression:"youtubeLink"}],class:{error:t.error},attrs:{type:"text",placeholder:t.placeholder},domProps:{value:t.youtubeLink},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.openStreamModal.apply(null,arguments)},input:function(e){e.target.composing||(t.youtubeLink=e.target.value)}}}),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconEyes},on:{toggle:t.openStreamModal}})],1),e("transition",{attrs:{name:"fadeSlideUp",mode:"out-in"}},[t.isLoading?e("LoadMessages"):e("DynamicScroller",{ref:"scroller",staticClass:"scroller",attrs:{"key-field":"videoId",items:t.youtubeData,"min-item-size":60,buffer:200},scopedSlots:t._u([{key:"default",fn:function(t){var i=t.item,o=t.index,n=t.active;return[e("DynamicScrollerItem",{attrs:{item:i,active:n,"data-index":o,"data-active":n,"size-dependencies":[i.title]}},[e("OneVideo",{key:o,attrs:{video:i}})],1)]}}])})],1)],1)},yK=[],CK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LoadMessages"},t._l(3,(function(t){return e("Sceleton",{key:t,attrs:{height:225}})})),1)},bK=[],SK={name:"LoadMessages",components:{Sceleton:nT}},PK=SK,TK=(i("2dfd"),Object(C["a"])(PK,CK,bK,!1,null,"9d04e90e",null)),xK=TK.exports,OK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneVideo",class:t.darkClass},[e("div",{staticClass:"imageBlock",style:t.stylePreview,on:{click:function(e){return t.openTv(t.video.videoId)}}},[e("svgIcon",{attrs:{name:"Youtube-Red"}}),"live"===t.video.liveBroadcastContent?e("div",{staticClass:"liveBroadcast"},[e("svgIcon",{attrs:{name:"Youtube-Stream"}}),t._v("  В ЭФИРЕ")],1):t._e()],1),e("div",{staticClass:"paddingWrapper"},[e("div",{staticClass:"shortDescription"},[t._v(t._s(t.video.title))])])])},wK=[],_K={name:"OneVideo",mixins:[xt],props:{video:{type:Object}},computed:{stylePreview:function(){var t=this.video.thumbnailsMaxRes||this.video.thumbnails;return{backgroundImage:"url(".concat(t,")")}}},methods:{openTv:function(t){this.$store.dispatch("messenger/setCurrentVideoId",t),this.$store.dispatch("modal/switchTvWidget",!0)}}},AK=_K,DK=(i("a024"),Object(C["a"])(AK,OK,wK,!1,null,"448c7414",null)),kK=DK.exports,IK={name:"YoutubeComponent",mixins:[xt],components:{LoadMessages:xK,OneVideo:kK,DynamicScroller:QP["a"],DynamicScrollerItem:QP["b"]},data:function(){return{youtubeLink:"",isLoading:!0,error:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({youtubeData:"messenger/youtubeData"})),{},{iconEyes:function(){return{name:"Show",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},placeholder:function(){return this.error?this.$t("invalid_link"):this.$t("pltv")}}),methods:{openStreamModal:function(){this.error=!1;var t=/^https?:\/\/(?:www\.)?youtube\./;if(t.test(this.youtubeLink)){var e=this.youtubeLink.split("v=")[1],i=this.youtubeLink.split("live/")[1];if(e){var o=e.indexOf("&");-1!=o&&(e=e.substring(0,o))}else if(i){var n=i.indexOf("?");-1!=n&&(i=i.substring(0,n))}this.$store.dispatch("messenger/setOtherVideo","https://www.youtube.com/embed/".concat(e||i,"?autoplay=1")),this.$store.dispatch("modal/switchTvWidget",!0)}else this.youtubeLink="",this.error=!0}},activated:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i="UC7UkN5kN7Zz41SnRwqXafvA",!i){e.next=4;break}return e.next=4,t.$store.dispatch("messenger/getChannelDataYoutube",i);case 4:t.isLoading=!1;case 5:case"end":return e.stop()}}),e)})))()},deactivated:function(){this.isLoading=!0}},BK=IK,MK=(i("307f"),Object(C["a"])(BK,vK,yK,!1,null,"ec59da18",null)),$K=MK.exports,LK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TelegramComponent"},[t.isVisibleButton?e("ButtonBottom",{attrs:{count:t.count,clickBottomHandler:t.clickBottomHandler}}):t._e(),e("transition",{attrs:{name:"fadeSlideUp",mode:"out-in"}},[t.isLoading?e("LoadMessages"):t.isVisibleMessageBlock?e("DynamicScroller",{ref:"scroller",staticClass:"scroller",attrs:{items:t.telegramData,"min-item-size":60,buffer:200,emitUpdate:!0},on:{update:t.update,visible:t.visible},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.item,n=i.index,s=i.active;return[e("DynamicScrollerItem",{attrs:{item:o,active:s,"data-index":n,"data-active":s,"size-dependencies":[o.text]}},[o.isDate?e("DataBlock",{key:n,attrs:{dataMessage:o}}):o.notRead?e("NotReadLine",{attrs:{text:o.text}}):e("MessageBlock",{key:n,attrs:{index:n,message:o,allMessage:t.telegramData.length}})],1)]}}])}):t._e()],1)],1)},FK=[],jK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MessageBlock",class:t.rootClass},[e("div",{staticClass:"wrapperBlock",domProps:{innerHTML:t._s(t.getMessage)}})])},RK=[],WK={name:"MessageBlock",props:{message:{type:Object},allMessage:{type:Number},index:{type:Number}},data:function(){return{regexpLink:/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/g}},computed:{rootClass:function(){return{last:this.index===this.allMessage-1}},getMessage:function(){var t=this.message.text;if(t=t.replace(/\n/gi,(function(){return"
"})),t='
'.concat(this.message.nameChat,"
")+t,t.includes("#Start#"))t+="Пользователь начал трансляцию.
t.me/super_trader578",t=t.replace("#Start#","");else if(t.includes("#Stop")){var e=t.match(/duration:\d+/)[0].split(":")[1];t+="Пользователь закончил трансляцию (".concat(e," секунд)"),t=t.replace(/#[a-zA-Z]+#\s[a-zA-Z]+:\d+/gi,"")}else t=t.replace(this.regexpLink,(function(t){return'').concat(t,"")}));return t+="
".concat(this.message.time,"
"),t}}},NK=WK,EK=(i("3b0d"),Object(C["a"])(NK,jK,RK,!1,null,"34c1a492",null)),UK=EK.exports,VK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LoadMessages"},t._l(5,(function(t){return e("Sceleton",{key:t,attrs:{height:100}})})),1)},HK=[],GK={name:"LoadMessages",components:{Sceleton:nT}},qK=GK,zK=(i("0a0f"),Object(C["a"])(qK,VK,HK,!1,null,"2a7fd3ab",null)),YK=zK.exports,XK=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DataBlock"},[e("div",{staticClass:"wrapperContent"},[t._v(t._s(t.dataMessage.text))])])},QK=[],JK={name:"DataBlock",props:{dataMessage:{type:Object}}},KK=JK,ZK=(i("e900"),Object(C["a"])(KK,XK,QK,!1,null,"14ab9a50",null)),tZ=ZK.exports,eZ=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NotReadLine"},[e("div",{staticClass:"wrapperBlock"},[t._v(t._s(t.text))])])},iZ=[],oZ={name:"NotReadLine",mixins:[],props:{text:{type:String}}},nZ=oZ,sZ=(i("0812"),Object(C["a"])(nZ,eZ,iZ,!1,null,"75c81994",null)),rZ=sZ.exports,aZ=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonBottom",on:{click:t.clickBottomHandler}},[e("svgIcon",t._b({},"svgIcon",t.svgIconData,!1)),t.count>0?e("div",{staticClass:"count"},[t._v(t._s(t.count))]):t._e()],1)},cZ=[],lZ={name:"ButtonBottom",mixins:[],props:{count:{type:Number},clickBottomHandler:{type:Function}},computed:{svgIconData:function(){return{name:"Arrow-expand-bottom",color:"#8c8c8c",size:34}}}},uZ=lZ,dZ=(i("a5dd"),Object(C["a"])(uZ,aZ,cZ,!1,null,"c0bc5940",null)),hZ=dZ.exports,pZ={name:"TelegramComponent",components:{MessageBlock:UK,LoadMessages:YK,DataBlock:tZ,NotReadLine:rZ,ButtonBottom:hZ,DynamicScroller:QP["a"],DynamicScrollerItem:QP["b"]},data:function(){return{isLoading:!0,initializing:!1,visibleEndIndex:!1,stopPoint:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",telegramData:"messenger/telegramData",getStatistics:"statistic/getStatistics"})),{},{isVisibleMessageBlock:function(){var t;return!this.isLoading&&(null===(t=this.telegramData)||void 0===t?void 0:t.length)>0},isVisibleButton:function(){var t;return!!this.initializing&&(null===(t=this.telegramData)||void 0===t?void 0:t.length)>this.visibleEndIndex},count:function(){var t;return this.isLoading?0:(null===(t=this.telegramData)||void 0===t?void 0:t.length)-this.stopPoint}}),activated:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.stopPoint=+localStorage.getItem("visibleEndIndex")||!1,e.next=3,t.getTelegramMessagesByUser({accountId:t.getDefaultAccount.id,userId:t.getStatistics.account.owner,endIndex:t.stopPoint});case 3:t.isLoading=!1;case 4:case"end":return e.stop()}}),e)})))()},deactivated:function(){this.isLoading=!0,this.stopPoint=null,this.initializing=!1},watch:{visibleEndIndex:function(t){var e=this;this.initializing&&((!this.stopPoint||this.stopPoint1||null===(t=this.$refs.scroller)||void 0===t||t.scrollToBottom()}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getTelegramMessagesByUser:"messenger/getTelegramMessagesByUser"})),{},{visible:function(){this.initializing=!0;var t=localStorage.getItem("visibleEndIndex");if(t){if(this.telegramData.length-t>1)return void this.$refs.scroller.scrollToItem(t-2);this.$refs.scroller.scrollToBottom()}},update:function(t,e,i,o){this.initializing&&(this.visibleEndIndex=o)},clickBottomHandler:function(){this.visibleEndIndex365?this.getStatistics.accountDaily.slice(-365):this.getStatistics.accountDaily;e.forEach((function(e){t.points[0].push({time:new Date(e.date).getTime(),data:e[t.statParam]})})),this.chartStatus=!0}},mounted:function(){this.size.width=159,this.size.height=66,this.getChangeParam&&this.getPoints()}},g0=p0,f0=(i("9858"),Object(C["a"])(g0,s0,r0,!1,null,"4aa35b7a",null)),m0=f0.exports,v0=function(){var t=this,e=t._self._c;return e("div",{staticClass:"WidgetAbsoluteProfit"},[e("div",{staticClass:"WidgetAbsoluteProfit-title",class:"WidgetAbsoluteProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"WidgetAbsoluteProfit-titleItem"},[t._v(t._s(t.$t("instruments")))]),e("div",{staticClass:"WidgetAbsoluteProfit-titleItem"},[t._v(t._s(t.$t("open_trades")))]),e("div",{staticClass:"WidgetAbsoluteProfit-titleItem"},[t._v(t._s(t.$t("closed_trade")))])]),t.getProfitByInstruments?e("div",{staticClass:"WidgetAbsoluteProfit-instruments"},t._l(t.getProfitByInstruments,(function(i,o){return e("div",{key:o,staticClass:"WidgetAbsoluteProfit-instrumentsWrap"},[e("div",{staticClass:"WidgetAbsoluteProfit-instrumentDevider",class:"WidgetAbsoluteProfit-instrumentDevider_".concat(t.getActiveTheme)},[e("hr")]),e("div",{staticClass:"WidgetAbsoluteProfit-instrumentItem"},[e("div",{staticClass:"WidgetAbsoluteProfit-instrumentWrap"},[e("div",{staticClass:"WidgetAbsoluteProfit-instrumentBg",class:"WidgetAbsoluteProfit-instrumentBg_".concat(t.getActiveTheme)},[e("div",{staticClass:"WidgetAbsoluteProfit-instrumentName",class:"WidgetAbsoluteProfit-instrumentName_".concat(t.getActiveTheme)},[t._v(t._s(i.instrument))])])]),e("div",{staticClass:"WidgetAbsoluteProfit-instrumentData"},[e("div",{staticClass:"WidgetAbsoluteProfit-data",class:"WidgetAbsoluteProfit-data_".concat(t.getActiveTheme),style:{color:i.floatingProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(" "+t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.floatingProfit,2))))])]),e("div",{staticClass:"WidgetAbsoluteProfit-instrumentData"},[e("div",{staticClass:"WidgetAbsoluteProfit-data",class:"WidgetAbsoluteProfit-data_".concat(t.getActiveTheme),style:{color:i.profitClose<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profitClose,2))))])])])])})),0):t._e(),e("div",{staticClass:"WidgetAbsoluteProfit-result",class:"WidgetAbsoluteProfit-result_".concat(t.getActiveTheme)},[e("div",{staticClass:"WidgetAbsoluteProfit-resultDevider",class:"WidgetAbsoluteProfit-resultDevider_".concat(t.getActiveTheme)},[e("hr")]),e("div",{staticClass:"WidgetAbsoluteProfit-resultTitles"},[e("div",{staticClass:"WidgetAbsoluteProfit-resultTextWrap"},[e("div",{staticClass:"WidgetAbsoluteProfit-resultText",class:"WidgetAbsoluteProfit-resultText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("result")))])]),e("div",{staticClass:"WidgetAbsoluteProfit-resultDataWrap"},[e("div",{staticClass:"WidgetAbsoluteProfit-resultData",class:"WidgetAbsoluteProfit-resultData_".concat(t.getActiveTheme),style:{color:t.getResultFloatingProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getResultFloatingProfit,2))))])]),e("div",{staticClass:"WidgetAbsoluteProfit-resultDataWrap"},[e("div",{staticClass:"WidgetAbsoluteProfit-resultData",class:"WidgetAbsoluteProfit-resultData_".concat(t.getActiveTheme),style:{color:t.getResultProfitClose<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getResultProfitClose,2))))])])])]),e("div",{staticClass:"WidgetAbsoluteProfit-absProfit",class:"WidgetAbsoluteProfit-absProfit_".concat(t.getActiveTheme),style:{background:t.getAbsProfit<0?t.getRedColor.fill:t.getGreenColor.fill}},[e("div",{staticClass:"WidgetAbsoluteProfit-absProfitTitles"},[t._v(t._s(t.$t("absolute_profit")))]),e("div",{staticClass:"WidgetAbsoluteProfit-absProfitResult",style:{color:t.getAbsProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getAbsProfit,2))))])])])},y0=[],C0={data:function(){return{contractStatistics:null,accountId:null}},mixins:[qe],watch:{getStatByOrders:function(t){t&&(this.contractStatistics=JSON.parse(sessionStorage.getItem("contractStatisitics")))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatByOrders:"contracts/getStatByOrders",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getAbsProfit:function(){return this.getResultFloatingProfit+this.getResultProfitClose},getResultFloatingProfit:function(){return this.getProfitByInstruments&&this.getProfitByInstruments.length?this.getProfitByInstruments.reduce((function(t,e){return t+e.floatingProfit}),0):0},getResultProfitClose:function(){return this.getProfitByInstruments&&this.getProfitByInstruments.length?this.getProfitByInstruments.reduce((function(t,e){return t+e.profitClose}),0):0},getProfitByInstruments:function(){if(this.contractStatistics)return this.contractStatistics.map((function(t){return{instrument:t[6],profitClose:t[2],floatingProfit:t[3]}}))}}),methods:{setProfitByInstrument:function(t){var e=this;if(!t)return 0;t.length?this.contractStatistics.forEach((function(i){var o=t.reduce((function(t,e){return e.contractName===i[6]&&(t+=e.profit),t}),0);e.$set(i,3,o)})):this.contractStatistics.forEach((function(t){var i=0;e.$set(t,3,i)}))},setProfitCloseOrder:function(t){var e=this;this.contractStatistics.forEach((function(i){i[6]===t.contract&&e.$set(i,2,i[2]+t.profit)}))},setMessageHandler:function(t){t&&t.command&&"AccountsDetails"===t.command?(this.setAccountId(),this.getDefaultAccount.id===this.accountId&&this.contractStatistics&&this.setProfitByInstrument(t.data[0].openOrders.tradingOrders)):t&&t.command&&"BrokerPosition"===t.command&&"Closed"===t.data.status&&this.setProfitCloseOrder(t.data)},setAccountId:function(){sessionStorage.getItem("userProfileInfo")&&(this.accountId=JSON.parse(sessionStorage.getItem("userProfileInfo")).accountId)}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.setAccountId(),sessionStorage.getItem("contractStatisitics")&&(this.contractStatistics=JSON.parse(sessionStorage.getItem("contractStatisitics")))},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},b0=C0,S0=(i("5a4e"),Object(C["a"])(b0,v0,y0,!1,null,"592dc064",null)),P0=S0.exports,T0=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ExtandStatPortfolio"},[e("DxPopup",{attrs:{visible:!0,shading:!1,minWidth:"575px",resize:!0,width:"auto",height:"475px",container:".grid",position:{my:"left center",at:"right",of:t.container,offset:{x:10,y:0}},wrapperAttr:{class:"ExtandStatPortfolio"}},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"ExtandStatPortfolio-title ExtandStatPortfolio-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"ExtandStatPortfolio-titleText"},[t._v(t._s(t.$t("management_statistics")))]),e("div",{staticClass:"ExtandStatPortfolio-titleCloseIcon",on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{class:"ExtandStatPortfolio-content ExtandStatPortfolio-content_".concat(t.getActiveTheme)},[e("OrdersStatPortfolio",{attrs:{mode:t.modeStat}})],1)]},proxy:!0}])})],1)},x0=[],O0=function(){var t=this,e=t._self._c;return e("div",{class:"OrderStatProtfolio OrderStatProtfolio_".concat(t.getActiveTheme)},[e("div",{class:"OrderStatProtfolio-content OrderStatProtfolio-content_".concat(t.getActiveTheme)},[t.statData?e("div",{staticClass:"OrderStatProtfolio-contentTable"},[e("div",{class:"OrderStatProtfolio-contentTableTitle OrderStatProtfolio-contentTableTitle_".concat(t.getActiveTheme)},t._l(t.getTitles,(function(i,o){return e("div",{key:o,staticClass:"OrderStatProtfolio-contentTableTitleItem",style:{width:"".concat(i.width,"px")}},[t._v(t._s(t.$t(i.label)))])})),0),e("div",{staticClass:"OrderStatProtfolio-columns"},[e("div",{staticClass:"OrderStatProtfolio-columnsLabels"},t._l(t.labelsForColumns,(function(i,o){return e("div",{key:o,class:"OrderStatProtfolio-columnsLabelsItems OrderStatProtfolio-columnsLabelsItems_".concat(t.getActiveTheme)},[t._v(" "+t._s(t.$t(i)))])})),0),t._l(t.getColumns,(function(i,o){return e("div",{key:o,staticClass:"OrderStatProtfolio-columnsData"},t._l(i,(function(i,o){return e("div",{key:o,class:"OrderStatProtfolio-columnsDataItems OrderStatProtfolio-columnsDataItems_".concat(t.getActiveTheme),style:{color:i.color?i.color:""}},[t._v(" "+t._s(i.data))])})),0)}))],2)]):t._e(),t.statData||t.statusNoStat?t._e():e("div",[e("Preloader",{attrs:{enabled:!0,circle:!0,icon:!0,opacity:"0.95"}})],1),t.statusNoStat?e("div",[t._m(0)]):t._e()])])},w0=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrderStatProtfolio-noStat"},[t._v("Расширенная статистика формируется"),e("br"),t._v("либо по портфелю нет закрытых сделок."),e("br"),t._v("Попробуйте позже.")])}],_0={components:{Preloader:ah},props:{mode:{type:String,default:"portfolio"}},mixins:[qe],data:function(){return{statusNoStat:!1,statData:null,getTitles:[{width:"25%",label:"value"},{width:"25%",label:"total_trades"},{width:"25%",label:"buy"},{width:"25%",label:"sell"}],labelsForColumns:["net_profit","profit_factor","fee","maximum_balance_drawdown","total_trades","post","profitable_trades","tmpt","unprofitable_trades","tmut","average_trade_profit","tpoi","apipp","average_trade_length","trading_volume"]}},watch:{findPortfolio:function(){this.getStatData()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getSession:"auth/getSession",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",findPortfolio:"expertsPortfolio/findPortfolio",apiUrl:"api/api"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getSubscriptionsBySource:function(){var t=this;if(this.findPortfolio&&this.allSubscriptionCurrentDate){var e=this.allSubscriptionCurrentDate,i=e.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}));return i.map((function(t){return t.subscription.id.toString()}))}},getAllSubscription:function(){if(this.allSubscriptionCurrentDate)return this.allSubscriptionCurrentDate.map((function(t){return t.subscription.id.toString()}))},getColumns:function(){var t=this;if(this.statData){var e=[];return this.statData.forEach((function(i){e.push([{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color,data:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profit,2))},{color:i.profitFactor<0?t.getRedColor.color:t.getGreenColor.color,data:Math.round(i.profitFactor)},{data:i.comission},{color:0===i.maxDDBalance?t.getGreenColor.color:t.getRedColor.color,data:"% ".concat(t.$moneyf(i.maxDDBalance))},{data:i.ordersCount},{color:100*i.positiveOrdersCount/i.ordersCount<30?t.getRedColor.color:100*i.positiveOrdersCount/i.ordersCount>30&&100*i.positiveOrdersCount/i.ordersCount<60?t.getOrangeColor.color:t.getGreenColor.color,data:i.positiveOrdersCount&&i.ordersCount?"".concat(Math.round(100*i.positiveOrdersCount/i.ordersCount),"%"):0},{data:i.positiveOrdersCount},{color:t.getGreenColor.color,data:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.maxProfit,2))},{data:i.negativeOrdersCount},{color:i.minProfit<0?t.getRedColor.color:t.getGreenColor.color,data:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.minProfit,2))},{color:i.avgProfit<0?t.getRedColor.color:t.getGreenColor.color,data:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.avgProfit,2))},{data:t.$moneyf(Math.round(i.sumPipByOrders))},{data:t.$moneyf(Math.round(i.avgPipByOrders/10))},{data:t.getFormatDate(i.avgOrderDurationInms)},{data:"".concat(t.getCryptoStatus?"Qty":t.getCurrencyChar," ").concat(t.$moneyf(i.sumOrderVolume))}])})),[e[0],e[2],e[1]]}}}),methods:{getFormatDate:function(t){var e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o)).concat(this.$t("d")," ").concat(Math.floor(o%1*24)).concat(this.$t("h"),"."):Math.floor(i)>=1?"".concat(Math.floor(i)).concat(this.$t("h"),"."):"".concat(Math.floor(e)).concat(this.$t("м"));return n},getCommandForPortfolio:function(){var t=[];this.findPortfolio.sources.forEach((function(e){var i=e.accountId;if(t.length){var o=t.findIndex((function(t){return t.AccountId=i}));-1!==o?t[o].Contracts.push(e.contract):t.push({AccountId:i,Contracts:[e.contract]})}else t.push({AccountId:i,Contracts:[e.contract]})}));var e={command:"AccountShortStatisticV2",data:{datas:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},setMessageHandler:function(t){t&&t.command&&"AccountShortStatisticV2"===t.command&&(this.statData=this.getObjectStat(JSON.parse(t.data)))},getObjectStat:function(t){var e=[];return t.forEach((function(t){e.push({dataType:t[0],profit:t[1],profitFactor:t[2],comission:t[3],maxDDBalance:t[4],ordersCount:t[5],positiveOrdersCount:t[6],maxProfit:t[7],negativeOrdersCount:t[8],minProfit:t[9],avgProfit:t[10],sumPipByOrders:t[11],avgPipByOrders:t[12],avgOrderDuration:t[13],sumOrderVolume:t[14],avgOrderDurationInms:t[15],recoveryFactor:t[16],recoveryFactorRound:t[17],accountId:t[18]})})),e},getStatData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.statData=null,i=JSON.stringify({AccountId:t.getDefaultAccount.id,SubscriptionId:"myStat"===t.mode?t.getSubscriptionsBySource:t.getAllSubscription}),e.next=4,t.$workKeys.signMessage(i,t.getSession.sk);case 4:o=e.sent,t.$http.post("".concat(t.apiUrl,"GetAccountShortStatistic"),i,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o,"Content-type":"application/json"}}).then((function(e){e.data&&e.data.data.length?t.statData=e.data.data:t.statusNoStat=!0}));case 6:case"end":return e.stop()}}),e)})))()}},mounted:function(){"portfolio"===this.mode?(this.$socketStream.$on("apiWS3",this.setMessageHandler),this.getCommandForPortfolio()):this.getStatData()},destroyed:function(){"portfolio"===this.mode&&this.$socketStream.$off("apiWS3",this.setMessageHandler)}},A0=_0,D0=(i("2733e"),Object(C["a"])(A0,O0,w0,!1,null,"15549007",null)),k0=D0.exports,I0={props:{modeStat:{default:"myStat"},container:{type:String,default:".SelectedPortfolio-titleTableIcon"}},components:{DxPopup:xo.a,OrdersStatPortfolio:k0},data:function(){return{}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{closePopup:function(){this.$emit("closePopup")}}},B0=I0,M0=(i("38d3"),Object(C["a"])(B0,T0,x0,!1,null,null,null)),$0=M0.exports,L0=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatByAccount",class:t.darkClass,style:t.styleRoot},[e("div",{staticClass:"containerStatDataList"},t._l(t.manyStatDataFiltered,(function(i,o){return e("div",{key:o,staticClass:"statData"},[e("div",{staticClass:"title",class:i.dopClassTitle,on:{mouseenter:function(e){return t.viewTooltipHandler(e,i.tooltipText)},mouseleave:t.hideTooltip}},[t._v(t._s(i.title))]),e("div",{staticClass:"value",class:i.dopClass},[t._v(t._s(i.value))])])})),0),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},F0=[],j0={name:"StatByAccount",mixins:[Ot,xt],props:{accountDailyDate:{type:Array}},data:function(){return{accountId:null,dataProfit:null,orderStatistic:null,textTooltip:""}},watch:{getDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!t||e.accountId){i.next=5;break}if(e.accountId=e.getDefaultAccount.id,!e.accountId){i.next=5;break}return i.next=5,e.getProfitData(e.accountId);case 5:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getStatistics:"statistic/getStatistics",getStatByMonth:"statistic/getStatByMonth",getStatByYears:"statistic/getStatByYears",isProvider:"subscribeOrders/isProvider"})),{},{accountDailyDateLastDate:function(){if(this.getStatistics)return this.accountDailyDate.length?this.accountDailyDate.at(-1):{equityClose:this.getStatistics.account.equity,equityOpen:this.getStatistics.account.equity,balanceClose:this.getStatistics.account.balance}},dateCreated:function(){var t=this.getStatistics.account.registrationDate,e=new Date(t).getTime();return rL(e)},balance:function(){var t=this.accountDailyDateLastDate.balanceClose;return Lm(t,2,!0)},equity:function(){var t=this.accountDailyDateLastDate.equityClose;return Lm(t,2,!0)},tradesDays:function(){return this.accountDailyDate.length},closedProfitSum:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][1]:0;return{clearValue:t,value:t?Lm(t,2,!0):0,dopClass:t>0?"green":"red"}},depositDraws:function(){var t=this.getStatistics.sumDeposits,e=Object.values(t).reduce((function(t,e){return t+e}),0),i=this.getStatistics.sumWithdraws,o=Object.values(i).reduce((function(t,e){return t+e}),0);return"".concat(Lm(e,2,!0)," / ").concat(Lm(o,2,!0))},dayGeometry:function(){var t=this.accountDailyDate.reduce((function(t,e){var i=e.equityClose-e.equityOpen,o=i?100*i/e.equityOpen:1;return t*o}),1),e=Math.pow(t,1/this.accountDailyDate.length);return isNaN(e)?"--":Lm(e,1,!0)},monthGeometry:function(){if(this.getStatByMonth){var t=this.getStatByMonth.length?this.getStatByMonth.reduce((function(t,e){var i=e.profitRel?e.profitRel:1;return t*i}),1):1;return Lm(Math.pow(Math.abs(t),1/(this.getStatByMonth.length?this.getStatByMonth.length:1)),2,!0)}},yearGeometry:function(){var t=this.getStatByYears.length?this.getStatByYears.reduce((function(t,e){var i=e.profitRel?e.profitRel:1;return t*i}),1):1;return Lm(Math.pow(Math.abs(t),1/(this.getStatByYears.length?this.getStatByYears.length:1)),2,!0)},netProfit:function(){return{value:this.closedProfitSum.value,dopClass:this.closedProfitSum.dopClass}},netProfitPips:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][11]:0;return{value:t,dopClass:t>=0?"green":"red"}},netProfitPipsByTransaction:function(){if(!this.orderStatistic)return{value:0};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][12]:0;return{value:Lm(t.toFixed(0),0,!0),dopClass:t>=0?"green":"red"}},pipsOpenOrders:function(){if(this.orderStatistic)return this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][11]:0},allPips:function(){if(!this.pipsOpenOrders)return{value:0,dopClass:"green"};var t=this.pipsOpenOrders+this.netProfitPips.value;return{value:t?Lm(t,2,!0):0,dopClass:t>=0?"green":"red"}},profitFactor:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][2]:0;return{value:Lm(t,2,!0),dopClass:t>=1?"green":"red"}},matExpectation:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][10]:0;return{value:t?Lm(t,2,!0):0,dopClass:t>=0?"green":"red"}},recoveryFactor:function(){if(!this.orderStatistic)return"";var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][18]:0;return Lm(t,2,!0)},coefSharp:function(){var t=this.getStatistics.efficiency.sharp;return{value:Lm(t,1,!0),dopClass:t>=0?"green":"red"}},allOrders:function(){var t=this.orderStatistic&&this.orderStatistic[3]?this.orderStatistic[3][5]:0,e=this.orderStatistic&&this.orderStatistic[0]?this.orderStatistic[0][5]:0;return t+e},onlyProfitTransition:function(){if(!this.orderStatistic)return"";var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][6]:0,e=this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][6]:0,i=t+e,o=this.orderStatistic[2]&&this.orderStatistic[2].length?this.orderStatistic[2][6]:0,n=this.orderStatistic[1]&&this.orderStatistic[1].length?this.orderStatistic[1][6]:0,s=this.orderStatistic[5]&&this.orderStatistic[5].length?this.orderStatistic[5][6]:0,r=this.orderStatistic[4]&&this.orderStatistic[4].length?this.orderStatistic[4][6]:0;return{all:i,buy:s+o,sell:r+n}},onlyLossTransition:function(){if(!this.orderStatistic)return"";var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][8]:0,e=this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][8]:0,i=t+e,o=this.orderStatistic[2]&&this.orderStatistic[2].length?this.orderStatistic[2][8]:0,n=this.orderStatistic[1]&&this.orderStatistic[1].length?this.orderStatistic[1][8]:0,s=this.orderStatistic[5]&&this.orderStatistic[5].length?this.orderStatistic[5][8]:0,r=this.orderStatistic[4]&&this.orderStatistic[4].length?this.orderStatistic[4][8]:0;return{all:i,buy:o+s,sell:n+r}},openOrdersLength:function(){if(this.orderStatistic)return this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][5]:0},closedOrdersLength:function(){if(this.orderStatistic)return this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][5]:0},openOrderProfit:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][1]:0;return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}},losingTrade:function(){if(!this.orderStatistic)return"";if(!this.closedOrdersLength)return 0;var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][8]:0,e=t?100*t/this.closedOrdersLength:0;return"".concat(t," (").concat(Lm(e,2,!0)," %)")},averageProfitValue:function(){if(!this.orderStatistic)return{value:""};var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][10]:0;return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}},profitTradePercent:function(){if(!this.orderStatistic)return"";if(!this.closedOrdersLength)return 0;var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][6]:0;return Lm(100*t/this.closedOrdersLength,2,!0)},maxDDAbs:function(){return this.orderStatistic?this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][4]:0:""},maxLeverage:function(){return"1:".concat(this.getStatistics.account.maxLeverage)},profitTrade:function(){if(!this.orderStatistic)return"";var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][6]:0;return"".concat(t," (").concat(Lm(this.profitTradePercent,2,!0)," %)")},commission:function(){return"$ "+Lm(.25*this.accountDailyDateLastDate.equityClose/100,2,!0)},countSubscriber:function(){return this.dataProfit&&this.isProvider?this.dataProfit.length:0},investVolume:function(){if(!this.dataProfit||!this.isProvider)return"";var t=this.dataProfit.reduce((function(t,e){return t+e.investMoney}),0);return Lm(t,2,!0)},capital:function(){if(!this.dataProfit||!this.isProvider)return"";var t=this.dataProfit.reduce((function(t,e){return t+2*e.usedVolume}),0);return Lm(t,2,!0)},tradingActivity:function(){var t;if(null===(t=this.getStatistics.accountDaily)||void 0===t||!t.length)return 0;var e=this.getStatistics.accountDaily.filter((function(t){t.equityOpen===t.equityClose&&(t.equityOpen,t.balanceClose)})),i=e.length?100*e.length/this.getStatistics.accountDaily.length:0;return Lm(100-i,1,!0)},openVolume:function(){if(!this.orderStatistic)return 0;var t=this.orderStatistic[3]&&this.orderStatistic[3].length?this.orderStatistic[3][14]:0;return{value:t,formattedValue:Fn(t,2)}},allVolume:function(){if(!this.orderStatistic)return"";var t=this.orderStatistic[0]&&this.orderStatistic[0].length?this.orderStatistic[0][14]:0;return Fn(this.openVolume.value+t,2)},manyStatData:function(){return[{title:this.$t("account_creation_date"),value:this.dateCreated,tooltipText:null},{title:this.$t("tpbsd"),value:this.tradesDays,tooltipText:this.$t("nodstsot")},{title:"".concat(this.$t("balance"),", $"),value:this.balance,dopClass:"blue",tooltipText:this.$t("aofotatictr")},{title:"".concat(this.$t("equity"),", $"),value:this.equity,dopClass:"green",tooltipText:this.$t("aofotawfnfp")},{title:"".concat(this.$t("total_result"),", $"),value:this.closedProfitSum.value,dopClass:this.closedProfitSum.dopClass,tooltipText:this.$t("troacd")},{title:"".concat(this.$t("deposits_withdrawals"),", $"),value:this.depositDraws,dopClass:"green",tooltipText:this.$t("tsoadawotua")},{title:"".concat(this.$t("percentage_successful_trades"),", %"),value:this.profitTradePercent,dopClass:"green",tooltipText:this.$t("sotfttnfwap")},{title:"".concat(this.$t("max_drawdown"),", $"),value:this.maxDDAbs,dopClass:"red",tooltipText:this.$t("ambditmolfa")},{title:this.$t("leverage"),value:this.maxLeverage,tooltipText:this.$t("titrottmttt")},{title:this.$t("sharpe_ratio"),value:this.coefSharp.value,dopClass:this.coefSharp.dopClass,tooltipText:this.$t("ciotprr")},{title:this.$t("recovery_factor"),value:this.recoveryFactor,tooltipText:this.$t("trficatrotn")},{title:this.$t("profit_factor"),value:this.profitFactor.value,dopClass:this.profitFactor.dopClass,tooltipText:this.$t("tpfshmtttpe")},{title:this.$t("mathematical_expectation"),value:this.matExpectation.value,dopClass:this.matExpectation.dopClass,tooltipText:this.$t("tmeapptitro")},{title:"".concat(this.$t("net_profit"),", $"),value:this.netProfit.value,dopClass:this.netProfit.dopClass,tooltipText:this.$t("poct")},{title:"".concat(this.$t("net_profit"),", pip"),value:Lm(this.netProfitPips.value,2,!0),dopClass:this.netProfitPips.dopClass,tooltipText:this.$t("poctip")},{title:this.$t("tpoi"),value:this.allPips.value,dopClass:this.allPips.dopClass,tooltipText:this.$t("tsoipfei")},{title:"".concat(this.$t("agdi"),", %"),value:this.dayGeometry,dopClass:"green",tooltipText:null},{title:"".concat(this.$t("agmi"),", %"),value:this.monthGeometry,dopClass:"green",tooltipText:null},{title:"".concat(this.$t("agai"),", %"),value:this.yearGeometry,dopClass:"green",tooltipText:null},{title:"".concat(this.$t("trading_activity"),", %"),value:this.tradingActivity+"%",tooltipText:null},{title:this.$t("total_trades"),value:this.allOrders,tooltipText:this.$t("notootp"),dopClassTitle:"bold"},{title:this.$t("profitable_trades"),value:this.onlyProfitTransition.all,tooltipText:null,dopClassTitle:"bold"},{title:this.$t("buy"),value:this.onlyProfitTransition.buy,tooltipText:null,dopClassTitle:"pl"},{title:this.$t("sell"),value:this.onlyProfitTransition.sell,tooltipText:null,dopClassTitle:"pl"},{title:this.$t("unprofitable_trades"),value:this.onlyLossTransition.all,tooltipText:null,dopClassTitle:"bold"},{title:this.$t("buy"),value:this.onlyLossTransition.buy,tooltipText:null,dopClassTitle:"pl"},{title:this.$t("sell"),value:this.onlyLossTransition.sell,tooltipText:null,dopClassTitle:"pl"},{title:this.$t("open_trades"),value:this.openOrdersLength,tooltipText:this.$t("tnoot")},{title:this.$t("closed_trades"),value:this.closedOrdersLength,tooltipText:this.$t("tnoct")},{title:this.$t("profitable_closed_trades"),value:this.profitTrade,dopClass:"green",tooltipText:this.$t("soctoottnfw")},{title:this.$t("unprofitable_closed_trades"),value:this.losingTrade,dopClass:"red",tooltipText:this.$t("soctoottnfwal")},{title:"".concat(this.$t("troot"),", $"),value:this.openOrderProfit.value,dopClass:this.openOrderProfit.dopClass,tooltipText:this.$t("soploaot")},{title:"".concat(this.$t("troct"),", $"),value:this.netProfit.value,dopClass:this.netProfit.dopClass,tooltipText:this.$t("soploact")},{title:"".concat(this.$t("average_profit_per_trade"),", $"),value:this.averageProfitValue.value,dopClass:this.averageProfitValue.dopClass,tooltipText:this.$t("tavopfetcat")},{title:"".concat(this.$t("average_profit_per_trade"),", PIP"),value:this.netProfitPipsByTransaction.value,dopClass:this.netProfitPipsByTransaction.dopClass,tooltipText:null},{title:"".concat(this.$t("equity_turnover"),", $"),value:this.allVolume,dopClass:"green",tooltipText:null},{title:"".concat(this.$t("trading_volume"),", $"),value:this.openVolume.formattedValue,dopClass:"green",tooltipText:null},{title:"".concat(this.$t("fee")," (MF 0.25%)"),value:this.commission,dopClass:"red",tooltipText:this.$t("fcttuacttpf")},{title:"".concat(this.$t("equity_turnover"),", $"),value:this.capital,isProvider:!0,dopClass:"green",tooltipText:this.$t("tsovotwtipd")},{title:"".concat(this.$t("funds_under_management"),", $"),value:this.investVolume,dopClass:"green",isProvider:!0,tooltipText:this.$t("ttaomttpshi")},{title:this.$t("copying"),value:this.countSubscriber,isProvider:!0,tooltipText:this.$t("tnouctp")}]},manyStatDataFiltered:function(){return this.isProvider?this.manyStatData:this.manyStatData.filter((function(t){return!t.isProvider}))},styleRoot:function(){return{"--countRowByColumn":this.isProvider?22:20}}}),activated:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.accountId?t.accountId:t.getDefaultAccount?t.getDefaultAccount.id:null,!i){e.next=4;break}return e.next=4,t.getProfitData(i);case 4:case"end":return e.stop()}}),e)})))()},methods:{viewTooltipHandler:function(t,e){e&&(this.textTooltip=e,this.viewTooltip(t))},setMessageHendler:function(t){t&&t.command&&"AccountShortStatistic"===t.command&&(t.isSubscriptionData?this.updateOrderStatistic(JSON.parse(t.data)):this.orderStatistic=JSON.parse(t.data))},updateOrderStatistic:function(t){var e=this;this.orderStatistic&&this.orderStatistic.length&&t&&t.length&&t.forEach((function(t,i){e.$set(e.orderStatistic,i+3,t)}))},getStatisticsByOrders:function(){var t={Command:"AccountShortStatistic",method:"get",Data:{accountId:this.accountId}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},SubsStatisticsByOrders:function(t){var e={Command:"AccountShortStatistic",method:t,Data:{accountId:this.accountId}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},getProfitData:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=JSON.stringify({accountId:t}),i.next=3,e.$workKeys.signMessage(o,e.getSession.sk);case 3:return n=i.sent,i.next=6,e.$http.get("".concat(e.getApiUrl,"Subscription/SubscriberStatisticBySourceAccount"),{params:o,headers:{"X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n}});case 6:s=i.sent,a=s.data,e.dataProfit=a.data;case 9:case"end":return i.stop()}}),i)})))()}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$socketStream.$on("apiWS3",t.setMessageHendler),t.$route.query.accountId?t.accountId=t.$route.query.accountId:t.getDefaultAccount&&(t.accountId=t.getDefaultAccount.id),t.getStatisticsByOrders(),t.SubsStatisticsByOrders("subscribe"),!t.accountId){e.next=7;break}return e.next=7,t.getProfitData(t.accountId);case 7:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.dataProfit=null,this.SubsStatisticsByOrders("unsubscribe"),this.$socketStream.$off("apiWS3",this.setMessageHendler)}},R0=j0,W0=(i("2a8f"),Object(C["a"])(R0,L0,F0,!1,null,"8e9dc99a",null)),N0=W0.exports,E0={name:"StatisticBlock",mixins:[UV,qe],components:{BalanceEquityWidget:m0,VuePerfectScrollbar:Xt.a,WidgetAbsoluteProfit:P0,SectorDiagram:MB,ChatLoader:h0,StatByAccount:N0,PopupExtandStatPortfolio:$0},data:function(){return{subscribers:[],contractStatistic:null,statusNoTrade:!1,popupExtandStat:!1,userOrders:null,dataOpenPosition:null}},watch:{getStatByOrders:function(t){t&&(this.contractStatistic=JSON.parse(sessionStorage.getItem("contractStatisitics")))},getStat:function(t){t&&this.checkTrade()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStat:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getStatByMonth:"statistic/getStatByMonth",getYearsStat:"statistic/getYearsStat",getProfileAccount:"subscribeOrders/getProfileAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getCommonVolume:function(){if(this.contractStatistic){var t=this.contractStatistic.reduce((function(t,e){return t+e[1]}),0),e=this.contractStatistic.reduce((function(t,e){return t+e[10]}),0);return this.getCryptoStatus?e:t}},getSectorDiagramObject:function(){var t=this;if(this.contractStatistic&&this.getDefaultAccount){var e=[];return this.contractStatistic.forEach((function(i,o){var n=t.getCryptoStatus?i[10]:i[1],s=i[7];e.push({symbol:i[6],color:t.getSetRandomColors[o]?t.getSetRandomColors[o].color:U0(),data:n?Number((100*n/t.getCommonVolume).toFixed(2)):0,profitRel:Number(s).toFixed(2),profitRelColor:s>=70?t.getGreenColor.color:s<70&&s>=50?t.getOrangeColor.color:t.getRedColor.color})})),e}},getBalanceColor:function(){return{stroke:"light"===this.getActiveTheme?"#2462db":"#00b9fc",fill:(this.getActiveTheme,"rgba(36, 98, 219, 0.1)")}},getEquityColor:function(){return{stroke:"light"===this.getActiveTheme?"#008e72":"#1ef0b1",fill:"dark"===this.getActiveTheme?"rgba(0, 255, 172, 0.1)":"rgba(0, 142, 114, 0.1)"}},currencyFormatted:function(){var t=this;return function(e){var i=e<=1e5?2:0;return t.$moneyf(e,i,i)}},getIconCurrency:function(){var t=new Intl.NumberFormat("de-DE",{style:"currency",currency:this.getStat.account.assetCode}).format(1);return t[t.length-1]},getTradesDays:function(){if(this.getStat){var t=this.getStat.ordersStatistics.tradesDays;return t.toLocaleString()}},getCommonProfit:function(){if(this.getStat){var t=this.getStat,e=t.accountDaily,i=t.ordersStatistics;if(0===e.length)return 0;var o=e.find((function(t){return nL(new Date(t.date))===nL(new Date(i.startTradingDT))})),n=e.at(-1),s=n.equityClose-(null===o||void 0===o?void 0:o.equityOpen),r=100*s/(null===o||void 0===o?void 0:o.equityOpen);return isNaN(r)?0:Lm(r,r<1?1:2)}},getCurrentDrawDown:function(){var t;if(this.getStat){var e=this.getStat.accountDaily.length-1,i=null!==(t=this.getStat)&&void 0!==t&&t.accountDaily[e]?-1*this.getStat.accountDaily[e].drawdown.toFixed(2):"";return i||0}},getMaxDrawDown:function(){if(this.getStat)return-1*this.getStat.efficiency.drawdownRel.toFixed(2)},getSuccessfulTransaction:function(){if(this.getStat){var t=this.getStat.ordersStatistics,e=t.closedOrdersCount,i=t.positiveOrders;return 0===i?0:(100*i/e).toFixed(2)}},getMonthProfit:function(){if(this.getStat){if(this.getStatByMonth){var t=(this.getStatByMonth.reduce((function(t,e){return t+e.profitRel}),0)/this.getStatByMonth.length).toFixed(2);return isNaN(t)?0:t}return 0}},getPositiveMonth:function(){if(!this.getStatByMonth)return!1;var t=this.getStatByMonth.filter((function(t){return t.profitRel>0})).length,e=(100*t/this.getStatByMonth.length).toFixed(2);return isNaN(e)?0:e},getYearProfit:function(){var t=this;if(this.getYearsStat){var e=function(e){return t.getYearsStat[e].reduce((function(t,e){var i="number"===typeof e.profitRel&&Number.isFinite(e.profitRel)?e.profitRel:0;return t+i}),0)},i=Object.keys(this.getYearsStat).reduce((function(t,i){return t+e(i)}),0);return(i/Object.keys(this.getYearsStat).length).toFixed(2)}return 0},getEquity:function(){if(this.getStat){var t=this.getStat.account.equity;return"".concat(this.currencyFormatted(t)," ").concat(this.getIconCurrency)}},getBalance:function(){var t=this.getStat.account.balance;return"".concat(this.currencyFormatted(t)," ").concat(this.getIconCurrency)},getOrdersClosed:function(){if(this.getStat){var t=this.getStat.ordersStatistics.closedOrdersCount;return t.toLocaleString()}},getOrdersClosedProfit:function(){if(this.getStat){var t=this.getStat.ordersStatistics.positiveOrders;return t.toLocaleString()}},getOrdersClosedProfitPercent:function(){if(this.getStat){var t=this.getStat.ordersStatistics.closedOrdersCount,e=this.getStat.ordersStatistics.positiveOrders;return 0===e?0:100*e/t}},getOrdersClosedNegative:function(){if(this.getStat){var t=this.getStat.ordersStatistics.closedOrdersCount,e=this.getStat.ordersStatistics.positiveOrders;if(0===t)return 0;var i=(t-e).toLocaleString(),o=parseFloat((100-this.getOrdersClosedProfitPercent).toFixed(2));return"".concat(i," (").concat(o,"%)")}},getSharpeRatio:function(){if(this.getStat){var t=this.getStat.efficiency.sharp;return parseFloat(t.toFixed(2))}},getSubscribedToProvider:function(){return this.subscribers.length},getFollowUser:function(){return this.subscribers.filter((function(t){return!t.autoTrade})).length},getAutoFollowUser:function(){return this.subscribers.filter((function(t){return t.autoTrade})).length},getNetProfit:function(){var t=this.getStat.ordersStatistics.closedProfit;return"".concat(this.currencyFormatted(t)," ").concat(this.getIconCurrency)},getClass:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{red:t=e}}},arrayStat:function(){return this.getStat?[{id:1,title:this.$t("ptasd"),value:this.getTradesDays},{id:2,title:this.$t("headerAccountMenuGetLoad2"),value:this.getEquity,class:this.getClass(this.getStat.account.equity)},{id:3,title:this.$t("widgetMyStatsGetRowsTitle1"),value:this.getBalance,class:{blue:!0}},{id:4,title:this.$t("widgetProfitWatchMenu2"),value:this.getNetProfit,class:this.getClass(this.getStat.ordersStatistics.closedProfit)},{id:5,title:this.$t("widgetMyStatsGetRowsTitle7"),value:this.getOrdersClosed},{id:6,title:this.$t("apct"),value:this.getOrdersClosedProfit,class:this.getClass(this.getOrdersClosedProfitPercent,30)},{id:7,title:this.$t("ppct"),value:Lm(parseFloat(this.getOrdersClosedProfitPercent),2),class:this.getClass(this.getOrdersClosedProfitPercent,30),percent:!0},{id:8,title:this.$t("aut"),value:this.getOrdersClosedNegative},{id:9,title:this.$t("widgetMyStatsGetRowsTitleA"),value:this.getSharpeRatio,class:this.getClass(this.getSharpeRatio,1)},{id:10,title:this.$t("widgetProfitInfoRows0"),value:parseFloat(this.getCommonProfit),class:this.getClass(this.getCommonProfit),percent:!0},{id:11,title:this.$t("currentDrawdown"),value:parseFloat(this.getCurrentDrawDown),class:this.getClass(this.getCurrentDrawDown),percent:!0},{id:12,title:this.$t("maxDrawdown"),value:parseFloat(this.getMaxDrawDown),class:this.getClass(this.getMaxDrawDown),percent:!0},{id:13,title:this.$t("wedAnnualIncomeWord"),value:parseFloat(this.getYearProfit),class:this.getClass(this.getYearProfit),percent:!!this.getYearProfit},{id:14,title:this.$t("wedMounthlyIncomeWord"),value:parseFloat(this.getMonthProfit),class:this.getClass(this.getMonthProfit),percent:this.getMonthProfit},{id:15,title:this.$t("succesMounthWord"),value:this.getPositiveMonth?parseFloat(this.getPositiveMonth):0,class:this.getClass(this.getPositiveMonth),percent:!!this.getPositiveMonth},{id:16,title:this.$t("succesDealsWord"),value:parseFloat(this.getSuccessfulTransaction),class:this.getClass(this.getSuccessfulTransaction,30),percent:!0},{id:17,title:this.$t("autoFollowedWord"),value:this.getAutoFollowUser},{id:18,title:this.$t("followedWord"),value:this.getFollowUser},{id:19,title:this.myProfile?this.$t("totalSubscribers"):this.$t("amPrSub"),value:this.getSubscribedToProvider}]:[]}}),methods:{openExpandStat:function(){this.popupExtandStat=!this.popupExtandStat},getSubscribersByAccount:function(){var t={Command:"SubsсribersByAccountId",data:{AccountId:this.$route.query.accountId}};this.$socketStream.sendCommand({ws:"apiWS",command:t})},checkTrade:function(){var t=this.getStat.ordersStatistics.startTradingDT;t||(this.statusNoTrade=!0)},setMessageHandler:function(t){"SubsсribersByAccountId"===(null===t||void 0===t?void 0:t.command)&&(this.subscribers=t.data)}},mounted:function(){sessionStorage.getItem("contractStatisitics")&&(this.contractStatistic=JSON.parse(sessionStorage.getItem("contractStatisitics"))),this.getSubscribersByAccount(),this.getStat&&this.checkTrade(),this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)}};function U0(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var V0=E0,H0=(i("f396"),Object(C["a"])(V0,o0,n0,!1,null,"178a92c4",null)),G0=H0.exports,q0=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnalyticBlock"},[e("DxTabPanel",{attrs:{height:"100%","data-source":t.source,"selected-index":t.selectedIndex,onSelectionChanged:t.onSelectionChanged,loop:!0,"animation-enabled":!0,"swipe-enabled":!0,elementAttr:{class:"tabPanel"}},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"wrapperTitle"},[t.selectedIndex===o.selectedIndex?e("span",{staticClass:"text"},[t._v(t._s(o.title))]):t._e()])]}},{key:"item",fn:function(e){var i=e.data;return[t._v(t._s(i.componentName))]}}])})],1)},z0=[],Y0={name:"AnalyticBlock",components:{DxTabPanel:i0.a},data:function(){return{selectedIndex:1,source:[{ID:1,componentName:"StatisticBlock",selectedIndex:0},{ID:2,componentName:"AnalyticBlock",selectedIndex:1},{ID:3,componentName:"EventsBlock",selectedIndex:2}]}},methods:{onSelectionChanged:function(){}}},X0=Y0,Q0=(i("50c2"),Object(C["a"])(X0,q0,z0,!1,null,"636a6615",null)),J0=Q0.exports,K0=function(){var t=this,e=t._self._c;return e("h1",[t._v("FavouritesBlock")])},Z0=[],t1={name:"FavouritesBlock"},e1=t1,i1=(i("c971"),Object(C["a"])(e1,K0,Z0,!1,null,"ad377d1c",null)),o1=i1.exports,n1=function(){var t=this,e=t._self._c;return e("WidgetProvider",{attrs:{tabsComponent:!0}})},s1=[],r1={name:"ProviderBlock",components:{WidgetProvider:AX}},a1=r1,c1=(i("26c9"),Object(C["a"])(a1,n1,s1,!1,null,"277e9279",null)),l1=c1.exports,u1={name:"UserProfileLeftSideTab",mixins:[UV],components:{DxTabPanel:i0.a,DxScrollView:NY["DxScrollView"],StatisticBlock:G0,AnalyticBlock:J0,FavouritesBlock:o1,ProviderBlock:l1},data:function(){return{selectedIndex:0,source:[{ID:1,title:"Statistics",componentName:"StatisticBlock",iconName:"StatsText",alien:!0},{ID:2,title:"Аналитика",componentName:"AnalyticBlock",iconName:"Analytics",alien:!0},{ID:3,title:"Избранное",componentName:"FavouritesBlock",iconName:"Favorite-off",alien:!1},{ID:4,title:"Провайдеры",componentName:"ProviderBlock",iconName:"Provider",alien:!1}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getColorIcon:function(){return"dark"===this.getActiveTheme?"#8FA8C1":"#8C8C8C"},getSource:function(){var t=this.source.map((function(t,e){return Object(c["a"])(Object(c["a"])({},t),{},{selectedIndex:e})}));return this.myProfile?t:t.filter((function(t){return t.alien}))},elementAttr:function(){var t="tabPanel";return this.selectedIndex&&(t+=" tabPanel-".concat(this.selectedIndex)),{class:t}}}),methods:{onSelectionChanged:function(t){this.selectedIndex=t.addedItems[0].selectedIndex}}},d1=u1,h1=(i("fa7b"),Object(C["a"])(d1,ZZ,t0,!1,null,"0ae73886",null)),p1=h1.exports,g1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UserProfileLeftSideFollow",class:t.rootClass},[t.myProfile?[e("ButtonIconFlat",{staticClass:"buttonCustom withText",attrs:{icon:t.getIconData("Settings")},on:{toggle:t.goToMyProfile}},[t._v(t._s(t.$t("configure")))])]:[t.isVisibleButtonCopy?e("ButtonIconFlat",{staticClass:"buttonCustom withText",attrs:{disabled:t.isLoadingStart,icon:t.iconAutoFollow},on:{toggle:t.startCopy}},[t._v(t._s(t.$t("copy"))),t.isLoadingStart?e("div",{staticClass:"loadingContainer"},[e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}})],1):t._e()]):t._e()]],2)},f1=[],m1={name:"UserProfileLeftSideFollow",inject:["openModalCopyProvider"],mixins:[$n],props:{userData:{type:Object,default:function(){return{}}},isLoadingGetSignals:{type:Boolean},signalsBroker:{type:Array},myProfile:{type:Boolean},getLeftSideBar:{type:Boolean},isSignalsBroker:{type:Boolean},isContentBroker:{type:Boolean},contentSubscribed:{type:Boolean},leftBar:{type:Boolean,default:!1}},data:function(){return{opacity:!1,isLoadingStart:!1}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCurrenSiteSubscriptions:"paymentService/getCurrenSiteSubscriptions",getActiveTheme:"headerSettings/getActiveTheme",getProviderSubscribePay:"subscribeOrders/getProviderSubscribePay",getDefaultAccount:"subscribeOrders/getDefaultAccount",getUserDetail:"user/getUserDetail",activeSubscriptionByAccount:"subscription/activeSubscriptionByAccount"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},iconAutoFollow:function(){return{name:"AutoFolow",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{column:!this.getLeftSideBar,opacity:this.opacity})},getColorIcon:function(){return"dark"===this.getActiveTheme?"#8FA8C1":"#8C8C8C"},getIconData:function(){var t=this;return function(e){return{name:e,color:t.getColorIcon}}},isVisibleButtonCopy:function(){return this.isSignalsBroker},traderName:function(){return"".concat(this.userData.firstName," ").concat(this.userData.lastName)},sequenceId:function(){var t;if(null!==(t=this.signalsBroker)&&void 0!==t&&t.length)return this.signalsBroker[0].sequenceId}}),watch:{getLeftSideBar:function(){var t=this;this.opacity=!0,setTimeout((function(){t.opacity=!1}),1e3)}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({openModalAuth:"modal/setPopupData",setVisible:"modalPay/setVisible"})),{},{openAuthModal:function(){this.openModalAuth({visiblePopup:!0,modalComponentName:"ModalLogin",titlePopup:"sign_in"})},goToMyProfile:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalTradeSignals"}})},startCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.needPay();case 2:if(i=e.sent,!i){e.next=10;break}return t.isLoadingStart=!0,e.next=7,t.pendingStatus(i.id);case 7:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 10:t.openModalCopyProvider({providerCopy:!0,infoAccount:{avatar:t.userData.avatarURL,traderName:t.traderName,login:t.$route.query.accountId,sequenceId:t.sequenceId}});case 11:case"end":return e.stop()}}),e)})))()}})},v1=m1,y1=(i("d3cc"),Object(C["a"])(v1,g1,f1,!1,null,"52903eb8",null)),C1=y1.exports,b1={methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast"})),{},{visibleToastStatusPay:function(){var t,e;"succeeded"===(null===(t=this.$route.query)||void 0===t?void 0:t.redirect_status)?this.showToast({visible:!0,outSideClick:!0,componentName:"ToastSuccessPay",dopInfo:{dateToPeriod:localStorage.getItem("dateToPeriod")}}):null!==(e=this.$route.query)&&void 0!==e&&e.redirect_status&&this.showToast({visible:!0,outSideClick:!0,componentName:"ToastErrorPay"})}})},S1={name:"UserLeftBar",mixins:[UV,b1],props:{signalsBroker:{type:Array},isSignalsBroker:{type:Boolean},isContentBroker:{type:Boolean},isLoadingGetSignals:{type:Boolean},contentSubscribed:{type:Boolean},userData:{type:Object,default:function(){return{}}},activeTab:{type:String}},components:{ProfileModule:Cz,UserProfileLeftSideTopBar:qZ,StatisticBlock:G0,UserProfileLeftSideMicroCard:KZ,UserProfileLeftSideTab:p1,UserProfileLeftSideFollow:C1},data:function(){return{mountedRequest:!1}},computed:Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",getLeftSideBar:"userSettings/getLeftSideBar",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.visibleToastStatusPay();case 1:case"end":return e.stop()}}),e)})))()},methods:Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",getContentSubscription:"cart/getContentSubscription"}))},P1=S1,T1=(i("855b"),Object(C["a"])(P1,WZ,NZ,!1,null,"ab55ae20",null)),x1=T1.exports,O1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"userProfileCenter-column"},[e("div",{staticClass:"userProfileCenter-title"},[e("UserProfileCentralPartTopBar",{attrs:{tabButtons:t.tabButtons,activeTab:t.activeTab},on:{setActiveTab:function(e){return t.$emit("setActiveTab",e)}}})],1),e("div",{ref:"container",class:"userProfileCenter-content containerForTables userProfileCenter-content_".concat(t.getActiveTheme)},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[e(t.activeTab,t._b({tag:"component",attrs:{loadedSessionTableData:t.loadedSessionTableData}},"component",t.propsComponent[t.activeTab],!1))],1)],1)])},w1=[],_1=function(){var t=this,e=t._self._c;return e("div",{class:"userProfileCenterPartTopBar userProfileCenterPartTopBar_".concat(t.getActiveTheme)},[e("div",{ref:"wrapTabs",staticClass:"userProfileCenterPartTopBar-leftPart"},[t.refTabWrapper?e("AdaptiveTabBlock",{attrs:{tabsSet:t.getTabButtons,refTabWrapper:t.refTabWrapper},on:{setActiveTab:t.setActiveTab}}):t._e()],1),e("div",{staticClass:"userProfileCenterPartTopBar-rightPart"},[e("div",{staticClass:"buttonWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,"TV")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:"TV"},modifier:t.modifierTv},on:{click:t.openTv}})],1),e("div",{staticClass:"buttonWrapper",on:{mouseenter:function(e){return t.viewTooltipHandler(e,t.getLeftAndRightSidebarsStatus?"collapse":"maximaze")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:t.getLeftAndRightSidebarsStatus?"UnExpand-bottom-blocks":"Expand-bottom-blocks"},modifier:t.modifierCloseSideBars},on:{toggle:t.closeAllSideBars}})],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.$t(t.textTooltip)))])],1)},A1=[],D1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"adaptiveTabs-wrapTabs"},[t._l(t.tabsSet,(function(i,o){return t.firstRender?e("ButtonIconFlat",{key:o,ref:i.ref,refInFor:!0,attrs:{icon:{name:i.icon},modifier:{class:["buttonFlat-icon","adaptiveTabs-groupButton","adaptiveTabs-groupButton_".concat(t.getActiveTheme),i.dopClass||"",i.isActive?"adaptiveTabs-groupButton_isActive-".concat(t.getActiveTheme):""],style:{position:"absolute",padding:t.getPaddingButton(i)}}},on:{click:function(e){return t.setActiveTab(i.component)}}},[t._t("default",(function(){return[e("div",{class:"adaptiveTabs-groupButton-text adaptiveTabs-groupButton-text_".concat(t.getActiveTheme," ").concat(i.isActive?"adaptiveTabs-groupButton-text-isActive":""),style:{marginLeft:i.icon&&i.text?"0.4rem":"0"}},[t._v(t._s(t.$t(i.text)))])]}),{data:i})],2):t._e()})),t._l(t.getTabs,(function(i,o){return t.firstRender?t._e():e("ButtonIconFlat",{key:o,ref:null===i||void 0===i?void 0:i.ref,refInFor:!0,attrs:{icon:{name:i.icon},disabled:i.disabled,modifier:{class:["buttonFlat-icon","adaptiveTabs-groupButton","adaptiveTabs-groupButton_".concat(t.getActiveTheme,"-").concat(t.typeTheme),i.dopClass||"",i.isActive?"adaptiveTabs-groupButton_isActive-".concat(t.getActiveTheme):""],style:{padding:t.getPaddingButton(i)}}},on:{toggle:function(e){return t.setActiveTab(i.component)}}},[t._t("default",(function(){return[e("div",{class:"adaptiveTabs-groupButton-text adaptiveTabs-groupButton-text_".concat(t.getActiveTheme," ").concat(i.isActive?"adaptiveTabs-groupButton-text-isActive":""),style:{marginLeft:i.icon&&i.text?"0.4rem":"0"}},[t._v(t._s(t.$t(i.text)))])]}),{data:i})],2)})),t.getDropDownTab.length&&!t.firstRender?e("DropDownButton",{key:JSON.stringify(t.getDropDownTab),class:"adaptiveTabs-groupButton adaptiveTabs-groupButton_dropdown adaptiveTabs-groupButton_".concat(t.getActiveTheme,"-").concat(t.typeTheme),attrs:{items:t.getDropDownTab,id:t.idDropDown,"display-expr":"text",showArrowIcon:!0,hoverStateEnabled:!1,icon:t.$iconPath("new-dropdown-arrow-down"),focusStateEnabled:!1,"drop-down-options":{width:"".concat(t.getMaxWidthDropDownListItem,"px"),container:".adaptiveTabs-groupButton",position:{my:"top right",at:"bottom right",of:"#".concat(t.idDropDown),offset:{x:0,y:4}}},dropDownContentTemplate:"content"},scopedSlots:t._u([{key:"content",fn:function(i){var o=i.data;return[e("div",{staticClass:"adaptiveTabs-ddList",on:{wheel:function(t){t.stopPropagation()}}},t._l(o,(function(i,o){return e("div",{key:"".concat(i.text,"-").concat(o),ref:i.ref,refInFor:!0,class:"adaptiveTabs-ddListItem adaptiveTabs-ddListItem_".concat(t.getActiveTheme," ").concat(i.dopClass||""," ").concat(i.isActive?"adaptiveTabs-ddListItem-isActive_".concat(t.getActiveTheme):""),style:{padding:i.icon?"0.8rem 1.6rem 0.8rem 0.8rem":"0.8rem"},on:{click:function(e){return t.setActiveTab(i.component)}}},[t._t("default",(function(){return[i.icon?e("div",{staticClass:"adaptiveTabs-ddListItem-icon"},[e("svgIcon",{attrs:{name:i.icon}})],1):t._e(),e("div",{staticClass:"adaptiveTabs-ddListItem-text",style:{marginLeft:i.icon?"0.8rem":"0"}},[t._v(t._s(t.$t(i.text)))])]}),{data:i})],2)})),0)]}}],null,!0)}):t._e()],2)},k1=[],I1={components:{DropDownButton:Gg.a},props:{tabsSet:{type:Array,default:function(){return[]}},refTabWrapper:{type:HTMLDivElement},typeTheme:{type:Number,default:1},idDropDown:{type:String,default:"adaptiveTabs-groupButton_dropdown"},dopWidth:{type:Number,default:0}},data:function(){return{resizeObserver:null,widthWrapButton:0,firstRender:!0}},watch:{getActiveLang:function(){this.setWidthForTabs()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getUserSettings:"userSettings/getUserSettings"})),{},{getActiveLang:function(){return this.getUserSettings.lang?this.getUserSettings.lang.code:"en"},getTabs:function(){var t=this,e=32+this.dopWidth,i=[];return this.tabsSet.forEach((function(o){e+=o.minWidth,e=360?0:360}}},scopedSlots:t._u([{key:"title",fn:function(){return[t.statusDayReport?e("UserProfileDayReportWidget",{attrs:{statDay:t.statDay},on:{close:t.closeReport}}):t._e()]},proxy:!0}],null,!1,274191292)}):t._e()],1)},E1=[],U1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"incomeTable"},[e("div",{staticClass:"incomeTable-table"},[e("div",{class:"incomeTable-ginstagramm-title incomeTable-ginstagramm-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("itbm")))]),e("TableColumnsCustom",{attrs:{dataTable:t.getDataForTable,columns:t.getColumnsForTable,stickyHeader:!0},scopedSlots:t._u([{key:"column",fn:function(i){i.data;var o=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeTable-tableCell",style:{background:o<0?t.getRedColor.fill:o?t.getGreenColor.fill:"rgba(0,0,0,0)",color:o<0?t.getRedColor.color:o?t.getGreenColor.color:"light"===t.getActiveTheme?"#333":"#bbcee0"}},[t._v(t._s(o<0?t.$moneyf(o,2):o?"+".concat(t.$moneyf(o,2)):0))])]}},{key:"year",fn:function(i){var o=i.cellData,n=i.indexRow;return[e("div",{class:n===t.hoverIndex?"incomeTable-tableCell_hovered":"incomeTable-tableCell",style:{color:"light"===t.getActiveTheme?"#333":"#fff"}},[t._v(t._s(o))])]}}])})],1),t.points?e("div",{ref:"gistogrammWrap",staticClass:"incomeTable-ginstagramm"},[e("div",{class:"incomeTable-ginstagramm-title incomeTable-ginstagramm-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("income_by_days")))]),e("div",{staticClass:"incomeTable-ginstagramm-chart"},[e("GistogrammEventChart",{key:t.points[0][0].y,attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}},on:{clickPoint:t.hedlerClickChartPoint,hover:t.hoverPoint}}),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e(),t.historyButtonStatus?e("div",{class:"incomeTable-historyButtonWrap"},[e("ButtonIconFlat",{attrs:{modifier:{class:[t.fullHistory?"incomeTable-historyButton_isActive_".concat(t.getActiveTheme):"incomeTable-historyButton_".concat(t.getActiveTheme)]}},on:{click:t.setFullHistory}},[t._v(t._s(t.$t("the_entire_story")))])],1):t._e(),null!==t.hoverIndex?e("div",{class:"incomeTable-hoverWidget incomeTable-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"incomeTable-hoverWidgetRow incomeTable-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"incomeTable-hoverWidgetLabel incomeTable-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"incomeTable-hoverWidgetStat incomeTable-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1),t.statusMonthReport?e("DxPopup",{attrs:{visible:t.statusMonthReport,shading:!1,width:360,maxHeight:"calc(100vh - 200px)",dragEnabled:!0,dragOutsideBoundary:!0,container:".userIncomeTab"},scopedSlots:t._u([{key:"title",fn:function(){return[t.statusMonthReport?e("UserProfileMonthReportWidget",{attrs:{statDay:t.statMoth},on:{close:t.closeReport}}):t._e()]},proxy:!0}],null,!1,1090049150)}):t._e()],1):t._e()])},V1=[],H1=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"TableColumnsCustom vp_table_uniqueName",class:t.darkClass,style:t.styleRoot},[e("div",{ref:"table",staticClass:"tableColumns"},t._l(t.columns,(function(i,o){return e("ColumnTable",{key:i.field,attrs:{index:o,width:i.width,maxWidth:i.maxWidth,title:i.title,dataColumn:t.dataColumn[i.field],dataTable:t.dataPagination,align:i.align,field:i.field,slotName:i.cellTemplate,slotNameHeader:i.headerTemplate,sortedField:i.sortedField,vectorSort:t.sortedField[t.activeSortedField],activeSortedField:t.activeSortedField,sortingEnabled:i.sortingEnabled,resizeEnabled:t.resizeEnabled,hoverEnabled:t.hoverEnabled,size:t.sizeArr[o],calcSize:t.calcSize,heightRow:t.heightRow,stickyHeader:t.stickyHeader,fixedSize:i.fixedSize,columns:t.columns,indexHoverRow:t.indexHoverRow},scopedSlots:t._u([{key:i.cellTemplate,fn:function(e){return[t._t(i.cellTemplate,null,{data:e.data,index:o,cellData:e.cellData,indexRow:e.indexRow})]}},{key:i.headerTemplate,fn:function(e){return[t._t(i.headerTemplate,null,{title:e.title,column:i,indexColumn:e.indexColumn})]}}],null,!0)})})),1),t.isVisibleTable?t._e():e("div",{staticClass:"noData"},[t._v("Данные отсутствуют")])])},G1=[],q1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"colData",class:t.classRoot,style:Object(c["a"])(Object(c["a"])({},t.styleData),t.finishStyle),attrs:{"data-col":t.index}},[e("ThComponent",{attrs:{title:t.title,index:t.index,align:t.align,field:t.field,sortedField:t.sortedField,vectorSort:t.vectorSort,activeSortedField:t.activeSortedField,sortingEnabled:t.sortingEnabled,resizeEnabled:t.resizeEnabled,darkClass:t.darkClass,calcSize:t.calcSize,stickyHeader:t.stickyHeader,fixedSize:t.fixedSize,columns:t.columns,indexColumn:t.indexColumn,slotName:t.slotNameHeader},scopedSlots:t._u([{key:t.slotNameHeader,fn:function(e){return[t._t(t.slotNameHeader,null,{title:e.title,indexColumn:e.indexColumn})]}}],null,!0)}),t._l(t.dataColumn,(function(i,o){return e("TdComponent",{key:o,attrs:{indexColumn:t.indexColumn,indexRow:o,rowData:i,slotName:t.slotName,fullData:t.dataTable[o],align:t.align,darkClass:t.darkClass,calcSize:t.calcSize,heightRow:t.heightRow,hoverEnabled:t.hoverEnabled,indexHoverRow:t.indexHoverRow},scopedSlots:t._u([{key:t.slotName,fn:function(e){return[t._t(t.slotName,null,{data:e.data,cellData:e.cellData,indexRow:o})]}}],null,!0)})}))],2)},z1=[],Y1=function(){var t=this,e=t._self._c;return e("div",{staticClass:"th",class:t.classRoot,style:t.styleRoot,on:{click:t.sorted}},[t.calcSize?t._e():e("span",[t._t(t.slotName,(function(){return[t._v(t._s(t.title))]}),{title:t.title,indexColumn:t.indexColumn})],2),t.isVisibleArrowSorted?e("div",{staticClass:"arrowSorted",class:t.rotateVectorClass}):t._e(),t.isVisibleSliderLine?e("div",{staticClass:"sliderLine",on:{click:function(t){t.stopPropagation()}}}):t._e()])},X1=[],Q1={name:"ThComponent",inject:["sortedHandler"],props:{title:{type:String},index:{type:Number},align:{type:String},field:{type:String},sortedField:{type:[String,Boolean]},vectorSort:{type:[String,Boolean]},activeSortedField:{type:[String,Boolean]},sortingEnabled:{type:Boolean},resizeEnabled:{type:Boolean},darkClass:{type:Object},calcSize:{type:Boolean},stickyHeader:{type:Boolean},fixedSize:{type:Boolean},columns:{type:Array},indexColumn:{type:Number},slotName:{type:[String]}},computed:{styleAlign:function(){switch(this.align){case"center":return{justifyContent:"center"};case"right":return{justifyContent:"flex-end"};default:return{justifyContent:"flex-start"}}},styleRoot:function(){var t={};return this.stickyHeader&&(t["position"]="sticky",t["top"]=0,t["zIndex"]=2),Object(c["a"])(Object(c["a"])({},this.styleAlign),t)},classRoot:function(){return Object(c["a"])({sort:this.sortingEnabled},this.darkClass)},isVisibleArrowSorted:function(){return!!this.sortingEnabled&&this.activeSortedField===this.field},rotateVectorClass:function(){return{asc:"asc"===this.vectorSort}},isVisibleSliderLine:function(){var t,e;return(null===(t=this.columns[this.indexColumn-1])||void 0===t||!t.fixedSize)&&((null===(e=this.columns[this.indexColumn+1])||void 0===e||!e.fixedSize)&&(this.index>0&&this.resizeEnabled&&!this.fixedSize))}},methods:{sorted:function(){this.sortingEnabled&&this.sortedHandler(this.field,this.sortedField)}}},J1=Q1,K1=(i("3793"),Object(C["a"])(J1,Y1,X1,!1,null,"068396e6",null)),Z1=K1.exports,t2=function(){var t=this,e=t._self._c;return e("div",{staticClass:"td",class:t.rootClass,style:t.styleRoot,attrs:{"data-row":t.indexRow},on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[t.calcSize?t._e():e("span",[t._t(t.slotName,(function(){return[t._v(t._s(t.rowData))]}),{data:t.fullData,cellData:t.rowData})],2)])},e2=[],i2={name:"TdComponent",props:{rowData:{type:[String,Number,Object,Array]},slotName:{type:String},align:{type:String},fullData:{type:[Object,Array]},darkClass:{type:Object},calcSize:{type:Boolean},heightRow:{type:Number},indexColumn:{type:Number},indexRow:{type:Number},hoverEnabled:{type:Boolean},indexHoverRow:{type:[Number,Boolean]}},computed:{styleTd:function(){switch(this.align){case"center":return{justifyContent:"center"};case"right":return{justifyContent:"flex-end"};default:return{justifyContent:"flex-start"}}},styleRoot:function(){return Object(c["a"])(Object(c["a"])({},this.styleTd),{},{"--height":this.heightRow+"px"})},rootClass:function(){return["col".concat(this.indexColumn),Object(c["a"])({highlighted:this.indexHoverRow===this.indexRow},this.darkClass)]}},methods:{mouseenterHandler:function(t){if(this.hoverEnabled){var e=t.target.closest(".tableColumns"),i=t.target.dataset.row;e.querySelectorAll('[data-row="'.concat(i,'"]')).forEach((function(t){t.classList.add("hover")}))}},mouseleaveHandler:function(t){if(this.hoverEnabled){var e=t.target.closest(".tableColumns"),i=t.target.dataset.row;e.querySelectorAll('[data-row="'.concat(i,'"]')).forEach((function(t){t.classList.remove("hover")}))}}}},o2=i2,n2=(i("dcc1"),Object(C["a"])(o2,t2,e2,!1,null,"a3580c3c",null)),s2=n2.exports,r2={name:"ColumnTable",mixins:[xt],props:{index:{type:Number},title:{type:String},dataColumn:{type:Array},dataTable:{type:Array},width:{type:[String,Boolean],default:null},maxWidth:{type:[String,Boolean],default:null},slotName:{type:[String,Boolean],default:"default"},slotNameHeader:{type:[String,Boolean],default:"default"},align:{type:String,default:"left",validator:function(t){return["left","center","right"].includes(t)}},field:{type:String},sortedField:{type:[String,Boolean],default:null},vectorSort:{type:[String,Boolean]},activeSortedField:{type:[String,Boolean]},sortingEnabled:{type:Boolean,default:!0},resizeEnabled:{type:Boolean},size:{type:[Number,String]},calcSize:{type:Boolean},heightRow:{type:Number},stickyHeader:{type:Boolean},fixedSize:{type:Boolean,default:!1},hoverEnabled:{type:Boolean},columns:{type:Array},indexHoverRow:{type:[Number,Boolean]}},components:{ThComponent:Z1,TdComponent:s2},computed:{indexColumn:function(){return this.index},classRoot:function(){return["col".concat(this.index),this.darkClass]},styleData:function(){var t=this.width||[];return{minWidth:t.includes("px")||t.includes("%")?t:"auto",maxWidth:t.includes("px")||t.includes("%")?t:"none"}},finishStyle:function(){return this.size?{minWidth:this.fixedSize?this.size:this.size+"%",maxWidth:this.fixedSize?this.size:this.size+"%"}:{}}}},a2=r2,c2=(i("9a22"),Object(C["a"])(a2,q1,z1,!1,null,"811987d2",null)),l2=c2.exports,u2={name:"TableColumnsCustom",mixins:[xt],props:{dataTable:{type:Array,default:function(){return[]}},columns:{type:Array,default:function(){}},resizeEnabled:{type:Boolean,default:!0},hoverEnabled:{type:Boolean,default:!0},emitSize:{type:Boolean,default:!1},heightRow:{type:Number,default:32},stickyHeader:{type:Boolean,default:!1},pagination:{type:Boolean,default:!1},currentPage:{type:Number},count:{type:Number},indexHoverRow:{type:[Number,Boolean]}},components:{ColumnTable:l2},provide:function(){return{sortedHandler:this.sortedHandler}},data:function(){return{calcSize:!0,sortedField:{},activeSortedField:null,fieldSort:null,sizeArr:[]}},computed:{isVisibleTable:function(){var t;return(null===(t=this.dataTable)||void 0===t?void 0:t.length)>0},styleRoot:function(){return{"--overflow":this.stickyHeader?"visible":"hidden"}},sortedDataTable:function(){var t,e=this;if(!this.activeSortedField)return this.dataTable;var i=this.sortedField[this.activeSortedField],o=null===(t=this.columns.find((function(t){return t.field===e.activeSortedField})))||void 0===t?void 0:t.sortFunction;return Object(x["a"])(this.dataTable).sort((function(t,n){var s=o?o(t):t[e.activeSortedField],r=o?o(n):n[e.activeSortedField];return"desc"===i?e.fieldSort?t[e.activeSortedField][e.fieldSort]>n[e.activeSortedField][e.fieldSort]?-1:0:s>r?-1:0:e.fieldSort?n[e.activeSortedField][e.fieldSort]>t[e.activeSortedField][e.fieldSort]?-1:0:r>s?-1:0}))},dataPagination:function(){if(!this.pagination)return this.sortedDataTable;var t=this.currentPage*this.count,e=this.currentPage*this.count+this.count;return this.sortedDataTable.slice(t,e)},dataColumn:function(){var t=this,e={};return this.columns.forEach((function(i){e[i.field]=t.dataPagination.map((function(t){return t[i.field]}))})),e},isPagination:function(){var t;return this.pagination&&(null===(t=this.dataTable)||void 0===t?void 0:t.length)>this.pageSize[0]}},mounted:function(){if(this.$refs.table){var t=this.$refs.table.querySelectorAll(".vp_table_uniqueName .colData");this.settingSize(t),this.$refs.table.addEventListener("pointerdown",this.resizeFunction)}},beforeDestroy:function(){var t;null===(t=this.$refs.table)||void 0===t||t.removeEventListener("pointerdown",this.resizeFunction)},watch:{columns:function(){var t=this;this.calcSize=!0,this.$nextTick((function(){var e=t.$refs.table.querySelectorAll(".vp_table_uniqueName .colData");e.forEach((function(t){return t.removeAttribute("style")})),t.settingSize(e)}))}},methods:{settingSize:function(t){var e=this;if(this.$refs.table){var i=this.$refs.table.getBoundingClientRect(),o=i.width;setTimeout((function(){var i=Array.from(e.columns).map((function(i,n){var s;return i.fixedSize?i.width:e.calcPercent(null===(s=t[n])||void 0===s||null===(s=s.getBoundingClientRect())||void 0===s?void 0:s.width,o)}));e.emitSize&&e.$emit("getSizeArr",i),e.sizeArr=i,e.calcSize=!1}),0)}},resizeFunction:function(t){if(t.target.classList.contains("sliderLine")){var e=this,i=t.target.closest(".colData"),o=i.previousElementSibling,n=i.getBoundingClientRect(),s=n.width,r=n.left,a=o.getBoundingClientRect(),c=a.width,l=this.$refs.table.getBoundingClientRect(),u=l.width;this.$refs.table.onpointermove=function(t){var n=r-t.pageX;if(!(s+n<20||c-n<20)){var a=e.calcPercent(n,u),l=e.calcPercent(s,u),d=e.calcPercent(c,u);i.style.minWidth=l+a+"%",i.style.maxWidth=l+a+"%",o.style.minWidth=d-a+"%",o.style.maxWidth=d-a+"%"}},this.$refs.table.onpointerup=function(){this.onpointermove=null,this.onpointerup=null}}},calcPercent:function(t,e){return 100*t/e},sortedHandler:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.fieldSort=e,!this.sortedField[t])return this.$set(this.sortedField,t,"asc"),void(this.activeSortedField=t);var i=this.sortedField[t];this.sortedField[t]="asc"===i?"desc":"asc",this.activeSortedField=t}}},d2=u2,h2=(i("f390"),Object(C["a"])(d2,H1,G1,!1,null,"076ec260",null)),p2=h2.exports,g2=function(){var t=this,e=t._self._c;return e("div",{ref:"reportWrap",class:"userProfileDayReport userProfileDayReport_".concat(t.getActiveTheme),style:"left"===t.side?{left:0}:{right:0}},[e("div",{staticClass:"userProfileDayReport-wrapper"},[e("div",{class:"userProfileDayReport-title userProfileDayReport-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-titleText"},[t._v(t._s(t.$t("reportOfDay"))+" "+t._s(t.getDateForDay))]),e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["userProfileDayReport-controlButtonItem","userProfileDayReport-controlButtonItem_".concat(t.getActiveTheme)]}},on:{toggle:t.closeReport}})],1),e("div",{class:"userProfileDayReport-content userProfileDayReport-content_".concat(t.getActiveTheme)},[e("DxAccordion",{key:t.getRerenderStatus,attrs:{"data-source":t.getAccordionTabs,height:"100%",hoverStateEnabled:!1},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{class:"userProfileDayReport-titleAccordion userProfileDayReport-titleAccordion_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-textAccordionTitle"},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(o.title))]),e("div",{class:"userProfileDayReport-count userProfileDayReport-count_".concat(t.getActiveTheme)},[t._v(t._s(o.count))]),3===o.ID&&t.getSummaryProfitForClosedOrders?e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(t.getSummaryProfitForClosedOrders<0?"red":"green"),style:{marginLeft:"0.4rem"}},[t._v("$ "+t._s(t.$moneyf(t.getSummaryProfitForClosedOrders)))]):t._e()])])]}},{key:"item",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{staticClass:"userProfileDayReport-accordionWrap"},[1===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.title)))]),e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(i.data))])])})),0):t._e(),2===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v("Контракт")]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v("Тип")]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v("Объём")]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v("Цена открытия")])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-priceOpenTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.openPrice))])])}))],2):t._e(),3===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v("Контракт")]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v("Тип")]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v("Объём")]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, %")])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s((100/(i.volume/i.profit)).toFixed(2)))])])}))],2):t._e(),4===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{staticClass:"userProfileDayReport-diagramWrapper"},[e("SectorDiagram",{attrs:{height:210,width:210,widthBorder:65,percents:t.getSectorDiagramObject}})],1),e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v("Контракт")]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v("Объём")]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v("%, от общего")])]),t._l(t.getSectorDiagramObject,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-contactTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.symbol))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit.toFixed(2)))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-priceOpenTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.data))])])}))],2):t._e()])]}}])})],1)])])},f2=[],m2={components:{DxAccordion:uw.a,SectorDiagram:MB,VuePerfectScrollbar:Xt.a},mixins:[yn],props:{statDay:{type:[Object,Array]},contract:{type:String,default:""},side:{default:"left"}},data:function(){return{accordionData:null,userOrders:null,portfolioStat:[],statContract:null,heightWrap:0}},watch:{statDay:function(){this.setDataForPortfolio()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme",getUsingAccountContracts:"contracts/getUsingAccountContracts"})),{},{getStatForMonth:function(){var t=this;if(this.getStatistics)return this.getStatistics.accountDaily.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.statDay.statDay.date).getFullYear()&&new Date(e.date).getMonth()===new Date(t.statDay.statDay.date).getMonth()}))},getSectorDiagramObject:function(){if(this.portfolioStat){var t=this.portfolioStat.reduce((function(t,e){return t+e.volume}),0),e=[];return this.portfolioStat.forEach((function(i){e.push({volume:i.volume,profit:i.profit,symbol:i.contract,color:v2(),data:Number((100/(t/i.volume)).toFixed(2))})})),e}},getDateForDay:function(){return"".concat(this.$t("mounthArr")[new Date(this.statDay.statDay.date).getMonth()]," ").concat(new Date(this.statDay.statDay.date).getFullYear())},getRerenderStatus:function(){return this.getActiveTheme+this.heightWrap},getAccordionTabs:function(){if(this.getCloseOrdersForMonth&&this.getOpenOrdersForMonth&&this.getStatDataForReport&&this.getSectorDiagramObject)return[{ID:1,title:"Статистика за месяц",data:this.getStatDataForReport},{ID:2,title:"Открытые ордера",count:this.getOpenOrdersForMonth.length,data:this.getOpenOrdersForMonth},{ID:3,title:"Закрытые ордера",count:this.getCloseOrdersForMonth.length,data:this.getCloseOrdersForMonth},{ID:4,title:"Торгуемые инструменты",count:this.getSectorDiagramObject.length,data:this.getSectorDiagramObject}]},getSummaryProfitForClosedOrders:function(){if(this.getCloseOrdersForMonth)return this.getCloseOrdersForMonth.reduce((function(t,e){return t+e.profit}),0)},getCloseOrdersForMonth:function(){if(this.userOrders){var t=this.statDay.statDay.date,e=this.userOrders.closedOrders.filter((function(e){return new Date(e.closedDate).getFullYear()===new Date(t).getFullYear()&&new Date(e.closedDate).getMonth()===new Date(t).getMonth()}));return e}},getOpenOrdersForMonth:function(){if(this.userOrders){var t=this.statDay.statDay.date,e=this.userOrders.closedOrders.filter((function(e){return new Date(e.createdDate).getFullYear()===new Date(t).getFullYear()&&new Date(e.createdDate).getMonth()===new Date(t).getMonth()})),i=this.userOrders.tradingOrders.filter((function(e){return new Date(e.createdDate).getFullYear()===new Date(t).getFullYear()&&new Date(e.createdDate).getMonth()===new Date(t).getMonth()}));return i.concat(e)}},getStatDataForReport:function(){if(this.getStatForMonth)return[{title:"Баланс начало месяца",data:this.$moneyf(this.getStatForMonth[0].balanceClose),color:"blue",symbol:"$"},{title:"Баланс конец месяца",data:this.$moneyf(this.getStatForMonth.at(-1).balanceClose),color:"blue",symbol:"$"},{title:"Баланс минимум",data:this.$moneyf(Math.min.apply(null,this.getStatForMonth.map((function(t){return t.balanceClose})))),color:"blue",symbol:"$"},{title:"Баланс максимум",data:this.$moneyf(Math.max.apply(null,this.getStatForMonth.map((function(t){return t.balanceClose})))),color:"blue",symbol:"$"},{title:"PL,$ по балансу",data:this.$moneyf(this.getStatForMonth.at(-1).balanceClose-this.getStatForMonth[0].balanceClose,2),color:this.getStatForMonth.at(-1).balanceClose-this.getStatForMonth[0].balanceClose<0?"red":"green",symbol:"$"},{title:"Средства начало месяца",data:this.$moneyf(this.getStatForMonth[0].equityOpen),color:"green",symbol:"$"},{title:"Средства конец месяца",data:this.$moneyf(this.getStatForMonth.at(-1).equityClose),color:"green",symbol:"$"},{title:"Средства максимум",data:this.$moneyf(Math.max.apply(null,this.getStatForMonth.map((function(t){return t.equityClose}))),2),color:"green",symbol:"$"},{title:"Средства минимум",data:this.$moneyf(Math.min.apply(null,this.getStatForMonth.map((function(t){return t.equityClose}))),2),color:"green",symbol:"$"},{title:"PL, $ по средствам",data:this.$moneyf(this.getStatForMonth.at(-1).equityClose-this.getStatForMonth[0].equityOpen,2),color:this.getStatForMonth.at(-1).equityClose-this.getStatForMonth[0].equityOpen>0?"green":"red",symbol:"$"},{title:"leverageWord",data:this.getStatForMonth.at(-1).leverage,color:"gray",symbol:""},{title:"leverageHigh",data:this.getStatForMonth.at(-1).leverageHigh,color:"gray",symbol:""},{title:"margin",data:this.$moneyf(this.getStatForMonth.at(-1).margin),color:"pink",symbol:"$"},{title:"Маржа максимум",data:this.$moneyf(this.getStatForMonth.at(-1).marginHigh),color:"pink",symbol:"$"},{title:"swaps",data:this.$moneyf(this.getStatForMonth.at(-1).swaps),color:this.getStatForMonth.at(-1).swaps<0?"red":"green",symbol:"$"},{title:"Максимальная просадка",data:this.getStatForMonth.at(-1).drawdownHigh.toFixed(2),color:"red",symbol:"%"}]}}),methods:{closeReport:function(){this.$emit("close")},setDataForPortfolio:function(){var t=this;this.portfolioStat=[],this.getUsingAccountContracts.forEach((function(e){t.statContract=JSON.parse(sessionStorage.getItem("statContract".concat(e)));var i=t.statDay.statDay.date;if(t.statContract){var o=t.statContract.find((function(t){return new Date(t[3]).getFullYear()===new Date(i).getFullYear()&&new Date(t[3]).getMonth()===new Date(i).getMonth()}));o&&t.portfolioStat.push({contract:o[0],profit:o[1],volume:o[7]})}}))},onResize:function(t){this.heightWrap=t[0].contentRect.height}},mounted:function(){var t=this;this.$orderStorage.getOrdersOnStorage()&&(this.userOrders=this.$orderStorage.getOrdersOnStorage()),this.getUsingAccountContracts&&this.setDataForPortfolio(),this.$nextTick((function(){t.observerElem=t.$refs.reportWrap,t.initObserver()}))}};function v2(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var y2=m2,C2=(i("79e4"),Object(C["a"])(y2,g2,f2,!1,null,null,null)),b2=C2.exports,S2={components:{TableColumnsCustom:p2,TitlesForGistogram:DI,GistogrammEventChart:TI,DxPopup:xo.a,UserProfileMonthReportWidget:b2},mixins:[qe],data:function(){return{points:null,historyButtonStatus:!1,fullHistory:!1,hoverIndex:null,positionHoverWidget:null,statsForHoverWidget:null,statusMonthReport:!1,averLine:[],bars:[],statMoth:null}},watch:{getEquityClose:function(){this.setPointsForChart(this.fullHistory)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getYearsStat:"statistic/getYearsStat",getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime"})),{},{getEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getStartDeposit:function(){if(this.getStatistics)return this.getStatistics.transfers?this.getStatistics.transfers[0].amount:this.getStatistics.account.balance},getDataForTable:function(){var t=this;if(this.getYearsStat){var e=[];if(Array.isArray(this.getYearsStat)){var i;e.push((i={year:new Date(this.getServerTime.now).getFullYear()},Object(Vt["a"])(i,"month_".concat(new Date(this.getServerTime.now).getMonth()),100*(this.getEquityClose-this.getStartDeposit)/this.getStartDeposit),Object(Vt["a"])(i,"count",100*(this.getEquityClose-this.getStartDeposit)/this.getStartDeposit),i))}else{var o=function(i){e.push({year:i}),t.$t("mounthArr").forEach((function(o,n){var s=t.getYearsStat[i].find((function(t){return t.month===n}));e.at(-1)["month_".concat(n)]=s?s.profitRel:null}));var o=t.getYearsStat[i].reduce((function(t,e){return t+=e.profitRel,t}),0);e.at(-1).count=o};for(var n in this.getYearsStat)o(n)}return e}},getColumnsForTable:function(){var t=[{title:this.$t("year"),field:"year",sortingEnabled:!1,cellTemplate:"year",width:"55px",align:"center"}];return this.$t("mounthArr").forEach((function(e,i){t.push({title:e,field:"month_".concat(i),sortingEnabled:!1,cellTemplate:"column",align:"center"})})),t.push({title:this.$t("result"),field:"count",sortingEnabled:!1,cellTemplate:"column",align:"center"}),t},getMetaInfoForLines:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("average")}]},getStat:function(){if(this.bars.length&&this.averLine.length){var t=this.bars.at(-1).y,e=Math.max.apply(null,this.bars.map((function(t){return t.y}))),i=Math.min.apply(null,this.bars.map((function(t){return t.y}))),o=this.averLine.at(-1).y;return[{label:"P/L",symbol:"%",data:this.$moneyf(t,t<.01?5:3),color:this.bars.at(-1).y<0?"red":"green"},{label:this.$t("max"),symbol:"%",data:this.$moneyf(e,Math.abs(e)<.01?5:3),color:"green"},{label:this.$t("min"),symbol:"%",data:this.$moneyf(i,Math.abs(i)<.01?5:3),color:"red"},{label:this.$t("average"),symbol:"%",data:this.$moneyf(o,Math.abs(o)<.01?5:3),color:"orange"}]}}}),methods:{hedlerClickChartPoint:function(t){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),i=this.getStatistics.accountDaily.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}));this.statMoth={index:i,statDay:e},this.statusMonthReport=!0},closeReport:function(){this.statusMonthReport=!1},setFullHistory:function(){this.fullHistory=!this.fullHistory,this.setPointsForChart(this.fullHistory)},hoverPoint:function(t){if(t){this.hoverIndex=t.point.x;var e=t.point.date,i=this.getStatistics.accountDaily.find((function(t){return new Date(t.date).getTime()===new Date(e).getTime()}));if(i){var o={width:this.$refs.gistogrammWrap.clientWidth,height:this.$refs.gistogrammWrap.clientHeight},n=o.width-t.event.offsetX,s=o.height-t.event.offsetY;this.positionHoverWidget={top:"".concat(s>110?t.event.offsetY:t.event.offsetY-110,"px"),left:"".concat(n>152?t.event.offsetX+12:t.event.offsetX-152,"px")};var r=i.equityClose-i.equityOpen,a=100*r/i.equityOpen,c=this.averLine[this.hoverIndex].y;this.statsForHoverWidget=[{label:"Дата",stat:new Date(e).toLocaleDateString("ru"),color:"white"},{label:this.$t("Balance"),stat:"$ ".concat(this.$moneyf(i.balanceClose,2)),color:"blue"},{label:this.$t("headerAccountMenuGetLoad2"),stat:"$ ".concat(this.$moneyf(i.equityClose,2)),color:"green"},{label:"P/L, %",stat:Math.abs(a)<.001?">0.001":Math.abs(a)<.01?"".concat(this.$moneyf(a,3)):"".concat(this.$moneyf(a,2)),color:a<0?"red":"green"},{label:"P/L, $",stat:"".concat(this.$moneyf(r,2)),color:r<0?"red":"green"},{label:"Среднее",stat:c<.001?">0.001":"".concat(c<.01?this.$moneyf(c,3):this.$moneyf(c,2)),color:"orange"}]}}else this.hoverIndex=null},setPointsForChart:function(t){var e=this,i=this.getStatistics.ordersStatistics.startTradingDT,o=this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.filter((function(t){return i?new Date(t.date).getTime()>=new Date(i).getTime()&&t.equityClose:t.equityClose})):[{equityClose:this.getEquityClose,equityOpen:this.getStartDeposit,date:this.getServerTime.now}];this.bars=[],this.averLine=[];var n,s=0;o.length>365&&!t?(n=o.slice(-365),this.historyButtonStatus=!0):n=o,n.forEach((function(t,i){var o=t.equityClose-t.equityOpen,n=o&&t.equityOpen?100*o/t.equityOpen:0;s+=n,e.bars.push({x:i,y:n,date:t.date}),e.averLine.push({x:i,y:s/(i+1),date:t.date})})),this.points=[[{x:0,y:0,date:o[0].date}],this.bars,this.averLine]}},mounted:function(){this.getYearsStat&&this.setPointsForChart(this.fullHistory)}},P2=S2,T2=(i("837f"),Object(C["a"])(P2,U1,V1,!1,null,"5bab197e",null)),x2=T2.exports,O2=function(){var t=this,e=t._self._c;return e("div",{staticClass:"clearProfit"},[e("div",{staticClass:"clearProfit-content",class:"clearProfit-content_".concat(t.getActiveTheme)},[e("div",{class:"clearProfit-chartWrap clearProfit-chartWrap_".concat(t.getActiveTheme)},[t.points?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,watermark:t.$t("net_profit_full"),watermarkData:t.getWaterMarkData,minIndicator:{lines:[2]},maxIndicator:{lines:[2]}},on:{hover:t.hoverPoint}}):t._e(),e("div",{class:"clearProfit-statData clearProfit-statData_".concat(t.getActiveTheme)},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit?e("div",{key:o,class:"clearProfit-currentProfit clearProfit-currentProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"clearProfit-currentProfit-arrow"},[e("div",{style:{color:"down"===t.directions[o]?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directions[o],"_direct")}})],1)]),e("div",{staticClass:"clearProfit-currentProfit-data",class:"clearProfit-currentProfit-data_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data[0],2))))]),e("div",{staticClass:"clearProfit-currentProfit-title",class:"clearProfit-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"clearProfit-currentProfit-text",class:"clearProfit-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])]):t._e()})),0),t.historyButtonStatus?e("div",{class:"clearProfit-historyButtonWrap"},[e("ButtonIconFlat",{attrs:{modifier:{class:[t.fullHistory?"clearProfit-historyButton_isActive_".concat(t.getActiveTheme):"clearProfit-historyButton_".concat(t.getActiveTheme)]}},on:{click:t.setFullHistory}},[t._v(t._s(t.$t("the_entire_story")))])],1):t._e(),null!==t.hoverIndex?e("div",{class:"clearProfit-hoverWidget clearProfit-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"clearProfit-hoverWidgetRow clearProfit-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"clearProfit-hoverWidgetStat clearProfit-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1),e("div",{class:"clearProfit-gistogrammTitle clearProfit-gistogrammTitle_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("income_by_days"),", ").concat(t.getCurrencyChar)))]),e("div",{staticClass:"clearProfit-gistogramm"},[e("GistogrammEventChart",{attrs:{points:t.pointsForGistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)])])},w2=[],_2={components:{LineEventChart:Uk,GistogrammEventChart:TI,TitlesForGistogram:DI},mixins:[qe,Xh],data:function(){return{accountId:null,historyButtonStatus:!1,fullHistory:!1,stat:null,statsForHoverWidget:null,positionHoverWidget:null,points:null,pointsForGistogram:null,hoverIndex:null,directions:["up","up"]}},watch:{getAbsProfit:function(t,e){e&&t&&(this.directions[1]=t365&&!t?(e=this.stat.slice(-365),this.historyButtonStatus=!0):e=this.stat,e.forEach((function(t,e){var u=t[8]+t[9],d=t[5]-u;l++,c+=t[5],a+=d,i.push({date:t[0],x:e,y:t[5]}),o.push({date:t[0],x:e,y:t[2]}),n.push({date:t[0],x:e,y:c/l}),s.push({date:t[0],x:e,y:d}),r.push({date:t[0],x:e,y:a/l})})),this.pointsForGistogram=[[{x:0,y:0,date:new Date}],s,r],this.points=[n,o,i]},getDataForProfit:function(){var t={Command:"AccountProfitByHourse",Data:{accountId:this.accountId}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.$socketStream.$on("apiWS3",this.setMessageHendler),this.accountId=JSON.parse(sessionStorage.getItem("userProfileInfo")).accountId,this.accountId&&this.getDataForProfit()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),this.$socketStream.$off("apiWS3",this.setMessageHendler)}},A2=_2,D2=(i("c3dd"),Object(C["a"])(A2,O2,w2,!1,null,"374385ca",null)),k2=D2.exports,I2=function(){var t,e=this,i=e._self._c;return i("div",{ref:"wrap",class:"incomeEquityTab incomeEquityTab_".concat(e.getActiveTheme)},[i("div",{class:"incomeEquityTab-head incomeEquityTab-head_".concat(e.getActiveTheme)},[i("DxSelectBox",{attrs:{items:e.getTabsForYear,value:e.getTabsForYear.at(-1).year,"display-expr":"year","value-expr":"year","field-template":"field","item-template":"item",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1,dropDownOptions:{container:".incomeEquityTab"}},scopedSlots:e._u([{key:"field",fn:function(t){var o=t.data;return[i("div",{class:"incomeEquityTab-yearTab ".concat(e.activeYear===o.year?"incomeEquityTab-yearTab_isActive_".concat(e.getActiveTheme):"incomeEquityTab-yearTab_".concat(e.getActiveTheme)),style:{background:e.activeYear===o.year?"light"===e.getActiveTheme?"#2462db":"#00b9fc":o.color}},[e._v(e._s(o.year)),e.hoverIndexYear===o.year?i("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(e.getActiveTheme,"-").concat(o.profitAbs<0?"negative":"positive")},[i("div",[e._v("$ "+e._s(e.$moneyf(o.profitAbs,2)))]),i("div",[e._v("% "+e._s(e.$moneyf(o.profitRel,2)))])]):e._e(),i("DxTextBox",{attrs:{visible:!1}})],1)]}},{key:"item",fn:function(t){var o=t.data;return[i("div",{class:"incomeEquityTab-yearTab ".concat(e.activeYear===o.year?"incomeEquityTab-yearTab_isActive_".concat(e.getActiveTheme):"incomeEquityTab-yearTab_".concat(e.getActiveTheme)),style:{background:e.activeYear===o.year?"light"===e.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{click:function(t){return e.setActiveYear(o.year)}}},[e._v(e._s(o.year))])]}}])}),i("div",{class:"incomeEquityTab-head incomeEquityTab-head_".concat(e.getActiveTheme)},[e.getListTabs&&e.getListTabs.length?i("div",{class:"incomeEquityTab-yearTabsList"},[i("DxSelectBox",{key:e.getListTabs.length,attrs:{items:e.getListTabs,placeholder:"",value:e.getListTabs.at(-1).title,"display-expr":"title","value-expr":"title","field-template":"field","item-template":"item",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1},scopedSlots:e._u([{key:"field",fn:function(t){var o=t.data;return[i("div",{class:"incomeEquityTab-yearTab ".concat(e.activeTabMonth===o.month?"incomeEquityTab-yearTab_isActive_".concat(e.getActiveTheme):"incomeEquityTab-yearTab_".concat(e.getActiveTheme)),style:{background:e.activeTabMonth===o.month?"light"===e.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{mouseenter:function(t){return e.setHoverIndex(o.month,"month")},mouseleave:function(t){return e.setHoverIndex(null,"month")}}},[e._v(e._s(o.title)),e.hoverIndexMonth===o.month?i("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(e.getActiveTheme,"-").concat(o.profitAbs<0?"negative":"positive")},[i("div",[e._v("$ "+e._s(e.$moneyf(o.profitAbs,2)))]),i("div",[e._v("% "+e._s(e.$moneyf(o.profitRel,2)))])]):e._e(),i("DxTextBox",{attrs:{visible:!1}})],1)]}},{key:"item",fn:function(t){var o=t.data;return[i("div",{class:"incomeEquityTab-yearTab ".concat(e.activeTabMonth===o.month?"incomeEquityTab-yearTab_isActive_".concat(e.getActiveTheme):"incomeEquityTab-yearTab_".concat(e.getActiveTheme)),style:{background:e.activeTabMonth===o.month?"light"===e.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{click:function(t){return e.setActiveMonth(o.month)}}},[e._v(e._s(o.title))])]}}],null,!1,1615902957)})],1):e._e(),e._l(e.getLineTabs,(function(t,o){return i("div",{key:o,class:"incomeEquityTab-yearTab ".concat(e.activeTabMonth===t.month?"incomeEquityTab-yearTab_isActive_".concat(e.getActiveTheme):"incomeEquityTab-yearTab_".concat(e.getActiveTheme)),style:{background:e.activeTabMonth===t.month?"light"===e.getActiveTheme?"#2462db":"#00b9fc":t.color},on:{mouseenter:function(i){return e.setHoverIndex(t.month,"month")},mouseleave:function(t){return e.setHoverIndex(null,"month")},click:function(i){return e.setActiveMonth(t.month)}}},[e._v(e._s(t.title)),e.hoverIndexMonth===t.month?i("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(e.getActiveTheme,"-").concat(t.profitAbs<0?"negative":"positive")},[i("div",[e._v("$ "+e._s(e.$moneyf(t.profitAbs,2)))]),i("div",[e._v("% "+e._s(e.$moneyf(t.profitRel,2)))])]):e._e()])}))],2),i("div",{staticClass:"incomeEquityTab-titleButtons"},[i("div",{class:"incomeEquityTab-titleButton ".concat("abs"!==e.type?"incomeEquityTab-titleButton_".concat(e.getActiveTheme):"incomeEquityTab-titleButton_isActive_".concat(e.getActiveTheme)),on:{click:function(t){return e.setTypeGistogramm("abs")}}},[i("svgIcon",{attrs:{name:"SortDollar"}})],1),i("div",{class:"incomeEquityTab-titleButton ".concat("rel"!==e.type?"incomeEquityTab-titleButton_".concat(e.getActiveTheme):"incomeEquityTab-titleButton_isActive_".concat(e.getActiveTheme)),on:{click:function(t){return e.setTypeGistogramm("rel")}}},[i("svgIcon",{attrs:{name:"new-procent-icon"}})],1)])],1),i("div",{staticClass:"incomeEquityTab-content"},[i("div",{class:e.widthWrap>=950?"incomeEquityTab-contentWrap":"incomeEquityTab-contentWrapDirection"},[i("div",{class:"incomeEquityTab-dataTable incomeEquityTab-dataTable_".concat(e.getActiveTheme),style:{maxHeight:e.widthWrap>=950?"100%":"30rem"}},[i("VuePerfectScrollbar",{staticClass:"incomeEquityTab-table"},[i("TableColumnsCustom",{key:e.widthWrap,attrs:{dataTable:e.getDataForTable,columns:e.getColumnsForTable,indexHoverRow:e.hoverIndex,stickyHeader:!0},scopedSlots:e._u([{key:"column",fn:function(t){var o=t.data,n=t.cellData;t.indexRow;return[i("div",{staticClass:"incomeEquityTab-tableCell",style:{color:o.color}},[e._v(e._s(n))])]}},{key:"date",fn:function(t){var o=t.cellData;t.indexRow;return[i("div",{staticClass:"incomeEquityTab-tableCell"},[e._v(e._s(o))])]}}])})],1),i("div",{staticClass:"incomeEquityTab-absProfit",class:"incomeEquityTab-absProfit_".concat(e.getActiveTheme)},[i("div",{staticClass:"incomeEquityTab-absProfitData",style:{color:e.getMonthProfit<0?e.getRedColor.color:e.getGreenColor.color}},[i("div",{staticClass:"incomeEquityTab-absProfitDataIcon",style:{color:"up"===e.directionsMonthProfit?e.getGreenColor.color:e.getRedColor.color}},[i("svgIcon",{attrs:{name:"Arrow_".concat(e.directionsMonthProfit,"_direct"),size:14}})],1),i("div",{staticClass:"incomeEquityTab-absProfitAbs"},[e._v(e._s(null===(t=e.getTotalMonthPercent)||void 0===t?void 0:t.data))])]),i("div",{staticClass:"incomeEquityTab-absProfitTitle"},[i("div",{staticClass:"incomeEquityTab-absProfitTitleText",class:"incomeEquityTab-absProfitTitleText_".concat(e.getActiveTheme)},[e._v(e._s(e.$t("ipfm")))])])])],1),i("div",{ref:"chart",staticClass:"incomeEquityTab-chart"},[i("div",{staticClass:"incomeEquityTab-chartTitle"},e._l(e.getStatForTitleChart,(function(t,o){return e.getStatForTitleChart?i("div",{key:o,class:"incomeEquityTab-currentProfit incomeEquityTab-currentProfit_".concat(e.getActiveTheme),style:{color:o?e.getGreenColor.color:e.getBlueColor.color}},[i("div",{staticClass:"incomeEquityTab-currentProfit-arrow"},["down"===e.directions[o]?i("div",{style:{color:o?e.getRedColor.color:e.getBlueColor.color}},[i("svgIcon",{attrs:{name:"Arrow_down_direct"}})],1):i("div",{style:{color:o?e.getGreenColor.color:e.getBlueColor.color}},[i("svgIcon",{attrs:{name:"Arrow_up_direct"}})],1)]),i("div",{staticClass:"incomeEquityTab-currentProfit-data",class:"incomeEquityTab-currentProfit-data_".concat(e.getActiveTheme)},[e._v(e._s("".concat(e.getCurrencyChar," ").concat(t.data)))]),i("div",{staticClass:"incomeEquityTab-currentProfit-title",class:"incomeEquityTab-currentProfit-title_".concat(e.getActiveTheme)},[i("div",{staticClass:"incomeEquityTab-currentProfit-text",class:"incomeEquityTab-currentProfit-text_".concat(e.getActiveTheme)},[e._v(e._s(t.label))])])]):e._e()})),0),i("div",{staticClass:"incomeEquityTab-lineChart"},[e.points?i("SectorLineEventChart",{key:e.points[0][0].y,attrs:{points:e.points,theme:e.getActiveTheme,metaInfoForLines:e.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},watermark:e.$t("equity_increase"),watermarkData:e.getTotalMonthPercent},on:{hover:e.hoverPoint,clickPoint:e.hedlerClickChartPoint}}):e._e(),null!==e.hoverIndex?i("div",{class:"incomeEquityTab-hoverWidget incomeEquityTab-hoverWidget_".concat(e.getActiveTheme),style:e.positionHoverWidget},e._l(e.statsForHoverWidget,(function(t,o){return i("div",{key:o,class:"incomeEquityTab-hoverWidgetRow incomeEquityTab-hoverWidgetRow_".concat(e.getActiveTheme)},[i("div",{class:"incomeEquityTab-hoverWidgetLabel incomeEquityTab-hoverWidgetLabel_".concat(e.getActiveTheme)},[e._v(e._s(t.label))]),i("div",{class:"incomeEquityTab-hoverWidgetStat incomeEquityTab-hoverWidgetStat_".concat(e.getActiveTheme,"-").concat(t.color)},[e._v(e._s(t.stat))])])})),0):e._e(),i("DxPopup",{attrs:{visible:e.statusDayReport,shading:!1,width:360,height:800,maxHeight:"calc(100vh - 200px)",dragEnabled:!0,container:".userIncomeTab",dragOutsideBoundary:!0},scopedSlots:e._u([{key:"title",fn:function(){return[e.statusDayReport?i("UserProfileDayReportWidget",{attrs:{statDay:e.statDay,side:e.xWidthPoint>=360?"left":"right"},on:{close:e.closeReport}}):e._e()]},proxy:!0}])})],1),i("div",{staticClass:"incomeEquityTab-gistogrammChart"},[i("div",{class:"incomeEquityTab-gistogrammChart-title incomeEquityTab-gistogrammChart-title_".concat(e.getActiveTheme)},[i("div",{staticClass:"incomeEquityTab-gistogrammChart-text"},[e._v(e._s(e.$t("income_by_days")))])]),i("div",{staticClass:"incomeEquityTab-gistogrammChart-chart"},[e.pointsForGistogramm?i("GistogrammEventChart",{key:e.pointsForGistogramm[0][0].y,attrs:{points:e.pointsForGistogramm,theme:e.getActiveTheme,metaInfoForLines:e.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):e._e()],1)])])])])])},B2=[],M2={components:{TableColumnsCustom:p2,GistogrammEventChart:TI,SectorLineEventChart:Fj,VuePerfectScrollbar:Xt.a,UserProfileDayReportWidget:RB,DxPopup:xo.a,DxSelectBox:Bo.a,DxTextBox:rc.a},mixins:[qe,yn],data:function(){return{activeYear:null,activeTabMonth:null,statusDayReport:!1,widthWrap:0,statDay:null,points:null,pointsForGistogramm:null,accountId:null,hoverIndexYear:null,hoverIndexMonth:null,hoverIndex:null,directions:["up","up"],directionsMonthProfit:"up",positionHoverWidget:{top:"0px",right:"0px"},type:"abs",statsForHoverWidget:null}},watch:{getStatByPeriod:function(t){t&&this.setPointsForChart(t)},getMonthProfit:function(t,e){void 0===t&&void 0===e||(this.directionsMonthProfit=t1e4?0:2)," / %").concat(this.$moneyf(i,2)),color:e<0?this.getRedColor.fill:this.getGreenColor.fill}},getStatByPeriod:function(){if(this.getStatistics&&null!==this.activeYear){var t=this.activeTabMonth,e=this.activeYear,i=this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.filter((function(i){return new Date(i.date).getFullYear()===e&&new Date(i.date).getMonth()===t&&0!==new Date(i.date).getDay()&&6!==new Date(i.date).getDay()})):[{date:this.getServerTime.now,equityClose:this.getStatistics.account.equity,equityOpen:this.getStartDeposit,balanceClose:this.getStatistics.account.balance}];return i}},getDataForTable:function(){var t=this;if(this.getStatByPeriod)return this.getStatByPeriod.length?this.getStatByPeriod.map((function(e){var i=e.equityClose-e.equityOpen,o=100*(e.equityClose-e.equityOpen)/e.equityOpen;return{date:"".concat(new Date(e.date).getDate()>9?new Date(e.date).getDate():"0".concat(new Date(e.date).getDate()),".").concat(new Date(e.date).getMonth()+1>9?new Date(e.date).getMonth()+1:"0".concat(new Date(e.date).getMonth()+1)),equity:t.$moneyf(e.equityClose,2),profitDay:"$ ".concat(t.$moneyf(i,2),"/ %").concat(t.$moneyf(o,2)),color:i<0?t.getRedColor.color:t.getGreenColor.color,profitMonth:100*(e.equityClose-t.getStatByPeriod[0].equityOpen)/t.getStatByPeriod[0].equityOpen}})):void 0},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")}]}},getMetaInfoForLines:function(){if(this.points){var t=this.getStatByPeriod[0].equityOpen,e=this.getStatByPeriod.at(-1).equityClose-t,i=t&&e?100*e/t:0;return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"line",color:e<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("equity"),extandsIndicator:"rel"===this.type?"$ ".concat(this.$moneyf(this.getStatByPeriod.at(-1).equityClose,0)):"".concat(this.$moneyf(i,2)," %")}]}},getColumnsForTable:function(){return[{title:this.$t("date"),field:"date",sortingEnabled:!1,cellTemplate:"date",width:"60px",align:"center"},{title:"$, ".concat(this.$t("equity")),field:"equity",sortingEnabled:!1,cellTemplate:"column",align:"center"},{title:this.$t("day"),field:"profitDay",sortingEnabled:!1,cellTemplate:"column",width:"170px",align:"center"}]},getLineTabs:function(){if(this.getMonthTabs){var t=Math.floor((this.widthWrap-102)/78);return t=this.getMonthTabs.length||t<0))return this.getMonthTabs.slice(0,this.getMonthTabs.length-t)}},getMonthTabs:function(){var t=this;if(this.getYearsStat&&null!==this.activeYear&&this.getTabsForYear)return this.getYearsStat[this.activeYear]?this.getYearsStat[this.activeYear].map((function(e){return{title:t.$t("mounthArr")[e.month],month:e.month,profitAbs:e.profitAbs,profitRel:e.profitRel,color:e.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}})):[{title:this.$t("mounthArr")[new Date(this.getServerTime.now).getMonth()],month:new Date(this.getServerTime.now).getMonth(),profitAbs:13e3,profitRel:13e3,color:this.getRedColor.color}]},getStatForTitleChart:function(){if(this.getStatByPeriod)return[{label:this.$t("balance"),data:this.$moneyf(this.getStatByPeriod.at(-1).balanceClose,2),color:"blue"},{label:this.$t("equity"),data:this.$moneyf(this.getStatByPeriod.at(-1).equityClose,2),color:"green"}]}}),methods:{closeReport:function(){this.statusDayReport=!1},setTypeGistogramm:function(t){this.type=t,this.setPointsForChart(this.getStatByPeriod)},hedlerClickChartPoint:function(t){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),i=this.getStatistics.accountDaily.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}));this.statDay={index:i,statDay:e},this.statusDayReport=!0},hoverPoint:function(t){if(t){var e=this.$refs.chart.clientWidth-t.cPointX,i=this.$refs.chart.clientHeight-t.cPointY;this.positionHoverWidget={top:"".concat(i>54?Math.round(t.cPointY-5):Math.round(t.cPointY-59),"px"),left:"".concat(e>140?t.cPointX+8:t.cPointX-148,"px")};var o=this.getStatByPeriod.find((function(e){return e.date===t.point.date})),n=this.getStatByPeriod[0].equityOpen,s=o.equityClose-n,r=n&&s?100*s/n:0,a=o.equityClose-o.equityOpen,c=a&&o.equityOpen?100*a/o.equityOpen:0;o&&(this.statsForHoverWidget=[{label:this.$t("balance"),stat:"$ ".concat(this.$moneyf(o.balanceClose)),color:"blue"},{label:this.$t("equity"),stat:"$ ".concat(this.$moneyf(o.equityClose)),color:"green"},{label:"P/L ".concat(this.$t("day"),", %"),stat:"% ".concat(this.$moneyf(c,c<.01?3:2)),color:a<0?"red":"green"},{label:"P/L ".concat(this.$t("month"),", %"),stat:"% ".concat(this.$moneyf(r,r<.01?3:2)),color:r<0?"red":"green"},{label:this.$t("date"),stat:new Date(o.date).toLocaleDateString("ru"),color:r<0?"red":"green"}]),this.hoverIndex=this.getStatByPeriod.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}))}else this.hoverIndex=null},setHoverIndex:function(t,e){"year"===e?this.hoverIndexYear=t:this.hoverIndexMonth=t},setActiveMonth:function(t){this.activeTabMonth=t},setActiveYear:function(t){this.activeYear=t,this.activeTabMonth=this.getYearsStat[t].at(-1).month},setPointsForChart:function(t){for(var e=this,i=new Date(t[0].date).daysInMonth(),o=t[0].equityOpen,n=this.activeTabMonth,s=this.activeYear,r=[],a=0;a5&&s<10?this.getOrangeColor.color:this.getRedColor.color}]}]}}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},onResize:function(t){this.size=t[0].contentRect.width}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},t3=Z2,e3=(i("8cb3"),Object(C["a"])(t3,J2,K2,!1,null,"1a9e0a47",null)),i3=e3.exports,o3=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",staticClass:"AnaliticsSectorDiagram"},[e("div",{staticClass:"AnaliticsSectorDiagram-chart"},[t.getSizeDiagram?e("SectorDiagram",{key:"".concat(t.getSizeDiagram.height,"_").concat(t.getActiveTheme,"_").concat(t.getSizeDiagram.width),attrs:{percents:t.getSectorDiagramObject,width:t.getSizeDiagram.height,height:t.getSizeDiagram.height,widthBorder:t.getSizeDiagram.height/3,fontSize:Math.round(7*t.getSizeDiagram.height/100)}}):t._e()],1)])},n3=[],s3={components:{SectorDiagram:MB},mixins:[yn,qe],props:{colors:{type:Array},commonVolume:{default:0}},data:function(){return{size:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getInvestingPortfolios:function(){if(this.getCreatedPortfolios)return this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}))},getFullEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getSizeDiagram:function(){if(this.size){var t=this.size.width-100,e=this.size.height>t?t:this.size.height,i=this.size.height>t?t:this.size.height;return{width:Math.round(e),height:Math.round(i)}}},getMargin:function(){var t;return null!==(t=this.getStatistics)&&void 0!==t&&t.accountDaily.length?this.getStatistics.accountDaily.at(-1).margin:this.getStatistics.margin},getSectorDiagramObject:function(){var t,e=[];if(null!==(t=this.colors)&&void 0!==t&&t.length)return this.colors.forEach((function(t){e.push({symbol:t.symbol,color:t.color,data:t.data})})),e}}),methods:{onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},r3=s3,a3=(i("bb24"),Object(C["a"])(r3,o3,n3,!1,null,"0d3708a7",null)),c3=a3.exports,l3=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",staticClass:"AnaliticsProgressBar"},[e("div",{class:"AnaliticsProgressBar-investing AnaliticsProgressBar-investing_".concat(t.getActiveTheme),style:{width:"".concat(t.getWidthMargin.rel,"%"),background:t.getBlueColor.color},attrs:{title:"Занято ".concat(t.$moneyf(t.getWidthMargin.rel,t.getWidthMargin.rel<.01?5:2),"% (").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthMargin.abs,t.getWidthMargin.abs>1e4?0:2),")")}},[e("div",[t._v(t._s(t.getTitleInvesting))])]),e("div",{class:"AnaliticsProgressBar-free AnaliticsProgressBar-free_".concat(t.getActiveTheme),style:{background:t.getWidthFeeEquity.rel>=70?t.getGreenColor.color:t.getWidthFeeEquity.rel<70&&t.getWidthFeeEquity.rel>=30?t.getOrangeColor.color:t.getRedColor.color},attrs:{title:"Свободно для торговли ".concat(t.$moneyf(t.getWidthFeeEquity.rel,t.getWidthFeeEquity.rel<.01?5:2),"% (").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthFeeEquity.abs,t.getWidthFeeEquity.abs>1e4?0:2),")")}},[e("div",[t._v(t._s(t.getTitleFreeEquity))])])])},u3=[],d3={mixins:[qe,yn],data:function(){return{wrapSize:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme",getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getMargin:function(){return this.getDataForWidgets.marging},getFullEquityClose:function(){return this.getStatistics,this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getWidthFeeEquity:function(){if(this.getStatistics){var t=100-this.getWidthMargin.rel,e=this.getFullEquityClose-this.getWidthMargin.abs;return{rel:t,abs:e}}},getWidthMargin:function(){if(this.getStatistics){var t=this.getMargin?100*this.getMargin/this.getFullEquityClose:0;return{rel:t,abs:this.getMargin}}},getPixelWidthMargin:function(){return this.wrapSize&&this.getWidthMargin?Math.round(this.wrapSize*(this.getWidthMargin.rel/100)):0},getPixelWidthFreeEquity:function(){return this.wrapSize&&this.getWidthFeeEquity?Math.round(this.wrapSize*(this.getWidthFeeEquity.rel/100)):0},getTitleFreeEquity:function(){if(this.getPixelWidthFreeEquity)return this.getPixelWidthFreeEquity>=405?"Свободно для торговли ".concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthFeeEquity.abs,2),")"):this.getPixelWidthFreeEquity<450&&this.getPixelWidthFreeEquity>220?"".concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthFeeEquity.abs,2),")"):"".concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% ")},getTitleInvesting:function(){if(this.getWidthMargin)return this.getPixelWidthInvestingEquity>300?"Занято ".concat(this.$moneyf(this.getWidthMargin.rel,this.getWidthMargin.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthMargin.abs,2),")"):this.getPixelWidthInvestingEquity<300&&this.getPixelWidthInvestingEquity>220?"".concat(this.$moneyf(this.getWidthMargin.rel,this.getWidthMargin.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthMargin.abs,2),")"):"".concat(this.$moneyf(this.getWidthMargin.rel,this.getWidthMargin.rel<.01?5:2),"%")}}),methods:{onResize:function(t){this.wrapSize=t[0].contentRect.width}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},h3=d3,p3=(i("bf81"),Object(C["a"])(h3,l3,u3,!1,null,"0caa8e80",null)),g3=p3.exports,f3=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnaliticsTables"},[t.getDataTable&&t.getDataTable.length?e("div",{class:"AnaliticsTable AnaliticsTable_".concat(t.getActiveTheme)},[e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v("Контракты")]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("open_trades")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("closed_trades")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("success_rate")))])]),t._l(t.getDataTable,(function(i,o){return e("div",{key:o,class:"AnaliticsTable-dataRow AnaliticsTable-dataRow_".concat(t.getActiveTheme),style:{color:i.color}},[e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s(i.name))]),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:i.currentProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.currentProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.investing,2)," / ").concat(i.investingPercent,"%")))]),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:i.closeProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.closeProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("%".concat(Math.round(i.percentProfitCloseOrders))))])])})),e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v("Итог")]),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountProfitsForOpenOrders<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountProfitsForOpenOrders,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"}),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountClosedProfits<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountClosedProfits,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"})])],2):t._e()])},m3=[],v3={components:{Avatar:E},props:{colors:{type:Array}},data:function(){return{userOrders:null,openOrders:null}},mixins:[qe],watch:{getStatByOrders:function(t){t&&(this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.openOrders=this.userOrders.tradingOrders)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getFullEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getAbsoluteRelProfit:function(){return this.getAbsolutProfit&&this.getFullEquityClose?100*this.getAbsolutProfit/this.getFullEquityClose:0},getAbsolutProfit:function(){return this.getCountProfitsForProvider+this.getCountProfitsForPortfolio},getCountProfitsForOpenOrders:function(){if(this.openOrders&&this.openOrders.length)return this.openOrders.reduce((function(t,e){return t+e.profit}),0)},getCountClosedProfits:function(){if(this.userOrders&&this.userOrders.closedOrders.length)return this.userOrders.closedOrders.reduce((function(t,e){return t+e.profit}),0)},getDataTable:function(){var t=this;if(this.colors&&this.openOrders&&this.userOrders){var e=[];return this.colors.forEach((function(i){var o=t.openOrders.length?t.openOrders.filter((function(t){return t.contractName===i.symbol})):[],n=o.length?o.reduce((function(t,e){return t+e.profit}),0):0,s=t.userOrders.closedOrders.length?t.userOrders.closedOrders.filter((function(t){return t.contractName===i.symbol})):[],r=s.length?s.reduce((function(t,e){return t+e.profit}),0):0,a=s.length?s.filter((function(t){return t.profit>0})):[],c=s.length&&a.length?100*a.length/s.length:0;e.push({color:i.color,id:i.symbol,investing:i.dataAbs,investingPercent:i.data,name:i.symbol,currentProfit:n,closeProfit:r,percentProfitCloseOrders:c})})),e}}}),methods:{setMessageHendler:function(t){t&&t.command&&"AccountsDetails"===t.command&&(this.openOrders=t.data[0].openOrders.tradingOrders)},getStatDataForTable:function(t,e){var i=this,o=[];return t.forEach((function(t){var n=i.getSubscriptionsBySource(t),s=i.openOrders.filter((function(t){return n.some((function(e){return e===+t.subscriptionId}))})),r=s.length?s.reduce((function(t,e){return t+e.profit}),0):0,a=i.userOrders.closedOrders.filter((function(t){return n.some((function(e){return e===+t.subscriptionId}))})),c=a.length?a.reduce((function(t,e){return t+e.profit}),0):0,l=a.length?a.filter((function(t){return t.profit>0})):[],u=a.length&&l.length?100*l.length/a.length:0;o.push({avatar:"portfolio"===e?t.avatar:t.sources[0].userInfo.avatarURL,id:t.id,investing:t.investMoney,investingPercent:i.$moneyf(100*t.investMoney/i.getFullEquityClose,2),name:t.name,currentProfit:r+c,closeProfit:c,percentProfitCloseOrders:u})})),o}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.$orderStorage.getOrdersOnStorage()&&(this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.openOrders=this.userOrders.tradingOrders)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},y3=v3,C3=(i("3efc5"),Object(C["a"])(y3,f3,m3,!1,null,"07e42ba8",null)),b3=C3.exports,S3={props:{reports:{type:Boolean}},components:{AnaliticsAccount:i3,AnaliticsProgressBar:g3,AnaliticsSectorDiagram:c3,AnaliticsTable:b3},mixins:[yn,qe],data:function(){return{contractStatistic:null,size:{width:0,height:0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getCommonVolume:function(){if(this.contractStatistic){var t=this.contractStatistic.reduce((function(t,e){return t+e[1]}),0),e=this.contractStatistic.reduce((function(t,e){return t+e[10]}),0);return this.getCryptoStatus?e:t}},getColors:function(){var t=this;if(this.contractStatistic&&this.getDefaultAccount){var e=[];return this.contractStatistic.forEach((function(i,o){var n=t.getCryptoStatus?i[10]:i[1],s=i[7];e.push({symbol:i[6],color:t.getSetRandomColors[o]?t.getSetRandomColors[o].color:P3(),data:Number((100*n/t.getCommonVolume).toFixed(2)),dataAbs:n,profitRel:Number(s).toFixed(2),profitRelColor:s>=70?t.getGreenColor.color:s<70&&s>=50?t.getOrangeColor.color:t.getRedColor.color})})),e}},getWrapWidth:function(){return this.size.width}}),methods:{onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap})),sessionStorage.getItem("contractStatisitics")&&(this.contractStatistic=JSON.parse(sessionStorage.getItem("contractStatisitics")))}};function P3(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var T3=S3,x3=(i("208e"),Object(C["a"])(T3,X2,Q2,!1,null,"54fe9803",null)),O3=x3.exports,w3=function(){var t=this,e=t._self._c;return e("div",{staticClass:"userProfilePeriodChart"},[e("div",{staticClass:"userProfilePeriodChart-wrapper",class:"userProfilePeriodChart-wrapper_".concat(t.getActiveTheme)},[e("div",{ref:"titleWrap",staticClass:"userProfilePeriodChart-titleWrap",style:{width:"".concat(t.widthForTitle,"px")}},[e("div",{staticClass:"userProfilePeriodChart-titlePeriods"},t._l(t.tabPeriods,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{icon:{name:i.icon},modifier:{class:["userProfilePeriodChart-periodTab",t.period===i.period?"userProfilePeriodChart-periodTab_isActive_".concat(t.getActiveTheme):"userProfilePeriodChart-periodTab_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setPeriod(i.period)}}})})),1),e("div",{staticClass:"userProfilePeriodChart-title"},[t.getTitle?e("div",{staticClass:"userProfilePeriodChart-infoTitle",attrs:{title:"".concat(t.getTitle[0]," ").concat(t.getTitle[1]," ").concat(t.$moneyf(t.getTitle[2])," ").concat(t.$moneyf(t.getTitle[3]))}}):t._e(),e("div",{staticClass:"userProfilePeriodChart-titleText",class:"userProfilePeriodChart-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitle[0])),e("div",{class:"userProfilePeriodChart-titleDate userProfilePeriodChart-titleDate_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitle[1]))]),e("div",{staticClass:"userProfilePeriodChart-titleText"},[t._v(t._s(t.getTitle[2])+" ")]),t.getCurrentProfit?e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getCurrentProfit[1].data[0]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getCurrentProfit[1].data[0]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCurrentProfit[1].data[0],2)))+" ")])]):t._e(),t.getCurrentProfit?e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getCurrentProfit[1].data[0]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getCurrentProfit[1].data[1]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v("% "+t._s(t.$pricef(t.getCurrentProfit[1].data[1],2)))])]):t._e()]),e("div",{staticClass:"userProfilePeriodChart-dateControl"},[t.getLastDates&&t.widthForTitle>610?e("div",{staticClass:"userProfilePeriodChart-lastDates"},t._l(t.getLastDates,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-lastDatesItem userProfilePeriodChart-lastDatesItem_".concat(t.getActiveTheme," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive"," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(t.checkActiveDate(i.date)?"isAcitve":"noActive"),on:{click:function(e){return t.setActiveDate(i.date)},mouseenter:function(e){return t.setHoverIndex(o)},mouseleave:function(e){return t.setHoverIndex(null)}}},[t._v(t._s(i.title)),t.hoverIndex===o?e("div",{class:"userProfilePeriodChart-hoverWidgetlastDates userProfilePeriodChart-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive")},[e("div",[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profitAbs,2))))]),e("div",[t._v("% "+t._s(t.$moneyf(i.profitRel,2)))])]):t._e()])})),0):t._e(),e("div",{staticClass:"userProfilePeriodChart-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1)])]),t.dateCheckerStatus?e("DataChartChecker",{attrs:{positionPopup:{my:"top right",at:"bottom right",of:t.containerForDataChecker,offset:{x:0,y:5}},statistic:t.getStatisticsByDateChecker,period:t.period,activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()],1),e("div",{staticClass:"userProfilePeriodChart-chart"},[e("div",{ref:"chartWrap",class:"userProfilePeriodChart-statData userProfilePeriodChart-statData_".concat(t.getActiveTheme)},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit?e("div",{key:o,class:"userProfilePeriodChart-currentProfit userProfilePeriodChart-currentProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfilePeriodChart-currentProfit-arrow"},[e("div",{style:{color:"down"===t.directions?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directions,"_direct")}})],1)]),e("div",{staticClass:"userProfilePeriodChart-currentProfit-data",class:"userProfilePeriodChart-currentProfit-data_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s(void 0!==i.data[1]?"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data[0],2)," / ").concat(t.$moneyf(i.data[1],Math.abs(i.data[1])<.01?5:2)," %"):"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data[0],2))))]),e("div",{staticClass:"userProfilePeriodChart-currentProfit-title",class:"userProfilePeriodChart-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfilePeriodChart-currentProfit-text",class:"userProfilePeriodChart-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])]):t._e()})),0),e("div",{ref:"chartWrap",staticClass:"userProfilePeriodChart-chartWrapper"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.points?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.points?e("SectorLineEventChart",{key:t.period,attrs:{typeXAxis:t.period,points:t.points,theme:t.getActiveTheme,interval:t.intervalGrid,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},watermark:t.getWaterMark,watermarkData:t.getWaterMarkData},on:{hover:t.hoverPoint}}):t._e()],1),t.showHoverWidget?e("div",{class:"userProfilePeriodChart-hoverWidget userProfilePeriodChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-hoverWidgetRow userProfilePeriodChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"userProfilePeriodChart-hoverWidgetStat userProfilePeriodChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1)]),e("div",{staticClass:"userProfilePeriodChart-gistogramm"},[e("div",{staticClass:"userProfilePeriodChart-gistogrammWrap-title"},[t._v(t._s("".concat(t.$t("income"),", ").concat(t.getCurrencyChar)))]),e("div",{staticClass:"userProfilePeriodChart-gistogrammWrap"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}})],1),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)])])])},_3=[],A3=function(){var t=this,e=t._self._c;return e("div",{class:"dataChartChecker dataChartChecker_".concat(t.getActiveTheme)},[e("DxPopup",{attrs:{visible:!0,shading:!1,container:"dataChartChecker",position:t.positionPopup,closeOnOutsideClick:t.clickOutSide,width:"160px",height:"auto",maxHeight:"250px"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"dataChartChecker-title dataChartChecker-title_".concat(t.getActiveTheme)},[t.getYearsArr.length>1&&"year"!==t.period?e("DxSelectBox",{attrs:{hoverStateEnabled:!1,dropDownOptions:{container:"dataChartChecker"},width:"80px",items:t.getYearsArr,value:t.getActiveYear},on:{valueChanged:function(e){return t.setActiveDate(e.value,!0)}}}):e("div",{staticClass:"dataChartChecker-yearTitle"},[t._v(t._s("year"!==t.period?t.getYearsArr[0]:t.getActiveYear)+"г.")])],1)]},proxy:!0},{key:"content",fn:function(){return[e("div",{key:t.getActiveYear,class:"dataChartChecker-content dataChartChecker-content_".concat(t.getActiveTheme)},[e("DxScrollView",{attrs:{scrollByContent:!0,showScrollbar:"onHover"}},t._l(t.getListDates,(function(i,o){return e("div",{key:o,class:"dataChartChecker-rowContent dataChartChecker-rowContent_".concat(t.getActiveTheme," dataChartChecker-rowContent_").concat(t.getActiveTheme,"-").concat(t.chekActiveListItem(i.date)?"isActive":"noActive"," dataChartChecker-rowContent_").concat(t.getActiveTheme,"-").concat(t.multichoiceDate?"no-hover":"hover"),on:{click:function(e){t.setActiveDate(t.multiсhoiceStatus?{date:i.date,status:t.chekActiveListItem(i.date)}:i.date)}}},[e("div",{class:"dataChartChecker-colContent dataChartChecker-colContent_".concat(t.getActiveTheme," dataChartChecker-colContent_").concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive")},[t._v(t._s(i.title))]),e("div",{class:"dataChartChecker-colContent dataChartChecker-colContent_".concat(t.getActiveTheme," dataChartChecker-colContent_").concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive"),attrs:{title:t.$moneyf(i.profit,Math.abs(i.profit)>=1e3?0:Math.abs(i.profit)<.01?5:2)}},[t._v("% "+t._s(t.$moneyf(i.profit,Math.abs(i.profit)>=1e3?0:Math.abs(i.profit)<.01?5:2)))])])})),0)],1)]},proxy:!0}])})],1)},D3=[],k3={props:{positionPopup:{type:Object},statistic:{type:Array},activeDate:{type:[String,Number,Array,Date]},multichoiceDate:{type:Array},"multiсhoiceStatus":{type:Boolean,default:!1},period:{type:String,default:"week"}},components:{DxPopup:To["DxPopup"],DxSelectBox:Io["DxSelectBox"],DxScrollView:NY["DxScrollView"]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getActiveYear:function(){return new Date(this.activeDate).getFullYear()},getYearsArr:function(){return this.statistic?Object(x["a"])(new Set(this.statistic.map((function(t){return new Date(t.date).getFullYear()})))):[]},getListDates:function(){return"day"===this.period?this.getListDays:"week"===this.period?this.getListWeeks:"month"===this.period?this.getListMonth:"year"===this.period?this.getListYears:void 0},getListMonth:function(){var t=this;if(this.statistic){var e=this.statistic.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()})),i=[];return e.forEach((function(t){i.push({title:"".concat(new Date(t.date).getMonth()+1<10?"0".concat(new Date(t.date).getMonth()+1):new Date(t.date).getMonth()+1,".").concat(new Date(t.date).getFullYear(),"."),date:t.date,profit:t.profitRel})})),i}},getListWeeks:function(){var t=this;if(this.statistic){var e=this.statistic.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()})),i=[];return e.forEach((function(t){i.push({title:new Date(t.date).getWeek(),date:t.date,profit:t.profitRel})})),1===i[i.length-1].title&&i.splice(-1,1),i}},getListDays:function(){if(this.statistic){var t=[];return this.statistic.forEach((function(e){t.push({title:"".concat(new Date(e.date).getDate(),".").concat(new Date(e.date).getMonth()+1<10?"0".concat(new Date(e.date).getMonth()+1):new Date(e.date).getMonth()+1),date:e.date,profit:void 0!==e.profitRel&&null!==e.profitRel?e.profitRel:100*(e.data.at(-1).equityClose-e.data[0].equityOpen)/e.data[0].equityOpen})})),t}},getListYears:function(){if(this.statistic){var t=[];return this.statistic.forEach((function(e){t.push({title:e.year,date:e.date,profit:e.profitRel})})),t}}}),methods:{clickOutSide:function(t){t.target.closest(".dataChartChecker")||this.$emit("clickOutSide")},chekActiveListItem:function(t){var e=this;return this.multiсhoiceStatus?this.multichoiceDate.some((function(i){return e.checkConditionForPeriod(e.period,t,i)})):this.checkConditionForPeriod(this.period,t,this.activeDate)},checkConditionForPeriod:function(t,e,i){var o={day:new Date(e).getDate()===new Date(i).getDate(),week:new Date(e).getWeek()===new Date(i).getWeek(),month:new Date(e).getMonth()===new Date(i).getMonth(),year:new Date(e).getFullYear()===new Date(i).getFullYear()};return o[t]},setActiveDate:function(t,e){if(e){var i=this.statistic.filter((function(e){return new Date(e.date).getFullYear()===t}));this.$emit("setActiveDate",i[0].date)}else this.multiсhoiceStatus?this.$emit("addDate",t):this.$emit("setActiveDate",t)}}},I3=k3,B3=(i("87ef"),Object(C["a"])(I3,A3,D3,!1,null,null,null)),M3=B3.exports,$3={computed:{getStatByDate:function(){var t={month:this.getStatByMonthes,week:this.getStatByWeek,day:this.getStatByDay,year:this.getStatByYear};return t[this.period]},getStatByMonthes:function(){var t=this;if(this.activeDate&&this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getMonth()===new Date(t.activeDate).getMonth()})):[{date:this.getServerTime.now,equityClose:this.getEquityClose,equityOpen:this.getStatistics.transfers[0].amount}]},getStatByWeek:function(){var t,e=this;if(this.activeDate&&this.getStatByWeeks)return this.getStatByWeeks.length?null===(t=this.getStatByWeeks.find((function(t){return new Date(t.date).getFullYear()===new Date(e.activeDate).getFullYear()&&new Date(t.date).getWeek()===new Date(e.activeDate).getWeek()})))||void 0===t?void 0:t.data:[{date:this.getServerTime.now,equityClose:this.getEquityClose,equityOpen:this.getStatistics.transfers[0].amount}]},getStatByYear:function(){var t=this;if(this.activeDate&&this.getStatByYears)return this.getStatByMonth.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()}))},getLastDates:function(){if(this.getStatByDate){var t={month:this.getStatByMonth.length?this.getStatByMonth:[{date:this.getServerTime.now,data:this.getStatByDate}],day:this.getStatisticsByDay.statistic.length?this.getStatisticsByDay.statistic:[{date:this.getServerTime.now,data:this.getStatByDate}],week:this.getStatByWeeks.length?this.getStatByWeeks:[{date:this.getServerTime.now,data:this.getStatByDate}],year:this.getStatByYears},e=t[this.period].length<=5?t[this.period]:t[this.period].slice(-5);return this.setStatForLastDates(e)}},getStatisticsByDateChecker:function(){var t={month:this.getStatByMonth.length?this.getStatByMonth:[{date:this.getServerTime.now,data:this.getStatByDate,profitAbs:this.getStatByDate.at(-1).equityOpen-this.getStatByDate.at(-1).equityClose,profitRel:this.getStatByDate.at(-1).equityOpen-this.getStatByDate.at(-1).equityClose?100*(this.getStatByDate.at(-1).equityClose-this.getStatByDate.at(-1).equityOpen)/this.getStatByDate.at(-1).equityOpen:0}],week:this.getStatByWeeks.length?this.getStatByWeeks:[{date:this.getServerTime.now,data:this.getStatByDate,profitAbs:this.getStatByDate.at(-1).equityOpen-this.getStatByDate.at(-1).equityClose,profitRel:this.getStatByDate.at(-1).equityOpen-this.getStatByDate.at(-1).equityClose?100*(this.getStatByDate.at(-1).equityClose-this.getStatByDate.at(-1).equityOpen)/this.getStatByDate.at(-1).equityOpen:0}],day:this.getStatisticsByDay.statistic.length?this.getStatisticsByDay.statistic:[{date:this.getServerTime.now,data:this.getStatByDate}],year:this.getStatByYears};return t[this.period]},getOpenEquity:function(){if(this.getStatByDate)return this.getStatByDate[0].equityOpen},getEquityCloseByPeriod:function(){if(this.getStatByDate)return this.getStatByDate.at(-1).equityClose},getEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily[this.getStatistics.accountDaily.length-1].equityClose:this.getStatistics.account.equity}}},L3={components:{SectorLineEventChart:Fj,GistogrammEventChart:TI,TitlesForGistogram:DI,DataChartChecker:M3,Sceleton:nT},mixins:[$3,qe],data:function(){return{activeDate:new Date,tabPeriods:[{period:"day",icon:"TimePeriod_2D"},{period:"week",icon:"TimePeriod_2W"},{period:"month",icon:"TimePeriod_2M"}],directions:"up",period:"day",points:null,statusLoadChart:!0,hoverIndex:null,lcoords:null,showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},statsForHoverWidget:null,containerForDataChecker:null,dateCheckerStatus:!1,intervalGrid:null,widthForTitle:0,pointsForGistogramm:null}},watch:{getStatByDate:function(t){t&&this.setPointForChart()},period:function(){this.setPointForChart()},getActiveTheme:function(){this.setPointForChart()},getEquityClose:function(t,e){t&&this.setPointForChart(),t&&e&&(this.directions=e0){var i=100*(this.points[1][e].y-this.getOpenEquity)/this.getOpenEquity;this.statsForHoverWidget=[{stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.points[1][e].y,2)),color:i>=0?"green":"red"},{stat:"% ".concat(this.$moneyf(i,2)),color:i>=0?"green":"red"}]}this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setPointForChart:function(){var t=this;if(this.getStatByDate){var e;this.points=[[]],this.pointsForGistogramm=[[],[]],"week"===this.period?e=7:"month"===this.period?e=new Date(this.activeDate).daysInMonth():"day"===this.period&&(e=24),this.$refs.chartWrap&&(this.widthForTitle=this.$refs.chartWrap.clientWidth,this.intervalGrid=this.$refs.chartWrap.clientWidth/e);for(var i=0,o=function(e){var o;if("day"===t.period?o=t.getStatByDate.find((function(t){return new Date(t.date).getHours()===e})):"week"===t.period?o=t.getStatByDate.find((function(t){return new Date(t.date).getDay()?new Date(t.date).getDay()-1===e:6})):"month"===t.period&&(o=t.getStatByDate.find((function(t){return new Date(t.date).getDate()===e+1}))),o){var n=o.equityClose-t.getOpenEquity;i+=n,t.points[0].push({x:e,y:o.equityClose,date:o.date}),t.pointsForGistogramm[0].push({x:e,y:n,date:o.date}),t.pointsForGistogramm[1].push({x:e,y:i/(e+1),date:o.date})}else t.points[0].push({x:e}),t.pointsForGistogramm[0].push({x:e}),t.pointsForGistogramm[1].push({x:e})},n=0;n5?this.fileSizeError=!0:this.filePdf=e)},triggerInputFile:function(){this.$refs.inputPdf.click()},finishEditable:function(){var t=this.isAboutMe?"editAboutMe":"editStrategy";this.$emit("finishEditable",t)},deleteFile:function(){this.filePdf=null},saveAboutMe:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isLoading=!0,!t.filePdf||Array.isArray(t.filePdf)){e.next=8;break}return o=new File([t.filePdf],"file_strategy.pdf",{type:t.filePdf.type}),n=new FormData,n.append("file",o),e.next=7,t.$http.post("".concat(t.getApiUri,"Image/item"),n,{headers:{"Content-Type":"multipart/form-data","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":t.getSession.signFP}});case 7:i="".concat(t.getApiUri,"Image/item/").concat(t.getUser.id,"/file_strategy.pdf");case 8:return s={field:t.field,data:{title:t.titleModel,text:t.htmlEditorModel}},t.isAboutMe&&(s.data.socialLinks=t.socialLinksForSave),t.isStrategy&&(s.data.linkFile=i||(null===(a=t.filePdf)||void 0===a?void 0:a[1])||null,s.data.nameFile=(null===(c=t.filePdf)||void 0===c?void 0:c.name)||(null===(l=t.filePdf)||void 0===l?void 0:l[0])||null),e.next=13,t.setCustomData(s);case 13:t.finishEditable(),t.isLoading=!1;case 15:case"end":return e.stop()}}),e)})))()},myClick:function(){var t=this.$refs["htmlEditorRefKey"].instance,e=t.getSelection(),i=e.index,o=e.length,n=t.getText(i,o);0!==n.trim().length&&(this.text=n,this.index=i,this.length=o,this.openModal=!0)},addLink:function(){var t=this.$refs["htmlEditorRefKey"].instance;t.delete(this.index,this.length),t.insertEmbed(this.index,"link",{href:this.titleLink,text:this.text,target:this.blank}),t.setSelection(this.index+this.length,0),this.openModal=!1},hiddenModal:function(){this.openModal=!1,this.blank=!0,this.length=null,this.index=null,this.titleLink=""},clickClose:function(){this.openModal=!1},addNewField:function(){if(this.linksArr[this.linksArr.length-1].field.trim()){var t=Date.now();this.$set(this.linksArr,this.linksArr.length,{id:t,field:""})}},removeField:function(t){var e=this.linksArr.findIndex((function(e){return e.id===t}));this.$delete(this.linksArr,e)}})},x5=T5,O5=(i("2ce7"),i("75d6"),Object(C["a"])(x5,g5,f5,!1,null,"7bec20bd",null)),w5=O5.exports,_5={name:"AboutMeSection",mixins:[UV,xt],props:{editAboutMe:{type:Boolean},ttUser:{type:Object,default:function(){return{}}},isLoadingCustomData:{type:Boolean}},components:{InformationAboutYourself:w5,CompletedInformation:P5,Preloader:ah},data:function(){return{htmlEditor:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({customData:"user/customData"})),{},{aboutMeDataUser:function(){var t,e,i,o=null===(t=this.ttUser)||void 0===t?void 0:t.customData;return!(!o||null===(e=JSON.parse(o))||void 0===e||!e.aboutMe)&&(null===(i=JSON.parse(o))||void 0===i?void 0:i.aboutMe)},colorIcon:function(){return this.darkClass.dark?"#BBCEE0":"#CCCCCC"}})},A5=_5,D5=(i("6423"),Object(C["a"])(A5,h5,p5,!1,null,"20e390b0",null)),k5=D5.exports,I5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatisticSection"},[e("h3",{style:{textAlign:"center",fontSize:"20px",fontWeight:"bold",position:"relative",top:"32px"}},[t._v(t._s(t.$t("section_in_development")))]),e("img",{style:{height:"230px",display:"block",margin:"0 auto"},attrs:{src:"https://gradmedia.ru/assets/images/galery/strategy-03.gif",alt:""}})])},B5=[],M5={name:"StatisticSection"},$5=M5,L5=(i("6610"),Object(C["a"])($5,I5,B5,!1,null,"9f77ae0a",null)),F5=L5.exports,j5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StrategySection",class:t.darkClass},[t.myProfile?e("InformationAboutYourself",{attrs:{field:"strategy",editFlag:t.editStrategy},on:{finishEditable:function(e){return t.$emit("finishEditable",e)}}}):!t.myProfile&&t.strategyDataUser?e("CompletedInformation",{attrs:{data:t.strategyDataUser,isStrategy:""}}):e("div",{staticClass:"noData"},[e("svgIcon",{attrs:{name:"Big-Sovet",viewBox:"0 0 100 101",size:100,color:t.colorIcon}}),e("div",{staticClass:"textEmptyData"},[t._v("Пользователь не заполнил информацию о стратегии.")])],1)],1)},R5=[],W5={name:"StrategySection",mixins:[UV,xt],props:{editStrategy:{type:Boolean},ttUser:{type:Object,default:function(){return{}}}},components:{InformationAboutYourself:w5,CompletedInformation:P5},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({customData:"user/customData"})),{},{strategyDataUser:function(){var t,e,i,o=null===(t=this.ttUser)||void 0===t?void 0:t.customData;return!(!o||null===(e=JSON.parse(o))||void 0===e||!e.strategy)&&(null===(i=JSON.parse(o))||void 0===i?void 0:i.strategy)},colorIcon:function(){return this.darkClass.dark?"#BBCEE0":"#CCCCCC"}})},N5=W5,E5=(i("bdef"),Object(C["a"])(N5,j5,R5,!1,null,"0c5ffbe4",null)),U5=E5.exports,V5={name:"MyInfo",mixins:[xt,UV],props:{ttUser:{type:Object},isLoadingCustomData:{type:Boolean}},components:{DxTabPanel:i0.a,AboutMeSection:k5,StatisticSection:F5,StrategySection:U5},data:function(){return{selectedID:1,editAboutMe:!1,editStrategy:!1,source:[{ID:1,title:"Обо мне",componentName:"AboutMeSection"},{ID:2,title:"Статистика",componentName:"StatisticSection"},{ID:3,title:"Стратегия",componentName:"StrategySection"}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({customData:"user/customData"})),{},{aboutMeData:function(){var t;return null===(t=this.customData)||void 0===t?void 0:t.aboutMe},strategyData:function(){var t;return null===(t=this.customData)||void 0===t?void 0:t.strategy},heightScroll:function(){if(this.$refs.myInfo)return this.$refs.myInfo.getBoundingClientRect().height-32-16},isVisibleAboutMeEdit:function(){return 1===this.selectedID&&this.aboutMeData&&this.myProfile&&!this.editAboutMe},isVisibleStrategyEdit:function(){return 3===this.selectedID&&this.strategyData&&this.myProfile&&!this.editStrategy},isVisibleButtonEdit:function(){return!(!this.isVisibleAboutMeEdit&&!this.isVisibleStrategyEdit)},props:function(){return{AboutMeSection:{editAboutMe:this.editAboutMe,ttUser:this.ttUser,isLoadingCustomData:this.isLoadingCustomData},StrategySection:{editStrategy:this.editStrategy,ttUser:this.ttUser}}}}),methods:{onSelectionChanged:function(t){this.selectedID=t.addedItems[0].ID},finishEditable:function(t){this[t]=!1},editData:function(){1===this.selectedID&&(this.editAboutMe=!0),3===this.selectedID&&(this.editStrategy=!0)}}},H5=V5,G5=(i("6cb0"),Object(C["a"])(H5,u5,d5,!1,null,"44d4551e",null)),q5=G5.exports,z5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SignalsUser",class:t.darkClass},[e("transition",{attrs:{name:"fade",appear:"",mode:"out-in"}},[t.isLoadingCustomData?e("Preloader",{attrs:{enabled:t.isLoadingCustomData,icon:t.isLoadingCustomData,message:"Loading"}}):t.myProfile?e("MySignals"):e("SomeoneElsesSignals",{attrs:{signalsBroker:t.signalsBroker,isSignalsBroker:t.isSignalsBroker}})],1)],1)},Y5=[],X5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MySignals",class:t.darkClass},[t.free?e("img",{staticClass:"contentMaker",attrs:{alt:"",src:i("fa24")},on:{click:t.goToSubscribe}}):e("div",{staticClass:"sourceContent"},[e("AccountNumber"),0===t.source.length?e("div",{staticClass:"noSignals"},[e("p",{staticClass:"noSignalsText"},[t._v(t._s(t.$t("yhsupfytsy")))]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.getIconData("Settings")},on:{toggle:t.goToMyProfile}},[t._v(t._s(t.$t("configure")))])],1)]):e("div",{staticClass:"containerTable"},[e("SignalsList",{attrs:{signals:t.source}})],1)],1)])},Q5=[],J5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SignalsList",class:t.darkClass},[e("div",{staticClass:"headTable"},t._l(t.headTableData,(function(i){return e("div",{key:i.id,staticClass:"part",domProps:{innerHTML:t._s(i.title)}})})),0),e("div",{staticClass:"containerTable"},t._l(t.signals,(function(t){return e("RowSignals",{key:t.id,attrs:{data:t}})})),1),t.onlyInstruments?t._e():e("div",{staticClass:"footerTable"},t._l(t.footerTableData,(function(i){return e("div",{key:i.id,staticClass:"part",domProps:{innerHTML:t._s(i.title)}})})),0)])},K5=[],Z5=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RowSignals",class:t.darkClass},t._l(t.cells,(function(i,o){return e("div",{key:o,staticClass:"part",domProps:{innerHTML:t._s(i.content)}})})),0)},t4=[],e4={name:"RowSignals",mixins:[xt],props:{data:{type:Object}},computed:{isSuccess:function(){return this.data.totalOrders&&this.data.positiveOrders?"".concat(Math.trunc(100/(this.data.totalOrders/this.data.positiveOrders)),"%"):"0%"},cells:function(){return[{content:"".concat(this.data.contract,"
")},{content:"$".concat(this.data.monthPrice,"
в мес.

")},{content:"".concat(this.data.profitPercent,"%
")},{content:"".concat(this.isSuccess,"
")}]}}},i4=e4,o4=(i("f10d"),Object(C["a"])(i4,Z5,t4,!1,null,"495b44ca",null)),n4=o4.exports,s4={name:"SignalsList",mixins:[xt],props:{signals:{type:Array,default:function(){return[]}}},components:{RowSignals:n4},data:function(){return{typeSalesData:null,isAllBag:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getApiUrl:"api/api"})),{},{headTableData:function(){return[{id:1,title:"Инструмент"},{id:2,title:"Стоимость
$/мес."},{id:3,title:"% от
результата"},{id:4,title:"% успешности
сделок"}]},footerTableData:function(){var t,e,i;return[{id:1,title:"Весь
портфель
"},{id:2,title:"$ ".concat(null===(t=this.typeSalesData)||void 0===t?void 0:t.monthPrice,"
в мес.

")},{id:3,title:"".concat(null===(e=this.typeSalesData)||void 0===e?void 0:e.profitPercent,"%
\n ").concat(null===(i=this.typeSalesData)||void 0===i?void 0:i.discountPricePercent,"%
скидка
")}]},onlyInstruments:function(){var t;return"instruments"===(null===(t=this.typeSalesData)||void 0===t||null===(t=t.chatData)||void 0===t?void 0:t.currentTypePublished)}}),mounted:function(){this.typeSales()},methods:{typeSales:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({accountId:t.$route.query.accountId}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:return o=e.sent,e.next=6,t.$http.get("".concat(t.getApiUrl,"SourceBag"),{params:i,headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}});case 6:n=e.sent,s=n.data,s&&(s.chatData=JSON.parse(s.chatData)),t.typeSalesData=s||{},t.onlyBag&&(t.isAllBag=!0);case 11:case"end":return e.stop()}}),e)})))()}}},r4=s4,a4=(i("1c0d"),Object(C["a"])(r4,J5,K5,!1,null,"eaed9096",null)),c4=a4.exports,l4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AccountNumber",class:t.darkClass},[e("span",{class:{noSignals:t.noSignals},domProps:{innerHTML:t._s(t.text)}}),t.noSignals?t._e():e("div",{staticClass:"wrapAccountNumber"},[e("div",{staticClass:"leftPart"},[e("img",{attrs:{src:t.srcIcon,alt:""}})]),e("div",{staticClass:"rightPart"},[e("span",{staticClass:"accountGroupCode",class:t.classGroupCode},[t._v(t._s(t.accountGroupCode))]),e("span",{staticClass:"number"},[t._v(t._s(t.accountNumber))])])])])},u4=[],d4={name:"AccountNumber",mixins:[xt,lW],props:{noSignals:{type:Boolean,default:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{srcIcon:function(){return i("700b")},myProfile:function(){return"owner"===this.getStatusUser.status},accountNumber:function(){var t;return this.myProfile?this.getDefaultAccount.sequenceId:null===(t=this.getStatistics)||void 0===t||null===(t=t.account)||void 0===t?void 0:t.sequenceId},accountGroupCode:function(){var t;return this.myProfile?this.getDefaultAccount.accountGroupCode:null===(t=this.getStatistics)||void 0===t||null===(t=t.account)||void 0===t?void 0:t.accountGroupCode},classGroupCode:function(){return["green",{red:"Demo"===this.accountGroupCode}]},text:function(){return this.noSignals?"Пользователь не предоставляет
торговые сигналы по счету":this.$t("tsba")}})},h4=d4,p4=(i("7dd4"),Object(C["a"])(h4,l4,u4,!1,null,"69397008",null)),g4=p4.exports,f4={name:"MySignals",mixins:[xt],components:{SignalsList:c4,AccountNumber:g4},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCurrenSiteSubscriptions:"paymentService/getCurrenSiteSubscriptions",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics"})),{},{free:function(){var t;return"free"===(null===(t=this.getCurrenSiteSubscriptions)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.toLowerCase())},source:function(){return this.getDefaultAccount.source},accountNumber:function(){var t;return null===(t=this.getStatistics)||void 0===t||null===(t=t.account)||void 0===t?void 0:t.sequenceId}}),methods:{goToSubscribe:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalSubscriptionOnPlatform"}})},goToMyProfile:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalTradeSignals"}})}}},m4=f4,v4=(i("68de"),Object(C["a"])(m4,X5,Q5,!1,null,"2e92467f",null)),y4=v4.exports,C4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SomeoneElsesSignals",class:t.darkClass},[t.isSignalsBroker?e("div",{staticClass:"signalsBlock"},[e("div",{staticClass:"tableSignals"},[e("AccountNumber"),e("SignalsList",{attrs:{signals:t.signalsBroker}})],1)]):e("div",{staticClass:"noSignal"},[e("svgIcon",{attrs:{name:"Big_Notification_of_price",viewBox:"0 0 100 101",size:100,color:t.colorIcon}}),e("div",{staticClass:"textEmptySignals"},[e("AccountNumber",{attrs:{noSignals:""}})],1)],1)])},b4=[],S4={name:"SomeoneElsesSignals",mixins:[xt],props:{signalsBroker:{type:Array},isSignalsBroker:{type:Boolean}},components:{SignalsList:c4,AccountNumber:g4},computed:{colorIcon:function(){return this.darkClass.dark?"#BBCEE0":"#CCCCCC"}}},P4=S4,T4=(i("4bc4"),Object(C["a"])(P4,C4,b4,!1,null,"74dd9ddb",null)),x4=T4.exports,O4={name:"SignalsUser",mixins:[UV,xt],props:{signalsBroker:{type:Array},isSignalsBroker:{type:Boolean},isLoadingCustomData:{type:Boolean}},components:{MySignals:y4,SomeoneElsesSignals:x4,Preloader:ah}},w4=O4,_4=(i("31c8"),Object(C["a"])(w4,z5,Y5,!1,null,"35015d4f",null)),A4=_4.exports,D4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ContentUser",class:t.darkClass},[e("transition",{attrs:{name:"fade",appear:"",mode:"out-in"}},[t.isLoadingCustomData?e("Preloader",{attrs:{enabled:t.isLoadingCustomData,icon:t.isLoadingCustomData,message:"Loading"}}):t.myProfile?e("MyContent",{attrs:{dataContent:t.dataContent,isVisibleContent:t.isVisibleContent}}):e("SomeoneElsesContent",{attrs:{dataContent:t.dataContent,isVisibleContent:t.isVisibleContent}})],1)],1)},k4=[],I4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyContent",class:t.darkClass},[t.free?e("img",{staticClass:"provider",attrs:{alt:"",src:i("49aa")},on:{click:t.goToSubscribe}}):e("div",{staticClass:"contentContainer"},[e("h3",{staticClass:"heading"},[t._v(t._s(t.$t("user_content")))]),t.isVisibleContent?e("ContentsList",{attrs:{dataContent:t.dataContent}}):[e("p",{staticClass:"noContentText"},[t._v(t._s(t.$t("yhsupfcy")))]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.getIconData("Settings")},on:{toggle:t.goToSettingsContent}},[t._v(t._s(t.$t("configure")))])],1)]],2)])},B4=[],M4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ContentsList",class:t.darkClass},[e("ul",t._l(t.contentArray,(function(i){return t.dataContent.content[i.type]?e("li",{key:i.id},[e("div",{staticClass:"wrapper"},[e("svgIcon",{attrs:{name:i.iconName,color:t.getColorIcon}}),e("span",{staticClass:"title"},[t._v(t._s(i.title))])],1)]):t._e()})),0),e("div",{staticClass:"priceBlock"},[e("p",{staticClass:"textPrice"},[t._v("Цена подписки на контент")]),e("div",{staticClass:"priceSum"},[t._v(t._s(t.price)+" $/мес.")])])])},$4=[],L4={name:"ContentsList",mixins:[xt],props:{dataContent:{type:Object}},computed:{contentArray:function(){return[{id:1,type:"acceptStreams",iconName:"Stream",title:"Стримы"},{id:2,type:"acceptGroups",iconName:"MarketIndicator",title:"Группы"},{id:3,type:"acceptBlogs",iconName:"Blogger",title:"Блоги"},{id:4,type:"acceptWebinars",iconName:"Webinar",title:"Вебинары"}]},price:function(){var t;return null===(t=this.dataContent)||void 0===t||null===(t=t.prices[0])||void 0===t?void 0:t.price}}},F4=L4,j4=(i("fffa"),Object(C["a"])(F4,M4,$4,!1,null,"67b58308",null)),R4=j4.exports,W4={name:"MyContent",mixins:[xt],props:{dataContent:{type:Object,default:function(){return{}}},isVisibleContent:{type:Boolean}},components:{ContentsList:R4},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCurrenSiteSubscriptions:"paymentService/getCurrenSiteSubscriptions"})),{},{free:function(){var t;return"free"===(null===(t=this.getCurrenSiteSubscriptions)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.toLowerCase())}}),methods:{goToSubscribe:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalSubscriptionOnPlatform"}})},goToSettingsContent:function(){this.$router.push({name:"Personal Area",query:{tabName:"PersonalMyContent"}})}}},N4=W4,E4=(i("24e7"),Object(C["a"])(N4,I4,B4,!1,null,"01938723",null)),U4=E4.exports,V4=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SomeoneElsesContent",class:t.darkClass},[t.isVisibleContent?e("div",{staticClass:"contentContainer"},[e("h3",{staticClass:"heading"},[t._v("Контент пользователя")]),e("ContentsList",{attrs:{dataContent:t.dataContent}})],1):e("div",{staticClass:"noContent"},[e("svgIcon",{attrs:{name:"Big-Content",viewBox:"0 0 100 101",size:100,color:t.colorIcon}}),e("div",{staticClass:"textEmptyContent"},[t._v("Пользователь не предоставляет подписку на контент")])],1)])},H4=[],G4={name:"SomeoneElsesContent",mixins:[xt],props:{dataContent:{type:Object,default:function(){return{}}},isVisibleContent:{type:Boolean}},components:{ContentsList:R4},computed:{colorIcon:function(){return this.darkClass.dark?"#BBCEE0":"#CCCCCC"}}},q4=G4,z4=(i("060e"),Object(C["a"])(q4,V4,H4,!1,null,"0b29cfff",null)),Y4=z4.exports,X4={name:"ContentUser",mixins:[UV,xt],props:{userData:{type:Object,default:function(){return{}}},isLoadingCustomData:{type:Boolean}},components:{MyContent:U4,SomeoneElsesContent:Y4,Preloader:ah},data:function(){return{dataContent:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api"})),{},{isVisibleContent:function(){var t,e=this;if(null===(t=this.dataContent)||void 0===t||!t.content)return!1;var i=["acceptBlogs","acceptGroups","acceptStreams","acceptWebinars"];return i.some((function(t){return e.dataContent.content[t]}))}}),watch:{"userData.id":{handler:function(t){t&&this.getUserContent()},deep:!0}},methods:{getUserContent:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("".concat(t.getApiUrl,"UserContent"),{params:{userId:null===(i=t.userData)||void 0===i?void 0:i.id}});case 2:o=e.sent,n=o.data,s=n.find((function(e){return e.accountId===t.$route.query.accountId})),t.dataContent=Object(c["a"])(Object(c["a"])({},s),{},{content:[]});case 6:case"end":return e.stop()}}),e)})))()}}},Q4=X4,J4=(i("9e2e"),Object(C["a"])(Q4,D4,k4,!1,null,"46966861",null)),K4=J4.exports,Z4={name:"UserProfileAboutUserTab",mixins:[UV,lW],props:{userData:{type:Object},signalsBroker:{type:Array},isSignalsBroker:{type:Boolean}},components:{PhotoUser:l5,MyInfo:q5,SignalsUser:A4,ContentUser:K4},data:function(){return{ttUser:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getUser:"user/getUserDetail",customData:"user/customData"})),{},{isLoadingCustomData:function(){var t,e=null===(t=this.getStatusUser)||void 0===t?void 0:t.status;return("ghost"!==e||!this.ttUser)&&("owner"!==e||!this.customData)}}),watch:{getStatusUser:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(o=null===t||void 0===t?void 0:t.status,n=null===t||void 0===t?void 0:t.user,"ghost"!==o||"auth"!==n||e.ttUser){i.next=5;break}return i.next=5,e.getUserData();case 5:case"end":return i.stop()}}),i)})))()},userData:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(null===t||void 0===t||!t.id){i.next=6;break}if(s=null===(o=e.getStatusUser)||void 0===o?void 0:o.status,a=null===(n=e.getStatusUser)||void 0===n?void 0:n.user,"ghost"!==s||"unauth"!==a||e.ttUser){i.next=6;break}return i.next=6,e.getUserData();case 6:case"end":return i.stop()}}),i)})))()}},methods:{getUserData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("".concat(t.getApiUrl,"User/CustomData"),{params:{login:null===(i=t.userData)||void 0===i?void 0:i.login}});case 2:o=e.sent,n=o.data,t.ttUser=n;case 5:case"end":return e.stop()}}),e)})))()}}},t8=Z4,e8=(i("97d8"),Object(C["a"])(t8,H3,G3,!1,null,"a21de458",null)),i8=e8.exports,o8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"userProfileMyWorld"},[e("div",{staticClass:"calendarContainer"},[e("EventCalendar",{attrs:{events:t.getEventsCalendar,isLoading:t.isLoadingCalendar,editOne:t.getLeftSideBar,editTwo:t.getRightSideBar}})],1)])},n8=[],s8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"myCalendar"},[e("HeaderCalendar",{attrs:{day:t.day,getMonth:t.getMonth,year:t.year,navigation:t.navigation,goToCurrentDay:t.goToCurrentDay,periods:t.periods,selectedPeriod:t.selectedPeriod,darkClass:t.darkClass,clickButtonAddEvent:t.clickButtonAddEvent,currentDate:t.currentDate},on:{periodChanged:t.periodChanged}}),e("transition",{attrs:{name:"component-fade",mode:"out-in"}},[t.isLoading?e("div",{staticClass:"loaderBlock"},[e("DxLoadIndicator",{class:t.classForLoading,attrs:{height:80,width:80}})],1):t.currentDate?e("keep-alive",[e(t.selectedPeriod,t._b({tag:"component",attrs:{day:t.day,month:t.month,year:t.year,weekdays:t.weekdays,currentDate:t.currentDate,selectedPeriod:t.selectedPeriod,localization:t.getLocalization,language:t.getLanguage,darkClass:t.darkClass,serverTime:t.serverTime,getEventsCalendar:t.getEventsCalendar,editOne:t.editOne,editTwo:t.editTwo,nav:t.nav}},"component",t.propsEvents[t.selectedPeriod],!1))],1):t._e()],1),t.visiblePopupEvent?e("PopupAddEvent",{attrs:{visiblePopupEvent:t.visiblePopupEvent,selectedDay:t.selectedDay,localization:t.getLocalization,serverTime:t.serverTime,lineForDayDbClick:t.lineForDayDbClick,selectedPeriod:t.selectedPeriod,selectedEvent:t.selectedEvent},on:{closePopupEvent:t.closePopupEvent,hiddenPopupEvent:t.hiddenPopupEvent}}):t._e()],1)},r8=[],a8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"headerCalendar",class:t.darkClass},[e("div",{staticClass:"monthAndYear"},[t.visibleDay?e("span",{staticClass:"day"},[t._v(t._s(t.day)+" ")]):t._e(),t.visibleMonth?e("span",{staticClass:"month"},[t._v(t._s(t.getMonth))]):t._e(),e("span",{staticClass:"year"},[t._v(" "+t._s(t.year))])]),e("DxSelectBox",{attrs:{value:t.selectedPeriod,"display-expr":"value","value-expr":"component",items:t.periods,height:32,width:105,"element-attr":{class:"selectForPeriod"},dropDownOptions:{wrapperAttr:{class:t.dropDownOptionsClass}}},on:{"value-changed":t.periodChanged}}),t.visibleAddEvent?e("ButtonIconFlat",{attrs:{icon:{name:"Plus"},modifier:{class:["buttonAddEvent"]}},on:{click:t.addNewEventPopup}}):t._e(),e("div",{staticClass:"navigaionButtons"},[e("ButtonIconFlat",{attrs:{icon:{name:"Arrow-expand-left"},modifier:{class:["buttonNavigation"]}},on:{toggle:function(e){return t.navigation(-1)}}}),e("button",{staticClass:"buttonNavigation currentDay",on:{click:t.goToCurrentDay}},[t._v(t._s(t.$t("today")))]),e("ButtonIconFlat",{attrs:{icon:{name:"Arrow-expand-right"},modifier:{class:["buttonNavigation"]}},on:{toggle:function(e){return t.navigation(1)}}})],1)],1)},c8=[],l8={name:"HeaderCalendar",props:{day:{type:Number},getMonth:{type:String},year:{type:Number},currentDate:{type:Date},navigation:{type:Function},goToCurrentDay:{type:Function},periods:{type:Array},selectedPeriod:{type:String},darkClass:{type:Object},clickButtonAddEvent:{type:Function}},components:{DxSelectBox:Bo.a},computed:{visibleDay:function(){return"DayView"===this.selectedPeriod},visibleMonth:function(){return"YearView"!==this.selectedPeriod},dropDownOptionsClass:function(){var t="dropDownPeriodCalendar";return this.darkClass.dark&&(t+=" dark"),t},visibleAddEvent:function(){return"DayView"===this.selectedPeriod}},methods:{periodChanged:function(t){this.$emit("periodChanged",{value:t.value,previousValue:t.previousValue})},addNewEventPopup:function(){var t=this.currentDate.getFullYear(),e=this.currentDate.getMonth(),i=this.currentDate.getDate();this.clickButtonAddEvent({year:t,month:e,numberDay:i})}}},u8=l8,d8=(i("9842"),i("3577"),Object(C["a"])(u8,a8,c8,!1,null,"292fb68a",null)),h8=d8.exports,p8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"daysWeek",class:t.classForDaysWeek},t._l(t.weekdays,(function(i,o){return e("div",{key:o,staticClass:"dateString",class:t.classForDateString},[e("span",{staticClass:"dayName"},[t._v(t._s(i)),t.visibleDayNumber?e("span",[t._v(",")]):t._e()]),t.visibleDayNumber?e("span",{staticClass:"dayNumber",class:{today:t.weekData[o].today}},[t._v(t._s(t.weekData[o].numberDay))]):t._e(),t.visibleDayNumber&&t.weekData[o].monthName?e("span",{staticClass:"nameDayFirstDay"},[t._v(t._s(t.weekData[o].monthName))]):t._e(),t.forWeek?e("ButtonIconFlat",{attrs:{icon:{name:"Plus"},modifier:{class:["buttonAddEvent"]}},on:{click:function(e){return t.addNewEventPopup(t.weekData[o].date)}}}):t._e()],1)})),0)},g8=[],f8={name:"WeekDays",props:{weekdays:{type:Array},weekData:{type:Array,default:function(){return[]}},forDay:{type:Boolean,default:!1},forWeek:{type:Boolean,default:!1},darkClass:{type:Object},clickButtonAddEvent:{type:Function}},computed:{visibleDayNumber:function(){return this.weekData.length>0},classForDaysWeek:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{forWeek:this.forWeek,forDay:this.forDay})},classForDateString:function(){return{forDay:this.forDay}}},methods:{addNewEventPopup:function(t){var e=t.getDate(),i=t.getMonth(),o=t.getFullYear();this.clickButtonAddEvent({year:o,month:i,numberDay:e})}}},m8=f8,v8=(i("b780"),Object(C["a"])(m8,p8,g8,!1,null,"65b1ad0a",null)),y8=v8.exports,C8=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"yearContainer",class:t.getClassResize},t._l(t.monthNames,(function(i,o){return e("div",{key:o,staticClass:"containerForMonth"},[e("transition",{attrs:{name:"fade"}},[t.isVisibleCalendar?e("div",{staticClass:"sectionMonth"},[e("div",{staticClass:"monthName"},[t._v(t._s(i))]),e("MonthView",{attrs:{day:1,month:o,year:t.year,weekdays:t.weekdays,"for-year":!0,localization:t.localization,language:t.language,darkClass:t.darkClass,selectedPeriod:t.selectedPeriod,goToDay:t.goToDay,getEventsCalendar:t.getEventsCalendar,serverTime:t.serverTime,nav:t.nav,currentDate:t.currentDate}})],1):t._e()])],1)})),0)},b8=[],S8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"containerForMonthView",class:t.classContainer},[e("WeekDays",{attrs:{weekdays:t.weekdays,"for-day":t.forDay,darkClass:t.darkClass}}),e("div",{ref:"contentCalendar",staticClass:"contentCalendar",class:t.darkClass},t._l(t.allDaysByMonth,(function(i,o){return e("div",{key:o,staticClass:"day",class:t.classForDay(i),on:{click:function(e){return t.clickDayHandler(i)}}},[t.visibleEventsForYear(i)?e("div",{staticClass:"eventsLength"},[t._v(t._s(i.events.length))]):t._e(),e("div",{staticClass:"number"},[t.visibleButtonAddEvent(i)?e("ButtonIconFlat",{attrs:{icon:{name:"Plus"},modifier:{class:["buttonAddEvent"]}},on:{click:function(e){e.stopPropagation(),t.clickButtonAddEvent&&t.clickButtonAddEvent(i)}}}):t._e(),e("span",{class:["wrapNumber",{today:i.today}]},[t._v(t._s(i.numberDay))]),!i.monthName||t.forYear||t.forDay?t._e():e("span",{class:["monthName",{today:i.today}]},[t._v(t._s(i.monthName))])],1),t.visibleEvents(i)?e("div",{staticClass:"events"},[t._l(t.eventsRender(i.events),(function(i,o){return e("div",{key:o,staticClass:"oneEvent",style:{background:i.data.currentColor}},[t._v(t._s(t.getTimeEvent(i))+" "+t._s(i.name))])})),t.moreCount(i.events,t.eventsRender(i.events))?e("div",{staticClass:"more",on:{click:function(e){return t.openPopupFullevents(i)}}},[t._v("+"+t._s(t.moreCount(i.events,t.eventsRender(i.events)))+" more")]):t._e()],2):t._e()])})),0),e("PopupAllEvents",{attrs:{widthCell:t.widthCell,minHeightCell:t.cellHeight,popupVisible:t.popupVisible,numberDay:t.numberDay,localization:t.localization,allEventsForDay:t.allEventsForDay},on:{hiddenPopupEvent:t.closePopupAllEventOutsideClick,close:t.closePopupAllEvents}})],1)},P8=[],T8=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"popupAllEvents",attrs:{shadingColor:"transparent","title-template":"header",height:"auto","min-height":t.minHeightCell,width:t.widthCell,"min-width":250,visible:t.popupVisible,"drag-enabled":!0,"close-on-outside-click":!0,"show-close-button":!0,"show-title":!0,wrapperAttr:{class:t.wrapperClass}},on:{hidden:function(e){return t.$emit("hiddenPopupEvent",t.$refs.popupAllEvents)}},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"headerPopup"},[t._v(t._s(t.headerText)),e("span",{staticClass:"closeButton",on:{click:function(e){return t.$emit("close")}}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0}])},[e("DxPosition",{attrs:{at:"bottom left",my:"left bottom",of:t.offClass}}),e("div",{staticClass:"wrapper"},[e("ul",{staticClass:"list-events"},t._l(t.allEventsForDay,(function(i){return e("li",{key:i.id,staticClass:"list-events-item"},[e("span",{staticClass:"circleColor",style:{background:i.data.currentColor}}),e("span",{staticClass:"text"},[t._v(t._s(t.getTime(i))+" "+t._s(i.description))])])})),0)])],1)},x8=[],O8={name:"PopupAllEvents",props:{popupVisible:{type:Boolean,default:!1},numberDay:{type:Date},localization:{type:String},closePopupAllEventOutsideClick:{type:Function},minHeightCell:{type:Number},widthCell:{type:Number},allEventsForDay:{type:Array}},components:{DxPopup:To["DxPopup"],DxPosition:To["DxPosition"]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{wrapperClass:function(){return"dark"===this.getActiveTheme?"popupAllEvents dark":"popupAllEvents"},offClass:function(){return".day".concat(this.numberDay?this.numberDay.getDate():0)},headerText:function(){return this.numberDay.toLocaleDateString(this.localization,{day:"2-digit",month:"long",year:"numeric"})},getTime:function(){return function(t){return cL(t)}}})},w8=O8,_8=(i("dbf6"),i("4e95"),Object(C["a"])(w8,T8,x8,!1,null,"0eddf7e3",null)),A8=_8.exports,D8={props:{day:{type:Number},month:{type:Number},year:{type:Number},weekdays:{type:Array},currentDate:{type:Date},selectedPeriod:{type:String},localization:{type:String},language:{type:String},darkClass:{type:Object},serverTime:{type:Date},editOne:{type:Boolean},editTwo:{type:Boolean},getEventsCalendar:{type:Array},nav:{type:Number}},computed:{getToday:function(){var t=this;if(!this.serverTime)return!1;var e=this.serverTime,i=e.getDate(),o=e.getMonth(),n=e.getFullYear();return function(e){return e===i&&t.month===o&&t.year===n}},getOnlyCurrentDay:function(){return"WeekView"===this.selectedPeriod?uL(this.currentDate):new Date(this.year,this.month,this.day)}}},k8={name:"MonthView",inject:["postEventsFromData"],components:{WeekDays:y8,PopupAllEvents:A8},mixins:[D8,qg],props:{forYear:{type:Boolean,default:!1},forDay:{type:Boolean,default:!1},dayViewClickHandler:{type:Function,default:null},clickButtonAddEvent:{type:Function,default:null},goToDay:{type:Function,default:null}},data:function(){return{heightCalendar:0,allDaysByMonth:[],numberDay:new Date,popupVisible:!1,allEventsForDay:[],mounted:!1}},computed:{classContainer:function(){return{monthForDay:this.forDay}},getCurrentDay:function(){var t=this;return function(e,i,o){if(!t.currentDate)return!1;var n=t.currentDate.getDate(),s=t.currentDate.getMonth(),r=t.currentDate.getFullYear();return"DayView"===t.selectedPeriod&&new Date(e,i,o).getTime()===new Date(r,s,n).getTime()}},classForDay:function(){var t=this;return function(e){return["day".concat(e.numberDay),{noActive:!e.active,isWeekend:e.isWeekend,forYear:t.forYear,forDay:t.forDay,currentDayForDayView:e.currentDayForDayView}]}},visibleButtonAddEvent:function(){var t=this;return function(e){var i=e.year,o=e.month,n=e.numberDay,s="MonthView"===t.selectedPeriod;if(!s)return!1;var r=new Date(i,o,n),a=sL(r,t.serverTime,"more-equally");return s&&a}},getTimeEvent:function(){return function(t){return cL(t)}},cellHeight:function(){if(this.el)return this.heightCalendar/6},widthCell:function(){if(this.el)return this.el.getBoundingClientRect().width/7},eventsRender:function(){var t=this;return function(e){var i=Math.floor(t.cellHeight/22)-3;return e.filter((function(t,e){return e0&&"MonthView"===t.selectedPeriod}},visibleEventsForYear:function(){var t=this;return function(e){return e.events.length>0&&["YearView","DayView"].includes(t.selectedPeriod)}}},watch:{month:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getData(t);case 2:case"end":return i.stop()}}),i)})))()},getEventsCalendar:function(){this.renderContentForMonth()},currentDate:function(){this.renderContentForMonth()}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.heightCalendar=t.$refs.contentCalendar.clientHeight,t.initObserver(t.onResize,t.$refs.contentCalendar),t.renderContentForMonth(),t.mounted=!0;case 4:case"end":return e.stop()}}),e)})))()},activated:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.mounted){e.next=3;break}return e.next=3,t.getData(t.month);case 3:case"end":return e.stop()}}),e)})))()},methods:{getData:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!sL(e.currentDate,e.serverTime,"less")||e.forDay||e.forYear){i.next=4;break}return i.next=3,e.postEventsFromData({from:new Date(e.year,t,-5)});case 3:e.renderContentForMonth();case 4:case"end":return i.stop()}}),i)})))()},onResize:function(){this.heightCalendar!==this.el.clientHeight&&(this.heightCalendar=this.el.clientHeight)},renderContentForMonth:function(){this.allDaysByMonth=[];var t=new Date(this.year,this.month,1),e=new Date(this.year,this.month+1,0),i=e.getDate(),o=eL(t,this.localization),n=eL(e,this.localization),s=this.weekdays.indexOf(o.toLowerCase()),r=this.weekdays.length-(this.weekdays.indexOf(n.toLowerCase())+1);28===i&&o.toLowerCase()===this.weekdays[0]&&(r+=14);var a=i+s+r;a=35===a?a+7:a;for(var c=this.getEventsCalendar,l=1;l<=a;l++){var u=l%7===0||(l+1)%7===0;if(l>s&&l<=i+s){var d=l-s,h=sL(new Date(this.year,this.month,l-s),this.serverTime,"equally"),p=this.getCurrentDay(this.year,this.month,l-s),g=this.getEventsForDay(c,{year:this.year,month:this.month,day:l-s}),f=l-s===1?tL(new Date(this.year,this.month,1),this.language):"";this.allDaysByMonth.push({events:g,numberDay:d,today:h,monthName:f,currentDayForDayView:p,isWeekend:u,month:this.month,year:this.year,active:!0})}else{var m=new Date(this.year,this.month,l-s).getDate(),v=l>i?l-i-s:m,y=1===m?tL(new Date(this.year,this.month+1,1),this.language):"",C=this.getYearAndMonth(l,i),b=C.month,S=C.year,P=this.getEventsForDay(c,{year:S,month:b,day:v});this.allDaysByMonth.push({events:P,numberDay:v,month:b,year:S,active:!1,monthName:y,currentDayForDayView:this.getCurrentDay(this.year,b,v)})}}},getYearAndMonth:function(t,e){var i=this.year,o=this.month;return t>e?o+=1:o-=1,{year:i,month:o}},getEventsForDay:function(t,e){var i="".concat(e.day,".").concat(e.month,".").concat(e.year);return t.filter((function(t){var e;return(null===(e=t.data)||void 0===e?void 0:e.dateEvent)===i})).sort((function(t,e){var i=new Date(t.dateFrom).getTime(),o=new Date(e.dateFrom).getTime();return i-o}))},openPopupFullevents:function(t){this.numberDay=new Date(t.year,t.month,t.numberDay),this.allEventsForDay=t.events,this.popupVisible=!0},closePopupAllEvents:function(){this.popupVisible=!1},closePopupAllEventOutsideClick:function(t){var e=this;t.instance.hide().then((function(){e.popupVisible=!1}))},clickDayHandler:function(t){"DayView"===this.selectedPeriod&&(this.dayViewClickHandler(t),this.$emit("dayClick")),"YearView"===this.selectedPeriod&&this.goToDay(t)}}},I8=k8,B8=(i("9b26e"),Object(C["a"])(I8,S8,P8,!1,null,"603eabc2",null)),M8=B8.exports,$8={name:"YearView",mixins:[D8,qg],inject:["postEventsFromData"],props:{goToDay:{type:Function}},data:function(){return{isVisibleCalendar:!0,classResize:{}}},components:{MonthView:M8},computed:{monthNames:function(){return this.$t("mounthArr")},getClassResize:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),this.classResize)}},watch:{editOne:function(){this.setVisible()},editTwo:function(){this.setVisible()},nav:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(t.serverTime.getFullYear()>t.year)){e.next=3;break}return e.next=3,t.postEventsFromData({from:new Date(t.year,0,1)});case 3:case"end":return e.stop()}}),e)})))()}},activated:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.postEventsFromData({from:new Date(t.year,0,1)});case 2:case"end":return e.stop()}}),e)})))()},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.initObserver(t.onResize,t.$refs.container);case 1:case"end":return e.stop()}}),e)})))()},methods:{setVisible:function(){var t=this;this.isVisibleCalendar=!1,setTimeout((function(){t.isVisibleCalendar=!0}),1e3)},onResize:function(){var t=this.$refs.container,e=t.getBoundingClientRect().width,i=t.classList.contains("threeBlock"),o=t.classList.contains("twoBlocks"),n=t.classList.contains("oneBlocks");e<=1540&&e>1160&&!i&&(this.classResize={threeBlock:!0}),e<=1160&&e>770&&!o&&(this.classResize={twoBlocks:!0}),e<=770&&!n&&(this.classResize={oneBlocks:!0})}}},L8=$8,F8=(i("acfa"),Object(C["a"])(L8,C8,b8,!1,null,"5ca76206",null)),j8=F8.exports,R8=function(){var t=this,e=t._self._c;return e("transition",{attrs:{name:"fade"}},[t.isVisibleWeek?e("div",{staticClass:"containerForWeekView",class:t.darkClass},[e("WeekDays",{attrs:{weekdays:t.weekdays,weekData:t.daysForWeek,darkClass:t.darkClass,"for-week":!0,clickButtonAddEvent:t.clickButtonAddEvent}}),e("div",{ref:"contentWeek",staticClass:"contentCalendarWeek"},[e("div",{staticClass:"wrapperWeek"},[e("TimeLine",{ref:"timeline",attrs:{darkClass:t.darkClass}}),t._l(t.daysForWeek,(function(i,o){return e("div",{key:o,staticClass:"dayWeek",class:{isWeekend:i.isWeekend},attrs:{"data-cell":o+1,"data-date":i.date.toString()}},[e("DayView",{attrs:{day:t.dayForDayWiew(i.date),month:t.monthForDayView(i.date),year:t.yearForDayView(i.date),currentDate:i.date,serverTime:t.serverTime,selectedPeriod:t.selectedPeriod,doubleClickAddEvent:t.doubleClickAddEvent,editEvent:t.editEvent,"for-week":!0,darkClass:t.darkClass,getEventsCalendar:t.getEventsCalendar}})],1)}))],2)])],1):t._e()])},W8=[],N8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"timeLineVertical",class:t.darkClass},t._l(24,(function(i){return e("div",{key:i,staticClass:"line"},[1===i?e("span",{staticClass:"time first"},[t._v("00:00")]):t._e(),e("span",{staticClass:"time"},[t._v(t._s(t.formatNumber(i)))])])})),0)},E8=[],U8={name:"TimeLine",props:{darkClass:{type:Object}},computed:{formatNumber:function(){return function(t){var e=t<10?"0".concat(t):t;return 24===e&&(e="00"),"".concat(e,":00")}}}},V8=U8,H8=(i("7089"),Object(C["a"])(V8,N8,E8,!1,null,"ee499176",null)),G8=H8.exports,q8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dayView",class:t.darkClass},[t.forWeek?t._e():e("TimeLine",{attrs:{darkClass:t.darkClass}}),e("div",{key:t.render,ref:"container",staticClass:"dayContainer",style:t.getPositionTop,on:{dblclick:t.dbClickHandler}},[t._l(24,(function(i){return e("div",{key:i,staticClass:"timeLine",class:t.classForTimeLine(i),attrs:{"data-time":i}},t._l(t.getEvents(i),(function(o){return t.getEvents(i)?e("DraggableComponent",{key:o.id,attrs:{forWeek:t.forWeek,customEvent:o,line:i,deactive:t.deactive,dbClickHandler:t.dbClickHandler,setRender:t.setRender}}):t._e()})),1)})),t.visibleCurrentTimeLine?e("div",{staticClass:"currentTimeLine",attrs:{"data-current-time":t.getTimeForTimeLine}}):t._e()],2),t.forWeek?t._e():e("div",{ref:"monthContainer",staticClass:"monthContainer",class:{active:t.active}},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["iconOpenCalendar"]}},on:{toggle:t.openCalendar}}),e("MonthView",{key:t.render,attrs:{day:t.day,month:t.month,year:t.year,weekdays:t.weekdays,currentDate:t.currentDate,"for-day":!0,selectedPeriod:t.selectedPeriod,dayViewClickHandler:t.dayViewClickHandler,localization:t.localization,language:t.language,darkClass:t.darkClass,getEventsCalendar:t.getEventsCalendar,serverTime:t.serverTime},on:{dayClick:t.clickByDaySmallMonth}}),e("ListEvents",{attrs:{currentDate:t.currentDate,localization:t.localization,events:t.events,editEvent:t.editEvent,serverTime:t.serverTime,getOnlyCurrentDay:t.getOnlyCurrentDay,clickButtonAddEvent:t.clickButtonAddEvent}})],1)],1)},z8=[],Y8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"listEvents",class:t.darkClass,style:t.heightContainer},[e("h3",{staticClass:"date"},[t._v(t._s(t.getDate))]),t.events.length>0?e("div",{staticClass:"wrapEventsBlock"},t._l(t.events,(function(i){return e("div",{key:i.id,staticClass:"eventsBlock"},[e("div",{staticClass:"nameEvent"},[e("span",{staticClass:"curcle",style:{background:i.data.currentColor}}),e("span",{staticClass:"nameAndTime"},[t._v(t._s(t.getTime(i))+" "+t._s(i.name))]),e("IconBlockEdit",{attrs:{id:i.id,"for-events-list":!0,editEvent:t.editEventsInListEvents(i.id,t.currentDate)}})],1),e("p",{staticClass:"descriptionEvent"},[t._v(t._s(i.description))])])})),0):e("div",{staticClass:"notEvents"},[t._v(t._s(t.$t("no_events")))]),e("DxButton",{attrs:{height:"48",type:"default",elementAttr:{class:"buttonBack"},text:t.$t("add_event")},on:{click:t.addNewEventPopup}})],1)},X8=[],Q8=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrapIcon",class:t.darkClass},[e("div",{staticClass:"iconBlock"},[e("span",{staticClass:"iconEdit",on:{click:function(e){return t.editEvent(e,!1)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),e("span",{staticClass:"iconEdit",on:{click:function(e){return t.editEvent(e,!0)}}},[e("svgIcon",{attrs:{name:"new-copy"}})],1),e("span",{staticClass:"iconEdit iconDelete",class:t.iconId,on:{click:t.openConfirmDelete}},[e("svgIcon",{attrs:{name:"new-delete"}})],1)]),e("PopupConfirm",{attrs:{width:"180",height:"80",visible:t.popupVisible,position:t.getPopupPosition,confirmClickHandler:t.deleteEvent},on:{close:t.closePopup}})],1)},J8=[],K8=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"popupConfirm",attrs:{shadingColor:"transparent","title-template":"header",width:t.width,height:t.height,visible:t.visible,"drag-enabled":!1,"close-on-outside-click":!0,"show-close-button":!1,"show-title":!0,wrapperAttr:{class:t.classWrapper}},on:{hidden:t.closePopup},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"headerPopup"},[t._v("Delete?")])]},proxy:!0}])},[e("DxPosition",{attrs:{at:t.position.at,my:t.position.my,of:t.position.of,offset:"-17 0"}}),e("div",{staticClass:"footer",class:t.darkClass},[e("DxButton",{attrs:{width:"50%",height:"40",type:"danger",elementAttr:{class:"buttonConfirm buttonDelete"},text:"Ок"},on:{click:t.confirmClickHandler}}),e("DxButton",{attrs:{width:"50%",height:"40",type:"normal",elementAttr:{class:"buttonConfirm buttonCancel"},text:"Cancel"},on:{click:t.closePopup}})],1)],1)},Z8=[],t6={name:"PopupConfirm",props:{visible:{type:Boolean},position:{type:Object},confirmClickHandler:{type:Function},width:{type:[Number,String]},height:{type:[Number,String]}},components:{DxPopup:To["DxPopup"],DxPosition:To["DxPosition"],DxButton:cc.a},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},classWrapper:function(){return"dark"===this.getActiveTheme?"popupConfirm dark":"popupConfirm"}}),methods:{closePopup:function(){this.$emit("close",this.$refs.popupConfirm)}}},e6=t6,i6=(i("334e"),i("1a2db"),Object(C["a"])(e6,K8,Z8,!1,null,"03de5b6e",null)),o6=i6.exports,n6={name:"IconBlockEdit",inject:{deleteHandler:"deleteEvent"},props:{editEvent:{type:Function},id:{type:Number},forEventsList:{type:Boolean,default:!1}},components:{PopupConfirm:o6},data:function(){return{popupVisible:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getEventsCalendar:"eventsCalendar/getEventsCalendar",getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},iconId:function(){return(this.forEventsList?"iconDeleteForList":"iconDelete")+this.id},getPopupPosition:function(){return{at:"left",my:"right",of:"."+this.iconId}}}),methods:{openConfirmDelete:function(t){this.$emit("openPopupConfirm",t),this.popupVisible=!0},deleteEvent:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.deleteHandler(t.id);case 2:t.popupVisible=!1;case 3:case"end":return e.stop()}}),e)})))()},closePopup:function(t){var e=this;t.instance.hide().then((function(){e.popupVisible=!1;var t=document.querySelector(".confirmEvents");t&&t.classList.remove("confirmEvents")}))}}},s6=n6,r6=(i("7ce4"),Object(C["a"])(s6,Q8,J8,!1,null,"6d64f1c4",null)),a6=r6.exports,c6={name:"ListEvents",mixins:[qg],props:{currentDate:{type:Date},localization:{type:String},events:{type:Array},editEvent:{type:Function},serverTime:{type:Date},getOnlyCurrentDay:{type:Date},clickButtonAddEvent:{type:Function}},components:{IconBlockEdit:a6,DxButton:cc.a},data:function(){return{monthContainerHeight:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{heightContainer:function(){return{"--month-container":this.monthContainerHeight+"px"}},darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getDate:function(){return this.currentDate.toLocaleDateString(this.localization,{weekday:"long",day:"numeric",month:"short"})},getTime:function(){return function(t){return cL(t)}}}),mounted:function(){this.monthContainerHeight=this.$parent.$refs.monthContainer.clientHeight,this.initObserver(this.onResize,this.$parent.$refs.monthContainer)},methods:{onResize:function(){this.monthContainerHeight!==this.$parent.$refs.monthContainer.clientHeight&&(this.monthContainerHeight=this.$parent.$refs.monthContainer.clientHeight)},editEventsInListEvents:function(t,e){var i=this;return function(o,n){return i.editEvent(t,e,n)}},addNewEventPopup:function(){var t=this.currentDate.getFullYear(),e=this.currentDate.getMonth(),i=this.currentDate.getDate();this.clickButtonAddEvent({year:t,month:e,numberDay:i})}}},l6=c6,u6=(i("a5df"),Object(C["a"])(l6,Y8,X8,!1,null,"c81f60ca",null)),d6=u6.exports,h6=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"popupEvent",attrs:{visible:t.visiblePopupEvent,"drag-enabled":!0,"close-on-outside-click":!1,"show-close-button":!0,"show-title":!0,wrapperAttr:{class:t.getPopupClass},shadingColor:"transparent",width:"350",height:"auto",title:t.getTitle},on:{hidden:function(e){return t.$emit("hiddenPopupEvent")}}},[e("div",{staticClass:"wrapper"},[e("div",{staticClass:"nameAndColor"},[e("DxTextBox",{attrs:{height:"60",label:t.$t("event_name"),labelMode:"static","value-change-event":"keyup",elementAttr:{class:"nameEvent"},inputAttr:{maxlength:500}},model:{value:t.nameEvent,callback:function(e){t.nameEvent=e},expression:"nameEvent"}}),e("NewColorPicker",{key:t.currentColor,attrs:{color:t.currentColor,visibleOpacityLine:!1},on:{changeColor:t.setColor}})],1),e("div",{staticClass:"date"},[e("DxDateBox",{attrs:{width:"100%",type:"date",pickerType:"rollers","display-format":"MMMM dd, yyyy",dropDownOptions:t.dropDownOptionsForDate,elementAttr:{class:"dateBox"}},model:{value:t.date,callback:function(e){t.date=e},expression:"date"}})],1),e("div",{staticClass:"time"},[e("DxDateBox",{attrs:{width:"50%",type:"time",displayFormat:"HH:mm",pickerType:"rollers",step:"600",dropDownOptions:t.dropDownOptions(".timeBoxFrom"),elementAttr:{class:"timeBoxFrom"}},model:{value:t.timeFrom,callback:function(e){t.timeFrom=e},expression:"timeFrom"}}),e("DxDateBox",{attrs:{width:"50%",type:"time",displayFormat:"HH:mm",pickerType:"rollers",dropDownOptions:t.dropDownOptions(".timeBoxTo"),elementAttr:{class:"timeBoxTo"}},model:{value:t.timeTo,callback:function(e){t.timeTo=e},expression:"timeTo"}})],1),e("div",{staticClass:"description"},[e("span",{staticClass:"label"},[t._v(t._s(t.$t("event_description")))]),e("DxTextArea",{attrs:{"auto-resize-enabled":!0,"min-height":90,"value-change-event":"keyup",elementAttr:{class:"textAreaDescription"},inputAttr:{maxlength:1e3}},model:{value:t.description,callback:function(e){t.description=e},expression:"description"}})],1),e("div",{staticClass:"footer"},[e("DxButton",{attrs:{width:"50%",height:"40",type:"default",disabled:t.disabledButton||t.isLoadingApi,elementAttr:{class:"buttonReg"},text:t.getTextButton},on:{click:t.addOrEditEvent},scopedSlots:t._u([{key:"content",fn:function(){return[e("LoadingForButton",{attrs:{text:t.getTextButton,isLoading:t.isLoadingApi}})]},proxy:!0}])}),e("DxButton",{attrs:{width:"50%",height:"40",type:"normal",elementAttr:{class:"buttonCancel"},text:t.$t("cancel")},on:{click:function(e){return t.$emit("closePopupEvent",t.$refs.popupEvent)}}})],1)])])},p6=[],g6=i("9576"),f6=i.n(g6),m6={name:"PopupAddEvent",props:{selectedDay:{type:Date},visiblePopupEvent:{type:Boolean},localization:{type:String},serverTime:{type:Date},selectedPeriod:{type:String},selectedEvent:{type:Object},lineForDayDbClick:{type:Number}},inject:["addNewEvent","editEvent","copyEvent"],components:{DxPopup:To["DxPopup"],DxTextBox:rc.a,DxColorBox:f6.a,DxDateBox:Iz.a,DxTextArea:gQ.a,DxButton:cc.a,NewColorPicker:Ki,LoadingForButton:Qc},data:function(){return{nameEvent:"",currentColor:"rgba(60,115,241,1)",date:null,timeFrom:null,timeTo:null,description:"",isLoadingApi:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserInfo:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme"})),{},{dropDownOptions:function(){var t=this;return function(e){return{width:220,closeOnOutsideClick:!0,showTitle:!1,shadingColor:"transparent",wrapperAttr:{class:"dark"===t.getActiveTheme?"popupAddEvent popupTime dark":"popupAddEvent popupTime"},position:{my:"left",at:"left",of:e}}}},dropDownOptionsForDate:function(){return Object(c["a"])(Object(c["a"])({},this.dropDownOptions()),{},{width:350,wrapperAttr:{class:"dark"===this.getActiveTheme?"popupAddEvent popupDate dark":"popupAddEvent"},position:{my:"top",at:"top",of:".dateBox"}})},disabledButton:function(){return!(this.nameEvent&&this.timeFrom&&this.timeTo&&this.description)},getTitle:function(){var t;return null!==(t=this.selectedEvent)&&void 0!==t&&t.copy?this.$t("copy_event"):this.selectedEvent?this.$t("edit_event"):this.$t("add_event")},getTextButton:function(){var t;return null!==(t=this.selectedEvent)&&void 0!==t&&t.copy?this.$t("copy"):this.selectedEvent?this.$t("edit"):this.$t("add")},getPopupClass:function(){return"dark"===this.getActiveTheme?"popupAddEvent dark":"popupAddEvent"}}),watch:{selectedDay:function(){this.setDate()},timeFrom:function(t){var e=t.getTime(),i=this.timeTo.getTime();this.timeAlignment(e,i)},timeTo:function(t){var e=this.timeFrom.getTime(),i=t.getTime();this.timeAlignment(e,i)}},mounted:function(){this.setDate()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({eventHandlers:"eventsCalendar/eventHandlers"})),{},{timeAlignment:function(t,e){t>e&&(this.timeTo=new Date(t+18e5))},setColor:function(t){this.currentColor=t},setDate:function(){switch(this.selectedPeriod){case"MonthView":this.setDateByMonth();break;case"DayView":case"WeekView":this.selectedEvent?this.setDateByEvent():this.setDateByMonth();break;default:return null}},setDateByMonth:function(){var t=sL(this.serverTime,this.selectedDay,"equally");this.timeFrom=t?new Date(this.serverTime):this.selectedDay,this.timeTo=new Date(this.timeFrom.getTime()+18e5),this.date=new Date(this.selectedDay)},setDateByEvent:function(){var t=this.selectedEvent.selectedEvent;this.timeFrom=new Date(t.dateFrom),this.timeTo=new Date(t.dateTo),this.date=new Date(t.dateFrom),this.description=t.description,this.nameEvent=t.name,this.currentColor=t.data.currentColor},setBackground:function(t){var e=t.split(",");return e[e.length-1]="0.1)",e.join(",")},addOrEditEvent:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isLoadingApi=!0,s=t.getDateForEdit(t.timeFrom),a=t.getDateForEdit(t.timeTo),t.getUserInfo.id){e.next=5;break}return e.abrupt("return");case 5:if(c={userId:t.getUserInfo.id,name:t.nameEvent,description:t.description,data:JSON.stringify({currentColor:t.currentColor,background:t.setBackground(t.currentColor),dateEvent:nL(t.date)}),eventType:"Personal",dateFrom:s,dateTo:a,isDeleted:!1},t.selectedEvent||null!==(i=t.selectedEvent)&&void 0!==i&&i.copy){e.next=11;break}return e.next=9,t.addNewEvent(c);case 9:e.next=20;break;case 11:if(!t.selectedEvent||null!==(o=t.selectedEvent)&&void 0!==o&&o.copy){e.next=17;break}return c.id=t.selectedEvent.selectedEvent.id,e.next=15,t.editEvent(c);case 15:e.next=20;break;case 17:if(null===(n=t.selectedEvent)||void 0===n||!n.copy){e.next=20;break}return e.next=20,t.copyEvent(c);case 20:t.$emit("closePopupEvent",t.$refs.popupEvent),setTimeout((function(){t.isLoadingApi=!1}),300);case 22:case"end":return e.stop()}}),e)})))()},getDateForEdit:function(t){var e=t.getHours(),i=t.getMinutes(),o=this.date.getDate(),n=this.date.getMonth(),s=this.date.getFullYear();return new Date(s,n,o,e,i).toISOString()}})},v6=m6,y6=(i("d27b"),Object(C["a"])(v6,h6,p6,!1,null,null,null)),C6=y6.exports,b6=function(){var t=this,e=t._self._c;return e("DxDraggable",{ref:"eventsBlock",class:t.classDraggable,style:t.styleEvents(t.customEvent),attrs:{container:".dayContainer",dragDirection:t.dragDirection,clone:!1,"on-drag-start":t.onDragStart,"on-drag-end":t.onDragEnd,"on-drag-move":t.onDragMove,data:{line:t.line,events:t.customEvent},elementAttr:{id:t.customEvent.id}}},[e("div",{ref:"contentEvents",staticClass:"contentData"},[e("span",{staticClass:"timeEvent"},[t._v(t._s(t.getTimeEvent(t.customEvent)))]),e("span",{staticClass:"nameEvent"},[t._v(t._s(t.customEvent.name))])]),t.move?t._e():e("IconBlockEdit",{attrs:{editEvent:t.dbClickHandler,id:t.customEvent.id},on:{openPopupConfirm:t.openPopupConfirm}}),e("div",{staticClass:"resizer",on:{pointerdown:function(e){return t.onPointerdown(e,t.customEvent)}}})],1)},S6=[],P6={name:"DraggableComponent",props:{forWeek:{type:Boolean},customEvent:{type:Object},line:{type:Number},deactive:{type:Boolean},dbClickHandler:{type:Function},setRender:{type:Function}},components:{DxDraggable:Se.a,IconBlockEdit:a6},data:function(){return{move:!1,notDrag:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{dragDirection:function(){return this.forWeek?"both":"vertical"},styleEvents:function(){var t=this;return function(e){if(t.deactive)return{};var i=new Date(e.dateFrom),o=new Date(e.dateTo),n=i.getHours()+1,s=i.getMinutes(),r=document.querySelector("[data-time='".concat(n,"']")),a=r.getBoundingClientRect().height/60,c=a*s,l=(o-i)/1e3/60*a;return{left:null!==e&&void 0!==e&&e.left?e.left+"%":0,width:null!==e&&void 0!==e&&e.width?e.width+"%":"100%",background:e.data.background,borderColor:e.data.currentColor,top:c+"px",height:Math.round(l)+"px"}}},getTimeEvent:function(){return function(t){return cL(t)}},classDraggable:function(){var t="events";return"dark"===this.getActiveTheme&&(t+=" dark"),t}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({eventHandlers:"eventsCalendar/eventHandlers"})),{},{calculateForDrag:function(t){var e,i,o,n=t.fromData.events,s=new Date(n.dateFrom),r=new Date(n.dateTo),a=t.event.target,c=a.getBoundingClientRect(),l=document.querySelector("[data-time='".concat(t.fromData.line,"']")),u=l.getBoundingClientRect(),d=u.height/60,h=c.top-u.top,p=t.fromData.line+Math.floor(h/u.height)-1;if(this.forWeek){var g=document.querySelector(".dayWeek").getBoundingClientRect().width,f=this.$parent.$parent.$refs.timeline.$el.getBoundingClientRect().width,m=c.left,v=this.$parent.$parent.$refs.contentWeek.getBoundingClientRect().left+f,y=Math.ceil((m-v)/(g-1));i=document.querySelector(".dayWeek[data-cell='".concat(y,"']")),e=i&&i.querySelector("[data-time='".concat(p+1,"']"))}else e=document.querySelector("[data-time='".concat(p+1,"']"));if(!e)return null===(o=document.querySelector(".dropActive"))||void 0===o||null===(o=o.classList)||void 0===o||o.remove("dropActive"),{noDrop:!0};var C,b=e.getBoundingClientRect(),S=-1*(b.top-c.top)/d,P=r.getTime()-s.getTime();if(this.forWeek){var T=new Date(i.dataset.date);C=new Date(T.getFullYear(),T.getMonth(),T.getDate(),p,Math.floor(S))}else C=new Date(s.getFullYear(),s.getMonth(),s.getDate(),p,Math.floor(S));var x=new Date(C.getTime()+P);return{events:n,minutes:S,hours:p,timeInterval:P,dateFrom:C,dateTo:x,dropBlock:e}},createPostObject:function(t){var e=t.events,i=t.dateFrom,o=t.dateTo,n=JSON.parse(JSON.stringify(e));return n.dateFrom=i.toISOString(),n.dateTo=o.toISOString(),n.data.dateEvent=this.forWeek?nL(i):n.data.dateEvent,n.data=JSON.stringify(n.data),n},setTextContent:function(t){var e=t.target,i=t.dateFrom,o=t.dateTo,n=t.nameEvent,s=e.querySelector(".timeEvent"),r=e.querySelector(".nameEvent");s.textContent="".concat(cL({dateFrom:i,dateTo:o})),r.textContent="".concat(n)},onDragStart:function(t){this.notDrag?t.cancel=!0:(this.move=!0,t.event.target.style.zIndex=17)},onDragMove:function(t){var e=this.calculateForDrag(t),i=e.events,o=e.dateFrom,n=e.dateTo,s=e.noDrop,r=e.dropBlock;if(!s){var a;if(this.forWeek)null===(a=document.querySelector(".dropActive"))||void 0===a||null===(a=a.classList)||void 0===a||a.remove("dropActive"),r.classList.add("dropActive");var c=i.name,l=t.event.target,u=this.getDateToForDrag({dateFrom:o,dateTo:n});this.setTextContent({target:l,dateFrom:o,dateTo:u,nameEvent:c})}},onDragEnd:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,c,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.move=!1,n=e.calculateForDrag(t),s=n.events,a=n.dateFrom,c=n.dateTo,l=n.noDrop,null===(o=document.querySelector(".dropActive"))||void 0===o||null===(o=o.classList)||void 0===o||o.remove("dropActive"),!l){i.next=6;break}return e.setRender(),i.abrupt("return");case 6:return u=e.getDateToForDrag({dateFrom:a,dateTo:c}),d=e.createPostObject({events:s,dateFrom:a,dateTo:u}),i.next=10,e.eventHandlers(d);case 10:case"end":return i.stop()}}),i)})))()},onPointerdown:function(t,e){var i=this;this.notDrag=!0;var o,n=document.querySelector(".dayContainer"),s=t.target.closest(".events"),c=document.querySelector(".timeLine");n.style.cursor="row-resize",s.style.cursor="row-resize";var l=s.getBoundingClientRect(),u=l.bottom,d=l.height,h=u-t.pageY,p=c.getBoundingClientRect().height/60,g=d/p,f=(new Date(e.dateTo)-new Date(e.dateFrom))/1e3/60,m=f0&&void 0!==t[0]&&t[0],e.activated){i.next=3;break}return i.abrupt("return");case 3:for(e.daysForWeek=[],n=eL(new Date(e.year,e.month,e.day),e.localization),s=e.weekdays.indexOf(n.toLowerCase()),a=e.day-s,c=0;c0&&(c%6===0||(c+1)%6===0),u=new Date(e.year,e.month,a+c),d=u.getDate(),h=1===d&&tL(u,e.language),e.daysForWeek.push({date:u,numberDay:d,isWeekend:l,monthName:h,today:e.getToday(d)});if(p=e.daysForWeek[0].date,!sL(p,e.serverTime,"less")||o){i.next=12;break}return i.next=12,e.postEventsFromData({from:p});case 12:case"end":return i.stop()}}),i)})))()}}},I6=k6,B6=(i("39325"),Object(C["a"])(I6,R8,W8,!1,null,"3ae12486",null)),M6=B6.exports,$6={name:"EventCalendar",props:{events:{type:Array},isLoading:{type:Boolean},currentPeriod:{type:String,default:"DayView"},editOne:{type:Boolean,default:!1},editTwo:{type:Boolean,default:!1}},components:{HeaderCalendar:h8,WeekDays:y8,DayView:D6,WeekView:M6,MonthView:M8,YearView:j8,PopupAddEvent:C6,DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{nav:0,week:{ru:["пн","вт","ср","чт","пт","сб","вс"],en:["mon","tue","wed","thu","fri","sat","sun"]},selectedDay:null,selectedPeriod:this.currentPeriod,basicDate:null,currentDate:null,day:null,month:null,year:null,valueCalculation:0,localization:{ru:"ru-RU",en:"en-US"},visiblePopupEvent:!1,selectedEvent:null,lineForDayDbClick:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getServerTime:"serverTime/getServerTime",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme"})),{},{periods:function(){return[{value:this.$t("day"),component:"DayView"},{value:this.$t("week"),component:"WeekView"},{value:this.$t("month"),component:"MonthView"},{value:this.$t("year"),component:"YearView"}]},getEventsCalendar:function(){return this.events},classForLoading:function(){return["loadingCalendar",{dark:"dark"===this.getActiveTheme}]},getLanguage:function(){var t;return(null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code)||"en"},serverTime:function(){var t,e=(new Date).toString();return new Date((null===(t=this.getServerTime)||void 0===t?void 0:t.now)||e)},weekdays:function(){return this.week[this.getLanguage]},getLocalization:function(){return this.localization[this.getLanguage]},darkClass:function(){return{dark:"dark"===this.getActiveTheme}},getMonth:function(){return new Date(this.year,this.month,this.day).toLocaleDateString(this.getLocalization,{month:"long"})},propsEvents:function(){return{DayView:{dayViewClickHandler:this.dayViewClickHandler,doubleClickAddEvent:this.doubleClickAddEvent,editEvent:this.editEvent,clickButtonAddEvent:this.clickButtonAddEvent},WeekView:{doubleClickAddEvent:this.doubleClickAddEvent,editEvent:this.editEvent,clickButtonAddEvent:this.clickButtonAddEvent},MonthView:{clickButtonAddEvent:this.clickButtonAddEvent},YearView:{goToDay:this.goToDay}}}}),watch:{valueCalculation:function(){this.currentDate=new Date(this.basicDate.toString()),0!==this.nav?this.setData():this.currentDate=new Date(this.basicDate.toString()),this.day=this.currentDate.getDate(),this.month=this.currentDate.getMonth(),this.year=this.currentDate.getFullYear()},selectedPeriod:function(){this.popupEventToggle(!1)}},mounted:function(){this.basicDate=this.serverTime,this.currentDate=this.serverTime,this.day=this.serverTime.getDate(),this.month=this.serverTime.getMonth(),this.year=this.serverTime.getFullYear()},deactivated:function(){this.popupEventToggle(!1)},methods:{setData:function(){switch(this.selectedPeriod){case"DayView":this.currentDate.setDate(this.currentDate.getDate()+this.nav);break;case"WeekView":this.currentDate.setDate(this.currentDate.getDate()+7*this.nav);break;case"MonthView":this.currentDate.setMonth(this.basicDate.getMonth()+this.nav);break;case"YearView":this.currentDate.setFullYear(this.currentDate.getFullYear()+this.nav);break;default:return null}},navigation:function(t){this.nav=this.nav+t,this.beginTimeCalculation()},goToCurrentDay:function(){this.basicDate=new Date(this.serverTime),this.editBasicDate(this.basicDate),this.beginTimeCalculation()},periodChanged:function(t){var e=t.value,i=t.previousValue;this.selectedPeriod=e,this.editPeriod({value:e,previousValue:i})},beginTimeCalculation:function(){this.valueCalculation=this.valueCalculation+1},editBasicDate:function(t){this.currentDate=new Date(t.toString()),this.nav=0},dateComparison:function(){var t=new Date(this.serverTime).getDate(),e=new Date(this.serverTime).getMonth(),i=new Date(this.serverTime).getFullYear(),o=new Date(this.year,this.month,t);return new Date(i,e,t).getTime()===o.getTime()},editPeriod:function(t){var e=t.previousValue,i=this.dateComparison()||["DayView"].includes(e)?this.day:1;this.basicDate=new Date(this.year,this.month,i),this.editBasicDate(this.basicDate),this.beginTimeCalculation()},dayViewClickHandler:function(t){this.nav=0,this.basicDate=new Date(t.year,t.month,t.numberDay),this.beginTimeCalculation()},popupEventToggle:function(t){this.visiblePopupEvent=t},doubleClickAddEvent:function(t,e){this.lineForDayDbClick=t;var i=e.getFullYear(),o=e.getMonth(),n=e.getDate();this.selectedDay=new Date(i,o,n,t-1,0,0,0),this.popupEventToggle(!0)},editEvent:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.selectedEvent={copy:i,selectedEvent:this.getEventsCalendar.find((function(e){return e.id.toString()===t.toString()}))},this.selectedDay=new Date(e.toString()),this.popupEventToggle(!0)},clickButtonAddEvent:function(t){this.selectedDay=new Date(t.year,t.month,t.numberDay,9,0),this.popupEventToggle(!0)},hiddenPopupEvent:function(){this.popupEventToggle(!1),this.selectedEvent=null},closePopupEvent:function(t){var e=this;t.instance.hide().then((function(){e.popupEventToggle(!1),e.selectedEvent=null}))},goToDay:function(t){var e=this;this.selectedPeriod="DayView",this.$nextTick((function(){e.basicDate=new Date(t.year,t.month,t.numberDay),e.currentDate=new Date(e.basicDate.toString())}))}}},L6=$6,F6=(i("633e"),Object(C["a"])(L6,s8,r8,!1,null,"1a34f035",null)),j6=F6.exports,R6={name:"UserProfileMyWorldTab",components:{EventCalendar:j6},provide:function(){return{addNewEvent:this.eventApiHandler,editEvent:this.eventApiHandler,copyEvent:this.eventApiHandler,deleteEvent:this.deleteEvent,postEventsFromData:this.postEventsFromData}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getEventsCalendar:"eventsCalendar/getEventsCalendar",getLeftSideBar:"userSettings/getLeftSideBar",getRightSideBar:"userSettings/getRightSideBar"})),{},{isLoadingCalendar:function(){return null===this.getEventsCalendar}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({eventHandlers:"eventsCalendar/eventHandlers",postEvents:"eventsCalendar/postEvents"})),{},{eventApiHandler:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.eventHandlers(t);case 2:o=i.sent,n=Object(D["a"])(o,1),n[0];case 6:case"end":return i.stop()}}),i)})))()},deleteEvent:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=JSON.parse(JSON.stringify(e.getEventsCalendar.find((function(e){return e.id===t})))),o.isDeleted=!0,o.data=JSON.stringify(o.data),i.next=5,e.eventApiHandler(o);case 5:case"end":return i.stop()}}),i)})))()},postEventsFromData:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.postEvents(t);case 2:case"end":return i.stop()}}),i)})))()}})},W6=R6,N6=(i("097b"),Object(C["a"])(W6,o8,n8,!1,null,"1441b0f4",null)),E6=N6.exports,U6={name:"UserCentralPart",components:{UserProfileCentralPartTopBar:W1,UserProfileAboutUserTab:i8,UserProfileMyWorldTab:E6,UserProfileIncomeTab:V3},props:{loadedSessionTableData:{type:Boolean},userData:{type:Object,default:function(){return{}}},signalsBroker:{type:Array},isSignalsBroker:{type:Boolean},isContentBroker:{type:Boolean},isLoadingGetSignals:{type:Boolean},contentSubscribed:{type:Boolean},activeTab:{type:String},symbol:{type:String}},data:function(){return{tabButtons:L1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{propsComponent:function(){return{UserProfileAboutUserTab:{userData:this.userData,signalsBroker:this.signalsBroker,isSignalsBroker:this.isSignalsBroker},UserProfileTradingTab:{symbol:this.symbol}}}})},V6=U6,H6=(i("a62d"),Object(C["a"])(V6,O1,w1,!1,null,"712b05f4",null)),G6=H6.exports,q6=function(){var t=this,e=t._self._c;return e("div",{staticClass:"WelcomeModal"},[e("img",{attrs:{src:t.getSvgIcon}}),e("div",{staticClass:"WelcomeModal-content"},[e("div",{staticClass:"WelcomeModal-title"},[t._v(t._s(t.$t(t.getTitlesModals))),e("div",{staticClass:"WelcomeModal-close",on:{click:t.hideWelcome}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"WelcomeModal-welcomeText"},t._l(t.getTextModals,(function(i,o){return e("p",[t._v(t._s(t.$t(i)))])})),0),e("div",{staticClass:"WelcomeModal-noShow"},[e("div",{staticClass:"WelcomeModal-noShowCheckbox"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.noMoreVisible,expression:"noMoreVisible"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.noMoreVisible)?t._i(t.noMoreVisible,null)>-1:t.noMoreVisible},on:{change:function(e){var i=t.noMoreVisible,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.noMoreVisible=i.concat([s])):r>-1&&(t.noMoreVisible=i.slice(0,r).concat(i.slice(r+1)))}else t.noMoreVisible=n}}})]),e("div",{staticClass:"WelcomeModal-noShowText"},[t._v(t._s(t.$t("dsam")))])])])])},z6=[],Y6={props:{routeName:{type:String}},data:function(){return{noMoreVisible:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession"})),{},{getSrcWelcomeSvg:function(){return i("1c2d")},getSrcProfileSvg:function(){return i("6a64")},getSrcPortfoliosSvg:function(){return i("395d")},getSrcTopsSvg:function(){return i("8119")},getSrcReportSvg:function(){return i("3729")},getTitlesModals:function(){var t={Trading:"market_section",Profile:"profile_section",Tops:"tops_section",Portfolios:"portfolio_section",Report:"report_section"};return t[this.routeName]},getTextModals:function(){var t={Trading:["tsdas","stmaiy","uasofg","otssb"],Profile:["tscia"],Tops:["apgit","tbpft"],Portfolios:["tscds","ycsup"],Report:["trscd","sota","hotoo","trading_analytics","iastt","iotus","feoua"]};return t[this.routeName]},getSvgIcon:function(){var t={Trading:this.getSrcWelcomeSvg,Profile:this.getSrcProfileSvg,Tops:this.getSrcTopsSvg,Portfolios:this.getSrcPortfoliosSvg,Report:this.getSrcReportSvg};return t[this.routeName]}}),methods:{hideWelcome:function(){this.noMoreVisible&&this.$store.commit("userSettings/redactWelcomeModals",{name:this.routeName}),this.$emit("hideWelcome",this.routeName)}}},X6=Y6,Q6=(i("36b7"),Object(C["a"])(X6,q6,z6,!1,null,null,null)),J6=Q6.exports,K6={name:"UserProfile",components:{Layout:oV,VuePerfectScrollbar:Xt.a,UserCentralPart:G6,UserLeftBar:x1,UserRightBar:RZ,WelcomeModals:J6,DxPopup:wt["DxPopup"]},props:{accountId:{type:String},userId:{type:String}},provide:function(){return{goToSelectedTab:this.goToSelectedTab}},data:function(){return{loadedSessionTableData:!1,usingTools:null,activeDate:null,signalsBroker:[],userData:null,isSignalsBroker:!1,isContentBroker:!1,isLoadingGetSignals:!0,activeTab:"",statusWelcomeModal:!1,keyWelcome:(new Date).getTime()}},watch:{getServerTime:function(t){t&&(this.activeDate||(this.activeDate=this.getServerTime.now),this.checkDateForUpdateStatistic())},"$route.query.accountId":{handler:function(){location.reload()},deep:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getUsingAccountContracts:"contracts/getUsingAccountContracts",getOrdersPanel:"modal/getOrdersPanel",getUserInfo:"user/getUserDetail",getWelcomsModals:"userSettings/getWelcomsModals",apiUri:"api/api",getServerTime:"serverTime/getServerTime",getStatistics:"statistic/getStatistics",getContentSubscribed:"cart/getContentSubscribed",activeContract:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus"})),{},{contentSubscribed:function(){var t=this;return Boolean(this.getContentSubscribed.length>0&&this.getContentSubscribed.find((function(e){var i;return e.contentId===(null===(i=t.userData)||void 0===i?void 0:i.id)})))},getStatus:function(t){t&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Profile"===t})):!this.getWelcomsModals.length)}}),methods:{hideWelcome:function(){this.statusWelcomeModal=!1},setActiveTab:function(t){this.activeTab=t},checkDateForUpdateStatistic:function(){new Date(this.activeDate).getHours()!==new Date(this.getServerTime.utcNow).getHours()&&(this.$store.dispatch("statistic/getStatisticByAccountsForDay",this.accountId),this.activeDate=this.getServerTime.utcNow),new Date(this.activeDate).getDate()!==new Date(this.getServerTime.utcNow).getDate()&&(this.$store.dispatch("statistic/getStatisticByAccounts",[this.accountId]),this.activeDate=this.getServerTime.utcNow)},addHashToLocation:function(t){history.pushState({},null,this.$route.path+"#"+encodeURIComponent(t))},getUsingContractsByAccount:function(){var t=this;this.$http.post(this.apiUri+"AccountContracts",JSON.stringify({accountsIds:[this.accountId]}),{headers:{"Content-Type":"application/json"}}).then((function(e){e.data.length?t.usingTools=e.data[0].allContracts:t.usingTools=[],t.$store.dispatch("contracts/LoadUsingAccountContracts",t.usingTools)}))},getHistoryOrdersForAccount:function(){this.$store.commit("contracts/setStatusByOrders",!1);var t={Command:"HistoryOrders",Data:{accountId:this.accountId,filter:{orderTypes:["All"],startTime:null,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setUserAndAccountData:function(){sessionStorage.setItem("userProfileInfo",JSON.stringify({userId:this.userId,accountId:this.accountId}))},getDataForProfit:function(){var t={Command:"AccountProfitByHourse",Data:{accountId:this.accountId,byContract:!0,CurrentOnly:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHendler:function(t){if(t&&t.command&&"HistoryOrders"===t.command){var e=JSON.parse(t.data);this.accountId===e[0]&&(this.$orderStorage.setOrdersToStorage(e),this.loadedSessionTableData=!this.loadedSessionTableData,this.$store.commit("contracts/setStatusByOrders",!0))}else if(t&&t.command&&"None"===t.command){if("OrderExecution"===t.data.dataType&&this.$orderStorage.getOrdersOnStorage()){var i=JSON.parse(t.data.data);"TrailingSL"===i.Message&&this.$orderStorage.setOrderTrailingSL(i)}}else if(t&&t.command&&"GetStatisticsByAccounts"===t.command)this.accountId===t.data[0].account.id&&(this.$store.commit("statistic/setStatistics",t.data),this.$store.commit("statistic/setOrdersStatistics",t.data));else if(t&&t.command&&"AccountsDetails"===t.command)this.getDefaultAccount.id===this.accountId&&this.updateStatistic(t.data);else if(t&&t.command&&"GetAccountDailyByHourse"===t.command)this.$store.commit("statistic/setStatisticsByDay",t.data);else if("BrokerPosition"===(null===t||void 0===t?void 0:t.command))this.accountId===t.data.accountId&&(this.$orderStorage.setUserOrder(t.data),this.getUsingAccountContracts&&this.getUsingAccountContracts.find((function(t){return t.contract===t}))||this.getUsingContractsByAccount());else if(t&&t.command&&"AccountProfitByHourse"===t.command){var o=JSON.parse(t.data);o.length&&o[0][6]&&sessionStorage.setItem("contractStatisitics",t.data)}},updateStatistic:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id}));this.$store.commit("statistic/updateAccountDailyStatistic",i),this.$store.commit("statistic/updateStatistic",i),this.$store.commit("statistic/updateStatisticDay",i),this.$store.commit("statistic/updateStatisticYear",i)},getAlienProfileData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("".concat(t.apiUri,"UserAccountsInfoSimpleSingle"),{params:{accountid:t.$route.query.accountId}});case 2:i=e.sent,o=i.data,t.userData=o.ttUser;case 5:case"end":return e.stop()}}),e)})))()},getSourcesByAccount:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,s;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,i.$http.get("".concat(i.apiUri,"Subscription/Sources"),{params:{ID:t,type:"Account"}});case 2:return n=o.sent,s=n.data,i[e]=s,o.abrupt("return",s);case 6:case"end":return o.stop()}}),o)})))()},clearSessionStorge:function(){sessionStorage.removeItem("userProfileInfo"),sessionStorage.removeItem("contractStatisitics")},getUserContent:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.$http.get("".concat(e.apiUri,"UserContent"),{params:{userId:t}});case 2:return o=i.sent,n=o.data,i.abrupt("return",Object(c["a"])(Object(c["a"])({},n),{},{content:n.content?JSON.parse(n.content):[]}));case 5:case"end":return i.stop()}}),i)})))()},goToSelectedTab:function(t){this.activeTab=t}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.activeTab=localStorage.getItem("activeTabUserProfile")||"UserProfileIncomeTab",sessionStorage.getItem("contractStatisitics")&&sessionStorage.removeItem("contractStatisitics"),t.getServerTime&&(t.activeDate=t.getServerTime.utcNow),t.$socketStream.$on("apiWS3",t.setMessageHendler),t.$socketStream.events.subscribe("apiWS_NOTI",t.setMessageHendler),t.$socketStream.events.subscribe("apiWS",t.setMessageHendler),t.setUserAndAccountData(),t.getStatistics||t.$store.dispatch("statistic/getStatisticByAccounts",[t.accountId]),t.$store.dispatch("statistic/getStatisticByAccountsForDay",t.accountId),t.getDataForProfit(),t.getHistoryOrdersForAccount(),t.getUsingContractsByAccount(),t.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:t.$route.query.accountId}),t.myProfile){e.next=26;break}return e.next=16,t.getAlienProfileData();case 16:return e.next=18,t.getSourcesByAccount(t.$route.query.accountId,"signalsBroker");case 18:return i=e.sent,e.next=21,t.getUserContent(t.userData.id);case 21:o=e.sent,n=(null===o||void 0===o?void 0:o.content)||{},s=n.acceptBlogs,a=n.acceptGroups,c=n.acceptStreams,l=n.acceptWebinars,t.isSignalsBroker=Boolean(null===i||void 0===i?void 0:i.length),t.isContentBroker=[s,a,c,l].some(Boolean),t.isLoadingGetSignals=!1;case 26:t.getStatus&&(t.statusWelcomeModal=t.getWelcomsModals.length?!t.getWelcomsModals.some((function(t){return"Profile"===t})):!t.getWelcomsModals.length);case 27:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.getOrdersPanel.status&&this.$store.dispatch("modal/switchOrdersPanel",{status:!1,data:null}),this.$socketStream.$off("apiWS3",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS_NOTI",this.setMessageHendler),this.clearSessionStorge()}},Z6=K6,t7=(i("68fe"),Object(C["a"])(Z6,BR,MR,!1,null,"764e57d8",null)),e7=t7.exports,i7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StrategiesNew",class:t.darkClass},[e("div",{staticClass:"wrapperStrategies",class:{visibility:t.getStatusProgress}},[e("CardReadyMadeSolution",{attrs:{topPortfolios:t.topPortfolios,statDataReadyMadeSolution:t.statDataReadyMadeSolution,accountsArr:t.accountsArr,buttonsValue:t.buttonsValue,getStatusProgress:t.getStatusProgress,traders:t.traders,theBestFiveTraders:t.theBestFiveTraders,skipCount:t.skipCount,getPages:t.getPages,setButtonsValue:t.setButtonsValue,getAccounts:t.getAccounts,getProgress:t.getProgress,isVisiblePreloader:t.isVisiblePreloader,alertMessage:t.alertMessage,toTop:t.toTop,startRender:t.startRender,defaultFilterByTraders:t.defaultFilterByTraders,instrumentType:t.instrumentType,emptyProvider:t.emptyProvider},on:{progressLoaded:t.progressLoaded}})],1),t.visiblePopup?e("ModalPortfolioExperts",t._b({attrs:{visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}},"ModalPortfolioExperts",t.modalData,!1)):t._e(),e("DxPopup",{attrs:{width:"588px",height:"368px",shading:!1,visible:t.statusWelcomeModal,showTitle:!1}},[e("WelcomeModals",{attrs:{routeName:"Tops"},on:{hideWelcome:t.hideWelcome}})],1)],1)},o7=[],n7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopBarStrategies",class:t.darkClass},[e("ButtonGroup",{staticClass:"viewButtons",attrs:{buttons:t.buttonsView,active:t.appearance},on:{clickHandler:function(e){return t.selectingSection(e,"appearance")}}}),e("ButtonGroup",{staticClass:"buttonsExperts",attrs:{active:t.whoAreWeShowing,buttons:t.buttonsExperts},on:{clickHandler:function(e){return t.selectingSection(e,"whoAreWeShowing")}}}),e("div",{staticClass:"wrapperSelectBox"},[e("span",{staticClass:"label"},[t._v("Успешныx сделок")]),e("DxSelectBox",{key:t.isReadyMadeSolution,attrs:{"display-expr":"title","value-expr":"value",value:t.percentInterval,width:100,height:32,"drop-down-options":t.getDropDownOptionsInterval,items:t.percentageList,elementAttr:{class:"selectBoxPercent"},hoverStateEnabled:!1},on:{itemClick:t.itemClickSelectBoxInterval}})],1),e("div",{staticClass:"wrapperSelectBox"},[e("span",{staticClass:"label"},[t._v("Инструменты")]),e("DxSelectBox",{key:t.symbolList.length,ref:"symbol",attrs:{"display-expr":"value",value:t.symbolSelect,width:100,height:32,"drop-down-options":t.getDropDownOptionsInterval,"data-source":t.symbolList,elementAttr:{class:"selectBoxPercent"},hoverStateEnabled:!1},on:{itemClick:t.itemClickSelectBox}})],1),t.isReadyMadeSolution?t._e():e("div",{staticClass:"cartProviderBlock",on:{click:t.openModal}},[e("div",{staticClass:"number"},[t._v(t._s(t.countPortfolio))]),e("svgIcon",{attrs:{name:"RegPartner",color:t.getColorIcon}}),e("div",{staticClass:"text"},[t._v("Портфель")]),e("div",{staticClass:"imgFacesBlock"},[e("transition-group",{attrs:{name:"listImg",tag:"p"}},t._l(t.expertsFace,(function(t,i){return e("img",{key:i,attrs:{src:t}})})),0),t.countPortfolio>5?e("span",{staticClass:"elipsis"},[t._v("...")]):t._e()],1)],1),t.isReadyMadeSolution?t._e():e("div",{staticClass:"searchBlock"},[e("div",{staticClass:"iconContainer"},[e("svgIcon",{attrs:{name:"Search-mini",color:t.getColorIcon}})],1),e("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.search,expression:"search",modifiers:{trim:!0}},{name:"debounce",rawName:"v-debounce:3s.unlock",value:t.setSearchString,expression:"setSearchString",arg:"3s",modifiers:{unlock:!0}}],staticClass:"search",attrs:{type:"text",placeholder:t.filterSearch.value},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}}),e("DxDropDownButton",{attrs:{displayExpr:"value","key-expr":"id",items:t.itemsForSearch,activeStateEnabled:!0,"drop-down-options":t.getDropDownOptions,"element-attr":{class:"dropdownSearch"},hoverStateEnabled:!1},on:{"item-click":t.onItemClick}})],1),e("DxTooltip",{attrs:{visible:t.tooltipVisible,target:".cartProviderBlock",position:"bottom",animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Добавьте в портфель экспертов")]),t.visiblePopup?e("ModalPortfolioExperts",{attrs:{visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}}):t._e()],1)},s7=[],r7=[{id:1,title:"Все",value:{from:0,to:100}},{id:2,title:"50% > ",value:{from:50,to:100}},{id:3,title:"60% >",value:{from:60,to:100}},{id:4,title:"70% >",value:{from:70,to:100}},{id:5,title:"80% >",value:{from:80,to:100}},{id:6,title:"90% >",value:{from:90,to:100}},{id:7,title:"100%",value:{from:100,to:100}}],a7={name:"TopBarStrategies",mixins:[xt,Ot,KU],components:{ButtonGroup:WP,DxDropDownButton:x$.a,ModalPortfolioExperts:JU,DxTooltip:Pt["DxTooltip"],DxSelectBox:Bo.a},props:{getStatusProgress:{type:Boolean},isReadyMadeSolution:{type:Boolean}},data:function(){return{percentInterval:r7[0].value,symbolSelect:{},search:"",filterSearch:{},appearance:"blocks",whoAreWeShowing:"providers",tooltipVisible:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({countPortfolio:"expertsPortfolio/countPortfolio",expertsFace:"expertsPortfolio/expertsFace",getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary"})),{},{percentageList:function(){return r7},buttonsView:function(){return[{id:"blocks",icon:"Windows4"},{id:"rows",icon:"SortLine"}]},buttonsExperts:function(){return[{id:"providers",title:"Провайдеры",icon:"Provider"},{id:"tops",icon:"RegPartner",title:"Топы"}]},itemsForSearch:function(){return[{id:"fioSubstring",value:"по имени/фамилии"},{id:"loginSubstring",value:"по логину"},{id:"emailSubstring",value:"по email"}]},getDropDownOptions:function(){return{wrapperAttr:{class:"listDropdownTopBarStrategies ".concat(this.darkClass.dark?"dark":"")},width:130}},getDropDownOptionsInterval:function(){return{maxHeight:350,wrapperAttr:{class:"listDropdownInterval ".concat(this.darkClass.dark?"dark":"")}}},animationConfig:function(){return{show:{type:"pop",from:{scale:.8,opacity:0},to:{scale:1,opacity:1}},hide:{type:"pop",from:{scale:1,opacity:1},to:{scale:.8,opacity:0}}}},symbolList:function(){var t=this.getUserQuotesLibrary.map((function(t){return{id:t,value:t}}));return[{id:"all",value:"Все"}].concat(Object(x["a"])(t))}}),mounted:function(){var t=Y$();if(t.length>0){var e=t.map((function(t){return{avatar:t.avatar,iAmProvider:t.iAmProvider,login:t.login,sources:t.sources,symbol:t.symbol,traderName:t.traderName,uniqueId:t.uniqueId}}));this.$store.dispatch("expertsPortfolio/setExpert",e)}this.filterSearch=this.itemsForSearch[0],0===Object.keys(this.symbolSelect).length&&this.symbolList.length>0&&(this.symbolSelect=this.symbolList[0])},watch:{symbolList:function(){this.symbolSelect=this.symbolList[0]},isReadyMadeSolution:function(){this.symbolSelect=this.symbolList[0]}},methods:{selectingSection:function(t,e){this[e]=t.id,this.$emit("setButtonsValue",{data:t,field:e})},onItemClick:function(t){this.filterSearch=t.itemData,this.search&&this.setSearchString()},setSearchString:function(){var t=Object(Vt["a"])({},this.filterSearch.id,this.search);this.$emit("setParamFiltering",t)},openModal:function(){var t=this;this.getStatusProgress&&(this.countPortfolio>0?this.visiblePopup=!0:(this.tooltipVisible=!0,setTimeout((function(){t.tooltipVisible=!1}),2e3)))},itemClickSelectBox:function(t){this.symbolSelect=t.itemData;var e="all"!==t.itemData.id?t.itemData.value:null;this.$emit("setParamFiltering",{contract:e})},itemClickSelectBoxInterval:function(t){var e=t.itemData.value,i=e.from,o=e.to;this.$emit("setParamFiltering",{ProcPosOrdersFrom:i,ProcPosOrdersTo:o})}}},c7=a7,l7=(i("180f"),i("9ddc"),Object(C["a"])(c7,n7,s7,!1,null,"1cfc6b10",null)),u7=l7.exports,d7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CardExpertStrategies",class:t.rootClass},[e("transition-group",{attrs:{name:"fade",appear:""}},[t.emptyProvider?e("div",{key:"noData",staticClass:"noData"},[e("div",{staticClass:"wrapperSvg"},[e("svgIcon",t._b({},"svgIcon",t.iconBigData,!1))],1),t._v(t._s(t.$t("no_data")))]):t.isVisiblePreloader?e("div",{key:"preloader",staticClass:"containerPreloader"},[e("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,progress:t.getProgress,message:t.alertMessage,enabledMessage:!1,icon:!1}})],1):t._e()]),e("div",{directives:[{name:"show",rawName:"v-show",value:"100"===t.getProgress,expression:"getProgress === '100'"}]},[e("transition-group",{attrs:{name:"fade",appear:""}},[e("div",{key:"wrapperCard",ref:"flatTable",staticClass:"wrapperCard"},t._l(t.traders,(function(i,o){return e("ExpertInfoStat",{key:i.login,attrs:{infoAccount:i,isRows:t.isRows,rowsClass:t.rowsClass,symbol:t.symbol,indexCard:o,skipCount:t.skipCount,isVisiblePreloader:t.isVisiblePreloader,hoveredCard:t.hoveredCard},on:{setDataForGraph:t.setDataForGraph,progressLoaded:t.progressLoaded,changeClass:t.changeClass,changeData:t.changeData,openModalSelectPortfolio:t.openModalSelectPortfolio}})})),1)])],1),e("div",{staticClass:"pagination"},[e("Paginator",{attrs:{pages:t.getPages,toTop:t.toTop},on:{scrollTop:t.onScrollTop,setPage:function(e){return t.getAccounts(e)}}})],1),e("DxTooltip",{attrs:{visible:t.tooltipVisible,target:".cartProviderBlock",position:"bottom",animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Добавьте в портфель экспертов")]),t.popupVisible?e("DxPopup",{attrs:{visible:t.popupVisible,"drag-enabled":!1,closeOnOutsideClick:!0,"show-title":!1,position:t.positionPopup,shading:!1,width:t.portfolioSelectionView?250:"auto",height:"auto",container:"body",wrapperAttr:t.wrapperAttrPopup},on:{hidden:t.hidePopup}},[t.portfolioSelectionView?e("PortfolioSelection",{attrs:{portfolio:t.getPortfolioOnlyStatusCreated,refFunctionAddToDraft:t.refFunctionAddToDraft,login:t.login,nameProvider:t.nameProvider,imgFly:t.imgFly,symbol:t.symbol},on:{hiddenModal:t.hidePopup}}):e("ChoiceActionByPortfolio",{attrs:{portfolios:t.getPortfolioOnlyStatusCreated,portfolioId:t.portfolioId},on:{hiddenModal:t.hidePopup}})],1):t._e()],1)},h7=[],p7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ExpertInfoStat"},[e("transition",{attrs:{mode:"out-in",css:!1},on:{"before-enter":t.beforeEnter,enter:t.enter,"before-leave":t.beforeLeave,leave:t.leave,"after-leave":t.afterLeave}},[t.isRows?e("div",{key:"rowsContainer",staticClass:"rowsContainer"},[e("Row",t._b({attrs:{addInCartProvider:t.addInCartProvider}},"Row",t.props,!1))],1):e("div",{key:"cardContainer",staticClass:"cardContainer"},[e("Card",t._b({ref:"card",attrs:{addInCartProvider:t.addInCartProvider,symbol:t.symbol}},"Card",t.props,!1))],1)])],1)},g7=[],f7=function(){var t=this,e=t._self._c;return e("div",{ref:"card",staticClass:"OneCard",class:t.rootClass},[e("HeaderCard",{attrs:{infoAccount:t.infoAccount,countSubscribers:t.countSubscribers}}),e("BodyCard",{attrs:{infoAccount:t.infoAccount,avgProfitOnOrder:t.avgProfitOnOrder,roi:t.roi,totalClosedOrders:t.totalClosedOrders,ordersClosedProfit:t.ordersClosedProfit,successfulPercent:t.successfulPercent,assetsUnderManagement:t.assetsUnderManagement,profitSubscribers:t.profitSubscribers,countSubscribers:t.countSubscribers,signals:t.signals,widthCard:t.widthCard,symbol:t.symbol,isVisiblePreloader:t.isVisiblePreloader}}),e("footer",[e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){return t.mouseEnterHandler(e,t.textTooltip[0])},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{disabled:t.disabledButtonCopy||t.loadingCreatedByAddCard||t.isLoadingStart,icon:t.iconDataCopy},on:{toggle:t.openModalCopy}},[t.isLoadingStart?t._e():e("div",{staticClass:"textPricePercent"},[t._v(t._s(t.priceAndPercent))]),t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1),e("div",{staticClass:"wrapButton",on:{mouseenter:function(e){return t.mouseEnterHandler(e,t.textTooltip[1])},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{class:t.classForAddInCart,attrs:{icon:t.iconDataPlus,disable:t.disabledButtonAdd||t.loadingCreatedByAddCard||t.isLoadingStart||t.getIsReal},on:{toggle:t.addInCartProviderHandler}},[t.loadingCreatedByAddCard?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))])],1)},m7=[],v7=function(){var t=this,e=t._self._c;return e("header",{staticClass:"HeaderCard",class:t.darkClass},[e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{ref:"img",class:"img".concat(t.infoAccount.index)},[e("Avatar",{attrs:{src:t.infoAccount.avatar,size:"3.9",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"nameAndAccount",on:{click:t.goToProfile}},[e("div",{staticClass:"name",class:"name_".concat(t.getActiveTheme)},[e("svgIcon",t._b({},"svgIcon",t.iconProvider,!1)),e("div",{staticClass:"textName",class:"textName_".concat(t.getActiveTheme)},[t._v(t._s(t.infoAccount.traderName))])],1),e("div",{staticClass:"account"},[e("div",{staticClass:"wrapAccountNumber"},[e("div",{staticClass:"leftPart",class:t.groupClass},[t._v(t._s(t.infoAccount.accountGroup)+":")]),e("div",{staticClass:"rightPart"},[e("span",{staticClass:"number"},[t._v(t._s(t.infoAccount.sequenceId))])])])])]),e("div",{staticClass:"favorite",on:{click:t.saveOrDeleteFavorite}},[e("svgIcon",t._b({},"svgIcon",t.favoriteIcon,!1))],1)])},y7=[],C7={name:"HeaderCard",mixins:[xt,uW,rT,qe],components:{Avatar:E},props:{infoAccount:{type:Object},countSubscribers:{type:Number}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllFavorites:"favoriteSettings/getAllFavorites"})),{},{iconProvider:function(){return{name:"Provider",color:this.darkClass.dark?"#00b9fc":"#3C73F1",size:14}},checkInFavoriteList:function(){var t,e=this;if(null!==(t=this.getAllFavorites)&&void 0!==t&&t.length)return this.getAllFavorites.some((function(t){return t.accountId===e.infoAccount.login}))},favoriteIcon:function(){return{name:this.checkInFavoriteList?"Favorite-on":"Favorite-off",color:this.getBlueColor.color}},unionIcon:function(){return{name:"Union",color:this.darkClass.dark?"#8FA8C1":"#cccccc"}},groupClass:function(){return{red:"Demo"===this.infoAccount.accountGroup||"CryptoDemo"===this.infoAccount.accountGroup,green:"Real"===this.infoAccount.accountGroup}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"favoriteSettings/redactSettings"})),{},{mouseenterHandler:function(t){var e=t.target.getBoundingClientRect(),i=e.right,o=window.innerWidth-i;this.mouseEnterFunction(t,{imageForSource:this.infoAccount.avatar,nameSource:this.infoAccount.traderName,accountId:this.infoAccount.login,noActiveButton:!0,position:o>500?"rightTop":"leftTop"})},mouseleaveHandler:function(){this.mouseLeaveFunction()},saveOrDeleteFavorite:function(){this.checkInFavoriteList?this.redactSettings({data:{contract:this.infoAccount.contract,accountId:this.infoAccount.login,myAccount:this.getDefaultAccount.id},mutation:"deleteFavorite"}):WG({elementFly:this.$refs.img,targetFly:document.querySelector(".StrategysForInvesting-head"),offsetLeft:10,calcSize:20,cb:this.addToFavorite})},addToFavorite:function(){this.redactSettings({data:{type:"OneProvider",contract:[this.infoAccount.contract],accountGroupCode:this.infoAccount.accountGroup,accountId:this.infoAccount.login,sequenceId:this.infoAccount.sequenceId,nameExpert:this.infoAccount.traderName,avatarURL:this.infoAccount.avatar,brokerId:this.infoAccount.brokerId,procPosOrders:0,monthPrice:0,profitPercent:0,myAccount:this.getDefaultAccount.id},mutation:"addNewFavorite"})},goToProfile:function(){var t=this.$router.resolve({name:"UserProfile",query:{accountId:this.infoAccount.login,userId:this.infoAccount.userId}});localStorage.setItem("activeTabUserProfile",L1[0].component),window.open(t.href,"_blank")}})},b7=C7,S7=(i("101a"),Object(C["a"])(b7,v7,y7,!1,null,"78ea1d5a",null)),P7=S7.exports,T7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"BodyCard",class:t.darkClass},[e("div",{staticClass:"BodyCard-roi"},[e("StatDataContainer",{attrs:{title:"Средний доход на сделку"}},[e("StatWidgetWithGradient",{attrs:{color:t.avgProfitOnOrder<0?t.getRedColor.color:t.getLemonColor.color,data:t.avgProfitOnOrder,symbol:t.getCurrencyChar,gradient:t.avgProfitOnOrder<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",type:"abs"}})],1),e("StatDataContainer",{attrs:{title:"ROI"}},[e("StatWidgetWithGradient",{attrs:{color:t.roi<0?t.getRedColor.color:t.getLemonColor.color,data:t.roi,symbol:"%",gradient:t.roi<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",type:"rel"}})],1)],1),e("div",{staticClass:"BodyCard-stat"},[t._l(t.getStatData,(function(i,o){return e("div",{key:o,class:"BodyCard-startStat-item BodyCard-startStat-item_".concat(t.getActiveTheme)},[e("div",{class:"BodyCard-startStat-itemTitle BodyCard-startStat-itemTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(i.title)))]),e("hr"),e("div",{class:"BodyCard-startStat-itemData BodyCard-startStat-itemData_".concat(t.getActiveTheme),style:{color:i.color}},[i.iconName?e("svgIcon",{attrs:{size:16,name:i.iconName}}):t._e(),t._v(t._s(i.data))],1)])})),e("div",{class:"BodyCard-startStat-item BodyCard-startStat-item_".concat(t.getActiveTheme)},[e("div",{class:"BodyCard-startStat-itemTitle BodyCard-startStat-itemTitle_".concat(t.getActiveTheme)},[t._v("Сигналы")]),e("hr"),e("div",{staticClass:"BodyCard-startStat-signals"},t._l(t.signals,(function(i,o){return e("div",{key:i,staticClass:"BodyCard-signal",class:"BodyCard-signal_".concat(t.getActiveTheme)},[t._v(t._s(i))])})),0)])],2)])},x7=[],O7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatDataContainer",class:"StatDataContainer_".concat(t.getActiveTheme)},[t._t("default"),e("div",{staticClass:"StatDataContainer-title"},[e("div",{staticClass:"StatDataContainer-titleText",class:"StatDataContainer-titleText_".concat(t.getActiveTheme)},[t._v(t._s(t.title))])])],2)},w7=[],_7={props:{title:{type:String,default:"Title"}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"}))},A7=_7,D7=(i("caa4"),Object(C["a"])(A7,O7,w7,!1,null,null,null)),k7=D7.exports,I7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatWidgetWithGradient",class:"StatWidgetWithGradient_".concat(t.getActiveTheme),style:{color:t.color}},[e("div",{staticClass:"StatWidgetWithGradient-itemWrapper",style:{background:t.gradient}},[t.arrow?e("div",{staticClass:"StatWidgetWithGradient-svg"},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.arrow,"_direct")}})],1):t._e(),"left"===t.sideSymbol?e("span",[t._v(t._s(t.symbol))]):t._e(),e("span",[t._v(t._s(t.getFormatData[0]))]),+t.getFormatData[1]?e("span",[t._v(".")]):t._e(),+t.getFormatData[1]?e("span",{staticStyle:{"font-size":"1.4rem"}},[t._v(t._s(t.getFormatData[1]))]):t._e(),"right"===t.sideSymbol?e("span",[t._v(t._s(t.symbol))]):t._e()])])},B7=[],M7={props:{data:{default:0},symbol:{default:"$"},type:{default:"abs"},sideSymbol:{default:"left"},gradient:{default:"radial-gradient(50% 50% at 50% 50%, #26647A 0%, #23313F 100%)"},format:{default:!0},color:{default:"#333"},arrow:{default:"up"}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getFormatData:function(){if(this.format){var t="abs"===this.type?2:Math.abs(this.data)<.01&&Math.abs(this.data)?5:2,e=this.$moneyf(this.data,t),i=e.split(",");return i}return[this.data]}})},$7=M7,L7=(i("5cec"),Object(C["a"])($7,I7,B7,!1,null,"5669704f",null)),F7=L7.exports,j7={name:"BodyCard",mixins:[xt,qe],props:{infoAccount:{type:Object},widthCard:{type:Number},symbol:{type:[String,Boolean]},isVisiblePreloader:{type:Boolean},avgProfitOnOrder:{type:Number},roi:{type:Number},successfulPercent:{type:Number},totalClosedOrders:{type:Number},ordersClosedProfit:{type:Number},assetsUnderManagement:{type:[Number,String]},profitSubscribers:{type:[Number]},countSubscribers:{type:[Number]},signals:{default:null}},components:{ProgressRoundDiagram:c$,StatDataContainer:k7,ContractData:q$,StatWidgetWithGradient:F7},data:function(){return{strategiesCards:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({sourcesByAccount:"expertsPortfolio/sourcesByAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getStatData:function(){return[{title:"Общий доход",data:"".concat(this.getCurrencyChar).concat(this.$moneyf(this.ordersClosedProfit,2)),color:this.ordersClosedProfit<0?this.getRedColor.color:this.getGreenColor.color},{title:"Количество сделок",data:this.totalClosedOrders,color:this.getBlueColor.color},{title:"% Успешных сделок",data:"".concat(Math.round(this.successfulPercent),"%"),color:this.successfulPercent<30?this.getRedColor.color:this.successfulPercent>30&&this.successfulPercent<60?this.getOrangeColor.color:this.getGreenColor.color},{title:"AUM",data:"".concat(this.getCurrencyChar).concat(this.$moneyf(this.assetsUnderManagement,2)),color:this.getBlueColor.color},{title:"Доход подписчиков",data:"".concat(this.getCurrencyChar).concat(this.$moneyf(this.profitSubscribers,2)),color:this.profitSubscribers<0?this.getRedColor.color:this.getGreenColor.color},{title:"Подписчики",data:this.countSubscribers,color:this.getGrayColor.color,iconName:"Union2"}]},dataRow:function(){return{sourceAccountId:this.infoAccount.login,sources:this.sourcesByAccount(this.infoAccount.login)}},getPips:function(){return Lm(this.pipsProfit,2,!0)},dopClassPips:function(){return this.pipsProfit>=0?"green":"red"},getAvgProcPipDay:function(){return Lm(this.avgProcPipDay,2,!0)},classAvgProcPipDay:function(){return this.avgProcPipDay>=0?"green":"red"},getAvgProcPipMonth:function(){return Lm(this.avgProcPipMonth,2,!0)},classAvgProcPipMonth:function(){return this.avgProcPipMonth>=0?"green":"red"}})},R7=j7,W7=(i("714d"),Object(C["a"])(R7,T7,x7,!1,null,"62a8db22",null)),N7=W7.exports,E7={name:"Card",inject:["openModalCopyProvider"],mixins:[qg,xt,Ot,lW,$n],props:{infoAccount:{type:Object},statByAccount:{default:null},dataProfit:{default:null},disabledButtonCopy:{type:Boolean},existCopy:{type:Boolean},classForAddInCart:{type:Array},alreadyInPortfolio:{type:[Boolean,Object]},disabledButtonAdd:{type:Boolean},addInCartProvider:{type:Function},symbol:{type:[String,Boolean]},hoveredCard:{type:[Number,Boolean]},isVisiblePreloader:{type:Boolean}},components:{HeaderCard:P7,BodyCard:N7,DxTooltip:Tt.a,DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{text:"",isLoadingCreated:!1,loadingCreatedByAddCard:!1,widthCard:null,isLoadingStart:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated",sourcesByAccount:"expertsPortfolio/sourcesByAccount",getShortPrice:"expertsPortfolio/getShortPrice",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{avgProfitOnOrder:function(){return this.totalClosedOrders&&this.closeProfit?this.closeProfit/this.totalClosedOrders:0},roi:function(){return this.closeProfit&&this.allVolume?100*this.closeProfit/this.allVolume:0},signals:function(){return this.statByAccount?this.statByAccount.map((function(t){return t.contract})):[]},allVolume:function(){if(!this.statByAccount)return 0;var t=this.statByAccount.reduce((function(t,e){return t+e.volume}),0);return t},closeProfit:function(){if(!this.statByAccount)return 0;var t=this.statByAccount.reduce((function(t,e){return t+e.profitClose}),0);return t},ordersClosedProfit:function(){return this.statByAccount?this.statByAccount.reduce((function(t,e){return t+e.pClosedCount}),0):0},totalClosedOrders:function(){return this.statByAccount?this.statByAccount.reduce((function(t,e){return t+e.closedCount}),0):0},successfulPercent:function(){return this.statByAccount?100*this.ordersClosedProfit/this.totalClosedOrders:0},assetsUnderManagement:function(){return this.dataProfit?this.dataProfit.investMoney:0},profitSubscribers:function(){return this.dataProfit?this.dataProfit.profit:0},countSubscribers:function(){return this.dataProfit?this.dataProfit.count:0},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{hoveredCard:this.hoveredCard===this.infoAccount.sequenceId})},getIsReal:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},textTooltip:function(){var t=this.$t("atmi"),e=this.alreadyInPortfolio?this.$t("rftp"):this.$t("add_to_portfolio"),i=this.$t("copy");return[i,e,t]},iconDataCopy:function(){return this.isLoadingStart?{}:{name:this.existCopy?"Settings":"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconDataPlus:function(){return this.loadingCreatedByAddCard?{}:{name:this.alreadyInPortfolio?"Check":"Follow",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},priceAndPercent:function(){var t=this,e=this.infoAccount.login,i=this.getShortPrice.filter((function(i){return t.symbol?i.accountId===e&&i.contract===t.symbol:i.accountId===e})),o=i.reduce((function(t,e){return t+e.monthPrice}),0);o=Lm(o,2,!0);var n=i.reduce((function(t,e){return t+e.profitPercent}),0);return n=n?Lm(n/i.length,2,!0):0,"$ ".concat(o," / ").concat(n,"%")}}),mounted:function(){this.widthCard=this.$refs.card.getBoundingClientRect().width,this.initObserver(this.onResize,this.$refs.card)},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast",setVisible:"modalPay/setVisible"})),{},{login:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},mouseEnterHandler:function(t,e){this.text=e,this.viewTooltip(t)},onResize:function(){this.$refs.card.getBoundingClientRect().width!==this.widthCard&&(this.widthCard=this.$refs.card.getBoundingClientRect().width)},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.symbol||t.infoAccount.traderName,o=t.sourcesByAccount(t.infoAccount.login),t.symbol&&(o=o.filter((function(e){return e.contract===t.symbol}))),n=o.map((function(t){return t.id})),e.next=6,t.saveInvestBag({name:i,investLeverage:1,investMoney:0,investBagType:"Invest"});case 6:if(s=e.sent,!s.requestStatus.isOK){e.next=12;break}return a=[],n.forEach((function(t){a.push(tq({sourceId:t,bagId:s.id}))})),e.next=12,t.saveInvestBagContent(a);case 12:case"end":return e.stop()}}),e)})))()},openModalCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=13;break}return t.isLoadingStart=!0,e.next=10,t.pendingStatus(i.id);case 10:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 13:t.openModalCopyProvider({providerCopy:!0,infoAccount:t.infoAccount,symbol:t.symbol});case 14:case"end":return e.stop()}}),e)})))()},addToDraft:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(e.isAuth){o.next=3;break}return e.login(),o.abrupt("return");case 3:return t?e.loadingCreatedByAddCard=!0:e.isLoadingCreated=!0,n=document.querySelector(".AdaptiveLineButtons"),o.next=7,WG({elementFly:document.querySelector(".img".concat(e.infoAccount.index)),targetFly:document.querySelector(".adaptiveBlockContainer_main"),offsetLeft:(null===n||void 0===n?void 0:n.clientWidth)||0,cb:function(){var o=Object(a["a"])(Object(r["a"])().mark((function o(){var n;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,e.addInvest();case 2:e.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:e.$t("tcphbattps")}}),t?e.loadingCreatedByAddCard=!1:e.isLoadingCreated=!1,n=new Audio,n.src=i("2e5e"),n.play();case 7:case"end":return o.stop()}}),o)})));function n(){return o.apply(this,arguments)}return n}()});case 7:case"end":return o.stop()}}),o)})))()},addInCartProviderHandler:function(t){var e=this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}));e.length>0?this.addInCartProvider(t):this.addToDraft(!0)}})},U7=E7,V7=(i("2216"),Object(C["a"])(U7,f7,m7,!1,null,"3dfe0588",null)),H7=V7.exports,G7=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Row",class:t.darkClass},[e("div",{staticClass:"num"},[e("div",{staticClass:"bookmark",style:t.bookmarkStyle},[t._v(t._s(t.infoAccount.index))])]),e("div",{staticClass:"dataExpert"},[e("img",{class:"img".concat(t.infoAccount.index),attrs:{src:t.infoAccount.avatar,alt:""}}),e("div",{staticClass:"nameAndAccount"},[e("div",{staticClass:"name"},[t._v(t._s(t.infoAccount.traderName))]),e("div",{staticClass:"number"},[t._v(t._s(t.infoAccount.sequenceId))])])]),e("div",{staticClass:"chartBlock"},[e("Chart",{attrs:{statByAccount:t.statByAccountForGraph,widthCard:300,classes:["graphBlock"],height:32}})],1),e("div",{staticClass:"successfulTransaction"},[e("ProgressRoundDiagram",{key:t.getProfitOrdersPercent+JSON.stringify(t.darkClass.dark),attrs:{width:30,height:30,fontSize:10,widthBorder:2,percent:t.getProfitOrdersPercent}})],1),e("div",{staticClass:"accountType"},[e("img",{attrs:{src:t.srcIcon,alt:""}}),e("span",{staticClass:"accountGroupCode",class:t.classGroupCode},[t._v(t._s(t.accountGroupCode))])]),e("div",{staticClass:"averageIncome",class:t.valueClass},[t._v(t._s(t.getMonthProfit>=1?t.getMonthProfit:"< 1")+"%")]),e("div",{staticClass:"profitability",class:t.colorProfitClass},[t._v(t._s(t.profitability)+"%")]),e("div",{staticClass:"risk",class:t.colorDrawDownClass},[t._v(t._s(t.drawDown)+"%")]),e("div",{staticClass:"sharp",class:t.colorSharpClass},[t._v(t._s(t.sharpeRatio))]),e("div",{staticClass:"activeButton"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{disabled:t.disabledButtonCopy,icon:t.getIconData(t.existCopy?"Settings":"Copy")},on:{toggle:function(e){return t.openModal({follow:t.existCopy?"exist":"copy"})}}}),e("ButtonIconFlat",{class:t.classForAddInCart,attrs:{icon:t.getIconData(t.alreadyInPortfolio?"Check":"Follow"),disable:t.disabledButtonAdd},on:{toggle:t.addInCartProvider}})],1)])},q7=[],z7={name:"Row",mixins:[uW,xt],props:{infoAccount:{type:Object},statByAccount:{type:Object},classForAddInCart:{type:Array},addInCartProvider:{type:Function},symbol:{type:String}},components:{ProgressRoundDiagram:c$,Chart:cW}},Y7=z7,X7=(i("f87b"),Object(C["a"])(Y7,G7,q7,!1,null,"690bd010",null)),Q7=X7.exports;function J7(t){return{accountId:t[0],contract:t[1],profitClose:t[2],procPosOrders:t[3],volume:t[4],closedCount:t[5],pClosedCount:t[6]}}var K7,Z7={name:"ExpertInfoStat",mixins:[xt,lW,uW],props:{infoAccount:{type:Object},isRows:{type:Boolean},symbol:{type:[String,Boolean]},indexCard:{type:Number},skipCount:{type:Number},hoveredCard:{type:[Boolean,Number]},isVisiblePreloader:{type:Boolean}},components:{Card:H7,Row:Q7,DxTooltip:Pt["DxTooltip"]},data:function(){return{dataProfit:null,statByAccount:null,timeAnimation:null,ratioTime:1.3,calcSize:25,calcSizeRow:5,tooltipVisible:!1,timeFade:800,timer:null,timer2:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",expertsLogin:"expertsPortfolio/expertsLogin",getDefaultAccount:"subscribeOrders/getDefaultAccount",sourcesByAccount:"expertsPortfolio/sourcesByAccount"})),{},{isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},classForAddInCart:function(){return["buttonCustom","expert".concat(this.infoAccount.login),{alreadyInPortfolio:this.alreadyInPortfolio}]},animationConfig:function(){return{show:{type:"pop",from:{scale:.8,opacity:0},to:{scale:1,opacity:1}},hide:{type:"pop",from:{scale:1,opacity:1},to:{scale:.8,opacity:0}}}},props:function(){return{statByAccount:this.statByAccount,dataProfit:this.dataProfit,infoAccount:this.infoAccount,disabledButtonCopy:this.disabledButtonCopy,existCopy:this.existCopy,classForAddInCart:this.classForAddInCart,alreadyInPortfolio:this.alreadyInPortfolio,disabledButtonAdd:this.disabledButtonAdd,symbol:this.symbol,hoveredCard:this.hoveredCard,isVisiblePreloader:this.isVisiblePreloader}},textTooltip:function(){return this.$t("yaactpiotaa")},emptyData:function(){return{count:0,invest:0,profit:0,volume:0}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({setPopupModalData:"modal/setPopupData",addExpertInPortfolio:"expertsPortfolio/addExpertInPortfolio",deleteExpert:"expertsPortfolio/deleteExpert",redactSettings:"favoriteSettings/redactSettings"})),{},{setStat:function(t){t&&t[0][0]===this.infoAccount.login&&(this.statByAccount=t.map((function(t){return J7(t)})),this.$emit("progressLoaded"))},setMessageHandler:function(t){if("GetAccountCloseOrderStatisticByContract"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);this.setStat(e[0][0])}else if("GetProviderShortStatistics"===(null===t||void 0===t?void 0:t.command)){var i;t.data.length&&(null===(i=t.data[0])||void 0===i?void 0:i.accountId)===this.infoAccount.login&&(this.dataProfit=t.data[0])}},sendWSCommand:function(){var t=[];this.symbol&&t.push(this.symbol);var e=[{AccountId:this.infoAccount.login,Contracts:t}];this.timer=(new Date).getTime();var i={command:"GetAccountCloseOrderStatisticByContract",data:{datas:e}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},iAmProvider:function(){var t=[];if(0===this.getDefaultAccount.source.length)return[];var e=this.sourcesByAccount(this.infoAccount.login).map((function(t){return t.contract})),i=this.getDefaultAccount.source;return this.symbol&&i.includes(this.symbol)?t.push(this.symbol):this.symbol||e.forEach((function(e){i.includes(e)&&t.push(e)})),t},login:function(){this.setPopupModalData({visiblePopup:!0,modalComponentName:"ModalLogin",titlePopup:"sign_in"})},addInCartProvider:function(t){var e;if(this.isAuth){if(!this.disabledButtonAdd){var i=t.closest("footer"),o=t.closest(".OneCard").querySelector(".HeaderCard .wrapImage img"),n=this.$refs.card.addToDraft,s=this.infoAccount.login,r=null===(e=this.infoAccount)||void 0===e?void 0:e.traderName;this.$emit("openModalSelectPortfolio",{target:i,login:s,refFunctionAddToDraft:n,nameProvider:r,imgFly:o})}}else this.login()},beforeEnter:function(t){t.style.opacity=0,this.isRows||this.$emit("changeData",{visibleTopGraphAndVideoBlock:!0})},enter:function(t,e){var i=null,o=this.timeFade;window.requestAnimationFrame((function n(s){i||(i=s);var r=s-i,a=r/o;if(t.style.opacity=a<1?a:1,r0?a:0,r0)return window.requestAnimationFrame(n);e()}))},afterLeave:function(t){t.style.opacity=0,this.$emit("changeData",{classRow:this.isRows})},tableDataProfit:function(t){var e=this,i={};return t.forEach((function(t){i[t.contract]||(i[t.contract]=Object(c["a"])({contract:t.contract},e.emptyData)),i[t.contract].count+=1,i[t.contract].invest+=t.investMoney,i[t.contract].profit+=t.closedProfit,i[t.contract].volume+=2*t.usedVolume})),Object.values(i)},getProfitData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i={command:"GetProviderShortStatistics",data:{id:t.infoAccount.login}},t.$socketStream.sendCommand({ws:"apiWS3",command:i}),t.timer2=(new Date).getTime();case 3:case"end":return e.stop()}}),e)})))()}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$socketStream.events.subscribe("apiWS3",t.setMessageHandler),t.sendWSCommand(),t.getProfitData();case 3:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHandler)}},t9=Z7,e9=(i("4d94"),Object(C["a"])(t9,p7,g7,!1,null,"375a1c46",null)),i9=e9.exports,o9=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"GraphBlockTops",class:t.rootClass},[e("div",{ref:"resizeContainer",staticClass:"resizeContainer"},[e("header",[e("div",{staticClass:"text"},[t._v(t._s(t.$t("tmptp")))]),e("div",{staticClass:"activeBlock"},[t.expand?t._e():e("div",{staticClass:"pseudoButton",on:{click:t.toBeSmall}},[e("svgIcon",t._b({},"svgIcon",t.expandLeftRightIcon,!1))],1),e("div",{staticClass:"pseudoButton",on:{click:t.expandToggle}},[e("svgIcon",t._b({},"svgIcon",t.expandIcon,!1))],1)])]),e("div",{staticClass:"contentGraph"},[t.isVisibleList?e("div",{staticClass:"listProviders"},[e("div",{staticClass:"scrollData"},[e("transition-group",{attrs:{name:"listExperts",tag:"div"}},t._l(t.expertsSorted,(function(i){return e("CheckboxBlock",{key:i.infoAccount.login,attrs:{expert:i,color:i.color,checked:t.checked,symbol:t.symbol},on:{setStatus:t.setStatus,setHover:t.setHover}})})),1)],1)]):t._e(),t.visibleGraph&&!t.isVisiblePreloader?e("LineEventChart",{key:t.points.length+t.small,attrs:{points:t.points,roundIndicator:t.small,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",widthYaxis:t.small?"15px":"7rem",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:t.hoverPoint}}):t._e()],1)])])},n9=[],s9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckboxBlock",class:t.rootClass,on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{staticClass:"checkbox",class:{colored:t.color},style:t.styleColor},[e("DxCheckBox",{attrs:{value:t.getChecked,elementAttr:{class:"checkBoxCustom"},onValueChanged:t.setStatus}})],1),e("div",{staticClass:"nameAndAvatar"},[e("Avatar",{attrs:{src:t.avatarSrc,theme:t.getTheme,size:"2.4"}}),e("div",{staticClass:"name"},[t._v(t._s(t.expertName)),e("span",[t._v(t._s(t.sequenceId))])])],1),e("hr"),e("div",{staticClass:"diagramm"},[e("div",{staticClass:"DataPortfolio-profit",style:{color:t.color}},[t._v(t._s(t.closeAbsProfit))])]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionBottomCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},r9=[],a9={name:"CheckboxBlock",mixins:[xt,Ot],props:{expert:{type:Object},lastDataChart:{type:Number,default:0},typeData:{type:String},color:{type:String,default:"green"},checked:{type:Array},symbol:{type:[String,Boolean]}},components:{DxCheckBox:Th["DxCheckBox"],Avatar:E},data:function(){return{hover:!1,textTooltip:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios"})),{},{rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{hover:this.hover})},getTheme:function(){return this.darkClass.dark?"dark":"light"},getChecked:function(){return this.checked.includes(this.expert.infoAccount.login)},expertName:function(){return this.expert.infoAccount.traderName},sequenceId:function(){return this.expert.infoAccount.sequenceId},avatarSrc:function(){return this.expert.infoAccount.avatar},styleColor:function(){return this.color?{"--color-checkbox":this.color}:{}},closeAbsProfit:function(){if(!this.symbol){var t=nW(this.expert.statByAccount.data).at(-1)[1];return Lm(t,2,!0)+" pip"}var e=this.expert.statByAccount.data.at(-1),i=e.pip;return Lm(i,2,!0)+" pip"},expertsForStat:function(){var t=[];return this.portfolio.data.forEach((function(e){e[1].forEach((function(e){return t.push(e)}))})),t},dataIconPlus:function(){return{name:"Plus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},dataIconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}}}),methods:{setStatus:function(t){this.$emit("setStatus",{status:t.value,login:this.expert.infoAccount.login})},mouseenterHandler:function(){this.hover=!0,this.$emit("setHover",this.sequenceId)},mouseleaveHandler:function(){this.hover=!1,this.$emit("setHover",null)},viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)}}},c9=a9,l9=(i("ae58"),Object(C["a"])(c9,s9,r9,!1,null,"25c371e4",null)),u9=l9.exports,d9={name:"GraphBlockTops",mixins:[xt],props:{tradersLength:{type:Number},symbol:{type:[String,Boolean]},isVisiblePreloader:{type:Boolean},theBestFiveTraders:{type:Array}},components:{LineEventChart:Uk,CheckboxBlock:u9},data:function(){return{expand:!1,small:!0,points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1,checked:[],firstFiveStatistic:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getScreenWidth:"user/getScreenWidth"})),{},{isVisibleList:function(){var t=this.theBestFiveTraders<=5?this.tradersLength:5;return t===this.firstFiveStatistic.length&&(!!this.expand||!this.small)},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{small:this.small})},expandIcon:function(){return{name:this.expand?"Unexpand":"Expand",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},expandLeftRightIcon:function(){return{name:this.small?"Block-expand-right-close":"Block-expand-left-close",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},colors:function(){return this.darkClass.dark?[{color:"rgba(0, 185, 252, 1)",fill:"rgba(0, 185, 252, 0.1)"},{color:"rgba(0, 255, 172, 1)",fill:"rgba(0, 255, 172, 0.1)"},{color:"rgba(250, 76, 74, 1)",fill:"rgba(250, 76, 74, 0.1)"},{color:"rgba(211, 190, 0, 1)",fill:"rgba(211, 190, 0, 0.1)"},{color:"rgba(202, 117, 255, 1)",fill:"rgba(202, 117, 255, 0.1)"}]:[{color:"rgba(60, 115, 241, 1)",fill:"rgba(60, 115, 241, 0.1)"},{color:"rgba(0, 142, 114, 1)",fill:"rgba(0, 142, 114, 0.1)"},{color:"rgba(233, 18, 18, 1)",fill:"rgba(233, 18, 18, 0.1)"},{color:"rgba(165, 124, 0, 1)",fill:"rgba(165, 124, 0, 0.1)"},{color:"rgba(172, 60, 241, 1)",fill:"rgba(172, 60, 241, 0.1)"}]},expertsColored:function(){var t=this;return this.firstFiveStatistic.map((function(e,i){return Object(c["a"])(Object(c["a"])({},e),{},{color:t.colors[i].color,fill:t.colors[i].fill})}))},expertsSorted:function(){var t=this;return this.expertsColored.sort((function(e,i){return t.checked.includes(i.infoAccount.login)-t.checked.includes(e.infoAccount.login)}))},expertsFiltered:function(){var t=this;return this.expertsSorted.filter((function(e){return t.checked.includes(e.infoAccount.login)}))}}),watch:{firstFiveStatistic:function(t){t.length===this.theBestFiveTraders.length&&this.setPointsForChart()}},methods:{expandToggle:function(){var t=document.querySelector(".CardExpertStrategies"),e=this.$refs.container,i=this.$refs.resizeContainer,o=t.getBoundingClientRect(),n=o.width,s=o.height,r=e.getBoundingClientRect(),a=r.width,c=r.height,l=n-a,u=s-c,d=null,h=800,p=this;window.requestAnimationFrame((function o(r){d||(d=r);var g=r-d,f=g/h,m=a+l*f,v=c+u*f;if(p.expand&&(m=n-l*f,v=s-u*f),i.style.width=m+"px",i.style.height=v+"px",g1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setStatus:function(t){var e=t.status,i=t.login;e?this.checked.push(i):this.checked=this.checked.filter((function(t){return t!==i})),this.setPointsForChart()},setHover:function(t){this.$emit("setHover",t)},getStatByContract:function(t){var e={command:"ContractStatisticsByAccount",method:"get",data:t};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}},setStat:function(t){if(t){var e=this.theBestFiveTraders.map((function(t){return t.login}));e.includes(t.dailyData.accountId)&&this.firstFiveStatistic.push({statByAccount:t,infoAccount:this.theBestFiveTraders.find((function(e){return e.login===t.dailyData.accountId}))})}}},mounted:function(){var t=this,e=new Date,i=e.getFullYear()-1,o=e.getMonth(),n=e.getDay(),s=new Date(i,o,n);this.checked=this.theBestFiveTraders.map((function(t){return t.login})),this.theBestFiveTraders.forEach((function(e){t.getStatByContract({AccountId:e.login,contracts:t.symbol?[t.symbol]:null,ForChart:!0,DateRequest:s})})),this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},h9=d9,p9=(i("d1d45"),Object(C["a"])(h9,o9,n9,!1,null,"0f609b5f",null)),g9=p9.exports,f9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"paginator",class:t.darkClass},[e("div",{staticClass:"paginator__left"},[e("Button-label",{class:{"button-label--active":t.openRows},attrs:{iconName:t.openRows?"Arrow-dropdown-top":"Arrow-dropdown-bottom",modifier:"flat reverse"},on:{tab:t.toggleDropdownRows}},[t._v(t._s(t.activeRow))]),e("Dropdown-menu",{staticClass:"paginator__dropdown-rows",attrs:{isOpen:t.openRows,width:"95"}},t._l(t.rows,(function(i,o){return e("List-item",{key:o,attrs:{modifier:"radio"}},[e("Radio",{attrs:{value:i},on:{change:function(e){return t.changeRows(e)}},model:{value:t.activeRow,callback:function(e){t.activeRow=e},expression:"activeRow"}},[t._v(t._s(i))])],1)})),1)],1),t.getLastPage>1?e("div",{staticClass:"paginator__center"},[e("Dropdown-menu",{staticClass:"paginator__dropdown-pages",attrs:{isOpen:t.openPages,width:"130"}},[e("list-item",{staticClass:"paginator__dropdown-search"},[e("input-search",{model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1),e("VuePerfectScrollBar",{staticClass:"paginator__dropdown-scroll"},t._l(t.pages,(function(i,o){return e("List-item-menu",{key:o,attrs:{isActive:t.getActivePage===i},on:{click:function(e){return t.setActivePage(i)}}},[t._v(t._s(i+1))])})),1)],1),e("Button-label",{class:{"button-label--active":t.openPages},attrs:{iconName:t.openPages?"Arrow-dropdown-top":"Arrow-dropdown-bottom",modifier:"flat reverse group"},on:{tab:t.toggleDropdownPages}},[t._v(t._s(t.$t("goOver")))]),t.getActivePage>0?e("Button-icon",{attrs:{iconName:"Arrow-move-left",modifier:"flat group pager-nav"},on:{toggle:t.setPrevPage}}):t._e(),t._l(t.getAllPages,(function(i,o){return e("Button-label",{key:o,attrs:{modifier:"flat group digit",isActive:t.getActivePage===i},on:{tab:function(e){return t.setActivePage(i)}}},[t._v(t._s(i+1))])})),t.getLastPage-t.getActivePage>4?e("Button-label",{attrs:{modifier:"flat group digit",disable:""}},[t._v("...")]):t._e(),t.getLastPage-t.getActivePage>4?e("Button-label",{attrs:{modifier:"flat group digit",isActive:t.getActivePage===t.pages},on:{tab:function(e){return t.setActivePage(t.getLastPage-1)}}},[t._v(t._s(t.getLastPage))]):t._e(),t.getActivePage4?this.pages.slice(e,e+4):this.pages.slice(-4),t},getActivePage:function(){return this.activePage},getLastPage:function(){return this.pages.length}},methods:{scrollTop:function(){this.$emit("scrollTop")},setActivePage:function(t){this.activePage=t,this.openPages=!1,this.$emit("setPage",{skipCount:t,count:+this.activeRow})},setPrevPage:function(){0!==this.activePage&&this.activePage--,this.$emit("setPage",{skipCount:this.activePage,count:+this.activeRow})},setNextPage:function(){this.activePage".concat(this.currentPortfolio.name,"?")}})},copyPortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoading){e.next=2;break}return e.abrupt("return");case 2:return t.isLoading=!0,e.next=5,t.needPay();case 5:if(i=e.sent,!i){e.next=12;break}return e.next=9,t.pendingStatus(i.id);case 9:return t.setVisible(!0),t.isLoading=!1,e.abrupt("return");case 12:o={command:"ContractStatisticsByInvestBags",method:"get",data:{InvestBagIds:[t.currentPortfolio.id],StatisticType:1}},t.$socketStream.sendCommand({ws:"apiWS3",command:o});case 14:case"end":return e.stop()}}),e)})))()},deleteFunctionOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.physicalDeletePortfolio(t.currentPortfolio.id);case 2:case"end":return e.stop()}}),e)})))()},closeModalFunction:function(){this.$emit("hidden")},setMessageHandler:function(t){"ContractStatisticsByInvestBags"===(null===t||void 0===t?void 0:t.command)&&(this.stat=JSON.parse(t.data))},hiddenModalPortfolioExperts:function(){this.$emit("hiddenModal"),this.visibleModalPortfolioExperts=!1}}),mounted:function(){this.namePortfolio=this.currentPortfolio.name,this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},x9=T9,O9=(i("eb79"),Object(C["a"])(x9,S9,P9,!1,null,"5ad5e94c",null)),w9=O9.exports,_9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonView",class:t.darkClass,style:t.styleRoot},[e("div",{staticClass:"avatarsBlock"},[t._l(t.avatarsSlice,(function(t){return e("img",{key:t,attrs:{src:t}})})),t.dopAvatars?e("div",{staticClass:"dopAvatar"},[t._v("+"+t._s(t.dopAvatars))]):t._e()],2),e("div",{staticClass:"textWrapper"},[t._v(t._s(t.dataButton.text))])])},A9=[],D9={name:"ButtonView",components:{},props:{isLoading:{type:Boolean},dataButton:{type:Object},portfolioId:{type:[String,Boolean]},getPortfolioOnlyStatusCreatedFilter:{type:Array}},mixins:[xt],data:function(){return{}},watch:{},computed:{styleRoot:function(){return{opacity:this.isLoading&&this.dataButton.idPortfolio===this.portfolioId?0:1}},findPortfolio:function(){var t=this;return this.getPortfolioOnlyStatusCreatedFilter.find((function(e){return e.id===t.dataButton.idPortfolio}))},avatars:function(){var t=this.findPortfolio.sources.map((function(t){var e=t.userInfo.avatarURL;return"User-profile.png"===e&&(e=i("81bc")),e}));return Array.from(new Set(t))},avatarsSlice:function(){return this.avatars.slice(0,3)},dopAvatars:function(){var t=this.avatars.length-3;return!(t<=0)&&t}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},k9=D9,I9=(i("3906"),Object(C["a"])(k9,_9,A9,!1,null,"65334436",null)),B9=I9.exports,M9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ControlButtons",class:t.darkClass,on:{mouseenter:t.mouseenter,mouseleave:t.mouseleave}},[e("div",{staticClass:"leftButton",class:t.classForLeftButton,on:{click:t.clickLeftButton}},[t.isLoadingCopy?e("DxLoadIndicator",{attrs:{height:40,width:40}}):t._e(),t.isLoadingCopy?t._e():e("div",{staticClass:"svgIconContainer"},[e("svgIcon",t._b({},"svgIcon",t.iconStopOrPlay,!1))],1),t.isLoadingCopy?t._e():e("div",{staticClass:"text"},[t._v(t._s(t.textLeftButton))])],1),e("div",{staticClass:"rightButtons"},[e("div",{staticClass:"buttonSection editButton",on:{click:t.setEditName}},[t.editName?e("div",{staticClass:"inputContainer"},[e("div",{staticClass:"svgIconContainer",on:{click:t.nameEditing}},[t.isLoadingEditName?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("svgIcon",t._b({},"svgIcon",t.iconCheck,!1))],1),e("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],ref:"input",attrs:{type:"text"},domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}})]):e("div",{staticClass:"contentContainer"},[e("div",{staticClass:"svgIconContainer"},[e("svgIcon",t._b({},"svgIcon",t.iconEdit,!1))],1),e("div",{staticClass:"text"},[t._v(t._s(t.$t("edit")))])])]),e("div",{staticClass:"buttonSection deleteButton",on:{click:t.deletePortfolio}},[t.isLoading?e("div",{staticClass:"loadIndicatorContainer"},[e("DxLoadIndicator",{attrs:{height:20,width:20}})],1):e("div",{staticClass:"contentContainer"},[e("div",{staticClass:"svgIconContainer"},[e("svgIcon",t._b({},"svgIcon",t.iconDelete,!1))],1),e("div",{staticClass:"text"},[t._v(t._s(t.$t("delete")))])])])])])},$9=[],L9={name:"ControlButtons",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{dataButton:{type:Object}},mixins:[xt,$n],data:function(){return{name:"",editName:!1,isLoading:!1,isLoadingCopy:!1,isLoadingEditName:!1,stat:null}},watch:{findPortfolio:function(t){this.editName=!1,this.name=t.name},stat:function(t){var e=this,i=t[0][0][1],o=this.findPortfolio.sources.map((function(t){return{data:i.find((function(e){return e[0]===t.contract}))[1][0][1],sequenceId:e.dataButton.sequenceId,accountGroupCode:t.accountGroupCode,uniqueId:"".concat(t.accountId).concat(t.contract),login:t.accountId,avatar:t.userInfo.avatarURL,symbol:t.contract,profitOrdersPercent:0,traderName:"".concat(t.userInfo.firstName," ").concat(t.userInfo.lastName),iAmProvider:[],status:!0}}));this.$emit("setDataModalPortfolio",{visibleModalPortfolioExperts:!0,expertsByFindPortfolio:o,findPortfolio:this.findPortfolio}),this.isLoadingCopy=!1,this.$emit("setLoadingCopyControlButtons",!1),localStorage.removeItem("controlButtonGetStatistic")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios"})),{},{findPortfolio:function(){var t=this;return this.getCreatedPortfolios.find((function(e){return e.id===t.dataButton.component}))},statusPortfolio:function(){return this.dataButton.status},statusActive:function(){return"Active"===this.statusPortfolio},classForLeftButton:function(){return{activePortfolio:this.statusActive,noActivePortfolio:!this.statusActive}},textLeftButton:function(){return this.statusActive?this.$t("stop_copying"):this.$t("start_copying2")},iconEdit:function(){return{name:"EditInform",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconDelete:function(){return{name:"Delete",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconStopOrPlay:function(){return this.statusActive?{name:"Stop",color:this.darkClass.dark?"#FA4C4A":"#E91212"}:{name:"Play",color:this.darkClass.dark?"#00FFAC":"#008E72"}},iconCheck:function(){return{name:"Check",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",saveInvestBag:"expertsPortfolio/saveInvestBag",getDataByBagOpenOrders:"expertsPortfolio/getDataByBagOpenOrders",changeInvestBagStatus:"expertsPortfolio/changeInvestBagStatus",physicalDeletePortfolio:"expertsPortfolio/physicalDeletePortfolio",clearExperts:"expertsPortfolio/clearExperts",clearStatus:"expertsPortfolio/clearStatus",setVisible:"modalPay/setVisible"})),{},{setEditName:function(){var t=this;this.editName=!0,this.$nextTick((function(){t.$refs.input.focus()}))},getTextMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.count&&"Created"!==this.statusPortfolio?"".concat(this.$t("tanotitp")[0](t.count),"
\n ").concat(this.$t("tanotitp")[1]," ≈ $ ").concat(Math.abs(t.profit),". \n ").concat(this.$t("aysywtdtp")):this.$t("aysywtdtp")},deletePortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Created"===t.statusPortfolio){e.next=8;break}return t.isLoading=!0,e.next=4,t.getDataByBagOpenOrders(t.findPortfolio.id);case 4:i=e.sent,t.isLoading=!1,e.next=10;break;case 8:return t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{visibleButtonAction:!0,functionArray:[t.deleteFunctionOk],message:t.getTextMessage(i)}}),e.abrupt("return");case 10:t.showToast({visible:!0,componentName:"StopOrDeletePortfolioAlert",width:"75vw",height:"90vh",shading:!0,outSideClick:!0,dopInfo:{functionSetStatus:t.deleteFunctionOk,delete:!0,profit:i.profit,count:i.count,namePortfolio:t.name}});case 11:case"end":return e.stop()}}),e)})))()},deleteFunctionOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Created"!==t.statusPortfolio){e.next=5;break}return e.next=3,t.physicalDeletePortfolio(t.findPortfolio.id);case 3:e.next=10;break;case 5:if(!["Active","Pause"].includes(t.statusPortfolio)){e.next=8;break}return e.next=8,t.changeInvestBagStatus({bagId:t.findPortfolio.id,status:"Stoped",changeStatus:!1});case 8:return e.next=10,t.changeInvestBagStatus({bagId:t.findPortfolio.id,status:"Deleted",changeStatus:!0});case 10:t.$store.dispatch("expertsPortfolio/setNextFindPortfolio");case 11:case"end":return e.stop()}}),e)})))()},nameEditing:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.editName){e.next=7;break}return t.isLoadingEditName=!0,e.next=4,t.saveInvestBag({name:t.name,investLeverage:t.findPortfolio.investLeverage,investMoney:t.findPortfolio.investMoney,investBagType:t.findPortfolio.type,id:t.findPortfolio.id});case 4:"Signal"===t.findPortfolio.type?t.clearStatus():t.clearExperts(),t.isLoadingEditName=!1,t.$store.commit("expertsPortfolio/setNamePortfolio",{id:t.findPortfolio.id,newName:t.name});case 7:t.editName=!t.editName;case 8:case"end":return e.stop()}}),e)})))()},getTextMessageStatus:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.count?"".concat(this.$t("tanotitp")[0](e.count),"
\n ").concat(this.$t("tanotitp")[1]," ≈ $ ").concat(Math.abs(e.profit),". \n ").concat(this.$t("aystywtsi")):this.$t("aystywtsi")},changeStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.changeInvestBagStatus({bagId:e.findPortfolio.id,status:t,changeStatus:!0});case 2:case"end":return i.stop()}}),i)})))()},stopInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getDataByBagOpenOrders(t.findPortfolio.id);case 2:i=e.sent,t.showToast({visible:!0,componentName:"StopOrDeletePortfolioAlert",width:"75vw",height:"90vh",shading:!0,outSideClick:!0,dopInfo:{functionSetStatus:t.changeStatus.bind(null,"Stoped"),stop:!0,profit:i.profit,count:i.count,namePortfolio:t.name}});case 4:case"end":return e.stop()}}),e)})))()},clickLeftButton:function(){this.statusActive?this.stopInvest():this.copyPortfolio()},copyPortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoadingCopy){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.needPay();case 4:if(i=e.sent,!i){e.next=12;break}return t.isLoadingCopy=!0,e.next=9,t.pendingStatus(i.id);case 9:return t.setVisible(!0),t.isLoadingCopy=!1,e.abrupt("return");case 12:localStorage.setItem("controlButtonGetStatistic",JSON.stringify(!0)),t.$emit("setLoadingCopyControlButtons",!0),t.isLoadingCopy=!0,o={command:"ContractStatisticsByInvestBags",method:"get",data:{InvestBagIds:[t.findPortfolio.id],StatisticType:1}},t.$socketStream.sendCommand({ws:"apiWS3",command:o});case 17:case"end":return e.stop()}}),e)})))()},setMessageHandler:function(t){var e=localStorage.getItem("controlButtonGetStatistic");if("ContractStatisticsByInvestBags"===(null===t||void 0===t?void 0:t.command)&&e){var i=JSON.parse(t.data);i[0][0][0]===this.findPortfolio.id&&(this.stat=JSON.parse(t.data))}},mouseenter:function(){this.$emit("mouseenter")},mouseleave:function(){this.$emit("mouseleave")}}),mounted:function(){this.name=this.findPortfolio.name,this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},F9=L9,j9=(i("aae5"),Object(C["a"])(F9,M9,$9,!1,null,"10023815",null)),R9=j9.exports,W9={name:"CardExpertStrategies",inject:["openModalCopyProvider"],mixins:[xt,Ot],props:{traders:{type:Array},theBestFiveTraders:{type:Array},buttonsValue:{type:Object},symbol:{type:String,default:""},skipCount:{type:Number},getPages:{type:Array},getAccounts:{type:Function},isVisiblePreloader:{type:Boolean},getProgress:{type:[Number,String]},alertMessage:{type:String},toTop:{type:Boolean},view:{type:String},emptyProvider:{type:Boolean}},components:{ExpertInfoStat:i9,GraphBlockTops:g9,AdaptiveTabBlock:$1,PortfolioSelection:Pq,ChoiceActionByPortfolio:w9,Preloader:ah,Paginator:b9,DxPopup:To["DxPopup"],DxLoadIndicator:OT["DxLoadIndicator"],ButtonView:B9,ControlButtons:R9},data:function(){return{target:null,imgFly:null,refFunctionAddToDraft:null,refContainer:null,login:null,firstFiveStatistic:[],isVisibleModal:!1,timeFade:500,rowsClass:!1,hoveredCard:null,popupVisible:!1,tooltipVisible:!1,nameProvider:"",portfolioId:null,isLoading:!1,portfolioSelectionView:!1,visibleData:{classRow:!1,visibleTopGraphAndVideoBlock:!0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",countPortfolio:"expertsPortfolio/countPortfolio",expertsFace:"expertsPortfolio/expertsFace",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated"})),{},{iconBigData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c",size:40}},isRows:function(){return"Rows"===this.view},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{isRows:this.visibleData.classRow})},getPortfolioOnlyStatusCreatedFilter:function(){return this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}))},isVisiblePortfolio:function(){var t;return(null===(t=this.getPortfolioOnlyStatusCreatedFilter)||void 0===t?void 0:t.length)>0},buttonsArray:function(){return this.getPortfolioOnlyStatusCreatedFilter.map((function(t){var e="Signal"===t.type;return{provider:e,avatarURL:t.avatar,login:t.sources[0].accountId,sequenceId:t.sources[0].accountSequenceId,idBtn:Math.random().toString(36).substring(7),text:t.name,component:t.id,dopClass:"prov_".concat(t.id),disabled:!1,isActive:!1,minWidth:e?40:135,idPortfolio:t.id,status:t.status}}))},positionPopupSelectionPortfolio:function(){return{my:"bottom center",at:"bottom center",of:this.target}},positionPopupChoice:function(){return{my:"top left",at:"bottom left",of:this.target}},positionPopup:function(){return this.portfolioSelectionView?this.positionPopupSelectionPortfolio:this.positionPopupChoice},followIcon:function(){return{name:"Follow",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},wrapperAttrPopup:function(){var t="topPopupPortfolio";return this.darkClass.dark&&(t+=" dark"),{class:t}}}),methods:{viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},setActiveTab:function(t){this.target=".prov_".concat(t),this.portfolioId=t,this.popupVisible=!0},progressLoaded:function(){this.$emit("progressLoaded")},changeClass:function(t){this.rowsClass=t},beforeEnter:function(t){t.style.opacity=0},enter:function(t,e){var i=null,o=this.timeFade;window.requestAnimationFrame((function n(s){i||(i=s);var r=s-i,a=r/o;if(t.style.opacity=a<1?a:1,r0?a:0,r0)return window.requestAnimationFrame(n);e()}))},openVideoModal:function(){var t="https://about.toptrader.ru/wp-content/themes/toptrader/assets/videos/TT_%D0%A1%D0%A2%D0%A0%D0%90%D0%A2%D0%95%D0%93%D0%98%D0%98.mp4";this.$store.dispatch("messenger/setOtherVideo",t),this.$store.dispatch("modal/switchTvWidget",!0)},setDataForGraph:function(t){this.firstFiveStatistic.push(t)},setHover:function(t){this.hoveredCard=t},onScrollTop:function(){this.$refs.flatTable.scrollTop()},openModal:function(){var t=this;this.countPortfolio>0?this.openModalCopyProvider({}):(this.tooltipVisible=!0,setTimeout((function(){t.tooltipVisible=!1}),2e3))},hidePopup:function(){this.popupVisible=!1,this.portfolioSelectionView&&(this.portfolioSelectionView=!1)},openModalSelectPortfolio:function(t){var e=t.target,i=t.refFunctionAddToDraft,o=t.login,n=t.nameProvider,s=t.imgFly;this.target=e,this.refFunctionAddToDraft=i,this.login=o,this.popupVisible=!0,this.nameProvider=n,this.imgFly=s,this.portfolioSelectionView=!0},changeData:function(t){this.visibleData=Object(c["a"])(Object(c["a"])({},this.visibleData),t)}},mounted:function(){this.refContainer=this.$refs.container},destroyed:function(){}},N9=W9,E9=(i("5e5e"),i("c74e"),Object(C["a"])(N9,d7,h7,!1,null,"1be21f94",null)),U9=E9.exports,V9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CardReadyMadeSolution"},[e("SlideByContract",t._b({on:{progressLoaded:t.progressLoaded}},"SlideByContract",t.$props,!1))],1)},H9=[],G9=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CardAndGraph",class:t.rootClass},[e("transition",{attrs:{name:"fade",appear:""}},[t.noData?e("div",{staticClass:"noData"},[e("div",{staticClass:"wrapperSvg"},[e("svgIcon",t._b({},"svgIcon",t.iconBigData,!1))],1),t._v(t._s(t.$t("no_data")))]):t.getStatusProgress||t.empty?e("div",{staticClass:"contentCardTop"},[t.empty?t._e():e("GraphBlockTops",{attrs:{topPortfolios:t.topPortfolios,graphData:t.graphData,completeData:t.completeData},on:{setHover:t.setHover}}),t.empty?t._e():e("div",{staticClass:"presentationCard"},[e("div",{staticClass:"iconPlay"},[e("img",{attrs:{src:i("694f"),alt:""},on:{click:function(){}}})]),e("div",{staticClass:"textPresentation"},[t._v("Как"),e("br"),t._v("инвестироать"),e("br"),t._v("в Топ?")])]),t._l(t.topPortfolios,(function(i,o){return e("div",{key:o,staticClass:"containerCard",class:{hoveredCard:t.hoveredCard===i.length}},[e("HeaderCard",{attrs:{index:o,portfolio:i}}),e("CentralCard",{attrs:{graphData:t.graphData[i.length],portfolio:i,selectedContract:t.selectedContract,statDataReadyMadeSolution:t.statDataReadyMadeSolution}}),e("FooterCard",{attrs:{portfolio:i,statDataReadyMadeSolution:t.statDataReadyMadeSolution,graphData:t.graphData,viewTooltip:t.viewTooltip,hideTooltip:t.hideTooltip}})],1)}))],2):e("div",{key:"preloader",staticClass:"containerPreloader"},[e("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,progress:t.getProgress,message:t.alertMessage,enabledMessage:!1,icon:!1}})],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:150,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},q9=[],z9=function(){var t=this,e=t._self._c;return e("header",{staticClass:"HeaderCard",class:t.darkClass},[e("div",{staticClass:"bookmark",style:t.bookmarkStyle},[t._v(t._s(t.index+1))]),e("div",{staticClass:"expertsContainer"},[e("div",{staticClass:"text"},[e("div",{staticClass:"count",class:t.countClass},[t._v(t._s(t.portfolio.length))]),e("div",{staticClass:"topText"},[t._v("TOP")])]),e("div",{staticClass:"imageExperts"},t._l(t.tenPortfolio,(function(o,n){return e("div",{key:n,staticClass:"wrapImage",on:{mouseenter:function(e){return t.mouseenterHandler(e,o)},mouseleave:t.mouseleaveHandler}},[e("img",{staticClass:"oneExpertImage",attrs:{src:"User-profile.png"===o.avatarURL?i("81bc"):o.avatarURL}})])})),0)])])},Y9=[],X9=function(t,e){return function(){var i=arguments,o=this;clearInterval(K7),K7=setTimeout((function(){t.apply(o,i)}),e)}},Q9={name:"HeaderCard",mixins:[xt,rT],props:{index:{type:Number},portfolio:{type:Array}},computed:{bookmarkStyle:function(){var t;switch(this.index+1){case 1:t=this.darkClass.dark?"#D59200":"#FFDE94";break;case 2:t=this.darkClass.dark?"#AC8068":"#E7C6B4";break;case 3:t=this.darkClass.dark?"#757474":"#CCCACA";break;default:t=this.darkClass.dark?"rgba(245,245,245, .2)":"#F5F5F5"}return{background:t}},countClass:function(){return{two:this.portfolio.length>9}},tenPortfolio:function(){return this.portfolio.slice(-10)}},methods:{mouseenterHandler:X9((function(t,e){this.mouseEnterFunction(t,{imageForSource:e.avatarURL,nameSource:e.userName,accountId:e.accountId,sequenceId:e.sequenceid,noActiveButton:!0,position:"left"})}),300),mouseleaveHandler:function(){clearInterval(K7),this.mouseLeaveFunction()}}},J9=Q9,K9=(i("b26b"),Object(C["a"])(J9,z9,Y9,!1,null,"70bebef0",null)),Z9=K9.exports,ttt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"FooterCard",class:t.darkClass},[e("div",{staticClass:"wrapButton",on:{mouseenter:t.viewTooltip,mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconAdd,disable:t.isLoadingCreated||t.isLoadingStart},on:{toggle:t.addToDraft}},[t.isLoadingCreated?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1),e("ButtonIconFlat",{staticClass:"buttonCustom hollowPig",attrs:{disable:t.isLoadingCreated||t.isLoadingStart,icon:t.iconCopy},on:{toggle:t.startCopy}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):[e("span",{staticClass:"textButton"},[t._v("Копировать")]),e("span",{staticClass:"textButton"},[t._v("SF 33%")])]],2)],1)},ett=[],itt={name:"FooterCard",mixins:[xt,lW,Dq],inject:["openModalCopyProvider"],props:{portfolio:{type:Array},graphData:{type:Object},statDataReadyMadeSolution:{type:Array},viewTooltip:{type:Function},hideTooltip:{type:Function}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},computed:{iconAdd:function(){return this.isLoadingCreated?{}:{name:"Add",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconCopy:function(){return this.isLoadingStart?{}:{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},name:function(){return"Топ ".concat(this.portfolio.length)},portfolioForSlider:function(){return this.portfolio}}},ott=itt,ntt=(i("0983"),Object(C["a"])(ott,ttt,ett,!1,null,"5a5cc73a",null)),stt=ntt.exports,rtt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CentralCard",class:t.darkClass},[e("div",{staticClass:"commonBlock"},[e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"titleText"},[t._v(t._s(t.$t("successful_trades_full")))]),e("div",{staticClass:"circleGraph"},[e("ProgressRoundDiagram",{attrs:{width:80,height:80,widthBorder:10,percent:t.percent}})],1),e("div",{staticClass:"infoText"},[t._v(t._s(t.profitTransaction)+" из "+t._s(t.allTransactions)),e("br"),t._v("прибыльных сделок")])]),e("div",{staticClass:"averageAndGrowt"},[e("div",{staticClass:"growtValue"},[e("div",{staticClass:"title"},[t._v("Доход, pip")]),e("div",{staticClass:"value"},[e("div",{staticClass:"triangle",class:t.pipsData.pip.dopClass}),t._v(t._s(t.pipsData.pip.value))])]),e("div",{staticClass:"dayValue"},[e("div",{staticClass:"title"},[t._v("Прирост в день")]),e("div",{staticClass:"value",class:t.pipsData.avgProcPipDay.dopClass},[t._v(t._s(t.pipsData.avgProcPipDay.value)+"%")])]),e("div",{staticClass:"monthValue"},[e("div",{staticClass:"title"},[t._v("Прирост в месяц")]),e("div",{staticClass:"value",class:t.pipsData.avgProcPipMonth.dopClass},[t._v(t._s(t.pipsData.avgProcPipMonth.value)+"%")])])])]),e("div",{staticClass:"minInvesting"},[t._v("Минимальная Инвестиция: "),e("span",{staticClass:"green"},[t._v("$ "+t._s(t.minMoney.valueFormatted))])])])},att=[],ctt={name:"CentralCard",mixins:[xt],props:{portfolio:{type:Array},statDataReadyMadeSolution:{type:Array},graphData:{type:Array},selectedContract:{type:String}},components:{ProgressRoundDiagram:c$},data:function(){return{leverage:3,minCountTransaction:30,minPrice:1e3}},computed:{allTransactions:function(){return this.portfolio.reduce((function(t,e){return t+e.closedCount}),0)},profitTransaction:function(){return this.portfolio.reduce((function(t,e){return t+e.pClosedCount}),0)},percent:function(){return 100*this.profitTransaction/this.allTransactions},accountsAndContract:function(){if("all"===this.selectedContract){var t={};return this.portfolio.forEach((function(e){var i=e.accountId;t[i]||(t[i]=[]),t[i].push(e.contract)})),t}},accountsPortfolio:function(){var t=this.portfolio.map((function(t){return t.accountId}));return Array.from(new Set(t))},statPortfolio:function(){var t=this,e=this.statDataReadyMadeSolution.filter((function(e){return t.accountsPortfolio.includes(e.accountId)}));return this.accountsAndContract?e.map((function(e){return{accountId:e.accountId,data:e.data.filter((function(i){return t.accountsAndContract[e.accountId].includes(i.contract)}))}})):e},statDataGraph:function(){return MW(this.statPortfolio.map((function(t){return t.data})),(function(t){return t.pip}),this.portfolio.length)},minMoney:function(){var t=this.minCountTransaction*this.portfolio.length,e=t*this.minPrice;return{value:e/this.leverage,valueFormatted:Lm(e/this.leverage,2,!0)}},avgProcPipDay:function(){var t=this.portfolio.reduce((function(t,e){return t+e.avgProcPipDay}),0);return t/this.portfolio.length},avgProcPipMonth:function(){var t=this.portfolio.reduce((function(t,e){return t+e.avgProcPipMonth}),0);return t/this.portfolio.length},pipsData:function(){return{pip:{value:Lm(this.graphData.at(-1)[1],2,!0),dopClass:this.graphData.at(-1)[1]>=0?"green":"red"},avgProcPipDay:{value:Lm(this.avgProcPipDay,2,!0),dopClass:this.avgProcPipDay>=0?"green":"red"},avgProcPipMonth:{value:Lm(this.avgProcPipMonth,2,!0),num:this.avgProcPipMonth,dopClass:this.avgProcPipMonth>=0?"green":"red"}}}}},ltt=ctt,utt=(i("6b73"),Object(C["a"])(ltt,rtt,att,!1,null,"7896d338",null)),dtt=utt.exports,htt=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"GraphBlockTops",class:t.rootClass},[e("div",{ref:"resizeContainer",staticClass:"resizeContainer"},[e("header",[e("div",{staticClass:"text"},[t._v("Сравнение Топов")]),e("div",{staticClass:"activeBlock"},[t.expand?t._e():e("div",{staticClass:"pseudoButton",on:{click:t.toBeSmall}},[e("svgIcon",t._b({},"svgIcon",t.expandLeftRightIcon,!1))],1),e("div",{staticClass:"pseudoButton",on:{click:t.expandToggle}},[e("svgIcon",t._b({},"svgIcon",t.expandIcon,!1))],1)])]),e("div",{staticClass:"contentGraph"},[t.isVisibleList?e("div",{staticClass:"listProviders"},[e("div",{staticClass:"scrollData"},[e("transition-group",{attrs:{name:"listExperts",tag:"div"}},t._l(t.dataForCheckboxSorted,(function(i){return e("CheckboxBlock",{key:i.id,attrs:{portfolioLength:i.id,color:i.color,check:i.check,graphData:t.graphData[i.id]},on:{setStatus:t.setStatus,setHover:t.setHover}})})),1)],1)]):t._e(),t.visibleGraph?e("LineEventChart",{key:t.points.length+t.small,attrs:{points:t.points,roundIndicator:t.small,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",widthYaxis:t.small?"15px":"7rem",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:t.hoverPoint}}):t._e()],1)])])},ptt=[],gtt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckboxBlock",class:t.rootClass,on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("div",{staticClass:"checkbox",class:{colored:t.color},style:t.styleColor},[e("DxCheckBox",{attrs:{value:t.check,elementAttr:{class:"checkBoxCustom"},onValueChanged:t.setStatus}})],1),e("div",{staticClass:"nameAndAvatar"},[e("div",{staticClass:"name"},[t._v(t._s(t.portfolioName))])]),e("hr"),e("div",{staticClass:"resultValue",style:{color:t.color}},[t._v(t._s(t.closeAbsProfit)+" pip")]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionBottomCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},ftt=[],mtt={name:"CheckboxBlock",mixins:[xt,Ot],props:{portfolioLength:{type:Number},lastDataChart:{type:Number,default:0},color:{type:String,default:"green"},check:{type:Boolean},graphData:{type:Array}},components:{DxCheckBox:Th["DxCheckBox"],Avatar:E},data:function(){return{hover:!1,textTooltip:""}},computed:{rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{hover:this.hover})},getTheme:function(){return this.darkClass.dark?"dark":"light"},portfolioName:function(){return"Топ "+this.portfolioLength},styleColor:function(){return this.color?{"--color-checkbox":this.color}:{}},dataIconPlus:function(){return{name:"Plus",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},dataIconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},closeAbsProfit:function(){return this.graphData?this.graphData.at(-1)[1]:0}},methods:{setStatus:function(t){this.$emit("setStatus",{status:t.value,id:this.portfolioLength})},mouseenterHandler:function(){this.hover=!0,this.$emit("setHover",this.portfolioLength)},mouseleaveHandler:function(){this.hover=!1,this.$emit("setHover",null)}}},vtt=mtt,ytt=(i("9ddcb"),Object(C["a"])(vtt,gtt,ftt,!1,null,"815ceea4",null)),Ctt=ytt.exports,btt={name:"GraphBlockTops",mixins:[xt,qe],props:{topPortfolios:{type:Array},completeData:{type:Boolean},graphData:{type:Object}},components:{LineEventChart:Uk,CheckboxBlock:Ctt},data:function(){return{expand:!1,small:!0,points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1,checked:{}}},computed:{rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{small:this.small})},expandIcon:function(){return{name:this.expand?"Unexpand":"Expand",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},expandLeftRightIcon:function(){return{name:this.small?"Block-expand-right-close":"Block-expand-left-close",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},colors:function(){var t=this.getSetRandomColors,e=[];return this.topPortfolios.length>10&&Array.from(new Array(this.topPortfolios.length-5)).forEach((function(){var t=uB(),i=t.color,o=t.fill;e.push({color:i,fill:o})})),[].concat(Object(x["a"])(t),e)},dataForCheckbox:function(){var t=this;return this.topPortfolios.map((function(e,i){return{id:e.length,check:t.checked[e.length],color:t.colors[i].color,fill:t.colors[i].fill}}))},dataForCheckboxSorted:function(){return this.dataForCheckbox.sort((function(t,e){return e.check-t.check}))},portfolioFiltered:function(){return this.dataForCheckboxSorted.filter((function(t){return t.check}))},isVisibleList:function(){return!!this.expand||!this.small}},watch:{completeData:function(t){t&&this.setPointsForChart()},topPortfolios:function(t){var e=this;t.length>0&&(this.checked={},t.forEach((function(t){e.$set(e.checked,t.length,!0)})))}},mounted:function(){var t=this;this.topPortfolios.forEach((function(e){t.$set(t.checked,e.length,!0)})),this.completeData&&this.setPointsForChart()},methods:{expandToggle:function(){var t=document.querySelector(".wrapperForComponent"),e=this.$refs.container,i=this.$refs.resizeContainer,o=t.getBoundingClientRect(),n=o.width,s=o.height,r=e.getBoundingClientRect(),a=r.width,c=r.height,l=n-a,u=s-c,d=null,h=800,p=this;window.requestAnimationFrame((function o(r){d||(d=r);var g=r-d,f=g/h,m=a+l*f,v=c+u*f;if(p.expand&&(m=n-l*f,v=s-u*f),i.style.width=m+"px",i.style.height=v+"px",g1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setHover:function(t){this.$emit("setHover",t)}}},Stt=btt,Ptt=(i("9df1"),Object(C["a"])(Stt,htt,ptt,!1,null,"a92c08ae",null)),Ttt=Ptt.exports,xtt={name:"CardAndGraph",mixins:[xt,Ot],props:{topPortfolios:{type:Array},accountsArr:{type:Array},getStatusProgress:{type:Boolean},statDataReadyMadeSolution:{type:Array},selectedContract:{type:String},getProgress:{type:[Number,String]},alertMessage:{type:String},empty:{type:Boolean,default:!1}},components:{HeaderCard:Z9,CentralCard:dtt,FooterCard:stt,GraphBlockTops:Ttt,Preloader:ah},data:function(){return{hoveredCard:null}},computed:{rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{progress:!this.getStatusProgress})},completeData:function(){var t,e;return(null===(t=this.accountsArr)||void 0===t?void 0:t.length)===(null===(e=this.statDataReadyMadeSolution)||void 0===e?void 0:e.length)},graphData:function(){var t=this;if(this.completeData){var e={};return this.topPortfolios.forEach((function(i){e[i.length]=Oq(i,t.statDataReadyMadeSolution)})),e}return{}},textTooltip:function(){return"Добавить в инвестиции как черновик"},noData:function(){var t;return 0===(null===(t=this.topPortfolios[0])||void 0===t?void 0:t.length)},iconBigData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c",size:40}}},watch:{},mounted:function(){},destroyed:function(){},methods:{setHover:function(t){this.hoveredCard=t}}},Ott=xtt,wtt=(i("19d1"),Object(C["a"])(Ott,G9,q9,!1,null,"12ee6c8a",null)),_tt=wtt.exports,Att=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SlideByContract"},[e("Scroller",t._b({on:{setSelectedSignal:t.setSelectedSignal,setPage:t.setPage,setView:t.setView,setExpand:t.setExpand}},"Scroller",t.scrollerProps,!1)),e("div",{staticClass:"wrapperForComponent"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[e(t.getNamePage,t._b({tag:"component",on:{progressLoaded:t.progressLoaded,closeSidebar:t.closeSidebar}},"component",t.getProps[t.getNamePage],!1))],1)],1)],1)},Dtt=[],ktt=function(){var t=this,e=t._self._c;return e("div",{ref:"scroller",staticClass:"Scroller",class:t.rootClass,style:t.rootStyle,on:{mouseenter:t.mouseEnterHandlerNested,mouseleave:t.mouseleaveHandlerNested}},[e("div",{staticClass:"myChoice",on:{mouseenter:t.mouseEnterHandler,mouseleave:t.mouseleaveHandler,mousemove:t.mouseMoveHandler}},[t.isVisible?e("ButtonIconFlat",{staticClass:"buttonCustom",class:{activeBorder:["Block","Rows"].includes(t.view)},attrs:{disabled:t.disabledButton,icon:t.iconWindow},on:{toggle:function(e){return t.setView(t.isExperts?"Rows":"Block")}}}):t._e(),t.isVisible?e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:["Slider","CompareGraphTop"].includes(t.namePage)},attrs:{icon:t.iconTop,disabled:t.disabledButton},on:{toggle:function(e){return t.setPage("Slider")}}},[t.smallScreen?t._e():e("span",[t._v(t._s(t.$t("tops")))])]):t._e(),t.isVisible?e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:"CardExpertStrategies"===t.namePage},attrs:{icon:t.iconProvider,disabled:t.disabledButton},on:{toggle:function(e){return t.setPage("CardExpertStrategies")}}},[t.smallScreen?t._e():e("span",[t._v(t._s(t.$t("providers2")))])]):t._e(),e("div",{staticClass:"wrpaExpandButton"},[t.nestedComponent?t._e():e("ButtonIconFlat",{staticClass:"buttonCustom expandButton",attrs:{icon:t.iconExpand},on:{toggle:t.expandHandler}})],1)],1),t.isVisible&&t.topView?e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:"Slider"===t.namePage},attrs:{icon:t.iconFilter,disabled:t.disabledButton},on:{toggle:function(e){return t.setPage("Slider")}}},[t.smallScreen?t._e():e("span",[t._v(t._s(t.$t("filter")))])]),e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:"CompareGraphTop"===t.namePage},attrs:{icon:t.iconCompare,disabled:t.disabledButton},on:{toggle:function(e){return t.setPage("CompareGraphTop")}}},[t.smallScreen?t._e():e("span",[t._v(t._s(t.$t("comparison")))])])],1):t.isVisible?e("SliderPercent",{attrs:{smallScreen:t.smallScreen,defaultFilterByTraders:t.defaultFilterByTraders,setParamFiltering:t.setParamFiltering,getStatusProgress:t.getStatusProgress}}):t._e(),t.isVisible?e("div",{staticClass:"wrap"},[e("div",{staticClass:"contentSignals"},[t.arrayForAccordion?e("div",{staticClass:"wraperSignals"},[e("Accordion",{attrs:{collapsible:!0,"data-source":t.arrayForAccordion,time:500,openIndex:0},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"headerBlock"},[e("div",{staticClass:"titleCount"},[e("span",{staticClass:"title"},[t._v(t._s(null===o||void 0===o?void 0:o.title))])])])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"ordersContainer"},t._l((null===o||void 0===o?void 0:o.array)||[],(function(i){return e("div",{key:i.s,staticClass:"instrument",class:{hovered:i.s===t.selectedContract&&i.instrumentType===t.instrumentType},on:{click:function(e){return t.clickHandler(i.s,i.instrumentType)}}},[e("span",{staticClass:"title"},[t._v(t._s("all"===i.s?t.$t("all"):i.s))])])})),0)]}}],null,!1,3432163563)})],1):t._e()])]):!t.isVisible&&t.recursion?e("Scroller",{attrs:{recursion:!1,visibleDopBlock:(t.hovered||t.hoveredNested)&&t.expand&&!t.isVisible,selectedContract:t.selectedContract,view:t.view,namePage:t.namePage,topView:t.topView,getStatusProgress:t.getStatusProgress,defaultFilterByTraders:t.defaultFilterByTraders,setParamFiltering:t.setParamFiltering},on:{setHovered:t.setHovered,triggerClickHandler:t.triggerClickHandler,triggerSetView:t.triggerSetView,triggerSetPage:t.triggerSetPage}}):t._e()],1)},Itt=[],Btt=(i("3f1c"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"SliderPercent",class:t.darkClass},[e("div",{staticClass:"wrpaPercentTrack",class:{smallScreen:t.smallScreen}},[t.smallScreen?t._e():e("div",{staticClass:"minValue"},[t._v("0%")]),e("div",{ref:"track",staticClass:"sliderCustom"},[e("div",{staticClass:"blueLine"}),e("div",{ref:"caret",staticClass:"caret",class:t.caretClass,on:{pointerdown:t.pointerdownHandler}},[t._v(t._s(t.getPercent))])]),t.smallScreen?t._e():e("div",{staticClass:"maxValue"},[t._v("100%")])])])}),Mtt=[],$tt={name:"SliderPercent",components:{},props:{smallScreen:{type:Boolean},defaultFilterByTraders:{type:Object},setParamFiltering:{type:Function},getStatusProgress:{type:Boolean}},mixins:[xt],data:function(){return{percent:this.defaultFilterByTraders.ProcPosOrdersFrom}},watch:{},computed:{getDescriptionText:function(){return this.smallScreen?this.$t("successful_trades2"):"".concat(this.$t("successful_trades2"),": >").concat(this.percent,"%")},getPercent:function(){return this.percent+"%"},caretClass:function(){return{notActive:!this.getStatusProgress,smallScreen:this.smallScreen,green:this.percent>=50,red:this.percent<50}}},methods:{pointerdownHandler:function(t){this.getStatusProgress&&(this.caretEl=this.$refs.caret,this.trackEl=this.$refs.track,this.firstCoordinate=t.pageX,this.currentPosition=new WebKitCSSMatrix(getComputedStyle(this.caretEl).transform).m41,this.maxPosition=this.trackEl.clientWidth-this.caretEl.clientWidth,document.onpointermove=this.pointerMoveHandler,document.onpointerup=this.pointerUpHandler)},pointerMoveHandler:function(t){var e=t.pageX,i=this.currentPosition+(e-this.firstCoordinate);i<=0?this.caretEl.style.transform="translate3d(0, 0, 0)":i>=this.maxPosition?this.caretEl.style.transform="translate3d(".concat(this.maxPosition,"px, 0, 0)"):(this.trackEl.style.setProperty("--width-line",i+25+"px"),this.caretEl.style.transform="translate3d(".concat(i,"px, 0, 0)"),this.percent=10*Math.round(100*i/this.maxPosition/10))},pointerUpHandler:function(){document.onpointermove=null,document.onpointerup=null,this.caretEl=null,this.trackEl=null,this.firstCoordinate=null,this.currentPosition=null,this.maxPosition=null,this.percent!==this.defaultFilterByTraders.ProcPosOrdersFrom&&this.setParamFiltering({param:"ProcPosOrdersFrom",data:this.percent})}},mounted:function(){var t=this.$refs.caret,e=this.$refs.track,i=t.clientWidth,o=e.clientWidth-i,n=o/2;e.style.setProperty("--width-line",n+25+"px"),t.style.transform="translate3d(".concat(n,"px, 0, 0)")}},Ltt=$tt,Ftt=(i("6f19c"),Object(C["a"])(Ltt,Btt,Mtt,!1,null,"50ea861e",null)),jtt=Ftt.exports;function Rtt(t){var e=t.el,i=t.cssProperty,o=t.timeOperation,n=t.startValue,s=t.finishValue,r=null,a=s-n;window.requestAnimationFrame((function t(c){r||(r=c);var l=c-r,u=l/o;if(e.style[i]=n+a*u+"px",u<1)return window.requestAnimationFrame(t);e.style[i]=s+"px"}))}var Wtt={name:"Scroller",mixins:[xt],props:{topPortfoliosLength:{type:Number},namePage:{type:String},view:{type:[Boolean,String]},recursion:{type:Boolean,default:!0},visibleDopBlock:{type:Boolean,default:!1},buttonsValue:{type:Object},setButtonsValue:{type:Function},topView:{type:Boolean},selectedContract:{type:String},setParamFiltering:{type:Function},defaultFilterByTraders:{type:Object},getStatusProgress:{type:Boolean},expand:{type:Boolean},instrumentType:{type:String},emptyProvider:{type:Boolean}},components:{SliderPercent:jtt,Accordion:zP},data:function(){return{time:800,pressed:!1,caretEl:null,trackEl:null,wrapSignalsEl:null,firstCoordinate:null,currentPosition:null,maxPosition:null,maxScroll:null,stop:!1,isVisible:!0,hovered:!1,hoveredNested:!1,symbolList:null}},watch:{expand:function(t){var e=this,i=this.$refs.scroller,o=i.getBoundingClientRect().width,n=t?this.widthExpand:this.widthFull;Rtt({timeOperation:this.time,el:i,cssProperty:"width",startValue:o,finishValue:n}),t?this.isVisible=!1:setTimeout((function(){e.isVisible=!0,e.hovered=!1,e.hoveredNested=!1}),this.time)},getCatalogs:{handler:function(){this.symbolList||this.setSymbolList()},deep:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserQuotesLibrary:"tradingTopBarSettings/getUserQuotesLibrary",getScreenWidth:"user/getScreenWidth",getCatalogs:"quotesCatalogs/getCatalogs"})),{},{disabledButton:function(){return!this.getStatusProgress&&!this.emptyProvider},nestedComponent:function(){return!this.recursion},smallScreen:function(){return this.getScreenWidth<=1105},isExperts:function(){var t;return"experts"===(null===(t=this.buttonsValue)||void 0===t?void 0:t.whoAreWeShowing)},iconWindow:function(){return{name:this.isExperts?"SortLine":"Windows4",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconExpand:function(){return{name:this.expand?"Block-expand-right-close":"Block-expand-left-close",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconTop:function(){return this.smallScreen?{name:"Top-Portfolio",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}:{}},iconProvider:function(){return this.smallScreen?{name:"Provider",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}:{}},iconFilter:function(){return this.smallScreen?{name:"Filter",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}:{}},iconCompare:function(){return this.smallScreen?{name:"Compare",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}:{}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{expand:this.expand&&!this.nestedComponent,smallScreen:this.smallScreen,nested:this.nestedComponent,visibleSlide:this.nestedComponent&&this.visibleDopBlock})},widthFull:function(){return this.smallScreen?150:240},widthExpand:function(){return 40},symbolListForex:function(){var t=this.getUserQuotesLibrary.map((function(t){return{id:t,value:t,type:"Forex"}}));return[{id:"all",value:"all",type:"Forex"}].concat(Object(x["a"])(t))},arrayForAccordion:function(){var t=this,e=Object(c["a"])({},this.getCatalogs);if(0===Object.values(e).filter(Boolean).length)return!1;delete e["all"];var i=Object.entries(e).map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1],s="Forex"===o?n.filter((function(e){return t.getUserQuotesLibrary.includes(e.s)})):n;return{title:o,array:[{id:"all",s:"all",instrumentType:s[0].instrumentType}].concat(Object(x["a"])(s))}})),o=i.findIndex((function(t){return"Forex"===t.title})),n=i[o];return n.array.length<3&&(n.array=[n.array[0]].concat(Object(x["a"])(e["Forex"]))),[n].concat(Object(x["a"])(i.toSpliced(o,1)))},rootStyle:function(){return{"--count":32*this.arrayForAccordion.length+"px"}}}),methods:{expandHandler:function(){this.$emit("setExpand")},clickHandler:function(t,e){var i={contract:t,instrumentType:e};this.nestedComponent?this.$emit("triggerClickHandler",i):this.$emit("setSelectedSignal",i)},triggerClickHandler:function(t){this.clickHandler(t)},setPage:function(t){this.nestedComponent?this.$emit("triggerSetPage",t):(this.$emit("setPage",t),"CardExpertStrategies"===t?this.setButtonsValue({data:"experts",field:"whoAreWeShowing"}):"Slider"===t&&this.setButtonsValue({data:"tops",field:"whoAreWeShowing"}))},triggerSetPage:function(t){this.setPage(t)},setView:function(t){this.nestedComponent?this.$emit("triggerSetView",t):this.$emit("setView",t)},triggerSetView:function(t){this.setView(t)},mouseEnterHandler:function(){this.isVisible||(this.hovered=!0)},mouseMoveHandler:function(){this.isVisible||this.hovered||(this.hovered=!0)},mouseleaveHandler:function(){var t=this;this.isVisible||setTimeout((function(){t.hovered=!1}),0)},mouseEnterHandlerNested:function(){this.nestedComponent&&this.$emit("setHovered",!0)},mouseleaveHandlerNested:function(){this.nestedComponent&&this.$emit("setHovered",!1)},setHovered:function(t){this.isVisible||(this.hoveredNested=t)},setSymbolList:function(){var t=this,e={};Object.keys(this.getCatalogs).forEach((function(i){"all"!==i&&(e[i]=t.getCatalogs[i].map((function(t){return{id:t.s,value:t.s,type:i}})),e[i]=[{id:"all",value:"all",type:i}].concat(Object(x["a"])(e[i])))})),this.symbolList=e}},mounted:function(){Object.keys(this.getCatalogs).length>1&&this.setSymbolList()}},Ntt=Wtt,Ett=(i("d7d8"),Object(C["a"])(Ntt,ktt,Itt,!1,null,"e3649f1a",null)),Utt=Ett.exports,Vtt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Slider",class:t.darkClass,style:t.rootStyle},[e("transition",{attrs:{name:"fade",appear:""}},[t.emptyData?e("div",{staticClass:"emptyData"},[e("div",{staticClass:"wrapperSvg"},[e("svgIcon",t._b({},"svgIcon",t.iconBigData,!1))],1),t._v(t._s(t.$t("no_data")))]):t._e()]),e("transition",{attrs:{name:"fade",appear:""}},[t.emptyData?t._e():e("button",{staticClass:"buttonNextSlide",on:{click:function(e){return t.nextSlide(1)}}},[e("svgIcon",t._b({},"svgIcon",t.iconArrow,!1))],1)]),t.emptyData?t._e():e("transition-group",{key:t.selectedContract,staticClass:"animate",attrs:{name:"list",css:!1,tag:"div"},on:{"before-enter":t.beforeEnter,enter:t.enter,leave:t.leave}},t._l(t.slidersCount,(function(i,o){return e("SlideItem",{key:i,attrs:{portfolioForSlider:t.slidersArr[o],analyticData:0===o?t.statData:null,statDataReadyMadeSolution:t.statDataReadyMadeSolution,count:i,selectedContract:t.selectedContract,index:o,allTops:t.allTops,lengthArr:t.slidersCount.length,stopClick:t.stopClick,getStatusProgress:t.getStatusProgress,expand:t.expand,isVisible:t.isVisible},on:{setSlideTop:t.setSlideTop,setExpand:t.setExpand,closeSidebar:t.closeSidebar}})})),1)],1)},Htt=[],Gtt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SlideItem",class:t.darkClass,style:t.styleRoot},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isVisibleWrap?e("div",{key:"Sidebar",staticClass:"visibleWrapp"},[e("Sidebar",{attrs:{stopClick:t.stopClick,index:t.index,portfolioForSlider:t.portfolioForSlider,statDataReadyMadeSolution:t.statDataReadyMadeSolution,analyticData:t.analyticData,selectedContract:t.selectedContract,expand:t.expand,isVisible:t.isVisible,pipsData:t.pipsData},on:{setExpand:t.setExpand}}),e("ProfitAndAnalytic",{attrs:{allTops:t.allTops,countTop:t.portfolioForSlider.length,statPortfolio:t.statPortfolio,portfolioForSlider:t.portfolioForSlider,analyticData:t.analyticData,index:t.index,stopClick:t.stopClick,accountsAndContract:t.accountsAndContract,selectedContract:t.selectedContract,pipsData:t.pipsData},on:{setSlideTop:t.setSlideTop,closeSidebar:t.closeSidebar}})],1):t.isVisiblePreview||!t.isVisibleWrap?e("div",{key:"Preview",staticClass:"visiblePreview"},[e("SidebarLoader"),e("ProfitAndAnalyticLoader")],1):t._e()])],1)},qtt=[],ztt=function(){var t,e,i=this,o=i._self._c;return o("div",{staticClass:"Sidebar",class:i.rootClass,on:{mouseenter:i.mouseEnterHandler,mouseleave:i.mouseleaveHandler}},[o("div",{staticClass:"topData"},[o("div",{staticClass:"buttonTabsAndName"},[o("div",{staticClass:"nameSection"},[i.isVisibleData?o("div",{staticClass:"nameTop",class:{isContract:i.isContract}},[i._v(i._s(i.name))]):i._e(),i.isVisibleData?o("div",{staticClass:"pipAndPersent"},[o("span",{staticClass:"pip",class:null===(t=i.pipsData)||void 0===t||null===(t=t.pip)||void 0===t?void 0:t.dopClass},[i._v(i._s(null===(e=i.pipsData)||void 0===e||null===(e=e.pip)||void 0===e?void 0:e.value)+" "),o("span",{staticClass:"pipText"},[i._v("pip  ")])])]):i._e(),i.nestedComponent?i._e():o("ButtonIconFlat",{staticClass:"buttonCustom expandButton",attrs:{icon:i.iconExpand},on:{toggle:i.setExpand}})],1),i.isVisibleData?o("div",{staticClass:"buttonsSection"},[o("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:"Statistic"===i.activeComponent},on:{toggle:function(t){return i.setActiveComponent("Statistic")}}},[i._v(i._s(i.$t("statistic")))]),o("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{activeBorder:"Users"===i.activeComponent},on:{toggle:function(t){return i.setActiveComponent("Users")}}},[i._v(i._s(i.$t("participants")))])],1):i._e()])]),i.isVisibleData?o("div",{staticClass:"tabsContent"},[o("transition",{attrs:{name:"fade-slide",mode:"out-in"}},[o("keep-alive",[o(i.getActiveComponent,i._b({tag:"component"},"component",i.props[i.getActiveComponent],!1))],1)],1)],1):i._e(),i.isVisibleData&&!i.getIsReal?o("div",{staticClass:"buttonAdd"},[o("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{disable:i.isLoadingCreated||i.isLoadingStart,icon:i.iconStar},on:{toggle:i.addToDraft}},[i.isLoadingCreated?o("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):o("span",{staticClass:"textButton"},[i._v(i._s(i.$t("add")))])],1),o("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:i.iconCopy,disable:i.isLoadingCreated||i.isLoadingStart},on:{toggle:i.startCopy}},[i.isLoadingStart?o("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):o("span",{staticClass:"textButton"},[i._v(i._s(i.$t("copy")))])],1)],1):i._e(),!i.isVisible&&i.recursion?o("Sidebar",{attrs:{recursion:!1,visibleDopBlock:i.hovered&&i.expand&&!i.isVisible,selectedContract:i.selectedContract,portfolioForSlider:i.portfolioForSlider,pipsData:i.pipsData,statDataReadyMadeSolution:i.statDataReadyMadeSolution,analyticData:i.analyticData}}):i._e()],1)},Ytt=[],Xtt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Statistic",class:t.darkClass},[e("div",{staticClass:"linesData"},t._l(t.linesData,(function(i,o){return e("div",{key:o,staticClass:"lineData"},[e("div",{staticClass:"wrapData",class:i.wrapClass||""},[e("div",{staticClass:"title",class:i.dopClassTitle||""},[t._v(t._s(i.title))]),e("div",{staticClass:"value",class:i.dopClass||""},[t._v(t._s(i.value))])])])})),0),e("div",{staticClass:"profitFuture"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("forecasted_profitability")))])]),e("div",{staticClass:"smallDataGraphUpdated",on:{mouseenter:t.viewTooltipHandler,mouseleave:t.hideTooltip}},[e("div",{staticClass:"commonProfit"},[e("div",{staticClass:"value",class:"green"},[t._v("$ "+t._s(t.futureProfit.valueFormatted))]),e("div",{staticClass:"triangle green"})]),e("div",{staticClass:"percents"},[e("div",{staticClass:"percentDay",class:"green"},[t._v(t._s(t.percentProfitFuture.valueFormatted)+" %  ")]),e("div",{staticClass:"percentMonth",class:"green"},[t._v("("+t._s(t.percentMonth)+" %)")]),e("div",{staticClass:"hiddenPseudoTriangle"})])]),e("ul",{staticClass:"dopInfo"},[e("li",[e("div",{staticClass:"title"},[t._v(t._s(t.$t("minimum_funds")))]),e("div",{staticClass:"value"},[t._v("$ "+t._s(t.minMoney.valueFormatted))])]),e("li",[e("div",{staticClass:"title"},[t._v(t._s(t.$t("leverage")))]),e("div",{staticClass:"value"},[t._v(t._s(t.leverage))])]),e("li",[e("div",{staticClass:"title"},[t._v(t._s(this.$t("minimum_contract_value")))]),e("div",{staticClass:"value"},[t._v("$ "+t._s(t.minPrice.toLocaleString("ru-RU")))])]),e("li",[e("div",{staticClass:"title"},[t._v(t._s(t.$t("mnot")))]),e("div",{staticClass:"value"},[t._v(t._s(t.minCountTransaction))])]),e("li",[e("div",{staticClass:"title"},[t._v(t._s(t.$t("mm_model")))]),e("div",{staticClass:"value"},[t._v(t._s(t.$t("dynamic2")))])]),e("li",[e("div",{staticClass:"title"},[t._v(t._s(t.$t("trading_months")))]),e("div",{staticClass:"value"},[t._v(t._s(t.monthCount))])])]),e("div",{staticClass:"calc"},[t._v(t._s(t.$t("income_calculator")))]),e("div",{staticClass:"calc mb16"},[t._v(" "+t._s(t.$t("atttypaycsa")))]),e("DxTooltip",{attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionLeftCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[e("div",{staticClass:"textContent"},[e("div",{staticClass:"firstLine text"},[t._v(t._s(t.$t("tiottip")))]),e("div",{staticClass:"twoLine text"},[t._v(t._s(t.$t("ipdip")))]),e("div",{staticClass:"treeLine text"},[t._v(t._s(t.$t("ipmip")))])])])],1)},Qtt=[],Jtt={computed:{analyticDataCommon:function(){if(this.analyticData)return this.analyticData.filter((function(t){return"Common"===t.dataType}))},analyticDataSell:function(){if(this.analyticData)return this.analyticData.filter((function(t){return"Sell"===t.dataType}))},analyticDataBuy:function(){if(this.analyticData)return this.analyticData.filter((function(t){return"Buy"===t.dataType}))},commonProfitPip:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.sumPipByOrders}),0):0},buyProfitPip:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.sumPipByOrders}),0):0},sellProfitPip:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.sumPipByOrders}),0):0},ordersCount:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.ordersCount}),0):0},ordersCountBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.ordersCount}),0):0},ordersCountSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.ordersCount}),0):0},positiveOrdersCount:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.positiveOrdersCount}),0):0},averageProfitPipByOneTransaction:function(){return this.analyticDataCommon?this.allPips/this.ordersCount:0},averageProfitPipByOneTransactionBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.reduce((function(t,e){return t+e.avgPipByOrders}),0);return t/this.analyticDataBuy.length},averageProfitPipByOneTransactionSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.reduce((function(t,e){return t+e.avgPipByOrders}),0);return t/this.analyticDataSell.length},percentProfit:function(){return this.analyticDataCommon?100*this.positiveOrdersCount/this.ordersCount:0},allProfit:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.profit}),0):0},buyProfit:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.profit}),0):0},sellProfit:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.profit}),0):0},matExpectation:function(){return this.analyticDataCommon?this.allProfit/this.ordersCount:0},profitFactor:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.reduce((function(t,e){return t+e.profitFactor}),0);return t/this.analyticDataCommon.length},profitFactorBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.reduce((function(t,e){return t+e.profitFactor}),0);return t/this.analyticDataBuy.length},profitFactorSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.reduce((function(t,e){return t+e.profitFactor}),0);return t/this.analyticDataSell.length},maxDDBalance:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.reduce((function(t,e){return t+e.maxDDBalance}),0);return t/this.analyticDataCommon.length},maxDDBalanceBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.reduce((function(t,e){return t+e.maxDDBalance}),0);return t/this.analyticDataBuy.length},maxDDBalanceSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.reduce((function(t,e){return t+e.maxDDBalance}),0);return t/this.analyticDataSell.length},recoveryFactor:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.reduce((function(t,e){return t+e.recoveryFactor}),0);return t/this.analyticDataCommon.length},positiveOrdersCountBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.positiveOrdersCount}),0):0},positiveOrdersCountSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.positiveOrdersCount}),0):0},negativeOrdersCount:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.negativeOrdersCount}),0):0},negativeOrdersCountBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.negativeOrdersCount}),0):0},negativeOrdersCountSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.negativeOrdersCount}),0):0},averageProfitByTransaction:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.reduce((function(t,e){return t+e.avgProfit}),0);return t/this.analyticDataCommon.length},averageProfitByTransactionBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.reduce((function(t,e){return t+e.avgProfit}),0);return t/this.analyticDataBuy.length},averageProfitByTransactionSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.reduce((function(t,e){return t+e.avgProfit}),0);return t/this.analyticDataSell.length},allPips:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.sumPipByOrders}),0):0},maxProfit:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.map((function(t){return t.maxProfit}));return Math.max.apply(Math,Object(x["a"])(t))},maxProfitBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.map((function(t){return t.maxProfit}));return Math.max.apply(Math,Object(x["a"])(t))},maxProfitSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.map((function(t){return t.maxProfit}));return Math.max.apply(Math,Object(x["a"])(t))},minProfit:function(){if(!this.analyticDataCommon)return 0;var t=this.analyticDataCommon.map((function(t){return t.minProfit}));return Math.min.apply(Math,Object(x["a"])(t))},minProfitBuy:function(){if(!this.analyticDataBuy)return 0;var t=this.analyticDataBuy.map((function(t){return t.minProfit}));return Math.min.apply(Math,Object(x["a"])(t))},minProfitSell:function(){if(!this.analyticDataSell)return 0;var t=this.analyticDataSell.map((function(t){return t.minProfit}));return Math.min.apply(Math,Object(x["a"])(t))},comission:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.comission}),0):0},comissionBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.comission}),0):0},comissionSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.comission}),0):0},avgOrderDurationInms:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.avgOrderDurationInms}),0):0},avgOrderDurationInmsBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.avgOrderDurationInms}),0):0},avgOrderDurationInmsSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.avgOrderDurationInms}),0):0},sumOrderVolume:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.sumOrderVolume}),0):0},sumOrderVolumeBuy:function(){return this.analyticDataBuy?this.analyticDataBuy.reduce((function(t,e){return t+e.sumOrderVolume}),0):0},sumOrderVolumeSell:function(){return this.analyticDataSell?this.analyticDataSell.reduce((function(t,e){return t+e.sumOrderVolume}),0):0},firstDayTrading:function(){if(!this.analyticDataCommon)return 0;var t=[];this.analyticDataCommon.forEach((function(e){t.push(new Date(e.firstDayTrading).getTime())}));var e=Math.min.apply(Math,t),i=new Date-new Date(e),o=Math.floor(i/1e3/60/60/24);return{value:o,valueFormatted:Lm(o,2,!0)}},monthCount:function(){return this.analyticDataCommon?Math.floor(this.firstDayTrading.value/30):0}}},Ktt={name:"Statistic",mixins:[xt,Jtt,Ot],props:{stopClick:{type:Boolean},index:{type:Number},analyticData:{type:[Array,Boolean]},countTop:{type:Number},pipsData:{type:Object}},components:{ProgressRoundDiagram:c$},data:function(){return{leverage:3,minPrice:1e3,minCountTransaction:30,pricePoint:.085}},computed:{linesData:function(){var t,e,i,o,n,s;return[{title:"".concat(this.$t("tsott"),", ").concat(this.$t("days")),value:this.firstDayTrading.valueFormatted},{title:"".concat(this.$t("tiott"),", pip"),value:null===(t=this.pipsData)||void 0===t||null===(t=t.pip)||void 0===t?void 0:t.value,dopClass:null===(e=this.pipsData)||void 0===e||null===(e=e.pip)||void 0===e?void 0:e.dopClass},{title:this.$t("apptp"),value:Lm(this.averageProfitPipByOneTransaction,2,!0),dopClass:this.averageProfitPipByOneTransaction>=0?"green":"red"},{title:this.$t("tnot"),value:Lm(this.ordersCount,2,!0)},{title:"".concat(this.$t("percentage_successful_trades"),", %"),value:Lm(this.percentProfit,2,!0)+" %",dopClass:"green"},{title:"".concat(this.$t("increase_per_day"),", %"),value:null===(i=this.pipsData)||void 0===i||null===(i=i.avgProcPipDay)||void 0===i?void 0:i.value,dopClass:null===(o=this.pipsData)||void 0===o||null===(o=o.avgProcPipDay)||void 0===o?void 0:o.dopClass},{title:"".concat(this.$t("increase_per_month"),", %"),value:null===(n=this.pipsData)||void 0===n||null===(n=n.avgProcPipMonth)||void 0===n?void 0:n.value,dopClass:null===(s=this.pipsData)||void 0===s||null===(s=s.avgProcPipMonth)||void 0===s?void 0:s.dopClass},{title:this.$t("mathematical_expectation"),value:Lm(this.matExpectation,2,!0),dopClass:this.matExpectation>=0?"green":"red"},{title:this.$t("profit_factor"),value:Lm(this.profitFactor,2,!0),dopClass:this.profitFactor>=0?"green":"red"},{title:"MaxDD, %",value:Lm(this.maxDDBalance,2,!0),dopClass:"red"},{title:this.$t("sharpe_ratio"),value:"---",dopClass:"green"},{title:this.$t("recovery_factor"),value:Lm(this.recoveryFactor,2,!0),dopClass:this.recoveryFactor>=0?"green":"red"}]},iconArrow:function(){return{name:"Arrow-nano-top",color:this.darkClass.dark?"#00ffac":"#008e72"}},minMoney:function(){var t=this.minCountTransaction*this.countTop,e=t*this.minPrice;return{value:e/this.leverage,valueFormatted:Lm(e/this.leverage,2,!0)}},futureProfit:function(){return{value:this.commonProfitPip*this.pricePoint,valueFormatted:Lm(Math.floor(this.commonProfitPip*this.pricePoint),2,!0)}},percentProfitFuture:function(){return{value:100*this.futureProfit.value/this.minMoney.value,valueFormatted:Lm(100*this.futureProfit.value/this.minMoney.value,2,!0)}},percentMonth:function(){return Fm(this.percentProfitFuture.value/this.monthCount,2)}},watch:{},mounted:function(){},destroyed:function(){},methods:{viewTooltipHandler:function(t){this.viewTooltip(t)}}},Ztt=Ktt,tet=(i("e127"),Object(C["a"])(Ztt,Xtt,Qtt,!1,null,"8937ed6e",null)),eet=tet.exports,iet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Users",class:t.darkClass},[e("div",{staticClass:"headerUsers"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("participant")))]),e("div",{staticClass:"title"},[t._v(t._s(t.$t("instrument")))]),e("div",{staticClass:"title"},[t._v(t._s(t.$t("increase"))+", pip")])]),t._l(t.portfolioForSlider,(function(t,i){return e("LineUser",{key:i,attrs:{user:t}})})),e("div",{staticClass:"result"},[e("div",{staticClass:"title"},[t._v(t._s(t.$t("tops_profit")))]),e("div",{staticClass:"value",class:t.pipsData.pip.dopClass},[t._v(t._s(t.pipsData.pip.value)+" pip")])])],2)},oet=[],net=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LineUser",class:t.darkClass},[e("div",{staticClass:"oneBlock userBlock"},[e("div",{staticClass:"wrapImage",on:{mouseenter:function(e){return t.mouseenterHandler(e,t.user)},mouseleave:t.mouseleaveHandler}},[e("img",{attrs:{src:t.userAvatar,alt:""}})]),e("hr")]),e("div",{staticClass:"twoBlock userBlock"},[e("hr"),e("div",{staticClass:"containerContract"},[t._v(t._s(t.user.contract))]),e("hr")]),e("div",{staticClass:"threeBlock userBlock"},[e("hr"),e("div",{staticClass:"pips",class:{red:t.user.pip<0}},[t._v(t._s(t.user.pip.toLocaleString("ru-RU")))])])])},set=[],ret={name:"LineUser",components:{},props:{user:{type:Object}},mixins:[xt,rT],data:function(){return{}},watch:{},computed:{userAvatar:function(){return"User-profile.png"===this.user.avatarURL?i("81bc"):this.user.avatarURL}},methods:{mouseenterHandler:function(t,e){this.mouseEnterFunction(t,{imageForSource:e.avatarURL,nameSource:e.userName,accountId:e.accountId,sequenceId:e.sequenceid,noActiveButton:!0,position:"right"})},mouseleaveHandler:function(){this.mouseLeaveFunction()}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},aet=ret,cet=(i("3acc"),Object(C["a"])(aet,net,set,!1,null,"ef17859e",null)),uet=cet.exports,det={name:"Users",props:{portfolioForSlider:{type:Array},pipsData:{type:Object}},mixins:[xt],components:{LineUser:uet},data:function(){return{}},computed:{},watch:{},mounted:function(){},destroyed:function(){},methods:{}},het=det,pet=(i("09e2"),Object(C["a"])(het,iet,oet,!1,null,"950167de",null)),get=pet.exports,fet={name:"Sidebar",mixins:[xt,Dq],props:{stopClick:{type:Boolean},index:{type:Number},portfolioForSlider:{type:Array},statDataReadyMadeSolution:{type:Array},analyticData:{type:[Array,Boolean]},expand:{type:Boolean},isVisible:{type:Boolean},selectedContract:{type:String},recursion:{type:Boolean,default:!0},visibleDopBlock:{type:Boolean,default:!1},pipsData:{type:Object}},components:{Statistic:eet,Users:get,DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{activeComponent:"Statistic",hovered:!1,hoveredNested:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getIsReal:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.isReal},nestedComponent:function(){return!this.recursion},isVisibleData:function(){return!!this.nestedComponent||this.isVisible},isContract:function(){return"all"!==this.selectedContract},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{expand:this.expand,nested:this.nestedComponent,visibleSideBar:this.nestedComponent&&this.visibleDopBlock})},iconExpand:function(){return{name:this.expand?"Block-expand-right-close":"Block-expand-left-close",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconCopy:function(){return this.isLoadingStart?{}:{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconStar:function(){return this.isLoadingCreated?{}:{name:"Favorite-off",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},getActiveComponent:function(){return"Planet"===this.activeComponent?"Statistic":this.activeComponent},props:function(){return{Statistic:{stopClick:this.stopClick,index:this.index,analyticData:this.analyticData,countTop:this.portfolioForSlider.length,pipsData:this.pipsData},Users:{portfolioForSlider:this.portfolioForSlider,pipsData:this.pipsData}}}}),watch:{isVisible:function(t){!this.nestedComponent&&t&&(this.hovered=!1)}},methods:{setActiveComponent:function(t){this.activeComponent=t},setExpand:function(){this.$emit("setExpand")},mouseEnterHandler:function(){if(!this.nestedComponent){if(this.isVisible)return;this.hovered=!0}},mouseleaveHandler:function(){if(!this.nestedComponent){if(this.isVisible)return;this.hovered=!1}},mouseMoveHandler:function(){if(!this.nestedComponent){if(this.isVisible)return;this.hovered||(this.hovered=!0)}}}},met=fet,vet=(i("93c1"),Object(C["a"])(met,ztt,Ytt,!1,null,"4cb4b8ec",null)),yet=vet.exports,Cet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SidebarLoader",class:t.darkClass},[e("div",{staticClass:"topData"},[e("div",{staticClass:"buttonTabsAndName"},[e("div",{staticClass:"nameSection"},[e("Sceleton",{attrs:{width:71,height:32}}),e("Sceleton",{attrs:{width:150,heigh:15}})],1),e("div",{staticClass:"buttonsSection"},[e("Sceleton",{attrs:{width:"100%",height:32}}),e("Sceleton",{attrs:{width:"100%",height:32}}),e("Sceleton",{staticClass:"smallButton",attrs:{width:32,height:32}})],1)])]),e("div",{staticClass:"tabsContent"},t._l(15,(function(t){return e("div",{staticClass:"lineData"},[e("Sceleton",{attrs:{width:120,height:15}}),e("Sceleton",{attrs:{width:45,height:15}})],1)})),0),e("div",{staticClass:"buttonBlock"},[e("Sceleton",{attrs:{width:"100%",height:32}}),e("Sceleton",{attrs:{width:"100%",height:32}})],1)])},bet=[],Pet={name:"SidebarLoader",mixins:[xt],components:{Sceleton:nT}},Tet=Pet,xet=(i("13a9"),Object(C["a"])(Tet,Cet,bet,!1,null,"408e4a37",null)),Oet=xet.exports,wet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitAndAnalitic",class:t.darkClass},[e("div",{staticClass:"topButton"},[e("div",{staticClass:"lineByCircle"},t._l(t.allTops,(function(i){return e("div",{key:i,staticClass:"circle",class:{active:t.countTop===i},on:{click:function(e){return t.setSlideTop(i)}}},[t._v(t._s(i))])})),0)]),e("div",{staticClass:"tabsButtonContainer"},[e("div",{staticClass:"tabsButton",class:{active:"profit"===t.currentTab},on:{click:function(e){return t.setCurrentTab("profit")}}},[t._v(t._s(t.$t("iott")))]),e("div",{staticClass:"tabsButton",class:{active:"comparison"===t.currentTab},on:{click:function(e){return t.setCurrentTab("comparison")}}},[t._v(t._s(t.$t("comparison")))]),e("div",{staticClass:"tabsButton",class:{active:"analytic"===t.currentTab},on:{click:function(e){return t.setCurrentTab("analytic")}}},[t._v(t._s(t.$t("report")))]),e("div",{staticClass:"descriptionText"},["profit"===t.currentTab?e("div",{staticClass:"textProfit"},[e("span",{staticClass:"title"},[t._v(t._s(t.$t("iott"))+" "+t._s(t.countTop)+" "+t._s("all"!==t.selectedContract?" "+t.selectedContract:""))]),e("span",{staticClass:"pips",class:t.pipsData.pip.dopClass},[t._v(t._s(t.pipsData.pip.value)+" pip  ")])]):"analytic"===t.currentTab?e("div",{staticClass:"textAnalytic"},[t._v(t._s(t.$t("top_analytics")))]):e("div",{staticClass:"textAnalytic"},[t._v(t._s(this.$t("comparison_of_participants")))])])]),e("transition",{attrs:{name:"fade",mode:"out-in"}},[e("keep-alive",[e(t.currentComponent,t._b({tag:"component"},"component",t.propsComponent[t.currentComponent],!1))],1)],1)],1)},_et=[],Aet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitGraph",class:t.darkClass,style:t.styleRoot},[e("transition",{attrs:{name:"fade"}},[t.isLoadingStatistic?e("div",{staticClass:"containerPreloader"},[e("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,message:"",progress:t.getProgress,enabledMessage:!1,icon:!1}})],1):t._e()]),e("div",{staticClass:"smallDataGraphUpdated",on:{mouseenter:t.viewTooltipHandler,mouseleave:t.hideTooltip}},[e("div",{staticClass:"commonProfit"},[e("div",{staticClass:"value",class:t.pipsData.pip.dopClass},[t._v(t._s(t.pipsData.pip.value)),e("small",[t._v(" pip")])]),e("div",{staticClass:"triangle",class:t.pipsData.pip.dopClass})]),e("div",{staticClass:"blockDiagramm"},[0!==t.index||t.stopClick?t._e():e("ProgressRoundDiagram",{key:t.percentProfit,attrs:{width:t.sizeCircle,height:t.sizeCircle,widthBorder:t.fontSizeCircle,fontSize:.001,percent:t.percentProfit}}),e("div",{staticClass:"label"},[t._v(t._s(t.percentProfitFormatted)+"%")])],1)]),e("div",{key:t.darkClass.dark,staticClass:"graph"},[t.visibleGraph?e("LineEventChart",{key:t.countTop,attrs:{typeXAxis:"dateClear",points:t.points,metaInfoForLines:t.metaInfoLines,widthYaxis:"7rem",theme:t.getActiveTheme,minIndicator:{lines:[0]},maxIndicator:{lines:[0]},watermark:t.watermark,watermarkData:t.watermarkData},on:{hover:t.hoverPoint,clickPoint:t.hedlerClickChartPoint}}):t._e(),e("ButtonTogglePeriod",{attrs:{activeButton:t.activeButton},on:{setActiveButton:t.setActiveButton}})],1),e("div",{staticClass:"gistogramm"},[t.visibleGraph&&t.pointsForHistogram?e("GistogrammEventChart",{key:t.countTop,attrs:{points:t.pointsForHistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1),e("DxTooltip",{attrs:{visible:t.tooltipVisible&&t.activated,maxWidth:300,target:t.selector,position:t.positionLeftCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[e("div",{staticClass:"textContent"},[e("div",{staticClass:"firstLine text"},[t._v(t._s(t.$t("tiottip")))]),e("div",{staticClass:"fourline text"},[t._v(t._s(t.$t("postott")))])])])],1)},Det=[],ket=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonTogglePeriod",class:t.darkClass},[e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{active:"allHistory"===t.activeButton},on:{toggle:t.getAllHistory}},[t._v(t._s(t.$t("the_entire_story")))]),e("ButtonIconFlat",{staticClass:"buttonCustom onlyText",class:{active:"currentYear"===t.activeButton},on:{toggle:t.getCurrentYearStatistic}},[t._v(t._s("За последний год"))])],1)},Iet=[],Bet={name:"ButtonTogglePeriod",components:{},props:{activeButton:{type:String}},mixins:[xt],methods:{getAllHistory:function(){this.$emit("setActiveButton","allHistory")},getCurrentYearStatistic:function(){this.$emit("setActiveButton","currentYear")}}},Met=Bet,$et=(i("8a95"),Object(C["a"])(Met,ket,Iet,!1,null,"ce09646e",null)),Let=$et.exports,Fet={name:"ProfitGraph",inject:["setCalcPipsByStatistic"],components:{LineEventChart:Uk,GistogrammEventChart:TI,ProgressRoundDiagram:c$,Preloader:ah,ButtonTogglePeriod:Let},props:{statPortfolio:{type:Array},countTop:{type:Number},analyticData:{type:[Array,Boolean]},index:{type:Number},stopClick:{type:Boolean},accountsAndContract:{type:[Object,Boolean]},portfolioForSlider:{type:Array},selectedContract:{type:String},pipsData:{type:Object}},mixins:[xt,qe,Ot],data:function(){return{points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1,pointsForHistogram:null,textTooltip:"",activeButton:"currentYear",statPortfolioLocal:[],progress:0,isLoadingStatistic:!1,sizeCircle:130,fontSizeCircle:15,activated:!1}},watch:{activeButton:function(t){var e=this;"allHistory"===t&&0===this.statPortfolioLocal.length||(this.visibleGraph=!1,this.points=null,this.$nextTick((function(){e.setPointsForChart(),e.setPointsForHistogram()})))},index:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)},getProgress:function(t){100===t&&(this.points=null,this.visibleGraph=!1,this.isLoadingStatistic=!1,this.setPointsForChart(),this.setPointsForHistogram())}},computed:{styleRoot:function(){return{"--sizeCircle":this.sizeCircle+"px"}},statDataGraph:function(){if("allHistory"!==this.activeButton||this.statPortfolioLocal.length){var t="allHistory"===this.activeButton?this.statPortfolioLocal:this.statPortfolio;return MW(t.map((function(t){return t.data})),(function(t){return t.pip}),this.countTop)}},statDataMonth:function(){if(this.statDataGraph){var t={};return this.statDataGraph.forEach((function(e){var i=new Date(e.date),o=i.getMonth(),n=i.getFullYear(),s=new Date(n,o,1).getTime();t[s]||(t[s]=[]),t[s].push(e.sumValue)})),Object.entries(t).sort((function(t,e){return+t[0]-+e[0]}))}},getMetaInfoLinesForChat:function(){return[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:this.darkClass.dark?"#314456":"#fff",extandsIndicator:this.pipsData.avgProcPipMonth.num.toFixed(0),label:"",lineWidth:3,title:""},{type:"line",color:this.getBlueColor.color,fill:"rgba(0,0,0,0)",fillIndicator:this.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""}]},getMetaInfoForLines:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Доход"},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"}]},analyticDataCommon:function(){if(this.analyticData)return this.analyticData.filter((function(t){return"Common"===t.dataType}))},ordersCount:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.ordersCount}),0):0},positiveOrdersCount:function(){return this.analyticDataCommon?this.analyticDataCommon.reduce((function(t,e){return t+e.positiveOrdersCount}),0):0},percentProfit:function(){return this.analyticDataCommon?100*this.positiveOrdersCount/this.ordersCount:0},percentProfitFormatted:function(){return this.percentProfit?Lm(this.percentProfit,1,!0):0},getProgress:function(){return"all"===this.selectedContract?100*this.progress/Object.keys(this.accountsAndContract).length:100*this.progress/this.portfolioForSlider.length},calcPipsByStatistic:function(){return this.statDataGraph.at(-1).sumValue},watermark:function(){return"".concat(this.$t("top")," ").concat(this.countTop," ").concat("all"!==this.selectedContract?this.selectedContract:"")},watermarkData:function(){return{data:"".concat(this.pipsData.pip.value," pip"),color:"rgba(143, 168, 193, 0.1)"}}},methods:{setPointsForChart:function(){var t,e=this;this.metaInfoLines=[],this.points=[[],[]],(t=this.metaInfoLines).push.apply(t,Object(x["a"])(this.getMetaInfoLinesForChat)),this.statDataGraph.forEach((function(t){e.points[0].push({x:t.date,y:t.sumValue,date:t.date}),e.points[1].push({x:t.date,y:t.averageValue,date:t.date})})),this.visibleGraph=!0},setPointsForHistogram:function(){var t=this;this.pointsForHistogram=[[{x:0,y:0,date:0}],[],[]],this.statDataMonth.forEach((function(e,i){var o=e[1].at(-1)-e[1][0];t.pointsForHistogram[1].push({x:i,y:o,date:+e[0]}),t.pointsForHistogram[2].push({x:i,y:o/(i+1),date:+e[0]})}))},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},hedlerClickChartPoint:function(t){var e,i=t.cPointX,o=t.cPointY,n=t.point;return e="currentYear"===this.activeButton?this.statPortfolio:this.statPortfolioLocal,{statData:e,cPointX:i,cPointY:o,pointData:n}},viewTooltipHandler:function(t){this.viewTooltip(t)},getStatByContract:function(t,e){var i={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:e}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},postLocalStatistic:function(){var t=this;this.accountsAndContract?Object.keys(this.accountsAndContract).forEach((function(e){t.getStatByContract(e,t.accountsAndContract[e])})):this.portfolioForSlider.forEach((function(e){t.getStatByContract(e.accountId,[e.contract])}))},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}},setStat:function(t){this.statPortfolioLocal.push({accountId:t.dailyData.accountId,data:t.data}),this.progress+=1},getAllHistory:function(){this.statPortfolioLocal.length>0||(this.isLoadingStatistic=!0,this.visibleGraph=!1,this.points=null,this.postLocalStatistic())},setActiveButton:function(t){this.activeButton=t,"allHistory"===t&&this.getAllHistory()}},created:function(){var t=window.screen.width;t<=1441&&(this.sizeCircle=100,this.fontSizeCircle=12)},mounted:function(){this.setPointsForChart(),this.setPointsForHistogram(),this.setCalcPipsByStatistic(this.calcPipsByStatistic)},destroyed:function(){},activated:function(){this.activated=!0,this.$socketStream.$on("apiWS3",this.setMessageHandler)},deactivated:function(){this.activated=!1,this.$socketStream.$off("apiWS3",this.setMessageHandler)}},jet=Fet,Ret=(i("1340"),Object(C["a"])(jet,Aet,Det,!1,null,"b2dc082a",null)),Wet=Ret.exports,Net=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnalyticStatistic",class:t.darkClass},[e("TradingAnalytics",{attrs:{calendarDate:new Date,location:"slider",externalTopTableData:t.topTableData,externalBottomTableData:t.bottomTableData,externalBottomTableResult:t.bottomTableResult,externalWorkPiece:t.workPiece}})],1)},Eet=[],Uet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradingAnalytics",class:t.darkClass},[t.isVisibleHeader?e("header",[t._v(t._s(t.$t("trading_analytics"))+" "+t._s(t.$t("on"))+" "+t._s(t.date))]):t._e(),e("TopTable",{attrs:{dataClosedPositionDate:t.dataClosedPositionDate,statData:t.statData,statDataCommon:t.statDataCommon,statDataBuy:t.statDataBuy,statDataSell:t.statDataSell,externalTopTableData:t.externalTopTableData}}),e("BottomDetailTable",{attrs:{workPiece:t.workPiece,dataClosedPositionDate:t.dataClosedPositionDate,externalBottomTableData:t.externalBottomTableData,externalBottomTableResult:t.externalBottomTableResult}}),"slider"!==t.location?e("div",{staticClass:"TradingAnalytics-openOrders"},[e("header",[t._v(t._s(t.$t("capital_distribution")))]),e("OpenOrdersAnalitics")],1):t._e(),e("DistributionLineGraph",{attrs:{workPiece:t.externalWorkPiece||t.workPiece}})],1)},Vet=[],Het=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopTable",class:t.darkClass},t._l(t.externalTopTableData||t.topTableData,(function(i,o){var n,s,r;return e("div",{key:o,staticClass:"row",class:{blur:!t.statData}},[e("div",{staticClass:"title"},[o&&!t.statData?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",[t._v(t._s(i.title||""))])],1),e("div",{staticClass:"allTransaction",class:i.allTransaction.dopClass},[o&&!t.statData?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",[t._v(t._s(null===(n=i.allTransaction)||void 0===n?void 0:n.value))])],1),e("div",{staticClass:"transactionBuy",class:i.transactionBuy.dopClass},[o&&!t.statData?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",[t._v(t._s(null===(s=i.transactionBuy)||void 0===s?void 0:s.value))])],1),e("div",{staticClass:"transactionSell",class:i.transactionSell.dopClass},[o&&!t.statData?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",[t._v(t._s(null===(r=i.transactionSell)||void 0===r?void 0:r.value))])],1)])})),0)},Get=[],qet={name:"TopTable",mixins:[xt],props:{dataClosedPositionDate:{type:[Boolean,Array]},statData:{type:[Boolean,Array]},statDataCommon:{type:[Boolean,Object]},statDataBuy:{type:[Boolean,Object]},statDataSell:{type:[Boolean,Object]},externalTopTableData:{type:[Array,Boolean]}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},transactionBuy:function(){return this.dataClosedPositionDate?this.dataClosedPositionDate.filter((function(t){return"Buy"===t.orderType})):[]},transactionSell:function(){return this.dataClosedPositionDate?this.dataClosedPositionDate.filter((function(t){return"Sell"===t.orderType})):[]},profitFactor:function(){var t;if("number"===typeof(null===(t=this.statDataCommon)||void 0===t?void 0:t.profitFactor))return{buy:this.statDataBuy.profitFactor,sell:this.statDataSell.profitFactor,all:this.statDataCommon.profitFactor};if(!this.dataClosedPositionDate)return{};var e=this.transactionBuy.reduce((function(t,e){return e.profit<0?t+e.profit:t}),0),i=this.transactionBuy.reduce((function(t,e){return e.profit>=0?t+e.profit:t}),0),o=i/Math.abs(e),n=this.transactionSell.reduce((function(t,e){return e.profit<0?t+e.profit:t}),0),s=this.transactionSell.reduce((function(t,e){return e.profit>=0?t+e.profit:t}),0),r=s/Math.abs(n),a=this.dataClosedPositionDate.reduce((function(t,e){return e.profit<0?t+e.profit:t}),0),c=this.dataClosedPositionDate.reduce((function(t,e){return e.profit>=0?t+e.profit:t}),0),l=c/Math.abs(a);return{buy:o||0,sell:r||0,all:l||0}},topTableData:function(){return[{title:null,allTransaction:{value:this.$t("all_trades")},transactionBuy:{value:this.$t("buy")},transactionSell:{value:this.$t("sell")}},{title:this.$t("net_profit"),allTransaction:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.statDataCommon.profit,2,!0)),dopClass:this.statDataCommon.profit>=0?"green":"red"},transactionBuy:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.statDataBuy.profit,2,!0)),dopClass:this.statDataBuy.profit>=0?"green":"red"},transactionSell:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.statDataSell.profit,2,!0)),dopClass:this.statDataSell.profit>=0?"green":"red"}},{title:this.$t("profit_factor"),allTransaction:{value:Lm(this.profitFactor.all,2,!0),dopClass:this.profitFactor.all>1.6?"green":"red"},transactionBuy:{value:Lm(this.profitFactor.buy,2,!0),dopClass:this.profitFactor.buy>1.6?"green":"red"},transactionSell:{value:Lm(this.profitFactor.sell,2,!0),dopClass:this.profitFactor.sell>1.6?"green":"red"}},{title:this.$t("fee"),allTransaction:{value:this.statDataCommon.comission,dopClass:"red"},transactionBuy:{value:this.statDataBuy.comission,dopClass:"red"},transactionSell:{value:this.statDataSell.comission,dopClass:"red"}},{title:this.$t("maximum_balance_drawdown"),allTransaction:{value:"".concat(Lm(this.statDataCommon.maxDDBalance,2,!0)," %"),dopClass:"red"},transactionBuy:{value:"".concat(Lm(this.statDataBuy.maxDDBalance,2,!0)," %"),dopClass:"red"},transactionSell:{value:"".concat(Lm(this.statDataSell.maxDDBalance,2,!0)," %"),dopClass:"red"}},{title:this.$t("total_trades"),allTransaction:{value:Lm(this.statDataCommon.ordersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.statDataBuy.ordersCount,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.statDataSell.ordersCount,2,!0),dopClass:"blue"}},{title:this.$t("profitable_trades"),allTransaction:{value:Lm(this.statDataCommon.positiveOrdersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.statDataBuy.positiveOrdersCount,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.statDataSell.positiveOrdersCount,2,!0),dopClass:"blue"}},{title:this.$t("tmpt"),allTransaction:{value:Lm(this.statDataCommon.maxProfit,2,!0),dopClass:this.statDataCommon.maxProfit>=0?"green":"red"},transactionBuy:{value:Lm(this.statDataBuy.maxProfit,2,!0),dopClass:this.statDataBuy.maxProfit>=0?"green":"red"},transactionSell:{value:Lm(this.statDataSell.maxProfit,2,!0),dopClass:this.statDataSell.maxProfit>=0?"green":"red"}},{title:this.$t("unprofitable_trades"),allTransaction:{value:Lm(this.statDataCommon.negativeOrdersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.statDataBuy.negativeOrdersCount,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.statDataSell.negativeOrdersCount,2,!0),dopClass:"blue"}},{title:this.$t("tmut"),allTransaction:{value:Lm(this.statDataCommon.minProfit,2,!0),dopClass:this.statDataCommon.minProfit>=0?"green":"red"},transactionBuy:{value:Lm(this.statDataBuy.minProfit,2,!0),dopClass:this.statDataBuy.minProfit>=0?"green":"red"},transactionSell:{value:Lm(this.statDataSell.minProfit,2,!0),dopClass:this.statDataSell.minProfit>=0?"green":"red"}},{title:this.$t("average_trade_profit"),allTransaction:{value:Lm(this.statDataCommon.avgProfit,2,!0),dopClass:this.statDataCommon.avgProfit>=0?"green":"red"},transactionBuy:{value:Lm(this.statDataBuy.avgProfit,2,!0),dopClass:this.statDataBuy.avgProfit>=0?"green":"red"},transactionSell:{value:Lm(this.statDataSell.avgProfit,2,!0),dopClass:this.statDataSell.avgProfit>=0?"green":"red"}},{title:this.$t("tpoi"),allTransaction:{value:Lm(this.statDataCommon.sumPipByOrders,2,!0),dopClass:this.statDataCommon.sumPipByOrders>=0?"green":"red"},transactionBuy:{value:Lm(this.statDataBuy.sumPipByOrders,2,!0),dopClass:this.statDataBuy.sumPipByOrders>=0?"green":"red"},transactionSell:{value:Lm(this.statDataSell.sumPipByOrders,2,!0),dopClass:this.statDataSell.sumPipByOrders>=0?"green":"red"}},{title:this.$t("apippt"),allTransaction:{value:Lm(this.statDataCommon.avgPipByOrders,2,!0),dopClass:this.statDataCommon.avgPipByOrders>=0?"green":"red"},transactionBuy:{value:Lm(this.statDataBuy.avgPipByOrders,2,!0),dopClass:this.statDataBuy.avgPipByOrders>=0?"green":"red"},transactionSell:{value:Lm(this.statDataSell.avgPipByOrders,2,!0),dopClass:this.statDataSell.avgPipByOrders>=0?"green":"red"}},{title:this.$t("average_trade_length"),allTransaction:{value:this.statDataCommon.avgOrderDurationInms?hL(this.statDataCommon.avgOrderDurationInms):0,dopClass:""},transactionBuy:{value:this.statDataBuy.avgOrderDurationInms?hL(this.statDataBuy.avgOrderDurationInms):0,dopClass:""},transactionSell:{value:this.statDataBuy.avgOrderDurationInms?hL(this.statDataBuy.avgOrderDurationInms):0,dopClass:""}},{title:"".concat(this.$t("trading_volume"),", ").concat(this.getCryptoStatus?"Qty":this.getCurrencyChar),allTransaction:{value:Lm(this.statDataCommon.sumOrderVolume,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.statDataBuy.sumOrderVolume,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.statDataSell.sumOrderVolume,2,!0),dopClass:"blue"}}]}})},zet=qet,Yet=(i("adba"),Object(C["a"])(zet,Het,Get,!1,null,"3ffed81e",null)),Xet=Yet.exports,Qet=function(){var t=this,e=t._self._c;return e("div",{staticClass:"BottomDetailTable",class:t.darkClass},[e("div",{staticClass:"detail"},[t._v(t._s(t.$t("dfei")))]),e("div",{staticClass:"subTitle"},[e("div",{staticClass:"empty"}),e("div",{staticClass:"allPosition"},[t._v(t._s(t.$t("all_trades")))]),e("div",{staticClass:"sellPosition"},[t._v(t._s(t.$t("sell")))]),e("div",{staticClass:"buyPosition"},[t._v(t._s(t.$t("buy")))])]),1===t.bottomTableData.length?e("div",{staticClass:"noDataBottomTable"},[t._v(t._s(t.$t("no_data")))]):e("div",{staticClass:"bottomTable"},t._l(t.externalBottomTableData||t.bottomTableData,(function(i,o){return e("div",{key:o,staticClass:"row"},t._l(t.bottomTableOrderFields,(function(o,n){return e("div",{key:n,staticClass:"cell",class:i[o].dopClass},[t._v(t._s(i[o].value))])})),0)})),0),e("div",{staticClass:"commonData"},[e("ResultTableData",{attrs:{dataResult:t.externalBottomTableResult||t.dataResult,columns:12,resultTextEnable:!1}})],1)])},Jet=[],Ket=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ResultTableData",class:t.darkClass,style:t.rootStyle},[t.resultTextEnable?e("div",{staticClass:"resultText"},[t._v("Итог")]):t._e(),t._l(t.dataResult,(function(t,i){return e("LabelBlock",{key:i,class:[t.dopClass,{green:i>0}],attrs:{title:t.title,value:t.value}})}))],2)},Zet=[],tit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LabelBlock",class:t.darkClass},[e("div",{staticClass:"label"},[t._v(t._s(t.title))]),e("div",{staticClass:"value"},[t._v(t._s(t.value))])])},eit=[],iit={name:"LabelBlock",mixins:[xt],props:{title:{type:String},value:{type:[Number,String]}}},oit=iit,nit=(i("3451"),Object(C["a"])(oit,tit,eit,!1,null,"0a2d41d8",null)),sit=nit.exports,rit={name:"ResultTableData",mixins:[xt],props:{dataResult:{type:Array},columns:{type:Number},resultTextEnable:{type:Boolean,default:!0}},components:{LabelBlock:sit},data:function(){return{}},computed:{rootStyle:function(){return{"--columns":this.columns}}},watch:{},mounted:function(){},destroyed:function(){},methods:{}},ait=rit,cit=(i("50d2"),Object(C["a"])(ait,Ket,Zet,!1,null,"b01c5fb4",null)),lit=cit.exports;function uit(t,e){var i=/\s/gi;return t.bottomTableData.reduce((function(t,o,n){var s=o[e].value.replace(i,"");return n?t+ +s:t}),0)}var dit={name:"BottomDetailTable",mixins:[xt],props:{workPiece:{type:Array},dataClosedPositionDate:{type:[Boolean,Array]},externalBottomTableData:{type:[Array,Boolean],default:null},externalBottomTableResult:{type:[Array,Boolean],default:null}},components:{ResultTableData:lit},data:function(){return{}},computed:{bottomTableOrderFields:function(){return["contract","count","pips","prof","profitCount","lossCount","countSell","pipsSell","profitSell","countBuy","pipsBuy","profitBuy"]},bottomTableData:function(){if(!this.dataClosedPositionDate)return[];var t=this.workPiece.map((function(t){return{contract:{value:t.contract,dopClass:""},count:{value:Lm(t.count,2,!0),dopClass:"blue"},pips:{value:Lm(t.pips,2,!0),dopClass:t.pips>=0?"green":"red"},prof:{value:Lm(t.prof,2,!0),dopClass:t.prof>=0?"green":"red"},profitCount:{value:Lm(t.profitCount,2,!0),dopClass:"green"},lossCount:{value:Lm(t.lossCount,2,!0),dopClass:"red"},countSell:{value:Lm(t.countSell,2,!0),dopClass:"blue"},pipsSell:{value:Lm(t.pipsSell,2,!0),dopClass:t.pipsSell>=0?"green":"red"},profitSell:{value:Lm(t.profitSell,2,!0),dopClass:t.profitSell>=0?"green":"red"},countBuy:{value:Lm(t.countBuy,2,!0),dopClass:"blue"},pipsBuy:{value:Lm(t.pipsBuy,2,!0),dopClass:t.pipsBuy>=0?"green":"red"},profitBuy:{value:Lm(t.profitBuy,2,!0),dopClass:t.profitBuy>=0?"green":"red"}}}));return[{contract:{value:this.$t("instrument")},count:{value:this.$t("trades")},pips:{value:this.$t("pips")},prof:{value:this.$t("net_profit")},profitCount:{value:this.$t("profitable_trades")},lossCount:{value:this.$t("unprofitable_trades")},countSell:{value:this.$t("trades")},pipsSell:{value:this.$t("pips")},profitSell:{value:this.$t("net_profit")},countBuy:{value:this.$t("trades")},pipsBuy:{value:this.$t("pips")},profitBuy:{value:this.$t("net_profit")}}].concat(Object(x["a"])(t))},allTransitionDataResult:function(){return uit(this,"count")},allPipDataResult:function(){return uit(this,"pips")},allProfitDataResult:function(){return uit(this,"prof")},allProfitTransactionDataResult:function(){return uit(this,"profitCount")},allLossTransactionDataResult:function(){return uit(this,"lossCount")},allTransactionSellDataResult:function(){return uit(this,"countSell")},allPipSellDataResult:function(){return uit(this,"pipsSell")},allProfitSellDataResult:function(){return uit(this,"profitSell")},allTransactionBuyDataResult:function(){return uit(this,"countBuy")},allPipBuyDataResult:function(){return uit(this,"pipsBuy")},allProfitBuyDataResult:function(){return uit(this,"profitBuy")},dataResult:function(){return[{title:this.$t("instruments"),value:this.bottomTableData.length,dopClass:"orange"},{title:this.$t("trades"),value:Lm(this.allTransitionDataResult,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(this.allPipDataResult,2,!0),dopClass:this.allPipDataResult<0?"red":""},{title:this.$t("profit"),value:Lm(this.allProfitDataResult,2,!0),dopClass:this.allProfitDataResult<0?"red":""},{title:this.$t("profitable_trades"),value:Lm(this.allProfitTransactionDataResult,2,!0)},{title:this.$t("unprofitable_trades"),value:Lm(this.allLossTransactionDataResult,2,!0),dopClass:"red"},{title:this.$t("trades"),value:Lm(this.allTransactionSellDataResult,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(this.allPipSellDataResult,2,!0),dopClass:this.allPipSellDataResult<0?"red":""},{title:this.$t("profit"),value:Lm(this.allProfitSellDataResult,2,!0),dopClass:this.allProfitSellDataResult<0?"red":""},{title:this.$t("trades"),value:Lm(this.allTransactionBuyDataResult,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(this.allPipBuyDataResult,2,!0),dopClass:this.allPipBuyDataResult<0?"red":""},{title:this.$t("profit"),value:Lm(this.allProfitBuyDataResult,2,!0),dopClass:this.allProfitBuyDataResult<0?"red":""}]}},watch:{},mounted:function(){},destroyed:function(){},methods:{}},hit=dit,pit=(i("b1c0"),Object(C["a"])(hit,Qet,Jet,!1,null,"6fa6a267",null)),git=pit.exports,fit=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",staticClass:"OpenOrdersAnalistics"},[e("div",{key:t.getWrapWidth,staticClass:"OpenOrdersAnalistics-statBlock",style:{flexDirection:t.getWrapWidth<800?"column":"row"}},[e("div",{staticClass:"OpenOrdersAnalistics-sectorBlock",style:{flexBasis:t.getWrapWidth<800?"100%":"".concat(Math.round(t.getWrapWidth/100*35),"px"),maxWidth:t.getWrapWidth<800?"100%":"35%",height:t.getWrapWidth<800?"35rem":"".concat(Math.round(t.getWrapWidth/100*35),"px")}},[t.getWrapWidth&&t.getColorsPortfolios?e("SectorDiagram",{key:"".concat(t.getWrapWidth,"_").concat(t.getActiveTheme),attrs:{width:t.getWrapWidth<800?t.getWrapWidth:Math.round(t.getWrapWidth/100*35),height:t.getWrapWidth<800?t.getWrapWidth:Math.round(t.getWrapWidth/100*35),widthBorder:t.getWrapWidth<800?Math.round(t.getWrapWidth/3):Math.round(Math.round(t.getWrapWidth/100*35)/3),fontSize:t.getWrapWidth<800?Math.round(7*t.getWrapWidth/100):Math.round(t.getWrapWidth/100*35*7/100),percents:t.getColorsPortfolios}}):t._e()],1),e("div",{staticClass:"OpenOrdersAnalistics-analiticsBlock"},[e("div",{staticClass:"OpenOrdersAnalistics-tableTitle",class:"OpenOrdersAnalistics-tableTitle_".concat(t.getActiveTheme)},t._l(t.tableTitle,(function(i,o){return e("div",{key:o,staticClass:"OpenOrdersAnalistics-tableTitleItem"},[t._v(t._s(i))])})),0),t._l(t.getColorsPortfolios,(function(i,o){return e("div",{key:o,staticClass:"OpenOrdersAnalistics-tableRow",class:"OpenOrdersAnalistics-tableRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"OpenOrdersAnalistics-tableRowItem",class:"OpenOrdersAnalistics-tableRowItem_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s(i.contract))]),e("div",{staticClass:"OpenOrdersAnalistics-tableRowItem",class:"OpenOrdersAnalistics-tableRowItem_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s(t.$moneyf(i.volume)))]),e("div",{staticClass:"OpenOrdersAnalistics-tableRowItem",class:"OpenOrdersAnalistics-tableRowItem_".concat(t.getActiveTheme),style:{color:i.openProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$".concat(t.$moneyf(i.openProfit,2))))]),e("div",{staticClass:"OpenOrdersAnalistics-tableRowItem",class:"OpenOrdersAnalistics-tableRowItem_".concat(t.getActiveTheme),style:{color:i.closedProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$".concat(t.$moneyf(i.closedProfit,2))))]),e("div",{staticClass:"OpenOrdersAnalistics-tableRowItem",class:"OpenOrdersAnalistics-tableRowItem_".concat(t.getActiveTheme),style:{color:i.percentProfit<35?t.getRedColor.color:i.percentProfit>=35&&i.percentProfit<=65?t.getOrangeColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(Math.round(i.percentProfit),"%")))])])})),e("div",{staticClass:"OpenOrdersAnalistics-total",class:"OpenOrdersAnalistics-total_".concat(t.getActiveTheme)},[e("div",{staticClass:"OpenOrdersAnalistics-totalText"},[t._v(t._s(t.$t("absolute_profit")))]),e("div",{staticClass:"OpenOrdersAnalistics-totalIncome",style:{color:t.getTotalProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$".concat(t.$moneyf(t.getTotalProfit,2)))+" / "+t._s("".concat(t.$moneyf(t.getPercentByEquity,t.getPercentByEquity<.01?5:2),"%")))])])],2)])])},mit=[],vit={mixins:[yn,qe],props:{outsideData:{type:[Array,Boolean]},outsideTotalProfit:{type:[Number,Boolean]}},components:{SectorDiagram:MB},data:function(){return{size:{width:0,height:0},usingTools:null,orders:null,contractStatistics:null,tableTitle:[this.$t("contract"),this.$t("volume"),this.$t("open_trades"),this.$t("closed_trade"),this.$t("success_rate")]}},watch:{getDefaultAccount:function(t){t&&(this.getUsingContractsByAccount(),this.getDataForProfit())},getStatByOrders:function(t){t&&(this.orders=this.$orderStorage.getOrdersOnStorage())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getStatistics:"statistic/getStatistics"})),{},{getPercentByEquity:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity;return this.getTotalProfit?100*this.getTotalProfit/t:0}},getTotalProfit:function(){if(this.outsideTotalProfit||0===this.outsideTotalProfit)return this.outsideTotalProfit;if(this.contractStatistics){var t=this.contractStatistics.length?this.contractStatistics.reduce((function(t,e){return t+e[2]}),0):0,e=this.contractStatistics.length?this.contractStatistics.reduce((function(t,e){return t+e[3]}),0):0;return t+e}},getColorsPortfolios:function(){var t=this;if(this.outsideData)return this.outsideData;if(this.getAllVolume&&this.contractStatistics){var e=this.contractStatistics.map((function(e,i){return{color:t.getSetRandomColors[i]?t.getSetRandomColors[i].color:yit(),contract:e[6],volume:e[1],closedProfit:e[2],openProfit:e[3],percentProfit:e[7],data:e[1]?Math.round(100*e[1]/t.getAllVolume):0}}));return e.sort((function(t,e){return e.volume-t.volume}))}},getAllVolume:function(){if(this.contractStatistics)return this.contractStatistics.length?this.contractStatistics.reduce((function(t,e){return t+e[1]}),0):0},getWrapWidth:function(){return this.size.width}}),methods:{onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}},getDataForProfit:function(){this.$store.commit("contracts/setStatusByOrders",!1);var t={Command:"AccountProfitByHourse",Data:{accountId:this.getDefaultAccount.id,byContract:!0,CurrentOnly:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setProfitByInstrument:function(t){var e=this;if(!t||!t.length||!this.contractStatistics)return 0;this.contractStatistics.forEach((function(i){var o=t.reduce((function(t,e){return e.instrumentName===i[6]&&(t+=e.profit),t}),0);e.$set(i,3,o)}))},setMessageHandler:function(t){if(t&&t.command&&"AccountsDetails"===t.command)this.setProfitByInstrument(t.data[0].openOrders.tradingOrders);else if("AccountProfitByHourse"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);this.contractStatistics=e}},getUsingContractsByAccount:function(){var t=this;if(this.getDefaultAccount){var e=this.getDefaultAccount.id;this.$http.post(this.getApiUrl+"AccountContracts",JSON.stringify({accountsIds:[e]}),{headers:{"Content-Type":"application/json"}}).then((function(e){e.data[0]&&(t.usingTools=e.data[0].allContracts)}))}}},mounted:function(){var t=this;this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler),this.$nextTick((function(){t.observerElem=t.$refs.wrap})),this.getDefaultAccount&&(this.getUsingContractsByAccount(),this.getDataForProfit()),this.getStatByOrders&&(this.orders=this.$orderStorage.getOrdersOnStorage())},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler),this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHandler)}};function yit(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var Cit=vit,bit=(i("25c6"),Object(C["a"])(Cit,fit,mit,!1,null,"2aa23750",null)),Sit=bit.exports,Pit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DistributionLineGraph",class:t.darkClass},[e("header",[t._v(t._s(t.$t("distribution")))]),e("div",{staticClass:"tablesContainer"},[e("TableLineGraph",{attrs:{titles:t.titlesTrades,tableData:t.workPieceSortByCount,maxValueCommon:t.commonCount,maxValueRed:t.commonCountSell,maxValueGreen:t.commonCountBuy,fields:t.countFields}}),e("TableLineGraph",{attrs:{titles:t.titlesProfit,tableData:t.workPieceSortByProfit,maxValueCommon:t.commonProfit,maxValueCommonNegative:t.commonProfitNegative,maxValueRed:t.commonOnlyLoss,maxValueGreen:t.commonOnlyProfit,fields:t.profitFields,negativeValue:t.negativeValueProfit}}),e("TableLineGraph",{attrs:{titles:t.titlesProfitPips,tableData:t.workPieceSortByPips,maxValueCommon:t.commonPips,maxValueCommonNegative:t.commonPipsNegative,maxValueRed:t.commonPipsLoss,maxValueGreen:t.commonPipsProfit,fields:t.pipsFields,negativeValue:t.negativeValuePips}}),e("DiagramBlock",{attrs:{contractData:t.workPieceSortByCountPercent}})],1)])},Tit=[],xit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TableLineGraph",class:t.darkClass},[e("div",{staticClass:"countTransactionTable"},[e("div",{staticClass:"titleHeader pl8"},[t._v(t._s(t.titles[0]))]),e("div",{staticClass:"titleHeader pl54"},[t._v(t._s(t.titles[1]))]),e("div",{staticClass:"titleHeader sellBuy"},[t._v(t._s(t.titles[2])+"    "+t._s(t.titles[3]))])]),t._l(t.tableData,(function(i){return e("RowLine",{key:i.contract,attrs:{lineData:i,fields:t.fields,maxValueCommon:t.maxValueCommon,maxValueCommonNegative:t.maxValueCommonNegative,maxValueRed:t.maxValueRed,maxValueGreen:t.maxValueGreen,negativeValue:t.negativeValue,abs:t.abs}})}))],2)},Oit=[],wit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RowLine",class:t.darkClass},[e("div",{staticClass:"contractName pl8"},[t._v(t._s(t.lineData.contract))]),t.negativeValue?e("div",{staticClass:"countTransactionNegative pl54"},[e("div",{staticClass:"negativeProgress"},[t.commonValue.value<0?e("div",{staticClass:"progress",style:t.redStyleNegative},[e("span",{staticClass:"text"},[t._v(t._s(t.commonValue.formattedValue))])]):t._e()]),e("div",{staticClass:"positiveProgress"},[t.commonValue.value>=0?e("div",{staticClass:"progress",style:t.greenStylePositive},[e("span",{staticClass:"text"},[t._v(t._s(t.commonValue.formattedValue))])]):t._e()])]):e("div",{staticClass:"countTransaction pl54"},[e("div",{staticClass:"progress",style:t.commonStyle},[e("div",{staticClass:"count",class:t.commonCountClass},[t._v(t._s(t.commonValue.formattedValue))])])]),e("div",{staticClass:"buySell"},[e("div",{staticClass:"sellProgress"},[e("div",{staticClass:"progress",style:t.redStyle},[e("span",{staticClass:"text"},[t._v(t._s(t.redValue))])])]),e("div",{staticClass:"buyProgress"},[e("div",{staticClass:"progress",style:t.greenStyle},[e("span",{staticClass:"text"},[t._v(t._s(t.greenValue))])])])])])},_it=[],Ait={name:"RowLine",mixins:[xt],props:{lineData:{type:Object},fields:{type:Object},maxValueCommon:{type:Number},maxValueCommonNegative:{type:Number},maxValueRed:{type:Number},maxValueGreen:{type:Number},negativeValue:{type:Boolean,default:!1},abs:{type:Boolean,default:!1}},components:{},data:function(){return{}},computed:{commonStyle:function(){return{"--width-percent":100*this.lineData[this.fields.commonField]/this.maxValueCommon+"%"}},redStyle:function(){var t=this.abs?Math.abs(this.lineData[this.fields.redField]):this.lineData[this.fields.redField],e=this.abs?Math.abs(this.maxValueRed):this.maxValueRed;return{"--width-percent":100*t/e+"%"}},greenStyle:function(){var t=this.abs?Math.abs(this.lineData[this.fields.greenField]):this.lineData[this.fields.greenField],e=this.abs?Math.abs(this.maxValueGreen):this.maxValueGreen;return{"--width-percent":100*t/e+"%"}},redStyleNegative:function(){var t=100*Math.abs(this.commonValue.value)/Math.abs(this.maxValueCommonNegative);return{"--width-percent":t<1?"2px":t+"%"}},greenStylePositive:function(){var t=100*this.commonValue.value/this.maxValueCommon;return{"--width-percent":t<1?"2px":t+"%"}},commonCountClass:function(){return{red:this.lineData[this.fields.commonField]<0}},commonValue:function(){return Number.isInteger(this.lineData[this.fields.commonField])?{value:this.lineData[this.fields.commonField],formattedValue:Fn(this.lineData[this.fields.commonField],1)}:{value:+this.lineData[this.fields.commonField].toFixed(1),formattedValue:Fn(+this.lineData[this.fields.commonField].toFixed(1),1)}},redValue:function(){return Number.isInteger(this.lineData[this.fields.redField])?Fn(this.lineData[this.fields.redField],1):Fn(+this.lineData[this.fields.redField].toFixed(1),1)},greenValue:function(){return Number.isInteger(this.lineData[this.fields.greenField])?Fn(this.lineData[this.fields.greenField],1):Fn(+this.lineData[this.fields.greenField].toFixed(1),1)}}},Dit=Ait,kit=(i("e261"),Object(C["a"])(Dit,wit,_it,!1,null,"9843f51a",null)),Iit=kit.exports,Bit={name:"TableLineGraph",mixins:[xt],props:{tableData:{type:Array},titles:{type:Array},maxValueCommon:{type:Number},maxValueCommonNegative:{type:Number},maxValueRed:{type:Number},maxValueGreen:{type:Number},fields:{type:Object},negativeValue:{type:Boolean,default:!1},abs:{type:Boolean,default:!1}},components:{RowLine:Iit}},Mit=Bit,$it=(i("4775"),Object(C["a"])(Mit,xit,Oit,!1,null,"7b16c15c",null)),Lit=$it.exports,Fit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TableLineOneGraph",class:t.darkClass},[e("div",{staticClass:"countTransactionTable"},[e("div",{staticClass:"titleHeader pl8"},[t._v(t._s(t.titles[0]))]),e("div",{staticClass:"titleHeader pl54"},[t._v(t._s(t.titles[1]))])]),t._l(t.tableData,(function(i){return e("RowLine",{key:i.contract,attrs:{lineData:i,maxValueCommon:t.maxValueCommon,fields:t.fields}})}))],2)},jit=[],Rit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RowLine",class:t.darkClass},[e("div",{staticClass:"contractName pl8"},[t._v(t._s(t.lineData.contract))]),e("div",{staticClass:"countTransaction pl8"},[e("div",{staticClass:"progress",style:t.commonStyle,attrs:{"data-count":t.lineData.percentProfitCount.toFixed(1)}})])])},Wit=[],Nit={name:"RowLine",components:{},props:{lineData:{type:Object},maxValueCommon:{type:Number},fields:{type:Object}},mixins:[xt],data:function(){return{}},watch:{},computed:{colors:function(){var t=this.lineData[this.fields.commonField];return t<=50?this.darkClass.dark?"#fa4c4a":"#e91212":t>50&&t<65?"#fa860a":t>=65&&t<80?"#ffe500":this.darkClass.dark?"#00ffac":"#008e72"},commonStyle:function(){return{"--width-percent":100*this.lineData[this.fields.commonField]/this.maxValueCommon+"%","--background-color":this.colors}}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},Eit=Nit,Uit=(i("d62f"),Object(C["a"])(Eit,Rit,Wit,!1,null,"56a16d49",null)),Vit=Uit.exports,Hit={name:"TableLineOneGraph",components:{RowLine:Vit},props:{tableData:{type:Array},titles:{type:Array},maxValueCommon:{type:Number},fields:{type:Object}},mixins:[xt],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},Git=Hit,qit=(i("e8fb"),Object(C["a"])(Git,Fit,jit,!1,null,"26f03d28",null)),zit=qit.exports,Yit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DiagramBlock",class:t.darkClass},[e("header",[t._v("% Успешных сделок")]),e("div",{staticClass:"diagramContainer"},t._l(t.contractData,(function(t){return e("OneDiagram",{key:t.contract,attrs:{count:t.count,profitCount:t.profitCount,contractName:t.contract}})})),1)])},Xit=[],Qit=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OneDiagram",class:t.darkClass},[e("div",{staticClass:"wrapDiagram"},[e("ProgressRoundDiagram",{key:t.percent,attrs:{width:200,height:200,fontSize:25,widthBorder:40,percent:t.percent}})],1),e("div",{staticClass:"contractName"},[t._v(t._s(t.contractName))])])},Jit=[],Kit={name:"OneDiagram",components:{ProgressRoundDiagram:c$},props:{count:{type:Number},profitCount:{type:Number},contractName:{type:String}},mixins:[xt],data:function(){return{}},watch:{},computed:{percent:function(){return 100*this.profitCount/this.count}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},Zit=Kit,tot=(i("a60c"),Object(C["a"])(Zit,Qit,Jit,!1,null,"686ed660",null)),eot=tot.exports,iot={name:"DiagramBlock",components:{OneDiagram:eot},props:{contractData:{type:Array}},mixins:[xt],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){}},oot=iot,not=(i("e932b"),Object(C["a"])(oot,Yit,Xit,!1,null,"e7d606b8",null)),sot=not.exports,rot={name:"DistributionLineGraph",mixins:[xt],props:{workPiece:{type:Array}},components:{TableLineGraph:Lit,TableLineOneGraph:zit,DiagramBlock:sot},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},workPieceSortByCount:function(){return Object(x["a"])(this.workPiece).sort((function(t,e){return e.count-t.count}))},countFields:function(){return{commonField:"count",redField:"countSell",greenField:"countBuy"}},commonCount:function(){return this.workPieceSortByCount.reduce((function(t,e){return t+e.count}),0)},commonCountSell:function(){return this.workPieceSortByCount.reduce((function(t,e){return t+e.countSell}),0)},commonCountBuy:function(){return this.workPieceSortByCount.reduce((function(t,e){return t+e.countBuy}),0)},workPieceSortByProfit:function(){return Object(x["a"])(this.workPiece).sort((function(t,e){return e.prof-t.prof}))},workPieceSortByPips:function(){return Object(x["a"])(this.workPiece).sort((function(t,e){return e.pips-t.pips}))},profitFields:function(){return{commonField:"prof",redField:"onlyLoss",greenField:"onlyProfit"}},commonProfit:function(){return this.workPieceSortByCount.reduce((function(t,e){return e.prof>=0?t+e.prof:t}),0)},commonProfitNegative:function(){return this.workPieceSortByCount.reduce((function(t,e){return e.prof<0?t+e.prof:t}),0)},commonOnlyProfit:function(){return this.workPieceSortByCount.reduce((function(t,e){return t+e.onlyProfit}),0)},commonOnlyLoss:function(){return this.workPieceSortByCount.reduce((function(t,e){return t+e.onlyLoss}),0)},negativeValueProfit:function(){var t=!1;return this.workPiece.forEach((function(e){e.prof<0&&(t=!0)})),t},pipsFields:function(){return{commonField:"pips",redField:"onlyLossPip",greenField:"onlyProfitPip"}},commonPips:function(){return this.workPieceSortByPips.reduce((function(t,e){return e.pips>=0?t+e.pips:t}),0)},commonPipsNegative:function(){return this.workPieceSortByPips.reduce((function(t,e){return e.pips<0?t+e.pips:t}),0)},commonPipsLoss:function(){return this.workPieceSortByPips.reduce((function(t,e){return t+e.onlyLossPip}),0)},commonPipsProfit:function(){return this.workPieceSortByPips.reduce((function(t,e){return t+e.onlyProfitPip}),0)},negativeValuePips:function(){var t=!1;return this.workPiece.forEach((function(e){e.pips<0&&(t=!0)})),t},workPieceSortByCountPercent:function(){var t=this.workPiece.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{percentProfitCount:100*t.profitCount/t.count})}));return t.sort((function(t,e){return e.percentProfitCount-t.percentProfitCount}))},commonCountPercent:function(){return 100},countPercentFields:function(){return{commonField:"percentProfitCount"}},titlesTrades:function(){return[this.$t("instrument"),this.$t("trades"),"Sell","Buy"]},titlesProfit:function(){return[this.$t("instrument"),"".concat(this.$t("total_profit"),", ").concat(this.getCurrencyChar),"".concat(this.$t("loss"),", ").concat(this.getCurrencyChar),"".concat(this.$t("profit"),", ").concat(this.getCurrencyChar)]},titlesProfitPips:function(){return[this.$t("instrument"),"".concat(this.$t("total_profit"),", pips"),"".concat(this.$t("loss"),", pips"),"".concat(this.$t("profit"),", pips")]},titlesPercent:function(){return[this.$t("instrument"),this.$t("percentage_successful_trades")]}})},aot=rot,cot=(i("d838"),Object(C["a"])(aot,Pit,Tit,!1,null,"3d5994ba",null)),lot=cot.exports;function uot(t){var e=t.order,i=t.getPrecision,o=t.Get10PowerF,n=o(i).toString().length-1,s={Buy:function(){return Math.round(+(e.closePrice-e.openPrice).toFixed(n)*o(i))},Sell:function(){return Math.round(+(e.openPrice-e.closePrice).toFixed(n)*o(i))}};return s[e.orderType]()}function dot(t){var e=t.order,i=t.getPrecision,o=t.Get10PowerF,n=t.quotes,s=e.contractName.split(".")[0],r=n[s],a=o(i).toString().length-1,c={Buy:function(){return Math.round(+(r["Buy"]-e.openPrice).toFixed(a)*o(i))},Sell:function(){return Math.round(+(e.openPrice-r["Sell"]).toFixed(a)*o(i))}};return c[e.orderType]()}var hot={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts"})),{},{workPiece:function(){var t=this;if(!this.dataClosedPositionDate)return[];var e={};return this.dataClosedPositionDate.forEach((function(i){var o,n=i.contractName,s=n.split(".")[0],r=null===(o=(t.getContracts||[]).find((function(t){return t.name===s})))||void 0===o?void 0:o.precision;e[n]||(e[n]={contract:n,count:0,countSell:0,countBuy:0,profitCount:0,lossCount:0,pips:0,pipsSell:0,pipsBuy:0,onlyProfitPip:0,onlyLossPip:0,prof:0,profitSell:0,profitBuy:0,onlyProfit:0,onlyLoss:0,volume:0,volumeSell:0,volumeBuy:0}),e[n].count+=1;var a=e[n].countSell;e[n].countSell="Sell"===i.orderType?a+1:a;var c=e[n].countBuy;e[n].countBuy="Buy"===i.orderType?c+1:c;var l=e[n].profitCount;e[n].profitCount=i.profit>=0?l+1:l;var u=e[n].lossCount;e[n].lossCount=i.profit<0?u+1:u,e[n].pips+=uot({order:i,getPrecision:r,Get10PowerF:Ph});var d=e[n].pipsSell;e[n].pipsSell="Sell"===i.orderType?d+uot({order:i,getPrecision:r,Get10PowerF:Ph}):d;var h=e[n].pipsBuy;e[n].pipsBuy="Buy"===i.orderType?h+uot({order:i,getPrecision:r,Get10PowerF:Ph}):h,e[n].prof+=i.profit;var p=e[n].profitSell;e[n].profitSell="Sell"===i.orderType?p+i.profit:p;var g=e[n].profitBuy;e[n].profitBuy="Buy"===i.orderType?g+i.profit:g,e[n].volume+=i.volume;var f=e[n].volumeSell;e[n].volumeSell="Sell"===i.orderType?f+i.volume:f;var m=e[n].volumeBuy;e[n].volumeBuy="Buy"===i.orderType?m+i.volume:m;var v=e[n].onlyProfit;e[n].onlyProfit=i.profit>=0?v+i.profit:v;var y=e[n].onlyLoss;e[n].onlyLoss=i.profit<0?y+i.profit:y;var C=e[n].onlyProfitPip,b=e[n].onlyLossPip,S=uot({order:i,getPrecision:r,Get10PowerF:Ph});e[n].onlyProfitPip=S>=0?C+S:C,e[n].onlyLossPip=S<0?b+S:b})),Object.values(e)}})},pot={name:"TradingAnalytics",mixins:[hot,xt],props:{dataClosedPositionDate:{type:[Boolean,Array]},calendarDate:{type:Date},location:{type:String,default:""},externalTopTableData:{type:[Array,Boolean],default:null},externalBottomTableData:{type:[Array,Boolean],default:null},externalBottomTableResult:{type:[Array,Boolean],default:null},externalWorkPiece:{type:[Array,Boolean],default:null}},components:{TopTable:Xet,BottomDetailTable:git,DistributionLineGraph:lot,OpenOrdersAnalitics:Sit},data:function(){return{statData:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession",getStatistics:"statistic/getStatistics",getUserSettings:"userSettings/getUserSettings"})),{},{lang:function(){var t;switch(null===(t=this.getUserSettings)||void 0===t||null===(t=t.lang)||void 0===t?void 0:t.code){case"en":return"en-US";case"ru":return"ru-RU";default:return"en-US"}},date:function(){return new Intl.DateTimeFormat(this.lang,{day:"2-digit",month:"long",year:"numeric"}).format(this.calendarDate)},statDataCommon:function(){return this.statData?this.statData.find((function(t){return"Common"===t.dataType})):{}},statDataBuy:function(){return this.statData?this.statData.find((function(t){return"Buy"===t.dataType})):{}},statDataSell:function(){return this.statData?this.statData.find((function(t){return"Sell"===t.dataType})):{}},isVisibleHeader:function(){return"slider"!==this.location}}),watch:{calendarDate:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getStatData();case 2:case"end":return e.stop()}}),e)})))()}},mounted:function(){"slider"===this.location&&this.getStatData()},deactivated:function(){this.location||(this.statData=null)},methods:{getStatData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.statData=null,o=JSON.stringify({AccountId:(null===(i=t.$route)||void 0===i||null===(i=i.query)||void 0===i?void 0:i.accountId)||t.getDefaultAccount.id,SubscriptionId:null,fromDT:t.location?null:t.getStatistics.account.registrationDate,toDT:t.location?null:t.calendarDate.toISOString()}),e.next=4,t.$workKeys.signMessage(o,t.getSession.sk);case 4:return n=e.sent,e.next=7,t.$http.post("".concat(t.getApiUrl,"GetAccountShortStatistic"),o,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":n,"Content-type":"application/json"}});case 7:if(s=e.sent,s.data&&s.data.data.length){e.next=10;break}return e.abrupt("return");case 10:t.statData=s.data.data;case 11:case"end":return e.stop()}}),e)})))()}}},got=pot,fot=(i("559e"),Object(C["a"])(got,Uet,Vet,!1,null,"549a0a2c",null)),mot=fot.exports,vot={name:"AnalyticStatistic",components:{TradingAnalytics:mot},props:{analyticData:{type:[Array,Boolean]}},mixins:[Jtt,xt],data:function(){return{}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t,e;return null!==(t=this.getDefaultAccount)&&void 0!==t&&t.currencyChar?null===(e=this.getDefaultAccount)||void 0===e?void 0:e.currencyChar:"$"},analyticDataGroupContract:function(){var t={};return this.analyticData.forEach((function(e){t[e.contract]||(t[e.contract]=[]),t[e.contract].push(e)})),Object.entries(t).map((function(t){var e=t[1].filter((function(t){return"Common"===t.dataType})),i=t[1].filter((function(t){return"Buy"===t.dataType})),o=t[1].filter((function(t){return"Sell"===t.dataType}));return{contract:t[0],count:e.reduce((function(t,e){return t+e.ordersCount}),0),pips:e.reduce((function(t,e){return t+e.sumPipByOrders}),0),prof:e.reduce((function(t,e){return t+e.profit}),0),profitCount:e.reduce((function(t,e){return t+e.positiveOrdersCount}),0),lossCount:e.reduce((function(t,e){return t+e.negativeOrdersCount}),0),volume:e.reduce((function(t,e){return t+e.sumOrderVolume}),0),countSell:o.reduce((function(t,e){return t+e.ordersCount}),0),pipsSell:o.reduce((function(t,e){return t+e.sumPipByOrders}),0),profitSell:o.reduce((function(t,e){return t+e.profit}),0),volumeSell:o.reduce((function(t,e){return t+e.sumOrderVolume}),0),countBuy:i.reduce((function(t,e){return t+e.ordersCount}),0),pipsBuy:i.reduce((function(t,e){return t+e.sumPipByOrders}),0),profitBuy:i.reduce((function(t,e){return t+e.profit}),0),volumeBuy:i.reduce((function(t,e){return t+e.sumOrderVolume}),0),onlyLoss:e.reduce((function(t,e){return t+e.onlyLoss}),0),onlyProfit:e.reduce((function(t,e){return t+e.onlyProfit}),0),onlyProfitPip:e.reduce((function(t,e){return t+e.onlyProfitPip}),0),onlyLossPip:e.reduce((function(t,e){return t+e.onlyLossPip}),0)}}))},topTableData:function(){return[{title:null,allTransaction:{value:this.$t("all_trades")},transactionBuy:{value:this.$t("buy2")},transactionSell:{value:this.$t("sell2")}},{title:this.$t("net_profit"),allTransaction:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.allProfit,2,!0)),dopClass:this.allProfit.profit>=0?"green":"red"},transactionBuy:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.buyProfit,2,!0)),dopClass:this.buyProfit>=0?"green":"red"},transactionSell:{value:"".concat(this.getCurrencyChar," ").concat(Lm(this.sellProfit,2,!0)),dopClass:this.sellProfit>=0?"green":"red"}},{title:this.$t("profit_factor"),allTransaction:{value:Lm(this.profitFactor,2,!0),dopClass:this.profitFactor>1.6?"green":"red"},transactionBuy:{value:Lm(this.profitFactorBuy,2,!0),dopClass:this.profitFactorBuy>1.6?"green":"red"},transactionSell:{value:Lm(this.profitFactorSell,2,!0),dopClass:this.profitFactorSell>1.6?"green":"red"}},{title:this.$t("fee"),allTransaction:{value:this.comission,dopClass:"red"},transactionBuy:{value:this.comissionBuy,dopClass:"red"},transactionSell:{value:this.comissionSell,dopClass:"red"}},{title:this.$t("maximum_balance_drawdown"),allTransaction:{value:"".concat(Lm(this.maxDDBalance,2,!0)," %"),dopClass:"red"},transactionBuy:{value:"".concat(Lm(this.maxDDBalanceBuy,2,!0)," %"),dopClass:"red"},transactionSell:{value:"".concat(Lm(this.maxDDBalanceSell,2,!0)," %"),dopClass:"red"}},{title:this.$t("total_trades"),allTransaction:{value:Lm(this.ordersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.ordersCountBuy,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.ordersCountSell,2,!0),dopClass:"blue"}},{title:this.$t("profitable_trades"),allTransaction:{value:Lm(this.positiveOrdersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.positiveOrdersCountBuy,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.positiveOrdersCountSell,2,!0),dopClass:"blue"}},{title:this.$t("tmpt"),allTransaction:{value:Lm(this.maxProfit,2,!0),dopClass:this.maxProfit>=0?"green":"red"},transactionBuy:{value:Lm(this.maxProfitBuy,2,!0),dopClass:this.maxProfitBuy>=0?"green":"red"},transactionSell:{value:Lm(this.maxProfitSell,2,!0),dopClass:this.maxProfitSell>=0?"green":"red"}},{title:this.$t("unprofitable_trades"),allTransaction:{value:Lm(this.negativeOrdersCount,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.negativeOrdersCountBuy,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.negativeOrdersCountSell,2,!0),dopClass:"blue"}},{title:this.$t("tmut"),allTransaction:{value:Lm(this.minProfit,2,!0),dopClass:this.minProfit>=0?"green":"red"},transactionBuy:{value:Lm(this.minProfitBuy,2,!0),dopClass:this.minProfitBuy>=0?"green":"red"},transactionSell:{value:Lm(this.minProfitSell,2,!0),dopClass:this.minProfitSell>=0?"green":"red"}},{title:this.$t("average_trade_profit"),allTransaction:{value:Lm(this.averageProfitByTransaction,2,!0),dopClass:this.averageProfitByTransaction>=0?"green":"red"},transactionBuy:{value:Lm(this.averageProfitByTransactionBuy,2,!0),dopClass:this.averageProfitByTransactionBuy>=0?"green":"red"},transactionSell:{value:Lm(this.averageProfitByTransactionSell,2,!0),dopClass:this.averageProfitByTransactionSell>=0?"green":"red"}},{title:this.$t("tpoi"),allTransaction:{value:Lm(this.commonProfitPip,2,!0),dopClass:this.commonProfitPip>=0?"green":"red"},transactionBuy:{value:Lm(this.buyProfitPip,2,!0),dopClass:this.buyProfitPip>=0?"green":"red"},transactionSell:{value:Lm(this.sellProfitPip,2,!0),dopClass:this.sellProfitPip>=0?"green":"red"}},{title:this.$t("apippt"),allTransaction:{value:Lm(this.averageProfitPipByOneTransaction,2,!0),dopClass:this.averageProfitPipByOneTransaction>=0?"green":"red"},transactionBuy:{value:Lm(this.averageProfitPipByOneTransactionBuy,2,!0),dopClass:this.averageProfitPipByOneTransactionBuy>=0?"green":"red"},transactionSell:{value:Lm(this.averageProfitPipByOneTransactionSell,2,!0),dopClass:this.averageProfitPipByOneTransactionSell>=0?"green":"red"}},{title:this.$t("average_trade_length"),allTransaction:{value:this.avgOrderDurationInms?hL(this.avgOrderDurationInms):0,dopClass:""},transactionBuy:{value:this.avgOrderDurationInmsBuy?hL(this.avgOrderDurationInmsBuy):0,dopClass:""},transactionSell:{value:this.avgOrderDurationInmsSell?hL(this.avgOrderDurationInmsSell):0,dopClass:""}},{title:"".concat(this.$t("trading_volume"),", ").concat(this.getCurrencyChar),allTransaction:{value:Lm(this.sumOrderVolume,2,!0),dopClass:"blue"},transactionBuy:{value:Lm(this.sumOrderVolumeBuy,2,!0),dopClass:"blue"},transactionSell:{value:Lm(this.sumOrderVolumeSell,2,!0),dopClass:"blue"}}]},bottomTableData:function(){if(!this.analyticData)return[];var t=this.analyticDataGroupContract.map((function(t){return{contract:{value:t.contract,dopClass:""},count:{value:Lm(t.count,2,!0),dopClass:"blue"},pips:{value:Lm(t.pips,2,!0),dopClass:t.pips>=0?"green":"red"},prof:{value:Lm(t.prof,2,!0),dopClass:t.prof>=0?"green":"red"},profitCount:{value:Lm(t.profitCount,2,!0),dopClass:"green"},lossCount:{value:Lm(t.lossCount,2,!0),dopClass:"red"},countSell:{value:Lm(t.countSell,2,!0),dopClass:"blue"},pipsSell:{value:Lm(t.pipsSell,2,!0),dopClass:t.pipsSell>=0?"green":"red"},profitSell:{value:Lm(t.profitSell,2,!0),dopClass:t.profitSell>=0?"green":"red"},countBuy:{value:Lm(t.countBuy,2,!0),dopClass:"blue"},pipsBuy:{value:Lm(t.pipsBuy,2,!0),dopClass:t.pipsBuy>=0?"green":"red"},profitBuy:{value:Lm(t.profitBuy,2,!0),dopClass:t.profitBuy>=0?"green":"red"}}}));return[{contract:{value:this.$t("instrument")},count:{value:this.$t("trades")},pips:{value:this.$t("pips")},prof:{value:this.$t("net_profit")},profitCount:{value:this.$t("profitable_trades")},lossCount:{value:this.$t("unprofitable_trades")},countSell:{value:this.$t("trades")},pipsSell:{value:this.$t("pips")},profitSell:{value:this.$t("net_profit")},countBuy:{value:this.$t("trades")},pipsBuy:{value:this.$t("pips")},profitBuy:{value:this.$t("net_profit")}}].concat(Object(x["a"])(t))},bottomTableResult:function(){return[{title:this.$t("instruments"),value:this.bottomTableData.length-1,dopClass:"orange"},{title:this.$t("trades"),value:Lm(uit(this,"count"),2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(uit(this,"pips"),2,!0),dopClass:uit(this,"pips")<0?"red":"green"},{title:this.$t("profit"),value:Lm(uit(this,"prof"),2,!0),dopClass:uit(this,"prof")<0?"red":""},{title:this.$t("profitable_trades"),value:Lm(uit(this,"profitCount"),2,!0)},{title:this.$t("unprofitable_trades"),value:Lm(uit(this,"lossCount"),2,!0),dopClass:"red"},{title:this.$t("trades"),value:Lm(uit(this,"countSell"),2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(uit(this,"pipsSell"),2,!0),dopClass:uit(this,"pipsSell")<0?"red":""},{title:this.$t("profit"),value:Lm(uit(this,"profitSell"),2,!0),dopClass:uit(this,"profitSell")<0?"red":""},{title:this.$t("trades"),value:Lm(uit(this,"countBuy"),2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(uit(this,"pipsBuy"),2,!0),dopClass:uit(this,"pipsBuy")<0?"red":""},{title:this.$t("profit"),value:Lm(uit(this,"profitBuy"),2,!0),dopClass:uit(this,"profitBuy")<0?"red":""}]},workPiece:function(){return this.analyticDataGroupContract.map((function(t){return{contract:t.contract,count:t.count,countSell:t.countSell,countBuy:t.countBuy,profitCount:t.profitCount,lossCount:t.lossCount,pips:t.pips,pipsSell:t.pipsSell,pipsBuy:t.pipsBuy,prof:t.prof,profitSell:t.profitSell,profitBuy:t.profitBuy,onlyProfit:t.onlyProfit,onlyLoss:t.onlyLoss,volume:t.volume,volumeSell:t.volumeSell,volumeBuy:t.volumeBuy,onlyProfitPip:t.onlyProfitPip,onlyLossPip:t.onlyLossPip}}))}})},yot=vot,Cot=(i("dbcb"),Object(C["a"])(yot,Net,Eet,!1,null,"e89b911c",null)),bot=Cot.exports,Sot=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ComparisonGraph",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.progressFinish?e("div",{staticClass:"graphContent"},[e("div",{staticClass:"commonPipsBlock",on:{mouseenter:t.viewTooltipHandler,mouseleave:t.hideTooltip}},[e("div",{staticClass:"value",class:t.pipsData.pip.dopClass},[t._v(t._s(t.pipsData.pip.value)),e("small",[t._v(" pip")])]),e("div",{staticClass:"triangle",class:t.pipsData.pip.dopClass})]),e("div",{staticClass:"listProviders"},[e("div",{staticClass:"scrollData"},[e("transition-group",{staticClass:"transitionDiv",attrs:{name:"listExperts",tag:"div"}},t._l(t.contractForGraphSorted,(function(i){return e("CheckboxBlock",{key:i.uniqueId,attrs:{accountId:i.accountId,userName:i.userName,uniqueId:i.uniqueId,sequenceId:i.sequenceid,avatar:i.avatarURL,color:i.color,contract:i.contract,check:i.check,splittingContract:t.splittingContract},on:{setStatus:t.setStatus}})})),1)],1)]),t.visibleGraph?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",widthYaxis:"7rem",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:t.hoverPoint}}):t._e()],1):e("div",{staticClass:"loadingContent"},[e("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,message:"",progress:t.getProgress,enabledMessage:!1,icon:!1}})],1)]),e("DxTooltip",{attrs:{visible:t.tooltipVisible,target:t.selector,position:t.positionBottomCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[e("div",{staticClass:"textContent"},[e("div",{staticClass:"firstLine text"},[t._v(t._s(t.$t("tiotpip")))])])])],1)},Pot=[],Tot=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckboxBlock",class:t.darkClass,on:{mouseenter:function(e){return t.setHovered(!0)},mouseleave:function(e){return t.setHovered(!1)}}},[e("div",{staticClass:"checkbox",class:{colored:t.color},style:t.styleColor},[e("DxCheckBox",{attrs:{value:t.check,elementAttr:{class:"checkBoxCustom"},onValueChanged:t.setStatus}}),e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("Avatar",{attrs:{size:"2.4",src:t.avatar}})],1),e("div",{staticClass:"contractLabel"},[t._v(t._s(t.contract))]),e("div",{staticClass:"pips",class:t.pips.dopClass},[t._v(t._s(t.pips.value))]),e("transition",{staticClass:"lol",attrs:{name:"fade"}},[t.hovered?e("div",{staticClass:"copyAndAddPortfolio"},[e("div",{staticClass:"checkboxWrapper",class:{noClicked:t.isLoadingStart||t.isLoadingCreated},on:{mouseenter:function(e){t.viewTooltipHandler(e,t.$t("add_to_portfolio"))},mouseleave:t.hideTooltip,click:t.addToDraft}},[t.isLoadingCreated?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):e("svgIcon",t._b({},"svgIcon",t.dataIconPlus,!1))],1),e("div",{staticClass:"checkboxWrapper",class:{noClicked:t.isLoadingStart||t.isLoadingCreated},on:{mouseenter:function(e){t.viewTooltipHandler(e,t.$t("copy"))},mouseleave:t.hideTooltip,click:t.startCopy}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):e("svgIcon",t._b({},"svgIcon",t.dataIconCopy,!1))],1)]):t._e()]),t.hovered?e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionBottomCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))]):t._e()],1)])},xot=[],Oot={name:"CheckboxBlock",inject:["openModalCopyProvider"],components:{DxCheckBox:Th["DxCheckBox"],Avatar:E,DxLoadIndicator:OT["DxLoadIndicator"]},props:{avatar:{type:String},color:{type:String},check:{type:Boolean},uniqueId:{type:String},contract:{type:String},splittingContract:{type:Array},accountId:{type:String},userName:{type:String},sequenceId:{type:String}},mixins:[rT,xt,Ot,lW],data:function(){return{textTooltip:"",hovered:!1,shortSources:[],isLoadingCreated:!1,isLoadingStart:!1}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{isAuth:function(){var t;return"auth"===(null===(t=this.getStatusUser)||void 0===t?void 0:t.user)},styleColor:function(){return this.color?{"--color-checkbox":this.color}:{}},pips:function(){var t=this;if(!this.splittingContract)return{};var e=this.splittingContract.find((function(e){return e.uniqueId===t.uniqueId})),i=e.stat.at(-1).pip;return{value:Lm(i,2,!0),dopClass:i>=0?"green":"red"}},dataIconPlus:function(){return{name:"Favorite-off",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},dataIconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},nameForPortfolio:function(){return"".concat(this.userName," ").concat(this.contract)}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({saveInvestBag:"expertsPortfolio/saveInvestBag",saveInvestBagContent:"expertsPortfolio/saveInvestBagContent",showToast:"toast/showToast"})),{},{setStatus:function(t){this.$emit("setStatus",{status:t.value,id:this.uniqueId})},mouseenterHandler:function(t){var e=t.target.getBoundingClientRect(),i=e.right,o=window.innerWidth-i;this.mouseEnterFunction(t,{imageForSource:this.avatar,nameSource:this.userName,accountId:this.accountId,noActiveButton:!0,sequenceId:this.sequenceId,position:o>500?"right":"left"})},mouseleaveHandler:function(){this.mouseLeaveFunction()},setHovered:function(t){this.hovered=t},viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},login:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},iAmProvider:function(t){var e=[];if(0===this.getDefaultAccount.source.length)return[];var i=this.getDefaultAccount.source;return i.includes(t)&&e.push(t),e},getShortSources:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.post("".concat(t.getApiUrl,"GetShortSourcesByAccountIds"),{ids:[t.accountId],checkStat:!0});case 2:return i=e.sent,o=i.data,n=Object(x["a"])(o.data).map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:t.data.filter((function(t){return!t.statIsOut}))})})),t.shortSources=n,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})))()},addInvest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.nameForPortfolio,o=t.shortSources[0].data.find((function(e){return e.contract===t.contract})),n=o.id,e.next=5,t.saveInvestBag({name:i,investMoney:0,investLeverage:1,investBagType:"InvestTop"});case 5:if(s=e.sent,!s.requestStatus.isOK){e.next=10;break}return a=[tq({sourceId:n,bagId:s.id})],e.next=10,t.saveInvestBagContent(a);case 10:case"end":return e.stop()}}),e)})))()},addToDraft:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:return t.isLoadingCreated=!0,e.next=6,t.getShortSources();case 6:return e.next=8,t.addInvest();case 8:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{congratulation:!0,visibleButtonOkay:!0,congratulationText:"empty",message:"Портфель ".concat(t.nameForPortfolio," добавлен в раздел “Инвестиции”.")}}),t.isLoadingCreated=!1,o=new Audio,o.src=i("2e5e"),o.play();case 13:case"end":return e.stop()}}),e)})))()},startCopy:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isAuth){e.next=3;break}return t.login(),e.abrupt("return");case 3:t.openModalCopyProvider({providerCopy:!0,infoAccount:{avatar:t.avatar,traderName:t.userName,login:t.accountId,sequenceId:t.sequenceId}});case 4:case"end":return e.stop()}}),e)})))()}})},wot=Oot,_ot=(i("6df7"),Object(C["a"])(wot,Tot,xot,!1,null,"608b3e35",null)),Aot=_ot.exports,Dot={name:"ComparisonGraph",components:{LineEventChart:Uk,CheckboxBlock:Aot,DxLoadIndicator:OT["DxLoadIndicator"],Preloader:ah},props:{statPortfolio:{type:Array},portfolioForSlider:{type:Array},accountsAndContract:{type:[Object,Boolean]},selectedContract:{type:String},pipsData:{type:Object}},mixins:[xt,qe,Ot],data:function(){return{statPortfolioLocal:[],visibleGraph:!1,points:null,metaInfoLines:null,checked:[],loadingStatus:!0,progress:0}},watch:{checked:function(){this.loadingStatus||this.setPointsForChart()},statPortfolioLocal:function(t){this.accountsAndContract?Object.keys(this.accountsAndContract).length===t.length&&(this.loadingStatus=!1):this.portfolioForSlider.length===t.length&&(this.loadingStatus=!1)},loadingStatus:function(t){var e=this;t||this.$nextTick((function(){e.setPointsForChart()}))}},computed:{getProgress:function(){return this.accountsAndContract?100*this.progress/Object.keys(this.accountsAndContract).length:100*this.progress/this.portfolioForSlider.length},progressFinish:function(){return 100===this.getProgress},colors:function(){var t=this.getSetRandomColors,e=[];return this.portfolioForSlider.length>10&&Array.from(new Array(this.portfolioForSlider.length-10)).forEach((function(){var t=uB(),i=t.color,o=t.fill;e.push({color:i,fill:o})})),[].concat(Object(x["a"])(t),e)},contractForGraph:function(){var t=this;return this.portfolioForSlider.map((function(e,i){var o="".concat(e.accountId).concat(e.contract);return Object(c["a"])(Object(c["a"])({},e),{},{uniqueId:o,color:t.colors[i].color,fill:t.colors[i].fill,check:t.checked.includes(o)})}))},contractForGraphSorted:function(){var t=this;return this.contractForGraph.sort((function(e,i){return t.checked.includes(i.uniqueId)-t.checked.includes(e.uniqueId)}))},splittingContract:function(){var t=this;if(!this.loadingStatus)return this.contractForGraph.map((function(e){var i=t.statPortfolioLocal.find((function(t){return t.accountId===e.accountId}));return Object(c["a"])(Object(c["a"])({},e),{},{stat:i.data.filter((function(t){return t.contract===e.contract}))})}))},contractForGraphFiltered:function(){if(this.splittingContract)return this.splittingContract.filter((function(t){return t.check}))}},methods:{setPointsForChart:function(){var t=this;this.metaInfoLines=[],this.points=[],this.contractForGraphFiltered.forEach((function(e){t.metaInfoLines.push({type:"line",color:e.color,fill:e.fill,fillIndicator:t.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""});var i=e.stat.map((function(t){return{x:new Date(t.date).getTime(),y:t.pip,date:new Date(t.date).getTime()}}));t.points.push(i)})),this.visibleGraph=!0},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setStatus:function(t){var e=t.status,i=t.id;e&&!this.checked.includes(i)?this.checked.push(i):!e&&this.checked.includes(i)&&(this.checked=this.checked.filter((function(t){return t!==i})))},getStatByContract:function(t,e){var i={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:e}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},postLocalStatistic:function(){var t=this;this.accountsAndContract?Object.keys(this.accountsAndContract).forEach((function(e){t.getStatByContract(e,t.accountsAndContract[e])})):this.portfolioForSlider.forEach((function(e){t.getStatByContract(e.accountId,[e.contract])}))},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}},setStat:function(t){this.statPortfolioLocal.push({accountId:t.dailyData.accountId,data:t.data}),this.progress+=1},viewTooltipHandler:function(t){this.viewTooltip(t)}},activated:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler),this.progress=0,this.postLocalStatistic(),this.checked=this.portfolioForSlider.map((function(t){return"".concat(t.accountId).concat(t.contract)}))},deactivated:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler),this.visibleGraph=!1,this.loadingStatus=!0,this.statPortfolioLocal=[]}},kot=Dot,Iot=(i("d4c7"),Object(C["a"])(kot,Sot,Pot,!1,null,"6c5ad970",null)),Bot=Iot.exports,Mot={name:"ProfitAndAnalytic",props:{allTops:{type:Array},countTop:{type:Number},statPortfolio:{type:Array},analyticData:{type:[Array,Boolean]},index:{type:Number},stopClick:{type:Boolean},portfolioForSlider:{type:Array},accountsAndContract:{type:[Object,Boolean]},selectedContract:{type:String},pipsData:{type:Object}},mixins:[xt],components:{ProfitGraph:Wet,AnalyticStatistic:bot,ComparisonGraph:Bot},data:function(){return{currentTab:"profit"}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getScreenWidth:"user/getScreenWidth"})),{},{currentComponent:function(){switch(this.currentTab){case"profit":return"ProfitGraph";case"analytic":return"AnalyticStatistic";case"comparison":return"ComparisonGraph";default:return""}},propsComponent:function(){return{ProfitGraph:{statPortfolio:this.statPortfolio,analyticData:this.analyticData,countTop:this.countTop,index:this.index,accountsAndContract:this.accountsAndContract,portfolioForSlider:this.portfolioForSlider,stopClick:this.stopClick,selectedContract:this.selectedContract,pipsData:this.pipsData},AnalyticStatistic:{analyticData:this.analyticData},ComparisonGraph:{portfolioForSlider:this.portfolioForSlider,statPortfolio:this.statPortfolio,accountsAndContract:this.accountsAndContract,selectedContract:this.selectedContract,pipsData:this.pipsData}}}}),methods:{setSlideTop:function(t){this.$emit("setSlideTop",t)},setCurrentTab:function(t){this.currentTab=t,"analytic"===t&&this.getScreenWidth<1105&&this.$emit("closeSidebar")}}},$ot=Mot,Lot=(i("7866"),Object(C["a"])($ot,wet,_et,!1,null,"390c6d46",null)),Fot=Lot.exports,jot=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitAndAnalyticLoader",class:t.rootClass},[t.onlyGraph?t._e():e("div",{staticClass:"topButton"},[e("div",{staticClass:"lineByCircle"},t._l(5,(function(t){return e("Sceleton",{key:t,staticClass:"circle",attrs:{width:25,height:25,variant:"circular"}})})),1)]),e("div",{staticClass:"contentPart"},[e("div",{staticClass:"graph"},[e("div",{staticClass:"grid"},t._l(16,(function(t){return e("div",{key:t,staticClass:"section"})})),0)]),e("div",{staticClass:"gistogramm"},[e("div",{staticClass:"topGistogram"},t._l(10,(function(i){return e("Sceleton",{key:i,attrs:{width:"9%",height:"".concat(t.randomHeight(),"%"),variant:"rectangular"}})})),1),e("div",{staticClass:"middleLine"})])])])},Rot=[],Wot={name:"ProfitAndAnalyticLoader",mixins:[xt],props:{onlyGraph:{type:Boolean,default:!1}},components:{Sceleton:nT},computed:{rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{onlyGraph:this.onlyGraph})}},methods:{randomHeight:function(){var t=20,e=90;return Math.floor(Math.random()*(e-t+1)+t)}}},Not=Wot,Eot=(i("77e6"),Object(C["a"])(Not,jot,Rot,!1,null,"cde4521a",null)),Uot=Eot.exports,Vot={name:"SlideItem",provide:function(){return{setCalcPipsByStatistic:this.setCalcPipsByStatistic}},props:{count:{type:Number},index:{type:Number},lengthArr:{type:Number},stopClick:{type:Boolean},allTops:{type:Array},portfolioForSlider:{type:Array},statDataReadyMadeSolution:{type:Array},getStatusProgress:{type:Boolean},selectedContract:{type:String},analyticData:{type:[Array,Boolean]},expand:{type:Boolean},isVisible:{type:Boolean}},mixins:[xt],components:{Sidebar:yet,SidebarLoader:Oet,ProfitAndAnalytic:Fot,ProfitAndAnalyticLoader:Uot},data:function(){return{statData:[],calcPipsByStatistic:0}},computed:{styleRoot:function(){return{transform:"translate3d(".concat(3.3*this.index,"%, 0, -").concat(50*this.index,"px)"),zIndex:this.lengthArr-this.index}},accountsAndContract:function(){if("all"===this.selectedContract){var t={};return this.portfolioForSlider.forEach((function(e){var i=e.accountId;t[i]||(t[i]=[]),t[i].push(e.contract)})),t}},accountsPortfolio:function(){var t=this.portfolioForSlider.map((function(t){return t.accountId}));return Array.from(new Set(t))},statPortfolio:function(){var t=this,e=this.statDataReadyMadeSolution.filter((function(e){return t.accountsPortfolio.includes(e.accountId)}));return this.accountsAndContract?e.map((function(e){return{accountId:e.accountId,data:e.data.filter((function(i){return t.accountsAndContract[e.accountId].includes(i.contract)}))}})):e},isVisibleWrap:function(){return!!this.getStatusProgress&&(0===this.index&&!this.stopClick)},isVisiblePreview:function(){return!this.getStatusProgress||0===this.index&&this.stopClick},avgProcPipDay:function(){var t=this.portfolioForSlider.reduce((function(t,e){return t+e.avgProcPipDay}),0);return t/this.portfolioForSlider.length},avgProcPipMonth:function(){var t=this.portfolioForSlider.reduce((function(t,e){return t+e.avgProcPipMonth}),0);return t/this.portfolioForSlider.length},pipsData:function(){return{pip:{value:Lm(this.calcPipsByStatistic,2,!0),dopClass:this.calcPipsByStatistic>=0?"green":"red"},avgProcPipDay:{value:Lm(this.avgProcPipDay,2,!0),dopClass:this.avgProcPipDay>=0?"green":"red"},avgProcPipMonth:{value:Lm(this.avgProcPipMonth,2,!0),num:this.avgProcPipMonth,dopClass:this.avgProcPipMonth>=0?"green":"red"}}}},watch:{},mounted:function(){},destroyed:function(){},methods:{setExpand:function(){this.$emit("setExpand")},setSlideTop:function(t){this.$emit("setSlideTop",t)},closeSidebar:function(){this.$emit("closeSidebar"),this.expand||this.setExpand()},setCalcPipsByStatistic:function(t){this.calcPipsByStatistic=t}}},Hot=Vot,Got=(i("f2ec"),Object(C["a"])(Hot,Gtt,qtt,!1,null,"5d2599d2",null)),qot=Got.exports;function zot(t){return{dataType:t[0],profit:t[1],profitFactor:t[2],comission:t[3],maxDDBalance:t[4],ordersCount:t[5],positiveOrdersCount:t[6],maxProfit:t[7],negativeOrdersCount:t[8],minProfit:t[9],avgProfit:t[10],sumPipByOrders:t[11],avgPipByOrders:t[12],avgOrderDuration:t[13],sumOrderVolume:t[14],avgOrderDurationInms:t[15],recoveryFactor:t[16],recoveryFactorRound:t[17],isClosedData:t[18],accountId:t[19],contract:t[20],firstDayTrading:t[21],onlyLoss:t[22],onlyProfit:t[23],onlyLossPip:t[24],onlyProfitPip:t[25]}}var Yot={name:"Slider",mixins:[xt],props:{selectedContract:{type:String},statDataReadyMadeSolution:{type:Array},topPortfolios:{type:Array},getStatusProgress:{type:Boolean},emptyProvider:{type:Boolean}},components:{SlideItem:qot},data:function(){return{statData:[],slidersCount:Object(x["a"])(this.topPortfolios.map((function(t){return t.length}))),slidersArr:Object(x["a"])(this.topPortfolios),first:null,time:800,stopClick:!1,animationKey:!1,expand:!1,isVisible:!0}},watch:{expand:function(t){var e=this;t?this.isVisible=!1:setTimeout((function(){return e.isVisible=!0}),this.time)},topPortfolios:function(t){this.slidersArr=Object(x["a"])(t),this.slidersCount=Object(x["a"])(t.map((function(t){return t.length})))},slidersArr:function(t){t.length&&t.length===this.topPortfolios.length&&this.getAnalyticData(t)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getScreenWidth:"user/getScreenWidth"})),{},{rootStyle:function(){return{"--time":this.time+"ms"}},iconArrow:function(){return{name:"Arrow-expand-right-big",color:this.darkClass.dark?"#bbcee0":"#fff"}},allTops:function(){return this.topPortfolios.map((function(t){return t.length}))},iconBigData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c",size:40}},emptyData:function(){var t;return 0===(null===(t=this.topPortfolios)||void 0===t?void 0:t.length)&&this.emptyProvider}}),methods:{getAnalyticData:function(t){var e=this.sourcesByAccounts(t[0]),i={command:"AccountShortStatisticV2",data:{datas:e,ByContract:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},sourcesByAccounts:function(t){var e={};return t.forEach((function(t){e[t.accountId]||(e[t.accountId]=[]),e[t.accountId].push(t.contract)})),Object.entries(e).map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return{accountId:i,contracts:o}}))},nextSlide:function(t){var e;if(!this.stopClick){var i=this.slidersArr.splice(t);(e=this.slidersArr).splice.apply(e,[0,0].concat(Object(x["a"])(i))),this.first=this.slidersCount[0],this.slidersCount=this.slidersCount.filter((function(t,e){return 0!==e})),this.stopClick=!0}},beforeEnter:function(t){t.style.opacity=0,this.stopClick=!1,this.animationKey=!this.animationKey},enter:function(t,e){var i=null,o=this.time;window.requestAnimationFrame((function n(s){i||(i=s);var r=s-i,a=r/o;if(t.style.opacity=a,a<1)return window.requestAnimationFrame(n);t.style.opacity=1,e()}))},leave:function(t,e){var i=null,o=this.time,n=0,s=this;window.requestAnimationFrame((function r(a){i||(i=a);var c=a-i,l=c/o;if(n+=.8,t.style.opacity=1-l+.005,t.style.transform="translate3d(".concat(-1*n+"%",", 0, 0)"),l<1)return window.requestAnimationFrame(r);setTimeout((function(){e(),s.slidersCount.push(s.first)}),s.time)}))},setSlideTop:function(t){var e=this.slidersArr.findIndex((function(e){return e.length===t}));this.nextSlide(e)},getObjectStat:function(t){var e=[];return t.forEach((function(t){e.push(zot(t))})),e},setMessageHandler:function(t){"AccountShortStatisticV2"===(null===t||void 0===t?void 0:t.command)&&(this.statData=this.getObjectStat(JSON.parse(t.data)))},setExpand:function(){this.expand=!this.expand},closeSidebar:function(){this.$emit("closeSidebar")}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.topPortfolios.length&&t.getAnalyticData(t.topPortfolios),t.$socketStream.$on("apiWS3",t.setMessageHandler);case 2:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},Xot=Yot,Qot=(i("a84a"),Object(C["a"])(Xot,Vtt,Htt,!1,null,"0dae43ec",null)),Jot=Qot.exports,Kot=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"CompareGraphTop",class:e.darkClass},[e.isVisibleContent||e.emptyData?e.emptyData?i("div",{staticClass:"emptyData"},[i("div",{staticClass:"wrapperSvg"},[i("svgIcon",e._b({},"svgIcon",e.iconBigData,!1))],1),e._v(e._s(e.$t("no_data")))]):i("div",{staticClass:"graphContent"},[i("div",{staticClass:"commonPipsBlock"},[i("div",{staticClass:"value",class:e.commonPips.dopClass},[e._v(e._s(e.commonPips.value))]),i("div",{staticClass:"triangle",class:e.commonPips.dopClass})]),i("div",{staticClass:"checkboxContainer"},[i("transition-group",{attrs:{name:"listExperts",tag:"div"}},e._l(e.dataCheckBoxSorted,(function(t){return i("CheckboxBlock",{key:t.idCheck,attrs:{dataObj:t,check:t.check,color:t.color,idCheck:t.idCheck},on:{setStatus:e.setStatus},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.data;return[i("CheckBoxContent",{attrs:{pips:o.pips,idCheck:o.idCheck,topPortfolios:e.topPortfolios,selectedContract:e.selectedContract,statDataReadyMadeSolution:e.statDataReadyMadeSolution}})]}}],null,!0)})})),1)],1),i("LineEventChart",{key:null===(t=e.points)||void 0===t?void 0:t.length,attrs:{points:e.points,metaInfoForLines:e.metaInfoLines,typeXAxis:"dateClear",widthYaxis:"7rem",theme:e.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:e.hoverPoint}}),i("ButtonTogglePeriod",{attrs:{activeButton:e.activeButton},on:{setActiveButton:e.setActiveButton}})],1):i("div",{staticClass:"preloaderContainer"},[e.iconLoader?i("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:90}}):i("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,message:"",progress:e.getProgressLoadingLocalStat,enabledMessage:!1,icon:!1}})],1)])},Zot=[],tnt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckboxBlock",class:t.darkClass},[e("div",{staticClass:"checkbox",class:{colored:t.color},style:t.styleColor},[e("DxCheckBox",{attrs:{value:t.check,elementAttr:{class:"checkBoxCustom"},onValueChanged:t.setStatus}}),t._t("default",null,{data:t.dataObj})],2)])},ent=[],int={name:"CheckboxBlock",components:{DxCheckBox:Th["DxCheckBox"]},props:{check:{type:Boolean},color:{type:String},idCheck:{type:[String,Number]},dataObj:{type:Object}},mixins:[xt],data:function(){return{}},watch:{},computed:{styleColor:function(){return{"--color-checkbox":this.color}}},methods:{setStatus:function(t){this.$emit("setStatus",{status:t.value,idCheck:this.idCheck})}},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},ont=int,nnt=(i("7ba5"),Object(C["a"])(ont,tnt,ent,!1,null,"31f47048",null)),snt=nnt.exports,rnt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckBoxContent",class:t.darkClass,on:{mouseenter:function(e){return t.setHovered(!0)},mouseleave:function(e){return t.setHovered(!1)}}},[e("div",{staticClass:"containerName"},[e("div",{staticClass:"namePortfolio",class:{symbol:"all"!==t.selectedContract}},[t._v(t._s(t.name))])]),e("div",{staticClass:"pips",class:t.dopClass},[t._v(t._s(t.pipsFormatted))]),e("transition",{staticClass:"lol",attrs:{name:"fade"}},[t.hovered?e("div",{staticClass:"copyAndAddPortfolio",class:"box".concat(t.idCheck)},[e("div",{staticClass:"checkboxWrapper",class:{noClicked:t.isLoadingStart||t.isLoadingCreated},on:{mouseenter:function(e){t.viewTooltipHandler(e,t.$t("add_to_portfolio"))},mouseleave:t.hideTooltip,click:t.addToDraft}},[t.isLoadingCreated?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):e("svgIcon",t._b({},"svgIcon",t.dataIconPlus,!1))],1),e("div",{staticClass:"checkboxWrapper",class:{noClicked:t.isLoadingStart||t.isLoadingCreated},on:{mouseenter:function(e){t.viewTooltipHandler(e,t.$t("copy"))},mouseleave:t.hideTooltip,click:t.startCopy}},[t.isLoadingStart?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):e("svgIcon",t._b({},"svgIcon",t.dataIconCopy,!1))],1)]):t._e()]),t.hovered?e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionBottomCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))]):t._e()],1)},ant=[],cnt={name:"CheckBoxContent",components:{DxLoadIndicator:OT["DxLoadIndicator"]},props:{pips:{type:Number},topPortfolios:{type:Array},idCheck:{type:[String,Number]},statDataReadyMadeSolution:{type:Array},selectedContract:{type:String}},mixins:[xt,Ot,Dq],data:function(){return{textTooltip:"",hovered:!1}},computed:{portfolioForSlider:function(){var t=this;return this.topPortfolios.find((function(e){return e.length===t.idCheck}))},pipsFormatted:function(){return Lm(this.pips,2,!0)},dopClass:function(){return{green:this.pips>=0,red:this.pips<0}},dataIconPlus:function(){return{name:"Favorite-off",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},dataIconCopy:function(){return{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}}},methods:{viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},setHovered:function(t){this.hovered=t}}},lnt=cnt,unt=(i("94ee"),Object(C["a"])(lnt,rnt,ant,!1,null,"a0458de0",null)),dnt=unt.exports,hnt={data:function(){return{activeButton:"currentYear",statLocal:[]}},methods:{setActiveButton:function(t){"allHistory"===t?this.getAllHistory():(this.activeButton=t,this.visibleGraph=!1,this.points=null,this.dataCheckBox=this.setDataCheckBox(),this.redrawingGraph())},getAllHistory:function(){if(this.activeButton="allHistory",this.visibleGraph=!1,this.points=null,this.statLocal.length>0)return this.dataCheckBox=this.setDataCheckBox(),void this.redrawingGraph();this.iconLoader=!1,this.progress=0,this.postLocalStatistic()},postLocalStatistic:function(){var t=this;this.accountsAndContract?Object.keys(this.accountsAndContract).forEach((function(e){t.getStatByContract(e,t.accountsAndContract[e])})):this.portfolioForSlider.forEach((function(e){t.getStatByContract(e.accountId,[e.contract])}))},getStatByContract:function(t,e){var i={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:e}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)&&"allHistory"===this.activeButton){var e=Td(JSON.parse(t.data));this.setStat(e)}},setStat:function(t){this.statLocal.push({accountId:t.dailyData.accountId,data:t.data}),this.progress+=1}},mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},pnt={name:"CompareGraphTop",components:{LineEventChart:Uk,CheckboxBlock:snt,CheckBoxContent:dnt,Preloader:ah,ButtonTogglePeriod:Let},props:{topPortfolios:{type:Array},statDataReadyMadeSolution:{type:Array},getStatusProgress:{type:Boolean},selectedContract:{type:String},accountsArr:{type:Array}},mixins:[xt,qe,hnt],data:function(){return{checked:this.topPortfolios.map((function(t){return t.length})),points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,visibleGraph:!1,graphData:{},progress:0,dataCheckBox:[],iconLoader:!0}},watch:{getStatusProgress:function(t){t?(this.dataCheckBox=this.setDataCheckBox(),this.redrawingGraph(),this.checked=this.topPortfolios.map((function(t){return t.length}))):(this.activeButton="currentYear",this.statLocal=[])},checked:function(){this.redrawingGraph()},getProgressLoadingLocalStat:function(t){100===t&&(this.iconLoader=!0,this.dataCheckBox=this.setDataCheckBox(),this.redrawingGraph())}},computed:{accountsAndContract:function(){var t={};return this.topPortfolios.forEach((function(e){e.forEach((function(e){t[e.accountId]||(t[e.accountId]=[]),t[e.accountId].includes(e.contract)||t[e.accountId].push(e.contract)}))})),t},getProgressLoadingLocalStat:function(){return 100*this.progress/this.accountsArr.length},colors:function(){var t=this.getSetRandomColors,e=[];return this.topPortfolios.length>10&&Array.from(new Array(this.topPortfolios.length-10)).forEach((function(){var t=uB(),i=t.color,o=t.fill;e.push({color:i,fill:o})})),[].concat(Object(x["a"])(t),e)},statCurrentData:function(){return"currentYear"!==this.activeButton&&this.statLocal.length?this.statLocal:this.statDataReadyMadeSolution},dataFiltered:function(){if(this.dataCheckBox)return this.dataCheckBox.filter((function(t){return t.check}))},dataCheckBoxSortedByPips:function(){if(this.dataCheckBox)return this.dataCheckBox.sort((function(t,e){return e.pips-t.pips}))},dataCheckBoxSorted:function(){if(this.dataCheckBoxSortedByPips)return this.dataCheckBoxSortedByPips.sort((function(t,e){return e.check-t.check}))},commonPips:function(){if(this.dataFiltered){var t=this.dataFiltered.reduce((function(t,e){return t+e.pips}),0);return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}}},commonPercentDay:function(){if(this.dataFiltered){var t=this.dataFiltered.reduce((function(t,e){return t+e.percentPipsDay}),0);return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}}},commonPercentMonth:function(){if(this.dataFiltered){var t=this.dataFiltered.reduce((function(t,e){return t+e.percentPipsMonth}),0);return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}}},emptyData:function(){var t;return 0===(null===(t=this.topPortfolios[0])||void 0===t?void 0:t.length)},isVisibleContent:function(){return this.visibleGraph&&this.getStatusProgress},iconBigData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c",size:40}}},methods:{setDataCheckBox:function(){var t=this,e="all"!==this.selectedContract?this.selectedContract:"";return this.topPortfolios.map((function(i,o){var n=Array.from(new Set(i.map((function(t){return t.accountId})))),s=t.statCurrentData.filter((function(t){return n.includes(t.accountId)}));if("all"===t.selectedContract){var r={};i.forEach((function(t){var e=t.accountId;r[e]||(r[e]=[]),r[e].push(t.contract)})),s=s.map((function(t){return{accountId:t.accountId,data:t.data.filter((function(e){return r[t.accountId].includes(e.contract)}))}}))}var a=MW(s.map((function(t){return t.data})),(function(t){return t.pip}),i.length),c=a.map((function(t,e,i){if(0===e)return 0;var o=i[e-1].sumValue,n=i[e].sumValue,s=n-o;return 0===o?100:100*s/o})),l=c.reduce((function(t,e){return t+e}),0)/c.length,u={};a.forEach((function(t){var e=new Date(t.date),i=e.getMonth(),o=e.getFullYear(),n=new Date(o,i,1).getTime();u[n]||(u[n]=[]),u[n].push(t.sumValue)})),u=Object.entries(u).sort((function(t,e){return+t[0]-+e[0]}));var d=u.map((function(t){var e=Object(D["a"])(t,2),i=e[1],o=i.at(-1)-i[0],n=i.find((function(t){return t>0})),s=100*o/n;return{percentMonth:isNaN(s)?0:s}})),h=d.reduce((function(t,e){return t+e.percentMonth}),0),p=h/d.length;return{name:"ТОП ".concat(i.length," ").concat(e),check:!0,idCheck:i.length,color:t.colors[o].color,fill:t.colors[o].fill,pips:a.at(-1).sumValue,statDataGraph:a,percentPipsDay:l,percentPipsMonth:p}}))},setStatus:function(t){var e=t.status,i=t.idCheck,o=this.dataCheckBox.findIndex((function(t){return t.idCheck===i}));this.dataCheckBox[o].check=e,e?this.checked.push(i):this.checked=this.checked.filter((function(t){return t!==i}))},setPointsForChart:function(){var t=this;this.dataFiltered&&(this.metaInfoLines=[],this.points=[],this.dataFiltered.forEach((function(e){t.metaInfoLines.push({type:"line",color:e.color,fill:e.fill,fillIndicator:t.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""});var i=e.statDataGraph.map((function(t){return{x:t.date,y:t.sumValue,date:t.date}}));t.points.push(i)})),this.visibleGraph=!0)},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},redrawingGraph:function(){this.setPointsForChart()}},mounted:function(){var t=this;this.dataCheckBox=this.setDataCheckBox(),setTimeout((function(){t.setPointsForChart()}),50)},destroyed:function(){this.visibleGraph=!1}},gnt=pnt,fnt=(i("b685"),Object(C["a"])(gnt,Kot,Zot,!1,null,"3b044357",null)),mnt=fnt.exports,vnt={name:"SlideByContract",inject:["setParamFilteringByReadyMadeSolution","setParamFiltering"],props:{topPortfolios:{type:Array},statDataReadyMadeSolution:{type:Array},getStatusProgress:{type:Boolean},accountsArr:{type:Array},traders:{type:Array},theBestFiveTraders:{type:Array},skipCount:{type:Number},buttonsValue:{type:Object},setButtonsValue:{type:Function},getPages:{type:Array},getAccounts:{type:Function},isVisiblePreloader:{type:Boolean},getProgress:{type:[Number,String]},alertMessage:{type:String},toTop:{type:Boolean},startRender:{type:Boolean},defaultFilterByTraders:{type:Object},instrumentType:{type:String},emptyProvider:{type:Boolean}},components:{Scroller:Utt,Slider:Jot,CompareGraphTop:mnt,CardAndGraph:_tt,CardExpertStrategies:U9},data:function(){return{namePage:"Slider",view:null,selectedContract:"all",expand:!1}},watch:{namePage:function(){this.view=null}},computed:{topView:function(){return"tops"===this.buttonsValue.whoAreWeShowing},scrollerProps:function(){return{topPortfoliosLength:this.topPortfolios.length,topView:this.topView,namePage:this.namePage,view:this.view,buttonsValue:this.buttonsValue,setButtonsValue:this.setButtonsValue,selectedContract:this.selectedContract,setParamFiltering:this.setParamFiltering,defaultFilterByTraders:this.defaultFilterByTraders,getStatusProgress:this.getStatusProgress,expand:this.expand,instrumentType:this.instrumentType,emptyProvider:this.emptyProvider}},getNamePage:function(){return"Block"===this.view&&"Slider"===this.namePage?"CardAndGraph":this.namePage},getProps:function(){return{Slider:{getStatusProgress:this.getStatusProgress,selectedContract:this.selectedContract,topPortfolios:this.topPortfolios,namePage:this.namePage,statDataReadyMadeSolution:this.statDataReadyMadeSolution,emptyProvider:this.emptyProvider},CompareGraphTop:{getStatusProgress:this.getStatusProgress,topPortfolios:this.topPortfolios,statDataReadyMadeSolution:this.statDataReadyMadeSolution,selectedContract:this.selectedContract,accountsArr:this.accountsArr},CardAndGraph:{accountsArr:this.accountsArr,topPortfolios:this.topPortfolios,statDataReadyMadeSolution:this.statDataReadyMadeSolution,getStatusProgress:this.getStatusProgress,selectedContract:this.selectedContract,getProgress:this.getProgress,alertMessage:this.alertMessage},CardExpertStrategies:{key:this.startRender,ref:"flatTable",traders:this.traders,theBestFiveTraders:this.theBestFiveTraders,skipCount:this.skipCount,getPages:this.getPages,getAccounts:this.getAccounts,isVisiblePreloader:this.isVisiblePreloader,getProgress:this.getProgress,alertMessage:this.alertMessage,toTop:this.toTop,buttonsValue:this.buttonsValue,symbol:"all"!==this.selectedContract?this.selectedContract:null,view:this.view,emptyProvider:this.emptyProvider}}}},methods:{setSelectedSignal:function(t){this.selectedContract=t.contract;var e=this.topView?"setParamFilteringByReadyMadeSolution":"setParamFiltering",i={contract:"all"!==t.contract?t.contract:null};t.instrumentType&&(i.instrumentType=t.instrumentType),this[e](i)},setPage:function(t){this.selectedContract="all",this.namePage=t},setView:function(t){this.view=t===this.view?null:t},progressLoaded:function(){this.$emit("progressLoaded")},onScrollTop:function(){this.$refs.flatTable.scrollTop()},closeSidebar:function(){this.expand||(this.expand=!0)},setExpand:function(){this.expand=!this.expand}}},ynt=vnt,Cnt=(i("542d"),Object(C["a"])(ynt,Att,Dtt,!1,null,"d7a0e298",null)),bnt=Cnt.exports,Snt={name:"CardReadyMadeSolution",props:{traders:{type:Array},theBestFiveTraders:{type:Array},topPortfolios:{type:Array},accountsArr:{type:Array},getStatusProgress:{type:Boolean},statDataReadyMadeSolution:{type:Array},buttonsValue:{type:Object},skipCount:{type:Number},setButtonsValue:{type:Function},getPages:{type:Array},getAccounts:{type:Function},isVisiblePreloader:{type:Boolean},getProgress:{type:[Number,String]},alertMessage:{type:String},toTop:{type:Boolean},startRender:{type:Boolean},defaultFilterByTraders:{type:Object},instrumentType:{type:String},emptyProvider:{type:Boolean}},components:{CardAndGraph:_tt,SlideByContract:bnt},computed:{},methods:{progressLoaded:function(){this.$emit("progressLoaded")}}},Pnt=Snt,Tnt=(i("b97d"),Object(C["a"])(Pnt,V9,H9,!1,null,"c9cebe84",null)),xnt=Tnt.exports,Ont={provide:function(){return{setParamFilteringByReadyMadeSolution:this.setParamFilteringByReadyMadeSolution}},data:function(){return{loadingTop:!0,topPortfolios:[],accountsArr:[],statDataReadyMadeSolution:[],countTops:[3,5,10,15,20],filtersByReadyMadeSolution:{ProcPosOrdersFrom:80,ProcPosOrdersTo:100,contract:null,limit:25},instrumentType:"ForexSpot"}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession"})),{},{isReadyMadeSolution:function(){return"tops"===this.buttonsValue.whoAreWeShowing},isBlockView:function(){var t;return"blocks"===(null===(t=this.buttonsValue)||void 0===t?void 0:t.appearance)},getProgressReadyMadeSolution:function(){if(!this.accountsArr.length)return"";var t=this.accountsArr.length,e=this.statDataReadyMadeSolution.length,i=e/t*100;return i.toString()}}),watch:{isReadyMadeSolution:function(t){t?(this.progress=0,this.fetchHandler()):(this.topPortfolios=[],this.accountsArr=[],this.statDataReadyMadeSolution=[],this.filtersByReadyMadeSolution.ProcPosOrdersFrom=0,this.filtersByReadyMadeSolution.ProcPosOrdersTo=100,this.filtersByReadyMadeSolution.contract=null,this.filtersByReadyMadeSolution.limit=100)},filtersByReadyMadeSolution:function(t){this.statDataReadyMadeSolution=[],this.topPortfolios=[],this.accountsArr=[],this.fetchHandler(t.contract)}},methods:{fetchHandler:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.emptyProvider=!1,o=Object(c["a"])(Object(c["a"])({},e.filtersByReadyMadeSolution),{},{posProcFrom:e.filtersByReadyMadeSolution.ProcPosOrdersFrom,posProcTo:e.filtersByReadyMadeSolution.ProcPosOrdersTo,instrumentType:e.instrumentType}),delete o.ProcPosOrdersFrom,delete o.ProcPosOrdersTo,i.next=6,e.$workKeys.signMessage(JSON.stringify(o),e.getSession.sk);case 6:return n=i.sent,i.next=9,e.$http.post("".concat(e.getApiUrl,"GetTopAccountsByFilter"),o,{headers:{"Content-Type":"application/json","X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n}});case 9:if(s=i.sent,a=s.data,0!==a.count){i.next=15;break}return e.emptyProvider=!0,e.loadingTop=!1,i.abrupt("return");case 15:l=!1,e.countTops.forEach((function(t){if(!l){var i=a.data.slice(0,t);e.topPortfolios.push(i),i.length>=a.data.length&&(l=!0)}})),e.loadingTop=!1,e.accountsArr=Array.from(new Set(a.data.map((function(t){return t.accountId})))),e.accountsArr.forEach((function(i){e.getStatByContract(i,t)}));case 20:case"end":return i.stop()}}),i)})))()},getStatByContract:function(t,e){var i;i=this.isReadyMadeSolution&&this.isBlockView?e&&"all"!==e?[e]:null:this.symbol?[this.symbol]:null;var o=new Date,n=o.getFullYear()-1,s=o.getMonth(),r=o.getDay(),a=new Date(n,s,r),c={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:i,DateRequest:a,forChart:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:c})},setStat:function(t){this.isReadyMadeSolution&&this.statDataReadyMadeSolution.push({accountId:t.dailyData.accountId,data:t.data})},setMessageHandlerMixin:function(t){if("100"!==this.getProgressReadyMadeSolution&&"ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}},setParamFilteringByReadyMadeSolution:function(t){var e=Object(c["a"])({},t);t.instrumentType&&delete e.instrumentType,this.instrumentType=t.instrumentType,this.filtersByReadyMadeSolution=Object(c["a"])(Object(c["a"])({},this.filtersByReadyMadeSolution),t)}},mounted:function(){this.fetchHandler(),this.$socketStream.$on("apiWS3",this.setMessageHandlerMixin)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandlerMixin)}},wnt={name:"StrategiesNew",mixins:[xt,KU,Ont],components:{WelcomeModals:J6,DxPopup:wt["DxPopup"],ModalPortfolioExperts:JU,TopBarStrategies:u7,CardExpertStrategies:U9,CardReadyMadeSolution:xnt,Preloader:ah,Paginator:b9},provide:function(){return{setParamFiltering:this.setParamFiltering}},data:function(){return{buttonsValue:{whoAreWeShowing:"tops",appearance:"blocks"},statusWelcomeModal:!1,traders:[],theBestFiveTraders:[],allTraders:[],emptyLogins:[],defaultFilterByTraders:{takeCount:0,isOrderDesc:!1,order:7,minEquity:1e3,contract:null,IsActiveSource:!0,ProcPosOrdersFrom:50,ProcPosOrdersTo:100},alertMessage:"",progress:0,skipCount:0,pages:0,countPage:25,toTop:!1,filterObject:{isOrderDesc:!1,order:7},startRender:!1,emptyProvider:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getWelcomsModals:"userSettings/getWelcomsModals",expertsLogin:"expertsPortfolio/expertsLogin",findExpert:"expertsPortfolio/findExpert",getApiUrl:"api/api",getSession:"auth/getSession",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus"})),{},{getPages:function(){for(var t=Math.ceil(this.pages/this.countPage),e=[],i=0;i=this.traders.length))},getProgressProvider:function(){if(!this.traders.length)return"";var t=this.progress/this.traders.length*100;return t.toString()},getProgress:function(){return this.isReadyMadeSolution?this.getProgressReadyMadeSolution:this.getProgressProvider},getStatus:function(){return"ready"===this.getUserDetailRequestStatus||"noSent"===this.getAuthRequestStatus},isVisiblePreloader:function(){var t,e="tops"===this.buttonsValue.whoAreWeShowing,i="blocks"===(null===(t=this.buttonsValue)||void 0===t?void 0:t.appearance);return(!e||!i)&&!this.getStatusProgress}}),watch:{getDefaultAccount:function(t){t&&this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Created"]})},getStatus:function(t){t&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Tops"===t})):!this.getWelcomsModals.length)},traders:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!(t.length>0)){i.next=6;break}return o=t.map((function(t){return t.login})),i.next=4,e.getShortSourcesByAccountIds({logins:o,checkStat:!0});case 4:return i.next=6,e.getShortSourcesByAccountIds({logins:o,checkStat:!1});case 6:case"end":return i.stop()}}),i)})))()},isReadyMadeSolution:function(t){t?(this.defaultFilterByTraders.takeCount=0,this.defaultFilterByTraders.isOrderDesc=!1,this.defaultFilterByTraders.order=7,this.defaultFilterByTraders.minEquity=1e3,this.defaultFilterByTraders.contract=null,this.defaultFilterByTraders.IsActiveSource=!0,this.defaultFilterByTraders.ProcPosOrdersFrom=50,this.defaultFilterByTraders.ProcPosOrdersTo=100):this.sendMessageAccountByFilter(this.defaultFilterByTraders)}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getShortSourcesByAccountIds:"expertsPortfolio/getShortSourcesByAccountIds",getListsPortfolio:"expertsPortfolio/getListsPortfolio"})),{},{hideWelcome:function(){this.statusWelcomeModal=!1},setButtonsValue:function(t){var e=t.data,i=t.field;this.buttonsValue[i]=e},sendMessageAccountByFilter:function(t){this.emptyProvider=!1;var e={command:"AccountsByFilter",method:"get",data:t};this.$socketStream.sendCommand({ws:"apiWS",command:e})},setMessageHandler:function(t){"AccountsByFilter"===(null===t||void 0===t?void 0:t.command)&&(this.setStrategy(t.data),0===t.data.length&&(this.emptyProvider=!0)),"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&this.getListsPortfolio(Kq(JSON.parse(t.data)))},setStrategy:function(t){this.allTraders=t,this.pages=this.allTraders.length,this.allTraders.length?this.getAccounts():this.traders=[]},getAccounts:function(t){var e=this;t&&(this.skipCount=t.skipCount,this.countPage=t.count),this.traders=this.getTradersByCount.map((function(t,i){return{accountGroup:t.accountGroup,sequenceId:t.sequenceId,login:t.accountId,userId:t.ttUserId,userLogin:t.userLogin,index:i+1+e.skipCount*e.countPage,isOnline:!0,avatar:t.avatarURL,traderName:t.firstName+" "+t.lastName}})),this.theBestFiveTraders=this.traders.slice(0,5),this.progress=0,this.startRender=!this.startRender},progressLoaded:function(){this.progress++},setParamFiltering:function(t){this.skipCount=0,this.defaultFilterByTraders=Object(c["a"])(Object(c["a"])({},this.defaultFilterByTraders),t),this.sendMessageAccountByFilter(this.defaultFilterByTraders)}}),mounted:function(){var t;this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler),this.getStatus&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Tops"===t})):!this.getWelcomsModals.length),null!==(t=this.getDefaultAccount)&&void 0!==t&&t.id&&this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Active","Created","Stoped"]})},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)}},_nt=wnt,Ant=(i("53be"),Object(C["a"])(_nt,i7,o7,!1,null,"742d8205",null)),Dnt=Ant.exports,knt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-area",class:t.getActiveTheme},[e("Layout",{attrs:{right:t.getRightSideBar,left:t.getLeftSideBar},scopedSlots:t._u([{key:"left",fn:function(){return[e("PersonalLeftBar",{attrs:{currentTab:t.currentTab},on:{deleteAccount:t.deleteAccount,lockAccount:t.lockAccount,setTab:t.handleChangeTab}})]},proxy:!0},{key:"center",fn:function(){return[e("div",{staticClass:"personal-area-center",class:t.getActiveTheme},[t.isShowOverlay?e("div",{staticClass:"personal-area-center-overlay",class:t.getActiveTheme,on:{click:t.closeOverlay}}):t._e(),e(t.currentTab,{key:t.currentTitle,ref:"".concat(t.currentTab,"Ref"),tag:"component",attrs:{isShowOverlay:t.isShowOverlay,tabSettings:t.tabSettings},on:{showOverlay:function(){return t.isShowOverlay=!0},setTab:t.handleChangeTab}})],1)]},proxy:!0},{key:"right",fn:function(){},proxy:!0}])})],1)},Int=[],Bnt=(i("c1f9"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-left-bar",class:t.getActiveTheme},[e("PersonalLeftBarHeadline"),e("PersonalLeftBarHeader"),e("PersonalLeftBarList",{attrs:{currentTab:t.currentTab},on:{setTab:t.setTab}})],1)}),Mnt=[],$nt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-left-bar-headline",class:t.getActiveTheme},[e("p",{staticClass:"personal-left-bar-headline__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.PersonalAccount")))])])},Lnt=[],Fnt={components:{Button:zt},props:["currentTab","isMini"],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getColorIcon:function(){return"dark"===this.getActiveTheme?"#8fa8c1":"#8c8c8c"}}),methods:{closeLeftSideBar:function(){}}},jnt=Fnt,Rnt=(i("baf4"),Object(C["a"])(jnt,$nt,Lnt,!1,null,"64a38397",null)),Wnt=Rnt.exports,Nnt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-left-bar-header",class:t.getActiveTheme},[e("div",{staticClass:"personal-left-bar-header__info",class:t.getActiveTheme},[e("div",{staticClass:"personal-left-bar-header__name",class:t.getActiveTheme},[t._v(t._s(t.getPersonalName))]),t.getCreatedDate?e("div",{staticClass:"personal-left-bar-header__created",class:t.getActiveTheme},[e("div",{staticClass:"personal-left-bar-header__caption",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.ProfileCreated")))]),e("div",{staticClass:"personal-left-bar-header__filler",class:t.getActiveTheme}),e("div",{staticClass:"personal-left-bar-header__date",class:t.getActiveTheme},[t._v(t._s(t.getCreatedDate))])]):t._e()]),e("div",{staticClass:"personal-left-bar-header__avatar-container",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"5.2",src:t.getUser.avatarURL,theme:t.getActiveTheme}})],1)])},Ent=[],Unt={components:{Avatar:E},data:function(){return{}},props:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUser:"user/getUserDetail",getActiveTheme:"headerSettings/getActiveTheme",getPaymentReference:"paymentService/getPaymentReference",getUserPaymentServices:"paymentService/getUserPaymentServices"})),{},{getPersonalName:function(){return this.getUser?"".concat(this.getUser.firstName," ").concat(this.getUser.lastName):""},getCreatedDate:function(){var t,e;return null!==(t=this.getUser)&&void 0!==t&&t.userCreateDate?new Date(null===(e=this.getUser)||void 0===e?void 0:e.userCreateDate).toLocaleDateString():""}}),methods:{deleteAccount:function(){this.$emit("deleteAccount")},lockAccount:function(){this.$emit("lockAccount")}}},Vnt=Unt,Hnt=(i("9820"),Object(C["a"])(Vnt,Nnt,Ent,!1,null,"0281ba04",null)),Gnt=Hnt.exports,qnt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Personal-left-bar-list"},t._l(t.listTabs,(function(i){return e("div",{staticClass:"Personal-left-bar__item",class:{dark:"dark"===t.getActiveTheme,light:"light"===t.getActiveTheme,activeTab:t.currentTab===i.tab},style:{justifyContent:t.isMini&&"center"},on:{click:function(e){return t.setTab(i)}}},[e("svgIcon",{style:{marginRight:t.isMini?"0px":"8px",color:t.currentTab===i.tab?"white":t.getColorIcon},attrs:{name:i.icon}}),t.isMini?t._e():e("div",{staticClass:"Personal-left-bar__item-name"},[e("div",{style:{whiteSpace:"nowrap"}},[t._v(t._s(t.$t(i.name.toString())))])])],1)})),0)},znt=[],Ynt={data:function(){return{listTabs:[{disabled:!1,name:"personalArea.sidebar.MyData",icon:"DataGraph_Avatar",tab:"PersonalMyData"},{disabled:!1,name:"personalArea.sidebar.TradingAccounts",icon:"TradingAccounts",tab:"PersonalTradingAccounts"},{disabled:!1,name:"personalArea.sidebar.Payments",icon:"lk-leftbar-payments-and-comission",tab:"PersonalPayments"},{disabled:!1,name:"personalArea.sidebar.Signals",icon:"lk-leftbar-trade-signals",tab:"PersonalSignals"},{disabled:!1,name:"personalArea.sidebar.Partner",icon:"lk-leftbar-trade-partner",tab:"PersonalPartner"},{disabled:!1,name:"personalArea.sidebar.TelegramReports",icon:"Messenger-Telegramm",tab:"PersonalTelegramReports"},{disabled:!1,name:"personalArea.sidebar.Verification",icon:"Verification",tab:"PersonalVerification"},{disabled:!1,name:"personalArea.sidebar.Devices",icon:"Devices",tab:"PersonalDevices"},{disabled:!1,name:"personalArea.sidebar.Documents",icon:"Documents",tab:"PersonalDocuments"}]}},props:["currentTab","isMini"],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUser:"user/getUserDetail",getUserProfile:"user/getUserProfile",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getColorIcon:function(){return"dark"===this.getActiveTheme?"#8fa8c1":"#8c8c8c"}}),watch:{},methods:{setTab:function(t){this.$emit("setTab",t)}},mounted:function(){}},Xnt=Ynt,Qnt=(i("240b"),Object(C["a"])(Xnt,qnt,znt,!1,null,"5f98c80d",null)),Jnt=Qnt.exports,Knt={components:{PersonalLeftBarHeadline:Wnt,PersonalLeftBarHeader:Gnt,PersonalLeftBarList:Jnt},data:function(){return{userData:null}},props:["currentTab"],computed:Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getUserProfile:"user/getUserProfile",getLeftSideBar:"userSettings/getLeftSideBar",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme"})),watch:{getDefaultAccount:function(){this.getAlienProfileData()}},methods:{deleteAccount:function(){this.$emit("deleteAccount")},lockAccount:function(){this.$emit("lockAccount")},setTab:function(t){this.$emit("setTab",t)},getAlienProfileData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.getDefaultAccount&&t.getDefaultAccount.id){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$http.get("".concat(t.getApiUrl,"UserAccountsInfoSimpleSingle"),{params:{accountid:t.getDefaultAccount.id}});case 4:i=e.sent,o=i.data,t.userData=o.ttUser;case 7:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;this.$nextTick((function(){t.getAlienProfileData()}))}},Znt=Knt,tst=(i("3933"),Object(C["a"])(Znt,Bnt,Mnt,!1,null,"64b12286",null)),est=tst.exports,ist=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-area-my-data"},[e("div",{staticClass:"popupDefaultSelect",class:t.getActiveTheme}),t.isOpenChangeAvatar?e("ModalLoadAvatar",{attrs:{isOpen:t.isOpenChangeAvatar,src:t.srcAvatar,userId:t.getUser.id},on:{close:function(){return t.isOpenChangeAvatar=!1}}}):t._e(),e("div",{staticClass:"personal-area-my-data__container",class:t.getActiveTheme},[e("div",{staticClass:"personal-area-my-data-block"},[e("div",{staticClass:"personal-area-my-data-block__header"},[e("div",{staticClass:"personal-area-my-data-block__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.PublicInformation")))])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.FirstName")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.firstName,disabled:!t.isEditingfirstName},on:{onchange:function(e){return t.firstName=e}}}),t.isEditingfirstName?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("firstName",t.firstName)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditingfirstName?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.endEdit("firstName")}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.Surname")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.lastName,disabled:!t.isEditinglastName},on:{onchange:function(e){return t.lastName=e}}}),t.isEditinglastName?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("lastName",t.lastName)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditinglastName?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.endEdit("lastName")}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.Avatar")))]),e("div",{staticClass:"avatar-wrapper"},[e("div",{staticClass:"border-on-avatar",class:t.getActiveTheme,on:{click:t.triggerUpload}},[e("input",{ref:"uploadrAvatar",attrs:{accept:t.formatsString,type:"file"},on:{change:t.handleFileChange}}),e("Avatar",{attrs:{size:"4.2",src:t.getUser.avatarURL,theme:t.getActiveTheme}})],1),e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:t.triggerUpload}},[e("svgIcon",{attrs:{name:"Photo"}})],1)])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.AboutMe")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.aboutMe,expression:"aboutMe"}],staticClass:"personal-area-my-data-block-field-container",class:t.getActiveTheme,attrs:{type:"text",rows:"4",placeholder:t.$t("personalArea.personalMyData.public.AboutPlaceholder"),disabled:!t.isEditingaboutMe},domProps:{value:t.aboutMe},on:{input:function(e){e.target.composing||(t.aboutMe=e.target.value)}}}),t.isEditingaboutMe?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("aboutMe",t.aboutMe)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditingaboutMe?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.endEdit("aboutMe")}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.Country")))]),e("div",{staticClass:"dx-field",class:t.getActiveTheme},[e("div",{staticClass:"dx-field-value"},[e("DxSelectBox",{key:"select-"+t.country,attrs:{dropDownOptions:{container:".popupDefaultSelect"},items:t.countries,hoverStateEnabled:!1,allowSearch:!0,"drop-down-button-template":"iconDropDownTimeFrame","display-expr":"country.countryName","value-expr":"country.countryCode",placeholder:t.$t("common.select.PlaceholderCountry")},on:{"value-changed":t.countrySelectedCall},scopedSlots:t._u([{key:"item",fn:function(e){var i=e.data;return[t._v(t._s(i.country.countryName))]}},{key:"iconDropDownTimeFrame",fn:function(){return[e("div",{class:"".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1)]},proxy:!0}]),model:{value:t.country,callback:function(e){t.country=e},expression:"country"}})],1)])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.City")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.city,disabled:!t.isEditingcity},on:{onchange:function(e){return t.city=e}}}),t.isEditingcity?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("city",t.city)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditingcity?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.endEdit("city")}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.Timezone")))]),e("div",{staticClass:"dx-field",class:t.getActiveTheme},[e("div",{staticClass:"dx-field-value",class:t.timezones&&t.timezones.length?"":"disabled"},[e("DxSelectBox",{key:"select-"+t.zone,attrs:{dropDownOptions:{container:".popupDefaultSelect"},items:t.timezones,hoverStateEnabled:!1,"drop-down-button-template":"iconDropDownTimeFrame","display-expr":function(t){return t&&"".concat(t.timeZoneId," UTC(").concat(t.gmt,":00)")},"value-expr":"timeZoneId",noDataText:t.country?t.$t("common.select.noData"):t.$t("common.select.ChooseTheCountry"),placeholder:t.$t("common.select.Placeholder")},on:{"value-changed":function(e){return t.saveSelectData(e,"zone")}},scopedSlots:t._u([{key:"item",fn:function(e){var i=e.data;return[t._v(t._s(i.timeZoneId+"UTC("+i.gmt+":00)"))]}},{key:"iconDropDownTimeFrame",fn:function(){return[e("div",{class:"".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1)]},proxy:!0}]),model:{value:t.zone,callback:function(e){t.zone=e},expression:"zone"}})],1)])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.public.WebSite")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.webSite,disabled:!t.isEditingwebSite},on:{onchange:function(e){return t.webSite=e}}}),t.isEditingwebSite?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("webSite",t.webSite)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditingwebSite?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.endEdit("webSite")}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()],1)])])]),e("div",{staticClass:"personal-area-my-data__container",class:t.getActiveTheme},[e("div",{staticClass:"personal-area-my-data-block"},[e("div",{staticClass:"personal-area-my-data-block__header"},[e("div",{staticClass:"personal-area-my-data-block__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.Auth")))])]),e("Auth"),e("div",{staticClass:"personal-area-my-data-block__header"},[e("div",{staticClass:"personal-area-my-data-block__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.currency.Currency")))])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label extened",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.currency.CurrencyDisclaimer")))]),e("div",{staticClass:"dx-field",class:t.getActiveTheme},[e("div",{staticClass:"dx-field-value"},[e("DxSelectBox",{key:"select-"+t.currency,attrs:{dropDownOptions:{container:".popupDefaultSelect"},items:t.currenciesSelectData,value:t.currency,hoverStateEnabled:!1,"drop-down-button-template":"iconDropDownTimeFrame","display-expr":"label","value-expr":"value",placeholder:t.$t("common.select.Placeholder")},on:{"value-changed":function(e){return t.saveSelectData(e,"currency")}},scopedSlots:t._u([{key:"item",fn:function(e){var i=e.data;return[t._v(t._s(i.label))]}},{key:"iconDropDownTimeFrame",fn:function(){return[e("div",{class:"".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}})],1)]},proxy:!0}])})],1)])])],1)])],1)},ost=[],nst=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideList,expression:"hideList"}],staticClass:"new-input",class:t.getActiveTheme,style:t.getStyled},[t.counter?e("div",{staticClass:"new-input__upped",on:{click:function(e){!t.disabled&&t.$emit("increment")}}},[e("svgIcon",{attrs:{name:"Arrow-expand-top",size:20}})],1):t._e(),t.counter?e("div",{staticClass:"new-input__downed",on:{click:function(e){!t.disabled&&t.$emit("dicrement")}}},[e("svgIcon",{attrs:{name:"Arrow-expand-bottom",size:20}})],1):t._e(),t.search?e("div",{staticClass:"new-input__icn",class:t.height&&"offset-search-icon"},[e("svgIcon",{attrs:{name:"Search-mini",size:24}})],1):t._e(),e("input",{class:t.getClasses,style:t.getStyled,attrs:{disabled:t.disabled,placeholder:t.placeholder?t.placeholder:"",type:t.type},domProps:{value:t.newValue},on:{input:t.handleChangeInput,change:function(e){return t.$emit("change",t.newValue)},click:t.handleShowList}}),t.isList&&t.isOpen?e("div",{staticClass:"new-input__list"},t._l(t.list,(function(i){return e("div",{staticClass:"new-input__item"},[e("DxCheckBox",{attrs:{"element-attr":{class:"attr-to-check-box"},value:i.isAccepted},on:{valueChanged:function(e){return t.changedValueGroup(i)}}}),e("div",{staticClass:"new-input__item-cnt",on:{click:function(e){return t.changeItem(i)}}},[t._v(t._s(i.name))])],1)})),0):t._e(),t.isShowError?e("div",{staticClass:"new-input__invalid"},[e("svgIcon",{attrs:{name:"Alarm",size:16}}),e("span",[t._v(t._s(t.$t(t.defaultErrorMessage)))])],1):t._e()])},sst=[],rst={props:["value","disabled","placeholder","search","counter","isList","list","onlyNumber","maxNumber","height","boldPrice","type"],components:{svgIcon:L,DxCheckBox:Th["DxCheckBox"]},data:function(){return{defaultErrorMessage:"Error",isShowError:!1,newValue:"",isOpen:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStyled:function(){var t={maxHeight:this.height&&this.height>0?this.height+"px":"32px",color:this.boldPrice?"#3c73f1 !important":"",fontWeight:this.boldPrice?"bold":"normal"};return t},getClasses:function(){var t,e=(t={disabled:this.disabled,error:this.isShowError},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,"search",this.search),t);return e}}),watch:{value:function(t){t!==this.newValue&&(this.newValue=t)},list:function(t){var e=t.reduce((function(t,e){return e.isAccepted&&t.push(e.name),t}),[]);this.newValue=e.join()}},methods:{handleShowList:function(){this.isOpen=!this.isOpen},hideList:function(){this.isOpen=!1},changeItem:function(t){this.newValue=t.name,this.isOpen=!1},handleChangeInput:function(t){!t.target.value&&this.onlyNumber&&(t.target.value=0),this.onlyNumber&&this.maxNumber&&+t.target.value>this.maxNumber&&(t.target.value=99),this.newValue=this.onlyNumber?+t.target.value:t.target.value,this.isList||this.$emit("onchange",this.newValue)},changedValueGroup:function(t){this.$emit("changeAccepted",t);var e=this.list.reduce((function(t,e){return e.isAccepted&&t.push(e.name),t}),[]);this.newValue=e.join()}},mounted:function(){this.value&&(this.newValue=this.value),this.isList&&(this.newValue=this.list[0]?this.list[0].name:"")},destroyed:function(){}},ast=rst,cst=(i("5bef"),Object(C["a"])(ast,nst,sst,!1,null,"0831c507",null)),lst=cst.exports,ust=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:t.isOpen,width:"900",title:t.$t("loadIm"),modifier:"modal--reg modal--login"},on:{close:t.close},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{staticStyle:{display:"flex"}},[e("div",{staticClass:"img-container"},[e("img",{ref:"image",attrs:{src:t.src,crossorigin:""}})]),e("div",{staticStyle:{"margin-left":"10px"}},[e("img",{ref:"cropImage",staticClass:"img-preview",attrs:{src:t.destination}}),e("Button",{attrs:{disable:t.statusSaveButton,process:t.statusSaveButton,typeBtn:"primary"},on:{click:t.sentCroppedFile}},[t._v(t._s(t.$t("save")))]),t.msg?e("div",{staticClass:"msg",class:t.getErrorCssClass,on:{click:t.sentCroppedFile}},[e("svgIcon",{attrs:{name:t.getErrorIcon}}),t._v(t._s(t.msg))],1):t._e()],1)])]},proxy:!0}])})},dst=[],hst={components:{Modal:Oe,Button:Pa,svgIcon:L},data:function(){return{cropper:{},destination:{},blobFile:null,image:{},msg:"",statusSaveButton:!1,errorUpload:!1}},props:{isOpen:{default:!0,type:Boolean},src:{type:String},cropFactor:{type:Object,default:function(){return{width:300,height:300}}},ratio:{type:Number,default:1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getApiUri:"api/api",getUser:"user/getUserDetail",getChatAuth:"chat/getChatAuth",getApiChat:"api/apiChat"})),{},{getErrorIcon:function(){return this.errorUpload?"Warning":"Check"},getErrorCssClass:function(){return this.errorUpload?"text-error":"text-success"}}),methods:{close:function(){this.$emit("close")},uploadChatAvatar:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=new File([t],Date.now()+".jpeg",{type:"image/jpeg",lastModified:Date.now()}),n=new FormData,n.append("image",o),n.append("userId",e.getChatAuth.userId),s={method:"POST",url:"".concat(e.getApiChat,"users.setAvatar?userId=").concat(encodeURIComponent(e.getChatAuth.userId)),headers:{"Content-Type":"multipart/form-data","X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId},data:n},i.next=7,e.$http(s);case 7:case"end":return i.stop()}}),i)})))()},sentCroppedFile:function(){var t=this;if(this.blobFile){this.statusSaveButton=!0;var e=new File([this.blobFile],Date.now()+".jpeg",{type:"image/jpeg",lastModified:Date.now()}),i=new FormData;i.append("file",e);var o={method:"POST",url:"".concat(this.getApiUri,"Image?chatUserId=").concat(encodeURIComponent(this.getChatAuth.userId)),headers:{"Content-Type":"multipart/form-data","X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.singFP},data:i};this.$http(o).then((function(){t.uploadChatAvatar(t.blobFile).then((function(){t.$store.dispatch("user/getUserData",t.getUser.login).then((function(){t.msg="Изображение успешно загружено",t.errorUpload=!1,setTimeout((function(){t.$emit("close")}),1500)}))}))})).catch((function(){t.msg="Ошибка Загрузки попробуйте ещё раз!",t.statusSaveButton=!1,t.errorUpload=!0}))}}},mounted:function(){var t=this;this.image=this.$refs.image,this.cropper=new SP.a(this.image,{zoomable:!0,scalable:!0,aspectRatio:this.ratio,crop:function(){var e=t.cropper.getCroppedCanvas(t.cropFactor);t.destination=e.toDataURL("image/png"),e.toBlob((function(e){t.blobFile=e}),"image/jpeg",.7)}})}},pst=hst,gst=(i("175d"),Object(C["a"])(pst,ust,dst,!1,null,null,null)),fst=gst.exports,mst=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-area-my-data"},[e("div",{staticClass:"personal-area-my-data-block"},[e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.Login")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.getUser.login,disabled:!0}})],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.MobilePhone")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.getUser.phone,disabled:!0}}),e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getClassesForCheckAccepted("isVerifiedPhone")},[e("svgIcon",{attrs:{name:"Check"}})],1)],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.Email")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Input",{attrs:{value:t.email,disabled:!t.isEditingemail},on:{onchange:function(e){return t.email=e}}}),t.isEditingemail?t._e():e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.startEdit("email",t.email)}}},[e("svgIcon",{attrs:{name:"Pencil"}})],1),t.isEditingemail?e("div",{staticClass:"personal-area-my-data-block-field-container__btn",class:t.getActiveTheme,on:{click:function(e){return t.changeEmail()}}},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()],1)]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.TwoFA")))]),e("div",{staticClass:"personal-area-my-data-block-field-wrapper"},[e("Button",{staticClass:"qrbutton",attrs:{label:t.is2FAActive?t.$t("personalArea.personalMyData.auth.TurnOff"):t.$t("personalArea.personalMyData.auth.Setup"),icon:"QR",sizeIcon:24,disabled:null===t.is2FAActive},on:{click:function(e){return t.open2FAQR()}}})],1)]),e("div",{staticClass:"personal-area-my-data-block__header"},[e("div",{staticClass:"personal-area-my-data-block__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.ChangePassword")))])]),e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.CurrentPassword")))]),e("div",{staticClass:"personal-area-my-data-block-field-cover"},[e("div",{staticClass:"personal-area-my-data-block-field-wrapper no-shrink",class:t.getActiveTheme},[e("DxTextBox",{attrs:{type:"password",mode:t.passwordMode,"value-change-event":"keyup",value:t.checkPass,hoverStateEnabled:!1},on:{"value-changed":function(e){return t.checkPass=e.value}}},[e("PasswordViewButton",{class:t.getActiveTheme,attrs:{mode:t.passwordMode},on:{click:function(e){return t.setTypeInput("passwordMode")}}})],1),e("Button",{attrs:{label:t.$t("personalArea.personalMyData.auth.CheckPassword"),icon:"Check",disabled:!t.checkPass},on:{click:function(e){return t.checkPassword()}}})],1),e("ErrorText",{attrs:{text:t.tooltipCheck,visible:Boolean(t.tooltipCheck)}})],1)]),t.isAcceptChangePass?e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.NewPass")))]),e("div",{staticClass:"personal-area-my-data-block-field-cover"},[e("div",{staticClass:"personal-area-my-data-block-field-wrapper",class:t.getActiveTheme},[e("DxTextBox",{class:t.getActiveTheme,attrs:{type:"password",mode:t.passwordModeMain,"value-change-event":"keyup",value:t.newPass,hoverStateEnabled:!1},on:{"value-changed":function(e){return t.validatePass(e.value,"newPass")}}},[e("PasswordViewButton",{attrs:{mode:t.passwordModeMain},on:{click:function(e){return t.setTypeInput("passwordModeMain")}}})],1)],1),e("ErrorText",{attrs:{text:t.invalidPass,visible:Boolean(t.invalidPass)}})],1)]):t._e(),t.isAcceptChangePass?e("div",{staticClass:"personal-area-my-data-block-field-container"},[e("div",{staticClass:"personal-area-my-data-block-field-container__label",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalMyData.auth.AcceptNewPass")))]),e("div",{staticClass:"personal-area-my-data-block-field-cover"},[e("div",{staticClass:"personal-area-my-data-block-field-wrapper",class:t.getActiveTheme},[e("DxTextBox",{class:t.getActiveTheme,attrs:{mode:t.passwordModeRepeat,type:"password","value-change-event":"keyup",value:t.acceptPass,hoverStateEnabled:!1},on:{"value-changed":function(e){return t.validatePass(e.value,"acceptPass")}}},[e("PasswordViewButton",{attrs:{mode:t.passwordModeRepeat},on:{click:function(e){return t.setTypeInput("passwordModeRepeat")}}})],1)],1),e("ErrorText",{attrs:{text:t.invalidPassRepeat,visible:Boolean(t.invalidPassRepeat)}})],1)]):t._e(),e("div",{staticClass:"no-shrink"},[t.isAcceptChangePass?e("Button",{attrs:{label:"Confirm",icon:"Check",disabled:!t.changed},on:{click:t.saveSettings}}):t._e()],1)]),e("DxPopup",{class:"Setup2FAPopup ".concat(t.getActiveTheme),attrs:{visible:t.isDisable2FAVisible,width:"300px",height:"438px",maxWidth:"300px",maxHeight:"438px",position:{at:"center",my:"center"},fullScreen:!1,shading:!0,showTitle:!1,showCloseButton:!1,container:".Setup2FAPopup"}},[e("div",{staticClass:"personalAuth-Setup2FAPopup",class:t.getActiveTheme},[e("div",{staticClass:"header",class:t.getActiveTheme},[e("h4",[t._v(t._s(t.$t("personalArea.personalMyData.auth.TurnOff"))+" "+t._s(t.$t("personalArea.personalMyData.auth.GoogleAuth")))]),e("div",{on:{click:function(e){return t.closeDisable2FAPopup()}}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"wrapper"},[e("div",{staticClass:"caption",class:t.getActiveTheme},[t._v("Введите код-ответ сгенерированный приложением Google Authenticator"),e("Input",{attrs:{value:t.disableCode},on:{onchange:function(e){return t.disableCode=e}}})],1),e("Button",{staticClass:"button",attrs:{label:t.$t("common.Continue")},on:{click:t.check2FADisable}},[t.apiBusy?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1)])]),t.imgSrc?e("DxPopup",{class:"Setup2FAPopup ".concat(t.getActiveTheme),attrs:{visible:t.is2FAPopupVisible,width:"300px",height:"438px",maxWidth:"300px",maxHeight:"438px",position:{at:"center",my:"center"},fullScreen:!1,shading:!0,showTitle:!1,showCloseButton:!1,container:".Setup2FAPopup"}},[e("div",{staticClass:"personalAuth-Setup2FAPopup",class:t.getActiveTheme},[e("div",{staticClass:"header",class:t.getActiveTheme},[e("h4",[t._v(t._s(t.$t("personalArea.personalMyData.auth.Setup"))+" "+t._s(t.$t("personalArea.personalMyData.auth.GoogleAuth")))]),e("div",{on:{click:function(e){return t.close2FAPopup()}}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),1===t.step?e("div",{staticClass:"wrapper"},[e("div",{staticClass:"caption",class:t.getActiveTheme},[t._v("Скачайте на телефон приложение Google Authenticator и отсканируйте QR code")]),t.imgSrc?e("div",[e("img",{attrs:{src:t.imgSrc,alt:"",width:"166px",height:"166px"}})]):t._e(),e("div",{staticClass:"caption",class:t.getActiveTheme},[t._v("Если не получается отсканировать скопируйте и вставьте код вручную")]),e("div",{staticClass:"input-wrapper"},[e("Input",{attrs:{disabled:"",value:t.secret}}),e("div",{staticClass:"svg-wrapper",class:t.getActiveTheme,on:{click:function(e){return t.copyToClipBoard(t.secret)}}},[e("svgIcon",{attrs:{name:t.copiedToClipboard?"Check":"content_copy-24px"}})],1)],1),e("Button",{staticClass:"button",attrs:{label:t.$t("common.Continue")},on:{click:function(e){return t.setStep(2)}}})],1):t._e(),2===t.step?e("div",{staticClass:"wrapper"},[e("div",{staticClass:"caption",class:t.getActiveTheme},[t._v("Введите код-ответ сгенерированный приложением Google Authenticator"),e("Input",{attrs:{value:t.code},on:{onchange:function(e){return t.code=e}}})],1),e("Button",{staticClass:"button",attrs:{label:t.$t("common.Continue")},on:{click:t.check2FACode}},[t.apiBusy?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)],1):t._e()])]):t._e(),t.isConfirmOpened?e("networkNotification",{class:"".concat(t.getActiveTheme),attrs:{"icon-name":"checkbox-graphics-complex","icon-height":"86px","icon-width":"154px","popu-width":"300px","button-text":"".concat(t.$t("common.Understand")),message:t.is2FAActive?t.$t("personalArea.personalMyData.auth.GoogleAuthSuccess"):t.$t("personalArea.personalMyData.auth.GoogleAuthRemoved")},on:{click:function(e){t.isConfirmOpened=!1},closeNotification:function(e){t.isConfirmOpened=!1}}}):t._e()],1)},vst=[],yst=function(){var t=this,e=t._self._c;return e("div",{staticClass:"networkNotification",class:t.getActiveTheme,style:"".concat(t.popupWidth?"width:"+t.popupWidth:"",";").concat(t.popupHeight?"height:"+t.popupHeight:"")},[e("div",{staticClass:"networkNotification-body"},[e("div",{staticClass:"networkNotification-body-icon"},[e("svgIcon",{style:"".concat(t.iconWidth?"width:"+t.iconWidth:"",";").concat(t.iconHeight?"height:"+t.iconHeight:""),attrs:{size:t.iconSize,name:t.iconName}})],1),e("div",{staticClass:"networkNotification-body-message"},[t._v(t._s(t.message))])]),t.buttonText?e("div",{staticClass:"networkNotification-body-button"},[e("ButtonIconFlat",{attrs:{modifier:{class:["buttonFlat-icon-groupButtonItem"]}},on:{click:t.closeNotification}},[t._v(t._s(t.buttonText||t.$t("common.Understand")))])],1):t._e()])},Cst=[],bst={components:{Avatar:E,ButtonLabel:Z,ButtonIcon:Nt},props:{iconName:{type:String,default:null},iconHeight:{type:String,default:""},iconWidth:{type:String,default:""},popupWidth:{type:String,default:""},popupHeight:{type:String,default:""},iconSize:{type:Number,default:18},buttonText:{type:String,default:""},message:{type:String,default:null}},data:function(){return{}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{closeNotification:function(){this.$emit("closeNotification")}},mounted:function(){}},Sst=bst,Pst=(i("f3da"),Object(C["a"])(Sst,yst,Cst,!1,null,"0daf260f",null)),Tst=Pst.exports,xst={name:"PersonalAreaAuth",mixins:[qe],components:{Avatar:E,Button:zt,Input:lst,DxTextBox:sc["DxTextBox"],PasswordViewButton:Pc,ErrorText:gc,PassAndConfirmPass:wc,DxCheckBox:Th["DxCheckBox"],DxLoadIndicator:OT["DxLoadIndicator"],networkNotification:Tst,DxPopup:xo.a},data:function(){return{apiBusy:!1,is2FAActive:null,imgSrc:null,code:null,disableCode:null,step:1,secret:null,is2FAPopupVisible:!1,isDisable2FAVisible:!1,isConfirmOpened:!1,copiedToClipboard:!1,confirmNewPass:0,incorretNewPass:0,checkPass:"",isCheckPass:!1,isAcceptChangePass:!1,newPass:"",acceptPass:"",phone:"",email:"",changed:!1,styleInputPhone:{border:"1px solid rgba(138, 164, 189, 0.6)",color:"rgba(138, 164, 189, 0.7)",boxShadow:"none",width:"100%",flexGrow:1,marginRight:"8px"},isEditing:{},isEditingemail:!1,tooltipCheck:"",passwordMode:"password",passwordModeMain:"password",passwordModeRepeat:"password",invalidPass:!1,invalidPassRepeat:!1}},props:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUser:"user/getUserDetail",getUserProfile:"user/getUserProfile",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme",getActiveThemePrefix:"headerSettings/getActiveThemePrefix",getSession:"auth/getSession",getApiUrl:"api/api"})),{},{getClassesForInputsPass:function(){var t,e=this.incorretNewPass>0?"validate":0===this.incorretNewPass?"":"invalid";return t={},Object(Vt["a"])(t,this.getActiveTheme,!0),Object(Vt["a"])(t,e,!0),t},getClassesForCheckAccepted:function(){var t=this;return function(e){var i;return i={},Object(Vt["a"])(i,t.getActiveTheme,!0),Object(Vt["a"])(i,"checked-value",t.getUser[e]),i}},getStatusButton:function(){return this.changed?"enebled-btn":"disabled-btn"}}),watch:{getUser:function(t){var e;t&&(this.email=t.email||" ",this.phone=t.phone||" ",this.is2FAActive=null!==(e=t.isVerified2FA)&&void 0!==e?e:null)},incorretNewPass:function(t){t<0?this.changed=!1:t>0&&(this.changed=!0)},acceptPass:function(){Ost(this.validateNewPass,250,!1)}},methods:{closeDisable2FAPopup:function(){this.disableCode=null,this.isDisable2FAVisible=null},close2FAPopup:function(){this.is2FAPopupVisible=!1,this.step=1,this.code=null,this.secret=null,this.imgSrc=null},open2FAQR:function(){var t=this;this.apiBusy||(this.is2FAActive?this.isDisable2FAVisible=!0:this.is2FAPopupVisible||this.secret||this.imgSrc||(this.apiBusy=!0,this.$http.get(this.getApiUrl+"TwoFA/CreateQrCode",{headers:{"Content-Type":"application/json","X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.signFP}}).then((function(e){var i,o,n;(t.is2FAPopupVisible=!0,t.secret=null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.secret,null!==e&&void 0!==e&&null!==(o=e.data)&&void 0!==o&&null!==(o=o.qrcode)&&void 0!==o&&o.fileContents)&&(t.imgSrc="data:image/png;base64, ".concat(null===e||void 0===e||null===(n=e.data)||void 0===n||null===(n=n.qrcode)||void 0===n?void 0:n.fileContents))})).catch((function(t){window.console.error({error:t})})).finally((function(){t.apiBusy=!1}))))},check2FACode:function(){var t=this;if(this.code&&this.getUser.login){this.apiBusy=!0;var e={login:this.getUser.login,code:this.code};this.$http.post(this.getApiUrl+"TwoFA/Verify",JSON.stringify(e)).then((function(e){null!==e&&void 0!==e&&e.data&&t.$store.dispatch("user/getUserData",t.getUser.login).then((function(){t.close2FAPopup(),t.apiBusy=!1,t.isConfirmOpened=!0,setTimeout((function(){t.isConfirmOpened=!1}),2e3)}))})).catch((function(t){window.console.error({error:t})})).finally((function(){t.apiBusy=!1}))}},check2FADisable:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.disableCode){e.next=2;break}return e.abrupt("return");case 2:return t.apiBusy=!0,i=JSON.stringify({code:t.disableCode}),e.next=6,t.$workKeys.signMessage(i,t.getSession.sk);case 6:o=e.sent,t.$http.put(t.getApiUrl+"TwoFA/Disable/".concat(t.disableCode),i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(e){!0===(null===e||void 0===e?void 0:e.data)&&t.$store.dispatch("user/getUserData",t.getUser.login).then((function(){t.apiBusy=!1,t.isDisable2FAVisible=!1,t.disableCode=null,t.isConfirmOpened=!0,setTimeout((function(){t.isConfirmOpened=!1}),2e3)}))})).catch((function(t){window.console.error({error:t})}));case 8:case"end":return e.stop()}}),e)})))()},setStep:function(t){this.step=t},closePopup:function(){this.is2FAPopupVisible=this.secret=this.imgSrc=null},copyToClipBoard:function(t){var e=this;navigator.clipboard.writeText(t).then((function(){e.copiedToClipboard=!0,setTimeout((function(){e.copiedToClipboard=!1}),1e3)})).catch((function(t){window.console.error({error:t})}))},setTypeInput:function(t){this[t]="text"===this[t]?"password":"text"},startEdit:function(t,e){this["isEditing".concat(t)]=!0,this.isEditing[t]=e},changeEmail:function(){this.email!==this.isEditing["email"]&&this.email.match(new RegExp(/.+@.+\..+/i))?(this.$store.commit("user/redactUserDetails",{option:"email",data:this.email}),this.isEditingemail=!1,this.saveSettings()):this.isEditingemail=!1},changeStoreSetting:function(t,e){this.$store.commit("user/redactUserDetails",{option:t,data:e}),this.isAcceptChangePass||this.email===this.oldEmail?this.isAcceptChangePass||this.email!==this.oldEmail||(this.changed=!1):this.changed=!0},validatePass:function(t,e){this[e]=t;var i=/^[a-zA-Z0-9!@#\$%\^\&*\)\(+=._\-\{}\[\]~\<\>\?]{8,}$/g,o=/(?=.*[A-Z])/g,n=/(?=.*[a-z])/g,s=/[0-9]+?/g,r=!1;r=this.newPass.length<8?this.$t("mpl8c"):o.test(this.newPass)&&n.test(this.newPass)?s.test(this.newPass)?!i.test(this.newPass)&&this.$t("llnassaa"):this.$t("tpmcalod"):this.$t("tpmcualcl"),r?(this.incorretNewPass=-1,this.invalidPass=r):this.newPass!==this.acceptPass?(this.invalidPass="",this.incorretNewPass=-1,this.invalidPassRepeat=this.$t("pdnm")):(this.invalidPass="",this.invalidPassRepeat="",this.incorretNewPass=1)},checkPassword:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({password:t.checkPass}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:o=e.sent,t.$http.post(t.getApiUrl+"checkpassword",i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(e){e.data&&e.data.passValid?(t.isCheckPass=!0,t.errorCheckPass=!1,t.isAcceptChangePass=!0,t.tooltipCheck=""):e.data&&!e.data.passValid&&(t.isCheckPass=!1,t.errorCheckPass=!0,t.isAcceptChangePass=!1,e.data.msg?"Too many try"===e.data.msg?t.tooltipCheck=t.$t("personalArea.personalMyData.auth.TooManyTries"):t.tooltipCheck=e.data.msg:t.tooltipCheck=t.$t("personalArea.personalMyData.auth.WrongPassword")),t.serverErrorCheckPass=!1})).catch((function(){return t.serverErrorCheckPass=!0}));case 5:case"end":return e.stop()}}),e)})))()},changePassword:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({password:t.acceptPass}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:o=e.sent,t.$http.post(t.getApiUrl+"changepassword",i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(e){e.data&&e.data.isOK&&(t.checkPass="",t.newPass="",t.acceptPass="",t.isAcceptChangePass=!1,t.isCheckPass=!1)})).catch((function(){return t.serverErrorChangePass=!0}));case 5:case"end":return e.stop()}}),e)})))()},confirmSetting:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=Object(Vt["a"])({},t,"phone"===t?e.getUserInfo.phone:e.getUserInfo.email),i.next=3,e.$http.post(e.getApiUrl+("phone"===t?"validator/sms":"validator/email"),JSON.stringify(o),{headers:{"Content-Type":"application/json"}}).then((function(){e.$store.dispatch("modal/switchCheckCodeModal",{status:!0,check:t})})).catch((function(){return"phone"===t?e.serverError=!0:e.serverErrorEmail=!0}));case 3:case"end":return i.stop()}}),i)})))()},saveSettings:function(){this.$store.dispatch("user/saveSettings"),1===this.incorretNewPass&&this.changePassword()}},mounted:function(){var t;this.getUser&&(this.email=this.getUser.email||" ",this.phone=this.getUser.phone||" ",this.oldEmail=this.email,this.is2FAActive=null!==(t=this.getUser.isVerified2FA)&&void 0!==t?t:null)}};function Ost(t,e){var i;return function(){var o=this,n=arguments,s=function(){i=null,t.apply(o,n)};clearTimeout(i),i=setTimeout(s,e)}}var wst=xst,_st=(i("0e82"),Object(C["a"])(wst,mst,vst,!1,null,"51d4efa0",null)),Ast=_st.exports,Dst={name:"PersonalAreaMyData",components:{Avatar:E,FileUploader:We,ModalLoadAvatar:fst,Auth:Ast,Button:zt,Input:lst,DxSelectBox:Bo.a,DxTextBox:sc["DxTextBox"]},data:function(){return{formats:["image/jpg","image/jpeg","image/png"],isOpenChangeAvatar:!1,srcAvatar:"",webSite:"",firstName:"",lastName:"",aboutMe:"",timezone:"",showModalDanger:!1,loadingCountries:!1,country:"",countries:[],city:null,zone:null,timezones:[],currency:null,currenciesSelectData:[{value:"USDTTRC20",label:"USDT"},{value:"USD",label:"USD"},{value:"BTC",label:"BTC"},{value:"RUB",label:this.$t("common.RussianRuble")}],isEditing:{},isEditingwebSite:!1,isEditingfirstName:!1,isEditinglastName:!1,isEditingaboutMe:!1,isEditingcity:!1}},props:["payment_intent"],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getUser:"user/getUserDetail",getUserProfile:"user/getUserProfile",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme"})),{},{formatsString:{get:function(){return this.formats?this.formats.join(", "):"*"}}}),watch:{getUser:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.t0=this,t.next=3,this.getDocumentData();case 3:t.t1=t.sent,t.t0.setData.call(t.t0,t.t1);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},methods:{triggerUpload:function(){this.$refs.uploadrAvatar.click()},handleFileChange:function(t){this.srcAvatar=t.target.files[0],this.onInputAvatar(this.srcAvatar)},onInputAvatar:function(t){t&&t.type&&("image/jpeg"===t.type||"image/png"===t.type)?this.srcAvatar=URL.createObjectURL(t):window.alert("Неверный формат файла!!!"),this.isOpenChangeAvatar=!0},getDocumentData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.getUser){e.next=2;break}return e.abrupt("return");case 2:return n=null!==(i=t.getUser)&&void 0!==i&&i.customData?JSON.parse(null===(o=t.getUser)||void 0===o?void 0:o.customData):"{}",n.country&&(s=t.countries.find((function(t){return t.country.countryCode===n.country})),t.timezones=(null===s||void 0===s?void 0:s.zones)||[],t.city=n.city,t.zone=n.zone),e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))()},setData:function(t){for(var e in this.firstName=this.getUser.firstName,this.lastName=this.getUser.lastName,t)this[e]=t[e]},saveSettings:function(){this.$store.dispatch("user/saveSettings")},getCountries:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get("".concat(t.getApiUrl,"kb/GetCountryReference"),{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":t.getSession.signFP}});case 2:i=e.sent,t.countries=i.data.sort((function(t,e){var i,o;return(null===t||void 0===t||null===(i=t.country)||void 0===i?void 0:i.countryName)>(null===e||void 0===e||null===(o=e.country)||void 0===o?void 0:o.countryName)?1:-1}));case 4:case"end":return e.stop()}}),e)})))()},countrySelectedCall:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,c;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.event&&t.value){i.next=2;break}return i.abrupt("return");case 2:if(n=e.countries.find((function(e){return e.country.countryCode===t.value})),n){i.next=5;break}return i.abrupt("return");case 5:s=n.country,a=null===n||void 0===n?void 0:n.zones,c=a&&(null===(o=a[0])||void 0===o?void 0:o.timeZoneId)||null,e.city=null===s||void 0===s?void 0:s.capital,e.timezones=a||[],e.zone=c,e.loadingCountries=!1,e.$store.commit("user/setCustomData",{field:"country",data:null===s||void 0===s?void 0:s.countryCode}),e.$store.commit("user/setCustomData",{field:"city",data:null===s||void 0===s?void 0:s.capital}),e.$store.commit("user/setCustomData",{field:"zone",data:c}),e.saveSettings();case 16:case"end":return i.stop()}}),i)})))()},saveSelectData:function(t,e){var i=this;return Object(a["a"])(Object(r["a"])().mark((function o(){return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(t.event){o.next=2;break}return o.abrupt("return");case 2:return o.prev=2,o.next=5,i.$store.dispatch("user/setCustomData",{field:e,data:t.value});case 5:o.next=10;break;case 7:o.prev=7,o.t0=o["catch"](2),window.console.error({error:o.t0});case 10:case"end":return o.stop()}}),o,null,[[2,7]])})))()},startEdit:function(t,e){this["isEditing".concat(t)]=!0,this.isEditing[t]=e},endEdit:function(t){if(this.isEditing[t]!==this[t])switch(t){case"firstName":this.$store.commit("user/redactUserDetails",{option:t,data:this[t]}),this.saveSettings();break;case"lastName":this.$store.commit("user/redactUserDetails",{option:t,data:this[t]}),this.saveSettings();break;default:this.$store.dispatch("user/setCustomData",{field:t,data:this[t]});break}this["isEditing".concat(t)]=!1,delete this.isEditing[t]}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.getCountries(),e.t0=t,e.next=4,t.getDocumentData();case 4:e.t1=e.sent,e.t0.setData.call(e.t0,e.t1);case 6:case"end":return e.stop()}}),e)})))()}},kst=Dst,Ist=(i("e0a3"),Object(C["a"])(kst,ist,ost,!1,null,"0a13d604",null)),Bst=Ist.exports,Mst=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personalTradingAccounts"},[e("div",{staticClass:"personalTradingAccounts-header",class:t.getActiveTheme},[e("div",{staticClass:"personalTradingAccounts-header-tab personalTradingAccounts-header-tab-demo",class:"DEMO"===t.activeTab?"personalTradingAccounts-header-tab-active":"",on:{click:function(e){return t.switchTab("DEMO")}}},[t._v("DEMO")]),e("div",{staticClass:"personalTradingAccounts-header-tab personalTradingAccounts-header-tab-real",class:"REAL"===t.activeTab?"personalTradingAccounts-header-tab-active":"",on:{click:function(e){return t.switchTab("REAL")}}},[t._v("REAL")]),e("div",{staticClass:"personalTradingAccounts-header-tab"},[e("svgIcon",{attrs:{name:"Add"}}),t._v(t._s(t.$t("personalArea.personalTradingAccounts.ConnectAccount")))],1),e("div",{staticClass:"personalTradingAccounts-header-tab"},[e("svgIcon",{attrs:{name:"Add"}}),t._v(t._s(t.$t("personalArea.personalTradingAccounts.ConnectMT5")))],1)]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent"},[e("div",{staticClass:"personalTradingAccounts-switcher-wrapper"},[e("div",{staticClass:"personalTradingAccounts-switcher",class:t.getActiveTheme},[e("div",{staticClass:"personalTradingAccounts-switcher-tab",class:"Forex"===t.groupTypeFilter?"personalTradingAccounts-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("Forex")}}},[t._v("Forex")]),e("div",{staticClass:"personalTradingAccounts-switcher-tab",class:"Crypto"===t.groupTypeFilter?"personalTradingAccounts-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("Crypto")}}},[t._v("Crypto")]),e("div",{staticClass:"personalTradingAccounts-switcher-tab",class:""===t.groupTypeFilter?"personalTradingAccounts-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("")}}},[t._v(t._s(t.$t("all")))])])]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-container"},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList"},["DEMO"===t.activeTab?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-buttonNew",class:"".concat("newAccount"===t.activeTabAccount?"active":""," ").concat(t.getActiveTheme),on:{click:function(e){t.activeTabAccount="newAccount"}}},[e("svgIcon",{attrs:{name:"Add"}}),t._v(t._s(t.$t("personalArea.personalTradingAccounts.NewDemoAccount")))],1):t._e(),e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[t.filteredAccounts&&t.filteredAccounts.length?e("transition-group",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-wrapper",class:t.getActiveTheme,attrs:{appear:"",tag:"div",name:"list"}},t._l(t.filteredAccounts,(function(i,o){return e("div",{key:"accountsList-card-".concat(i.id),staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card",class:{"personalTradingAccounts-accountTypeContent-accountsList-card-active":t.activeTabAccount===o},on:{click:function(e){t.activeTabAccount=o}}},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card-avatar"},[i.isPublish?e("div",{staticClass:"account-provider",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Provider",size:18}})],1):t._e(),e("div",{staticClass:"avatar-wrapper",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"2.4",src:i.isReal?t.getSelectAccount.logo:"tt_broker.png",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card-info"},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card-info-name",class:"".concat(i.isReal?"REAL":"DEMO")},[t._v(t._s(i.accountGroupCode))]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card-info-number"},[t._v(t._s(i.sequenceId))])]),i.isDefault?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-accountsList-card-checkmark",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()])})),0):t._e()],1)],1),"newAccount"===t.activeTabAccount||"accountCreated"===t.activeTabAccount?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main personalTradingAccounts-accountTypeContent-main-newAccount",class:t.getActiveTheme},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-accountTools"},[e("div",{staticClass:"input-group-container"},[e("div",{staticClass:"input-group input-group-unsorted"},[e("DxSelectBox",{staticClass:"info-wrapper info-wrapper-fullsize info-wrapper-active",class:t.getActiveTheme,attrs:{items:t.marketList,label:t.$t("market"),"display-expr":"label",hoverStateEnabled:!1,"value-expr":"label",dropDownOptions:{container:".dropdownSelectDefault"}},model:{value:t.marketType,callback:function(e){t.marketType=e},expression:"marketType"}}),e("div",{staticClass:"info-wrapper info-wrapper-active",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("common.Deposit"))+", "+t._s("Forex"===t.marketType?"$":"₮"))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.deposit,expression:"deposit"}],attrs:{type:"number"},domProps:{value:t.deposit},on:{input:function(e){e.target.composing||(t.deposit=e.target.value)}}})]),e("DxSelectBox",{staticClass:"info-wrapper info-wrapper-fullsize info-wrapper-active back-filled",class:t.getActiveTheme,attrs:{items:t.leverageList,label:t.$t("common.Leverage"),"display-expr":"label",hoverStateEnabled:!1,"value-expr":"label","field-template":"field","item-template":"item",dropDownOptions:{container:".dropdownSelectDefault"}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropdownSelectDefault__content"},[e("div",{staticClass:"dropdownSelectDefault__content-text"},[e("DxTextBox",{attrs:{value:t.$t(o.label),"read-only":!0}})],1)])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropdownSelectDefault__content",class:"".concat(o.level," ").concat(t.getActiveTheme)},[e("div",{staticClass:"dropdownSelectDefault__content-text"},[t._v(t._s(t.$t(o.label)))])])]}}],null,!1,3397523192),model:{value:t.leverage,callback:function(e){t.leverage=e},expression:"leverage"}}),e("div",{staticClass:"info-wrapper info-wrapper-button info-wrapper-fullsize",class:t.getActiveTheme},[e("div",{staticClass:"btn",class:t.getActiveTheme,on:{click:t.addNewDemoAccount}},[t.getSelectAccountDemo?e("Avatar",{attrs:{src:t.getSelectAccountDemo.logo,size:"2.4"}}):t._e(),t._v(t._s(t.$t("personalArea.personalTradingAccounts.CreateDemoAccount")))],1)]),e("p",{staticClass:"caption",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CaptionHedging")))])],1)])]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-newAccount-info",class:t.getActiveTheme},[e("h3",{staticClass:"heading"},[t._v(t._s(t.$t("common.PayAttention")))]),e("p",[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CaptionPeriod"))+" "+t._s(t.$t("personalArea.personalTradingAccounts.CaptionPayment"))+" ")]),e("h3",{staticClass:"heading"},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.GetPaidMore")))]),e("p",[t._v(" "+t._s(t.$t("personalArea.personalTradingAccounts.CaptionPaidMore")[0])+" "),e("strong",[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CaptionPaidMore")[1]))]),t._v(" "+t._s(t.$t("personalArea.personalTradingAccounts.CaptionPaidMore")[2]))]),e("div",{staticClass:"info-wrapper info-wrapper-button info-wrapper-fullsize",class:t.getActiveTheme},[e("div",{staticClass:"btn"},[e("svgIcon",{attrs:{name:"Verification",color:"#8C8C8C"}}),t._v(t._s(t.$t("personalArea.personalTradingAccounts.PassVerification")))],1)])])]):t.filteredAccounts&&t.filteredAccounts.length?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main",class:t.getActiveTheme},[t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass",class:t.getActiveTheme},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass-info"},[t.remainedTime(t.getActiveAccountPayment)&&(t.remainedTime(t.getActiveAccountPayment).days||t.remainedTime(t.getActiveAccountPayment).hours)?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass-disclaimer",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CaptionHourglassPeriod")))]):t._e(),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass-description",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CaptionHourglassPayment")))]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass-buttons",class:t.getActiveTheme},[e("DxSelectBox",{staticClass:"info-wrapper",class:t.getActiveTheme,attrs:{items:t.prolongation,hoverStateEnabled:!1,dropDownOptions:{container:".dropdownSelectDefault"}},model:{value:t.subscriptionMonths,callback:function(e){t.subscriptionMonths=e},expression:"subscriptionMonths"}}),e("span",[t._v(t._s(t.$t('common["mon."]')))]),e("Button",{staticClass:"input-group-button",class:t.getActiveTheme,attrs:{icon:"my-wallet",label:t.$t("common.PayNow")}})],1)]),e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-hourglass-timer",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"hourglass"}}),e("p",[t._v(t._s(t.getActiveAccountPayedDate))])],1)]):t._e(),t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-accountTools"},[e("div",{staticClass:"input-group-container"},[e("div",{staticClass:"input-group input-group-unsorted",class:t.getActiveTheme},[e("div",{staticClass:"info-wrapper balance",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("balance")))]),e("p",[t._v(t._s(t.getAccountCurrency)+" "+t._s(t.$moneyf(t.filteredAccounts[t.activeTabAccount].balance)))])]),e("div",{staticClass:"info-wrapper balance",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("equity")))]),e("p",[t._v(t._s(t.getAccountCurrency)+" "+t._s(t.$moneyf(t.filteredAccounts[t.activeTabAccount].equity)))])]),e("div",{staticClass:"info-wrapper",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalTradingAccounts.AccountCurrency")))]),e("p",[t._v(t._s(t.getAccountCurrency)+" - "+t._s(t.filteredAccounts[t.activeTabAccount].assetCode))])]),e("div",{staticClass:"info-wrapper back-filled",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("common.Leverage")))]),e("p",[t._v(t._s(t.filteredAccounts[t.activeTabAccount].maxLeverage))])])])]),e("div",{staticClass:"input-group-container"},[e("div",{staticClass:"input-group input-group-labeled input-group-column",class:t.getActiveTheme},[e("div",{staticClass:"input-group-header input-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.TopUpAccountBalance")))]),e("div",{staticClass:"info-wrapper info-wrapper-active",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalTradingAccounts.AmountToTopUp")))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.refillBalance,expression:"refillBalance"}],class:t.getActiveTheme,attrs:{type:"number"},domProps:{value:t.refillBalance},on:{input:function(e){e.target.composing||(t.refillBalance=e.target.value)}}})]),e("Button",{staticClass:"input-group-button",attrs:{icon:"UpMoney",label:t.$t("personalArea.personalTradingAccounts.TopUpBalance"),disabled:t.isDisabledTotUpButton},on:{click:t.totUp}})],1),e("div",{staticClass:"input-group-container input-group-container-column"},[t.filteredAccounts[t.activeTabAccount].isDefault?t._e():e("div",{staticClass:"input-group input-group-labeled input-group-column",class:t.getActiveTheme},[e("div",{staticClass:"input-group-header input-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.SetAsDefaultAccount")))]),e("Button",{staticClass:"input-group-button input-group-button-relative",attrs:{icon:"Check",label:t.$t("personalArea.personalTradingAccounts.SetAsDefaultAccount"),disabled:t.isDisabledSetDefaultButton},on:{click:function(e){return t.setVariable("popupVisibleSetDefault",!0)}}})],1),e("div",{staticClass:"input-group input-group-labeled input-group-column",class:t.getActiveTheme},[e("div",{staticClass:"input-group-header input-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.DeleteDemoAccount")))]),e("Button",{staticClass:"input-group-button input-group-button-relative",attrs:{icon:"Delete",label:t.$t("personalArea.personalTradingAccounts.DeleteDemoAccount"),disabled:t.isDisabledRemoveButton&&!t.isDisabledDeleteButtonStatus},on:{click:function(e){t.filteredAccounts[t.activeTabAccount].isPublish?t.setVariable("popupVisibleCannotDelete",!0):t.setVariable("popupVisible",!0)}}})],1)])])]):t._e()]):t._e()])]),t.notificationDisplay?e("networkNotification",{class:"".concat("fade"===t.notificationDisplay?"fade":""," ").concat(t.getActiveTheme),attrs:{"icon-name":"doneblack",message:t.notificationMessage},on:{click:function(e){t.notificationDisplay=!1},closeNotification:t.closeNotification}}):t._e(),e("PopupConfirm",{attrs:{width:"190",height:"100",visible:t.popupVisible,position:t.getPopupPosition,confirmClickHandler:t.deleteEvent},on:{close:function(e){return t.setVariable("popupVisible",!1)}}}),e("PopupConfirm2",{attrs:{width:"190",height:"100",description:t.$t("setdefault"),option1:t.$t("common.Confirm"),option2:t.$t("common.Cancel"),visible:t.popupVisibleSetDefault,position:t.getPopupPosition,confirmClickHandler:t.setDefaultAccountEvent},on:{close:function(e){return t.setVariable("popupVisibleSetDefault",!1)}}}),e("PopupConfirm2",{attrs:{width:"190",height:"100",description:t.$t("personalArea.personalTradingAccounts.CannotDeleteWhilePublished"),option1:t.$t("common.Confirm"),option2:null,visible:t.popupVisibleCannotDelete,position:t.getPopupPosition,confirmClickHandler:t.setVariable("popupVisibleCannotDelete",!1)},on:{close:function(e){return t.setVariable("popupVisibleCannotDelete",!1)}}}),e("DxPopup",{staticClass:"successPopup",attrs:{visible:t.isNewAccountPopupVisible,width:"350px",height:"350px",maxWidth:"350px",maxHeight:"350px",position:{at:"center",my:"center"},fullScreen:!1,shading:!1,showTitle:!1,showCloseButton:!0}},[e("div",{staticClass:"personalTradingAccounts-accountTypeContent-main-accountCreated"},[e("div",{staticClass:"image-wrapper"},[e("svgIcon",{attrs:{name:"SuccessComplex",size:200}})],1),e("span",{staticClass:"status"},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.DemoAccountCreated")))]),e("div",{staticClass:"input-group-wrapper"},[e("div",{staticClass:"btn",on:{click:function(e){return t.goToCreatedAccount()}}},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.ToNewAccount")))]),e("div",{staticClass:"btn",on:{click:function(e){t.activeTabAccount="newAccount"}}},[t._v(t._s(t.$t("personalArea.personalTradingAccounts.CreateMore")))])])])])],1)},$st=[],Lst=function(){var t=this,e=t._self._c;return e("DxPopup",{ref:"popupConfirm",attrs:{shadingColor:"transparent","title-template":"header",width:t.width,height:t.height,visible:t.visible,"drag-enabled":!1,"close-on-outside-click":!0,"show-close-button":!1,"show-title":!0,wrapperAttr:{class:t.classWrapper}},on:{hidden:t.closePopup},scopedSlots:t._u([{key:"header",fn:function(){return[e("div",{staticClass:"headerPopup"},[t._v(t._s(t.description))])]},proxy:!0}])},[e("DxPosition",{attrs:{at:t.position.at,my:t.position.my,of:t.position.of,offset:"-17 0"}}),e("div",{staticClass:"footer",class:t.darkClass},[t.option1?e("DxButton",{attrs:{width:"50%",height:"40",type:"danger",elementAttr:{class:"buttonConfirm buttonDelete"},text:t.option1},on:{click:t.confirmClickHandler}}):t._e(),t.option2?e("DxButton",{attrs:{width:"50%",height:"40",type:"normal",elementAttr:{class:"buttonConfirm buttonCancel"},text:t.option2},on:{click:t.closePopup}}):t._e()],1),t.isLoading?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e()],1)},Fst=[],jst={name:"PopupConfirm2",props:{visible:{type:Boolean},position:{type:Object},confirmClickHandler:{type:Function},width:{type:[Number,String]},height:{type:[Number,String]},description:{type:String,default:"Heading"},option1:{type:String,default:"Confirm"},option2:{type:String,default:"Cancel"},isLoading:{type:Boolean,default:!1}},components:{DxPopup:To["DxPopup"],DxPosition:To["DxPosition"],DxButton:cc.a,DxLoadIndicator:OT["DxLoadIndicator"]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},classWrapper:function(){return"dark"===this.getActiveTheme?"popupConfirm dark":"popupConfirm"}}),methods:{closePopup:function(){this.$emit("close",this.$refs.popupConfirm)}}},Rst=jst,Wst=(i("df13"),i("f23d"),Object(C["a"])(Rst,Lst,Fst,!1,null,"50caf36d",null)),Nst=Wst.exports,Est={name:"PersonalAreaTradingAccounts",components:{Button:zt,DxSelectBox:Bo.a,DxPopup:xo.a,DxTextBox:sc["DxTextBox"],Avatar:E,networkNotification:Tst,VuePerfectScrollbar:Xt.a,PopupConfirm:o6,PopupConfirm2:Nst},mixins:[qe],data:function(){return{activeTab:"DEMO",groupTypeFilter:"Forex",activeTabAccount:0,balance:1e6,account:1e6,refillBalance:50,type:"Хеджинг",deposit:5e5,leverage:1,marketType:"Forex",createdAccount:null,allAccountsData:[],leverageList:[{label:1,level:"safe"},{label:2,level:"safe"},{label:3,level:"safe"},{label:5,level:"medium"},{label:10,level:"medium"},{label:20,level:"medium"},{label:30,level:"hard"},{label:50,level:"hard"},{label:60,level:"hard"},{label:70,level:"hard"},{label:80,level:"hard"},{label:90,level:"hard"},{label:100,level:"hard"}],marketList:[{label:"Forex",assetCode:"USD",accountGroupCode:"Demo"},{label:"Crypto",assetCode:"USDT",accountGroupCode:"CryptoDemo"}],prolongation:Array.from({length:12},(function(t,e){return e+1})),subscriptionMonths:1,notificationDisplay:!1,notificationDisplayTimer:null,popupVisible:!1,popupVisibleSetDefault:!1,popupVisibleCannotDelete:!1,isDisabledAddNewAccButton:!1,isDisabledSetDefaultButton:!1,isDisabledTotUpButton:!1,isDisabledDeleteButtonStatus:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getUser:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount",getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime"})),{},{notificationMessage:function(){var t=this,e=this.$t("personalArea.personalTradingAccounts.BalanceReplenishedSuccessfully"),i=this.marketList.find((function(e){return e.label===t.marketType})),o=i.assetCode;return"".concat(e," на: ").concat(this.refillBalance," ").concat(o)},getSelectAccount:function(){if(this.getProfileSequenceIds){var t=this.getProfileSequenceIds.find((function(t){return t.default}));return t||this.getProfileSequenceIds[0]}},getProfileSequenceIds:function(){var t=this;if(this.getProfileAccount.length){var e=this.getProfileAccount.map((function(e){return{text:e.sequenceId,logo:e.brokerId?"broker-sample.png":"tt_broker.png",color:"Demo"===e.accountGroupCode?t.getRedColor.color:"Real"===e.accountGroupCode?t.getGreenColor.color:t.getRedColor.color,id:e.id,brokerId:e.brokerId,group:e.accountGroupCode,default:e.isDefault,isProvider:!!e.source.length}}));return e=e.sort((function(t,e){return e.isProvider-t.isProvider})),e}},getPopupPosition:function(){return{at:"left",my:"right",of:".input-group-button-relative"}},formatsString:{get:function(){return this.formats?this.formats.join(", "):"*"}},filteredAccounts:function(){var t,e=this,i="REAL"===this.activeTab,o=null===(t=this.getProfileAccount)||void 0===t||null===(t=t.filter((function(t){return!(t.isReal^i)})))||void 0===t?void 0:t.filter((function(t){return!e.groupTypeFilter||t.groupType===e.groupTypeFilter}));if(this.createdAccount){var n=o.findIndex((function(t){return t.id===e.createdAccount}));if(-1!==n){var s=o.splice(n,1);o.unshift(s[0])}}return o},getAccountCurrency:function(){var t,e;return(null===(t=this.filteredAccounts)||void 0===t?void 0:t.length)&&(null===(e=this.filteredAccounts[this.activeTabAccount])||void 0===e?void 0:e.currencyChar)},getBalanceAfterRefill:function(){return Number(this.filteredAccounts[this.activeTabAccount].balance)+Number(this.refillBalance)},isDisabledRemoveButton:function(){var t;return this.filteredAccounts&&(null===(t=this.filteredAccounts[this.activeTabAccount])||void 0===t||null===(t=t.sources)||void 0===t?void 0:t.length)},isNewAccountPopupVisible:function(){return"accountCreated"===this.activeTabAccount},getActiveAccountPayment:function(){var t,e=this,i=null===(t=this.allAccountsData)||void 0===t?void 0:t.find((function(t){var i;return t.id===(null===(i=e.filteredAccounts[e.activeTabAccount])||void 0===i?void 0:i.id)}));return i},getActiveAccountPayedDate:function(){if(-1===this.activeTabAccount)return this.$t("personalArea.personalPayments.AccountNotSelected");var t,e,i,o,n,s,r=this.getActiveAccountPayment,a="",c="";null!==r&&void 0!==r&&r.stopDateTime&&(c=this.remainedTime(r),null!==(t=c)&&void 0!==t&&t.days||null!==(e=c)&&void 0!==e&&e.hours?a=(null===(n=this.remainedTime(r))||void 0===n?void 0:n.days)+this.$t('common["d."]')+(null===(s=this.remainedTime(r))||void 0===s?void 0:s.hours)+this.$t('common["h."]'):null!==(i=c)&&void 0!==i&&i.ended?a=this.$t("personalArea.personalPayments.Ended"):null!==(o=c)&&void 0!==o&&o.nosub&&(a=this.$t("personalArea.personalPayments.Nosub")));return null!==r&&void 0!==r&&r.stopDateTime?"".concat(a||this.$t("personalArea.personalPayments.noDataAccount")):this.$t("personalArea.personalPayments.noDataAccount")}}),watch:{getProfileAccount:function(t){t&&this.needPay(t)}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getPaymentService:"paymentService/getPaymentService"})),{},{remainedTime:function(t){if(!t)return{nosub:!0};if(null===t.stopDateTime)return{endless:!0};if(t.isDemo){var e=new Date(t.stopDateTime).getTime(),i=new Date(this.getServerTime.now).getTime(),o=e-i,n=Math.floor(o/1e3/60/60/24),s=Math.floor(o/1e3/60/60)%24;return n<0||s<0?{ended:!0}:{days:n,hours:s}}},needPay:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getPaymentService({id:e.getUser.id,isUserId:!0});case 2:o=i.sent,n=t.filter((function(t){var i;return-1===(null===(i=e.allAccountsData)||void 0===i?void 0:i.findIndex((function(e){return e.id===t.id})))})),n.length&&(s=e.allAccountsData).push.apply(s,Object(x["a"])(n.map((function(t){var e=null===o||void 0===o?void 0:o.find((function(e){return e.accountId===t.id}));return Object(c["a"])(Object(c["a"])({},t),{},{stopDateTime:null===e||void 0===e?void 0:e.stopDateTime,isDemo:null===e||void 0===e?void 0:e.isDemo})}))));case 5:case"end":return i.stop()}}),i)})))()},switchTab:function(t){this.activeTab!==t&&(this.activeTabAccount=0,this.activeTab=t)},switchMainTab:function(t){this.groupTypeFilter!==t&&(this.activeTabAccount=0,this.marketType=t,this.groupTypeFilter=t)},goToCreatedAccount:function(){var t,e=this,i=null===(t=this.getProfileAccount)||void 0===t?void 0:t.findIndex((function(t){return t.id===e.createdAccount}));-1!==i&&(this.groupTypeFilter=this.getProfileAccount[i].groupType,this.activeTabAccount=i)},addNewDemoAccount:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.marketList.find((function(e){return e.label===t.marketType})),i){e.next=3;break}return e.abrupt("return");case 3:return t.isDisabledAddNewAccButton=!0,o=i.accountGroupCode,n=i.assetCode,s=JSON.stringify({UserId:t.getUser.id,Balance:t.deposit,Leverage:t.leverage,accountGroupCode:o,assetCode:n}),e.next=8,t.$workKeys.signMessage(s,t.getSession.sk);case 8:a=e.sent,t.$http.post(t.getApiUrl+"CreateNewUserAccount",s,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":a}}).then((function(e){if(t.activeTabAccount="accountCreated",t.createdAccount=e.data.entityId,e.data.status.isOK){var i={command:"AccountsByUser",data:{userId:t.getUser.id}};t.$socketStream.sendCommand({ws:"apiWS",command:i})}})).catch((function(t){window.console.error({error:t})})).finally((function(){t.isDisabledAddNewAccButton=!1}));case 10:case"end":return e.stop()}}),e)})))()},getUserInfoAccounts:function(t){var e={command:"AccountsByUser",data:{userId:t}};this.$socketStream.sendCommand({ws:"apiWS",command:e})},totUp:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isDisabledTotUpButton=!0,n=JSON.stringify({AccountId:null===(i=t.filteredAccounts[t.activeTabAccount])||void 0===i?void 0:i.id,Amount:t.refillBalance,AssetCode:null===(o=t.filteredAccounts[t.activeTabAccount])||void 0===o?void 0:o.assetCode}),e.next=4,t.$workKeys.signMessage(n,t.getSession.sk);case 4:s=e.sent,t.$http.post(t.getApiUrl+"AccountDepositOperation",n,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":s}}).then((function(e){t.changeStoreSetting("balance",e.data.balance);var i={command:"AccountsByUser",data:{userId:t.getUser.id}};t.$socketStream.sendCommand({ws:"apiWS",command:i}),t.openNotification(t.$t("personalArea.personalTradingAccounts.BalanceReplenishedSuccessfully"))})).catch((function(t){window.console.error({error:t})})).finally((function(){t.isDisabledTotUpButton=!1}));case 6:case"end":return e.stop()}}),e)})))()},changeStoreSetting:function(t,e){this.$store.commit("user/redactUserDetails",{option:t,data:e})},removeAccount:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isDisabledRemoveButton){e.next=13;break}if(o=null===(i=t.filteredAccounts[t.activeTabAccount])||void 0===i?void 0:i.id,o){e.next=4;break}return e.abrupt("return");case 4:return t.isDisabledDeleteButtonStatus=!0,n="".concat(t.getApiUrl,"DeleteTradingAccount/?accountId=").concat(o),e.next=8,t.$workKeys.signMessage("accountId=".concat(o),t.getSession.sk);case 8:s=e.sent,a={headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":s}},t.$http.delete(n,a).then((function(e){var i;if(null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&null!==(i=i.status)&&void 0!==i&&i.isOK){t.openNotification(t.$t("DeletedSuccessfully"));var o={command:"AccountsByUser",data:{userId:t.getUser.id}};t.$socketStream.sendCommand({ws:"apiWS",command:o}),t.activeTabAccount=0}})).catch((function(t){window.console.error({error:t})})).finally((function(){t.isDisabledDeleteButtonStatus=!1})),e.next=14;break;case 13:return e.abrupt("return");case 14:case"end":return e.stop()}}),e)})))()},openNotification:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.notificationDisplay=!0,e&&(this.notificationMessage=e),this.notificationDisplayTimer=setTimeout((function(){t.notificationDisplay="fade",setTimeout((function(){t.notificationDisplay=!1}),500)}),2500)},closeNotification:function(){this.notificationDisplayTimer=null,this.notificationDisplay=!1},setDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.isDisabledSetDefaultButton=!0,e.$store.commit("subscribeOrders/resetDefaultAccount",t),e.$store.dispatch("subscribeOrders/setSubscribe"),o=JSON.stringify({accountId:t,isDefault:!0}),i.next=6,e.$workKeys.signMessage(o,e.getSession.sk);case 6:n=i.sent,e.$http.post(e.getApiUrl+"EditAccountCustomData",o,{headers:{"Content-Type":"application/json","X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n}}).catch((function(t){window.console.error({error:t})})).finally((function(){e.isDisabledSetDefaultButton=!1}));case 8:case"end":return i.stop()}}),i)})))()},setVariable:function(t,e){this.$set(this,t,e)},deleteEvent:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null!==(i=t.filteredAccounts)&&void 0!==i&&i.length&&null!==(o=t.filteredAccounts[t.activeTabAccount])&&void 0!==o&&o.id){e.next=3;break}return t.popupVisible=!1,e.abrupt("return");case 3:t.removeAccount(t.filteredAccounts[t.activeTabAccount].id),t.popupVisible=!1;case 5:case"end":return e.stop()}}),e)})))()},setDefaultAccountEvent:function(){var t,e,i;null===(t=this.filteredAccounts)||void 0===t||!t.length||null===(e=this.filteredAccounts[this.activeTabAccount])||void 0===e||!e.id||null!==(i=this.filteredAccounts[this.activeTabAccount])&&void 0!==i&&i.isDefault||this.setDefaultAccount(this.filteredAccounts[this.activeTabAccount].id),this.popupVisibleSetDefault=!1}}),mounted:function(){var t;null!==(t=this.getProfileAccount)&&void 0!==t&&t.length&&this.needPay(this.getProfileAccount)}},Ust=Est,Vst=(i("c3e9"),Object(C["a"])(Ust,Mst,$st,!1,null,"e3e064ba",null)),Hst=Vst.exports,Gst=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personalPayments"},[e("div",{staticClass:"personalPayments-accountTypeContent"},[e("div",{staticClass:"personalPayments-accountTypeContent-container"},[e("div",{staticClass:"personalPayments-accountTypeContent-accountsList"},[e("div",{staticClass:"personalPayments-switcher-wrapper"},[e("div",{staticClass:"personalPayments-switcher",class:t.getActiveTheme},[e("div",{staticClass:"personalPayments-switcher-tab",class:"Forex"===t.groupTypeFilter?"personalPayments-switcher-tab-active":"",on:{click:function(e){return t.switchGroupType("Forex")}}},[t._v("Forex")]),e("div",{staticClass:"personalPayments-switcher-tab",class:"Crypto"===t.groupTypeFilter?"personalPayments-switcher-tab-active":"",on:{click:function(e){return t.switchGroupType("Crypto")}}},[t._v("Crypto")]),e("div",{staticClass:"personalPayments-switcher-tab",class:""===t.groupTypeFilter?"personalPayments-switcher-tab-active":"",on:{click:function(e){return t.switchGroupType("")}}},[t._v(t._s(t.$t("all")))])])]),e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[t.filteredAccounts&&t.filteredAccounts.length?e("transition-group",{staticClass:"personalPayments-accountTypeContent-accountsList-wrapper",class:t.getActiveTheme,attrs:{appear:"",tag:"div",name:"list"}},t._l(t.filteredAccounts,(function(i,o){return e("div",{key:"accountsList-card-".concat(i.id),staticClass:"personalPayments-accountTypeContent-accountsList-card",class:{"personalPayments-accountTypeContent-accountsList-card-active":t.activeTabAccount===o},on:{click:function(e){return t.setActiveAccount(o,i.groupType)}}},[e("div",{staticClass:"personalPayments-accountTypeContent-accountsList-card-avatar"},[i.isPublish?e("div",{staticClass:"account-provider",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Provider",size:18}})],1):t._e(),e("div",{staticClass:"avatar-wrapper",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"2.4",src:i.isReal?t.getSelectAccount.logo:"tt_broker.png",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"personalPayments-accountTypeContent-accountsList-card-info"},[e("div",{staticClass:"personalPayments-accountTypeContent-accountsList-card-info-name",class:"".concat(i.isReal?"REAL":"DEMO")},[t._v(t._s(i.accountGroupCode))]),e("div",{staticClass:"personalPayments-accountTypeContent-accountsList-card-info-number"},[t._v(t._s(i.sequenceId))])]),i.isDefault?e("div",{staticClass:"personalPayments-accountTypeContent-accountsList-card-checkmark",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e()])})),0):t._e()],1)],1),t.filteredAccounts&&t.filteredAccounts.length?e("div",{staticClass:"personalPayments-accountTypeContent-main",class:t.getActiveTheme},[t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"personalPayments-accountTypeContent-main-header"},[e("div",{staticClass:"tab-container",class:t.getActiveTheme},[e("div",{staticClass:"tab",class:"pay"===t.mainFilter?"active":"",on:{click:function(e){return t.switchMainTab("pay")}}},[t._v(t._s(t.$t("personalArea.personalPayments.Payment")))]),e("div",{staticClass:"tab",class:"history"===t.mainFilter?"active":"",on:{click:function(e){return t.switchMainTab("history")}}},[t._v(t._s(t.$t("personalArea.personalPayments.PaymentsHistory")))])]),-1!==t.activeTabAccount?e("div",{staticClass:"hourglass-container"},[e("svgIcon",{attrs:{name:"hourglass-small"}}),e("div",{staticClass:"hourglass-container-wrapper"},[e("div",{staticClass:"hourglass-container-caption",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.payedPeriodTill")))]),e("div",{staticClass:"hourglass-container-date",class:t.getActiveTheme},[t._v(t._s(t.getActiveAccountPayedDate))])])],1):t._e()]):t._e(),e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"personalPayments-accountTypeContent-main-accountTools"},["pay"===t.mainFilter?e("div",{staticClass:"items-group-container items-group-container-column"},[e("div",{staticClass:"items-group items-group-labeled",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.TTSubscriptionPayment")))]),t._l(t.subscriptionVariants,(function(i,o){return e("div",{staticClass:"card",class:t.getActiveTheme,attrs:{id:"subscription-".concat(i.period.id)},on:{click:function(e){return t.selectSub(o)}}},[e("div",{staticClass:"card-header"},[e("RadioButton",{attrs:{value:o,modelValue:t.selectedSubscription,theme:t.getActiveTheme}}),e("p",{staticClass:"card-header-text"},[t._v(t._s(t.getNaming(i.period.name)))])],1),e("div",{staticClass:"card-main"},[e("p",{staticClass:"card-main-text-primary"},[e("em",[t._v(t._s(i.price.amount))])]),e("p",{staticClass:"card-main-text-secondary"},[e("em",[t._v(t._s(i.price.amount/(i.period.period/30)))]),t._v(" / "+t._s(t.$t('common["mon."]')))])]),e("div",{staticClass:"card-caption"},[i.savePrice&&i.savePrice>0?e("p",{staticClass:"card-caption-text"},[t._v(t._s(t.$t("personalArea.personalPayments.YouSave"))+": "),e("em",[t._v(t._s(i.savePrice)+"₽")])]):t._e()])])})),t.subscriptionVariants[t.selectedSubscription]?e("div",{staticClass:"items-group-sub",class:t.getActiveTheme},[e("span",{staticClass:"caption"},[t._v(t._s(t.$t("personalArea.personalPayments.iypflp")))]),e("div",{staticClass:"items-group-sub-container"},[e("span",{staticClass:"period"},[t._v(t._s(t.subscriptionVariants[t.selectedSubscription].period.period/30)+" "+t._s(t.$t('common["mon."]')))]),e("span",{staticClass:"period"},[t._v("x")]),e("span",{staticClass:"amount"},[t._v(t._s(t.subscriptionVariants[t.selectedSubscription].price.amount/(t.subscriptionVariants[t.selectedSubscription].period.period/30))+" ₽")])]),e("Button",{staticClass:"items-group-button",attrs:{icon:"my-wallet",label:t.$t("common.Pay")}})],1):t._e()],2),t.filteredAccounts[t.activeTabAccount]&&!1===t.filteredAccounts[t.activeTabAccount].isReal?e("div",{staticClass:"items-group items-group-labeled",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.CopyingFee")))]),e("div",{staticClass:"items-group-content"},[e("img",{attrs:{src:i("88f2")}}),e("p",{staticClass:"heading",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.YouDoNotInvest")))]),e("p",{staticClass:"text",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.ydnhip")))])])]):t.filteredAccounts[t.activeTabAccount]&&t.filteredAccounts[t.activeTabAccount].isReal?e("div",{staticClass:"items-group items-group-labeled items-group-pad4",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.CopyingFee")))]),e("div",{staticClass:"paymentList paymentList-Wider",class:t.getActiveTheme},[e("div",{staticClass:"paymentList-header grid-layout grid-layout-1-4 align-center",class:t.getActiveTheme},[e("div",{staticClass:"flex flex-row"},[e("input",{attrs:{type:"checkbox"}}),t._v(t._s(t.$t("personalArea.personalPayments.PortfolioTopProvider")))]),e("span",{staticClass:"flex flex-row"},[t._v(t._s(t.$t("personalArea.personalPayments.PortfolioWorkingPeriod")))]),e("span",[t._v(t._s(t.$t("personalArea.personalPayments.NetIncome")))]),e("span",[t._v("SF 33%")])]),t._l(t.filteredAccounts.slice(4),(function(i,o){return e("div",{key:"accountsList-card-".concat(i.id),staticClass:"paymentList-row grid-layout grid-layout-1-4"},[e("div",{staticClass:"flex flex-row"},[e("input",{attrs:{type:"checkbox"}}),e("div",{staticClass:"flex flex-row"},[e("div",{staticClass:"avatar-wrapper",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"2.4",src:i.isReal?t.getSelectAccount.logo:"tt_broker.png",theme:t.getActiveTheme}})],1),e("div",{staticClass:"flex flex-column"},[e("div",{staticClass:"account-owner",class:t.getActiveTheme},[t._v(t._s(i.owner.slice(10)))])])])]),e("div",{staticClass:"flex flex-row"},[e("span",{staticClass:"time"},[t._v("(21.05.2023 - 21.06.2023)")])]),e("span",{staticClass:"amount"},[t._v("500₽")]),e("span",{staticClass:"amount"},[t._v("70.65₽")])])})),e("div",{staticClass:"paymentList-footer"},[e("div",{staticClass:"paymentList-footer-tableSum",class:t.getActiveTheme},[e("span",{staticClass:"amount amountPositive"},[t._v("3 000₽")]),e("span",{staticClass:"amount"},[t._v("3 000₽")])])]),e("div",{staticClass:"paymentList-footer-summarize",class:t.getActiveTheme},[e("div",{staticClass:"flex flex-row"},[e("span",{staticClass:"amount"},[t._v("3 000₽ ")]),e("Button",{staticClass:"button-default",attrs:{label:t.$t("common.Pay")}})],1)])],2)]):t._e()]):t._e(),"history"===t.mainFilter&&t.getAccountPaymentsHistory?e("div",{staticClass:"paymentList",class:t.getActiveTheme},[e("div",{staticClass:"paymentList-header",class:t.getActiveTheme},[e("span",[t._v(t._s(t.$t("personalArea.personalPayments.PaymentPurpose")))]),e("span",[t._v(t._s(t.$t("personalArea.personalPayments.TimeInterval")))]),e("span",[t._v(t._s(t.$t("personalArea.personalPayments.TotalSum")))])]),t._l(t.getAccountPaymentsHistory,(function(i){return e("div",{staticClass:"paymentList-row align-center",class:t.getActiveTheme},[e("span",{staticClass:"text"},[t._v(t._s(t.$t("personalArea.personalPayments.TTSubscriptionPayment")))]),e("span",{staticClass:"time align-center"},[t._v("Январь 2023")]),e("span",{staticClass:"amount"},[t._v("500₽")])])}))],2):"history"!==t.mainFilter||t.getAccountPaymentsHistory?t._e():e("div",{staticClass:"paymentList",class:t.getActiveTheme},[e("span",{staticClass:"text-nohistory",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPayments.noHistoryAccount")))])])]):t._e()]),""===t.groupTypeFilter?e("div",{staticClass:"personalPayments-accountTypeContent-main-accountTools no-padding"},[e("table",{staticClass:"paymentList paymentList-Wider paymentList-notFull",class:t.getActiveTheme},[e("thead",[e("tr",{staticClass:"paymentList-header table-default grid-layout grid-layout-1-4",class:t.getActiveTheme},[e("td",{staticClass:"flex flex-row"},[e("input",{attrs:{type:"checkbox"},on:{click:function(e){return t.selectAll()}}}),t._v(t._s(t.$t("common.Account")))]),e("td",[e("span",{staticClass:"flex flex-row justify-center",on:{click:function(e){return t.refreshTable()}}},[t._v("15.02.2023"),e("svgIcon",{staticClass:"rotate-animation",attrs:{name:"new-refrash"}})],1)]),e("td",[e("span",[t._v(t._s(t.$t("tt_subscription")))])]),e("td",[e("span",[t._v(t._s(t.$t("fee"))+" SF")])])])]),e("tbody",[e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},t._l(t.allAccountsData,(function(i,o){return e("tr",{key:"accountsList-card-".concat(i.id),staticClass:"paymentList-row grid-layout grid-layout-1-4"},[e("td",{staticClass:"flex flex-row"},[e("input",{directives:[{name:"model",rawName:"v-model",value:i.checked,expression:"acc.checked"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(i.checked)?t._i(i.checked,null)>-1:i.checked},on:{click:function(e){return t.checkIsAllSelected()},change:function(e){var o=i.checked,n=e.target,s=!!n.checked;if(Array.isArray(o)){var r=null,a=t._i(o,r);n.checked?a<0&&t.$set(i,"checked",o.concat([r])):a>-1&&t.$set(i,"checked",o.slice(0,a).concat(o.slice(a+1)))}else t.$set(i,"checked",s)}}}),e("div",{staticClass:"flex flex-row"},[e("div",{staticClass:"avatar-wrapper",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"2.4",src:i.isReal?t.getSelectAccount.logo:"tt_broker.png",theme:t.getActiveTheme}})],1),e("div",{staticClass:"flex flex-column"},[e("div",{staticClass:"account-name",class:"".concat(i.isReal?"REAL":"DEMO")},[t._v(t._s(i.groupType))]),e("div",{staticClass:"account-id"},[t._v(t._s(i.sequenceId))])])])]),e("td",{staticClass:"flex flex-row justify-center"},[!t.remainedTime(i)||t.remainedTime(i).endless||t.remainedTime(i).ended?t.remainedTime(i)&&t.remainedTime(i).ended?e("span",{staticClass:"timeleft",style:{color:[t.getRedColor.color]}},[t._v(t._s(t.$t("personalArea.personalPayments.Ended")))]):t.remainedTime(i)&&t.remainedTime(i).nosub?e("span",{staticClass:"timeleft"},[t._v(t._s(t.$t("personalArea.personalPayments.Nosub")))]):t._e():e("span",{staticClass:"timeleft",style:{color:t.getSubscribeColor(i)}},[t._v(t._s(t.remainedTime(i).days)+t._s(t.$t('common["d."]'))+" "+t._s(t.remainedTime(i).hours)+" "+t._s(t.$t('common["h."]'))+" ")]),e("span",{staticClass:"time"},[t._v("("+t._s(t.remainedTime(i)&&t.remainedTime(i).endless?t.$t("personalArea.personalPayments.Endless"):t.getFormatDate(i.stopDateTime))+")")])]),e("td",[e("span",{staticClass:"amount"},[t._v(t._s(t.$moneyf(t.getCurrrentPPM))+"₽")])]),e("td",[e("span",{staticClass:"amount"},[t._v(t._s("".concat(t.subscriptions.get(i.id)||0,"₽")))])])])})),0)],1),e("tfoot",{staticClass:"paymentList-footer"},[e("tr",{staticClass:"paymentList-footer-agregate items-group-sub-container",class:t.getActiveTheme},[e("span",{staticClass:"amount"},[t._v(t._s(t.$moneyf(t.getAllAccountsSubsriptionSum))+"₽")]),e("span",{staticClass:"period-spec",class:t.getActiveTheme},[t._v("x")]),e("DxSelectBox",{staticClass:"info-wrapper numpicker",class:t.getActiveTheme,attrs:{height:"24px",items:t.getSubscriptionsMonths,hoverStateEnabled:!1,dropDownOptions:{container:".dropdownSelectDefault"}},model:{value:t.subscriptionMonths,callback:function(e){t.subscriptionMonths=e},expression:"subscriptionMonths"}}),e("span",{staticClass:"period-spec",class:t.getActiveTheme},[t._v(t._s(t.$t('common["mon."]')))]),e("span",{staticClass:"amount"},[t._v(t._s(t.$moneyf(t.getAllAccountsSubsriptionSum*t.subscriptionMonths))+"₽")])],1)])])]):t._e(),-1!==t.filteredAccounts[t.activeTabAccount]&&""===t.groupTypeFilter?e("div",{staticClass:"paymentList paymentList-Wider",class:t.getActiveTheme},[e("div",{staticClass:"paymentList-footer"},[e("div",{staticClass:"paymentList-footer-summarize REAL",class:t.getActiveTheme},[e("span",{staticClass:"caption"},[t._v(t._s(t.$t("personalArea.personalPayments.tscstt")))]),e("div",{staticClass:"flex flex-row"},[e("span",{staticClass:"amount"},[t._v(t._s(t.$moneyf(t.getAccountsTotalAmountToPay))+"₽ ")]),e("Button",{staticClass:"button-default",attrs:{label:t.$t("common.Pay")}})],1)])])]):t._e()],1):t._e()])])])},qst=[],zst={name:"PersonalPayments",components:{VuePerfectScrollbar:Xt.a,Button:zt,DxSelectBox:Bo.a,Avatar:E,RadioButton:$a},mixins:[qe],data:function(){return{activeTab:"DEMO",groupTypeFilter:"Forex",activeTabAccount:0,selectedPeriod:"1 мес.",periods:[],isLoading:!1,loadedService:!1,mainFilter:"pay",prolongation:Array.from({length:12},(function(t,e){return e+1})),subscriptionMonths:1,allSelected:!1,selectedSubscription:0,subscriptionVariants:[],allAccountsData:[],serviceName:"Site Plus",subscriptions:new Map,paymentHistory:new Map,subscriptionsplus:new Map,subscriptionsdemo:new Map}},watch:{getProfileAccount:function(t){t&&this.needPay(t)},getPaymentReference:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:e.setSubscriptionVariants(t);case 1:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getUser:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount",getActiveTheme:"headerSettings/getActiveTheme",getPaymentReference:"paymentService/getPaymentReference",getUserPaymentServices:"paymentService/getUserPaymentServices",getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",getUserSettings:"userSettings/getUserSettings"})),{},{getActiveAccountPayment:function(){var t=this,e=this.allAccountsData.find((function(e){var i;return e.id===(null===(i=t.filteredAccounts[t.activeTabAccount])||void 0===i?void 0:i.id)}));return e},getActiveAccountPayedDate:function(){if(-1===this.activeTabAccount)return this.$t("personalArea.personalPayments.AccountNotSelected");var t,e,i,o,n,s,r=this.getActiveAccountPayment,a="",c="";null!==r&&void 0!==r&&r.stopDateTime&&(c=this.remainedTime(r),null!==(t=c)&&void 0!==t&&t.days||null!==(e=c)&&void 0!==e&&e.hours?a=(null===(n=this.remainedTime(r))||void 0===n?void 0:n.days)+this.$t('common["d."]')+(null===(s=this.remainedTime(r))||void 0===s?void 0:s.hours)+this.$t('common["h."]'):null!==(i=c)&&void 0!==i&&i.ended?a=this.$t("personalArea.personalPayments.Ended"):null!==(o=c)&&void 0!==o&&o.nosub&&(a=this.$t("personalArea.personalPayments.Nosub")));return null!==r&&void 0!==r&&r.stopDateTime?"".concat(a," (").concat(this.getFormatDate(r.stopDateTime),")"):this.$t("personalArea.personalPayments.noDataAccount")},getAllAccountsSubsriptionSum:function(){var t,e=this,i=this.subscriptionVariants.find((function(t){return t.period.period===30*e.subscriptionMonths})),o=i?((null===(t=this.allAccountsData.filter((function(t){return t.checked})))||void 0===t?void 0:t.length)||0)*(i.price.amount/this.subscriptionMonths):0;return o},getCurrentSubsriptionPlan:function(){var t=this;return this.subscriptionVariants.find((function(e){return e.period.period===30*t.subscriptionMonths}))},getCurrrentPPM:function(){var t,e;return(null===(t=this.getCurrentSubsriptionPlan)||void 0===t||null===(t=t.price)||void 0===t?void 0:t.amount)*((null===(e=this.getCurrentSubsriptionPlan)||void 0===e?void 0:e.period.period)/30)},getSubscriptionsMonths:function(){return this.subscriptionVariants.map((function(t){return t.period.period/30}))},getAccountsTotalAmountToPay:function(){var t=this,e=this.allAccountsData.filter((function(t){return t.checked})),i=0;return null!==e&&void 0!==e&&e.length&&e.forEach((function(e){t.subscriptions.has(e.id)&&(i+=t.subscriptions.get(e.id))})),this.getAllAccountsSubsriptionSum*this.subscriptionMonths+i},getSelectAccount:function(){if(this.getProfileSequenceIds){var t=this.getProfileSequenceIds.find((function(t){return t.default}));return t||this.getProfileSequenceIds[0]}},getProfileSequenceIds:function(){var t=this;if(this.getProfileAccount.length){var e=this.getProfileAccount.map((function(e){return{text:e.sequenceId,logo:null!==e&&void 0!==e&&e.brokerId?"broker-sample.png":"tt_broker.png",color:"Demo"===e.accountGroupCode?t.getRedColor.color:"Real"===e.accountGroupCode?t.getGreenColor.color:t.getRedColor.color,id:e.id,brokerId:null===e||void 0===e?void 0:e.brokerId,group:e.accountGroupCode,default:e.isDefault,isProvider:!!e.source.length}}));return e=e.sort((function(t,e){return e.isProvider-t.isProvider})),e}},filteredAccounts:function(){var t,e=this,i=null===(t=this.getProfileAccount)||void 0===t?void 0:t.filter((function(t){return!e.groupTypeFilter||t.groupType===e.groupTypeFilter}));return i},getAccountPaymentsHistory:function(){return this.paymentHistory.get(this.filteredAccounts[this.activeTabAccount])}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getInvoiceByFilter:"paymentService/getInvoiceByFilter",getPaymentService:"paymentService/getPaymentService"})),{},{selectSub:function(t){this.selectedSubscription=t},getNaming:function(t){var e='personalArea.personalPayments.months["'.concat(t,'"]');return this.$t(e)},getFormatDate:function(t){var e;return new Date(t).toLocaleString((null===(e=this.getUserSettings.lang)||void 0===e?void 0:e.code)||"en",{year:"numeric",month:"long",day:"numeric"})},getSubscribeColor:function(t){var e,i=null===(e=this.remainedTime(t))||void 0===e?void 0:e.days;return i<=2?[this.getRedColor.color]:i<=3?[this.getOrangeColor.color]:[this.getGreenColor.color]},remainedTime:function(t){if(!t)return{nosub:!0};if(null===t.stopDateTime)return{endless:!0};if(t.isDemo){var e=new Date(t.stopDateTime).getTime(),i=new Date(this.getServerTime.now).getTime(),o=e-i,n=Math.floor(o/1e3/60/60/24),s=Math.floor(o/1e3/60/60)%24;return n<0||s<0?{ended:!0}:{days:n,hours:s}}},needPay:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,l,u,d,h,p,g,f,m,v;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.getPaymentService({id:e.getUser.id,isUserId:!0});case 2:return o=i.sent,n=t.filter((function(t){return-1===e.allAccountsData.findIndex((function(e){return e.id===t.id}))})),n.length&&(s=e.allAccountsData).push.apply(s,Object(x["a"])(n.map((function(t){var e=o.find((function(e){return e.accountId===t.id}));return Object(c["a"])(Object(c["a"])({},t),{},{checked:!1,stopDateTime:null===e||void 0===e?void 0:e.stopDateTime,isDemo:null===e||void 0===e?void 0:e.isDemo})})))),a=o.filter((function(t){return 1===t.serviceId})),l=o.filter((function(t){return 2===t.serviceId})),u=o.filter((function(t){return 4===t.serviceId})),i.next=10,e.getInvoiceByFilter();case 10:d=i.sent,h=Object(r["a"])().mark((function t(i){var o;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:d.length&&(o=d.find((function(t){return t.userServiceId===a[i].id})),o&&(o.paymentDateTime?e.paymentHistory.set(l[i].accountId,o.amount):e.subscriptions.set(l[i].accountId,o.amount)));case 1:case"end":return t.stop()}}),t)})),p=0;case 13:if(!(p(null===e||void 0===e||null===(o=e.country)||void 0===o?void 0:o.countryName)?1:-1}));case 4:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.getCountries(),e.t0=t,e.next=4,t.getDocumentData();case 4:e.t1=e.sent,e.t0.setData.call(e.t0,e.t1);case 6:case"end":return e.stop()}}),e)})))()}},trt=Zst,ert=(i("70b3"),Object(C["a"])(trt,Jst,Kst,!1,null,"334613e3",null)),irt=ert.exports,ort=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personalSignals"},[t.filteredAccounts&&t.filteredAccounts.length?e("div",{staticClass:"personalSignals-accountTypeContent"},[e("div",{staticClass:"personalSignals-accountTypeContent-container"},[e("div",{staticClass:"personalSignals-switcher-wrapper"},[e("div",{staticClass:"personalSignals-switcher",class:t.getActiveTheme},[e("div",{staticClass:"personalSignals-switcher-tab",class:"Forex"===t.groupTypeFilter?"personalSignals-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("Forex")}}},[t._v("Forex")]),e("div",{staticClass:"personalSignals-switcher-tab",class:"Crypto"===t.groupTypeFilter?"personalSignals-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("Crypto")}}},[t._v("Crypto")]),e("div",{staticClass:"personalSignals-switcher-tab",class:""===t.groupTypeFilter?"personalSignals-switcher-tab-active":"",on:{click:function(e){return t.switchMainTab("")}}},[t._v(t._s(t.$t("all")))])])]),e("div",{staticClass:"personalSignals-accountTypeContent-accountsList"},[e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},[e("transition-group",{staticClass:"personalSignals-accountTypeContent-accountsList-wrapper",class:t.getActiveTheme,attrs:{appear:"",tag:"div",name:"list"}},t._l(t.filteredAccounts,(function(i,o){return e("div",{key:"accountsList-card-".concat(i.id),staticClass:"personalSignals-accountTypeContent-accountsList-card",class:{"personalSignals-accountTypeContent-accountsList-card-active":t.activeTabAccount===o},on:{click:function(e){return e.stopPropagation(),t.changeActiveAcc(o)}}},[e("div",{staticClass:"personalSignals-accountTypeContent-accountsList-card-avatar"},[i.isPublish?e("div",{staticClass:"account-provider",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Provider",size:18}})],1):t._e(),e("div",{staticClass:"avatar-wrapper",class:t.getActiveTheme},[e("Avatar",{attrs:{size:"2.4",src:i.isReal?t.getSelectAccount.logo:"tt_broker.png",theme:t.getActiveTheme}})],1)]),e("div",{staticClass:"personalSignals-accountTypeContent-accountsList-card-info"},[e("div",{staticClass:"personalSignals-accountTypeContent-accountsList-card-info-name",class:"".concat(i.isReal?"REAL":"DEMO")},[t._v(t._s(i.accountGroupCode))]),e("div",{staticClass:"personalSignals-accountTypeContent-accountsList-card-info-number"},[t._v(t._s(i.sequenceId))])]),e("div",{staticClass:"providerIconContainer",on:{click:function(e){return t.listPublishAccount(i)}}},[i.isDefault?e("div",{staticClass:"personalSignals-accountTypeContent-accountsList-card-checkmark",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Check"}})],1):t._e(),t.activeTabAccount===o?e("svgIcon",{staticClass:"switch-off-provider",attrs:{name:i.isPublish?"disable-Provider":"Provider",size:24}}):t._e()],1)])})),0)],1)],1)]),e("div",{staticClass:"personalSignals-accountTypeContent-main-container"},[e("div",{staticClass:"personalSignals-accountTypeContent-main",class:t.getActiveTheme},[t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"personalSignals-accountTypeContent-main-accountTools"},[e("table",{staticClass:"paymentList paymentList-Wider paymentList-notFull",class:t.getActiveTheme},[e("thead",[e("tr",{staticClass:"paymentList-header table-default grid-layout grid-layout-1-4",class:t.getActiveTheme},[e("td",[e("span",[t._v(t._s(t.$t("instrument")))])]),e("td",{staticClass:"flex flex-row",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalSignals.FixedPaymentPM")))]),e("td",{staticClass:"flex flex-row",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalSignals.PercentOfSuccess")))])])]),e("tbody",[e("tr",{staticClass:"paymentList-row grid-layout grid-layout-1-4",class:t.getActiveTheme},[e("td",{staticClass:"flex flex-row cursor-pointer",class:t.getActiveTheme},[e("div",{staticClass:"flex flex-column"},[e("div",{staticClass:"name"},[t._v(t._s(t.$t("all")))])])]),e("td",[e("Input",{class:t.getActiveTheme,attrs:{value:t.commonMonthPrice,type:"Number",min:"0"},on:{input:function(e){return t.changeAllValues(e.target.value,"commonMonthPrice","monthPrice")}}})],1),e("td",[e("Input",{class:t.getActiveTheme,attrs:{value:t.commonProfitPercent,type:"Number",max:"100",min:"0"},on:{input:function(e){return t.changeAllValues(e.target.value,"commonProfitPercent","profitPercent")}}})],1)]),e("Vue-perfect-scrollbar",{staticClass:"scroll-area"},t._l(t.instruments,(function(i,o){return e("tr",{key:"instruments-".concat(i.contract),staticClass:"paymentList-row grid-layout grid-layout-1-4",class:t.getActiveTheme},[e("td",{staticClass:"flex flex-row cursor-pointer",class:t.getActiveTheme,on:{click:function(e){return t.changeInstValue(!i.checked,o,"checked")}}},[e("svgIcon",{attrs:{name:i.checked?"star-signals-filled":"star-signals-empty"}}),e("div",{staticClass:"flex flex-column"},[e("div",{staticClass:"name"},[t._v(t._s(i.contract))])])],1),e("td",[e("Input",{class:t.getActiveTheme,attrs:{value:i.monthPrice,disabled:!i.checked,type:"Number",min:"0"},on:{input:function(e){return t.changeInstValue(e.target.value,o,"monthPrice")}}})],1),e("td",[e("Input",{class:t.getActiveTheme,attrs:{value:i.profitPercent,disabled:!i.checked,type:"Number",max:"100",min:"0"},on:{input:function(e){return t.changeInstValue(e.target.value,o,"profitPercent")}}})],1)])})),0)],1)]),t.instrumentsChanged&&t.instrumentsChanged.size?e("Button",{staticClass:"items-group-button items-group-button-relative",attrs:{icon:"Save2",label:"".concat(t.$t("save"))},on:{click:t.saveSource}}):t._e()],1):t._e(),t.cantAddSource?e("div",{staticClass:"personalSignals-accountTypeContent-main-caption warning",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalSignals.InvestWarning")))]):t._e(),t.cantDeleteSource?e("div",{staticClass:"personalSignals-accountTypeContent-main-caption warning",class:t.getActiveTheme},[t._v(t._s("".concat(t.$t("personalArea.personalSignals.DeleteWarning")," ").concat(t.cantDeleteSource,".")))]):t._e(),e("div",{staticClass:"personalSignals-accountTypeContent-main-caption",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalSignals.TradesWarning50")))])]),e("div",{staticClass:"personalSignals-accountTypeContent-info"},[e("div",{staticClass:"items-group-container"},[e("div",{staticClass:"items-group items-group-labeled",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalSignals.VideoInstruction")))]),e("Button",{staticClass:"items-group-button items-group-button-relative",attrs:{icon:"Video",label:"".concat(t.$t("common.Watch"))}})],1),t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"items-group items-group-labeled items-group-wide",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s("".concat(t.filteredAccounts[t.activeTabAccount].isPublish?t.$t("common.Stop"):t.$t("common.Start")," ").concat(t.$t("personalArea.personalSignals.PublishTradeSignals"))))]),e("Button",{staticClass:"items-group-button items-group-button-relative",attrs:{icon:"Stop",label:t.filteredAccounts[t.activeTabAccount].isPublish?"".concat(t.$t("common.Stop")," "):"".concat(t.$t("common.Start")," "),disable:t.filteredAccounts[t.activeTabAccount].isPublish?t.cantDeleteSource:t.cantAddSource},on:{click:function(e){return t.listPublishAccount(t.filteredAccounts[t.activeTabAccount])}}}),e("svgIcon",{attrs:{name:"question"}})],1):t._e()])])])]):e("div",{staticClass:"personalSignals-empty"},[e("div",{staticClass:"caption"},[t._v(t._s(t.$t("personalArea.personalSignals.NoAccounts")))]),e("Button",{staticClass:"items-group-button items-group-button-relative",attrs:{icon:"TradingAccounts",label:t.$t("personalArea.personalSignals.OpenAccount")},on:{click:function(e){return t.goTo()}}})],1),t.isConfirmProviderPopupVisible?e("networkNotification",{class:"".concat(t.getActiveTheme),attrs:{"icon-name":"checkbox-graphics-complex","icon-height":"86px","icon-width":"154px","popu-width":"300px","button-text":"".concat(t.$t("common.Understand")),message:"".concat(t.$t("common.Account")).concat(t.filteredAccounts[t.activeTabAccount].sequenceId).concat(t.$t("personalArea.personalSignals.NotAProviderAnymore"))},on:{click:function(e){t.isConfirmProviderPopupVisible=!1},closeNotification:function(e){t.isConfirmProviderPopupVisible=!1}}}):t._e(),t.filteredAccounts&&t.filteredAccounts[t.activeTabAccount]?e("DxPopup",{staticClass:"removePublishPopup",attrs:{visible:t.isRemovePublishConfirmPopupVisible,width:"370px",height:"150px",maxWidth:"370px",maxHeight:"108px",position:{at:"center",my:"center"},fullScreen:!1,shading:!1,showTitle:!1,showCloseButton:!0,container:".removePublishPopup"}},[e("div",{staticClass:"personalSignals-RemovePublishConfirmPopup"},[e("span",{staticClass:"status"},[t._v(t._s("".concat(t.$t("personalArea.personalSignals.RemoveAccountProviderStatus")).concat(t.filteredAccounts[t.activeTabAccount].sequenceId,"?")))]),e("div",{staticClass:"input-group-wrapper"},[e("button",{staticClass:"btn",on:{click:function(e){t.isRemovePublishConfirmPopupVisible=!1}}},[e("svgIcon",{attrs:{name:"cross-default"}}),t._v(t._s(t.$t("no")))],1),e("button",{staticClass:"btn",on:{click:function(e){return t.continueWithAccountPublish()}}},[t.apiBusy?t._e():e("svgIcon",{attrs:{name:"Check"}}),t.apiBusy?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e(),t._v(t._s(t.$t("yes")))],1)])])]):t._e(),e("DxPopup",{attrs:{visible:t.isPublishConfirmPopupVisible,width:"290px",height:"460px",maxWidth:"290px",maxHeight:"460px",position:{at:"center",my:"center"},fullScreen:!1,shading:!1,showTitle:!1,showCloseButton:!0,container:"successPopup"}},[e("div",{staticClass:"personalSignals-PublishConfirmPopup"},[e("div",{staticClass:"image-wrapper"},[e("img",{attrs:{src:i("f7a9")}})]),e("span",{staticClass:"status"},[t._v(t._s(t.$t("personalArea.personalSignals.PopupCaption1"))+" "+t._s(t.$t("personalArea.personalSignals.PopupCaption2"))+" "+t._s(t.$t("personalArea.personalSignals.PopupCaption3"))+" "),e("br"),e("br"),e("em",[t._v(t._s(t.$t("personalArea.personalSignals.PopupCaption4")))])]),t.filteredAccounts[t.activeTabAccount]?e("div",{staticClass:"input-group-wrapper"},[e("button",{staticClass:"btn",on:{click:function(e){t.isPublishConfirmPopupVisible=!1}}},[e("svgIcon",{attrs:{name:"cross-default"}}),t._v(t._s(t.$t("no")))],1),e("button",{staticClass:"btn",on:{click:function(e){return t.continueWithAccountPublish()}}},[t.apiBusy?t._e():e("svgIcon",{attrs:{name:"Check"}}),t.apiBusy?e("DxLoadIndicator",{staticClass:"loadingComponent",attrs:{height:20,width:20}}):t._e(),t._v(t._s(t.$t("yes")))],1)]):t._e()])])],1)},nrt=[],srt={name:"PersonalSignals",components:{Button:zt,DxSelectBox:Bo.a,DxTextBox:sc["DxTextBox"],Avatar:E,networkNotification:Tst,VuePerfectScrollbar:Xt.a,PopupConfirm2:Nst,DxPopup:xo.a,DxLoadIndicator:OT["DxLoadIndicator"]},mixins:[qe],data:function(){return{apiBusy:!1,isPublishConfirmPopupVisible:!1,isConfirmProviderPopupVisible:!1,primarySourceSetting:!1,isRemovePublishConfirmPopupVisible:!1,groupTypeFilter:"Forex",activeTabAccount:0,shareSignalsByInstruments:!0,shareSignalsByPortfolio:!1,instrumentsChanged:new Map,instruments:[],contractsData:[],cantSwitchPublish:!1,cantAddSource:!1,cantDeleteSource:!1,commonProfitPercent:0,commonMonthPrice:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getServerTime:"serverTime/getServerTime",getUser:"user/getUserDetail",getProfileAccount:"subscribeOrders/getProfileAccount",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getPopupPosition:function(){return{at:"center",my:"center",of:"body"}},getSelectAccount:function(){if(this.getProfileSequenceIds){var t=this.getProfileSequenceIds.find((function(t){return t.default}));return t||this.getProfileSequenceIds[0]}},getProfileSequenceIds:function(){var t=this;if(this.getProfileAccount.length){var e=this.getProfileAccount.map((function(e){return{text:e.sequenceId,logo:e.brokerId?"broker-sample.png":"tt_broker.png",color:"Demo"===e.accountGroupCode?t.getRedColor.color:"Real"===e.accountGroupCode?t.getGreenColor.color:t.getRedColor.color,id:e.id,brokerId:e.brokerId,group:e.accountGroupCode,default:e.isDefault,isProvider:!!e.source.length}}));return e=e.sort((function(t,e){return e.isProvider-t.isProvider})),e}},filteredAccounts:function(){var t,e=this,i=null===(t=this.getProfileAccount)||void 0===t?void 0:t.filter((function(t){return!e.groupTypeFilter||t.groupType===e.groupTypeFilter}));return i}}),watch:{activeTabAccount:function(t){this.getAccountsContract(this.filteredAccounts[t])},groupTypeFilter:function(){this.getAccountsContract(this.filteredAccounts[this.activeTabAccount])},filteredAccounts:{deep:!0,handler:function(t){this.getAccountsContract(t[this.activeTabAccount]),this.sendCommandGetProviderShortStatistics(t[this.activeTabAccount]),this.sendCommandGetInvestBagInfo(t[this.activeTabAccount])}}},methods:{goTo:function(){var t={disabled:!1,name:"personalArea.sidebar.TradingAccounts",icon:"TradingAccounts",tab:"PersonalTradingAccounts"};this.$emit("setTab",t)},clickOutSidePopup:function(){this.isPublishConfirmPopupVisible=!1},changeAllValues:function(t,e,i){var o=this;String(Number(t))===t&&(Number(t)<0||"profitPercent"===i&&Number(t)>100||(this.$set(this,e,t),this.instruments.forEach((function(e,n){e.checked&&(e[i]=t,o.instrumentsChanged.set(n,e))}))))},listPublishAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.isPublish||!e.isCurrentAccountProvider){i.next=2;break}return i.abrupt("return");case 2:t.isPublish?e.isRemovePublishConfirmPopupVisible=!0:e.isPublishConfirmPopupVisible=!0;case 3:case"end":return i.stop()}}),i)})))()},continueWithAccountPublish:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.filteredAccounts[t.activeTabAccount].isPublish||!t.isCurrentAccountProvider){e.next=2;break}return e.abrupt("return");case 2:if(!t.apiBusy){e.next=4;break}return e.abrupt("return");case 4:if(t.apiBusy=!0,!t.primarySourceSetting){e.next=11;break}return e.next=8,t.publishClearAccount();case 8:t.primarySourceSetting=!1,e.next=13;break;case 11:return e.next=13,t.switchPublic();case 13:t.apiBusy=!1;case 14:case"end":return e.stop()}}),e)})))()},setVariable:function(t,e){this.$set(this,t,e)},changeInstValue:function(t,e,i){var o=this;return Object(a["a"])(Object(r["a"])().mark((function n(){var s,a;return Object(r["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!o.cantAddSource||"checked"!==i||!0!==t){n.next=2;break}return n.abrupt("return");case 2:if(!o.cantDeleteSource||"checked"!==i||!1!==t){n.next=4;break}return n.abrupt("return");case 4:if("monthPrice"!==i&&"profitPercent"!==i){n.next=9;break}if(String(Number(t))===t){n.next=7;break}return n.abrupt("return");case 7:if(!(Number(t)<0)){n.next=9;break}return n.abrupt("return");case 9:if(o.instruments[e][i]=t,o.instrumentsChanged.set(e,o.instruments[e]),"checked"!==i){n.next=18;break}if(a=o.filteredAccounts[o.activeTabAccount],0!==(null===a||void 0===a||null===(s=a.source)||void 0===s?void 0:s.length)){n.next=18;break}if(!o.isCurrentAccountProvider||!1!==o.filteredAccounts[o.activeTabAccount].isPublish){n.next=16;break}return n.abrupt("return");case 16:o.isPublishConfirmPopupVisible=!0,o.primarySourceSetting=!0;case 18:case"end":return n.stop()}}),n)})))()},publishClearAccount:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.switchPublic();case 2:return e.next=4,t.saveSource();case 4:t.apiBusy=!1;case 5:case"end":return e.stop()}}),e)})))()},setInstruments:function(){if(-1!==this.activeTabAccount){var t=this.filteredAccounts[this.activeTabAccount],e=this.contractsData.find((function(e){return e.accountId===(null===t||void 0===t?void 0:t.id)}));e&&(this.instruments=e.allContracts.map((function(e){var i,o=null===t||void 0===t||null===(i=t.source)||void 0===i?void 0:i.find((function(t){return t.contract===e}));return{contract:e,accountId:null===t||void 0===t?void 0:t.id,monthPrice:(null===o||void 0===o?void 0:o.monthPrice)||0,profitPercent:(null===o||void 0===o?void 0:o.profitPercent)||0,checked:!!o}})).sort((function(t){return t.checked?-1:1})))}},resetDefaults:function(){this.isPublishConfirmPopupVisible=!1,this.isConfirmProviderPopupVisible=!1,this.primarySourceSetting=!1,this.isRemovePublishConfirmPopupVisible=!1,this.cantAddSource=!1,this.cantDeleteSource=!1,this.cantSwitchPublish=!1},switchMainTab:function(t){this.groupTypeFilter!==t&&(this.apiBusy=!0,this.activeTabAccount=0,this.instrumentsChanged.clear(),this.apiBusy=!1,this.resetDefaults(),this.groupTypeFilter=t)},changeActiveAcc:function(t){var e,i,o,n;this.activeTabAccount!==t&&(this.activeTabAccount=t,this.instrumentsChanged.clear(),this.resetDefaults(),!1!==(null===(e=this.filteredAccounts[t])||void 0===e?void 0:e.isPublish)||null!==(i=this.filteredAccounts[t])&&void 0!==i&&null!==(i=i.source)&&void 0!==i&&i.length||this.sendCommandGetInvestBagInfo(this.filteredAccounts[t]),!0===(null===(o=this.filteredAccounts[t])||void 0===o?void 0:o.isPublish)&&(null===(n=this.filteredAccounts[t])||void 0===n||null===(n=n.source)||void 0===n?void 0:n.length)>0&&this.sendCommandGetProviderShortStatistics(this.filteredAccounts[t]))},sendCommandGetProviderShortStatistics:function(t){if(t.id){var e={command:"GetProviderShortStatistics",data:{id:t.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},sendCommandGetInvestBagInfo:function(t){if(t.id){var e={Command:"GetInvestBagInfo",Data:{AccountId:t.id,InvestBagId:"",Statuses:["Active"]}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},getAccountsContract:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!e.apiBusy&&t){i.next=2;break}return i.abrupt("return");case 2:return i.next=4,e.$http.post(e.getApiUrl+"AccountContracts",JSON.stringify({accountsIds:[t.id]}),{headers:{"Content-Type":"application/json"}}).then((function(t){var i;null!==t&&void 0!==t&&null!==(i=t.data)&&void 0!==i&&i.length?(e.contractsData=t.data,e.setInstruments()):e.instruments=[]})).catch((function(t){window.console.error({error:t})}));case 4:case"end":return i.stop()}}),i)})))()},saveSource:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.instrumentsChanged){e.next=2;break}return e.abrupt("return");case 2:if(!t.cantAddSource){e.next=4;break}return e.abrupt("return");case 4:if(i=Array.from(t.instrumentsChanged.values()).map((function(e){var i,o={accountId:e.accountId,contract:e.contract,monthPrice:e.checked?Number(e.monthPrice):0,profitPercent:e.checked?Number(e.profitPercent):0,stopDateTime:e.checked?null:t.getServerTime.now};if(-1!==t.activeTabAccount&&null!==(i=t.filteredAccounts[t.activeTabAccount])&&void 0!==i&&i.source){var n,s=null===(n=t.filteredAccounts[t.activeTabAccount])||void 0===n?void 0:n.source.find((function(t){return t.contract===e.contract}));s&&(o.id=s.id)}return o})),0!==t.instruments.filter((function(t){return t.checked})).length){e.next=8;break}return e.next=8,t.switchPublic();case 8:return e.next=10,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 10:o=e.sent,t.$http.post(t.getApiUrl+"Subscription/Save/Source",JSON.stringify(i),{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}}).then((function(){var e={command:"AccountsByUser",data:{userId:t.getUser.id}};t.$socketStream.sendCommand({ws:"apiWS",command:e}),t.$store.dispatch("subscribeOrders/getAccountsUser",{guid:t.getUser.id,accId:0}),t.instrumentsChanged.clear(),t.primarySourceSetting||(t.primarySourceSetting=!0)}));case 12:case"end":return e.stop()}}),e)})))()},setMessageHandler:function(t){if(t&&t.command){var e,i,o;if("GetInvestBagInfo"===t.command){var n=null,s=null;try{s=JSON.parse(t.data)}catch(l){window.console.error({error:l}),n=!0}finally{var r;if(s&&s.length&&s[0].length&&s[0][0].length&&s[0][0][0].length)s[0][0][0][1]===(null===(r=this.filteredAccounts[this.activeTabAccount])||void 0===r?void 0:r.id)&&s.forEach((function(t){n^=t.length}));else s&&s.length&&s.forEach((function(t){n^=t.length}));this.cantAddSource=n,this.cantSwitchPublish=n}}if("GetProviderShortStatistics"===t.command&&null!==t&&void 0!==t&&null!==(e=t.data)&&void 0!==e&&e.length&&(null===t||void 0===t||null===(i=t.data[0])||void 0===i?void 0:i.accountId)===(null===(o=this.filteredAccounts[this.activeTabAccount])||void 0===o?void 0:o.id)){var a=null;try{var c;a=null===t||void 0===t||null===(c=t.data[0])||void 0===c?void 0:c.count}catch(l){window.console.error({error:l}),a=null}this.cantDeleteSource=a,this.cantSwitchPublish=a}}},switchPublic:function(){var t=arguments,e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(o=t.length>0&&void 0!==t[0]?t[0]:e.filteredAccounts[e.activeTabAccount],o){i.next=3;break}return i.abrupt("return");case 3:if(!e.cantSwitchPublish){i.next=5;break}return i.abrupt("return");case 5:return n=JSON.stringify({accountId:o.id,isPublish:!o.isPublish}),i.next=8,e.$workKeys.signMessage(n,e.getSession.sk);case 8:return s=i.sent,i.next=11,e.$http.post(e.getApiUrl+"EditAccountCustomData",n,{headers:{"Content-Type":"application/json","X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":s}}).then((function(t){if(t.data.status.isOK){var i={command:"AccountsByUser",data:{userId:e.getUser.id}};e.$socketStream.sendCommand({ws:"apiWS",command:i}),e.$store.dispatch("subscribeOrders/getAccountsUser",{guid:e.getUser.id,accId:0}),e.isPublishConfirmPopupVisible=!1,e.isRemovePublishConfirmPopupVisible&&(e.isRemovePublishConfirmPopupVisible=!1,e.isConfirmProviderPopupVisible=!0)}})).catch((function(t){window.console.error({error:t})}));case 11:case"end":return i.stop()}}),i)})))()}},created:function(){this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler)},mounted:function(){this.getAccountsContract(this.filteredAccounts[this.activeTabAccount])}},rrt=srt,art=(i("6975"),Object(C["a"])(rrt,ort,nrt,!1,null,"4b227947",null)),crt=art.exports,lrt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personalPartner"},[t.isPartner?e("div",{staticClass:"personalPartner-wrapper"},[e("div",{staticClass:"personalPartner-header",class:t.getActiveTheme},[e("div",{staticClass:"personalPartner-header-tab",class:"1"===t.activeTab?"personalPartner-header-tab-active":"",on:{click:function(e){return t.switchTab("1")}}},[t._v(t._s(t.$t("personalArea.personalPartner.tabs.Referrals")))]),e("div",{staticClass:"personalPartner-header-tab",class:"2"===t.activeTab?"personalPartner-header-tab-active":"",on:{click:function(e){return t.switchTab("2")}}},[t._v(t._s(t.$t("personalArea.personalPartner.tabs.YourIncome")))]),e("div",{staticClass:"personalPartner-header-tab",class:"3"===t.activeTab?"personalPartner-header-tab-active":"",on:{click:function(e){return t.switchTab("3")}}},[t._v(t._s(t.$t("personalArea.personalPartner.tabs.Settings")))]),e("div",{staticClass:"personalPartner-header-tab",class:"4"===t.activeTab?"personalPartner-header-tab-active":"",on:{click:function(e){return t.switchTab("4")}}},[t._v(t._s(t.$t("personalArea.personalPartner.tabs.Documentation")))])]),"1"===t.activeTab?e("div",{staticClass:"personalPartner-content",class:t.getActiveTheme},[e("div",{staticClass:"items-group",class:t.getActiveTheme},[e("div",{staticClass:"input-group-container input-group-container-nowrap"},[e("div",{staticClass:"input-group input-group-nowrap"},[e("div",{staticClass:"info-wrapper info-wrapper-active info-wrapper-short",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalPartner.CommissionRate"))+" "),e("svgIcon",{attrs:{name:"question"}})],1),e("input",{directives:[{name:"model",rawName:"v-model",value:t.referral.percent,expression:"referral.percent"}],attrs:{type:"string"},domProps:{value:t.referral.percent},on:{input:function(e){e.target.composing||t.$set(t.referral,"percent",e.target.value)}}})]),e("div",{staticClass:"info-wrapper info-wrapper-active info-wrapper-short",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalPartner.CommissionSum")))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.referral.total,expression:"referral.total"}],attrs:{type:"string"},domProps:{value:t.referral.total},on:{input:function(e){e.target.composing||t.$set(t.referral,"total",e.target.value)}}})]),e("div",{staticClass:"info-wrapper info-wrapper-active info-wrapper-short",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalPartner.AvailableForWithdrawal")))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.referral.withdrawal,expression:"referral.withdrawal"}],attrs:{type:"string"},domProps:{value:t.referral.withdrawal},on:{input:function(e){e.target.composing||t.$set(t.referral,"withdrawal",e.target.value)}}})]),e("div",{staticClass:"info-wrapper info-wrapper-active info-wrapper-short",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalPartner.ValidityPeriod")))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.referral.expire,expression:"referral.expire"}],attrs:{type:"string"},domProps:{value:t.referral.expire},on:{input:function(e){e.target.composing||t.$set(t.referral,"expire",e.target.value)}}})])])])]),e("table",{staticClass:"table-referralUsers"},[t._m(1),e("tbody",t._l(t.refUsersData,(function(i){return e("tr",[e("td",[e("svgIcon",{attrs:{name:"empty-avatar"}}),e("span",[t._v(t._s(i.name))])],1),e("td",[e("span",{staticClass:"amount"},[t._v(" "+t._s(i.amount))])])])})),0)])]):t._e(),"2"===t.activeTab?e("div",{staticClass:"personalPartner-content",class:t.getActiveTheme},[e("div",{staticClass:"image-wrapper"},[e("img",{attrs:{src:i("db98")}}),e("img",{attrs:{src:i("e4d93")}}),e("img",{attrs:{src:i("2310")}})])]):t._e(),"3"===t.activeTab?e("div",{staticClass:"personalPartner-content",class:t.getActiveTheme},[e("div",{staticClass:"items-group items-group-labeled",class:t.getActiveTheme},[e("div",{staticClass:"items-group-header items-group-header-fixed",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalPartner.ReferralLink")))]),e("div",{staticClass:"input-group-container"},[e("div",{staticClass:"input-group input-group-column"},[e("div",{staticClass:"info-wrapper info-wrapper-active",class:t.getActiveTheme},[e("label",[t._v(t._s(t.$t("personalArea.personalPartner.YourLink")))]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.link,expression:"link"}],attrs:{type:"string"},domProps:{value:t.link},on:{input:function(e){e.target.composing||(t.link=e.target.value)}}})]),e("div",{staticClass:"social-wrapper"},[e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#8C8C8C"},attrs:{name:"Social-mail"}})],1),e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#00C194"},attrs:{name:"Messenger-WhatsApp"}})],1),e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#00C194"},attrs:{name:"Social-meta"}})],1),e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#549BFF"},attrs:{name:"Social-twitter"}})],1),e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#549BFF"},attrs:{name:"Messenger-Telegramm"}})],1),e("div",{staticClass:"social-link"},[e("svgIcon",{style:{color:"#981FAC"},attrs:{name:"Messenger-Viber"}})],1)]),e("DxSelectBox",{staticClass:"info-wrapper info-wrapper-fullsize info-wrapper-active back-filled",class:t.getActiveTheme,attrs:{items:t.leverageList,label:t.$t("common.Leverage"),"display-expr":"label",hoverStateEnabled:!1,"value-expr":"label","field-template":"field","item-template":"item",dropDownOptions:{container:".dropdownSelectDefault"}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropdownSelectDefault__content"},[e("div",{staticClass:"dropdownSelectDefault__content-text"},[e("DxTextBox",{attrs:{value:t.$t(o.label),"read-only":!0}})],1)])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"dropdownSelectDefault__content",class:"".concat(o.level," ").concat(t.getActiveTheme)},[e("div",{staticClass:"dropdownSelectDefault__content-text"},[t._v(t._s(t.$t(o.label)))])])]}}],null,!1,3397523192),model:{value:t.leverage,callback:function(e){t.leverage=e},expression:"leverage"}}),e("div",{staticClass:"rules-wrapper"},[e("input",{attrs:{type:"checkbox"}}),t._v(t._s(t.$t("personalArea.personalPartner.Agreement")[0])+" “"+t._s(t.$t("personalArea.personalPartner.Agreement")[1])+"”")]),e("Button",{attrs:{label:t.$t("personalArea.personalPartner.Generate")},on:{click:function(e){t.isModalPartnerDisableOpen=!0}}})],1)]),t._m(2)])]):t._e(),"4"===t.activeTab?e("div",{staticClass:"personalPartner-content",class:t.getActiveTheme},[e("div",{staticClass:"personalPartner-content-documents"},[e("div",{staticClass:"card",class:"".concat(t.getActiveTheme," ").concat(t.isOpenAffiliate?"active":"")},[e("div",{staticClass:"header-wrapper",on:{click:function(e){t.isOpenAffiliate=!t.isOpenAffiliate}}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}}),t._v(t._s(t.$t("personalArea.personalPartner.documents.HeadPart1")))],1),e("div",{staticClass:"content-wrapper"},[e("ul",[e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules1")))]),e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.PartnerRules2")))]),e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.PartnerRules3")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules4")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules5")))])]),e("p",{staticClass:"heading"},[t._v(t._s(t.$t("personalArea.personalPartner.documents.RuleHeading1")))]),e("ol",[e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.Circum1")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.Circum2")))])]),e("p",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.MainRules1")))]),e("p",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.MainRules2")))]),e("p",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.MainRules3")))])])]),e("div",{staticClass:"card",class:"".concat(t.getActiveTheme," ").concat(t.isOpenPartner?"active":"")},[e("div",{staticClass:"header-wrapper",on:{click:function(e){t.isOpenPartner=!t.isOpenPartner}}},[e("svgIcon",{attrs:{name:"new-dropdown-arrow-down"}}),t._v(t._s(t.$t("personalArea.personalPartner.documents.HeadPart2")))],1),e("div",{staticClass:"content-wrapper"},[e("ul",[e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules1")))]),e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.PartnerRules2")))]),e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.PartnerRules3")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules4")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.PartnerRules5")))])]),t._v(t._s(t.$t("personalArea.personalPartner.documents.RuleHeading1"))),e("ol",[e("li",[t._v(" "+t._s(t.$t("personalArea.personalPartner.documents.Circum1")))]),e("li",[t._v(t._s(t.$t("personalArea.personalPartner.documents.Circum2")))])]),t._v(t._s(t.$t("personalArea.personalPartner.documents.MainRules1"))+" "+t._s(t.$t("personalArea.personalPartner.documents.MainRules2"))+" "+t._s(t.$t("personalArea.personalPartner.documents.MainRules3")))])])])]):t._e()]):e("div",{staticClass:"personalPartner-preview"},[e("h1",{staticClass:"personalPartner-preview-header"},[t._v(t._s(t.$t("personalArea.personalPartner.tnbr")))]),e("div",{staticClass:"personalPartner-preview-content"},[e("div",{staticClass:"content-wrapper"},[e("div",{staticClass:"image"},[e("img",{attrs:{src:i("003c")}})]),t._m(0),e("p",{staticClass:"text text-centered"},[t._v(t._s(t.$t("personalArea.personalPartner.PaidToPartners")))])]),e("div",{staticClass:"content-wrapper"},[e("div",{staticClass:"heading"},[t._v(t._s(t.$t("personalArea.personalPartner.iyftt")))]),e("div",{staticClass:"caption"},[t._v(t._s(t.$t("personalArea.personalPartner.dywtri"))),e("br"),e("strong",[t._v(t._s(t.$t("personalArea.personalPartner.BecomeToptraderPartner")))]),t._v(" "+t._s(t.$t("personalArea.personalPartner.gurlqi"))),e("br"),e("br"),t._v(t._s(t.$t("personalArea.personalPartner.anawvc")))])])]),e("div",{staticClass:"personalPartner-preview-referral"},[e("div",{staticClass:"heading"},[t._v(t._s(t.$t("personalArea.personalPartner.ReferralPercent")))]),e("table",{staticClass:"table-referralInfo"},[e("thead",t._l(t.refData,(function(i){return e("th",[t._v(t._s(i.head))])})),0),e("tbody",t._l(t.refData,(function(i){return e("td",[t._v(t._s(i.data)+" ")])})),0)])]),e("Button",{attrs:{label:t.$t("personalArea.personalPartner.BecomePartner")},on:{click:function(e){t.isPartner=!0}}})],1),e("DxPopup",{attrs:{visible:t.isModalPartnerDisableOpen,width:"288px",height:"auto",maxWidth:"288px",maxHeight:"auto",position:{at:"center",my:"center"},fullScreen:!1,shading:!1,showTitle:!1,showCloseButton:!0,container:"PartnerConfirmPopup"}},[e("div",{staticClass:"personalPartner-PartnerConfirmPopup"},[e("div",{staticClass:"image-wrapper"},[e("img",{attrs:{src:i("003c")}})]),e("span",{staticClass:"status"},[t._v(t._s(t.$t("personalArea.personalPartner.yhctpi"))),e("br"),e("br"),t._v(t._s(t.$t("personalArea.personalPartner.ycartt")))]),e("div",{staticClass:"input-group-wrapper"},[e("button",{staticClass:"btn",on:{click:function(e){return t.disablePartnership()}}},[t._v(t._s(t.$t("common.Understand")))])])])])],1)},urt=[function(){var t=this,e=t._self._c;return e("p",{staticClass:"text text-centered"},[e("em",[t._v("$1 254 250")])])},function(){var t=this,e=t._self._c;return e("thead",[e("tr",[e("th",[t._v("Реферал")]),e("th",[t._v("Ваш доход")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"qrcode-wrapper"},[e("div",{staticClass:"qrcode"},[t._v("qrcode")])])}],drt={name:"PersonalPartner",components:{DxPopup:xo.a,Button:zt,DxSelectBox:Bo.a,DxTextBox:sc["DxTextBox"]},data:function(){return{isPartner:!1,isModalOpen:!1,refData:[{head:"Рефералов:",data:"%"},{head:"0 - 100",data:"10%"},{head:"101 - 500",data:"15%"},{head:"501 - 1K",data:"20%"},{head:"1K - 5K",data:"25%"},{head:"5K - 10K",data:"30%"},{head:">10K",data:"50%"}],refUsersData:[{name:"Alexey Denisoff",amount:"₮1 452.87",avatar:""},{name:"Alexey Denisoff",amount:"₮1 452.87",avatar:""},{name:"Alexey Denisoff",amount:"₮1 452.87",avatar:""},{name:"Alexey Denisoff",amount:"₮1 452.87",avatar:""},{name:"Alexey Denisoff",amount:"₮1 452.87",avatar:""}],referral:{percent:"20 %",total:"1 454 USD",withdrawal:"1 454 USD",expire:"365 д."},leverageList:[{label:1,level:"safe"},{label:2,level:"safe"}],isPublishConfirmPopupVisible:!1,isModalPartnerOpen:!1,isModalPartnerDisableOpen:!1,isCodeGenerated:!1,activeTab:"1",link:"ref.toptrader.com/x5478",isOpenAffiliate:!1,isOpenPartner:!1}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),watch:{},methods:{goTo:function(){var t={disabled:!1,name:"personalArea.sidebar.TradingAccounts",icon:"TradingAccounts",tab:"PersonalTradingAccounts"};this.$emit("setTab",t)},disablePartnership:function(){this.isModalPartnerDisableOpen=!1,this.isPartner=!1},switchTab:function(t){this.isModalPartnerDisableOpen=!1,this.isModalPartnerOpen=!1,this.activeTab!==t&&(this.activeTab=t)}},created:function(){this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler)},mounted:function(){this.getAccountsContract(this.filteredAccounts[this.activeTabAccount])}},hrt=drt,prt=(i("3c35a"),Object(C["a"])(hrt,lrt,urt,!1,null,"65250bf8",null)),grt=prt.exports,frt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-documents"},[e("div",{staticClass:"personal-documents__container",class:t.getActiveTheme},[e("div",{staticClass:"personal-documents__list"},t._l(t.getDomenLinks,(function(i){return e("div",{staticClass:"personal-documents__list_section",class:t.getActiveTheme},[e("div",{staticClass:"name"},[t._v(t._s(i.partName))]),t._l(i.links,(function(i){return e("div",{staticClass:"personal-documents__list_card",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"pdficon"}}),e("a",{staticClass:"name",attrs:{href:i.href,target:"_blank"}},[t._v(t._s(i.name))])],1)}))],2)})),0)]),e("div",{staticClass:"personal-documents__container description",class:t.getActiveTheme},[e("svgIcon",{attrs:{name:"Personal-documents-information",size:"100"}}),e("div",{staticClass:"personal-documents__caption-wrapper"},[e("div",{staticClass:"personal-documents__caption_heading",class:t.getActiveTheme},[t._v("Документы")]),e("div",{staticClass:"personal-documents__caption_text",class:t.getActiveTheme},[t._v("В этом разделе Вы сможете найти все документы, которые регулируют взаимоотношения между Вами и платформой TopTrader.")])])],1)])},mrt=[],vrt={name:"PersonalDocuments",components:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getActiveThemePrefix:"headerSettings/getActiveThemePrefix"})),{},{getDomenLinks:function(){return this.documents["toptrader.ru"]},documents:function(){return{"toptrader.ru":[{partName:"Пользователям",links:[{name:"СОГЛАШЕНИЕ ОБ ИСПОЛЬЗОВАНИИ САЙТА TOPTRADER.RU, СЕРВИСОВ И МАТЕРИАЛОВ, ПРЕДСТАВЛЕННЫХ НА САЙТЕ, И ЛИЦЕНЗИОННОЕ СОГЛАШЕНИЕ С ПОЛЬЗОВАТЕЛЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ «ТОПТРЕЙДЕР»",href:"https://about.toptrader.ru/docs/agreement.pdf"},{name:"Политика конфиденциальности",href:"https://about.toptrader.ru/docs/privacy_policy.pdf"},{name:"Согласие на обработку персональных данных",href:"https://about.toptrader.ru/docs/consent_to_personal_data_processing.pdf"},{name:"Порядок регистрации, авторизации и верификации на сайте",href:"https://about.toptrader.ru/docs/registration_authorization_and_verification_procedure_on_the_site.pdf"},{name:"Положение об оплате",href:"https://about.toptrader.ru/docs/payroll_regulations.pdf"},{name:"Прейскурант на предоставление ПО Правообладателя",href:"https://about.toptrader.ru/docs/price_list_for_provision_of_the_right_holder's_software.pdf"},{name:"Ссылки на другие сайты",href:"https://about.toptrader.ru/docs/references_to_other_sites.pdf"},{name:"Политика использования файлов cookie",href:"https://about.toptrader.ru/docs/cookies_policy.pdf"},{name:"Правила поведения Пользователя",href:"https://about.toptrader.ru/docs/user_behavior_rules.pdf"},{name:"Правила информационной поддержки Пользователей Сайта и ПО",href:"https://about.toptrader.ru/docs/terms_of_information_support_for_users_of_the_site_and_software.pdf"},{name:"Уведомление об авторских правах",href:"https://about.toptrader.ru/docs/copyright_notice.pdf"}]}],"toptrader.org":[{partName:"FOR USERS",links:[{name:"SMĚRNICE O ŘEŠENÍ OZNÁMENÍ",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Sm%C4%9Brnice%20o%20%C5%99e%C5%A1en%C3%AD%20ozn%C3%A1men%C3%AD.pdf"},{name:"OBCHODNÍ PODMÍNKY / TERMS AND CONDITIONS",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Terms%20and%20Conditions_for_WWW.pdf"},{name:"ZÁSADY OCHRANY OSOBNÍCH ÚDAJŮ / PRIVACY POLICY",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Privacy_Policy.pdf"},{name:"DEMO ÚČET / DEMO ACCOUNT",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Demo%20account_for_WWW.pdf"},{name:"ODMÍTNUTÍ ODPOVĚDNOSTI / DISCLAIMER",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Disclaimers.pdf"},{name:"COOKIES",href:"https://about.toptrader.org/wp-content/themes/toptrader/assets/For%20user/Cookies_for_WWW.pdf"}]}]}}})},yrt=vrt,Crt=(i("2a93"),Object(C["a"])(yrt,frt,mrt,!1,null,"6a4d9d74",null)),brt=Crt.exports,Srt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"personal-devices"},[e("div",{staticClass:"personal-devices__header"},[e("div",{staticClass:"personal-devices__title",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalDevices.DevicesSessions")))])]),e("div",{staticClass:"personal-devices__container",class:t.getActiveTheme},[e("div",{staticClass:"personal-devices__list"},t._l(t.devices,(function(i){return e("div",{staticClass:"personal-devices__list_card",class:t.getActiveTheme},[e("div",{staticClass:"main-section"},[e("div",{staticClass:"row"},[e("svgIcon",{staticClass:"session-svg",attrs:{name:i.icon,size:32}}),e("div",{staticClass:"column"},[e("div",{staticClass:"name"},[t._v(t._s(i.name))]),e("div",{staticClass:"session"},[t._v(t._s(t.getFormatDate(i.session)))])])],1),e("div",{staticClass:"icon-container"},[e("svgIcon",{attrs:{name:"arrow-right"}})],1)]),e("div",{staticClass:"subtext"},[t._v(t._s(t.$t("personalArea.personalDevices.ChooseThisDeviceToLogOut")))])])})),0)]),e("div",{staticClass:"personal-devices__container description",class:t.getActiveTheme},[e("div",{staticClass:"personal-devices__caption-wrapper"},[e("div",{staticClass:"personal-devices__caption_heading",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalDevices.ActiveSessions"))),e("br")]),e("div",{staticClass:"personal-devices__caption_text",class:t.getActiveTheme},[t._v(t._s(t.$t("personalArea.personalDevices.caption1"))+" "+t._s(t.$t("personalArea.personalDevices.caption2"))),e("br"),e("br"),t._v(t._s(t.$t("personalArea.personalDevices.caption3")))]),e("Button",{staticClass:"button",attrs:{icon:"User_exit",label:"".concat(t.$t("personalArea.personalDevices.LogOutAllDevices"))}})],1)])])},Prt=[],Trt={name:"PersonalDevices",components:{Button:zt},data:function(){return{devices:[{name:"Google Chrome (Windows)",session:new Date,icon:"Chrome"},{name:"Google Chrome (iOS)",session:new Date,icon:"Chrome"},{name:"macOS",session:new Date,icon:"macOS"},{name:"Android phone",session:new Date,icon:"Android-phone"}]}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getActiveThemePrefix:"headerSettings/getActiveThemePrefix",getUserSettings:"userSettings/getUserSettings"})),methods:{getFormatDate:function(t){var e;return new Date(t).toLocaleString((null===(e=this.getUserSettings.lang)||void 0===e?void 0:e.code)||"en",{year:"numeric",month:"long",day:"numeric"})}}},xrt=Trt,Ort=(i("62a7"),Object(C["a"])(xrt,Srt,Prt,!1,null,"8826024e",null)),wrt=Ort.exports,_rt={components:{Layout:oV,Button:zt,PersonalLeftBar:est,PersonalMyData:Bst,PersonalTradingAccounts:Hst,PersonalPayments:Qst,PersonalVerification:irt,PersonalSignals:crt,PersonalPartner:grt,PersonalDocuments:brt,PersonalDevices:wrt},data:function(){return{currentTab:"PersonalMyData",tabSettings:"",currentTitle:"MyData",modalSettings:{isOpen:!1,position:{}},observer:null,isShowOverlay:!1,isMini:!1,isShowModalPaymantAccept:!1,modalAcceptedChangeTab:null,descriptionBuyService:null}},computed:Object(c["a"])({},Object(p["c"])({getUserInfo:"user/getUserDetail",getSession:"auth/getSession",getCheckCodeModalStatus:"modal/getCheckCodeModalStatus",getRightSideBar:"userSettings/getRightSideBar",getLeftSideBar:"userSettings/getLeftSideBar",getPaidStatus:"subscription/getPaidStatus",getActiveTheme:"headerSettings/getActiveTheme",getDescriptionsSiteServices:"paymentService/getDescriptionsSiteServices"})),watch:{getRightSideBar:function(t){this.isMini&&!0===t&&this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!1})},getLeftSideBar:function(t){this.isMini&&!0===t&&this.handleChangeRightBar(!1)},currentTab:function(t){"PersonalSubscriptionOnPlatform"!==t&&(this.isShowOverlay=!1)},getDescriptionsSiteServices:function(t){this.URL=new URL(document.URL);var e=Object.fromEntries(this.URL.searchParams.entries());if("succeeded"===e.redirect_status){var i=localStorage.getItem("acceptSubscription"),o=JSON.parse(i),n=t.find((function(t){return t.id===o.serviceId}));n.upperName=n.name.split(" ")[1].toUpperCase(),this.descriptionBuyService=n}},"$route.query":{handler:function(t){Object.keys(t).length&&this.goToSelectedTab()},deep:!0}},methods:Object(c["a"])(Object(c["a"])({},Object(p["d"])({setIsPaymentsPage:"misc/setIsPaymentsPage"})),{},{closeOverlay:function(){this.isShowOverlay=!1},moveToSubscribePro:function(){this.isShowOverlay=!0,this.currentTab="PersonalSubscriptionOnPlatform"},deleteAccount:function(){this.modalSettings={description:"SendRequestForDeleteAccount",information:!1,maxWidth:"350px",lightTheme:!0,isOpen:!0,position:{left:"280px",top:"180px"}}},lockAccount:function(){this.modalSettings={description:"HiddenProfile",information:!1,maxWidth:"351px",lightTheme:!0,isOpen:!0,position:{left:"320px",top:"180px"}}},setTab:function(t){this.currentTab=t.tab,this.currentTitle=t.name,localStorage.setItem("tabInPersonalArea",this.currentTab),this.paramsSetTab=null},createModalAcceptChangeTab:function(){this.modalAcceptedChangeTab={description:"ModalAcceptRedirectDescription",information:!1,maxWidth:"270px",isOpen:!0,position:{left:"".concat(0,"px"),top:"".concat(0,"px")}}},handleChangeTab:function(t){this.setIsPaymentsPage("PersonalPayments"===(null===t||void 0===t?void 0:t.tab));var e=localStorage.getItem("acceptedRedirectFromPersonalArea");if(e){var i=JSON.parse(e);i.accept||(this.createModalAcceptChangeTab(),this.paramsSetTab=t)}var o,n=this.$refs["".concat(this.currentTab,"Ref")];if((null===n||void 0===n||!n.handleChangeTab)&&!e)return this.setTab(t),void history.pushState(null,null,"/personal-area?tabName=".concat(t.tab));n&&"function"===typeof n.handleChangeTab&&(o=n.handleChangeTab()),o&&o.accept||o&&!o.pos||o&&!o.accept&&(this.createModalAcceptChangeTab(),this.paramsSetTab=t)},handleChangeRightBar:function(t){this.$store.commit("userSettings/redactSettings",{widget:"rightSidebar",key:"visible",data:t})},appResize:function(t){t[0].target.offsetWidth<1650?(this.isMini=!0,this.handleChangeRightBar(!1)):(this.isMini=!1,this.handleChangeRightBar(!0))},createObserver:function(t,e){var i=new ResizeObserver(e);return i.observe(t),i},goToSelectedTab:function(){if(this.$route.query.tabName){var t={PersonalTradingAccounts:{disabled:!1,name:"personalArea.sidebar.TradingAccounts",icon:"TradingAccounts",tab:"PersonalTradingAccounts"},PersonalMyData:{disabled:!1,name:"personalArea.sidebar.MyData",icon:"DataGraph_Avatar",tab:"PersonalMyData"},PersonalPayments:{disabled:!1,name:"personalArea.sidebar.Payments",icon:"lk-leftbar-payments-and-comission",tab:"PersonalPayments"},PersonalSignals:{disabled:!1,name:"personalArea.sidebar.Signals",icon:"lk-leftbar-trade-signals",tab:"PersonalSignals"},PersonalPartner:{disabled:!1,name:"personalArea.sidebar.Partner",icon:"lk-leftbar-trade-partner",tab:"PersonalPartner"},PersonalVerification:{disabled:!1,name:"personalArea.sidebar.Verification",icon:"Verification",tab:"PersonalVerification"},PersonalDocuments:{disabled:!1,name:"personalArea.sidebar.Documents",icon:"Documents",tab:"PersonalDocuments"},PersonalDevices:{disabled:!1,name:"personalArea.sidebar.Devices",icon:"Devices",tab:"PersonalDevices"}};t[this.$route.query.tabName]&&this.handleChangeTab(t[this.$route.query.tabName])}}}),mounted:function(){var t=this;setTimeout((function(){t.$nextTick((function(){var e=document.getElementById("app");t.observer=t.createObserver(e,t.appResize)}))}),500),this.goToSelectedTab()}},Art=_rt,Drt=(i("6e80"),Object(C["a"])(Art,knt,Int,!1,null,"f6f7517a",null)),krt=Drt.exports,Irt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Trading",class:"Trading_".concat(t.getActiveTheme)},[t.getActiveSymbol?e("div",{staticClass:"Trading-left"},[e("TradingLeftBar",{attrs:{symbol:t.getActiveSymbol}})],1):t._e(),e("div",{staticClass:"Trading-central"},[e("Trading")],1),t.getActiveSymbol?e("div",{staticClass:"Trading-right",style:{width:t.getRightSideBar?"36rem":"4rem"}},[e("TradingRightBar",{attrs:{symbol:t.getActiveSymbol,activeTabProfile:"Trading"}})],1):t._e()])},Brt=[],Mrt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradingChart"},[e("div",{staticClass:"TradingChart-topBar",class:"TradingChart-topBar_".concat(t.getActiveTheme)},[e("ChartTradingTopBar")],1),e("div",{staticClass:"TradingChart-chart"},[e("div",{staticClass:"TradingChart-chartInstrumentBar",class:"TradingChart-chartInstrumentBar_".concat(t.getActiveTheme)}),e("div",{staticClass:"TradingChart-chartMultiChart"},[e("CandlesChart")],1)]),e("div",{staticClass:"TradingChart-tradingTable"},[e("UserProfileTable",{key:t.getStatByOrders,attrs:{selectorContainer:".TradingChart",loadedSessionTableData:t.getStatByOrders,symbol:t.getActiveSymbol}})],1)])},$rt=[],Lrt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chart-trading-top-bar"},[e("div",{staticClass:"chart-trading-top-bar_settingsButtonInfo"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__right--button","chart-trading-top-bar__right--button_".concat(t.getActiveTheme)]},icon:{name:"new-setting",color:t.getRedColor.color}},on:{click:t.showButtonInfoSettings}})],1),e("div",{class:"chart-trading-top-bar__right chart-trading-top-bar__right_".concat(t.getActiveTheme),on:{mouseleave:t.hideGroupButtons}},[t.getStatusUser?e("ScreenSwitcher"):t._e(),e("div",{ref:"wrapQuoteButtons",staticStyle:{position:"relative","flex-grow":"1",overflow:"hidden"}},[t.getStatusUser?e("div",{class:"chart-trading-top-bar__quoteWrap chart-trading-top-bar__quoteWrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"chart-trading-top-bar__quoteWrap-quotes"},[e("DxSortable",{staticClass:"chart-trading-top-bar__topButtonsQuote",attrs:{data:t.getTopButtonsQuote,autoScroll:!1,clone:!0,"item-orientation":"horizontal",group:"quotes"},on:{reorder:function(e){return t.onTaskDrop(e,"top")},add:function(e){return t.onTaskDrop(e,"top")},"drag-start":function(e){return t.onTaskDragStart(e,"top")}},scopedSlots:t._u([{key:"drag",fn:function(){return[e("div",[t._v("Button Set")])]},proxy:!0}],null,!1,2321515733)},t._l(t.getTopButtonsQuote,(function(i,o){return e("SetButton",{key:o+"tq",attrs:{setButton:i,statusGroupButtons:t.statusGroupButtons,ordersForAccount:t.ordersForAccount,openTradingMenu:t.openIndexTradingMenu===o,userStatus:t.getStatusUser},on:{setStatusGroupButtons:t.setStatusGroupButtons,setNewActiveSetButtons:function(e){return t.setNewActiveButtonInScreen(i)},openModalSettingMultichart:t.toggleSettingsMultichart,toggleSellBuy:function(e){return t.toggleSellBuyModalButtomInfo(e,{btn:i,index:o},"top")}}})})),1),e("div",[t.getListButtonsQuote.length?e("DxDropDownBox",{key:"".concat(t.getLabelMultiChartSelectList,"_").concat(t.getButtonForSelectListActiveStatus.selected,"_").concat(t.getActiveTheme),attrs:{id:"selectBoxQuote",openOnFieldClick:!1,height:"32px","element-attr":t.getClassForDropDownButtonsInfo,stylingMode:"underlined",items:t.getListButtonsQuote,value:t.getButtonForSelectListActiveStatus,"field-template":"field","content-template":"item",dropDownOptions:t.getDropDownSet,showDropDownButton:!0,"drop-down-button-template":"iconDropDown",onOpened:function(){t.iconDropDownSelect="doubleArrowUp"},onClosed:function(){t.iconDropDownSelect="doubleArrowDown"}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",[e("DxTextBox",{attrs:{visible:!1,"read-only":!0}}),e("SetButton",{attrs:{setButton:o,modePosition:"selectButton",statusGroupButtons:t.statusGroupButtons,ordersForAccount:t.ordersForAccount,userStatus:t.getStatusUser},on:{setStatusGroupButtons:t.setStatusGroupButtons,setNewActiveSetButtons:function(e){return t.setNewActiveButtonInScreen(o)}}})],1)]}},{key:"item",fn:function(i){i.data;return[e("DxSortable",{class:"chart-trading-top-bar__dropDownSelect-content chart-trading-top-bar__dropDownSelect-content_".concat(t.getActiveTheme),attrs:{data:t.getListButtonsQuote,maxHeight:"70vh",group:"quotes"},on:{"drag-start":function(e){return t.onTaskDragStart(e,"select")},reorder:function(e){return t.onTaskDrop(e,"select")},add:function(e){return t.onTaskDrop(e,"select")}}},t._l(t.getListButtonsQuote,(function(i,o){return e("div",{key:o+"lq",class:"chart-trading-top-bar__dropDownSelect-contentItem chart-trading-top-bar__dropDownSelect-contentItem_".concat(t.getActiveTheme)},[e("SetButton",{attrs:{setButton:i,modePosition:"list",ordersForAccount:t.ordersForAccount,userStatus:t.getStatusUser},on:{setNewActiveSetButtons:function(e){return t.setNewActiveButtonInScreen(i)}}})],1)})),0)]}},{key:"iconDropDown",fn:function(){return[e("div",{class:"chart-trading-top-bar__dropDownSelect-button chart-trading-top-bar__dropDownSelect-button_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:t.iconDropDownSelect}})],1)]},proxy:!0}],null,!1,447915093)}):t._e()],1),t.getStatusUser?e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__right--buttonNewChart","chart-trading-top-bar__right--buttonNewChart_".concat(t.getActiveTheme)],id:"buttonNewChart"},icon:{name:"Trading-open-new-chart"}},on:{click:t.openPopupNewChart}}):t._e()],1)]):t._e()]),e("div",{staticClass:"chart-trading-top-bar__buttons-group"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar_buttonTv","chart-trading-top-bar_buttonTv_".concat(t.getActiveTheme)],style:{marginRight:"0.8rem"}},icon:{name:"TV"}},on:{click:t.openTv}}),t.getStatusUser?e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__right--buttonMenu","chart-trading-top-bar__right--buttonMenu_".concat(t.getActiveTheme)],id:"toggle-multichart"},icon:{name:t.getActiveTypeChartForScreen}},on:{toggle:t.toggleSettingsMultichart}}):t._e(),e("ButtonIconFlat",{attrs:{icon:{name:t.getLeftAndRightSidebarsStatus?"UnExpand-bottom-blocks":"Expand-bottom-blocks"},modifier:{class:["chart-trading-top-bar__right--buttonMenu","chart-trading-top-bar__right--buttonMenu_".concat(t.getActiveTheme),"chart-trading-top-bar__right--buttonMenu-last"],id:"toggle-multichart"}},on:{toggle:t.closeAllSideBars}})],1)],1),e("DxPopup",{attrs:{visible:t.statusButtonInfoSettingsPopup,hideOnOutsideClick:!0,closeOnOutsideClick:!0,dragEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,position:{my:"top left",at:"bottom left",of:".chart-trading-top-bar_settingsButtonInfo",offset:{x:0,y:4}},shading:!1,showTitle:!1,width:"170px",onHidden:t.hideButtonInfoSettings,height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"chart-trading-top-bar_settingsButtonInfoMenu"},[e("TradingToolsConfig")],1)]},proxy:!0}])}),t.isOpenSettingsMultichart?e("DropDownSettingsMultichart",{attrs:{target:t.targetSettingsMultichart,show:t.isOpenSettingsMultichart},on:{changeShow:function(e){t.isOpenSettingsMultichart=!t.isOpenSettingsMultichart}}}):t._e()],1)},Frt=[],jrt=function(){var t=this,e=t._self._c;return e("div",{class:"chart-trading-top-bar__screenSwitcher chart-trading-top-bar__screenSwitcher_".concat(t.getActiveTheme)},[t._l(t.getSetButtonForSwitcher,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["chart-trading-top-bar__screenSwitcher-screenButton",t.getIndexScreen(i)===t.getActiveScreenInfo?"chart-trading-top-bar__screenSwitcher-activeScreenButton_".concat(t.getActiveTheme):"","chart-trading-top-bar__screenSwitcher-screenButton_".concat(t.getActiveTheme)]}},on:{toggle:function(e){return t.setScreenForQuotes(o)}}},["number"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenNumberMode"},[t._v(t._s(t.getIndexScreen(i)+1))]):t._e(),"color"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenColorMode",style:{background:i.screen.color}}):t._e(),"avatar"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenAvatarMode"},[e("Avatar",{attrs:{size:"1.7",src:i.screen.avatar}})],1):t._e()])})),t.getScreensForChartTopBar.length>3?e("DxDropDownButton",{attrs:{width:24,height:24,items:t.getDropDownScreens,dropDownOptions:t.dropDownOptinos,hoverStateEnabled:!1,focusStateEnabled:!1,"field-template":"field",dropDownButtonTemplate:"ddButton",dropDownContentTemplate:"ddContent"},scopedSlots:t._u([{key:"field",fn:function(t){t.value;return[e("div",[e("DxTextBox",{attrs:{visible:!1}})],1)]}},{key:"ddButton",fn:function(){return[e("div",{staticClass:"chart-trading-top-bar__screenSwitcher-ddButton"},[e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__screenSwitcher-settingsScreenButton","chart-trading-top-bar__screenSwitcher-settingsScreenButton_".concat(t.getActiveTheme)]},icon:{name:t.getScreensForChartTopBar.length>3?"new-dottedline":"new-setting"}}})],1)]},proxy:!0},{key:"ddContent",fn:function(i){i.data;return[e("div",{staticClass:"chart-trading-top-bar__screenSwitcher-ddContent"},[t._l(t.getDropDownScreens,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["chart-trading-top-bar__screenSwitcher-screenButton","chart-trading-top-bar__screenSwitcher-screenButton_".concat(t.getActiveTheme)],style:{marginBottom:"0.4rem"}}},on:{toggle:function(e){t.setScreenForQuotes(t.getIndexScreen(i))}}},["number"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenNumberMode"},[t._v(t._s(t.getIndexScreen(i)+1))]):t._e(),"color"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenColorMode",style:{background:i.screen.color}}):t._e(),"avatar"===i.screen.type?e("div",{staticClass:"chart-trading-top-bar__screenAvatarMode"},[e("Avatar",{attrs:{size:"1.7",src:i.screen.avatar}})],1):t._e()])})),e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__screenSwitcher-settingsScreenButton","chart-trading-top-bar__screenSwitcher-settingsScreenButton_".concat(t.getActiveTheme)]},icon:{name:"new-setting"}},on:{toggle:t.openModalSettings}})],2)]}}],null,!1,1734214066)}):e("ButtonIconFlat",{attrs:{modifier:{class:["chart-trading-top-bar__screenSwitcher-settingsScreenButton","chart-trading-top-bar__screenSwitcher-settingsScreenButton_".concat(t.getActiveTheme)]},icon:{name:t.getScreensForChartTopBar.length>3?"new-dottedline":"new-setting"}},on:{toggle:t.openModalSettings}})],2)},Rrt=[],Wrt={components:{ButtonIconFlat:Le,DxDropDownButton:wt["DxDropDownButton"],DxTextBox:rc.a,Avatar:E},data:function(){return{dropDownOptinos:{container:".chart-trading-top-bar__screenSwitcher"}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getScreensForChartTopBar:function(){return this.getTradingTopBarSettings.screensQuotes},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getSetButtonForSwitcher:function(){if(this.getScreensForChartTopBar.length<=3)return this.getScreensForChartTopBar;if(this.getScreensForChartTopBar.length>3&&this.getActiveScreenInfo<=2)return this.getScreensForChartTopBar.slice(0,3);if(this.getScreensForChartTopBar.length>3&&this.getActiveScreenInfo>2){var t=this.getScreensForChartTopBar.slice(0,2);return t.push(this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo]),t}},getDropDownScreens:function(){var t=this;if(!(this.getScreensForChartTopBar.length<3)){if(this.getActiveScreenInfo<=2)return this.getScreensForChartTopBar.slice(3,this.getScreensForChartTopBar.length);var e=this.getScreensForChartTopBar.slice(3,this.getScreensForChartTopBar.length);return e.splice(e.findIndex((function(e){return e.screen.screenId===t.getTradingTopBarSettings.screensQuotes[t.getActiveScreenInfo].screen.screenId})),1),e.unshift(this.getScreensForChartTopBar[2]),e}}}),methods:{openModalSettings:function(){this.$store.dispatch("modal/switchSettingsScreenQuotes")},getIndexScreen:function(t){return this.getScreensForChartTopBar.findIndex((function(e){return e.screen.screenId===t.screen.screenId}))},setScreenForQuotes:function(t){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewActiveScreenAndButtonQuote",data:t})}}},Nrt=Wrt,Ert=(i("5509"),Object(C["a"])(Nrt,jrt,Rrt,!1,null,null,null)),Urt=Ert.exports,Vrt=[[{name:"one-chart-first",countChatrs:1,typeMultichart:"one",typeNumber:1}],[{name:"double-chart-second",countChatrs:2,typeMultichart:"twoFirst",typeNumber:2},{name:"double-chart-first",countChatrs:2,typeMultichart:"twoSecond",typeNumber:22}],[{name:"three-chart-second",countChatrs:3,typeMultichart:"threeFirst",typeNumber:3},{name:"three-chart-first",countChatrs:3,typeMultichart:"threeSecond",typeNumber:32}],[{name:"four-chart-first",countChatrs:4,typeMultichart:"four",typeNumber:4}],[{name:"five-chart-first",countChatrs:5,typeMultichart:"fiveFirst",typeNumber:51}],[{name:"six-chart-first",countChatrs:6,typeMultichart:"sixFirst",typeNumber:61}],[{name:"seven-chart-first",countChatrs:7,typeMultichart:"sevenFirst",typeNumber:71}],[{name:"eight-chart-first",countChatrs:8,typeMultichart:"eightFirst",typeNumber:81}]],Hrt=function(){var t=this,e=t._self._c;return e("div",{ref:"buttonInfo",class:"button-info button-info_".concat(t.getActiveTheme," button-info__outer button-info__outer_").concat(t.getActiveTheme),attrs:{"data-info":t.dataBtn.id}},[e("div",{class:"button-info__backChart button-info__backChart_".concat(t.getActiveTheme)},[t.showMiniChart&&t.getColorTrendChart?e("simpleChart",{attrs:{fixedWidth:"compact"===t.mode?110:185,fixedHeight:32,points:t.getPointsForMiniChart,margin:{top:3,right:3,bottom:3,left:3},smooth:!0,color:t.getColorTrendChart.color,zeroGradient:t.getColorTrendChart.zeroGradient,firstGradient:t.getColorTrendChart.firstGradient}}):t._e()],1),e("div",{staticClass:"button-info__innerWrap",style:t.getWidthOnMode,on:{click:function(e){return t.clickHandler(e)}}},["selectButton"!==t.modePosition?e("div",{class:"button-info__drag button-info__drag_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Drag-small-top-left",size:10}})],1):t._e(),e("DxTooltip",{class:"button-info-tooltip button-info-tooltip_".concat(t.getActiveTheme),attrs:{target:t.targetMouseEnter,visible:t.tooltip,position:"top",container:".chart-wrapper-chartContainer"}},[t._v(t._s(t.$t("openOrder")))]),e("div",{class:"button-info__text button-info__text_".concat(t.getActiveTheme),on:{mouseover:t.toggleBtns}},[t._t("default")],2),t.priceQuote.bid&&"compact"!==t.mode?e("div",{class:"button-info__value button-info__value_".concat(t.getActiveTheme)},[t.priceQuote.bid?e("div",{class:"button-info__value-row ".concat(t.priceQuote.profit?"button-info__value_".concat(t.getActiveTheme,"--profit"):"button-info__value_".concat(t.getActiveTheme,"--noprofit"))},[e("svgIcon",{attrs:{name:t.priceQuote.profit?"Arrow-micro-top":"Arrow-micro-bottom",size:13}}),e("span",[t._v(t._s(t.priceQuote.bid)+" ")])],1):t._e(),"quote"===t.mode&&t.priceQuote.bid?e("div",{class:"button-info__value-bottom button-info__value-bottom-".concat(t.getActiveTheme," button-info__value-bottom-").concat(t.getActiveTheme,"--").concat(t.getPips>0?"profit":"noprofit")},[t._v(t._s(t.getPercent)+"% ("+t._s(t.getPips)+")")]):t._e(),"averPrice"===t.mode&&t.getTrend?e("div",{class:"button-info__value-bottom button-info__value-bottom-".concat(t.getActiveTheme," button-info__value-bottom-").concat(t.getActiveTheme,"--").concat(t.getTrend.buy>t.getTrend.sell?"profit":"noprofit")},[e("div",{staticClass:"button-info__value-trendIcon"},[e("div",{class:"button-info-trendIcon_block button-info-trendIcon_block-".concat(t.getActiveTheme," button-info-trendIcon_block-").concat(t.getActiveTheme,"--").concat(t.getTrend.sell>t.getTrend.buy?"sell":"buy")},[t._v(t._s(t.getTrend.sell>t.getTrend.buy?"SELL":"BUY"))])]),e("span",{class:"button-info-trendIcon_block button-info-trendIcon_block-".concat(t.getActiveTheme," button-info-trendIcon_block-").concat(t.getActiveTheme,"--").concat(t.getTrend.sell>t.getTrend.buy?"sell":"buy")},[t._v(t._s(t.getTrend.sell>t.getTrend.buy?t.getTrend.averPriceSell:t.getTrend.averPriceBuy)+" ")])]):t._e()]):t._e()],1),t.selectedStatus?e("div",{class:"button-info__activeIndicator button-info__activeIndicator_".concat(t.getActiveTheme)}):t._e(),t.showBtns?e("DxPopup",{attrs:{visible:t.showBtns,container:t.containerForGroupButtons,elementAttr:{class:"button-info__btns button-info__btns_".concat(t.getActiveTheme)},shading:!1,position:t.positionForPopupDealWidget,width:"auto",height:"32px",showTitle:!1,contentTemplate:"groupButton"},scopedSlots:t._u([{key:"groupButton",fn:function(){return[e("GroupButtonForButtonInfo",{attrs:{container:t.containerForGroupButtons,userStatus:t.userStatus,setId:t.setId,dataBtn:t.dataBtn,hasOrders:!!t.getTrend},on:{setNewOptionsForGuestProfile:t.setNewOptionsForGuestProfile,openOrdersPanel:t.openOrdersPanel,openNewPendingOrder:t.createPendingOrder,openNewOrder:t.openNewOrder}})]},proxy:!0}],null,!1,2703981199)}):t._e()],1)},Grt=[],qrt=function(){var t=this,e=t._self._c;return t.showGroupButtons?e("div",{class:"groupButtonForButtonInfo groupButtonForButtonInfo_".concat(t.getActiveTheme)},[t._l(t.getButtonsSet,(function(i,o){return i.status?e(i.component,{key:o,tag:"component",attrs:{icon:t.iconPath(i.icon),elementAttr:{class:"groupButtonForButtonInfo-buttonItem groupButtonForButtonInfo-buttonItem_".concat(t.getActiveTheme," ").concat(o===t.getButtonsSet.length-1?"groupButtonForButtonInfo-buttonItem_".concat(t.getActiveTheme,"--last"):"")},disabled:i.disabled},on:{click:function(e){return t.eventButtonHendler(e,i.hendler)}}}):t._e()})),t._l(t.getDropDownsComponents,(function(i,o){return e(i.component,{key:o+"dd",tag:"component",attrs:{elementAttr:i.elementAttr,position:i.position,content:i.content,size:i.size,defaultSelected:i.defaultSelected},on:{clickIcon:function(e){return t.selectNewOptionForQuote(e,i.type)}}})}))],2):t._e()},zrt=[],Yrt=function(){var t=this,e=t._self._c;return e("DxSelectBox",{staticClass:"dropDownSelectIcon",attrs:{openOnFieldClick:!0,elementAttr:t.elementAttr,width:"size.width",height:"size.height",stylingMode:"underlined",items:t.content.items,value:t.content.items.find((function(e){return e[t.content.keyOptions]===t.defaultSelected})),"field-template":"field","item-template":"item","drop-down-button-template":"iconDropDown",dropDownOptions:t.getDropDownSet,hoverStateEnabled:!1,focusStateEnabled:!1},on:{itemClick:t.selectNewOptionForQuote},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{class:"dropDownSelectIcon__field dropDownSelectIcon__field_".concat(t.getActiveTheme),style:{width:t.size.width,height:t.size.height}},[e("DxTextBox",{attrs:{visible:!1,width:"0px","read-only":!0}}),o?e("svgIcon",{attrs:{name:o.iconName}}):t._e()],1)]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{class:"dropDownSelectIcon__listItems dropDownSelectIcon__listItems_".concat(t.getActiveTheme," ").concat(o[t.content.keyOptions]===t.defaultSelected?"dropDownSelectIcon__listItems_".concat(t.getActiveTheme,"-active"):"")},[e("div",{class:"dropDownSelectIcon__listItems-icon dropDownSelectIcon__listItems_".concat(t.getActiveTheme,"-icon")},[o?e("svgIcon",{attrs:{name:o.iconName}}):t._e()],1),o?e("div",{class:"dropDownSelectIcon__listItems-text dropDownSelectIcon__listItems_".concat(t.getActiveTheme,"-text")},[t._v(t._s(t.$t(o.text)))]):t._e()])]}},{key:"iconDropDown",fn:function(t){t.data;return[e("div",{staticClass:"dropDownSelectIcon__button"})]}}])})},Xrt=[],Qrt={components:{DxSelectBox:Io["DxSelectBox"],DxTextBox:sc["DxTextBox"],svgIcon:L},props:{elementAttr:{},defaultSelected:{},content:{type:Object},position:{default:function(){return{my:"top center",at:"bottom center",offset:{x:0,y:5},of:window}}},size:{type:Object,default:function(){return{width:"3.2rem",height:"3.2rem"}}},button:{type:Object},field:{type:Object},iconDropDown:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getDropDownSet:function(){return{width:this.content.width,container:this.content.container,position:{my:this.position.my,at:this.position.at,of:this.position.of,offset:this.position.offset}}}}),methods:{selectNewOptionForQuote:function(t){this.$emit("clickIcon",t.itemData)}}},Jrt=Qrt,Krt=(i("729e"),Object(C["a"])(Jrt,Yrt,Xrt,!1,null,null,null)),Zrt=Krt.exports,tat={components:{DxButton:cc.a,DropDownSelectIcon:Zrt,DxSelectBox:Io["DxSelectBox"],DxTextBox:sc["DxTextBox"]},props:{dataBtn:{type:Object},container:{type:String,default:".chart-trading-top-bar__right"},setId:{type:String},userStatus:{type:Object},hasOrders:{type:Boolean,default:!1}},data:function(){return{timeFrames:ES,chartTypes:US,showGroupButtons:!0}},watch:{getActiveTheme:function(){var t=this;this.showGroupButtons=!1,this.$nextTick((function(){t.showGroupButtons=!0}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getOrdersPanel:"modal/getOrdersPanel",getContracts:"contracts/getContracts",getUsingAccountContracts:"contracts/getUsingAccountContracts",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCryptoStatus:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.dataBtn.symbol})).executionGroup;return"Crypto"===e},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getActiveTimeFrame:function(){return this.dataBtn.timeFrame},getActiveChartType:function(){return this.dataBtn.chartType},getStatByContract:function(){var t=this;if(this.getUsingAccountContracts){var e=JSON.parse(sessionStorage.getItem("statContract".concat(this.dataBtn.symbol))),i=this.getUsingAccountContracts.some((function(e){return e===t.dataBtn.symbol}));return e&&e.length&&i}},getDropDownSetTimeFrame:function(){return{width:"120px",container:this.container,position:{my:"top center",at:"bottom center",of:".groupButtonForButtonInfo-dropDown",offset:{x:0,y:0}},items:this.timeFrames,keyOptions:"timeFrame"}},getDropDownSetChartType:function(){return{width:"196px",container:this.container,position:{my:"top center",at:"bottom center",of:".groupButtonForButtonInfo-dropDown",offset:{x:0,y:0}},items:this.chartTypes,keyOptions:"type"}},getDropDownsComponents:function(){return[{component:"DropDownSelectIcon",type:"timeFrame",content:this.getDropDownSetTimeFrame,position:this.getDropDownSetTimeFrame.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:this.getActiveTimeFrame},{component:"DropDownSelectIcon",type:"chartType",content:this.getDropDownSetChartType,position:this.getDropDownSetChartType.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:this.getActiveChartType}]},getButtonsSet:function(){if(this.userStatus)return[{component:"DxButton",icon:"holow-pig",hendler:"openPigForContract",disabled:!1,status:this.getStatByContract},{component:"DxButton",icon:"Trading-open-new-order",hendler:"openModalNewOrder",disabled:!1,status:"owner"===this.userStatus.status},{component:"DxButton",icon:"Limitorder",hendler:"openModalNewPendingOrder",disabled:!1,status:"owner"===this.userStatus.status},{component:"DxButton",icon:"ordersWidget",hendler:"openOrdersWidget",disabled:!this.hasOrders,status:!0}]}}),methods:{iconPath:function(t){var e=i("8a78");return''.concat(this.$t("trades_open"),' \n \n ').concat(this.allOrdersEmptyState||0," ").concat(this.maxOpenPositionsPortfolio?" / "+this.maxOpenPositionsPortfolio:"","\n "),tooltip:this.$t("otota")},{content:''.concat(this.$t("volume"),", ").concat(this.getCryptoStatus?"coins":"$",' \n \n ').concat(this.volumeEmptyState," \n "),tooltip:this.$t("tvoot")},{content:'P/L, % \n \n ').concat(this.plPercentEmpty?this.plPercentEmpty.toFixed(2):0,"\n "),tooltip:this.$t("ctfroopipt")},{content:'P/L, '.concat(this.getCurrencyChar,' \n \n ').concat(this.profitResultEmpty?this.$moneyf(this.profitResultEmpty,2):0,"\n "),tooltip:this.$t("ctfroopiuni")}];return t}}})},Tct={computed:{allOrders:function(){return this.calcAllOrders.reduce((function(t,e){return e+t}),0)},allOrdersFormatted:function(){return'\n \n '.concat(this.allOrders," ").concat(this.maxOpenPositionsPortfolio&&"open"===this.position?" / "+this.maxOpenPositionsPortfolio:"","\n ")},volume:function(){var t=this.calcVolume.reduce((function(t,e){return t+e}),0);"closed"!==this.position||this.dataClosedPosition.length||(t=0),["open",-1].includes(this.position)&&!this.dataOpenPosition.length&&(t=0);var e=t.toLocaleString("ru-RU");return'Объем, '.concat(this.getCryptoStatus?"coins":"$",' \n \n ').concat(e," \n ")},plPercent:function(){var t=this.calcPlPercent,e=t>=0?"green":"red";return'P/L, %\n ').concat(t.toFixed(2),"")},profitResult:function(){return this.calcProfitResult.reduce((function(t,e){return e+t}),0)},profitResultFormatted:function(){var t=this.profitResult>=0?"green":"red";return"P/L, ".concat(this.getCurrencyChar,'\n ').concat(this.profitResult.toFixed(2),"")},sFClosedFormatted:function(){var t=this.calcSfClosed.reduce((function(t,e){return t+e}),0);return'$ '.concat(Lm(t,2,!0),"")},profitByCopyClosed:function(){var t=this.calcMyProfitClosed.reduce((function(t,e){return t+e}),0);return''.concat(Lm(t,2,!0),"")},sFOpenFormatted:function(){var t=this.calcSfOpen.reduce((function(t,e){return t+e}),0);return'$ '.concat(Lm(t,2,!0),"")},myProfitByCopyOpen:function(){var t=this.calcMyProfitOpen.reduce((function(t,e){return t+e}),0),e=t>=0?"green":"red";return'').concat(Lm(t,2,!0),"")},openCells:function(){var t=[null,{content:this.allOrdersFormatted,tooltip:this.$t("otota")},{content:this.volume,tooltip:this.$t("tvoot")},{content:this.plPercent,tooltip:this.$t("ctfroopipt")},{content:this.profitResultFormatted,tooltip:this.$t("ctfroopiuni")}];return t},orderSuccess:function(){var t=this.calcOrderSuccess.reduce((function(t,e){return e+t}),0),e=t>=0?"green":"red",i=100*t/this.allOrders;return'').concat(t," (").concat(i?Lm(i,1,!0):0,"%)")},closedCells:function(){var t=[null,{content:this.allOrdersFormatted,tooltip:this.$t("ctota")},{content:this.orderSuccess,tooltip:this.$t("csdpostfct")},{content:this.volume,tooltip:this.$t("voctota")},{content:this.plPercent,tooltip:this.$t("cfrocpi")},{content:this.profitResultFormatted,tooltip:this.$t("cfrocpiudni")}];return[].concat(t,[null])}}},xct={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({subscriberCopy:"subscriptionsContract/subscriberCopy"})),{},{profitForProfitCells:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.profit}),0):0},myProfitForProfitCells:function(){var t=this;if(!this.allDataProfit||!this.subscriberCopy)return 0;var e=0;return this.subscriberCopy.forEach((function(i){var o=t.allDataProfit.find((function(t){return t.subscriptionId===i.id})),n=o.closedProfit;"Money"===i.priceType?e+=i.price:n&&n>0&&(e+=n*i.price/100)})),{value:"".concat(Lm(e,2,!0)),dopClass:e<0?"red":"green"}},countSubscriber:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.count}),0):0},investVolume:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.invest}),0):0},capitalTurnover:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.volume}),0):0},myCapitalTurnover:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.myVolume}),0):0},profitCells:function(){return[null,{content:''.concat(this.countSubscriber,""),tooltip:this.$t("scys")},{content:"$ ".concat(Lm(this.investVolume,2,!0),""),tooltip:this.$t("aomtswraaci")},{content:"$ ".concat(Lm(this.profitForProfitCells,2,!0),""),tooltip:this.$t("cpfys")},{content:"$ ").concat(this.myProfitForProfitCells.value,""),tooltip:this.$t("ynifcticoaf")},{content:"\n $ ".concat(Lm(this.capitalTurnover,2,!0),"\n / $ ").concat(Lm(this.myCapitalTurnover,2,!0),"\n "),tooltip:this.$t("turnover_of_capital")}]}})},Oct={name:"CommonCalcData",mixins:[xt,Sct,Pct,Tct,xct],props:{position:{type:[String,Boolean,Number]},userProfile:{type:Boolean},calcOrderSuccess:{type:Array},calcPips:{type:Array},calcPlPercent:{type:[Number,Boolean]},calcProfitResult:{type:Array},calcAllOrders:{type:Array},calcProfitByCopy:{type:Array},calcProfitBySF:{type:Array},calcVolume:{type:Array},calcSfClosed:{type:Array},calcMyProfitClosed:{type:Array},calcSfOpen:{type:Array},calcMyProfitOpen:{type:Array},location:{type:String},isProvider:{type:Boolean},dataOpenPosition:{type:Array},dataClosedPosition:{type:Array},quotes:{type:Object},allSymbols:{type:Array},arrSubIds:{type:Array},dataProfit:{type:Array,default:function(){return[]}},allDataProfit:{type:[Array,Boolean]},investPortfolio:{type:Boolean,default:!1}},components:{Cell:bct},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTab:"expertsPortfolio/getActiveTab",allSubscription:"subscriptionsContract/allSubscriptionCurrentDate",getDefaultAccount:"subscribeOrders/getDefaultAccount",findPortfolio:"expertsPortfolio/findPortfolio"})),{},{noData:function(){var t;return!("closed"!==this.position||null!==(t=this.dataClosedPosition)&&void 0!==t&&t.length)||["open",-1].includes(this.position)&&!this.dataOpenPosition.length},getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},subscriptionCurrentPortfolio:function(){var t,e=this;return!(!this.investPortfolio||"Active"!==(null===(t=this.findPortfolio)||void 0===t?void 0:t.status))&&this.allSubscription.find((function(t){return t.subscription.bagId===e.getActiveTab}))},maxOpenPositionsPortfolio:function(){return!(!this.subscriptionCurrentPortfolio||this.noData)&&this.subscriptionCurrentPortfolio.subscription.maxOpenPositions*this.findPortfolio.sources.length},countCell:function(){return"open"===this.position?this.openCells:"closed"===this.position?this.closedCells:"profit"===this.position?this.profitCells:this.cellsForEmptyState},widthCell:function(){return this.countCell?100/this.countCell.length:0},moneyPrice:function(){return Boolean(this.investPortfolio&&"Money"===this.findPortfolio.bagContents[0].priceType)}})},wct=Oct,_ct=(i("089e"),Object(C["a"])(wct,pct,gct,!1,null,"e6a392a8",null)),Act=_ct.exports,Dct=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TabsPanel",class:t.darkClass},[t._l(t.tabs,(function(i,o){return e("div",{key:o,staticClass:"containerPanel",class:"containerPanel".concat(o),style:t.styleContainer},t._l(i,(function(i,n){return e("div",{key:n,staticClass:"wrapButton",on:{mouseenter:function(e){return t.viewTooltipHandler(e,i.tooltipText,i.tooltipClass)},mouseleave:t.hideTooltip}},[e("ButtonTab",{attrs:{tab:i,index:0===o?n:t.tabs[o-1].length+n,activeButton:t.activeButton,buttonClickHandler:t.buttonClickHandler},scopedSlots:t._u([{key:i.buttonTemplate,fn:function(e){return[t._t(i.buttonTemplate,null,{data:e.data})]}}],null,!0)})],1)})),0)})),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.tooltipPosition||t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttrTabs}},[e("div",{domProps:{innerHTML:t._s(t.hintTextButton)}})])],2)},kct=[],Ict=function(){var t=this,e=t._self._c;return e("button",{class:t.rootClass,style:t.styleButton,on:{click:function(e){return t.buttonClickHandler(t.index,t.tab)}}},[t._t(t.tab.buttonTemplate,(function(){return[t.tab.icon?e("svgIcon",{attrs:{name:t.tab.icon,color:t.colorIcon}}):t._e(),t.tab.title?e("span",{class:{marg:t.tab.icon}},[t._v(t._s(t.tab.title))]):t._e()]}),{data:t.tab})],2)},Bct=[],Mct={name:"ButtonTab",mixins:[xt],props:{index:{type:Number},tab:{type:Object,default:function(){return{}}},activeButton:{type:Number},buttonClickHandler:{type:Function}},computed:{rootClass:function(){var t=this.tab.dopClass||"";return[t,Object(c["a"])({active:this.activeButton===this.index},this.darkClass)]},styleButton:function(){return{"--width":this.tab.width}},colorIcon:function(){return this.darkClass.dark?this.activeButton===this.index?"#fff":"#bbcee0":this.activeButton===this.index?"#fff":"#8c8c8c"}}},$ct=Mct,Lct=(i("7b03"),Object(C["a"])($ct,Ict,Bct,!1,null,"0db1a834",null)),Fct=Lct.exports,jct={name:"TabsPanel",mixins:[xt,Ot],props:{tabs:{type:Array},height:{type:Number,default:32},pressBack:{type:Boolean,default:!1},selectedTabWatch:{type:[Number,Boolean],default:null},active:{type:Number},tooltipPosition:{type:[Boolean,Object]}},components:{ButtonTab:Fct},data:function(){var t;return{dopClass:"",activeButton:null!==(t=this.active)&&void 0!==t?t:-1,hintTextButton:""}},computed:{styleContainer:function(){return{"--height":this.height+"px"}},wrapperAttrTabs:function(){return Object(c["a"])(Object(c["a"])({},this.wrapperAttr),{},{class:"".concat(this.wrapperAttr.class," ").concat(this.dopClass)})}},watch:{selectedTabWatch:function(t){this.activeButton=t}},methods:{buttonClickHandler:function(t,e){if(this.activeButton===t&&this.pressBack)return this.activeButton=-1,void this.$emit("tabClick",{itemIndex:-1,tabData:e});this.activeButton=t,this.$emit("tabClick",{itemIndex:t,tabData:e})},viewTooltipHandler:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e&&(this.dopClass=i,this.hintTextButton=e,this.viewTooltip(t))}}},Rct=jct,Wct=(i("fb83"),Object(C["a"])(Rct,Dct,kct,!1,null,"c518f10c",null)),Nct=Wct.exports,Ect=function(){var t=this,e=t._self._c;return e("div",{ref:"container",staticClass:"ContainerWihData",class:t.dopClass,style:t.rootStyle},[e("transition",{attrs:{name:"fade"}},[-1!==t.activeTab?e("div",{staticClass:"touchButton",on:{pointerdown:t.pointerdownHandler}},[e("svgIcon",t._b({},"svgIcon",t.touchButtonIcon,!1))],1):t._e()]),e("transition",{attrs:{name:"fade"}},[-1!==t.activeTab?e("div",{staticClass:"upDownButton",class:t.classUpDownButton,on:{click:t.upDownClickHandler}},[e("svgIcon",t._b({},"svgIcon",t.upDownButtonIcon,!1))],1):t._e()]),e("transition",{attrs:{name:t.transitionName}},[e(t.activeComponent,t._b({ref:"childTable",tag:"component",attrs:{activeTab:t.activeTab},on:{setCurrentHeight:t.setCurrentHeight,setHeightAccordion:t.setHeightAccordion}},"component",t.propsForActiveComponent[t.activeComponent],!1))],1)],1)},Uct=[],Vct=function(){var t=this,e=t._self._c;return e("div",{ref:"table",staticClass:"OpenPosition"},[t.accordionData.length>0?e("AccordionForTable",{attrs:{dataTable:t.accordionData,emitFunction:t.emitFunction,activeTab:t.activeTab,typeOrders:"open",columns:t.columns,arrSubIds:t.arrSubIds,userProfile:t.userProfile,isProvider:t.isProvider,location:t.location,press:t.press,maxHeight:t.maxHeight,closePosition:t.closePosition,loadRow:t.loadRow,investPortfolio:t.investPortfolio},on:{setHeightAccordion:function(e){return t.$emit("setHeightAccordion",e)}}}):e("TableColumnsCustom",{attrs:{dataTable:t.accordionData,columns:t.columns,resizeEnabled:!1,heightRow:24}})],1)},Hct=[],Gct=function(){var t=this,e=t._self._c;return e("VuePerfectScrollbar",{staticClass:"AccordionForTable",style:{height:t.getCheckScroll?"".concat(t.maxHeight,"px"):"auto"}},[t.rowCommonData?e("RowCommonData",{attrs:{position:t.activeTab,rowCommonData:t.rowCommonData,currencyChar:t.getCurrencyChar,cryptoStatus:t.getCryptoStatus,location:t.location,userProfile:t.userProfile,isProvider:t.isProvider,signalCount:t.dataAccordion.length}}):t._e(),e("transition-group",{attrs:{name:"list",tag:"div"}},t._l(t.dataAccordion,(function(i,o){return e("div",{key:i[0],staticClass:"sectionAccordion"},[e("div",{staticClass:"titlePart",on:{click:function(e){return t.clickHandler(e,o)}}},[e("RowDataAccordion",{attrs:{currencyChar:t.getCurrencyChar,cryptoStatus:t.getCryptoStatus,position:t.activeTab,data:i,userProfile:t.userProfile,location:t.location,isProvider:t.isProvider,arrSubIds:t.arrSubIds,index:o,investPortfolio:t.investPortfolio,lengthContract:t.dataAccordion.length},on:{orderSuccess:t.setOrderSuccess,pips:t.setPips,profitResult:t.setProfitResult,volume:t.setVolume,allOrders:t.setAllOrders,profitByCopy:t.setProfitByCopy,profitBySF:t.setProfitBySF,sfClosed:t.setSfClosed,myProfitClosed:t.setMyProfitClosed,sfOpen:t.setSfOpen,myProfitOpen:t.setMyProfitOpen}})],1),t.activeElement===i[0]?e("div",{staticClass:"contentPart"},[e("TableComponent",{attrs:{dataTable:i[1],getColumns:t.getColumns,arrSubIds:t.arrSubIds,openMenu:t.openMenu,openSettingsModal:t.openSettingsModal,press:t.press,maxHeight:t.maxHeight,emitFunction:t.emitFunction,closePosition:t.closePosition,loadRow:t.loadRow,activeElement:t.activeElement,contractName:i[0],investPortfolio:t.investPortfolio}})],1):t._e()])})),0),e("PopupFilterAndSortCell",{attrs:{popupVisible:t.popupVisible,tableColumns:t.managedColumns,positionPopupFilter:t.positionPopupFilter,target:t.target},on:{hidden:t.closePopup,drop:t.onDrop,checkBoxHandler:t.checkBoxHandler}})],1)},qct=[],zct=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RowDataAccordion",class:t.darkClass},[t._l(t.countCell,(function(i,o){return e("Cell",{key:o,attrs:{cellData:i,position:t.position,widthCell:t.widthCell,lengthCell:t.countCell.length,lastCell:o===t.countCell.length-1,openModalGraph:t.openModalGraph}})})),t.statusChartWidget?e("ChartCurrentProfitContract",{attrs:{visible:t.statusChartWidget,mode:"closed",symbol:t.data[0],offset:{x:0,y:0},position:t.positionPopupGraph,hideOnOutsideClick:!0,dataOrder:t.data[1],profitResult:t.profitResult},on:{close:t.closeModalGraph}}):t._e()],2)},Yct=[],Xct=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Cell",class:t.rootClass,style:t.styleRoot},[e("div",{staticClass:"contentCell",domProps:{innerHTML:t._s(t.cellData)}})])},Qct=[],Jct={name:"Cell",mixins:[xt],props:{cellData:{type:[String,Number]},widthCell:{type:Number},position:{type:[String,Number]},lengthCell:{type:Number},openModalGraph:{type:Function},lastCell:{type:Boolean},dataOrder:{type:Array}},components:{DxButton:cc.a},computed:{rootClass:function(){return Object(c["a"])({lastCell:this.lastCell,closed:"closedd"===this.position},this.darkClass)},styleRoot:function(){return{"--width":this.widthCell+"%","--lengthCell":this.lengthCell}}},methods:{clickHandlerGraph:function(t){t.event.stopPropagation(),this.openModalGraph(t.event)}}},Kct=Jct,Zct=(i("ed2b0"),Object(C["a"])(Kct,Xct,Qct,!1,null,"688a8232",null)),tlt=Zct.exports,elt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chartContractWidget"},[e("DxPopup",{attrs:{visible:t.visible,shading:!1,showCloseButton:!1,width:t.getWidth,onResize:t.onResizeEnd,minWidth:350,resizeEnabled:!0,height:350,minHeight:250,onShown:t.onShown,container:".grid",position:t.getPosition},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"chartContractWidget-title chartContractWidget-title_".concat(t.getActiveTheme)},[e("div",{class:"chartContractWidget-title-text"},[t._v(t._s(t.getTitle))]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.size>=400,expression:"size >= 400"}],staticClass:"chartContractWidget-title-statWrap"},[t.sellOrdersCount?e("div",{staticClass:"chartContractWidget-title-typeOrders",style:{color:t.getNegativeColorOrder.color}},[t._v("Sell("+t._s(t.sellOrdersCount)+")")]):t._e(),t.buyOrdersCount?e("div",{staticClass:"chartContractWidget-title-typeOrders",style:{color:t.getPositiveColorOrder.color}},[t._v("Buy("+t._s(t.buyOrdersCount)+")")]):t._e(),t.profit?e("div",{staticClass:"chartContractWidget-title-typeOrders",style:{color:t.profit<0?t.getNegativeColorOrder.color:t.getPositiveColorOrder.color}},[t._v("$ "+t._s(t.$moneyf(t.profit,2)))]):t._e(),t.volume?e("div",{staticClass:"chartContractWidget-title-typeOrders",style:{color:t.profit<0?t.getNegativeColorOrder.color:t.getPositiveColorOrder.color}},[t._v("% "+t._s(t.$moneyf(100*t.profit/t.volume,2)))]):t._e()]),e("div",{staticClass:"chartContractWidget-title-close",on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{class:"chartContractWidget-content chartContractWidget-content_".concat(t.getActiveTheme)},[t.points&&t.showPopup&&!t.warnMessage?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.metaInfoForLines,maxIndicator:{lines:[0]},minIndicator:{lines:[0]}}}):e("DxLoadIndicator",{staticClass:"loadingIndicator",attrs:{height:80,width:80}})],1)]},proxy:!0}])})],1)},ilt=[],olt={props:{visible:{type:Boolean,default:!1},offset:{type:[Number,Object],default:8},container:{type:String},symbol:{type:String,default:"EURUSD"},position:{type:[Object,Boolean]},hideOnOutsideClick:{type:Boolean,default:!1},mode:{type:String,default:"open"},dataOrder:{type:Array,default:function(){return[]}},profitResult:{type:[Number,Boolean]}},mixins:[TM,xM,MV,qe],components:{DxPopup:To["DxPopup"],ChartWrapper:pM,LineEventChart:Uk,DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{volume:0,profit:0,size:450,sellOrdersCount:0,buyOrdersCount:0,contractStat:null,accountId:null,warnMessage:"",showPopup:!1,chartCanvas:null,xAxisCanvas:null,yAxisCanvas:null,xPoints:[],xServiceObject:null,points:null,metaInfoForLines:null}},watch:{getActiveTheme:function(){this.warnMessage||this.initDataForDraw()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatData:"statDataForPortfolio/getStatData"})),{},{getWidth:function(){return"closed"===this.mode?550:450},getTitle:function(){return"closed"===this.mode?"".concat(this.$t("ioctr")," ").concat(this.symbol):"".concat(this.$t("current_income")," ").concat(this.symbol)},getPositiveColorOrder:function(){return"dark"===this.getActiveTheme?{color:"#00ffac",fill:"rgba(0, 255, 172, 0.3)"}:{color:"#008e72",fill:"rgba(0, 142, 114, 0.3)"}},getNegativeColorOrder:function(){return"dark"===this.getActiveTheme?{color:"#ff4444",fill:"rgba(255, 68, 68, 0.3)"}:{color:"#e91213",fill:"rgba(233, 18, 19, 0.3)"}},getPosition:function(){return this.position?this.position:{my:"left top",at:"left top",of:this.container,offset:this.offset}}}),methods:{onResizeEnd:function(t){this.size=t.width},closePopup:function(){this.$emit("close")},onShown:function(){var t=this;setTimeout((function(){t.showPopup=!0}),400)},setActualStatForContract:function(){if(this.contractStat.length>1)if(0!==this.contractStat.at(-1)[1]){var t;this.contractStat=this.contractStat.slice(-20);for(var e=this.contractStat.length-1;e>0;e--)if(0===this.contractStat[e][1]){t=e;break}t&&(this.contractStat=this.contractStat.slice(t))}else this.warnMessage=this.$t("tanot");else this.contractStat=JSON.parse(sessionStorage.getItem("statContractByHours".concat(this.symbol))),this.contractStat.length<2&&(this.warnMessage=this.$t("nedfs"))},setMessageHendler:function(t){if("AccountsDetails"===(null===t||void 0===t?void 0:t.command))this.accountId===this.getDefaultAccount.id&&this.contractStat&&this.contractStat.length&&("open"===this.mode&&this.setActualStatForContract(),this.setFloatingProfit(t.data),this.setPointsForChart());else if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.contractStat=e.data.map((function(t){return[t.contract,t.floatingProfitClose,t.floatingProfitOpen,t.date,t.profitClose,t.profitOpen,t.forecast,t.volumeClose,t.volumeOpen,t.usedVolume,t.equity,t.pClosedCount,t.closedCount]}))}},setPointsForChatInvesting:function(){var t=this,e=[],i={},o=this.getStatData.myStat.filter((function(e){return e.symbol===t.symbol}));o=o.map((function(t){return t.data})).flat(),o.forEach((function(t){if(2===t[21]){var e=new Date(t[1]).getTime();i[e]||(i[e]=[]),i[e].push(t[6])}}));var n=Object.entries(i).sort((function(t,e){return t[0]-e[0]}));n.forEach((function(i,o,n){var s=n.length-1===o?t.profitResult:i[1].reduce((function(t,e){return t+e}),0);e.push({x:o,y:s,date:+i[0]})})),this.metaInfoForLines=[{type:"line",color:e.at(-1).y<0?this.getRedColor.color:this.getGreenColor.color,fill:e.at(-1).y<0?this.getRedColor.fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средняя по Средствам"}],this.points=[e]},setPointsForChart:function(){var t=this,e=[];this.contractStat.forEach((function(i,o){e.push({x:o,y:"closed"===t.mode&&o===t.contractStat.length-1?t.profit:i["closed"===t.mode?4:1],date:i[3]})})),this.metaInfoForLines=[{type:"line",color:e.at(-1).y<0?this.getRedColor.color:this.getGreenColor.color,fill:e.at(-1).y<0?this.getRedColor.fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средняя по Средствам"}],this.points=[e]},setFloatingProfit:function(t){var e=this,i=t.find((function(t){return t.account.id===e.accountId}));if(i){var o=i.openOrders.tradingOrders;o.length&&(this.setStatByOrders(o),this.initDataForDraw())}},setStatByOrders:function(t){var e=this;if("closed"===this.mode)return this.sellOrdersCount=this.dataOrder.filter((function(t){return"Sell"===t.orderType})).length,this.buyOrdersCount=this.dataOrder.filter((function(t){return"Buy"===t.orderType})).length,this.profit=this.dataOrder.reduce((function(t,e){return t+e.profit}),0),void(this.volume=this.dataOrder.reduce((function(t,e){return t+e.volume}),0));var i=t.filter((function(t){return t.instrumentName===e.symbol}));i.length&&(this.sellOrdersCount=i.filter((function(t){return"Sell"===t.orderType})).length,this.buyOrdersCount=i.filter((function(t){return"Buy"===t.orderType})).length,this.profit=i.reduce((function(t,e){return t+e.profit}),0),this.volume=i.reduce((function(t,e){return t+e.volume}),0),this.contractStat&&(this.contractStat.at(-1)[1]=this.profit))},getCanvasesObjects:function(t){this.chartCanvas=t.chartCanvas,this.xAxisCanvas=t.xAxisCanvas,this.yAxisCanvas=t.yAxisCanvas,this.initDataForDraw()},initDataForDraw:function(){this.chartCanvas&&this.yAxisCanvas&&this.xAxisCanvas&&(this.chartCanvas.clearCanvas(),this.yAxisCanvas.clearCanvas(),this.xAxisCanvas.clearCanvas(),this.setXData(),this.setYData(),this.drawGrid(),this.drawChart())},setXData:function(){this.xPoints=[],this.xPoints=this.contractStat.map((function(t){return new Date(t[3]).getTime()})),this.xServiceObject=this.chartCanvas.getServiceData(this.xPoints,{maxExpand:9/this.chartCanvas.getSizeCanvas().width*100/100,minExpand:15/this.chartCanvas.canvasObject.getBoundingClientRect().width*100/100},this.chartCanvas.getSizeCanvas().width)},setYData:function(){this.yPoints=this.contractStat.map((function(t){return t[1]})),this.yServiceObject=this.chartCanvas.getServiceData(this.yPoints,{maxExpand:.15,minExpand:.15},this.chartCanvas.getSizeCanvas().height)},drawGrid:function(){var t=50,e=this.getGridParams(this.xServiceObject,t),i=this.getGridParams(this.yServiceObject,t);this.drawXYGrid(!0,e,this.chartCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.drawXYGrid(!0,e,this.xAxisCanvas,this.xServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.xAxisCanvas.canvasObject.getBoundingClientRect().height},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out","date"),this.drawXYGrid(!1,i,this.chartCanvas,this.yServiceObject,{width:this.chartCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.drawXYGrid(!1,i,this.yAxisCanvas,this.yServiceObject,{width:this.yAxisCanvas.canvasObject.getBoundingClientRect().width,height:this.chartCanvas.canvasObject.getBoundingClientRect().height},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out","price")},drawChart:function(){var t=this.contractStat.map((function(t){return[new Date(t[3]).getTime(),t[1]]})),e=t.at(-1)[1];this.drawSplineLine(t,e<0?this.getNegativeColorOrder.color:this.getPositiveColorOrder.color,e<0?this.getNegativeColorOrder.fill:this.getPositiveColorOrder.fill)},drawSplineLine:function(t,e,i){var o=this,n=[],s={width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},r=Math.max.apply(null,t.map((function(t){return t[1]}))),a=t.findIndex((function(t){return t[1]===r})),c=Math.min.apply(null,t.map((function(t){return t[1]}))),l=t.findIndex((function(t){return t[1]===c}));t.forEach((function(t){n.push(o.chartCanvas.mapLogicalToCanvasXCoordinate(o.xServiceObject,s.width,t[0])),n.push(o.chartCanvas.mapLogicalToCanvasYCoordinate(o.yServiceObject,s.height,t[1]))})),this.drawSpline(this.chartCanvas.ctx,n,.3,!0,i,s),this.drawSpline(this.chartCanvas.ctx,n,.3,!1,e,s),this.drawAxisIndicator(n[n.length-1],e,this.chartCanvas.ctx,s);var u=t.at(-1)[1];u!==r&&r>=0&&this.drawLineIndicator({x:this.chartCanvas.mapLogicalToCanvasXCoordinate(this.xServiceObject,this.chartCanvas.getSizeCanvas().width,t[a][0]),y:this.chartCanvas.mapLogicalToCanvasYCoordinate(this.yServiceObject,this.chartCanvas.getSizeCanvas().height,t[a][1])},{x:this.chartCanvas.getSizeCanvas().width,y:this.chartCanvas.mapLogicalToCanvasYCoordinate(this.yServiceObject,this.chartCanvas.getSizeCanvas().height,t[a][1]),l:"$ ".concat(this.$moneyf(r,2))},this.chartCanvas.ctx,this.yAxisCanvas.ctx,this.chartCanvas.getSizeCanvas(),this.yAxisCanvas.getSizeCanvas(),this.getPositiveColorOrder.color,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),u!==c&&c<0&&this.drawLineIndicator({x:this.chartCanvas.mapLogicalToCanvasXCoordinate(this.xServiceObject,this.chartCanvas.getSizeCanvas().width,t[l][0]),y:this.chartCanvas.mapLogicalToCanvasYCoordinate(this.yServiceObject,this.chartCanvas.getSizeCanvas().height,t[l][1])},{x:this.chartCanvas.getSizeCanvas().width,y:this.chartCanvas.mapLogicalToCanvasYCoordinate(this.yServiceObject,this.chartCanvas.getSizeCanvas().height,t[l][1]),l:"$ ".concat(this.$moneyf(c,2))},this.chartCanvas.ctx,this.yAxisCanvas.ctx,this.chartCanvas.getSizeCanvas(),this.yAxisCanvas.getSizeCanvas(),this.getNegativeColorOrder.color,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),this.drawIndicator(n[n.length-1],"$ ".concat(this.$moneyf(u,2)),e,this.yAxisCanvas.ctx,{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},"light"===this.getActiveTheme?"#fff":"#333")},getStatisticByContract:function(){this.$store.commit("contracts/setStatusByContractStat",!1);var t={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:this.getDefaultAccount.id,contracts:[this.symbol]}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})}},mounted:function(){var t;if("Investing"!==(null===(t=this.$route.meta)||void 0===t?void 0:t.componentName)){this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS3",this.setMessageHendler),this.getStatisticByContract();var e=this.$orderStorage.getOrdersOnStorage();e&&(this.accountId=e.accountId,this.setStatByOrders(e.tradingOrders))}else this.setPointsForChatInvesting()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHendler)}},nlt=olt,slt=(i("8825"),Object(C["a"])(nlt,elt,ilt,!1,null,"5337b1e8",null)),rlt=slt.exports,alt={name:"RowDataAccordion",mixins:[xt,Sct],props:{data:{type:Array},currencyChar:{type:String},cryptoStatus:{type:Boolean},position:{type:[String,Number]},userProfile:{type:Boolean},location:{type:String},arrSubIds:{type:Array},index:{type:Number},isProvider:{type:Boolean},investPortfolio:{type:Boolean},lengthContract:{type:Number}},components:{Cell:tlt,ChartCurrentProfitContract:rlt},data:function(){return{positionPopupGraph:{at:"left center",my:"right bottom",offset:{x:0,y:0},of:null},statusChartWidget:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTab:"expertsPortfolio/getActiveTab",getContracts:"contracts/getContracts",allSubscription:"subscriptionsContract/allSubscriptionCurrentDate",findPortfolio:"expertsPortfolio/findPortfolio",fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{subscriptionCurrentPortfolio:function(){var t=this;return!!this.investPortfolio&&this.allSubscription.find((function(e){return e.subscription.bagId===t.getActiveTab}))},maxOpenPositionsPortfolio:function(){var t=this;if(!this.subscriptionCurrentPortfolio)return!1;var e=this.findPortfolio.sources.filter((function(e){return e.contract===t.data[0]}));return this.subscriptionCurrentPortfolio.subscription.maxOpenPositions*e.length},allOrders:function(){return this.data[1].length},allOrdersFormatted:function(){return''.concat(this.allOrders," ").concat(this.maxOpenPositionsPortfolio?"/ "+this.maxOpenPositionsPortfolio:"","")},orderSuccess:function(){if("closed"===this.position)return this.data[1].filter((function(t){return t.profit>=0})).length},orderSuccessFormatted:function(){if(!this.orderSuccess)return'0 (0)%';var t=100*this.orderSuccess/this.allOrders;return''.concat(this.orderSuccess," (").concat(Lm(t,1,!0),"%)")},volume:function(){return this.data[1].reduce((function(t,e){return t+e.volume}),0)},volumeFormatted:function(){return this.volume.toLocaleString("ru-RU")},profitResult:function(){return this.data[1].reduce((function(t,e){return t+e.profit}),0)},profitResultFormatted:function(){var t=this.profitResult>=0?"green":"red";return'').concat(this.profitResult.toFixed(2),"")},plPercent:function(){var t=this.cryptoStatus?this.data[1].reduce((function(t,e){return t+e.volume*e.openPrice}),0):this.data[1].reduce((function(t,e){return t+e.volume}),0);return 100*this.profitResult/t},plPercentFormatted:function(){var t=this.plPercent>=0?"green":"red";return'').concat(this.plPercent.toFixed(2),"")},contract:function(){var t,e;return(null===(t=this.data)||void 0===t?void 0:t.Contract)||(null===(e=this.data.SourceOrder)||void 0===e?void 0:e.Symbol)},getSellOrders:function(){return this.data[1].filter((function(t){return"Sell"===t.orderType}))},getBuyOrders:function(){return this.data[1].filter((function(t){return"Buy"===t.orderType}))},getSumPriceSell:function(){if(this.getSellOrders&&this.getSellOrders.length)return this.getAvaragePrice(this.getSellOrders,"openPrice","volume")},getSumPriceBuy:function(){if(this.getBuyOrders&&this.getBuyOrders.length)return this.getAvaragePrice(this.getBuyOrders,"openPrice","volume")},getPrecision:function(){var t,e=this.data[0].split(".")[0];return null===(t=(this.getContracts||[]).find((function(t){return t.name===e})))||void 0===t?void 0:t.precision},profitByCopy:function(){return this.data[1].reduce((function(t,e){return e.subscriptionId&&e.profit>0?t+e.profit:t}),0)},profitBySF:function(){return this.profitByCopy<=0?0:33*this.profitByCopy/100},arraySf:function(){var t=this;return this.data[1].map((function(e){var i,o,n=e.subscriptionId;if(!n)return 0;var s=t.fullListSubscription.find((function(t){return+t.subscription.id===+n}));if("Money"===(null===s||void 0===s||null===(i=s.subscription)||void 0===i?void 0:i.priceType)||!s)return 0;var r=null===s||void 0===s||null===(o=s.subscription)||void 0===o?void 0:o.price;return e.profit>0?e.profit*r/100:0}))},sfClosed:function(){return this.arraySf.reduce((function(t,e){return t+e}),0)},sfClosedFormatted:function(){return''.concat(Lm(this.sfClosed,2,!0),"")},myProfitClosed:function(){var t=this,e=0;return this.data[1].forEach((function(i,o){e+=i.profit-t.arraySf[o]})),e},myProfitClosedFormatted:function(){var t=this.myProfitClosed>=0?"green":"red";return"").concat(Lm(this.myProfitClosed,2,!0),"")},myProfitOpen:function(){var t=this,e=0;return this.data[1].forEach((function(i,o){e+=i.profit-t.arraySf[o]})),e},myProfitOpenFormatted:function(){var t=this.myProfitOpen>=0?"green":"red";return"").concat(Lm(this.myProfitOpen,2,!0),"")},sfOpen:function(){return this.arraySf.reduce((function(t,e){return t+e}),0)},sfOpenFormatted:function(){return''.concat(Lm(this.sfOpen,2,!0),"")},openCells:function(){var t=[this.data[0],this.allOrdersFormatted,this.volumeFormatted,this.plPercentFormatted,this.profitResultFormatted];return t},closedCells:function(){var t=[this.data[0],this.allOrdersFormatted,this.orderSuccessFormatted,this.volumeFormatted,this.plPercentFormatted,this.profitResultFormatted];return t},countCell:function(){return"open"===this.position?this.openCells:"closed"===this.position?this.closedCells:void 0},widthCell:function(){return this.countCell?100/this.countCell.length:0}}),watch:{profitResult:function(t){this.$emit("profitResult",{val:t,index:this.index})},plPercent:function(t){this.$emit("plPercent",{val:t,index:this.index})},profitBySF:function(t){this.$emit("profitBySF",{val:t,index:this.index})},volume:function(t){this.$emit("volume",{val:t,index:this.index})},allOrders:function(t){this.$emit("allOrders",{val:t,index:this.index})},profitByCopy:function(t){this.$emit("profitByCopy",{val:t,index:this.index})},orderSuccess:function(t){this.$emit("orderSuccess",{val:t,index:this.index})},sfClosed:function(t){this.$emit("sfClosed",{val:t,index:this.index})},myProfitClosed:function(t){this.$emit("myProfitClosed",{val:t,index:this.index})},sfOpen:function(t){this.$emit("sfOpen",{val:t,index:this.index})},myProfitOpen:function(t){this.$emit("myProfitOpen",{val:t,index:this.index})}},mounted:function(){this.emitHandler()},methods:{emitHandler:function(){this.$emit("orderSuccess",{val:this.orderSuccess,index:this.index}),this.$emit("plPercent",{val:this.plPercent,index:this.index}),this.$emit("profitResult",{val:this.profitResult,index:this.index}),this.$emit("allOrders",{val:this.allOrders,index:this.index}),this.$emit("profitByCopy",{val:this.profitByCopy,index:this.index}),this.$emit("profitBySF",{val:this.profitBySF,index:this.index}),this.$emit("volume",{val:this.volume,index:this.index}),this.$emit("sfClosed",{val:this.sfClosed,index:this.index}),this.$emit("myProfitClosed",{val:this.myProfitClosed,index:this.index}),this.$emit("sfOpen",{val:this.sfOpen,index:this.index}),this.$emit("myProfitOpen",{val:this.myProfitOpen,index:this.index})},getAvaragePrice:function(t,e,i){var o=t.reduce((function(t,o){return t+=o[e]*o[i],t}),0),n=t.reduce((function(t,e){return t+=e[i],t}),0);return o/n},closeModalGraph:function(){this.statusChartWidget=!1},openModalGraph:function(t){var e=t.currentTarget;this.positionPopupGraph.of=e,this.statusChartWidget=!0}}},clt=alt,llt=(i("c9a6"),Object(C["a"])(clt,zct,Yct,!1,null,"bfd7b126",null)),ult=llt.exports,dlt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RowCommonData",class:t.darkClass},[t._l(t.rowCommonData,(function(i,o){return e("Cell",{key:o,attrs:{index:o,cellData:i,widthCell:t.widthCell,position:t.position,lengthCell:t.rowCommonData.length,signalCount:t.signalCount,viewTooltip:t.viewTooltip,hideTooltip:t.hideTooltip}})})),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:t.maxWidthTooltip,target:t.selector,position:t.positionLeftCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t.isProvider||"TableCopySubscriber"===t.location?e("ProviderTextTooltip",{attrs:{position:t.position}}):e("UserTextTooltip",{attrs:{position:t.position}})],1)],2)},hlt=[],plt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Cell",class:t.rootClass,style:t.styleRoot},[t.isVisibleTooltip?e("div",{staticClass:"svgWrapper cellRowCommon",style:{overflow:"hidden"},on:{mouseenter:t.viewTooltip,mouseleave:t.hideTooltip}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("FAQ-16"),!1))],1):t._e(),e("span",{domProps:{innerHTML:t._s(t.cellData)}}),t.isVisibleTooltip?e("div",{staticClass:"countInstruments"},[t._v(" ("+t._s(t.countInstruments)+")")]):t._e()])},glt=[],flt={name:"Cell",mixins:[xt],props:{cellData:{type:String},index:{type:Number},viewTooltip:{type:Function},hideTooltip:{type:Function},widthCell:{type:Number},position:{type:[String,Number]},lengthCell:{type:Number},signalCount:{type:Number}},computed:{rootClass:function(){return Object(c["a"])({closed:"closedd"===this.position},this.darkClass)},styleRoot:function(){return{"--width":this.widthCell+"%","--lengthCell":this.lengthCell}},isVisibleTooltip:function(){return 0===this.index},countInstruments:function(){if(0===this.index)return this.signalCount}}},mlt=flt,vlt=(i("096c"),Object(C["a"])(mlt,plt,glt,!1,null,"2ec7400f",null)),ylt=vlt.exports,Clt=function(){var t=this,e=t._self._c;return e("ul",{staticClass:"ProviderTextTooltip"},t._l(t.textData,(function(i){return e("li",{key:i.id},[e("b",[t._v(t._s(i.title)+" ")]),t._v(t._s(i.text))])})),0)},blt=[],Slt={name:"ProviderTextTooltip",props:{position:{type:String}},computed:{textData:function(){return"open"===this.position?[{id:1,title:this.$t("instruments"),text:"- ".concat(this.$t("tiowthbm"))},{id:2,title:this.$t("volume"),text:"- ".concat(this.$t("tvofiiot"))},{id:3,title:"P/L, PIP",text:"- ".concat(this.$t("pfytip"))},{id:4,title:"P/L, %",text:"- ".concat(this.$t("pfyti"))},{id:5,title:"P/L, $",text:"- ".concat(this.$t("pfyti$"))}]:[{id:1,title:this.$t("instruments"),text:"- ".concat(this.$t("tiowthbm"))},{id:3,title:this.$t("volume"),text:"- ".concat(this.$t("tvofiict"))},{id:4,title:"P/L, PIP",text:"- ".concat(this.$t("pfytip"))},{id:5,title:"P/L, %",text:"- ".concat(this.$t("pfyti"))},{id:6,title:"P/L, $",text:"- ".concat(this.$t("pfyti$"))},{id:7,title:this.$t("copied"),text:"- ".concat(this.$t("noswcys"))},{id:8,title:"Прибыль подписчиков, $",text:"- ".concat(this.$t("spfys"))},{id:9,title:"".concat(this.$t("your_income"),", $"),text:"- ".concat(this.$t("ypfcys"))}]}}},Plt=Slt,Tlt=(i("f37a"),Object(C["a"])(Plt,Clt,blt,!1,null,"1524f77a",null)),xlt=Tlt.exports,Olt=function(){var t=this,e=t._self._c;return e("ul",{staticClass:"UserTextTooltip"},t._l(t.textData,(function(i){return e("li",{key:i.id},[e("b",[t._v(t._s(i.title)+" ")]),t._v(t._s(i.text))])})),0)},wlt=[],_lt={name:"UserTextTooltip",props:{position:{type:String}},computed:{textData:function(){return[{id:1,title:this.$t("instruments"),text:"- ".concat(this.$t("tiowthbm"))},{id:2,title:this.$t("volume"),text:"- ".concat(this.$t("tvofiit"))},{id:3,title:"P/L, PIP",text:"- ".concat(this.$t("pfytip"))},{id:4,title:"P/L, %",text:"- ".concat(this.$t("pfyti"))},{id:5,title:"P/L, $",text:"- ".concat(this.$t("pfyti$"))},{id:6,title:"".concat(this.$t("profit_from_copying"),", $"),text:"- ".concat(this.$t("ypftmotbots"))},{id:7,title:this.$t("spfr"),text:"- ".concat(this.$t("atpfcs"))}]}}},Alt=_lt,Dlt=(i("65d8"),Object(C["a"])(Alt,Olt,wlt,!1,null,"239be5d4",null)),klt=Dlt.exports,Ilt={name:"RowCommonData",mixins:[Sct,Ot,xt],props:{rowCommonData:{type:Array},position:{type:String},userProfile:{type:Boolean},location:{type:String},isProvider:{type:Boolean},signalCount:{type:Number}},components:{Cell:ylt,ProviderTextTooltip:xlt,UserTextTooltip:klt},computed:{widthCell:function(){return this.rowCommonData?100/this.rowCommonData.length:0},maxWidthTooltip:function(){return this.isProvider?425:580}}},Blt=Ilt,Mlt=(i("ee67"),Object(C["a"])(Blt,dlt,hlt,!1,null,"09e57370",null)),$lt=Mlt.exports,Llt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TableComponent",style:t.rootStyle},[t.isPagination?e("TablePagination",{attrs:{pageCount:t.pageCount,currentPage:t.currentPage,currentCount:t.count,pageSize:t.pageSize},on:{setPage:t.setPage,setCount:t.setCount}}):t._e(),e("div",{staticClass:"scrollContainer"},[e("TableColumnsCustom",{attrs:{dataTable:t.controlTableData,columns:t.getColumns,resizeEnabled:!0,heightRow:24,pagination:!0,stickyHeader:!0,currentPage:t.currentPage,count:t.count},scopedSlots:t._u([{key:"cellHeader-sort-and-filter",fn:function(i){var o=i.title;return[e("SortAndFilterColumnsTable",{attrs:{openMenu:t.openMenu,title:o}})]}},{key:"cell-openDate",fn:function(t){var i=t.data;return[e("DatePosition",{attrs:{date:i.openDate,fullData:i}})]}},{key:"cell-closedDate",fn:function(t){var i=t.data;return[e("DateClosed",{attrs:{date:i.closedDate}})]}},{key:"cell-orderType",fn:function(t){var i=t.data;return[e("TypePosition",{attrs:{dataOrder:i}})]}},{key:"cell-volume",fn:function(t){var i=t.data;return[e("Volume",{attrs:{dataOrder:i}})]}},{key:"cell-volumeAbs",fn:function(t){var i=t.data;return[e("VolumeAbs",{attrs:{dataOrder:i}})]}},{key:"cell-profit",fn:function(t){var i=t.data;return[e("ProfitPosition",{attrs:{data:i}})]}},{key:"gearWheel-cell-template",fn:function(i){var o=i.data;return[e("SettingButtonTable",{attrs:{dataOrder:o,openSettingsModal:t.openSettingsModal}})]}},{key:"remove-cell-template",fn:function(i){var o=i.data;return[e("CloseOpenOrder",{attrs:{dataOrder:o,closePosition:t.closePosition,loadRow:t.loadRow}})]}},{key:"cell-profit-copy",fn:function(i){var o=i.data;return[e("ProfitCopy",{attrs:{dataOrder:o,arrSubIds:t.arrSubIds}})]}},{key:"cell-pip",fn:function(i){var o=i.data;return[e("Pips",{attrs:{dataOrder:o,quotes:t.quotes}})]}},{key:"cell-userName",fn:function(t){var i=t.data,o=t.indexRow;return[e("UserName",{attrs:{dataOrder:i,indexRow:o}})]}}])})],1)],1)},Flt=[],jlt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TablePagination",class:t.darkClass},[e("div",{staticClass:"pageSize"},t._l(t.pageSize,(function(i){return e("div",{key:i,staticClass:"page",class:{active:i===t.currentCount},on:{click:function(e){return t.pageSizeHandler(i)}}},[t._v(t._s(i))])})),0),t.dataTableLength?e("div",{staticClass:"info"},[t._v("c "+t._s(t.from)+" по "+t._s(t.to)+" из "+t._s(t.dataTableLength))]):t._e(),e("div",{staticClass:"pages"},[e("div",{staticClass:"page",on:{click:function(e){return t.takeStep(-1)}}},[t._v("<")]),t._l(t.allPages,(function(i){return e("div",{key:i,staticClass:"page",class:{active:t.currentPage===i-1,notPointer:!i},on:{click:function(e){return t.buttonHandler(i-1)}}},[t._v(t._s(i||"..."))])})),e("div",{staticClass:"page",on:{click:function(e){return t.takeStep(1)}}},[t._v(">")])],2),t._t("default")],2)},Rlt=[],Wlt={name:"TablePagination",mixins:[xt],props:{pageCount:{type:Number},currentPage:{type:Number,default:0},pageSize:{type:Array},currentCount:{type:Number},dataTableLength:{type:Number}},computed:{allPages:function(){var t=this,e=[],i=Array.from(new Array(this.pageCount)).map((function(t,e){return e+1}));i.forEach((function(i,o,n){0===o||o===n.length-1||o===t.currentPage?e.push(i):ot.currentPage&&o-t.currentPage<4&&e.push(i)}));var o=[];return e.forEach((function(t,e,i){o.push(t),e!==i.length-1&&t+1!==i[e+1]&&o.push(null)})),o},from:function(){if(this.dataTableLength)return this.currentCount*this.currentPage+1},to:function(){if(this.dataTableLength){var t=this.currentCount*this.currentPage+this.currentCount;return tthis.allPages.length-1||this.$emit("setPage",e)},pageSizeHandler:function(t){this.$emit("setCount",t),this.$emit("setPage",0)}}},Nlt=Wlt,Elt=(i("2023"),Object(C["a"])(Nlt,jlt,Rlt,!1,null,"a574ee56",null)),Ult=Elt.exports,Vlt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UserName",class:t.darkClass},[e("img",{staticClass:"userPhoto",attrs:{src:t.srcImage},on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}}),e("div",{staticClass:"nameSection"},[t._v(t._s(t.userName))])])},Hlt=[],Glt={name:"UserName",mixins:[rT,xt],props:{dataOrder:{type:Object},indexRow:{type:Number}},components:{},data:function(){return{}},computed:{srcImage:function(){var t;return this.dataOrder.subscriptionId&&(null===(t=this.dataOrder)||void 0===t?void 0:t.sourceUserAvatar)||this.dataOrder.userAvatar},userName:function(){var t;return this.dataOrder.subscriptionId&&(null===(t=this.dataOrder)||void 0===t?void 0:t.sourceUserName)||this.dataOrder.userName}},methods:{mouseenterHandler:function(t){var e=t.target.getBoundingClientRect(),i=e.right,o=window.innerWidth-i;this.mouseEnterFunction(t,{imageForSource:this.srcImage,nameSource:this.userName,accountId:this.dataOrder.accountId,noActiveButton:!0,position:o>500?"right":"left"})},mouseleaveHandler:function(){this.mouseLeaveFunction()}}},qlt=Glt,zlt=(i("94f4"),Object(C["a"])(qlt,Vlt,Hlt,!1,null,"ac7b3a8a",null)),Ylt=zlt.exports,Xlt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DatePosition",class:t.darkClass},[t._v(t._s(t.formattedDate))])},Qlt=[],Jlt={name:"DatePosition",mixins:[xt],props:{date:{type:String},fullData:{type:Object}},components:{DxTooltip:Pt["DxTooltip"]},computed:{formattedDate:function(){return new Intl.DateTimeFormat("ru-RU",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(this.date))}}},Klt=Jlt,Zlt=(i("f0a7"),Object(C["a"])(Klt,Xlt,Qlt,!1,null,"0d5db65a",null)),tut=Zlt.exports,eut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TypePosition",class:t.classSell},[t._v(t._s(t.typeOrder))])},iut=[],out={name:"TypePosition",mixins:[xt],props:{dataOrder:{type:Object}},computed:{typeOrder:function(){return this.dataOrder.orderType},classSell:function(){return Object(c["a"])({green:"buy"===this.typeOrder.toLowerCase(),red:"sell"===this.typeOrder.toLowerCase()},this.darkClass)}}},nut=out,sut=(i("9c7b"),Object(C["a"])(nut,eut,iut,!1,null,"425d2c4e",null)),rut=sut.exports,aut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DateClosed"},[t._v(t._s(t.formattedDate))])},cut=[],lut={name:"DateClosed",props:{date:{type:String}},computed:{formattedDate:function(){return new Intl.DateTimeFormat("ru-RU",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(this.date))}}},uut=lut,dut=(i("a6b3"),Object(C["a"])(uut,aut,cut,!1,null,"4583d192",null)),hut=dut.exports,put=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitPosition",class:t.classColor},[t._v(t._s(t.profit))])},gut=[],fut={name:"ProfitPosition",mixins:[xt],props:{data:{type:Object}},computed:{classColor:function(){return Object(c["a"])({red:this.data.profit<0,green:this.data.profit>=0},this.darkClass)},profit:function(){return Lm(this.data.profit,2,!0)},percentProfit:function(){return Lm(100*this.data.profit/this.data.volume,2,!0)}}},mut=fut,vut=(i("79d7"),Object(C["a"])(mut,put,gut,!1,null,"27a9d644",null)),yut=vut.exports,Cut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CloseOpenOrder",class:t.rootClass},[t.loadOrders?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",{staticClass:"buttonRemove",on:{click:t.clickHandler,mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("svgIcon",{attrs:{name:"Close-mini",color:"#DA0000"}})],1),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Вы не можете закрыть сделки открытые по копированию")])],1)},but=[],Sut={name:"CloseOpenOrder",mixins:[Ot],props:{dataOrder:{type:Object},closePosition:{type:Function},loadRow:{type:Array}},components:{DxLoadIndicator:OT["DxLoadIndicator"]},computed:{loadOrders:function(){return this.loadRow.includes(this.dataOrder.id)},rootClass:function(){return{muddy:this.dataOrder.subscriptionId}}},methods:{clickHandler:function(){this.dataOrder.subscriptionId||this.closePosition(this.dataOrder)},mouseenterHandler:function(t){this.dataOrder.subscriptionId&&this.viewTooltip(t)},mouseleaveHandler:function(){this.dataOrder.subscriptionId&&this.hideTooltip()}}},Put=Sut,Tut=(i("0525"),Object(C["a"])(Put,Cut,but,!1,null,"54f663a5",null)),xut=Tut.exports,Out=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitCopy",class:t.rootClass},[e("span",{staticClass:"realProfit"},[t._v(t._s(t.realProfit))])])},wut=[],_ut={name:"ProfitCopy",mixins:[xt],props:{dataOrder:{type:Object},arrSubIds:{type:Array}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{subscriptionId:function(){return this.dataOrder.subscriptionId},profit:function(){return this.subscriptionId?this.dataOrder.profit:"-"},payment:function(){var t,e=this.dataOrder.subscriptionId;if(!e)return 0;var i=this.fullListSubscription.find((function(t){return+t.subscription.id===+e}));if("Money"===(null===i||void 0===i||null===(t=i.subscription)||void 0===t?void 0:t.priceType)||!i)return 0;var o=i.subscription.price;return this.dataOrder.profit>0?this.dataOrder.profit*o/100:0},realProfit:function(){return Lm(this.dataOrder.profit-this.payment,2,!0)},rootClass:function(){return Object(c["a"])({red:this.dataOrder.profit<0,green:this.dataOrder.profit>=0},this.darkClass)}})},Aut=_ut,Dut=(i("8df4"),Object(C["a"])(Aut,Out,wut,!1,null,"253f2bf8",null)),kut=Dut.exports,Iut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitSF",class:t.darkClass,domProps:{innerHTML:t._s(t.payment)}})},But=[],Mut={name:"ProfitSF",mixins:[xt],props:{dataOrder:{type:Object},arrSubIds:{type:Array}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{payment:function(){var t,e=this.dataOrder.subscriptionId;if(!e)return'0';var i=this.fullListSubscription.find((function(t){return+t.subscription.id===+e}));if("Money"===(null===i||void 0===i||null===(t=i.subscription)||void 0===t?void 0:t.priceType)||!i)return'0';var o=i.subscription.price,n=this.dataOrder.profit>0?this.dataOrder.profit*o/100:0;return''.concat(n>0?Lm(n,2,!0):0,"")}})},$ut=Mut,Lut=(i("1422"),Object(C["a"])($ut,Iut,But,!1,null,"6a9fc38c",null)),Fut=Lut.exports,jut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Pips",class:t.rootClass},[t._v(t._s(t.getPip))])},Rut=[],Wut={name:"Pips",mixins:[xt],props:{dataOrder:{type:Object},quotes:{type:Object}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts"})),{},{side:function(){return this.dataOrder.orderType},instrumentName:function(){return this.dataOrder.contractName.split(".")[0]},getPrecision:function(){var t,e=this;return null===(t=(this.getContracts||[]).find((function(t){return t.name===e.instrumentName})))||void 0===t?void 0:t.precision},getPip:function(){var t=this;if(!this.quotes[this.instrumentName])return 0;var e=Ph(this.getPrecision).toString().length-1,i=this.quotes[this.instrumentName]["Buy"],o=this.quotes[this.instrumentName]["Sell"],n={Buy:function(){return Math.round(+(i-t.dataOrder.openPrice).toFixed(e)*Ph(t.getPrecision))},Sell:function(){return Math.round(+(t.dataOrder.openPrice-o).toFixed(e)*Ph(t.getPrecision))}};return n[this.side]()},rootClass:function(){return Object(c["a"])({red:this.getPip<0,green:this.getPip>=0},this.darkClass)}})},Nut=Wut,Eut=(i("05be"),Object(C["a"])(Nut,jut,Rut,!1,null,"380f5f35",null)),Uut=Eut.exports,Vut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Volume"},[t._v(t._s(t.volume))])},Hut=[],Gut={name:"Volume",props:{dataOrder:{type:Object}},computed:{volume:function(){return Lm(this.dataOrder.volume,0,!0)}}},qut=Gut,zut=(i("4fd7"),Object(C["a"])(qut,Vut,Hut,!1,null,"3b06db57",null)),Yut=zut.exports,Xut=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Volume"},[t._v(t._s(t.volume))])},Qut=[],Jut={name:"Volume",props:{dataOrder:{type:Object}},computed:{volume:function(){return Lm(this.dataOrder.volumeAbs,0,!0)}}},Kut=Jut,Zut=(i("15eb"),Object(C["a"])(Kut,Xut,Qut,!1,null,"76add4c7",null)),tdt=Zut.exports,edt=function(){var t=this,e=t._self._c;return e("span",{staticClass:"SettingsButtonTable",class:t.rootClass,on:{click:t.clickHandler,mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("svgIcon",t._b({},"svgIcon",t.getIconData("Settings"),!1)),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Вы не можете редактировать сделки открытые по копированию")])],1)},idt=[],odt={name:"SettingButtonTable",mixins:[xt,Ot],props:{dataOrder:{type:Object},openSettingsModal:{type:Function}},data:function(){return{}},computed:{rootClass:function(){return{muddy:this.dataOrder.subscriptionId}}},methods:{clickHandler:function(){this.dataOrder.subscriptionId||this.openSettingsModal(this.dataOrder)},mouseenterHandler:function(t){this.dataOrder.subscriptionId&&this.viewTooltip(t)},mouseleaveHandler:function(){this.dataOrder.subscriptionId&&this.hideTooltip()}}},ndt=odt,sdt=(i("a53c"),Object(C["a"])(ndt,edt,idt,!1,null,"abf3c836",null)),rdt=sdt.exports,adt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SortAndFilterColumnsTable",class:t.darkClass},[e("DxButton",{attrs:{elementAttr:{class:"buttonIcon butttonMenuDot"},icon:t.$iconPath("Menu-dot")},on:{click:t.openMenu}}),t._v(t._s(t.title))],1)},cdt=[],ldt={name:"SortAndFilterColumnsTable",mixins:[xt],props:{openMenu:{type:Function},title:{type:String}},components:{DxButton:cc.a}},udt=ldt,ddt=(i("bf437"),Object(C["a"])(udt,adt,cdt,!1,null,"b28cc990",null)),hdt=ddt.exports,pdt=function(){var t=this,e=t._self._c;return e("DxPopup",{attrs:{visible:t.popupVisible,"drag-enabled":!0,"close-on-outside-click":!0,"show-close-button":!1,"show-title":!1,wrapperAttr:{class:"popupFilterAndSort"},width:"280",height:"auto",shadingColor:"transparent"},on:{hidden:function(e){return t.$emit("hidden")}}},[e("DxPosition",{attrs:{at:t.positionPopupFilter.at,my:t.positionPopupFilter.my,of:t.target}}),e("div",{staticClass:"wrapper",class:t.darkClass},[e("DxSortable",{attrs:{data:t.tableColumnFiltered},on:{"drag-start":function(e){return t.onListDragStart(e)},reorder:function(e){return t.onListDrop(e)}}},t._l(t.tableColumnFiltered,(function(i){return e("List-item",{key:i.id,attrs:{draggable:""}},[e("span",{staticClass:"titleList"},[t._v(t._s(i.title))]),e("input",{attrs:{type:"checkbox"},domProps:{checked:i.check},on:{change:function(e){return t.onValueChanged(e,i.id)}}})])})),1)],1)],1)},gdt=[],fdt={name:"PopupFilterAndSortCell",props:{popupVisible:{type:Boolean,default:!1},tableColumns:{type:Array,default:[]},positionPopupFilter:{type:Object},target:{type:[Boolean,Node]}},components:{DxPopup:To["DxPopup"],DxPosition:To["DxPosition"],ListItem:le,DxSortable:Gn.a,DxCheckBox:Th["DxCheckBox"]},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{darkClass:function(){return{dark:"dark"===this.getActiveTheme}},tableColumnFiltered:function(){return this.tableColumns.filter((function(t){return t.title}))}}),methods:{onListDragStart:function(t){t.itemData=t.fromData[t.fromIndex]},onListDrop:function(t){this.$emit("drop",{fromIndex:t.fromIndex,toIndex:t.toIndex,itemData:t.itemData})},onValueChanged:function(t,e){var i=this;setTimeout((function(){i.$emit("checkBoxHandler",{id:e,value:t.target.checked})}),10)}}},mdt=fdt,vdt=(i("31c0"),Object(C["a"])(mdt,pdt,gdt,!1,null,"42f46be0",null)),ydt=vdt.exports,Cdt={name:"TableComponent",mixins:[],props:{dataTable:{type:Array},getColumns:{type:Array},openMenu:{type:Function},openSettingsModal:{type:Function},arrSubIds:{type:Array},quotes:{type:Object},press:{type:Boolean},maxHeight:{type:Number},emitFunction:{type:Function},closePosition:{type:Function},loadRow:{type:Array},activeElement:{type:String},contractName:{type:String},investPortfolio:{type:Boolean}},components:{TableColumnsCustom:p2,UserName:Ylt,DatePosition:tut,TypePosition:rut,DateClosed:hut,ProfitPosition:yut,CloseOpenOrder:xut,ProfitCopy:kut,ProfitSF:Fut,Pips:Uut,SortAndFilterColumnsTable:hdt,TablePagination:Ult,PopupFilterAndSortCell:ydt,SettingButtonTable:rdt,Volume:Yut,VolumeAbs:tdt},data:function(){return{pageSize:[25,50],count:25,currentPage:0,controlTableData:Object(x["a"])(this.dataTable)}},computed:{isPagination:function(){var t;return(null===(t=this.dataTable)||void 0===t?void 0:t.length)>this.pageSize[0]},rootStyle:function(){var t=this.isPagination?32:0;return{"--maxHeight":this.press?"none":this.maxHeight-t+"px"}},pageCount:function(){var t;return Math.ceil((null===(t=this.dataTable)||void 0===t?void 0:t.length)/this.count)}},watch:{count:function(){this.currentPage=0},dataTable:{handler:function(t,e){this.activeElement!==this.contractName&&t.length===e.length||(this.controlTableData=Object(x["a"])(t))},deep:!0}},mounted:function(){this.controlTableData=Object(x["a"])(this.dataTable)},methods:{setCount:function(t){this.count=t,this.emitFunction()},setPage:function(t){this.currentPage=t,this.emitFunction()}}},bdt=Cdt,Sdt=(i("3553"),Object(C["a"])(bdt,Llt,Flt,!1,null,"7a96a765",null)),Pdt=Sdt.exports,Tdt={name:"AccordionForTable",mixins:[xt],inject:["maxHeightFirst","setOrderSuccess","setPips","setProfitResult","setVolume","setAllOrders","setProfitByCopy","setProfitBySF","setSfClosed","setMyProfitClosed","setSfOpen","setMyProfitOpen"],props:{emitFunction:{type:Function},activeTab:{type:[Number,String,Boolean]},dataTable:{type:Array},columns:{type:Array},arrSubIds:{type:Array},userProfile:{type:Boolean},isProvider:{type:Boolean},location:{type:String},press:{type:Boolean},maxHeight:{type:Number},currentHeight:{type:Number},closePosition:{type:Function,default:function(){}},loadRow:{type:Array,default:function(){return[]}},investPortfolio:{type:Boolean},typeOrders:{type:String,default:""}},components:{RowDataAccordion:ult,RowCommonData:$lt,TableComponent:Pdt,PopupFilterAndSortCell:ydt,VuePerfectScrollbar:Xt.a},data:function(){return{dataAccordion:Object(x["a"])(this.dataTable),managedColumns:Object(x["a"])(this.columns),popupVisible:!1,target:null,positionPopupFilter:{at:"right top",my:"left top"},activeElement:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCheckScroll:function(){var t=32*this.dataAccordion.length;return t>this.maxHeight},getColumns:function(){return this.managedColumns&&0!==this.managedColumns.length?this.managedColumns.filter((function(t){return t.check})).map((function(t,e){return 0===e?Object(c["a"])(Object(c["a"])({},t),{},{headerTemplate:"cellHeader-sort-and-filter"}):t})):[]},getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getCryptoStatus:function(){if(this.getDefaultAccount)return"CryptoDemo"===this.getDefaultAccount.accountGroupCode},namesOpen:function(){return[this.$t("instruments"),this.$t("trades_open"),"".concat(this.$t("volume"),", ").concat(this.getCryptoStatus?"coins":"$"),"P/L, %","P/L, ".concat(this.getCurrencyChar)]},namesClosed:function(){return[this.$t("instruments"),this.$t("trades_closed"),"".concat(this.$t("successful_trades_full"),", %"),"".concat(this.$t("volume"),", ").concat(this.getCryptoStatus?"coins":"$"),"P/L, %","P/L, ".concat(this.getCurrencyChar)]},rowCommonDataClosed:function(){var t;return!(null===(t=this.dataTable)||void 0===t||!t.length)&&this.namesClosed},rowCommonDataOpen:function(){var t;return!(null===(t=this.dataTable)||void 0===t||!t.length)&&this.namesOpen},rowCommonData:function(){switch(this.activeTab){case"open":return this.rowCommonDataOpen;case"closed":return this.rowCommonDataClosed;default:return!1}}}),watch:{dataTable:function(t){this.dataAccordion=Object(x["a"])(t)},activeTab:function(t){if(-1===t){var e=document.querySelector(".titlePart.active");e&&setTimeout((function(){e.nextElementSibling.removeAttribute("style"),e.classList.remove("active")}),1e3)}}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({redactSettings:"tableSettings/redactSettings"})),{},{openSettingsModal:function(t){var e=[t.id];this.$store.dispatch("modal/switchNewOrderModal",{symbol:t.contractName,payload:e})},openMenu:function(t){t.event.stopPropagation(),this.target=t.event.currentTarget;var e=t.event.target.getBoundingClientRect(),i=e.bottom,o=document.documentElement.clientHeight,n=o-i;this.positionPopupFilter=n<230?{at:"right top",my:"left bottom"}:n<500?{at:"right top",my:"left center"}:{at:"right top",my:"left top"},this.popupVisible=!0},closePopup:function(){this.popupVisible=!1},onDrop:function(t){this.managedColumns.splice(t.fromIndex,1),this.managedColumns.splice(t.toIndex,0,t.itemData)},checkBoxHandler:function(t){var e=t.value,i=t.id,o=this.managedColumns.findIndex((function(t){return t.id===i}));this.managedColumns[o].check=e;var n=this.managedColumns.map((function(t){return{check:t.check,field:t.field}}));this.redactSettings({data:{typeOrders:this.typeOrders,columns:n},mutation:"setSettingsTable"})},setCount:function(t){this.count=t},clickHandler:function(t,e){var i=this;this.activeElement=this.dataAccordion[e][0];var o=this.dataAccordion[e];this.dataAccordion.splice(e,1),this.dataAccordion.unshift(o);var n=t.currentTarget,s=n.classList.contains("active")?0:500;setTimeout((function(){if(i.maxHeightFirst(),n.classList.contains("active"))return n.nextElementSibling.removeAttribute("style"),n.classList.remove("active"),i.activeElement=null,void i.emitFunction();var t=document.querySelector(".titlePart.active");t&&t.classList.remove("active"),n.classList.add("active");var e=document.querySelectorAll(".contentPart");e.forEach((function(t){return t.removeAttribute("style")}));var o=n.nextElementSibling;o.style.height="auto",i.emitFunction()}),s)}})},xdt=Tdt,Odt=(i("1e4c"),Object(C["a"])(xdt,Gct,qct,!1,null,"22f93b6d",null)),wdt=Odt.exports,_dt={inject:{getRootContainerHeight:{from:"getRootContainerHeight",default:function(){}}},watch:{activeTab:function(t){-1!==t&&this.emitFunction()}},mounted:function(){this.emitFunction()},methods:{emitFunction:function(){var t=this;this.report||setTimeout((function(){var e,i=24,o=(null===(e=t.$refs.table)||void 0===e?void 0:e.clientHeight)+i,n=8,s=32,r=15,a=t.getRootContainerHeight()-r-s+n,c=o<=a?o:a;t.$emit("setCurrentHeight",c)}),0)}}},Adt={name:"OpenPosition",mixins:[_dt],props:{activeTab:{type:[Number,String,Boolean]},accordionData:{type:Array,default:function(){return[]}},columns:{type:Array},arrSubIds:{type:Array},userProfile:{type:Boolean},isProvider:{type:Boolean},location:{type:String},press:{type:Boolean},maxHeight:{type:Number},closePosition:{type:Function},loadRow:{type:Array},investPortfolio:{type:Boolean}},components:{AccordionForTable:wdt,TableColumnsCustom:p2}},Ddt=Adt,kdt=(i("43ad"),Object(C["a"])(Ddt,Vct,Hct,!1,null,"4d275663",null)),Idt=kdt.exports,Bdt=function(){var t=this,e=t._self._c;return e("div",{ref:"table",staticClass:"ClosedPosition"},[t.accordionData.length>0?e("AccordionForTable",{attrs:{dataTable:t.accordionData,emitFunction:t.emitFunction,activeTab:t.activeTab,typeOrders:"closed",columns:t.columns,quotes:t.quotes,arrSubIds:t.arrSubIds,userProfile:t.userProfile,isProvider:t.isProvider,location:t.location,press:t.press,maxHeight:t.maxHeight,investPortfolio:t.investPortfolio},on:{setHeightAccordion:function(e){return t.$emit("setHeightAccordion",e)}}}):e("TableColumnsCustom",{attrs:{dataTable:t.accordionData,columns:t.columns,resizeEnabled:!1,heightRow:24}})],1)},Mdt=[],$dt={name:"ClosedPosition",mixins:[_dt],props:{activeTab:{type:[Number,String,Boolean]},accordionData:{type:Array,default:function(){return[]}},columns:{type:Array},quotes:{type:Object},arrSubIds:{type:Array},userProfile:{type:Boolean},isProvider:{type:Boolean},location:{type:String},press:{type:Boolean},maxHeight:{type:Number},investPortfolio:{type:Boolean}},components:{AccordionForTable:wdt,PopupGraph:FT,TableColumnsCustom:p2},data:function(){return{statusChartWidget:!1,popupVisibleGraph:!1,positionPopup:{at:"left",my:"right"}}},methods:{openPopupCraph:function(t,e){var i=t.event.target.getBoundingClientRect(),o=i.top,n=i.bottom,s=document.documentElement.clientHeight;this.positionPopup=s-n<200?{at:"left",my:"right bottom"}:o<200?{at:"left",my:"right top"}:{at:"left",my:"right"},this.currentIdOrder=JSON.parse(JSON.stringify(e)),this.currentIdOrder.prefix=this.prefix,this.popupVisibleGraph=!0},openStatsChartWidget:function(){this.statusChartWidget=!this.statusChartWidget}}},Ldt=$dt,Fdt=(i("ff5d"),Object(C["a"])(Ldt,Bdt,Mdt,!1,null,"bcd6ebfe",null)),jdt=Fdt.exports,Rdt=function(){var t=this,e=t._self._c;return e("div",{ref:"table",staticClass:"ProfitPostion",class:t.darkClass},[e("TableColumnsCustom",{attrs:{dataTable:t.dataProfit,columns:t.columns,resizeEnabled:!1,emitSize:!0},on:{getSizeArr:t.getSizeArr},scopedSlots:t._u([{key:"header-cell-instrument",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"header-cell-copyCount",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"header-cell-volume",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"header-cell-invest",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"header-cell-profit",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"header-cell-myProfit",fn:function(i){var o=i.title,n=i.column;return[e("div",{staticClass:"svgWrapper",on:{mouseenter:function(e){return t.mouseenterHandler(e,n.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(o))])]}},{key:"cell-copyCount",fn:function(t){var i=t.data;return[e("CopyCount",{attrs:{dataContract:i}})]}},{key:"cell-volume",fn:function(i){var o=i.data;return[e("Volume",{attrs:{dataContract:o,dataProfit:t.dataProfit}})]}},{key:"cell-profit",fn:function(t){var i=t.data;return[e("Profit",{attrs:{dataContract:i}})]}},{key:"cell-my-profit",fn:function(i){var o=i.data;return[e("MyProfit",{attrs:{dataContract:o,allDataProfit:t.allDataProfit}})]}},{key:"cell-invest",fn:function(t){var i=t.data;return[e("Invest",{attrs:{dataContract:i}})]}}])}),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:350,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[e("span",{domProps:{innerHTML:t._s(t.tooltipText)}})])],1)},Wdt=[],Ndt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitYear",class:t.colorClass},[t._v(t._s(t.valueProfitData))])},Edt=[],Udt={name:"ProfitYear",props:{valueProfitData:{type:[Number,String,Boolean]},year:{type:Boolean},fullData:{type:Object}},computed:{colorClass:function(){return this.year?{red:this.fullData.total<0,green:this.fullData.total>=0}:{red:this.valueProfitData<0,green:this.valueProfitData>=0}}}},Vdt=Udt,Hdt=(i("7d61"),Object(C["a"])(Vdt,Ndt,Edt,!1,null,"25dd7c30",null)),Gdt=Hdt.exports,qdt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Profit",class:t.rootClass},[t._v(t._s(t.profit))])},zdt=[],Ydt={name:"Profit",mixins:[xt],props:{dataContract:{type:Object}},computed:{rootClass:function(){return Object(c["a"])({red:this.dataContract.profit<0,green:this.dataContract.profit>=0},this.darkClass)},profit:function(){return Lm(this.dataContract.profit,2,!0)}}},Xdt=Ydt,Qdt=(i("5ef7"),Object(C["a"])(Xdt,qdt,zdt,!1,null,"c4b17358",null)),Jdt=Qdt.exports,Kdt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyProfit",class:t.rootClass},[t._v(t._s(t.myProfit))])},Zdt=[],tht={name:"MyProfit",mixins:[xt],props:{dataContract:{type:Object},allDataProfit:{type:[Array,Boolean]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({subscriberCopy:"subscriptionsContract/subscriberCopy"})),{},{subscriberCopyFiltered:function(){var t=this;return this.subscriberCopy.filter((function(e){return e.contract===t.dataContract.contract}))},myProfit:function(){var t=this;if(!this.allDataProfit||!this.subscriberCopy)return 0;var e=0;return this.subscriberCopyFiltered.forEach((function(i){var o=t.allDataProfit.find((function(t){return t.subscriptionId===i.id})),n=o.closedProfit;"Money"===i.priceType?e+=i.price:n&&n>0&&(e+=n*i.price/100)})),"$ ".concat(Lm(e,2,!0))},rootClass:function(){return Object(c["a"])({},this.darkClass)}})},eht=tht,iht=(i("e2ee"),Object(C["a"])(eht,Kdt,Zdt,!1,null,"7e5a7b08",null)),oht=iht.exports,nht=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Invest",class:t.darkClass},[t._v(t._s(t.invest))])},sht=[],rht={name:"Invest",mixins:[xt],props:{dataContract:{type:Object}},computed:{invest:function(){return"$ "+Lm(this.dataContract.invest,2,!0)}}},aht=rht,cht=(i("ffb35"),Object(C["a"])(aht,nht,sht,!1,null,"75d3ecc3",null)),lht=cht.exports,uht=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Volume",class:t.darkClass},[t._v("$ "+t._s(t.volume)),t.myVolume?e("span",[t._v("  / $ "+t._s(t.myVolume))]):t._e()])},dht=[],hht={name:"Volume",mixins:[xt],props:{dataContract:{type:Object},dataProfit:{type:Array}},computed:{volume:function(){return Lm(this.dataContract.volume,2,!0)},myVolume:function(){return!!this.dataContract.myVolume&&Lm(this.dataContract.myVolume,2,!0)}}},pht=hht,ght=(i("7e9a"),Object(C["a"])(pht,uht,dht,!1,null,"0fc5043e",null)),fht=ght.exports,mht=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CopyCount",class:t.darkClass},[t._v(t._s(t.dataContract.count))])},vht=[],yht={name:"CopyCount",mixins:[xt],props:{dataContract:{type:Object}}},Cht=yht,bht=(i("2f4c"),Object(C["a"])(Cht,mht,vht,!1,null,"63c23f1e",null)),Sht=bht.exports,Pht={name:"ProfitPosition",mixins:[_dt,Ot,xt],props:{activeTab:{type:[Number,String,Boolean]},dataProfit:{type:Array},allDataProfit:{type:[Boolean,Array]},report:{type:Boolean,default:!1}},components:{ProfitYear:Gdt,TableColumnsCustom:p2,MyProfit:oht,Profit:Jdt,Invest:lht,Volume:fht,CopyCount:Sht},data:function(){return{tooltipText:""}},computed:{columns:function(){return[{id:1,title:this.$t("instruments"),field:"contract",align:"center",headerTemplate:"header-cell-instrument",tooltip:"Торгуемые инструменты"},{id:2,title:this.$t("yabc"),field:"count",align:"center",cellTemplate:"cell-copyCount",headerTemplate:"header-cell-copyCount",tooltip:"Подписчики копирующие
Вашу стратегию"},{id:3,title:"".concat(this.$t("vofi"),", $"),field:"invest",align:"center",cellTemplate:"cell-invest",headerTemplate:"header-cell-invest",tooltip:"Сумма средств, которые подписчики с
реальными счетами вкладывают в
копирование в настоящий момент."},{id:4,title:"".concat(this.$t("profit_from_copying"),", $"),field:"profit",align:"center",cellTemplate:"cell-profit",headerTemplate:"header-cell-profit",tooltip:"Полученная совокупная прибыль
от Вашей стратегии"},{id:5,title:"".concat(this.$t("your_income"),", $"),align:"center",field:"myProfit",cellTemplate:"cell-my-profit",headerTemplate:"header-cell-myProfit",tooltip:"Ваш чистый доход от копирования.
Доход состоит из фиксированной оплаты и
от процента успешных сделок"},{id:6,title:"".concat(this.$t("turnover_of_capital"),", $"),field:"volume",align:"center",cellTemplate:"cell-volume",headerTemplate:"header-cell-volume",tooltip:"Обороты капитала"}]}},methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},getSizeArr:function(t){this.$emit("getSizeArr",t)}}},Tht=Pht,xht=(i("25e0"),Object(C["a"])(Tht,Rdt,Wdt,!1,null,"adb75fae",null)),Oht=xht.exports;function wht(t,e){return t.filter((function(t){return!t.stopDateTime||new Date(t.stopDateTime).getTime()>new Date(e).getTime()}))}function _ht(t,e){return t.filter((function(t){return t.stopDateTime&&new Date(t.stopDateTime).getTime()0){var o=Array.from(new Set(i.map((function(t){return t.sourceAccountId})))),n=[];o.forEach((function(t){n.push(i.filter((function(e){return e.sourceAccountId===t})))})),e=e.filter((function(t){return!o.includes(t.sourceAccountId)}));var s={};n.forEach((function(t,i){s.portfolioUser=!0,s.name=t[0].name,s.sourceSequenceId=t[0].sourceSequenceId,s.sourceAccountId=t[0].sourceAccountId,s.sourceAccountGroup=t[0].sourceAccountGroup,s.startDateTime=t[0].subscription.startDateTime,s.stopDateTime=t[0].subscription.stopDateTime,s.priceType=t[0].subscription.priceType,s.price=t[0].subscription.price,s.sourceAvatar=t[0].subscription.sourceAvatar,s.sourceUserId=t[0].subscription.sourceUserId,s.sources=n[i].map((function(t){return t.subscription})),e.push(s),s={}}))}return e}function kht(t){if(!t)return[];var e=Array.from(new Set(t.map((function(t){return t.contractName})))),i={};return e.forEach((function(e){i[e]=t.filter((function(t){return t.contractName===e})).sort((function(t,e){return new Date(e.closedDate||e.openDate).getTime()-new Date(t.closedDate||t.openDate).getTime()}))})),Object.entries(i)}var Iht={name:"ContainerWihData",mixins:[xt],inject:["getRootContainerHeight"],props:{up:{type:Boolean},activeTab:{type:[Number,String,Boolean]},prevTab:{type:Number},clickButton:{type:Function},symbol:{type:String},dataOpenPosition:{type:Array},dataClosedPosition:{type:Array},dataProfit:{type:Array},allDataProfit:{type:[Array,Boolean]},columns:{type:Array},arrSubIds:{type:Array},userProfile:{type:Boolean},isProvider:{type:Boolean},location:{type:String},closePosition:{type:Function},loadRow:{type:Array,default:function(){return[]}},transitionName:{type:String},investPortfolio:{type:Boolean}},components:{OpenPosition:Idt,ClosedPosition:jdt,ProfitPosition:Oht},provide:function(){return{maxHeightFirst:this.maxHeightFirst}},data:function(){return{currentHeight:0,press:!1,maxHeight:0,lookDown:!1}},computed:{touchButtonIcon:function(){return{name:"Drag-horizontal",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},upDownButtonIcon:function(){return{name:"Arrow-nano-top",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},classUpDownButton:function(){return{down:this.lookDown}},dopClass:function(){return Object(c["a"])({up:this.up},this.darkClass)},rootStyle:function(){return{"--ledge":this.currentHeight+"px","--transition":this.press?"none":"transform 1s ease-in-out"}},prevComponent:function(){return 1===this.prevTab?"OpenPosition":2===this.prevTab?"ClosedPosition":3===this.prevTab?"ProfitPosition":""},activeComponent:function(){switch(this.activeTab){case"open":return"OpenPosition";case"closed":return"ClosedPosition";case"profit":return"ProfitPosition";default:return this.prevComponent}},openInstruments:function(){var t=this,e=kht(this.dataOpenPosition);return this.symbol&&(e=Object(x["a"])(e).sort((function(e,i){return(i[0]===t.symbol)-(e[0]===t.symbol)}))),e},closedInstruments:function(){var t=this,e=kht(this.dataClosedPosition);return this.symbol&&(e=Object(x["a"])(e).sort((function(e,i){return(i[0]===t.symbol)-(e[0]===t.symbol)}))),e},dopHeight:function(){var t=0;return"open"===this.activeTab&&(t=this.openInstruments.length),"closed"===this.activeTab&&(t=this.closedInstruments.length),32*t-24-15},propsForActiveComponent:function(){return{OpenPosition:{accordionData:this.openInstruments,columns:this.columns,arrSubIds:this.arrSubIds,userProfile:this.userProfile,isProvider:this.isProvider,location:this.location,press:this.press,maxHeight:this.maxHeight,closePosition:this.closePosition,loadRow:this.loadRow,investPortfolio:this.investPortfolio},ClosedPosition:{accordionData:this.closedInstruments,columns:this.columns,arrSubIds:this.arrSubIds,userProfile:this.userProfile,isProvider:this.isProvider,location:this.location,press:this.press,maxHeight:this.maxHeight,investPortfolio:this.investPortfolio},ProfitPosition:{dataProfit:this.dataProfit,allDataProfit:this.allDataProfit}}}},watch:{activeTab:function(t){-1===t?(this.currentHeight=0,this.lookDown=!1):this.lookDown=!0}},mounted:function(){this.maxHeightFirst(),this.lookDown=!0},methods:{upDownClickHandler:function(){this.lookDown?this.clickButton({itemIndex:-1}):(this.maxHeightFirst(),this.$refs.childTable.emitFunction(),this.lookDown=!0)},maxHeightFirst:function(){var t=32,e=32,i=32,o=24,n=8;this.maxHeight=this.getRootContainerHeight()-t-e-i-o-n},setCurrentHeight:function(t){this.currentHeight=-1*t},setHeightAccordion:function(t){this.currentHeight+=-1*t},pointerdownHandler:function(t){var e=this;this.press=!0;var i=this.currentHeight,o=t.pageY;this.$nextTick((function(){var t=e.$refs.container.clientHeight,n=e.getRootContainerHeight()-32-20,s=0,r=i;document.onpointermove=function(a){s=i+a.pageY-o,Math.abs(s)>t||Math.abs(s)>n?e.lookDown=!0:(r=s,e.$refs.container.style.transform="translate3d(0, ".concat(s,"px, 0)"),e.lookDown=!1)},document.onpointerup=function(){e.$refs.container.style.removeProperty("transform"),document.onpointermove=null,document.onpointerup=null,e.currentHeight=r,e.maxHeight=Math.abs(e.currentHeight)-32-24-32,e.press=!1,Math.abs(e.currentHeight)<70&&e.clickButton({itemIndex:-1})}}))}}},Bht=Iht,Mht=(i("9478"),Object(C["a"])(Bht,Ect,Uct,!1,null,"ad5284d2",null)),$ht=Mht.exports,Lht={name:"FloatingDataCopy",mixins:[xt],props:{tabs:Array,dataOpenPosition:Array,dataClosedPosition:Array,columnsOpenPosition:Array,columnsClosedPosition:Array,columnsProfit:Array,dataProfit:Array,cryptoStatus:Boolean,allDataProfit:[Array,Boolean],userProfile:Boolean,isProvider:Boolean,selectorContainer:String,loadRow:Array,closePosition:{type:Function,default:function(){}},location:{type:String,default:""},arrSubIds:{type:Array,default:function(){return[]}},symbol:{type:String,default:""},investPortfolio:{type:Boolean,default:!1}},components:{CommonCalcData:Act,ContainerWihData:$ht,TabsPanel:Nct,PopupGraph:FT},provide:function(){return{getRootContainerHeight:this.getRootContainerHeight,setOrderSuccess:this.setOrderSuccess,setPips:this.setPips,setProfitResult:this.setProfitResult,setVolume:this.setVolume,setAllOrders:this.setAllOrders,setProfitByCopy:this.setProfitByCopy,setProfitBySF:this.setProfitBySF,setSfClosed:this.setSfClosed,setMyProfitClosed:this.setMyProfitClosed,setSfOpen:this.setSfOpen,setMyProfitOpen:this.setMyProfitOpen}},data:function(){return{itemIndex:-1,prevItemIndex:-1,heightPanel:32,sizeCellOpenPosition:[],sizeCellClosedPosition:[],calcOrderSuccess:[],calcPips:[],calcProfitResult:[],calcAllOrders:[],calcProfitByCopy:[],calcProfitBySF:[],calcVolume:[],calcSfClosed:[],calcMyProfitClosed:[],calcSfOpen:[],calcMyProfitOpen:[],popupVisibleGraph:!1,currentIdOrder:null,up:!1,transitionName:"noName",positionPopup:{at:"left",my:"right"},keyContainer:!0}},computed:{tabActive:function(){return-1===this.itemIndex?-1:0===this.itemIndex?"open":1===this.itemIndex?"closed":2===this.itemIndex?"profit":void 0},columns:function(){switch(this.tabActive){case"open":return this.columnsOpenPosition;case"closed":return this.columnsClosedPosition;case"profit":return this.columnsProfit;default:return[]}},sizeWidth:function(){switch(this.tabActive){case"open":return this.sizeCellOpenPosition;case"closed":return this.sizeCellClosedPosition;default:return[]}},allSymbols:function(){return kht(this.dataOpenPosition)},calcPlPercent:function(){switch(this.tabActive){case"open":case-1:if(!this.dataOpenPosition||!this.dataOpenPosition.length)return 0;var t=this.cryptoStatus?this.dataOpenPosition.reduce((function(t,e){return t+e.volume*e.openPrice}),0):this.dataOpenPosition.reduce((function(t,e){return t+e.volume}),0),e=this.calcProfitResult.reduce((function(t,e){return t+e}),0);return 100*e/t;case"closed":if(!this.dataClosedPosition||0===this.dataClosedPosition.length)return 0;var i=this.cryptoStatus?this.dataClosedPosition.reduce((function(t,e){return t+e.volume*e.openPrice}),0):this.dataClosedPosition.reduce((function(t,e){return t+e.volume}),0),o=this.calcProfitResult.reduce((function(t,e){return t+e}),0);return 100*o/i;default:return 0}}},watch:{itemIndex:function(t,e){-1!==t&&(this.keyContainer=!this.keyContainer),this.up=t>-1,this.prevItemIndex=e}},methods:{getRootContainerHeight:function(){return document.querySelector(this.selectorContainer).clientHeight},tabClick:function(t){var e=this;-1===t.itemIndex?this.transitionName="fadeComponent":this.transitionName="noName",setTimeout((function(){e.itemIndex=t.itemIndex,e.calcOrderSuccess=[],e.calcPips=[],e.calcProfitResult=[],e.calcAllOrders=[],e.calcProfitByCopy=[],e.calcProfitBySF=[],e.$nextTick((function(){e.$emit("setPositionTabIndex",e.tabActive)}))}),0)},getSizeArr:function(t){switch(this.tabActive){case"open":this.sizeCellOpenPosition=t;break;case"closed":this.sizeCellClosedPosition=t;break;default:return[]}},closePopupGraph:function(){this.popupVisibleGraph=!1},setOrderSuccess:function(t){var e=t.val,i=t.index;this.$set(this.calcOrderSuccess,i,e)},setPips:function(t){var e=t.val,i=t.index;this.$set(this.calcPips,i,e)},setProfitResult:function(t){var e=t.val,i=t.index;this.$set(this.calcProfitResult,i,e)},setVolume:function(t){var e=t.val,i=t.index;this.$set(this.calcVolume,i,e)},setAllOrders:function(t){var e=t.val,i=t.index;this.$set(this.calcAllOrders,i,e)},setProfitByCopy:function(t){var e=t.val,i=t.index;this.$set(this.calcProfitByCopy,i,e)},setProfitBySF:function(t){var e=t.val,i=t.index;this.$set(this.calcProfitBySF,i,e)},setSfClosed:function(t){var e=t.val,i=t.index;this.$set(this.calcSfClosed,i,e)},setMyProfitClosed:function(t){var e=t.val,i=t.index;this.$set(this.calcMyProfitClosed,i,e)},setSfOpen:function(t){var e=t.val,i=t.index;this.$set(this.calcSfOpen,i,e)},setMyProfitOpen:function(t){var e=t.val,i=t.index;this.$set(this.calcMyProfitOpen,i,e)}}},Fht=Lht,jht=(i("0a55"),Object(C["a"])(Fht,dct,hct,!1,null,"683e282a",null)),Rht=jht.exports,Wht={data:function(){return{getDopData:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",getApiUrl:"api/api",getSession:"auth/getSession",isProvider:"subscribeOrders/isProvider",subscriberCopy:"subscriptionsContract/subscriberCopy"})),{},{emptyData:function(){return{count:0,invest:0,profit:0,volume:0}}}),watch:{getStatByOrders:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.isProvider&&!e.getDataForTableOutside){i.next=2;break}return i.abrupt("return");case 2:if(!t||e.getDopData){i.next=6;break}return i.next=5,e.getProfitData();case 5:e.getDopData||e.setDopData();case 6:case"end":return i.stop()}}),i)})))()}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isProvider&&!t.getDataForTableOutside){e.next=2;break}return e.abrupt("return");case 2:if(!t.getStatByOrders&&!t.report){e.next=6;break}return e.next=5,t.getProfitData();case 5:t.getDopData||t.setDopData();case 6:case"end":return e.stop()}}),e)})))()},methods:{setDopData:function(){var t,e,i=this;this.getDopData=!0,null!==(t=this.dataOpenPosition)&&void 0!==t&&t.length&&this.dataOpenPosition.forEach((function(t){var e=i.dataProfit.find((function(e){return e.contract===t.contractName}));e&&(e["myVolume"]||(e["myVolume"]=0),e["myVolume"]+=t.volume)})),null!==(e=this.dataClosedPosition)&&void 0!==e&&e.length&&this.dataClosedPosition.forEach((function(t){var e=i.dataProfit.find((function(e){return e.contract===t.contractName}));e&&(e["myVolume"]||(e["myVolume"]=0),e["myVolume"]+=2*t.volume)}))},tableDataProfit:function(t){var e=this,i={};return t.forEach((function(t){i[t.contract]||(i[t.contract]=Object(c["a"])({contract:t.contract},e.emptyData)),i[t.contract].count+=1,i[t.contract].invest+=t.investMoney,i[t.contract].profit+=t.closedProfit,i[t.contract].volume+=2*t.usedVolume})),Object.values(i)},getProfitData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$workKeys.signMessage("accountId=".concat(t.getDefaultAccount.id),t.getSession.sk);case 2:return i=e.sent,e.next=5,t.$http.get("".concat(t.getApiUrl,"Subscription/SubscriberStatisticBySourceAccount"),{params:{accountId:t.getDefaultAccount.id},headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":i}});case 5:o=e.sent,n=o.data,t.allDataProfit=n.data,t.dataProfit=t.tableDataProfit(n.data);case 9:case"end":return e.stop()}}),e)})))()}}},Nht={data:function(){return{tabsTables:[{id:1,icon:"OpenOrders",tooltipText:this.$t("open_trades")},{id:2,icon:"CloseOrders",tooltipText:this.$t("closed_trade")}]}},computed:{tabs:function(){return this.isProvider&&!this.outsideData?[].concat(Object(x["a"])(this.tabsTables),[{id:3,icon:"Copy",tooltipText:this.$t("income_table")}]):this.tabsTables}}};function Eht(t,e){var i=t.find((function(t){return t.field===e}));return!i||i.check}var Uht={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",findPortfolio:"expertsPortfolio/findPortfolio",getOpenSettingsTable:"tableSettings/getOpenSettingsTable",getClosedSettingsTable:"tableSettings/getClosedSettingsTable"})),{},{getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getCryptoStatus:function(){if(this.getDefaultAccount)return"CryptoDemo"===this.getDefaultAccount.accountGroupCode},moneyPrice:function(){return Boolean(this.investPortfolio&&"Money"===this.findPortfolio.bagContents[0].priceType)},columnsOpenPositionCrypto:function(){return[{id:1,title:this.$t("order_number"),field:"sequenceId",align:"center",width:this.isTablet?"70px":"10%",check:!!this.getOpenSettingsTable&&Eht(this.getOpenSettingsTable,"sequenceId")},{id:2,title:this.$t("provider"),field:"userName",align:"center",width:this.isTablet?"70px":"10%",cellTemplate:"cell-userName",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"userName")},{id:3,title:this.$t("opening_time"),field:"openDate",align:"center",width:this.isTablet?"110px":null,cellTemplate:"cell-openDate",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openDate")},{id:4,title:this.$t("type"),field:"orderType",align:"center",cellTemplate:"cell-orderType",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"orderType")},{id:5,title:"".concat(this.$t("volume"),", coins"),field:"volume",align:"center",cellTemplate:"cell-volume",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"volume")},{id:6,title:"".concat(this.$t("volume"),", ").concat(this.getCurrencyChar),field:"volumeAbs",align:"center",cellTemplate:"cell-volumeAbs",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"volume")},{id:7,title:this.$t("price"),field:"openPrice",align:"center",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openPrice")},{id:8,title:"T/P",field:"takeProfit",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"takeProfit")},{id:9,title:"S/L",field:"stopLoss",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"stopLoss")},{id:10,title:"".concat(this.$t("profit"),", ").concat(this.getCurrencyChar),field:"profit",align:"center",width:"8%",cellTemplate:"cell-profit",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"profit")},{id:11,title:"Комиссия",field:"openFee",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openFee")}]},columnsOpenPositionForex:function(){return[{id:1,title:this.$t("order_number"),field:"sequenceId",align:"center",width:this.isTablet?"70px":"10%",check:!!this.getOpenSettingsTable&&Eht(this.getOpenSettingsTable,"sequenceId")},{id:2,title:this.$t("provider"),field:"userName",align:"center",width:this.isTablet?"70px":"10%",cellTemplate:"cell-userName",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"userName")},{id:3,title:this.$t("opening_time"),field:"openDate",align:"center",width:this.isTablet?"110px":null,cellTemplate:"cell-openDate",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openDate")},{id:4,title:this.$t("type"),field:"orderType",align:"center",cellTemplate:"cell-orderType",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"orderType")},{id:5,title:"".concat(this.$t("volume"),", $"),field:"volume",align:"center",cellTemplate:"cell-volume",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"volume")},{id:6,title:this.$t("price"),field:"openPrice",align:"center",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openPrice")},{id:7,title:"T/P",field:"takeProfit",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"takeProfit")},{id:8,title:"S/L",field:"stopLoss",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"stopLoss")},{id:9,title:"".concat(this.$t("profit"),", ").concat(this.getCurrencyChar),field:"profit",align:"center",width:"8%",cellTemplate:"cell-profit",check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"profit")},{id:10,title:"Комиссия",field:"openFee",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"openFee")},{id:11,title:this.$t("swap"),field:"swaps",align:"center",check:!!this.getOpenSettingsTable&&Eht(this.getOpenSettingsTable,"swaps")}]},columnsOpenPosition:function(){return this.getCryptoStatus?this.columnsOpenPositionCrypto:this.columnsOpenPositionForex},columnsClosedPositionCrypto:function(){return[{id:1,title:this.$t("order_number"),field:"sequenceId",align:"center",width:this.isTablet?"70px":"10%",check:!!this.getClosedSettingsTable&&Eht(this.getClosedSettingsTable,"sequenceId")},{id:2,title:this.$t("provider"),field:"userName",align:"center",width:this.isTablet?"70px":"10%",cellTemplate:"cell-userName",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"userName")},{id:3,title:this.$t("opening_time"),field:"openDate",align:"center",width:this.isTablet?"90px":null,cellTemplate:"cell-openDate",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"openDate")},{id:4,title:this.$t("closing_time"),field:"closedDate",align:"center",width:this.isTablet?"90px":null,cellTemplate:"cell-closedDate",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"closedDate")},{id:5,title:this.$t("type"),field:"orderType",align:"center",cellTemplate:"cell-orderType",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"orderType")},{id:6,title:"".concat(this.$t("volume"),", coins"),field:"volume",align:"center",cellTemplate:"cell-volume",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"volume")},{id:7,title:"".concat(this.$t("volume"),",").concat(this.getCurrencyChar),field:"volumeAbs",align:"center",cellTemplate:"cell-volumeAbs",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"volume")},{id:8,title:this.$t("open_price"),field:"openPrice",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"openPrice")},{id:9,title:this.$t("closing_price"),field:"closePrice",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"closePrice")},{id:10,title:"T/P",field:"takeProfit",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"takeProfit")},{id:11,title:"S/L",field:"stopLoss",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"stopLoss")},{id:12,title:"".concat(this.$t("profit"),", ").concat(this.getCurrencyChar),field:"profit",align:"center",width:"8%",cellTemplate:"cell-profit",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"profit")},{id:13,title:"Комиссия",field:"closeFee",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"closeFee")}]},columnsClosedPositionForex:function(){return[{id:1,title:this.$t("order_number"),field:"sequenceId",align:"center",width:this.isTablet?"70px":"10%",check:!!this.getClosedSettingsTable&&Eht(this.getClosedSettingsTable,"sequenceId")},{id:2,title:this.$t("provider"),field:"userName",align:"center",width:this.isTablet?"70px":"10%",cellTemplate:"cell-userName",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"userName")},{id:3,title:this.$t("opening_time"),field:"openDate",align:"center",width:this.isTablet?"90px":null,cellTemplate:"cell-openDate",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"openDate")},{id:4,title:this.$t("closing_time"),field:"closedDate",align:"center",width:this.isTablet?"90px":null,cellTemplate:"cell-closedDate",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"closedDate")},{id:5,title:this.$t("type"),field:"orderType",align:"center",cellTemplate:"cell-orderType",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"orderType")},{id:6,title:this.$t("volume"),field:"volume",align:"center",cellTemplate:"cell-volume",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"volume")},{id:7,title:this.$t("open_price"),field:"openPrice",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"openPrice")},{id:8,title:this.$t("closing_price"),field:"closePrice",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"closePrice")},{id:9,title:"T/P",field:"takeProfit",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"takeProfit")},{id:10,title:"S/L",field:"stopLoss",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"stopLoss")},{id:11,title:"".concat(this.$t("profit"),", ").concat(this.getCurrencyChar),field:"profit",align:"center",width:"8%",cellTemplate:"cell-profit",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"profit")},{id:12,title:"Комиссия",field:"closeFee",align:"center",width:this.isTablet?"50px":null,check:!this.getOpenSettingsTable||Eht(this.getOpenSettingsTable,"closeFee")},{id:13,title:this.$t("swap"),field:"swaps",align:"center",check:!this.getClosedSettingsTable||Eht(this.getClosedSettingsTable,"swaps")}]},columnsClosedPosition:function(){return this.getCryptoStatus?this.columnsClosedPositionCrypto:this.columnsClosedPositionForex},columnsProfit:function(){return[{id:1,title:this.$t("instruments"),field:"instrument",align:"center",check:!0},{id:2,title:this.$t("yabc"),field:"copyCount",align:"center",check:!0},{id:3,title:"".concat(this.$t("vofi"),", ").concat(this.getCryptoStatus?"coins":"$"),field:"volume",align:"center",check:!0},{id:4,title:"".concat(this.$t("profit_from_copying"),", ").concat(this.getCurrencyChar),field:"profit",align:"center",cellTemplate:"cell-green-red-value",check:!0},{id:5,title:"".concat(this.$t("your_income"),", ").concat(this.getCurrencyChar),align:"center",field:"myProfit",cellTemplate:"cell-green-red-value",check:!0}]}}),mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler)},methods:{setMessageHandler:function(t){var e,i,o=this;"HistoryOrders"===(null===t||void 0===t?void 0:t.command)&&((null===(e=this.getDefaultAccount)||void 0===e?void 0:e.id)===(null===(i=t.data)||void 0===i?void 0:i.accountId)&&setTimeout((function(){return o.getDataForTable()}),50))}}},Vht={name:"UserProfileTable",mixins:[xt,Nht,Uht,Wht],props:{loadedSessionTableData:{type:Boolean},selectorContainer:{type:String,default:".containerForTables"},symbol:{type:String},getDataForTableOutside:{type:[Function,Boolean],default:null},outsideData:{type:Boolean,default:!1},noFilteredBySignal:{type:Boolean,default:!1},group:{type:Boolean,default:!1},investPortfolio:{type:Boolean,default:!1}},components:{TabPanel:uct,FloatingData:Rht,DxLoadPanel:ict["DxLoadPanel"],DxPosition:ict["DxPosition"]},data:function(){return{loadRow:[],dataOpenPosition:null,dataClosedPosition:null,dataProfit:null,allDataProfit:null,accountId:null,positionTabIndex:!1,serverTime:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getActiveTab:"expertsPortfolio/getActiveTab",getIncome:"statistic/getYearsStat",getUserSettings:"userSettings/getUserSettings",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getSession:"auth/getSession",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getCatalogs:"quotesCatalogs/getCatalogs",isProvider:"subscribeOrders/isProvider"})),{},{getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},isTablet:function(){var t=document.documentElement.clientWidth;return t<1150},getCheck:function(){var t;return!this.investPortfolio||"Active"===(null===(t=this.findPortfolio)||void 0===t?void 0:t.status)},columnsOpenPositionUserProfile:function(){return this.investPortfolio?Object(x["a"])(this.columnsOpenPosition):(this.columnsOpenPosition.splice(1,1),[].concat(Object(x["a"])(this.columnsOpenPosition),[{id:14,title:"",field:"gearWheel",align:"center",width:"50px",sortingEnabled:!1,cellTemplate:"gearWheel-cell-template",check:this.getCheck},{id:15,title:"",field:"remove",align:"center",width:"50px",sortingEnabled:!1,cellTemplate:"remove-cell-template",check:this.getCheck}]))},columnsClosedPositionUserProfile:function(){var t=Object(x["a"])(this.columnsClosedPosition);return t.splice(1,1),Object(x["a"])(t)}}),watch:{getStatByOrders:function(t){t&&this.getDataForTable()},getActiveTab:function(){"Active"!==this.findPortfolio.status&&this.getDataForTable()}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getSubscribers:"subscriptionsContract/getSubscribers"})),{},{addIdInLoadRowArray:function(t){this.loadRow=[].concat(Object(x["a"])(this.loadRow),[t])},addInTablePortfolioOpenPosition:function(t){var e=t.subscriptionId;if(e){var i=this.allSubscriptionCurrentDate.find((function(t){return+t.subscription.id===+e}));i&&i.subscription.bagId===this.findPortfolio.id&&(this.$store.commit("statDataForPortfolio/addOpenOrders",t),this.addOpenPosition(t))}},setMessageHandler:function(t){if("AccountsDetails"===t.command&&this.updatingTableDataOpenPosition(t.data),"BrokerPosition"===(null===t||void 0===t?void 0:t.command)){if(t.data.closedDate)return this.investPortfolio?void this.closedPositionPortfolio(t.data):(this.closedPosition(t.data),void(this.loadRow=this.loadRow.filter((function(e){return e.id!==t.data.id}))));if(t.data.accountId===this.getDefaultAccount.id&&"Position_Create"===t.data.reason&&"Rejected"!==t.data.status){if(this.investPortfolio)return void this.addInTablePortfolioOpenPosition(t.data);this.addOpenPosition(t.data)}}},updatingTableDataOpenPosition:function(t){var e,i=this;if(this.dataOpenPosition){this.accountId||(this.accountId=GV(this));var o=t.find((function(t){return t.account.id===i.accountId})),n=null===o||void 0===o||null===(e=o.openOrders)||void 0===e?void 0:e.tradingOrders,s=structuredClone(this.dataOpenPosition);s.forEach((function(t){var e=n?n.find((function(e){return e.id===t.id})):null;e&&(t.swaps=e.swaps,t.profit=e.profit)})),this.dataOpenPosition=s}},getDataForTable:function(){if(this.getDataForTableOutside){var t=this.getDataForTableOutside(),e=t.openOrders,i=t.closedOrders;return this.dataClosedPosition=i,void(this.dataOpenPosition=e)}this.dataClosedPosition=Object(x["a"])(qV(this)),this.dataOpenPosition=structuredClone(Object(x["a"])(HV(this)))},closedPosition:function(t){this.investPortfolio?this.getDataForTable():(this.dataOpenPosition=this.dataOpenPosition.filter((function(e){return e.id!==t.id})),this.dataClosedPosition=[].concat(Object(x["a"])(this.dataClosedPosition),[t]))},closedPositionPortfolio:function(t){var e=t.subscriptionId,i=t.id;if(t.subscriptionId){var o=this.dataOpenPosition.find((function(t){return t.subscriptionId===e&&t.id===i}));o&&(this.$store.commit("statDataForPortfolio/addCloseOrders",t),this.closedPosition(t))}},addOpenPosition:function(t){if(this.investPortfolio)this.getDataForTable();else if(this.dataOpenPosition.push(t),this.isProvider){var e=this.dataProfit.find((function(e){return e.contract===t.contractName}));e&&(e["myVolume"]||(e["myVolume"]=0),e["myVolume"]+=t.volume)}},closePositionWs:function(t){var e=t.accountId,i=t.id;this.addIdInLoadRowArray(i);var o={Command:"CloseTradingOrder",data:{accountId:e,id:i},FingetPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:o})},setPositionTabIndex:function(t){this.positionTabIndex=t},symbolsOpenPosition:function(){if(this.dataOpenPosition&&0!==this.dataOpenPosition.length)return Array.from(new Set(this.dataOpenPosition.map((function(t){return t.contractName}))))}}),mounted:function(){var t=this;this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$orderStorage.getOrdersOnStorage()&&!this.dataOpenPosition&&this.$nextTick((function(){t.getDataForTable()}))},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},Hht=Vht,Ght=(i("3804"),i("74db"),Object(C["a"])(Hht,tct,ect,!1,null,"88924baa",null)),qht=Ght.exports,zht=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrapper",style:{width:"100%"},attrs:{id:"chartWrap"}},[e("ModalSettingsTypeQoute"),t.modalAcceptCloseLimit?e("ModalAcceptCloseLimit",{attrs:{position:t.modalAcceptCloseLimit.positions,settings:t.modalAcceptCloseLimit.params}}):t._e(),t.modalCloseOrder?e("ModalAcceptCloseOrders",{attrs:{position:t.modalCloseOrder.positions,settings:t.modalCloseOrder.params}}):t._e(),t.ModalSettingsColor?e("div",{style:{position:"absolute",left:"40%",top:"20%",zIndex:1}},[e("NewModalSettingsColors")],1):t._e(),t.statusLoadChartSize&&t.getSetDataFormatForMultiChart?e("div",{ref:"layout",class:"layout-multichart layout-multichart_".concat(t.getActiveTheme)},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__slideInUp","leave-active-class":"animate__animated animate__slideOutDown"}},[t.getStatusWidgetsAccount?e("WidgetsByAccount",{attrs:{theme:t.getActiveTheme}}):t._e()],1),e("transition",{attrs:{"enter-active-class":"animate__animated animate__slideInUp","leave-active-class":"animate__animated animate__slideOutDown"}},[t.getShowStatusWigetsContracts?e("WidgetsByContracts",{attrs:{theme:t.getActiveTheme}}):t._e()],1),t._l(t.getSetDataFormatForMultiChart,(function(i,o){return t.getStatusWidgetsAccount||t.getShowStatusWigetsContracts||t.isFullScreen&&"groupCharts-".concat(o)!=="groupCharts-".concat(t.isFullScreen.groupIndex)?t._e():e("DxResizable",{key:"indexGroup-getSetDataFormatForMultiChart-".concat(o),attrs:{handles:"bottom","element-attr":{class:"fg"},height:t.heightRows[o],minWidth:0,minHeight:0},on:{resize:function(e){return t.resizeRow(e,o)}}},[e("DxSortable",{attrs:{handle:"#sortable-chart",data:i,"item-orientation":"horizontal",group:"row-chart-from-sortable","element-attr":{class:"flex-to-sortable"}},on:{reorder:function(e){return t.onTaskDrop(e,"top")},add:function(e){return t.onTaskDrop(e,"top")}}},t._l(i,(function(i,n){return t.isFullScreen&&n!==t.isFullScreen.chartIndex?t._e():e("DxResizable",{key:"".concat(i.symbol,"-").concat(n,"-").concat(t.countIter,"-resizeble"),attrs:{handles:t.getHandles([o,n]),"element-attr":{class:"trn fg-".concat(n)},height:t.heightRows[o],width:t.listWidthCells[o][n],minWidth:0,minHeight:0},on:{resize:function(e){return t.resizeCell(e,n,o,i.symbol)}}},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__fadeIn","leave-active-class":"animate__animated animate__fadeOut",mode:"in-out",appear:""}},[i?e("MultichartRefactor",{key:i.symbol+t.countIter,attrs:{configObject:{fullScreen:t.isFullScreen,typeMultichart:t.getTypeMultiChart,dataQuoteButton:i,widthCurrentChart:t.listWidthCells[o][n],heightCurrentChart:t.heightRows[o],groupId:"groupCharts-".concat(o),groupIndex:o,chartIndex:n}},on:{setFullScreen:function(e){return t.setFullScreen(o,n)}}}):t._e()],1)],1)})),1)],1)}))],2):t._e(),e("ModalIndicators",{directives:[{name:"show",rawName:"v-show",value:t.getIndicatorsModalStatus,expression:"getIndicatorsModalStatus"}],attrs:{open:t.getIndicatorsModalStatus}}),e("ModalSettingsIndicator",{directives:[{name:"show",rawName:"v-show",value:t.getSettingsIndicatorModal.status,expression:"getSettingsIndicatorModal.status"}],attrs:{open:t.getSettingsIndicatorModal.status}}),e("ChartControlPanel",{directives:[{name:"show",rawName:"v-show",value:!t.getStatusWidgetsAccount,expression:"!getStatusWidgetsAccount"}]})],1)},Yht=[],Xht=function(){var t=this,e=t._self._c;return e("div",{class:"widgetByAccount widgetByAccount_".concat(t.theme)},[e("UserProfileGrid",{key:t.theme,attrs:{configObject:t.getConfigGrid,minHeight:"800px",recursive:!0}})],1)},Qht=[],Jht=function(){var t=this,e=t._self._c;return e("UserProfileGrid",{attrs:{configObject:t.getConfigGrid,recursive:!0}})},Kht=[],Zht={name:"UserProfileWidgetsSet",props:{configObject:{type:Object},topBarWidgetParams:{type:Object}},computed:{getConfigGrid:function(){return{arrayWidgets:this.configObject.widgets,directionSize:570,downMarginGrid:0,paddingGrid:0,direction:!0}}}},tpt=Zht,ept=(i("2faa"),Object(C["a"])(tpt,Jht,Kht,!1,null,"223460b3",null)),ipt=ept.exports,opt={mixins:[qe],computed:{getPositiveColor:function(){return{color:"light"===this.getActiveTheme?"#008e72":"#00ffac",fill:"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)"}},getNegativeColor:function(){return{color:"light"===this.getActiveTheme?"#E91212":"#FA4C4A",fill:"light"===this.getActiveTheme?"rgba(233, 18, 18, 0.1)":"rgba(250, 76, 74, 0.1)"}},getConfigMaxDD:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.map((function(t,e){return{y:null===t.drawdown?0:t.drawdown,date:t.date,x:e}})),e=t.at(-1).y,i=Math.max.apply(null,t.map((function(t){return t.y}))),o=Math.min.apply(null,t.map((function(t){return t.y})));return{name:"UserProfileWidgetGauge",configObject:{min:0,max:100,percent:2,percentTitle:0,revers:!0,status:!1,pointsForChart:[t],maxLineIndicator:{lines:[0]},minLineIndicator:{lines:[0]},metaInfoForLines:[{type:"line",color:this.getRedColor.color,fill:this.getRedColor.fill,label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"}],widgetTitle:this.$t("max_drawdown"),widgetData:[{data:e,label:"%",title:"",color:this.getRedColor.color},{data:i,label:"%",title:"Max",color:this.getRedColor.color},{data:o,label:"%",title:"Min",color:this.getRedColor.color}],gaudgeTitle:"Max DD"}}}},getConfigLeverage:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.map((function(t,e){return{x:e,y:t.leverage,date:t.date}})),e=0,i=this.getStatistics.account.maxLeverage,o=this.getStatistics.accountDaily.at(-1).leverage,n=100*o/i;return{name:"UserProfileWidgetGauge",configObject:{min:this.$moneyf(e),max:this.$moneyf(i),percent:n,signal:this.getSignalDiagram(n),statusRoundDiagram:!0,percentRoundDiagram:n,percentTitle:o,precision:2,revers:!0,status:!0,statusGaudge:!1,widgetTitle:this.$t("leverage"),widgetData:[{data:o,label:"",title:"",color:this.getGreenColor.color},{data:i,label:"",title:"Max",color:this.getRedColor.color}],gaudgeTitle:"Leverage",pointsForChart:[t],maxLineIndicator:{lines:[0]},minLineIndicator:!1,metaInfoForLines:[{type:"line",color:n>50?this.getRedColor.color:this.getGreenColor.color,fill:n>50?this.getRedColor.fill:this.getGreenColor.fill,label:"",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"}]}}}},getConfigMargin:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.map((function(t,e){return{y:null===t.margin?0:t.margin,x:e,date:new Date(t.date).getTime()}})),e=Math.max.apply(null,t.map((function(t){return t.y}))),i=this.getStatistics.accountDaily.at(-1).margin,o=100*i/this.getStatistics.accountDaily.at(-1).equityClose;return{name:"UserProfileWidgetGauge",configObject:{statusGaudge:!1,statusRoundDiagram:!0,percentRoundDiagram:o,signal:this.getSignalDiagram(o),widgetTitle:this.$t("margin"),widgetData:[{data:i,label:"$",title:"",color:this.getPinkColor.color},{data:e,label:"$",title:"Max",color:this.getPinkColor.color}],pointsForChart:[t],maxLineIndicator:{lines:[0]},minLineIndicator:!1,metaInfoForLines:[{type:"line",color:this.getPinkColor.color,fill:this.getPinkColor.fill,label:"$",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"}]}}}},getConfigSharp:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.map((function(t,e){return{y:null===t.dailySharp?0:t.dailySharp,x:e,date:new Date(t.date).getTime()}})),e=Math.min.apply(null,this.getStatistics.accountDaily.map((function(t){return t.dailySharp}))),i=Math.max.apply(null,this.getStatistics.accountDaily.map((function(t){return t.dailySharp})));i===e&&(i+=1);var o=this.getStatistics.accountDaily.at(-1).dailySharp,n=100*Math.abs(o)/(i-e);return{name:"UserProfileWidgetGauge",configObject:{min:e,max:i,percent:n,percentTitle:o,revers:!1,status:!1,pointsForChart:[t],maxLineIndicator:{lines:[0]},minLineIndicator:{lines:[0]},metaInfoForLines:[{type:"line",color:o>=1?this.getGreenColor.color:this.getRedColor.color,fill:o>=1?this.getGreenColor.fill:this.getRedColor.fill,label:"",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"}],statusGaudge:!1,widgetTitle:this.$t("the_sharpe_ratio"),widgetData:[{data:o,label:"",title:"",color:o<=1?this.getRedColor.color:this.getGreenColor.color},{data:i,label:"",title:"Max",color:i<=1?this.getRedColor.color:this.getGreenColor.color},{data:e,label:"",title:"Min",color:e<=1?this.getRedColor.color:this.getGreenColor.color}],gaudgeTitle:"Sharp Ratio"}}}}},methods:{getSignalDiagram:function(t){switch(!0){case t<=30:return"good";case t>30&&t<=50:return"medium";case t>50&&t<=70:return"warning";case t>70:return"alert";default:return"good"}}}},npt={components:{UserProfileWidgetsSet:ipt},props:{theme:{type:String}},mixins:[opt],data:function(){return{topBarWidgetParams:{row:"normal",col:{index:1,mode:"normal"},directionModeRows:!1}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getStatByMonth:"statistic/getStatByMonth"})),{},{getConfigGistogram:function(){if(this.getStatByMonth){var t=this.getStatByMonth.map((function(t,e){return{data:t.profitRel,time:e,date:new Date(t.date).getTime()}}));return{name:"WidgetProfitGistogram",configObject:{points:t}}}},getProfitOrders:function(){if(this.getStatistics){var t=this.getStatistics.ordersStatistics.closedOrdersCount,e=this.getStatistics.ordersStatistics.positiveOrders,i=Math.round(100*e/t),o=this.getStatistics.ordersStatistics.startTradingDT,n=[],s=[],r=0,a=0;this.getStatistics.accountDaily.forEach((function(t,e){new Date(t.date).getTime()>=new Date(o).getTime()&&(r++,a+=t.procPosOrders,n.push({x:e,y:t.procPosOrders,date:t.date}),s.push({x:e,y:a/r,date:t.date}))}));var c=[n,s];return{name:"UserProfileWidgetGauge",configObject:{statusGaudge:!1,statusRoundDiagram:!0,percentRoundDiagram:i,widgetTitle:this.$t("successful_trades_full"),signal:"good",pointsForChart:c,maxLineIndicator:{lines:[0]},minLineIndicator:{lines:[0]},metaInfoForLines:[{type:"line",color:c[0].at(-1).y>=50?this.getPositiveColor.color:this.getNegativeColor.color,fill:c[0].at(-1).y>=50?this.getPositiveColor.fill:this.getNegativeColor.fill,label:"",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"},{type:"line",color:"orange",fill:"rgba(0,0,0,0)",label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"Средний процент успешных сделок",lineWidth:3}]}}}},getProfitMonthConfig:function(){if(this.getStatByMonth){var t=[[]],e=0;this.getStatByMonth.forEach((function(i,o){i.profitRel>=0&&e++,t.at(-1).push({y:100*e/(o+1),x:new Date(i.date).getTime(),date:new Date(i.date).getTime()})}));var i=this.getStatByMonth.filter((function(t){return t.profitRel>=0})),o=i.length?Math.round(100*i.length/this.getStatByMonth.length):0;return{name:"UserProfileWidgetGauge",configObject:{statusGaudge:!1,statusRoundDiagram:!0,percentRoundDiagram:o,revers:!0,status:!0,signal:"good",widgetTitle:this.$t("successful_months"),gaudgeTitle:"Margin",pointsForChart:t,maxLineIndicator:{lines:[0]},minLineIndicator:{lines:[0]},metaInfoForLines:[{type:"line",color:t[0].at(-1).y>=50?this.getPositiveColor.color:this.getNegativeColor.color,fill:t[0].at(-1).y>=50?this.getPositiveColor.fill:this.getNegativeColor.fill,label:"",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff"}]}}}},getConfigGrid:function(){if(this.getConfigSharp&&this.getConfigMargin&&this.getConfigMaxDD&&this.getProfitMonthConfig&&this.getProfitOrders)return{arrayWidgets:[{name:"WidgetBalanceEquity",configObject:{containerReport:".userProfileTradingTab-tradingChart"}},{name:"UserProfileWidgetsSet",configObject:{widgets:[this.getConfigMaxDD,this.getConfigGistogram,{name:"WidgetSectorDiagramContracts",configObject:{theme:this.theme}},{name:"WidgetCpmpareContracts",configObject:{showControlButton:!0}}]}},{name:"UserProfileWidgetsSet",configObject:{widgets:[this.getProfitMonthConfig,this.getConfigLeverage,this.getConfigSharp,this.getConfigMargin]}},{name:"UserProfileWidgetsSet",configObject:{widgets:[this.getProfitOrders,{name:"WidgetCountOrders"},{name:"WidgetAverProfitOrder",configObject:{mode:"sum",title:this.$t("tifct")}},{name:"WidgetAverProfitOrder",configObject:{mode:"order",title:this.$t("iipt")}}]}}],directionSize:1200,downMarginGrid:0,direction:!0}}})},spt=npt,rpt=(i("c735"),Object(C["a"])(spt,Xht,Qht,!1,null,"f4ab0e88",null)),apt=rpt.exports,cpt=function(){var t=this,e=t._self._c;return e("div",{ref:"wrapWigets",class:"widgetByContracts widgetByContracts_".concat(t.theme)},[t.getStatusTradeAccount?e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams,mode:"widgets",showControlButtons:!1}},[e("div",{class:"widgetByContracts-title widgetByContracts-title_".concat(t.theme)},[t._v(t._s("Статистика по контракту ".concat(t.getSymbol)))])]):t._e(),e("div",{staticClass:"widgetByContracts-content"},[t.activeComponent&&t.getStatusTradeAccount?e(t.activeComponent.component,{tag:"component",attrs:{configObject:t.activeComponent.config,recursive:!0,showControlButton:t.getGridStatus,topBarWidgetParams:t.topBarWidgetParams},on:{setActiveDate:function(e){return t.setActiveDate(e,t.activeComponent.config.period)}}}):t._e(),t.getStatusTradeAccount?t._e():e("div",{class:"widgetByContracts-noTradeContract widgetByContracts-noTradeContract_".concat(t.theme)},[e("div",{staticClass:"widgetByContracts-noTradeIcon"},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",{staticClass:"widgetByContracts-noTradeInfo"},[t._v(t._s("По контракту ".concat(t.getSymbol," не было сделок, либо статистика ещё не сформированна")))])])],1)],1)},lpt=[],upt=function(){var t=this,e=t._self._c;return e("div",{class:"widgetCompateContracts ".concat("horizontalMin"===t.topBarWidgetParams.col.mode?"widgetCompateContracts-minMode":""," widgetPeriodsContract_").concat(t.getActiveTheme)},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:t.configObject.showControlButton},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"widgetCompateContracts-title"},[e("div",{staticClass:"widgetCompateContracts-controlTabs"},[t._l(t.dataLineTypes,(function(i,o){return e("div",{key:"".concat(o,"_b"),staticClass:"widgetCompateContracts-buttons",class:i.status?"widgetCompateContracts-control_isActive-".concat(t.getActiveTheme):"widgetCompateContracts-control_".concat(t.getActiveTheme),on:{click:function(e){return t.setActiveTypeLine(o)}}},[t._v(" "+t._s(i.label))])})),t._l(t.dataButtons,(function(i,o){return e("div",{key:o,staticClass:"widgetCompateContracts-controls",class:i.status?"widgetCompateContracts-control_isActive-".concat(t.getActiveTheme):"widgetCompateContracts-control_".concat(t.getActiveTheme),on:{click:function(e){return t.setActiveType(o)}}},[e("svgIcon",{attrs:{name:i.icon}})],1)}))],2)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"widgetCompateContracts-content"},[e("UserProfileComparisonInstruments",{attrs:{type:t.typeChart,typeLine:t.typeLine}})],1)]},proxy:!0}])})],1)},dpt=[],hpt={name:"WidgetCompareContracts",props:{topBarWidgetParams:{type:Object,default:function(){return{row:"normal",col:{index:1,mode:"normal"},directionModeRows:!1}}},configObject:{type:Object,default:function(){return{showControlButton:!1}}}},components:{UserProfileWrapWidget:PB,UserProfileComparisonInstruments:gB,UserProfileGridWidgetTopBar:nM},data:function(){return{typeLine:"balance",typeChart:"abs",dataButtons:[{icon:"SortDollar",type:"abs",status:!0},{icon:"new-procent-icon",type:"rel",status:!1}],dataLineTypes:[{label:this.$t("balance"),type:"balance",status:!0},{label:this.$t("equity"),type:"equity",status:!1}]}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{setActiveType:function(t){this.typeChart=this.dataButtons[t].type,this.dataButtons.forEach((function(e,i){e.status=i===t}))},setActiveTypeLine:function(t){this.typeLine=this.dataLineTypes[t].type,this.dataLineTypes.forEach((function(e,i){e.status=i===t}))},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setNormal:function(){this.$emit("setNormal")}}},ppt=hpt,gpt=(i("fad5"),Object(C["a"])(ppt,upt,dpt,!1,null,"39f4c07a",null)),fpt=gpt.exports,mpt=function(){var t=this,e=t._self._c;return e("div",{ref:"chartWrap",staticClass:"userProfilePeriodChart-wrapper"},[e("div",{staticClass:"userProfilePeriodChart-chart"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:t.configObject.showControlButton},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{ref:"titleWrap",staticClass:"userProfilePeriodChart-titleWrap",style:{width:"".concat(t.widthForTitle+32,"px")}},[e("div",{staticClass:"userProfilePeriodChart-title",style:{marginLeft:t.configObject.showTabButtons?"-8px":"0px"}},[t.configObject.showTabButtons?e("div",{staticClass:"userProfilePeriodChart-periodButton"},t._l(t.periodsButtons,(function(i,o){return e("ButtonIconFlat",{attrs:{icon:{name:i.icon},modifier:{class:["userProfilePeriodChart-button",t.period===i.period?"userProfilePeriodChart-button_isActive_".concat(t.getActiveTheme):"userProfilePeriodChart-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setPeriod(i.period)}}})})),1):t._e(),t.getTitle?e("div",{staticClass:"userProfilePeriodChart-infoTitle",attrs:{title:"".concat(t.getTitle[0]," ").concat(t.getTitle[1]," ").concat(t.$moneyf(t.getTitle[2])," ").concat(t.$moneyf(t.getTitle[3]))}},[e("div",{class:"userProfilePeriodChart-titleDate userProfilePeriodChart-titleDate_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitle[0]))]),e("div",{staticClass:"userProfilePeriodChart-titleText"},[t._v(t._s(t.getTitle[1]))]),e("div",{staticClass:"userProfilePeriodChart-titleText"},[t._v(t._s(t.getTitle[2])+" ")]),e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getTitle[3]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getTitle[3]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v("$ "+t._s(t.$moneyf(t.getTitle[3]))+" ")])]),e("div",{class:"userProfilePeriodChart-titleProfit userProfilePeriodChart-titleProfit_".concat(t.getActiveTheme,"-").concat(t.getTitle[4]<0?"negative":"positive")},[e("div",{staticClass:"userProfilePeriodChart-titleProfit-icon"},[e("svgIcon",{attrs:{name:t.getTitle[4]<0?"Arrow-nano-bottom":"Arrow-nano-top",size:21}})],1),e("div",{staticClass:"userProfilePeriodChart-titleProfit-result"},[t._v("% "+t._s(t.$pricef(t.getTitle[4],2)))])])]):t._e()]),e("div",{staticClass:"userProfilePeriodChart-dateControl"},[t.getLastDates&&t.widthForTitle>610?e("div",{staticClass:"userProfilePeriodChart-lastDates"},t._l(t.getLastDates,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-lastDatesItem userProfilePeriodChart-lastDatesItem_".concat(t.getActiveTheme," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive"," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(t.checkActiveDate(i.date)?"isAcitve":"noActive"),on:{click:function(e){return t.setActiveDate(i.date)},mouseenter:function(e){return t.setHoverIndex(o)},mouseleave:function(e){return t.setHoverIndex(null)}}},[t._v(t._s(i.title)),t.hoverIndex===o?e("div",{class:"userProfilePeriodChart-hoverWidgetlastDates userProfilePeriodChart-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive")},[e("div",[t._v("$ "+t._s(t.$moneyf(i.profit,2)))]),e("div",[t._v("% "+t._s(t.$moneyf(i.profitRel,2)))])]):t._e()])})),0):t._e(),e("div",{staticClass:"userProfilePeriodChart-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1)])]),t.dateCheckerStatus?e("DataChartChecker",{attrs:{positionPopup:{my:"top right",at:"bottom right",of:t.containerForDataChecker,offset:{x:0,y:5}},statistic:t.getStatisticsByDateChecker,period:t.period,activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()]},proxy:!0},{key:"content",fn:function(){return[t.points&&t.getStatByDate.length?e("SectorLineEventChart",{key:t.points[0][0].y,attrs:{typeXAxis:t.period,points:t.points,theme:t.getActiveTheme,interval:t.intervalGrid,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},dayExchengeIndicator:"day"===t.period},on:{hover:t.hoverPoint}}):e("Preloader",{attrs:{enabled:!0}}),t.showHoverWidget?e("div",{class:"userProfilePeriodChart-hoverWidget userProfilePeriodChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-hoverWidgetRow userProfilePeriodChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"userProfilePeriodChart-hoverWidgetStat userProfilePeriodChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):e("div",{staticClass:"userProfilePeriodChart-noStat"},[e("div",{staticClass:"userProfilePeriodChart-noStatWrap"},[e("div",{staticClass:"userProfilePeriodChart-noStatIcon"},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",{staticClass:"userProfilePeriodChart-noStatText"},[t._v(t._s(t.getTextNoData))])])])]},proxy:!0}])})],1),t.getStatusShowGistogram?e("div",{staticClass:"userProfilePeriodChart-gistogramm"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showTitle:!1},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"userProfilePeriodChart-gistogrammWrap"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)]},proxy:!0}],null,!1,3972524605)})],1):t._e()])},vpt=[],ypt={computed:{getStatByDate:function(){var t={month:this.getStatByMonthes,week:this.getStatByWeek,day:this.getStatByDay,year:this.getStatByYear};return t[this.period]},getStatByYears:function(){if(this.contractStatistic){var t=[];t.push({year:new Date(this.contractStatistic[0][3]).getFullYear(),date:this.contractStatistic[0][3],profitAbs:this.contractStatistic[0][1],profitRel:100*this.contractStatistic[0][1]/this.contractStatistic[0][8]});for(var e=1;e410&&this.simpleChartSize.width>460},getRowStatus:function(){return this.topBarWidgetParams},getUTCTime:function(){var t;return null===(t=this.getServerTime)||void 0===t?void 0:t.utcNow},getConfigObjectForGistogramm:function(){if(this.intervalGrid&&this.yPointsForGistogramm)return{period:this.period,sizeColumn:this.intervalGrid,grid:{status:!0,xPoints:this.xPoints,yPoints:this.yPointsForGistogramm,intervalGrid:this.intervalGrid,label:"month"===this.period||"day"===this.period?"value":"day",labelShow:!0}}},getTitle:function(){return"month"===this.period?this.getTitleForMonth:"week"===this.period?this.getTitleForWeek:"day"===this.period?this.getTitleForDay:void 0},getTitleForMonth:function(){return[this.configObject.contract,"".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()),this.$t("pl"),this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]},getProfitForDate:function(){if(this.getStatByDate&&this.getStatByDate.length){var t=100*(this.getEquityClose-this.getOpenEquity)/this.getOpenEquity;this.getOpenEquity<0&&this.getEquityClose<0&&(t*=-1);var e=this.getEquityClose-this.getOpenEquity;return{profitAbs:e,profitRel:t}}},getTitleForDay:function(){return this.getStatByDate&&this.getStatByDate.length?[this.configObject.contract,"".concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime),"P/L",this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]:[this.configObject.contract,"".concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime)]},getTitleForWeek:function(){if(this.getProfitForDate)return[this.configObject.contract,"".concat(this.$t("week")," ").concat(new Date(this.activeDate).getWeek()),"P/L",this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]},getStatByDay:function(){var t=this;if(this.activeDate&&this.contractStatisticByHourse){var e=this.contractStatisticByHourse.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e[3]).getMonth()===new Date(t.activeDate).getMonth()&&new Date(e[3]).getDate()===new Date(t.activeDate).getDate()}));return e}},getStrokeColors:function(){return{positive:"light"===this.getActiveTheme?"#008e72":"#00ffac",negative:"light"===this.getActiveTheme?"#da0000":"#ff3232"}},getFillColors:function(){return{positive:"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)",negative:"light"===this.getActiveTheme?"rgba(218, 0, 0, 0.1)":"rgba(255, 50, 50, 0.1)"}}}),methods:{setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},hoverPoint:function(t){if(t){var e=this.points[1].findIndex((function(e){return e.date===t.point.date}));if(this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+10,"px")},e>0){var i=100*(this.points[1][e].y-this.getOpenEquity)/this.getOpenEquity;this.points[1][e].y<0&&this.getOpenEquity<0&&(i*=-1),this.statsForHoverWidget=[{stat:"$ ".concat(this.$moneyf(this.points[1][e].y,this.points[1][e].y>=1e6?0:2)),color:i>=0?"green":"red"},{stat:"% ".concat(this.$moneyf(i,2)),color:i>=0?"green":"red"}]}this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setHoverIndex:function(t){this.hoverIndex=t},setMessageHandler:function(t){var e=this;if(t&&t.command&&"AccountsDetails"===t.command){var i=t.data.find((function(t){return t.account.id===e.accountId}));if(i){var o=i.openOrders.tradingOrders;if(o.length){var n=o.filter((function(t){return t.instrumentName===e.configObject.contract}));n.length&&this.checkActualDate()&&("day"===this.period?this.$set(this.contractStatisticByHourse.at(-1),1,n.reduce((function(t,e){return t+e.profit}),0)):this.$set(this.contractStatistic.at(-1),1,n.reduce((function(t,e){return t+e.profit}),0)))}}}},checkActualDate:function(){var t=new Date(this.activeDate),e=new Date(this.actualServerDate),i={day:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),month:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth(),week:t.getFullYear()===e.getFullYear()&&t.getWeek()===e.getWeek()};return i[this.period]},setPeriod:function(t){this.period=t},checkActiveDate:function(t){var e={month:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.activeDate).getMonth(),week:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getWeek()===new Date(this.activeDate).getWeek(),day:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.activeDate).getMonth()&&new Date(t).getDate()===new Date(this.activeDate).getDate()};return e[this.period]},setStatForLastDates:function(t){return"day"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getDate(),profit:t.profitAbs,profitRel:t.profitRel}})):"week"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getWeek(),profit:t.profitAbs,profitRel:t.profitRel}})):"month"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getMonth()+1,profit:t.profitAbs,profitRel:t.profitRel}})):void 0},setActiveDate:function(t){this.activeDate=t},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},setPointsForChart:function(){var t=this;if(this.getStatByDate.length){var e;"week"===this.period?e=7:"month"===this.period?e=new Date(this.activeDate).daysInMonth():"day"===this.period&&(e=24),this.intervalGrid=Math.round(this.simpleChartSize.width/e),this.points=[[]],this.pointsForGistogramm=[[]];for(var i=function(e){var i;if("day"===t.period?i=t.getStatByDate.find((function(t){return new Date(t[3]).getHours()===e})):"week"===t.period?i=t.getStatByDate.find((function(t){return new Date(t[3]).getDay()?new Date(t[3]).getDay()-1===e:6})):"month"===t.period&&(i=t.getStatByDate.find((function(t){return new Date(t[3]).getDate()===e+1}))),i){t.points[0].push({x:e,y:i[1],date:i[3]});var o=100*(i[1]-t.getOpenEquity)/t.getOpenEquity;i[1]<0&&t.getOpenEquity&&(o*=-1),t.pointsForGistogramm[0].push({x:e,y:o,date:i[3]})}else t.points[0].push({x:e}),t.pointsForGistogramm[0].push({x:e})},o=0;o0?-334:58}},on:{close:t.openStatsChartWidget}}):t._e(),e("TradingVue",{ref:"tvjs-".concat(t.getGroupId,"-").concat(t.getSymbol,"-").concat(t.getTimeFrame),attrs:{strokeStyle:"white","legend-buttons":t.getLegendButtons,data:t.dataCube,width:t.getSizeChart.width,height:t.getSizeChart.height-38,id:"chart-".concat(t.getGroupIndex,"-").concat(t.getChartIndex),skin:t.getColor.colorBack?t.getColor.colorBack:"Alps",colorCross:t.getColor.colorCross,colorCandleDw:t.getColor.colorCandleDw,colorCandleUp:t.getColor.colorCandleUp,colorGrid:t.getColor.colorGrid,colorPanel:t.getColor.colorPanel,colorText:t.getColor.colorText,colorWickUp:t.getColor.colorCandleUp,colorWickDw:t.getColor.colorCandleDw,colorBack:t.getColor.colorBack,color:"#fff",titleTxt:" ",overlays:t.overlays,"chart-config":t.getChartConfig,colorHightilght:t.getColor.hightilght,"color-back":t.getColor.colorBack,"color-grid":t.getColor.colorGrid,"color-text":t.getColor.colorText,precision:t.getPrecision},on:{"legend-button-click":t.clickOnLegend}})],1)]):t._e()])},xpt=[],Opt=(i("5b81"),i("8af7")),wpt=i.n(Opt),_pt=function(){var t=this,e=t._self._c;return e("div",{ref:"topBarMultiChart",staticClass:"topBarMultiChart",class:t.dataQuoteButton.selected&&"one-chart-first"!==t.typeMultiChart?"topBarMultiChart_".concat(t.getActiveTheme," topBarMultiChart-select_").concat(t.getActiveTheme):"topBarMultiChart_".concat(t.getActiveTheme)},[e("div",{staticClass:"topBarMultiChart-leftSideMenu",on:{mouseleave:t.hiddenGroupButton}},["one-chart-first"===t.typeMultiChart||t.getShowStatusWigetsContracts?t._e():e("div",{class:"topBarMultiChart-dragButton topBarMultiChart-dragButton_".concat(t.getActiveTheme),attrs:{id:"sortable-chart"}},[e("svgIcon",{attrs:{name:"Drag"}})],1),t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])&&t.getStatByContract?e("DxButton",{attrs:{icon:t.$iconPath("Wigets"),hoverStateEnabled:!1,elementAttr:{class:"topBarMultiChart-buttonItem ".concat(t.getShowStatusWigetsContracts?"topBarMultiChart-buttonItem_isActive-".concat(this.getActiveTheme):"topBarMultiChart-buttonItem_isIconActive_".concat(this.getActiveTheme))}},on:{click:t.openWigetsContract}}):t._e(),t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])&&t.getStatByContract?e("DxButton",{attrs:{icon:t.$iconPath("holow-pig"),hoverStateEnabled:!1,elementAttr:{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_isIconActive_".concat(this.getActiveTheme)}},on:{click:t.openPigForContract}}):t._e(),t._l(t.getDropDownsComponents,(function(i,o){return e(i.component,{key:o+"dd",tag:"component",class:"topBarMultiChart-dropDown-".concat(t.dataQuoteButton.id),attrs:{position:i.position,content:i.content,size:i.size,defaultSelected:i.defaultSelected},on:{clickIcon:function(e){return t.onSelectListItem(e,i.content.keyOptions)}}})})),"one-chart-first"!==t.typeMultiChart?e("ButtonInfo",{attrs:{dataBtn:t.dataQuoteButton,modePosition:"selectButton",containerForGroupButtons:".topBarMultiChart-leftSideMenu",statusGroupButtons:t.statusGroupButtons,userStatus:t.statusUser,symbol:t.dataQuoteButton.symbol,last24HClosePrice:t.last24HClosePrice,ordersForAccount:t.ordersForAccount,mode:t.getModeButtonInfo,modifier:"group flat selectField"},on:{setStatusGroupButtons:t.setStatusGroupButtons}},[t._v(t._s(t.dataQuoteButton.symbol))]):t._e(),e("div",{staticClass:"topBarMultiChart-leftSideMenu__fullMode"},[t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])?e("DxButton",{attrs:{icon:t.$iconPath("ordersWidget"),elementAttr:t.getClassForLeftButton,disabled:!t.getOrderByFilter},on:{click:t.openOrdersPanel}}):t._e(),t._l(t.listButtons,(function(i,o){return e(i.component,{key:"".concat(o,"_lb"),ref:i.icon,refInFor:!0,tag:"component",attrs:{icon:t.$iconPath(i.icon),elementAttr:t.getClassForLeftButton,id:"buttonItem_".concat(t.dataQuoteButton.id,"-").concat(i.icon),disabled:i.disabled},on:{click:function(e){return t.eventButtonHendler(e,i.hendler)}}})})),t.listDropDown[0].items.length?e("DxMenu",{key:t.listDropDown[0].items.length,attrs:{items:t.listDropDown},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",[e(o.component,{tag:"component",attrs:{icon:t.$iconPath(o.icon),elementAttr:o.name?t.getClassForButtonSettingMenu:t.getClassForRightButton},on:{click:function(e){return t.eventButtonHendler(e,o.hendler)}}})],1)]}}],null,!1,626723932)}):t._e()],2)],2),t.showRightSideMenu&&"one-chart-first"!==t.typeMultiChart&&!t.getShowStatusWigetsContracts?e("div",{staticClass:"topBarMultiChart-rightSideMenu"},[e("DxButton",{attrs:{icon:t.getIconForFullScreen,elementAttr:t.getClassForRightButton},on:{click:t.setFullScreen}}),e("DxButton",{attrs:{icon:t.$iconPath("Close"),elementAttr:t.getClassForRightButton},on:{click:t.removeChart}})],1):t._e(),t.statusContractWidget?e("div",{staticClass:"topBarMultiChart-widgetContract"},[e("ButtonIconFlat",{attrs:{icon:{name:"normal"===this.topBarWidgetParams.row?"Expand":"Unexpand"},modifier:{class:["topBarMultiChart-buttonItem","topBarMultiChart-buttonItem_".concat(this.getActiveTheme)]}},on:{click:t.setFullScreenMode}})],1):t._e(),t.getWidthWrap<438?e("div",{class:"topBarMultiChart-shadowBlock topBarMultiChart-shadowBlock_".concat(t.getActiveTheme)}):t._e()])},Apt=[],Dpt={components:{DxMenu:Iat.a,DxButton:cc.a,ButtonInfo:lat,DropdownSelectIcon:Zrt},props:{dataQuoteButton:{require:!0},typeMultiChart:{type:String},statusContractWidget:{type:Boolean},topBarWidgetParams:{type:Object,default:function(){return{row:"full"}}},fullScreen:{default:!1},statusUser:{type:Object},groupId:{require:!1}},mixins:[Xh],data:function(){return{wrapWidth:0,statusInfoWidgetContract:!1,allTypes:Vrt,timeFrames:ES,chartTypes:US,last24HClosePrice:[],ordersForAccount:null,resizeObserver:null,modeMinimazeUser:!1,showRightSideMenu:!0,showMinimazeMenu:!1,listButtons:[],listDropDown:[{id:"1",name:"",component:"DxButton",icon:"Settings",items:[]}],statusGroupButtons:""}},watch:{getActiveTheme:function(){var t=this;this.showRightSideMenu=!1,this.$nextTick((function(){t.showRightSideMenu=!0}))},getStatusWidgetsAccount:function(t){t&&this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!1})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getToken:"auth/getToken",getActiveTheme:"headerSettings/getActiveTheme",getUsingAccountContracts:"contracts/getUsingAccountContracts",getStatusWidgetsContracts:"settingsTradingChart/getStatusWidgetsContracts",getStatusWidgetsAccount:"settingsTradingChart/getStatusWidgetsAccount",getStatusStatByContract:"contracts/getStatusStatByContract"})),{},{getClassForLeftButton:function(){return Object(Vt["a"])({class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_".concat(this.getActiveTheme)},"data-info","buttonIcon-".concat(this.dataQuoteButton.id))},getWidthWrap:function(){return this.wrapWidth},getStatByContract:function(){var t=this;if(this.getUsingAccountContracts&&this.getStatusStatByContract){var e=JSON.parse(sessionStorage.getItem("statContract".concat(this.dataQuoteButton.symbol))),i=this.getUsingAccountContracts.some((function(e){return e===t.dataQuoteButton.symbol}));return e&&e.length&&i}},getShowStatusWigetsContracts:function(){return this.getStatusWidgetsContracts.status},getIconForFullScreen:function(){return this.fullScreen?this.$iconPath("Unexpand"):this.$iconPath("Expand")},getClassForRightButton:function(){return{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_".concat(this.getActiveTheme)}},getCountOrders:function(){if(this.ordersForAccount)return this.ordersForAccount.length},getOrderByFilter:function(){var t=this;if(this.ordersForAccount&&this.ordersForAccount.length)return this.ordersForAccount.some((function(e){return e.instrumentName===t.dataQuoteButton.symbol}))},getClassForButtonSettingMenu:function(){return{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItemMenu_".concat(this.getActiveTheme)}},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getActiveQuotes:function(){return this.getActiveScreenInfo.activeButtons},getActiveMultiChartQuotes:function(){return this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.find((function(t){return t.selected})).setButtons},getModeButtonInfo:function(){return"owner"===this.statusUser.status?this.getTradingTopBarSettings.modeButtonInfo:"averPrice"},getDropDownSetTimeFrame:function(){return{width:"120px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-dropDown-".concat(this.dataQuoteButton.id),offset:{x:20,y:0}},items:ES,keyOptions:"timeFrame"}},getDropDownList:function(){return{width:"196px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-settingsDropDown-".concat(this.dataQuoteButton.id),offset:{x:0,y:0}},items:this.listDropDown,keyOptions:"type"}},getDropDownSetChartType:function(){return{width:"196px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-dropDown-".concat(this.dataQuoteButton.id),offset:{x:57,y:0}},items:US,keyOptions:"type"}},getStaticButtonWidth:function(){var t="one-chart-first"===this.typeMultiChart?0:"compact"===this.getTradingTopBarSettings.modeButtonInfo?110:185,e="one-chart-first"===this.typeMultiChart?this.getStatByContract?160:64:this.getStatByContract?280:152;return t+e},getDropDownsComponents:function(){var t=this;return[{component:"DropdownSelectIcon",type:"timeFrame",content:this.getDropDownSetTimeFrame,position:this.getDropDownSetTimeFrame.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:ES.find((function(e){return e.timeFrame===t.dataQuoteButton.timeFrame})).timeFrame},{component:"DropdownSelectIcon",type:"chartType",content:this.getDropDownSetChartType,position:this.getDropDownSetChartType.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:this.chartTypes.find((function(e){return e.type===t.dataQuoteButton.chartType})).type}]},getButtons:function(){return[{component:"DxButton",name:"Trading-open-new-order",userStatus:["unauthTradingghost","authTradingowner","authUserProfileowner"],id:"1_6",icon:"Trading-open-new-order",hendler:"newOrder",disabled:!1},{component:"DxButton",name:"Limitorder",userStatus:["authTradingowner","authUserProfileowner"],id:"1_6",icon:"Limitorder",hendler:"newPendingOrder",disabled:!1},{component:"DxButton",name:"Zoom-in",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_7",icon:"Zoom-in",hendler:"zoomIn",disabled:!1},{component:"DxButton",name:"Zoom-out",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_8",icon:"Zoom-out",hendler:"zoomOut",disabled:!1,status:!0},{component:"DxButton",name:"Color",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_10",icon:"Color",hendler:"",disabled:!1},{component:"DxButton",name:"Instrument-indicator",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_12",icon:"Instrument-indicator",hendler:"openModalIndicators",disabled:!1},{component:"DxButton",name:"Sync_1",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_9",icon:"Sync_1",hendler:"resetChart",disabled:!1,status:!0}]}}),methods:{setFullScreenMode:function(){this.$emit("setFullScreenMode")},hiddenGroupButton:function(){this.statusGroupButtons=""},resetChart:function(){this.$emit("resetChart")},zoomIn:function(){this.$emit("zoomIn",{screen:this.dataQuoteButton})},zoomOut:function(){this.$emit("zoomOut",{screen:this.dataQuoteButton})},setStatusGroupButtons:function(t){this.statusGroupButtons=t},openModalIndicators:function(){this.$store.dispatch("modal/switchIndicatorsModal")},openPigForContract:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,payload:this.dataQuoteButton.symbol,modalComponentName:"UserProfileEquityBalanceContractWidget",title:"Баланс/Средства по ".concat(this.dataQuoteButton.symbol),width:"80%",height:"90%"})},openWigetsContract:function(){this.getShowStatusWigetsContracts?this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!1}):this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!0})},openMinimazeMenu:function(){this.showMinimazeMenu=!this.showMinimazeMenu},clickOutside:function(t){this.$el.contains(t.target)&&27!==t.keyCode||this.showMinimazeMenu&&(this.showMinimazeMenu=!1)},setDropDownHendler:function(t,e,i){this[e](t,i)},switchModeLeftSide:function(){this.modeMinimazeUser=!this.modeMinimazeUser},eventButtonHendler:function(t,e){"function"===typeof this[e]&&this[e](t)},setMessageHendler:function(t){t&&t.command&&"BrokerPosition"===t.command&&this.debouncer("setOrdersForAccount",500)},setOrdersForAccount:function(){this.ordersForAccount=null,this.ordersForAccount=this.$orderStorage.getOrdersOnStorage().tradingOrders},removeChart:function(){var t=this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.findIndex((function(t){return t.selected}));this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"removeNewButtonInMultichartSet",data:{fromIndex:t,btn:this.dataQuoteButton}}),this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewTypeChartForActiveScreen",data:{indexActiveScreen:this.getActiveScreenInfo,indexActiveSet:this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.findIndex((function(t){return t.selected})),data:this.allTypes[this.getActiveMultiChartQuotes.length-1][0].name}}),this.$emit("removeChart")},setFullScreen:function(){var t=sessionStorage.getItem("fullScreens"),e=t?JSON.parse(t):{};e[this.dataQuoteButton.id]=e[this.dataQuoteButton.id]?!e[this.dataQuoteButton.id]:this.dataQuoteButton,sessionStorage.setItem("fullScreens",JSON.stringify(e)),this.$emit("setFullScreen")},setMenuHendler:function(t){t.itemData.hendler?this[t.itemData.hendler]():!t.itemData.hendler&&t.itemData.type&&this.onSelectListItem(t.itemData,t.itemData.timeFrame?"timeFrame":"chartType")},onSelectListItem:function(t,e){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewOptionForButtonQuoteActiveScreen",data:{id:this.dataQuoteButton.id,keyOption:"timeFrame"===e?"timeFrame":"chartType",newValue:t.type},role:this.statusUser})},newOrder:function(){this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.dataQuoteButton.symbol,type:"MomentOrder"})},newPendingOrder:function(){this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.dataQuoteButton.symbol,type:"PendingOrder"})},openOrdersPanel:function(){this.$store.dispatch("modal/switchOrdersPanel",{status:!0,data:{symbol:this.dataQuoteButton.symbol,role:this.statusUser,target:"buttonIcon-".concat(this.dataQuoteButton.id)}})},ver:function(){var t=new ResizeObserver(this.onResize);t.observe(this.$refs.topBarMultiChart),this.resizeObserver=t},getShowUserStatus:function(t){var e="".concat(this.statusUser.user).concat(this.statusUser.route).concat(this.statusUser.status);return t.some((function(t){return t===e}))},onResize:function(){var t=this,e=this.$refs.topBarMultiChart.clientWidth-this.getStaticButtonWidth,i=Math.floor(e/32);this.wrapWidth=this.$refs.topBarMultiChart.clientWidth,this.listButtons=[],this.listDropDown[0].items=[],this.getButtons.forEach((function(e,o){o=i&&t.getShowUserStatus(e.userStatus)&&t.listDropDown[0].items.push(e)}))}},mounted:function(){var t=this;this.$socketStream.$on("apiWS",this.setMessageHendler),this.$orderStorage.getOrdersOnStorage()&&(this.ordersForAccount=this.$orderStorage.getOrdersOnStorage().tradingOrders),this.last24HClosePrice=JSON.parse(localStorage.getItem("Last24HClosePrice")),this.$nextTick((function(){t.ver()})),window.addEventListener("click",this.clickOutside)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHendler)},beforeDestroy:function(){this.resizeObserver&&this.resizeObserver.unobserve(this.$refs.topBarMultiChart),window.removeEventListener("click",this.clickOutside)}},kpt=Dpt,Ipt=(i("8efc"),Object(C["a"])(kpt,_pt,Apt,!1,null,null,null)),Bpt=Ipt.exports;function Mpt(t,e,i){var o=6e4*e,n=new Date(null!==i&&void 0!==i&&i.utcNow?i.utcNow:(new Date).toISOString());return e>1e3?t.getDate()===n.getDate():360===e?Math.ceil(t.getTime()/o)===Math.floor(n.getTime()/o):Math.floor(t.getTime()/o)===Math.floor(n/o)}function $pt(t,e){var i=new Date(t);return 1440===e?new Date(i.getFullYear(),i.getMonth(),i.getDate()):e>=60?new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(i.getHours()/(e/60))*(e/60)):e<60?new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),Math.floor(i.getMinutes()/e)*e):void 0}var Lpt,Fpt,jpt,Rpt,Wpt,Npt,Ept,Upt,Vpt,Hpt,Gpt=function(){var t=this,e=t._self._c;return e("div",{class:"balanceEquityWidget"},[e("DxPopup",{attrs:{visible:t.visible,shading:!1,showCloseButton:!1,width:230,height:"contract"===t.mode?195:"auto",container:t.container,position:{my:"left top",at:"left top",of:t.container,offset:t.offset}},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{class:"balanceEquityWidget-infoWidgetTitle balanceEquityWidget-infoWidgetTitle_".concat(t.getActiveTheme)},[e("div",{class:"balanceEquityWidget-infoWidgetTitle-text"},[t._v(t._s(t.getTitle))]),e("div",{class:"balanceEquityWidget-infoWidgetTitle-close",on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return[e("div",{class:"balanceEquityWidget-infoWidgetContent balanceEquityWidget-infoWidgetContent_".concat(t.getActiveTheme)},[t._l(t.getListStatistic,(function(i,o){return e("div",{key:o,staticClass:"balanceEquityWidget-infoWidgetContent-item"},[e("div",{class:"balanceEquityWidget-infoWidgetContent-text balanceEquityWidget-infoWidgetContent-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))]),e("div",{class:"balanceEquityWidget-infoWidgetContent-devider balanceEquityWidget-infoWidgetContent-devider_".concat(t.getActiveTheme)}),e("div",{class:"balanceEquityWidget-infoWidgetContent-data balanceEquityWidget-infoWidgetContent-data_".concat(t.getActiveTheme,"-").concat(o?i.data.value<0?"negative":"positive":"blue")},[t._v(t._s(i.data.label))])])})),"contract"===t.mode&&t.getProfitOrdersPercent?e("div",{staticClass:"balanceEquityWidget-diagram"},[e("div",{class:"balanceEquityWidget-infoWidgetContent-text balanceEquityWidget-infoWidgetContent-text_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("successful_trades_full")))]),e("div",{staticClass:"balanceEquityWidget-diagramChart"},[e("ProgressRoundDiagram",{key:t.getActiveTheme,attrs:{width:60,height:60,fontSize:15,percent:Math.round(t.getProfitOrdersPercent)}})],1)]):t._e()],2)]},proxy:!0}])})],1)},qpt=[],zpt={props:{visible:{type:Boolean,default:!1},offset:{type:[Number,Object],default:8},container:{type:String},mode:{type:String,default:"account"},symbol:{type:String,default:"EURUSD"}},mixins:[bM],components:{DxPopup:To["DxPopup"],ProgressRoundDiagram:c$},data:function(){return{typeChart:"rel",statByMonthForContract:null,userClosedOrdersByContract:null,accountId:null}},watch:{getStatByOrders:function(t){var e=this;t&&(this.userClosedOrdersByContract=this.$orderStorage.getOrdersOnStorage().closedOrders.filter((function(t){return t.instrumentName===e.symbol})))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatByMonth:"statistic/getStatByMonth",getStatistics:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders"})),{},{getTitle:function(){return"account"===this.mode?"".concat(this.$t("income")," ").concat(this.$t("by_account")):"".concat(this.$t("iutct")," ").concat(this.symbol)},getBalanceClose:function(){return this.contractStat&&this.contractStat.length?this.contractStat[this.contractStat.length-1][4]:0},getEquityClose:function(){return this.contractStat&&this.contractStat.length?this.contractStat.at(-1)[1]:0},getProfitMonthes:function(){if(this.statByMonthForContract){if(!this.statByMonthForContract.length)return 0;var t=this.statByMonthForContract.filter((function(t){return t.profit>=0}));return t.length?100*t.length/this.statByMonthForContract.length:0}},getProfitOrdersPercent:function(){if(this.userClosedOrdersByContract){if(!this.userClosedOrdersByContract.length)return 0;var t=this.userClosedOrdersByContract.filter((function(t){return t.profit>=0}));return t.length?100*t.length/this.userClosedOrdersByContract.length:0}},getSumVolume:function(){if(this.contractStat&&this.contractStat.length)return this.contractStat[this.contractStat.length-1][7]},getAverProfitByMonth:function(){if(!this.statByMonthForContract||!this.statByMonthForContract.length)return 0;var t=this.statByMonthForContract.reduce((function(t,e){return t+e.profitRel}),0)/this.statByMonthForContract.length;return t},getListStatistic:function(){return"account"===this.mode?this.getInfoWidgetItemsAccount:this.getInfoWidgetItemsContract},getDateBeginTrading:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.startTradingDT?new Date(this.getStatistics.ordersStatistics.startTradingDT).getTime():new Date(this.getStatistics.accountDaily[0].date).getTime()},getPercentProfitMonth:function(){if(this.getStatByMonth){var t=this.getStatByMonth.filter((function(t){return t.profitAbs>0})).length,e=100*t/this.getStatByMonth.length;return e}},getPercentProfitOrder:function(){if(this.getStatistics)return 100*this.getStatistics.ordersStatistics.positiveOrders/this.getStatistics.ordersStatistics.closedOrdersCount},getStartDeposit:function(){var t=this;if(this.getDateBeginTrading){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getFullYear()===new Date(t.getDateBeginTrading).getFullYear()&&new Date(e.date).getMonth()===new Date(t.getDateBeginTrading).getMonth()&&new Date(e.date).getDate()===new Date(t.getDateBeginTrading).getDate()}));return e?e.equityOpen:e}},getProfitAbs:function(){if(this.getStatistics&&this.getStartDeposit){var t=this.getStatistics.accountDaily[this.getStatistics.accountDaily.length-1].equityClose;return t?t-this.getStartDeposit:t}},getProfitRel:function(){if(void 0!==this.getProfitAbs)return 100*this.getProfitAbs/this.getStartDeposit},getInfoWidgetItemsContract:function(){return[{text:"".concat(this.$t("total")," ").concat(this.$t("current")),data:{label:new Intl.NumberFormat("en",{style:"currency",currency:this.getStatistics.account.assetCode}).format(this.getBalanceClose),value:this.getBalanceClose}},{text:"".concat(this.$t("total")," ").concat(this.$t("income")),data:{label:new Intl.NumberFormat("en",{style:"currency",currency:this.getStatistics.account.assetCode}).format(this.getEquityClose),value:this.getEquityClose}},{text:this.$t("trading_volume"),data:{label:this.$moneyf(this.getSumVolume),value:this.getSumVolume}},{text:this.$t("aipm"),data:{label:"% ".concat(this.$moneyf(this.getAverProfitByMonth,2)),value:this.getAverProfitByMonth}},{text:this.$t("successful_months"),data:{label:"% ".concat(this.getProfitMonthes?this.getProfitMonthes.toFixed(2):0),value:this.getProfitMonthes}}]},getInfoWidgetItemsAccount:function(){var t=this;if(this.getStatistics&&this.getStatByMonth)return[{text:this.$t("balance"),data:{label:new Intl.NumberFormat("en",{style:"currency",currency:this.getStatistics.account.assetCode}).format(this.getStatByMonth[this.getStatByMonth.length-1].balanceClose),value:this.getStatByMonth[this.getStatByMonth.length-1].balanceClose}},{text:this.$t("equity"),data:{label:new Intl.NumberFormat("en",{style:"currency",currency:this.getStatistics.account.assetCode}).format(this.getStatByMonth[this.getStatByMonth.length-1].equityClose),value:this.getStatByMonth[this.getStatByMonth.length-1].equityClose}},{text:"".concat(this.$t("current")," P/L"),data:{label:new Intl.NumberFormat("en",{style:"currency",currency:this.getStatistics.account.assetCode}).format(this.getStatByMonth[this.getStatByMonth.length-1].equityClose-this.getStatByMonth[this.getStatByMonth.length-1].balanceClose),value:this.getStatByMonth[this.getStatByMonth.length-1].equityClose-this.getStatByMonth[this.getStatByMonth.length-1].balanceClose}},{text:"".concat(this.$t("total")," ").concat(this.$t("income")),data:{label:"".concat("rel"===this.typeChart?"%":"$"," ").concat("rel"===this.typeChart?this.$moneyf(this.getProfitRel):this.$moneyf(this.getProfitAbs)),value:"rel"===this.typeChart?this.getProfitRel:this.getProfitAbs}},{text:this.$t("max"),data:{label:"".concat("rel"===this.typeChart?"%":"$"," ").concat(Math.max.apply(null,this.getStatByMonth.map((function(e){return"rel"===t.typeChart?e.profitRel:e.profitAbs}))).toFixed(2)),value:Math.max.apply(null,this.getStatByMonth.map((function(e){return"rel"===t.typeChart?e.profitRel:e.profitAbs})))}},{text:this.$t("min"),data:{label:"".concat("rel"===this.typeChart?"%":"$"," ").concat(Math.min.apply(null,this.getStatByMonth.map((function(e){return"rel"===t.typeChart?e.profitRel:e.profitAbs}))).toFixed(2)),value:Math.min.apply(null,this.getStatByMonth.map((function(e){return"rel"===t.typeChart?e.profitRel:e.profitAbs})))}},{text:this.$t("successful_months"),data:{label:"% ".concat(this.getPercentProfitMonth.toFixed(1)),value:this.getPercentProfitMonth}},{text:this.$t("successful_trades_full"),data:{label:"% ".concat(this.getPercentProfitOrder.toFixed(1)),value:this.getPercentProfitOrder}}]}}),methods:{closePopup:function(){this.$emit("close")},setStatContractByMonth:function(t){if(t.length){for(var e=[{month:t[0][3],profit:t[0][4],volume:t[0][9],profitRel:100*t[0][4]/t[0][9]}],i=1;i=0?t.getPositiveColorOrder:t.getNegativeColorOrder},attrs:{title:t.positionInfoModal.profitAbs}},[t._v(t._s("$ ".concat(t.positionInfoModal.profitAbs)))]),e("div",{staticClass:"overlay-open-orders__modalSettings-profitRel",style:{color:t.positionInfoModal.profitAbs>=0?t.getPositiveColorOrder:t.getNegativeColorOrder}},[t._v(t._s("% ".concat((100*t.positionInfoModal.profitAbs/t.positionInfoModal.volume).toFixed(2))))])])])]):t._e(),t.orderSelect&&t.getMemoPositionButton&&this.getStatusUser&&"owner"===this.getStatusUser.status?e("div",{staticClass:"overlay-open-orders__buttons",style:{top:t.getMemoPositionButton.y-10+"px",left:t.getMemoPositionButton.x-80+"px"}},[e("div",{staticClass:"overlay-open-orders__btn cls closeOrder",on:{click:function(e){return t.openModalCloseOrder(e,t.orderSelect)}}},[e("svgIcon",{attrs:{name:"Close",size:21}})],1),t.openModalTrailing?e("TrailingModal",{attrs:{position:t.positionTralingModal,valuePip:t.getValuePip,order:t.orderSelect,prec:t.getPrecision,handlerChangeTrailing:t.handlerChangeTrailing},on:{close:t.closeTrailing,accept:t.changeTrailing}}):t._e(),e("div",{staticClass:"overlay-open-orders__btn setting",class:t.getActiveTheme,on:{click:t.handleClickOnButtonAutoStopLoss}},[t._v("TSL")])],1):t._e()])},Zpt=[],tgt=(i("4c53"),i("60a3")),egt=function(){var t=this,e=t._self._c;return e("DxDraggable",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.handleClickOutside,expression:"handleClickOutside"}],style:t.getPosition,on:{dragStart:t.dragStart}},[e("div",{staticClass:"wrapper-chart-order-info"},[t.settings&&"open"===t.settings.type?e("OrderInfo",{attrs:{order:t.settings.order,descriptionInModalStatus:t.settings.descriptionInModalStatus},on:{closeModal:t.close}}):t._e(),t.settings&&"close"===t.settings.type?e("CloseOrderInfo",{attrs:{order:t.settings.order,keyForChart:t.keyForChart,type:t.settings.type},on:{closeModal:t.close}}):t._e()],1)])},igt=[],ogt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-content-order-close",class:t.getActiveTheme},[t.isShowChart?t._e():e("div",{staticClass:"content-order-close-info"},[e("div",{staticClass:"btn-close",class:t.getActiveTheme,on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",size:14}})],1),e("div",{staticClass:"content-order-close-info__left"},[e("div",{staticClass:"content-order-close-info__avatar",class:t.getActiveTheme},["User-profile.png"===t.order.userAvatar?e("svgIcon",{attrs:{name:"empty-avatar",size:24}}):t._e(),"User-profile.png"!==t.order.userAvatar?e("img",{attrs:{src:t.order.userAvatar}}):t._e()],1),e("div",{staticClass:"content-order-close-info__item-start",style:{marginRight:"8px",marginLeft:"8px"}},[e("div",{staticClass:"content-order-item__name",class:t.getActiveTheme},[t._v(t._s(t.order.userName))]),e("div",{staticClass:"content-order-item__status",style:{color:t.getColorProfit}},[t._v(t._s("Closed"===t.order.status?"Closed order":"Open order")+" ")])])]),e("div",{staticClass:"content-order-close-info__center"},[e("div",{staticClass:"content-order-close-info__item-start",style:{display:"flex"}},[e("svgIcon",{style:{marginTop:"4px",color:t.getColor},attrs:{name:"Buy"===t.order.orderType?"Arrow-nano-top":"Arrow-nano-bottom",size:20}}),e("div",{staticClass:"content-order-item__box-content",style:{marginBottom:"1.8px"}},[e("div",{staticClass:"content-order-item__box"},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme,style:{fontSize:"9px",color:t.getColor}},[t._v(t._s("".concat(t.order.orderType.toUpperCase()," ").concat(t.order.volume.toLocaleString())))])]),e("div",{staticClass:"content-order-item__box"},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme},[t._v("Price open:")]),e("div",{staticClass:"content-order-item__value",class:t.getActiveTheme},[t._v(t._s(t.order.openPrice))])])])],1),e("div",{staticClass:"content-order-close-info__item-start",style:{marginRight:"8px",marginLeft:"8px"}},[e("div",{staticClass:"content-order-item__box"},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme},[t._v("Order №")]),e("div",{staticClass:"content-order-item__value-id",class:t.getActiveTheme},[t._v(t._s(t.order.externalId||t.order.sequenceId))])]),e("div",{staticClass:"content-order-item__box"},[e("div",{staticClass:"content-order-item__label",class:t.getActiveTheme},[t._v("Date")]),e("div",{staticClass:"content-order-item__value",class:t.getActiveTheme},[t._v(t._s(t.getTime)+" ")])])])])]),t.isShowChart?e("div",{staticClass:"chart-history-order",class:t.getActiveTheme},[e("div",{staticClass:"content-order-close-info__avatar-on-chart",class:t.getActiveTheme},["User-profile.png"===t.order.userAvatar?e("svgIcon",{attrs:{name:"empty-avatar",size:24}}):t._e(),"User-profile.png"!==t.order.userAvatar?e("img",{attrs:{src:t.order.userAvatar}}):t._e()],1),e("simpleChart",{key:t.keyForChart,attrs:{points:t.listPoints,fixedHeight:57.4,fixedWidth:342,grid:!0,smooth:!0,lineWidth:t.getColorTrendChart.lineWidth,color:t.getColorTrendChart.color,zeroGradient:t.getColorTrendChart.zeroGradient,firstGradient:t.getColorTrendChart.firstGradient,colorText:t.getColorTrendChart.colorText,colorWindow:t.getColorTrendChart.colorWindow,resultData:{profit:t.order.profit}}}),e("div",{staticClass:"result-order-close-info-withoutbackground",class:t.getActiveTheme},[e("div",{staticClass:"result-order-close-info__res",class:t.getActiveTheme},[t._v("P/L")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v("$"+t._s(t.order.profit))]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v("%"+t._s(t.getProcent)+" ")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v(t._s(t.getPip.toFixed(0))+" pip")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getDDcolor}},[t._v("DD "+t._s(t.getMaxDD.toFixed(4))+"%")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorCross,marginTop:"2px",marginLeft:"-9px",cursor:"pointer"},on:{click:t.handleShowChart}},[e("svgIcon",{attrs:{name:"Close",size:18}})],1)])],1):t._e(),t.isShowChart?t._e():e("div",{staticClass:"result-order-close-info",class:t.getActiveTheme},[e("div",{staticClass:"result-order-close-info__res",class:t.getActiveTheme},[t._v("P/L")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v("$"+t._s(t.order.profit))]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v("%"+t._s(t.getProcent)+" ")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit}},[t._v(t._s(t.getPip.toFixed(0))+" pip")]),this.isRightBar?t._e():e("div",{staticClass:"result-order-close-info__item",style:{color:t.getDDcolor}},[t._v("DD "+t._s(t.getMaxDD.toFixed(4))+"%")]),e("div",{staticClass:"result-order-close-info__item",style:{color:t.getColorProfit,marginTop:"2px",cursor:"pointer"},on:{click:t.handleShowChart}},[e("svgIcon",{attrs:{name:"test-chart",size:16}})],1)])])},ngt=[],sgt={name:"CloseOrderInfo",components:{svgIcon:L,DxDraggable:Se.a,simpleChart:BT},props:{order:{type:Object,required:!0},keyForChart:{default:"idChart"},isRightBar:{default:!1}},mounted:function(){this.equity=+localStorage.getItem("equity"),this.isRightBar||this.getOrderProfitHistory(this.getCloneOrder.id),this.controlSubribeWS()},destroyed:function(){this.controlSubribeWS(!0)},methods:{getProcentHandler:function(t){return+t/this.equity*100},controlSubribeWS:function(t){t?this.$socketStream.$off("apiWS3",this.setMessageHandler):this.$socketStream.$on("apiWS3",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},getOrderProfitHistory:function(t){if(t){var e={Command:"getOrderProfitHistory",Data:{orderId:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},handleShowChart:function(){this.isRightBar&&!this.isShowChart&&this.getOrderProfitHistory(this.getCloneOrder.id),this.isShowChart=!this.isShowChart},GetOrderProfitHistory:function(t){t[0]&&t[0].orderId===this.getCloneOrder.id?this.listPoints=t.sort((function(t,e){return t.date>e.date?1:e.date>t.date?-1:0})).map((function(t){return t.profit})):this.listPoints=[0,0,0,this.order.profit]},close:function(){this.$emit("closeModal")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts"})),{},{getCloneOrder:function(){if(this.order)return JSON.parse(JSON.stringify(this.order))},getColorTrendChart:function(){return{lineWidth:"light"===this.getActiveTheme?1:2,color:"light"===this.getActiveTheme?this.getCloneOrder.profit>=0?"#008e72":"#E91212":this.getCloneOrder.profit>=0?"#1ef0b1":"#FA4C4A",zeroGradient:"light"===this.getActiveTheme?this.getCloneOrder.profit>=0?"rgba(137, 239, 215, 0.73)":"#FFDCDC":this.getCloneOrder.profit>=0?"#1EF059":"#FA6A4A",firstGradient:"light"===this.getActiveTheme?"#fafafa":"rgba(49, 68, 86, 0.7)",colorText:"light"===this.getActiveTheme?"rgba(255,255,255,1)":"#314456",colorWindow:"light"===this.getActiveTheme?this.getCloneOrder.profit>=0?"#008e72":"#e91212":this.getCloneOrder.profit>=0?"#1ef0b1":"#FF3232"}},getMaxDD:function(){var t=this;return this.listPoints.length?this.listPoints.reduce((function(e,i){return t.getProcentHandler(i)999?999:t<1?1:t},handleInput:function(t){if(t){var e=t.target.value,i=+e,o=this.getValidateValue(i);this.newValue=o}},incr:function(){this.isDisabled||(this.newValue=this.getValidateValue(this.newValue+1))},decr:function(){this.isDisabled||(this.newValue=this.getValidateValue(this.newValue-1))}},watch:{newValue:function(t){this.$emit("newValue",t)}},mounted:function(){this.newValue=+this.value},destroyer:function(){}},ygt=vgt,Cgt=(i("a45c"),Object(C["a"])(ygt,fgt,mgt,!1,null,null,null)),bgt=Cgt.exports,Sgt={components:{DxDraggable:Se.a,Input:Sh,InputChange:bgt,Button:zt},data:function(){return{levelChange:500,levelResult:100}},props:["valuePip","order","prec","handlerChangeTrailing","position"],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getResPrice:function(){if(!this.order)return 0;var t=+this.order.openPrice?+this.order.openPrice:+this.order.pendingPrice,e={Buy:this.levelResult*this.valuePip+t,Sell:t-this.levelResult*this.valuePip},i=e[this.order.orderType].toFixed(this.prec);return i},getChangePrice:function(){if(!this.order)return 0;var t=+this.order.openPrice?+this.order.openPrice:+this.order.pendingPrice,e={Buy:this.levelChange*this.valuePip+t,Sell:t-this.levelChange*this.valuePip},i=e[this.order.orderType].toFixed(this.prec);return i}}),methods:{changeValue:function(t,e,i){i=i||0,+t0&&this.drawShip(t,e.takeProfit,this.green()),e.stopLoss>0&&this.drawShip(t,e.stopLoss,this.red());var o="Buy"===e.orderType?1:-1,n=this.isDark?"#02b9fc":"#3d73f1";if(e.trailingStart>0&&e.trailingSL>0){var s=o*(e.trailingStart*this.valuePip),r=e.openPrice+s,a=r.toFixed(this.getPrecision);this.drawShip(t,+a,n)}if(e.trailingSL>0&&e.trailingStart>0){var c=o*(e.trailingSL*this.valuePip),l=e.openPrice+c,u=l.toFixed(this.getPrecision);this.drawShip(t,+u,n)}if(this.isShowShipsTrailing){var d=this.isDark?"#bbcee0":"#8c8c8c";this.drawShip(t,this.trailingChange.value,d),this.drawShip(t,this.trailingRes.value,d)}}},{key:"drawShip",value:function(t,e,i){var o=this.comp.$props.layout.$2screen(e);t.beginPath(),t.fillStyle=this.isDark?"#23313f":"white",t.fillRect(0,o-9,60,18),t.strokeStyle=i,t.strokeRect(0,o-9,60,18),t.font="Arial 8px",t.fillStyle=i,t.fillText("".concat(e),3,o+4)}},{key:"draw",value:function(t,e,i,o,n,s,r,a,c){this.isDark=i,this.orders=e,this.isShowShipsTrailing=o&&n,this.trailingRes=o,this.trailingChange=n,this.temporaryLimits=s,this.temporaryTrailing=r,this.valuePip=a,this.getPrecision=c,this.shader||this.init_shader()}},{key:"isNan",value:function(t){var e=t>0,i=t<0,o=null===t;return!e&&!i&&!o}},{key:"green",value:function(){return this.isDark?"#1ef0b1":this.comp.$props.colors.candleUp}},{key:"red",value:function(){return this.isDark?"#ff3232":this.comp.$props.colors.candleDw}}]),t}(),Igt=Dgt["a"].current(),Bgt={name:"OpenOrders",components:{TrailingModal:xgt,ModalOrder:hgt,debounce:Xh},mixins:[tgt["a"],lW,Xh],data:function(){return{currentDevice:Igt,orderSelect:null,ctx:null,trailingRes:null,trailingChange:null,positionButtons:null,positionTralingModal:null,orderToDraw:[],oldOrder:null,countClick:0,listHoveredOrders:[],idCurrentAccount:null,EventList:[],openOrders:[],equity:null,settingsOrder:null,keyForChart:null,mobileStatus:!1,openModalTrailing:!1,positionInfoModal:null}},watch:{getDefaultAccount:function(t){t&&this.idCurrentAccount!==t.id&&(this.idCurrentAccount=t.id)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPositiveColorOrder:function(){return"dark"===this.getActiveTheme?"#00ffac":"#008e72"},getNegativeColorOrder:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},positiveLimit:function(){return"dark"===this.getActiveTheme?"rgba(31, 240, 177, 0.6)":"rgba(0, 142, 114, 0.6)"},negativeLimit:function(){return"dark"===this.getActiveTheme?"rgba(255, 68, 68, 0.6)":"rgba(233, 18, 19, 0.6)"},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},getQoute:function(){return this.qoute&&this.qoute.a&&this.qoute.b?this.qoute:{a:this.$props.sub[this.$props.sub.length-1][1],b:this.$props.sub[this.$props.sub.length-1][3]}},isShowProviderAvatar:function(){return this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.showAvatarsProviders&&this.getSettingsParamsLeftBar.showProviders},isShowMyAvatar:function(){return this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.myAvatar&&this.getSettingsParamsLeftBar.showMyActions},getMemoPositionButton:function(){return this.positionButtons},getValuePip:function(){return 1/Ph(this.getPrecision)}}),methods:{draw:function(t){this.ctx=t,this.orderSelect&&(this.positionButtons=this.getPositionButton(this.orderSelect)),this.drawTemporary(t),this.drawTemporaryLimits(t),this.trailingRes&&this.trailingChange&&this.drawControlsTrailing(t,this.trailingRes,this.trailingChange),this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.myOpenOrders&&(Array.isArray(this.openOrders)&&(this.createDrawOpenOrder(t),this.createDrawAvatarOpenOrders(t)),this.line&&this.drawLineToOrder(t,this.line))},createDrawOpenOrder:function(t){this.getOrderToDraw(),this.drawOpenOrders(t,this.orderToDraw)},getOrderToDraw:function(){var t=this.$props.settings.candles,e=this.$props.sub,i=e[0],o=e[e.length-1];if(Array.isArray(e)&&Array.isArray(t)&&Array.isArray(i)&&void 0!==i[0]&&Array.isArray(o)&&void 0!==o[0]&&t[i[0]]&&t[o[0]]){var n=t[i[0]][0],s=t[o[0]][0];this.orderToDraw=this.openOrders.filter((function(t){if(t.time>=n&&t.time<=s)return t}))}},drawOpenOrders:function(t,e){var i=this;"mobile"!==this.currentDevice.deviceType&&"tablet"!==this.currentDevice.deviceType&&(this.positionInfoModal=null),e.forEach((function(e){var o,n=i.$props.layout.t2screen(e.time),s=i.$props.layout.$2screen(e.openPrice),r="dark"===i.getActiveTheme,a=r?3:3.5,c=i.handleHoverOnOrder(e,n,s,a+3);e.calcPercent=i.getProcent(e.profit),e.pip=i.getPip(e.orderType,i.getQoute,e.openPrice).toFixed(0),i.drawCircleOrder(t,n,s,a);var l="dark"===i.getActiveTheme?"#182129":"#d5d5d5";if(t.strokeStyle=l,t.lineWidth=1.2,t.stroke(),t.lineWidth=1,t.fillStyle="Buy"===e.orderType?i.getPositiveColorOrder:i.getNegativeColorOrder,t.fill(),i.createDescription(t,n,s-7,e),(c||(null===(o=i.orderSelect)||void 0===o?void 0:o.id)===e.id)&&"owner"===i.getStatusUser.status){var u=e.trailingSL&&e.trailingStart;i.createOrderInformation(t,e,n,s),u&&i.drawSavedTrailing(t,e)}c&&"owner"===i.getStatusUser.status&&i.drawInfoModal(t,e,n,s)}))},handleHoverOnOrder:function(t,e,i,o){if(this.orderSelect)return!1;var n=this.onCircle(this.mouseX,this.mouseY,e,i,o);if(n){var s=this.listHoveredOrders.find((function(e){return e.id===t.id}));if(!s)return void(this.listHoveredOrders=[t].concat(Object(x["a"])(this.listHoveredOrders)))}else this.listHoveredOrders=this.listHoveredOrders.filter((function(e){return e.id!==t.id}));return n},createOrderInformation:function(t,e,i,o){this.createLimits(t,e,i,o),this.drawLevelOrder(t,e,i,o)},drawLevelOrder:function(t,e,i,o){var n=this.drawDescriptionOrder(t,e,o),s=this.getPositiveColorOrder;t.beginPath(),t.setLineDash([2,3]),t.moveTo(i+4,o),t.lineTo(this.$props.layout.spacex,o),t.strokeStyle=s,t.stroke(),t.setLineDash([]),t.beginPath(),t.setLineDash([2,3]),t.moveTo(i-4,o),t.lineTo(n-4,o),t.strokeStyle=s,t.stroke(),t.setLineDash([])},drawDescriptionOrder:function(t,e,i){var o=this,n="Buy"===e.orderType?this.getPositiveColorOrder:this.getNegativeColorOrder,s=e.profit>=0?this.getPositiveColorOrder:this.getNegativeColorOrder,r=[{value:e.orderType,color:n},{value:"".concat(e.volume.toLocaleString()),color:n},{value:"".concat(e.profit.toLocaleString()," $"),color:s},{value:"".concat(e.calcPercent.toLocaleString()," %"),color:s},{value:"".concat(e.pip," pip"),color:s}];t.beginPath(),t.fillStyle="blue";var a=r.reduce((function(e,n){var s=o.drawChanck(t,n,e,i-3);return e=s,e}),8);return a},drawChanck:function(t,e,i,o){var n="dark"===this.getActiveTheme?"#182129":"#d5d5d5";t.fillStyle=e.color;var s=t.measureText(e.value).width+4;return t.fillText(e.value,i,o+7),this.drawCircleForGap(t,i+s+4,o+4,e.color,n)},createLimits:function(t,e,i,o){var n=this,s=[{type:"takeProfit",curtType:"TP",price:e.takeProfit},{type:"stopLoss",curtType:"SL",price:e.stopLoss}];s.forEach((function(s){if(s.price>0){var r=n.checkCorrectLim(e,s.type);n.drawLimitLine(t,s,e,r),n.drawLineToLimit(t,s,e,i,o,r)}else n.drawControlsRect(t,s,e,i,n.getYWithOffset(o)[e.orderType][s.type],!0)}))},drawInfoModal:function(t,e,i,o){this.positionInfoModal={x:i<120?i:i-120,y:"mobile"===this.currentDevice.deviceType||"tablet"===this.currentDevice.deviceType?o+12:o,orderType:e.orderType,volume:e.volume,openPrice:e.openPrice,profitAbs:e.profit,order:e}},notificationHandler:function(t){if(t&&t.command&&"None"===t.command&&"OrderExecution"===t.data.dataType){var e=JSON.parse(t.data.data);"TrailingSL"===e.Message&&this.HistoryOrders(this.$orderStorage.getOrdersOnStorage())}},BrokerPosition:function(t){t.instrumentName===this.symbol&&this.HistoryOrders(this.$orderStorage.getOrdersOnStorage())},openModalSettingsOrder:function(t){if("owner"===this.getStatusUser.status){this.positionInfoModal&&(this.orderSelect=t,this.positionInfoModal=null);var e=[t.id];this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.symbol,payload:e})}},closeTrailing:function(){this.trailingRes=null,this.trailingChange=null,this.openModalTrailing=!1},handlerChangeTrailing:function(t){this.trailingRes=t.resultPrice,this.trailingChange=t.changePrice},handleClickOnButtonAutoStopLoss:function(){var t=this.ctx.canvas.clientHeight,e=this.$props.layout.t2screen(this.roundingFromDate(new Date(this.orderSelect.openDate),this.timeFrame||60)),i=this.$props.layout.$2screen(this.orderSelect.openPrice);this.positionTralingModal={x:e<315?-315:0,y:t-i<180?-180:24},this.openModalTrailing=!0},completeSetting:function(){this.orderSelect=null,this.positionButtons=null},getPositionButton:function(t){var e=this.$props.layout,i=this.roundingFromDate(new Date(t.openDate),this.timeFrame||60),o=e.t2screen(i),n=e.$2screen(t.openPrice);return{x:o,y:n}},init:function(){var t=this;this.$nextTick((function(){t.shader=new kgt(t)}))},meta_info:function(){return{author:"TopTrader",version:"2.0.0"}},use_for:function(){return["OpenOrders"]},mousemove:function(t){this.mouseX=t.layerX,this.mouseY=t.layerY,this.changePositionLimit(t.layerY),this.changePositionTsl(t)},changePositionTsl:function(t){var e=this;if(this.changeTSL){var i=this.$props.layout;if("trailingStart"!==this.changeTSL.type)if("trailingSl"!==this.changeTSL.type);else{var o=i.screen2$(t.layerY),n=o.toFixed(this.getPrecision),s=this.getPipsFormDirection(+n,+this.changeTSL.order.openPrice,"Sell"===this.changeTSL.order.orderType);this.openOrders=this.openOrders.map((function(t){if(t.id===e.changeTSL.order.id){var i=t.trailingSl?"trailingSl":t.trailingSL?"trailingSL":"trailingSl";return t[i]=+s,t}return t}))}else{var r=i.screen2$(t.layerY),a=r.toFixed(this.getPrecision),c=this.getPipsFormDirection(+a,+this.changeTSL.order.openPrice,"Sell"===this.changeTSL.order.orderType);this.openOrders=this.openOrders.map((function(t){return t.id===e.changeTSL.order.id?(t.trailingStart=+c,t):t}))}}},getPipsFormDirection:function(t,e,i){var o=i?e-t:t-e,n=o*Ph(this.getPrecision),s=n.toFixed(0);return+s},stopChart:function(t){this._$emit("custom-event",{event:"scroll-lock",args:[t]})},changePositionLimit:function(t){var e=this;if(this.orderSelect&&this.isSelectFoChangeLimit&&this.openOrders){var i=this.openOrders.findIndex((function(t){return t.id===e.orderSelect.id}));if(this.openOrders[i]){var o=this.$props.layout.screen2$(t),n=+o.toFixed(this.getPrecision);this.openOrders[i][this.isSelectFoChangeLimit]=n,this.orderSelect[this.isSelectFoChangeLimit]=n,this.orderSelect.indexOrder=i}}},mouseup:function(){this.isSelectFoChangeLimit&&this.updateOrder(),this.changeTSL&&this.updateTsl()},updateTsl:function(){var t=this,e=this.openOrders.find((function(e){return t.changeTSL.order.id===e.id}));if(e){var i=e.trailingSl?"trailingSl":e.trailingSL?"trailingSL":"trailingSl",o="trailingSl"===this.changeTSL.type?i:this.changeTSL.type;if(e[o]<10)return this.openOrders=this.openOrders.map((function(e){return e.id===t.changeTSL.order.id?(e[o]=t.changeTSL.initPips,e):e})),void this.cancelChangeTsl()}this.saveChange(e,"takeProfit",e.takeProfit),this.oldOrderTsl=this.changeTSL.order,this.cancelChangeTsl()},cancelChangeTsl:function(){this.changeTSL=null,this.stopChart(!1)},saveChange:function(t,e,i){var o,n="takeProfit"===e?"stopLoss":"takeProfit",s=(o={id:t.id,accountId:t.accountId,orderType:t.orderType,volume:t.volume,contractName:t.contractName},Object(Vt["a"])(o,e,+i.toFixed(this.getPrecision)),Object(Vt["a"])(o,n,+t[n]),Object(Vt["a"])(o,"openDate",t.openDate),Object(Vt["a"])(o,"openPrice",t.openPrice),Object(Vt["a"])(o,"trailingSl",t.trailingSL||t.trailingSl),Object(Vt["a"])(o,"trailingStart",t.trailingStart),o);Jpt.$emit("updateOrder",{name:"updateOrder",data:{symbol:this.symbol,order:s}})},updateOrder:function(){var t=this.correctedLimit(this.orderSelect,this.oldOrder,this.isSelectFoChangeLimit);t&&this.saveChange(this.orderSelect,this.isSelectFoChangeLimit,this.orderSelect[this.isSelectFoChangeLimit]),this.isSelectFoChangeLimit=!1,this.oldOrder=null,this.stopChart(!1)},openModalCloseOrder:function(t,e){var i={order:e,all:Array.isArray(e),orders:Array.isArray(e),type:e.orderType,handler:this.completeSetting};Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:this.getMemoPositionButton.y-32,left:t.x,paramName:"modalCloseOrder",params:i,positions:{left:t.clientX-280,bottom:this.getMemoPositionButton.y+64}}}})},checkCorrectLim:function(t,e){var i=this,o={Buy:{takeProfit:function(t,e){return t>e.openPrice},stopLoss:function(t){return ti.getQoute.a}}};return o[t.orderType][e](t[e],t)},correctedLimit:function(t,e,i){var o=this.checkCorrectLim(t,i);return o||(this.orderSelect[i]=e[i],this.openOrders[this.orderSelect.indexOrder][i]=e[i]),o},mousedown:function(t){var e=this;if("mobile"!==this.currentDevice.deviceType&&"tablet"!==this.currentDevice.deviceType||(this.positionInfoModal=null),this.line&&(this.line=null),this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.myOpenOrders&&Array.isArray(this.openOrders)&&!this.handleCheckChangeTSL(t)&&!this.checkClickOnSettingOrder(t)){this.completeSetting();var i=t.layerX,o=this.ctx.canvas.offsetHeight-32,n=!1,s=t.layerY,r=this.orderToDraw.find((function(t){var r=e.$props.layout.t2screen(t.time),a=e.$props.layout.$2screen(t.openPrice);return e.onCircle(i,s,r,a,"tablet"===e.currentDevice.deviceType||"mobile"===e.currentDevice.deviceType?15:5)?t:e.onCircle(i,s,r,o,16)?(n=!0,t):void 0}));if(r){if("tablet"===this.currentDevice.deviceType||"mobile"===this.currentDevice.deviceType){var a=this.$props.layout.t2screen(r.time),c=this.$props.layout.$2screen(r.openPrice);this.drawInfoModal(this.ctx,r,a,c)}this.openModal(t,r,n),this.orderSelect=r,this.doubleClick(r)}else this.openModalTrailing=!1}},handleCheckChangeTSL:function(t){if(this.settingsOrder){var e=this.$props.layout,i=this.settingsOrder.order,o="Buy"===i.orderType?1:-1,n=i.trailingSL||i.trailingSl,s=this.getPriceFromPips(i.openPrice,i.trailingStart,o),r=this.getPriceFromPips(i.openPrice,n,o),a=this.$props.layout.spacex/2,c=e.$2screen(s),l=e.$2screen(r),u=this.onCircle(t.layerX-8,t.layerY,a,c,8),d=this.onCircle(t.layerX-8,t.layerY,a,l,8);return(d||u)&&this.stopChart(!0),u?(this.changeTSL={type:"trailingStart",price:s,initPips:i.trailingStart,order:i},u):d?(this.changeTSL={type:"trailingSl",price:r,initPips:n,order:i},d):u||d}},getPriceFromPips:function(t,e,i){var o=e*this.getValuePip*i;return t+o},changeTrailing:function(t){var e={id:this.orderSelect.id,accountId:this.orderSelect.accountId,orderType:this.orderSelect.orderType,volume:this.orderSelect.volume,contractName:this.orderSelect.contractName,takeProfit:+this.orderSelect.takeProfit,stopLoss:+this.orderSelect.stopLoss,openDate:this.orderSelect.openDate,openPrice:this.orderSelect.openPrice,trailingSL:t.start,trailingStart:t.sl};Jpt.$emit("updateOrder",{name:"updateOrder",data:{symbol:this.symbol,order:e}})},doubleClick:function(t){this.countClick+=1,this.countClick>1&&(this.openModalSettingsOrder(t),this.countClick=0),this.debouncer("clearClicks",150,this.orderSelect)},clearClicks:function(){this.countClick=0},checkClickOnSettingOrder:function(t){if(this.orderSelect){var e=null,i=this.checkClickOnLimit(this.orderSelect,"takeProfit",t);i&&(e=i);var o=this.checkClickOnLimit(this.orderSelect,"stopLoss",t);return o&&(e=o),e&&this.stopChart(!0),this.oldOrder=JSON.parse(JSON.stringify(this.orderSelect)),this.isSelectFoChangeLimit=e,e}},checkClickOnLimit:function(t,e,i){var o=this.$props.layout,n=this.getYWithOffset(o.$2screen(t.openPrice)),s=o.t2screen(t.time),r=t[e]?o.$2screen(t[e]):n[t.orderType][e],a=i.layerX>=s-12&&i.layerX<=s+12,c=i.layerY>=r-9&&i.layerY<=r+9;if(a&&c)return e},drawTemporaryLimits:function(t){var e=this.getTemporaryValues("temporaryLimits");if(e&&e.symbol===this.symbol){var i=this.$props.layout,o="dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c";if(t.beginPath(),e.takeProfit>0){var n=i.$2screen(e.takeProfit),s="TP ".concat(e.takeProfit);this.drawTemporaryLine(t,n,s,o)}if(e.stopLoss>0){var r=i.$2screen(e.stopLoss),a="SL ".concat(e.stopLoss);this.drawTemporaryLine(t,r,a,o)}}},drawTemporaryLine:function(t,e,i,o){t.beginPath();var n=t.measureText(i).width,s=this.$props.layout.spacex/2;t.fillStyle=o,t.fillText(i,8,e+4),t.fillText(i,s-n/2,e+4),t.moveTo(n+12,e),t.lineTo(s-(n/2+8),e),t.moveTo(s+(n/2+8),e),t.lineTo(2*s,e),t.strokeStyle=o,t.setLineDash([2,3]),t.stroke()},getTemporaryValues:function(t){var e=localStorage.getItem(t);if(e){var i=JSON.parse(e);if(i.symbol===this.symbol)return i}},getTemporaryTrialingPrices:function(){var t=this.getTemporaryValues("isTrialingFromModal");if(t){var e=+(this.getQoute.b+this.getValuePip*t.levelResult).toFixed(this.getPrecision),i=+(this.getQoute.b+this.getValuePip*t.levelChange).toFixed(this.getPrecision);return{priceResult:e,priceChange:i,values:t}}},drawTemporary:function(t){var e=this.getTemporaryTrialingPrices();if(e){var i=e.priceResult,o=e.priceChange,n=e.values;this.drawResultTrailing(t,i,n.levelResult,this.$props.layout.spacex/2),this.drawResultTrailing(t,o,n.levelChange,this.$props.layout.spacex/2)}},drawControlsTrailing:function(t,e,i){e&&i&&(this.drawResultTrailing(t,e.value,e.pips),this.drawResultTrailing(t,i.value,i.pips))},drawResultTrailing:function(t,e,i,o,n,s){var r=s||("dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"),a=this.drawDescriptionResultTrailing(t,n||this.orderSelect,e,i,!0,o,!1,s),c=this.drawDescriptionResultTrailing(t,n||this.orderSelect,e,i,!1,o,!0,s);t.beginPath(),t.moveTo(c.startX,c.startY),t.lineTo(a.endX,c.startY),t.moveTo(c.endX,c.startY),t.lineTo(this.$props.layout.spacex,c.startY),t.strokeStyle=r,t.setLineDash([4,5]),t.stroke()},drawDescriptionResultTrailing:function(t,e,i,o,n,s,r,a){var c=this.$props.layout,l="".concat(n?"".concat(+i.toFixed(this.getPrecision)," "):"").concat(o),u=a||("dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"),d=n?8:s||c.t2screen(null===e||void 0===e?void 0:e.time),h=c.$2screen(+i);t.beginPath();var p=t.measureText(l).width;if(t.fillStyle=u,t.fillText(l,d,h+4),r){t.beginPath();var g=d+p/2;t.arc(g,h,p/2+4,0,2*Math.PI,!0),t.strokeStyle=u,t.setLineDash([]),t.stroke()}return{startX:d-4,startY:h,endX:d+4+p}},drawSavedTrailing:function(t,e){var i="Buy"===e.orderType?1:-1,o=e.trailingSL||e.trailingSl,n=this.getValuePip*e.trailingSL*i,s=this.getValuePip*e.trailingStart*i,r=e.openPrice+n,a=e.openPrice+s,c="dark"===this.getActiveTheme?"#00b9fc":"#3C73F1",l="dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c";this.drawResultTrailing(t,r,o,this.$props.layout.spacex/2,e,o>10?c:l),this.drawResultTrailing(t,a,e.trailingStart,this.$props.layout.spacex/2,e,e.trailingStart>10?c:l)},getYWithOffset:function(t){return{Buy:{takeProfit:t-16,stopLoss:t+16},Sell:{takeProfit:t+16,stopLoss:t-16}}},drawLineToLimit:function(t,e,i,o,n,s){t.beginPath();var r={takeProfit:"Buy"===i.orderType?4:-4,stopLoss:"Sell"===i.orderType?4:-4},a=this.$props.layout,c=a.$2screen(e.price);t.moveTo(o,n+r[e.type]),t.lineTo(o,c),t.strokeStyle="dark"===this.getActiveTheme?"rgba(187, 206, 224, 0.9)":"#8c8c8c",t.setLineDash([]),t.stroke(),this.drawDescriptionLimit(t,e,i,o+16,c+3),this.drawControlsRect(t,e,i,o,c,s)},drawControlsRect:function(t,e,i,o,n,s){var r=24,a=18,c=o-r/2,l=n-a/2,u={takeProfit:this.getPositiveColorOrder,stopLoss:this.getNegativeColorOrder},d="dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c";t.beginPath(),t.fillStyle=s?u[e.type]:d,t.fillRect(c,l,r,a),this.drawArcs(t,c,l)},drawArcs:function(t,e,i){t.beginPath(),t.arc(e+6,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+12,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+18,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+6,i+12,2,0,2*Math.PI),t.closePath(),t.arc(e+12,i+12,2,0,2*Math.PI),t.closePath(),t.arc(e+18,i+12,2,0,2*Math.PI),t.closePath(),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill()},drawDescriptionLimit:function(t,e,i,o,n){t.beginPath();var s=+this.getProfit(i.openPrice,e.price,i.volume,i.orderType).toFixed(this.getPrecision),r=this.getProcent(s),a=this.getPip(i.orderType,{a:i.openPrice,b:i.openPrice},e.price).toFixed(0),c="".concat(e.curtType," ").concat(e.price),l="".concat(s," $ ").concat(r," % ").concat(Math.abs(+a)," pip");t.font="10px Arial",t.fillStyle="takeProfit"===e.type?this.getPositiveColorOrder:this.getNegativeColorOrder;var u=t.measureText(c).width+4;return t.fillText(c,o,n),t.fillStyle=s>0?this.getPositiveColorOrder:this.getNegativeColorOrder,t.fillText(l,o+u,n),t.measureText("".concat(c," ").concat(l)).width},drawLimitLine:function(t,e,i,o){var n={takeProfit:this.positiveLimit,stopLoss:this.negativeLimit},s="dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c",r=this.$props.layout,a=r.$2screen(e.price);t.beginPath(),t.setLineDash([2,3]);var c=this.drawDescriptionLimit(t,e,i,8,a+3);t.moveTo(16+c,a),t.lineTo(r.spacex,a),t.strokeStyle=o?n[e.type]:s,t.lineWidth=.5,t.stroke()},drawCircleForGap:function(t,e,i,o,n){return t.beginPath(),t.setLineDash([]),t.arc(e,i,3,0,2*Math.PI,!1),t.fillStyle=o,t.fill(),t.strokeStyle=n,t.lineWidth=1,t.stroke(),e+7},createDrawAvatarOpenOrders:function(t){var e=this,i=this.$props.layout.$2screen,o=this.$props.layout.t2screen,n=this.agrigateForTimeframe(this.orderToDraw);this.$props.settings;var s=i(this.$props.layout.$_lo);n.forEach((function(i){var n=o(+i.id);e.drawAvatarOrder(t,"Sell",n,s-32,i)}))},agrigateForTimeframe:function(t){var e=this,i=t.reduce((function(t,i){var o=e.roundingFromDate(new Date(i.openDate),e.timeFrame||60),n=i.accountId===e.getDefaultAccount.id,s="".concat(o),r=t.find((function(t){return t.id===s}));if(r){var a=r.orders.find((function(t){return t.id===i.id}));n&&(r.avatar=i.userAvatar),a||(n&&e.isShowMyAvatar&&r.orders.push(i),!n&&e.isShowProviderAvatar&&r.orders.push(i))}else{var c={};n&&e.isShowMyAvatar&&(c.id=s,c.orders=[i],c.avatar=i.userAvatar),!n&&e.isShowProviderAvatar&&(c.id=s,c.orders=[i],c.avatar=i.userAvatar),t.push(c)}return t}),[]);return i},roundingFromDate:function(t,e){var i=6e4,o=i*e,n=t.getTimeWithoutUTC();return n-n%o},drawLineToOrder:function(t,e){var i=this.ctx.canvas.offsetHeight-40,o={Buy:"#008e72",Sell:"#e54150"};t.beginPath(),t.moveTo(e.x,i-10),t.lineTo(e.x,e.y),t.strokeStyle=o[e.order.orderType],t.strokeWidth=.1,t.stroke()},onCircle:function(t,e,i,o,n){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*n},getColor:function(t){var e=localStorage.getItem("allColors");if(!e)return wgt[this.getActiveTheme][t];var i=JSON.parse(e);return i[this.getActiveTheme][t]},getProcent:function(t){return this.equity&&t?(t/this.equity*100).toFixed(4):0},getProfit:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=this.getPrecision<=3;return s?n[o]()/Ph(this.getPrecision-1):n[o]()},getPip:function(t,e,i){var o=this;if(!e)return 0;var n={Buy:function(){return(+e.a-+i)*Ph(o.getPrecision-1)},Sell:function(){return(+i-+e.b)*Ph(o.getPrecision-1)}};return n[t]()},getDelta:function(t,e,i){var o="Sell"===t?i.a:i.b;return o?o-e:0},drawAvatarOrder:function(t,e,i,o,n){var s=new Image;s.src="User-profile.png"!==n.avatar&&n.avatar?n.avatar:Agt.a,t.lineWidth=3,t.beginPath(),t.save(),t.fillStyle="#dfdfdf",t.fillStyle="Sell"===e?"#e54150":"#23a776",t.strokeStyle="Sell"===e?"#e54150":"#23a776",t.arc(i,o,10,0,2*Math.PI,!0),t.stroke(),t.clip(),t.fill(),t.drawImage(s,i-16,o-16,32,32),t.restore()},createDescription:function(t,e,i,o){var n="".concat(this.getSettingsParamsLeftBar.showDirectionPin?o.orderType:""," ").concat(this.getSettingsParamsLeftBar.showEnterPin?o.openPrice:""),s=o.calcPercent,r=o.profit,a=o.pip,c="".concat(this.getSettingsParamsLeftBar.showDollars?"".concat(r,"$"):""," ").concat(this.getSettingsParamsLeftBar.showProcent?"".concat(s," %"):""," ").concat(this.getSettingsParamsLeftBar.showPips?"".concat(a," pip"):"");t.font="8px Arial";var l=e-15,u=i+3.2;this.getSettingsParamsLeftBar.showAllDate&&this.drawDescription(t,l,u,{priceLabel:n,paramLabel:c},this.getColor(o.orderType.toLowerCase()),o)},closeModal:function(){this.settingsOrder.showModal=null,this.keyForChart=null},openModal:function(t,e,i){var o=this.$props.layout,n=o.t2screen(e.time),s=o.$2screen(e.openPrice);i&&(this.line={y:s-36,x:n,order:e}),this.settingsOrder={left:n,top:s-72,order:e,showModal:!0,type:"open"},this.keyForChart="keyForChart_".concat(Math.floor(Math.random()*(new Date).getTime()))},drawDescription:function(t,e,i,o,n,s){var r="dark"===this.getActiveTheme?"#182129":"#d5d5d5",a=e-t.measureText(o.priceLabel).width,c=e-t.measureText(o.paramLabel).width,l=s.profit>=0?this.getPositiveColorOrder:this.getNegativeColorOrder,u=13;t.beginPath(),t.strokeStyle=r,t.lineWidth=1,t.strokeText(o.priceLabel,a,i+0),t.strokeText(o.paramLabel,c,i+u),t.beginPath(),t.fillStyle=l,t.fillText(o.priceLabel,a,i+0),t.fillStyle=l,t.fillText(o.paramLabel,c,i+u)},drawCircleOrder:function(t,e,i,o){t.beginPath(),t.arc(e,i,o,0,2*Math.PI)},HistoryOrders:function(t){t&&(this.openOrders=this.getOpenOrders(t.tradingOrders))},getOpenOrders:function(t){var e=this;if(this.getStatusUser){var i,o=t.filter((function(t){return t.instrumentName===e.symbol}));if("owner"===this.getStatusUser.status?i=o.filter((function(t){return t.accountId===e.getDefaultAccount.id})):"ghost"===this.getStatusUser.status&&"UserProfile"===this.getStatusUser.route&&(i=o.filter((function(t){return t.accountId===e.$route.query.accountId}))),i){var n=i.map((function(t){return e.createObjectOrder(t)}));return n}}},eventsHandles:function(t){t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},controlSubribeWS:function(t){if(!t)return this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler),this.$socketStream.$on("apiWS3",this.setMessageHandler),void this.$socketStream.events.subscribe("apiWS_NOTI",this.notificationHandler);this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler),this.$socketStream.events.unsubscribe("apiWS_NOTI",this.notificationHandler)},setMessageHandler:function(t){if(t&&t.command&&"function"===typeof this[t.command]){if("HistoryOrders"===t.command){if(this.openOrders)return;this[t.command](this.$orderStorage.getOrdersOnStorage())}this[t.command](t.data)}},AccountsDetails:function(t){var e=this.getDataForCurrentAccaunt(t);e&&e.openOrders&&this.updateProfitInOpenOrders(e.openOrders.tradingOrders),this.equity=this.getEquity(t)},updateProfitInOpenOrders:function(t){var e=this;if(Array.isArray(this.openOrders))for(var i=function(){var i=e.openOrders[o],n=t.find((function(t){return t.id===i.id}));n&&(e.openOrders[o].profit=n.profit)},o=0;o0&&this.drawLimit(t,e.takeProfit,"#008E72"),e.stopLoss>0&&this.drawLimit(t,e.stopLoss,"#DD5151")}},{key:"drawLimit",value:function(t,e,i){var o=this.comp.$props.layout,n=o.$2screen(e);t.fillStyle=this.isDark?"#23313f":"white",t.fillRect(.5,n-7,t.canvas.offsetWidth-2,14),t.strokeStyle=i,t.strokeRect(.5,n-7,t.canvas.offsetWidth-2,14),t.fillStyle=this.isDark?"#bbcee0":"#333333",t.textAlign="left",t.font="".concat(10,"px Arial"),t.fillText(e,7,n+4)}},{key:"click",value:function(t){}},{key:"mousedown",value:function(t){}},{key:"mouseup",value:function(t){}},{key:"removeAllEventListner",value:function(){}},{key:"draw",value:function(t,e,i,o,n,s,r){this.disabled=n,this.isDark=o,this.getValuePip=s,this.getPrecision=r,this.comp&&this.comp.$props.meta.last&&(this.arrOrder=e,this.objectCreatedOrder=i,this.shader||this.init_shader(e))}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.colorCandleUp}},{key:"red",value:function(){return this.comp.colorCandleDw}}]),t}(),Wgt=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],staticClass:"list-actions-for-planned",class:t.getActiveTheme,style:t.getStyled},t._l(t.listSettings,(function(i){return e("div",{key:i.id,staticClass:"list-actions-for-planned__item",class:"".concat(t.getActiveTheme," ").concat(i.class),on:{click:function(e){return t.handleClickOnItem(i.handler,i.data)}}},[e("div",{staticClass:"list-actions-for-planned__cnt"},[i.icon?e("div",{staticClass:"list-actions-for-planned__icn"},[e("svgIcon",{attrs:{name:i.icon}})],1):t._e(),e("div",{staticClass:"list-actions-for-planned__label"},[t._v(t._s(i.label))])])])})),0)},Ngt=[],Egt={name:"ModalListActionsForPlannedOrder",mixins:[],props:{settings:{type:Object,required:!0}},data:function(){return{listSettings:[{id:"3465yrthgff",icon:"Instrument-open-orders-colorblind",handler:"openPandingBuy",label:"Limit order to Buy",class:"positive-item"},{id:"efgfd4ygdf",icon:"Instrument-open-orders-colorblind",label:"Limit order to Sell",handler:"openPandingSell",class:"negative-item"},{id:"cxv5e4hrtfd",icon:"SetPrice",label:"Set price alert",class:"neutral-item",handler:"addOverlay",data:{overlay:"PriceAlert",name:"PriceAlert"}},{id:"p49itjkgnfd",icon:"Lines_Type_3",handler:"addOverlay",label:"Draw a horizontal line",class:"neutral-item",data:{overlay:"HorizontalLine",name:"HorizontalLine"}}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStyled:function(){return{top:"".concat(this.settings.offsetY,"px"),left:"".concat(this.settings.event.offsetX-200,"px")}}}),methods:{addOverlay:function(t){var e=JSON.parse(JSON.stringify(this.settings));delete e.id,Jpt.$emit("addInstrumentToChart",{name:"addInstrumentToChart",data:{name:t.name,overlay:t.overlay,withButtonAddAddedInFavorits:!0,data:Object(c["a"])(Object(c["a"])({},e),{},{createdWithDefault:!0})}}),this.close()},close:function(){this.acceptClose&&this.$emit("close")},handleClickOnItem:function(t,e){this[t]&&this[t](e)},openAtPriceSell:function(){this.$emit("openAtPriceSell",{price:this.settings.price,type:"Buy"}),this.close()},openAtPriceBuy:function(){this.$emit("openAtPriceBuy",{price:this.settings.price,type:"Buy"}),this.close()},openPandingBuy:function(){this.$emit("createPendingOrder",{price:this.settings.price,type:"Buy"}),this.close()},openPandingSell:function(){this.$emit("createPendingOrder",{price:this.settings.price,type:"Sell"}),this.close()}},mounted:function(){var t=this;setTimeout((function(){return t.acceptClose=!0}),200)},destroyed:function(){}},Ugt=Egt,Vgt=(i("80b6"),Object(C["a"])(Ugt,Wgt,Ngt,!1,null,"2fc67ef4",null)),Hgt=Vgt.exports,Ggt=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],staticClass:"dropdown-radio",class:t.getActiveTheme},[e("div",{staticClass:"dropdown-radio__item",class:t.getActiveTheme},[e("RadioButton",{attrs:{value:t.volumeType,modelValue:"Money",theme:t.getActiveTheme},on:{change:function(e){return t.changeVolumeType("Money",t.order)}}}),t._v("Volume")],1),e("div",{staticClass:"dropdown-radio__item",class:t.getActiveTheme},[e("RadioButton",{attrs:{value:t.volumeType,modelValue:"Percent",theme:t.getActiveTheme},on:{change:function(e){return t.changeVolumeType("Percent",t.order)}}}),t._v("Dinamic")],1)])},qgt=[],zgt={name:"ModalHedj",mixins:[],components:{RadioButton:$a},props:["volumeType","changeVolumeType","order"],mounted:function(){},destroyed:function(){},methods:{close:function(){this.$emit("close")}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),watch:{},data:function(){return{}}},Ygt=zgt,Xgt=(i("ef44"),Object(C["a"])(Ygt,Ggt,qgt,!1,null,"215c3b42",null)),Qgt=Xgt.exports,Jgt={name:"BigLineOverlay",mixins:[tgt["a"],Xh],components:{ModalListActionsForPlannedOrder:Hgt,TrailingModal:xgt,DropdownRadio:Qgt},data:function(){return{isOpenTrailingModifyModal:null,isOpenTypeVolumePlanned:null,positionTralingModal:null,isOpenTrailingModal:!1,ctx:null,settingsModal:null,volumeIntervalMinus:null,volumeIntervalAdd:null,qoute:null,isDown:null,isShow:!1,isShowControls:!1,volumeType:"Money",isDisabledShowCreatedOrder:!1,onHoverds:[],onHoveredLimit:[],isFromModal:!1,currentPosYQoute:0,changedOrderLimit:null,isMoveCreatedPendingOrder:!1,dropdownSettingsCreatedOrder:!1,idOrderOpenDropdown:"",objectCreatedOrder:[],offsetToDropdown:null,listPlannedOrders:[],listAlerts:[],listHorizontalLines:[],listTimes:[{hour:696,label:"До исполнения"},{hour:1,label:"01:00"},{hour:2,label:"02:00"},{hour:3,label:"03:00"},{hour:6,label:"06:00"},{hour:12,label:"12:00"},{hour:24,label:"24:00"},{hour:48,label:"48:00(2д)"},{hour:72,label:"72:00(3д)"},{hour:96,label:"96:00(4д)"},{hour:120,label:"120:00(5д)"},{hour:144,label:"144:00(6д)"},{hour:168,label:"168:00(7д)"}],addPlannedOrderButton:null,defaultVolume:1e3}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getProfileAccount:"subscribeOrders/getProfileAccount",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",getServerTime:"serverTime/getServerTime"})),{},{colorText:function(){return"dark"===this.getActiveTheme?"#333":"#fff"},positive:function(){return"dark"===this.getActiveTheme?"#1ff0b1":"#008e72"},negative:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},sett:function(){return this.$props.settings},getStep:function(){return 1/Ph(this.getPrecision)*120},getOffsetDD:function(){var t=this;return function(e){var i=t.getInterval(new Date(t.getServerTime.utcNow).getTime(),new Date(e.pendingStopDT).getTime()-6e4),o=i.day>1?40:0;return 70+o}},getOffsetTopForDropDownTime:function(){return"".concat(this.offsetToDropdown||32,"px")},getFormmatTime:function(){return function(t){return"".concat(t>10?t:"0".concat(t)," : 00")}},getQoute:function(){return this.qoute&&this.qoute.a&&this.qoute.b?this.qoute:{a:this.$props.sub[this.$props.sub.length-1][1],b:this.$props.sub[this.$props.sub.length-1][3]}},getTime:function(){return this.getOrderTimer},getEndPoint:function(){return this.$props.layout.spacex-8},getPositionsY:function(){var t=this;return function(e){return t.$props.layout.$2screen(e)}},getPrec:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.symbol})).precision},getValuePip:function(){return 1/Ph(this.getPrecision)},getEquity:function(){if(this.getDefaultAccount)return this.getDefaultAccount.equity},getAllMargin:function(){return this.getEquity*this.getStatistics.account.maxLeverage},getFreeMargin:function(){return this.getAllMargin-this.getStatistics.account.margin}}),methods:{getOffsetSettings:function(t){var e=document.getElementById("id_".concat(t.id));return e?this.getEndPoint/2-(e.offsetWidth+18):-1e3},drawResultTrailing:function(t,e,i,o,n,s){var r=s||("dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"),a=this.drawDescriptionResultTrailing(t,n,e,i,!0,o,!1,s),c=this.drawDescriptionResultTrailing(t,n,e,i,!1,o,!0,s);t.beginPath(),t.moveTo(c.startX,c.startY),t.lineTo(a.endX,c.startY),t.moveTo(c.endX,c.startY),t.lineTo(this.$props.layout.spacex,c.startY),t.strokeStyle=r,t.setLineDash([4,5]),t.stroke()},drawDescriptionResultTrailing:function(t,e,i,o,n,s,r,a){var c=this.$props.layout,l="".concat(n?"".concat(+i.toFixed(this.getPrecision)," "):"").concat(o),u=a||("dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"),d=n?8:s||c.t2screen(null===e||void 0===e?void 0:e.time),h=c.$2screen(+i);t.beginPath();var p=t.measureText(l).width;if(t.fillStyle=u,t.fillText(l,d,h+4),r){t.beginPath();var g=d+p/2;t.arc(g,h,11,0,2*Math.PI,!0),t.strokeStyle=u,t.setLineDash([]),t.stroke()}return{startX:d-4,startY:h,endX:d+4+p}},getVolumeForOrder:function(t){if(t.volume<1e3){var e=this.getFreeMargin*(t.volume/100),i=(e/1e3).toFixed(0),o=(1e3*+i).toFixed(0);return"".concat(t.volume," / ").concat(+o.toLocaleString("ru"))}return t.volume},getVolumeFromPercent:function(t){var e=100*t.volume/this.getFreeMargin;return e.toFixed(2)},openTrialingModifyModal:function(t,e){var i=this.ctx.canvas.clientHeight,o=this.$props.layout.t2screen(this.roundingFromDate(new Date(e.openDate),this.timeFrame||60)),n=this.$props.layout.$2screen(e.openPrice);this.positionTralingModal={x:o<315?-315:0,y:i-n<180?-180:24},this.isOpenTrailingModifyModal=e},handlerChangeTrailingModify:function(t){var e=this,i=JSON.parse(JSON.stringify(this.listPlannedOrders));this.listPlannedOrders=i.map((function(i){return i.id!==e.isOpenTrailingModifyModal.id||(i.trailingStart=t.changePrice.pips,i.trailingSl=t.resultPrice.pips),i}))},closeTrailingModify:function(t){this.isOpenTrailingModifyModal=null},changeTrailingModify:function(t){var e=this,i=JSON.parse(JSON.stringify(this.listPlannedOrders)),o=i.map((function(i){return i.id!==e.isOpenTrailingModifyModal.id||(i.trailingStart=t.sl,i.trailingSl=t.start),i})),n=o.find((function(t){return t.id===e.isOpenTrailingModifyModal.id}));this.modifyPendingTradingOrder(n),this.isOpenTrailingModifyModal=!1},closeTrailing:function(t){var e=this,i=JSON.parse(JSON.stringify(this.objectCreatedOrder));this.objectCreatedOrder=i.map((function(t){return t.id===e.isOpenTrailingModal.id?(t.trailingSl=void 0,t.trailingStart=void 0,t):t})),this.isOpenTrailingModal=null},changeTrailing:function(t){var e=this;this.objectCreatedOrder=this.objectCreatedOrder.map((function(i){return i.id!==e.isOpenTrailingModal.id||(i.trailingStart=t.sl,i.trailingSl=t.start),i})),this.isOpenTrailingModal=null},roundingFromDate:function(t,e){var i=6e4,o=i*e,n=t.getTimeWithoutUTC();return n-n%o},openTrialingModal:function(t,e){var i=this.ctx.canvas.clientHeight,o=this.$props.layout.t2screen(this.roundingFromDate(new Date(e.openDate),this.timeFrame||60)),n=this.$props.layout.$2screen(e.openPrice);this.positionTralingModal={x:o<315?-315:0,y:i-n<180?-180:24},this.isOpenTrailingModal=e},handlerChangeTrailing:function(t){var e=this;this.objectCreatedOrder=this.objectCreatedOrder.map((function(i){return i.id!==e.isOpenTrailingModal.id||(i.trailingStart=t.changePrice.pips,i.trailingSl=t.resultPrice.pips),i}))},openTypeVolumePlanned:function(t){this.isOpenTypeVolumePlanned=t.id},closeRadioDropDown:function(){this.isOpenTypeVolumePlanned=!1},changeVolumeType:function(t,e){this.objectCreatedOrder=this.objectCreatedOrder.map((function(i){return i.id!==e.id||(i.volumeType=t),i})),this.volumeType=t},changeDisabledLim:function(t){this.disabledLim=t},openDropdownTimes:function(t){if(!this.dropdownSettingsCreatedOrder||this.dropdownSettingsCreatedOrder.id!==t.id){this.dropdownSettingsCreatedOrder=t;var e=this.getPositionsY(t.openPrice),i=this.ctx.canvas.offsetHeight-e,o=i>192?32:-172;this.offsetToDropdown=o}},init:function(){this.shader=new Rgt(this)},getInterval:function(t,e){var i,o,n,s,r=e-t;return r/=1e3,i=Math.round(r/60/60/24),o=Math.round(r/60/60%24),n=Math.round(r/60%60),s=Math.round(r%60),{day:i,hour:o,minute:n,second:s}},getOrderTimer:function(t){var e=this.getInterval(new Date(this.getServerTime.utcNow).getTime(),new Date(t.pendingStopDT).getTime()-6e4),i=Math.abs(e.hour-1)>=10?"".concat(Math.abs(e.hour-1)):"0".concat(Math.abs(e.hour-1)),o=e.minute>=10?"".concat(Math.abs(e.minute)):"0".concat(Math.abs(e.minute));return e.day>1?"До исполнения ".concat(e.day," дней"):"".concat(i,":").concat(o)},setNewHour:function(t,e){var i=JSON.parse(JSON.stringify(e));i.hours=t,this.updateCreater(i),this.dropdownSettingsCreatedOrder=!1,Jpt.$emit("setNewValuePendingOrder",{data:e,symbol:this.symbol})},updateCreater:function(t){this.objectCreatedOrder=this.objectCreatedOrder.map((function(e){return t.id===e.id&&(e=t),e}))},drawControlForVolumeCreated:function(t,e,i){var o=this.drawSquare(t,e,i);this.addVolumeCreated=this.drawCross(t,e,i,18,5);var n=this.drawButton(t,o.midEnd.x-6,o.C.y+1,"".concat(this.objectCreatedOrder.volume),{margin:8,padding:6,background:"dark"===this.getActiveTheme?"#4c5b6b":"#dfdfdf",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}),s=this.drawSquare(t,n.startRect.x-8,i);return this.turnOutVolumeCreated=this.darwHorizontLine(t,n.startRect.x-8,i,18,5),t.lineWidth=1,s.A.x},closeLimit:function(t,e){var i=this;this.listPlannedOrders=this.listPlannedOrders.map((function(o){return o.id===t.id&&(o[e]=0,i.modifyPendingTradingOrder(o)),o}))},openDropdown:function(t){this.idOrderOpenDropdown===t.id?this.idOrderOpenDropdown="":this.idOrderOpenDropdown=t.id},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["WayOpenOrderFromQuote"]},mouseup:function(t){var e=this;this.isDown=null,this.isMoveCreatedPendingOrder=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.movedNewLimit&&(this.modifyPendingTradingOrder(this.movedNewLimit.order),this.movedNewLimit=null),this.onChangePrdictLimit&&(this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.changePredictLimitSettings&&(this.updateCreater(this.oldObjectCreatedOrder),this.oldObjectCreatedOrder=null,Jpt.$emit("setNewValuePendingOrder",{data:this.changePredictLimitSettings.creater,symbol:this.symbol}),this.changePredictLimitSettings=null),this.onChangePrdictLimit=!1),this.changedOrderLimit&&(this.onHoverds=this.onHoverds.filter((function(t){return t!=="".concat(e.changedOrderLimit.order.id,"_").concat(e.changedOrderLimit.typeChanged)})),this.reopenOrderWithModify(this.changedOrderLimit),this.changedOrderLimit=null,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}))},mousedown:function(t){this.isDown=t;var e=this.$props.layout,i=this.getEndPoint-9,o=e.$2screen(this.getQoute.b)||0,n=this.$props.layout.screen2$(t.layerY-2),s=this.$props.layout.$2screen(n),r=t.layerX;this.hover(t.layerX,s,i,o)?this.isShowControls=!0:(this.isShowControls=!1,this.handleCheckChangeLimitCreated(t,s)||this.handleCheckChangeLimit(t,s)||this.handleCheckClickOnMoveCreatedPendingOrder(t,s)||this.handleClickOnCreateLimit(t,r,s)||this.handleChangeLimitOrder(t,r,s)||this.handleCheckClickOnChangeVolume(t,s)||this.handleCheckClickOnControlsChangeVolumeNewLimitOrder(t,s)||this.handleCheckClickOnControlsChangeVolumeNewOrder(t,s)||this.addPlannedOrderButton&&this.hover(t.layerX,s,this.addPlannedOrderButton.x,this.addPlannedOrderButton.y)&&this.openModal(t,n.toFixed(this.getPrec)))},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},mousemove:function(t){var e=this;this.mouseX=t.layerX,this.mouseY=t.layerY,this.changeLimitsOnPredictOrder()||(t.layerXthis.getEndPoint-.02*this.getEndPoint?this.isShow=!0:this.isShow=!1,this.changePositionPendingOrder(),this.changePositionLimitsOrder(),this.changedOrderLimit&&(this.listPlannedOrders=this.listPlannedOrders.map((function(t){return t.id===e.changedOrderLimit.order.id&&(t[e.changedOrderLimit.typeChanged]=+e.$props.layout.screen2$(e.mouseY).toFixed(e.getPrec)),t}))))},getOrderModify:function(t){if(t){var e=t.id,i=t.accountId,o=t.comment,n=t.contractName,s=t.volume,r=t.orderType,a=(t.createdDate,t.trailingStart),c=t.trailingSl,l=this.listPlannedOrders.find((function(t){return t.id===e}));if(l){var u={id:e,accountId:i,comment:o||"",contractName:n,volume:s,orderType:r,openDate:t.createdDate||t.openDate||t.timeStart,takeProfit:l.takeProfit,stopLoss:l.stopLoss,trailingStart:a,trailingSL:c};return u}}},modifyPendingTradingOrder:function(t){var e=this.getOrderModify(t);if(e){var i={Command:"ModifyPendingTradingOrder",Token:this.getToken,data:e};this.$socketStream.sendCommand({ws:"apiWS",command:i})}},changePositionLimitsOrder:function(){var t=this;if(this.movedNewLimit){var e=this.$props.layout.screen2$(this.mouseY),i=e.toFixed(this.getPrecision);this.listPlannedOrders=this.listPlannedOrders.map((function(e){return e.id!==t.movedNewLimit.order.id||(e[t.movedNewLimit.type]=+i),e}))}},findedLimitClick:function(t,e,i){var o=this,n=this.$props.layout;return this.listPlannedOrders.find((function(s){if(s[t]){var r=o.getEndPoint/2,a=s[t],c=n.$2screen(a),l=i-24<=c&&i+24>=c,u=r-20<=e&&r+20>=e;return l&&u?s:void 0}}))},handleChangeLimitOrder:function(t,e,i){var o=this.findedLimitClick("takeProfit",e,i),n=this.findedLimitClick("stopLoss",e,i);return o?(this.movedNewLimit={type:"takeProfit",order:o},this.stopChart(!0),o):n?(this.movedNewLimit={type:"stopLoss",order:n},this.stopChart(!0),n):void 0},handleClickOnCreateLimit:function(t,e,i){var o=this,n=this.$props.layout,s=this.listPlannedOrders.find((function(t){var s=o.getEndPoint/2,r=t.pendingPrice||t.openPrice,a=n.$2screen(r),c=i-32<=a&&i+32>=a,l=s-20<=e&&s+20>=e;if(c&&l)return t}));if(s){var r=s.pendingPrice||s.openPrice,a=n.$2screen(r),c={Buy:i>a?"stopLoss":"takeProfit",Sell:i>a?"takeProfit":"stopLoss"};this.movedNewLimit={type:c[s.orderType],order:s},this.stopChart(!0)}},drawCirlce:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="red",t.arc(e,i,8.5,0,2*Math.PI,!0),t.stroke()},hover:function(t,e,i,o,n){return n=n||8.5,(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*n},drawCircle:function(t,e,i){t.beginPath(),t.fillStyle="red",t.lineWidth="1.5",t.strokeStyle="blue",t.arc(e,i,8,0,2*Math.PI,!0),t.stroke(),t.fill()},draw:function(t){this.ctx=t,this.onHoverds=[];var e=this.$props.layout;if(this.checkOnHoveredsAlert(),this.checkOnHoveredHorizontalLines(),this.shader&&this.shader.draw(t,this.listPlannedOrders,this.objectCreatedOrder,"dark"===this.getActiveTheme,!this.disabledLim,this.getValuePip,this.getPrecision),this.disabledLim||this.formatPendingOrder(t),this.initCreatePendingOrder(t),this.currentPosYQoute=e.$2screen(this.getQoute.b)-1||0,this.getQoute&&this.isShow||this.isShowControls){var i=this.getEndPoint;this.checkHovered(t),this.isMoveCreatedPendingOrder||(this.drawSquare(t,i,this.currentPosYQoute),this.drawRow(t,0,i-24,this.currentPosYQoute+1,this.positive),this.drawCross(t,i,this.currentPosYQoute,18,5)),this.isDown||this.isDisabledShowCreatedOrder||this.drawControlosCreatePlannedOrder(t)}},checkHovered:function(t){var e=this.onHoverds.find((function(t){return"onCreatedOrder"===t}));this.mouseY>=this.currentPosYQoute-12&&this.mouseY<=this.currentPosYQoute+12?e||this.onHoverds.push("onCreatedOrder"):e&&(this.onHoverds=this.onHoverds.filter((function(t){return"onCreatedOrder"!==t})))},formatPendingOrder:function(t){var e=this,i=this.$props.layout;this.listPlannedOrders=this.listPlannedOrders.map((function(o){var n=i.$2screen(o.pendingPrice);t.beginPath(),t.font="10px Arial";var s="Limit ".concat(o.orderType," ").concat(o.pendingPrice.toFixed(e.getPrecision)),r=t.measureText(s).width;t.fillStyle="Sell"===o.orderType?e.negative:e.positive,t.fillText(s,8,n+3);var a=e.drawPlannedOrder(t,o);return a.controlsPositions||e.drawRow(t,r+16,e.getEndPoint+8,n,"Sell"===a.orderType?e.negative:e.positive),a.yShader=n,a}))},drawControlsRect:function(t,e,i,o,n){var s=24,r=18,a=i-s/2,c=o-r/2,l={takeProfit:this.positive,stopLoss:this.negative};t.beginPath(),t.fillStyle=n||l[e],t.fillRect(a,c,s,r),this.drawArcs(t,a,c)},drawArcs:function(t,e,i){t.beginPath(),t.arc(e+6,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+12,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+18,i+6,2,0,2*Math.PI),t.closePath(),t.arc(e+6,i+12,2,0,2*Math.PI),t.closePath(),t.arc(e+12,i+12,2,0,2*Math.PI),t.closePath(),t.arc(e+18,i+12,2,0,2*Math.PI),t.closePath(),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill()},initCreatePendingOrder:function(t){var e=this;this.objectCreatedOrder.length&&(this.objectCreatedOrder=this.objectCreatedOrder.map((function(i){return e.drawCreatePendingOrder(t,i),i.yShader=e.$props.layout.$2screen(i.openPrice),i})))},checkOnHoveredHorizontalLines:function(){var t=this;if(this.mouseX&&this.mouseY&&!(this.listHorizontalLines.length<1)){var e=this.listHorizontalLines.find((function(e){var i=t.$props.layout.$2screen(e.y$);if(t.hover(t.mouseX,t.mouseY,t.getEndPoint-10,i,16))return e})),i=this.onHoverds.find((function(t){return"HorizontalLine"===t}));e?i||this.onHoverds.push("HorizontalLine"):i&&(this.onHoverds=this.onHoverds.filter((function(t){return"HorizontalLine"!==t})))}},checkOnHoveredsAlert:function(){var t=this;if(this.mouseX&&this.mouseY&&!(this.listAlerts.length<1)){var e=this.listAlerts.find((function(e){var i=t.$props.layout.$2screen(e.y$);if(t.hover(t.mouseX,t.mouseY,t.getEndPoint-10,i,16))return e})),i=this.onHoverds.find((function(t){return"isAlert"===t}));e?i||this.onHoverds.push("isAlert"):i&&(this.onHoverds=this.onHoverds.filter((function(t){return"isAlert"!==t})))}},copyCreater:function(t){t||(t=this.objectCreatedOrder[0]);var e=this.$props.layout,i=JSON.parse(JSON.stringify(t)),o=+e.$2screen(+i.openPrice)+80;if(i.openPrice=+e.screen2$(+o).toFixed(this.getPrecision),i.takeProfit){var n=e.$2screen(+i.takeProfit)+80;i.takeProfit=+e.screen2$(+n).toFixed(this.getPrecision)}if(i.stopLoss){var s=+e.$2screen(+i.stopLoss)+80;i.stopLoss=+e.screen2$(+s).toFixed(this.getPrecision)}i.id="createrPendingOrder_".concat(i.price,"_").concat(Math.floor(Math.random()*(new Date).getTime()));var r=JSON.parse(JSON.stringify(this.objectCreatedOrder));r.push(i),this.objectCreatedOrder=r},checkHoverOnCreater:function(t){var e=this.$props.layout.$2screen(t.openPrice);this.onHoverds;var i=this.onHoverds.find((function(e){return e==="onCreater__".concat(t.id)}));this.mouseY>=e-24&&this.mouseY<=e+24?i||this.onHoverds.push("onCreater__".concat(t.id)):i&&(this.onHoverds=this.onHoverds.filter((function(e){return e!=="onCreater__".concat(t.id)})))},drawCreatePendingOrder:function(t,e){var i={Buy:{label:"B",color:this.positive},Sell:{label:"S",color:this.negative}},o=this.getEndPoint,n=this.$props.layout.$2screen(e.openPrice),s=this.onHoverds.find((function(t){return"onCreatedPending"===t}));this.mouseY>=n-12&&this.mouseY<=n+12?s||this.onHoverds.push("onCreatedPending"):s&&(this.onHoverds=this.onHoverds.filter((function(t){return"onCreatedPending"!==t}))),t.beginPath(),t.font="10px Arial";var r="Limit ".concat(e.orderType," ").concat(+e.openPrice),a=t.measureText(r).width+16;t.fillStyle=i[e.orderType].color,t.fillText(r,8,n+3);var c=this.getPipsOnPrices(e.openPrice,this.getQoute.a),l="".concat(e.openPrice," / ").concat(c," ");if(this.drawRow(t,a,this.getEndPoint-8,n,i[e.orderType].color,[3,5],!0,l),this.checkHoverOnCreater(e),this.drawControlsRect(t,"stopLoss",o-12,n),this.drawPointerToLimits(t,(this.getEndPoint-8)/2,n,e,12,8),e.trailingStart&&e.trailingSl){var u="Buy"===e.orderType?1:-1,d=this.getValuePip*e.trailingStart*u+ +e.openPrice,h=this.getValuePip*e.trailingSl*u+ +e.openPrice,p="dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c";this.drawResultTrailing(t,d,e.trailingStart,this.$props.layout.spacex/2,e,p),this.drawResultTrailing(t,h,e.trailingSl,this.$props.layout.spacex/2,e,p)}if(e.takeProfit>0)this.drawLimitedPredict(t,e,"takeProfit","TP");else{var g="Buy"===e.orderType?-10:10;this.drawButton(t,this.getEndPoint,n+g,"TP",{margin:8,padding:4,background:this.positive,fontSize:8,color:this.colorText},"Buy"!==e.orderType," ");var f=this.onHoverds.find((function(t){return"onCreatedPendingTP"===t}));this.mouseY>=n+g-12&&this.mouseY<=n+g+12?f||this.onHoverds.push("onCreatedPendingTP"):f&&(this.onHoverds=this.onHoverds.filter((function(t){return"onCreatedPendingTP"!==t})));var m=(this.getEndPoint-8)/2,v="Buy"===e.orderType?-26:26;this.drawControlsRect(t,"takeProfit",m,n+v)}if(e.stopLoss>0)this.drawLimitedPredict(t,e,"stopLoss","SL");else{var y="Sell"===e.orderType?-10:10;this.drawButton(t,this.getEndPoint,n+y,"SL",{margin:8,padding:4,background:this.negative,fontSize:8,color:this.colorText},"Sell"!==e.orderType," ");var C=this.onHoverds.find((function(t){return"onCreatedPendingSL"===t}));this.mouseY>=n+y-12&&this.mouseY<=n+y+12?C||this.onHoverds.push("onCreatedPendingSL"):C&&(this.onHoverds=this.onHoverds.filter((function(t){return"onCreatedPendingSL"!==t})));var b=(this.getEndPoint-8)/2,S="Buy"===e.orderType?26:-26;this.drawControlsRect(t,"stopLoss",b,n+S)}},closeDropDownTime:function(t){this.dropdownSettingsCreatedOrder=null},getPipsOnPrices:function(t,e){if(!t||!e)return 0;var i=(t-e)*Ph(this.getPrecision-1);return Math.abs(i).toFixed(0)},getProfit:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=n[o]().toFixed(2);return+s},getProcent:function(t){return this.getDefaultAccount.equity&&t?(t/this.getDefaultAccount.equity*100).toFixed(3):0},drawLimitedPredict:function(t,e,i,o){var n={takeProfit:this.changePredictLimitSettings&&"takeProfit"===this.changePredictLimitSettings.typeLimit?"#8c8c8c":this.positive,stopLoss:this.changePredictLimitSettings&&"stopLoss"===this.changePredictLimitSettings.typeLimit?"#8c8c8c":this.negative},s=this.$props.layout,r=s.$2screen(e[i]);t.beginPath(),t.font="10px Arial";var a="".concat(o," ").concat(e[i]),c=t.measureText(a).width+16;t.fillStyle=n[i],t.fillText(a,8,r+3);var l=this.getProfit(e.openPrice,e[i],e.volume,e.orderType),u="".concat(o," ").concat(l," $ ").concat(this.getProcent(l)," % ").concat(this.getPipsOnPrices(e.openPrice,e[i])," pip");this.drawRow(t,c,this.getEndPoint-8,r,n[i],[3,5],!0,u);this.drawButton(t,this.getEndPoint,r+7,o,{margin:8,padding:4,background:n[i],fontSize:10,color:this.colorText},!1," ");var d=this.onHoverds.find((function(t){return t==="drawLimitedPredict_".concat(i)}));this.mouseY>=r-12&&this.mouseY<=r+14?d||this.onHoverds.push("drawLimitedPredict_".concat(i)):d&&(this.onHoverds=this.onHoverds.filter((function(t){return t!=="drawLimitedPredict_".concat(i)})))},checkOnHoveredOrders:function(t,e){t.font;var i=this.$props.layout,o=i.$2screen(e.pendingPrice),n=i.$2screen(e.takeProfit),s=i.$2screen(e.stopLoss),r=this.getEndPoint,a=this.getEndPoint/2,c=this.mouseX>r-205,l="Buy"===e.orderType?e.takeProfit?8:32:e.stopLoss?8:32,u="Sell"===e.orderType?e.takeProfit?8:32:e.stopLoss?8:32,d=o-l<=this.mouseY&&o+u>=this.mouseY,h=!c||!d,p=n-12<=this.mouseY&&n+12>=this.mouseY,g=s-12<=this.mouseY&&s+12>=this.mouseY,f=o-l<=this.mouseY&&o+u>=this.mouseY,m=a-24<=this.mouseX&&a+24>=this.mouseX,v=m&&f,y=this.changedOrderLimit&&this.changedOrderLimit.order.id===e.id,C=o-2<=this.mouseY&&o+2>=this.mouseY,b=h&&!y&&!p&&!g&&!v&&!C;return this.hoveredOrder="".concat(e.id),this.hoveredOrder===e.id&&b},drawPlannedOrder:function(t,e){var i=this.$props.layout,o=i.$2screen(e.pendingPrice),n=this.checkOnHoveredOrders(t,e);if(n||this.isMoveCreatedPendingOrder||this.isShowControls||this.objectCreatedOrder.length)return e.controlsPositions&&delete e.controlsPositions,e.isDisabledShow=!0,e;t.beginPath(),t.font="10px Arial";var s="Limit ".concat(e.orderType," ").concat(e.pendingPrice),r=t.measureText(s).width+16;t.fillStyle="Sell"===e.orderType?this.negative:this.positive,t.fillText(s,8,o+3),e.isDisabledShow=!1;var a=e.trailingSl||e.trailingSL;if(e.trailingStart&&a){var c="Buy"===e.orderType?1:-1,l=this.getValuePip*e.trailingStart*c+e.pendingPrice,u=this.getValuePip*a*c+e.pendingPrice,d="dark"===this.getActiveTheme?"#00b9fc":"#3C73F1";this.drawResultTrailing(t,l,e.trailingStart,this.$props.layout.spacex/2,e,d),this.drawResultTrailing(t,u,a,this.$props.layout.spacex/2,e,d)}this.drawPricePoint(t,o,e.pendingPrice,e.orderType,!0);var h="Sell"===e.orderType?this.negative:this.positive,p=e.pendingPrice||e.openPrice,g=this.getPipsOnPrices(p,this.getQoute.a),f="".concat(p," ").concat(g," pip");this.drawRow(t,r,this.getEndPoint,o,h,[3,5],"circle",f);var m=this.onHoverds.find((function(t){return t==="".concat(e.id)}));return this.mouseY>=o-14&&this.mouseY<=o+14?(this.onHoverds=this.onHoverds.filter((function(t){return t==="".concat(e.id)})),m||this.onHoverds.push("".concat(e.id))):m&&(this.onHoverds=this.onHoverds.filter((function(t){return t!=="".concat(e.id)}))),this.createLimitPlannedOrder(t,e),this.drawPointerToLimits(t,this.getEndPoint/2,o,e,12,0),e.controlsPositions={endPointX:this.getEndPoint/2-16},t.font=e.type,e},drawPointerToLimits:function(t,e,i,o,n,s){n=n||8,s=s||12;var r=this.$props.layout;if(o.takeProfit>0){var a="Buy"===o.orderType?-n:n,c="Buy"===o.orderType?s:-s,l=r.$2screen(o.takeProfit);t.beginPath(),t.moveTo(e,i+a),t.lineTo(e,l+c),t.strokeStyle="#8c8c8c",t.stroke()}if(o.stopLoss>0){var u="Buy"===o.orderType?n:-n,d="Buy"===o.orderType?-s:s,h=r.$2screen(o.stopLoss);t.beginPath(),t.moveTo(e,i+u),t.lineTo(e,h+d),t.strokeStyle="#8c8c8c",t.stroke()}},BrokerPosition:function(t){var e=this,i=this.$orderStorage.getOrdersOnStorage();setTimeout((function(){return e.setHistoryOrders(i)}),300)},createLimitPlannedOrder:function(t,e){e.takeProfit>0?this.drawLimitPlannedOrder(t,e,"takeProfit","TP"):this.drawBoxLimit(t,e,"takeProfit","TP"),e.stopLoss>0?this.drawLimitPlannedOrder(t,e,"stopLoss","SL"):this.drawBoxLimit(t,e,"stopLoss","SL")},drawBoxLimit:function(t,e,i,o){var n={takeProfit:this.positive,stopLoss:this.negative},s={Buy:{takeProfit:22,stopLoss:-22},Sell:{takeProfit:-22,stopLoss:22}},r=this.$props.layout,a=this.getEndPoint/2,c=r.$2screen(e.pendingPrice)-s[e.orderType][i];t.beginPath(),t.fillStyle=n[i],this.drawControlsRect(t,i,a,c),t.fill()},drawLimitPlannedOrder:function(t,e,i,o){var n={takeProfit:this.positive,stopLoss:this.negative},s=this.$props.layout,r=s.$2screen(e[i]),a=this.onHoverds.find((function(t){return t==="".concat(e.id,"_").concat(i)}));this.mouseY>=r-12&&this.mouseY<=r+14?a||this.onHoverds.push("".concat(e.id,"_").concat(i)):a&&(this.onHoverds=this.onHoverds.filter((function(t){return t!=="".concat(e.id,"_").concat(i)}))),t.beginPath(),t.fillStyle=n[i],t.font="10px Arial";var c="".concat(o," ").concat(e[i].toFixed(this.getPrecision)),l=t.measureText(c).width+16;t.fillText(c,8,r+3);var u=e.pendingPrice||e.openPrice,d=this.getPipsOnPrices(e[i],u),h="".concat(o," ").concat(e[i]," ").concat(d," pips"),p=this.onHoverds.find((function(t){return t==="".concat(e.id,"_").concat(i)})),g=!!p||"circle";this.drawRow(t,l,this.getEndPoint,r,n[i],[3,5],g,h);this.drawButton(t,this.getEndPoint,r+7,o,{margin:8,padding:4,background:n[i],fontSize:10,color:this.colorText},!1," ")},drawPricePoint:function(t,e,i,o,n){t.beginPath(),t.font="".concat(10,"px Arial");var s=t.measureText(i.toFixed(this.getPrec)),r=n?t.measureText(""):s,a=r.actualBoundingBoxAscent||7,c=n?this.getEndPoint+6:this.getEndPoint-r.width,l=c-8,u=this.getEndPoint+12;return t.beginPath(),t.moveTo(u,e-a),t.lineTo(u,e+a),t.lineTo(c,e+a),t.lineTo(l,e),t.lineTo(c,e-a),t.closePath(),t.fillStyle="Sell"===o?this.negative:this.positive,t.fill(),t.beginPath(),t.fillStyle=this.colorText,t.fillText(n?"":i.toFixed(this.getPrecision),c+2,e+a/2),l},drawControlsCreateOrder:function(t,e,i){var o=this.drawSquare(t,e,i);this.drawRow(t,0,e-24,i+1,this.positive),this.darwHorizontLine(t,e,i,18,5),this.buy=this.drawButton(t,o.midEnd.x,o.A.y-6,"Buy",{margin:8,padding:6,background:this.positive,color:this.colorText}),this.sell=this.drawButton(t,o.midEnd.x,o.C.y+6,"Sell",{margin:8,padding:6,background:this.negative,color:this.colorText,width:this.buy.width},!0),this.drawControlForVolume(t,o.midEnd.x-8,i,o.midEnd.x,o.C.y)},drawControlForVolumePlannedOrder:function(t,e,i,o){var n=this.drawButton(t,e-6,i+10,"".concat(o),{margin:8,padding:6,background:"dark"===this.getActiveTheme?"#4c5b6b":"#dfdfdf",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"});return t.lineWidth=1,{endPointX:n.startRect.x}},drawControlForVolume:function(t,e,i,o,n){var s=this.drawSquare(t,e,i);this.addVolume=this.drawCross(t,e,i,18,5);var r=this.drawButton(t,s.midEnd.x-6,s.C.y+1,"".concat(this.defaultVolume),{margin:8,padding:6,background:"dark"===this.getActiveTheme?"#4c5b6b":"#dfdfdf",color:"dark"===this.getActiveTheme?"#bbcee0":"#8c8c8c"}),a=this.drawSquare(t,r.startRect.x-8,i);return this.turnOutVolume=this.darwHorizontLine(t,r.startRect.x-8,i,18,5),t.lineWidth=1,a.A.x},drawControlosCreatePlannedOrder:function(t){if(!(this.onHoverds.length>0)){var e=this.getEndPoint,i=this.mouseY;this.drawSquare(t,e,i-3,null,"light"===this.getActiveTheme?"#8c8c8c":"#bbcee0"),this.drawRow(t,0,e-24,i-2,"light"===this.getActiveTheme?"#8c8c8c":"#bbcee0"),this.addPlannedOrderButton=this.drawCross(t,e,i-3,18,5)}},drawRow:function(t,e,i,o,n,s,r,a){if(s=s||[3,5],t.beginPath(),r||(t.moveTo(e,o),t.lineTo(i,o),t.setLineDash(s),t.strokeStyle=n,t.stroke(),t.setLineDash([0,0])),r){var c=0;if(t.moveTo(e,o),t.lineTo(i/2-8,o),t.setLineDash(s),t.strokeStyle=n,t.stroke(),t.setLineDash([0,0]),"circle"===r?this.drawOrderCircle(t,i/2,o,n,4):this.drawControlsRect(t,"stopLoss",i/2,o,n),a){var l="circle"===r?12:16;c=t.measureText(a).width+6,t.beginPath(),t.fillStyle=n,t.fillText(a,i/2+l,o+3.5)}t.beginPath(),t.moveTo(i/2+12+c,o),t.lineTo(i,o),t.setLineDash(s),t.strokeStyle=n,t.stroke(),t.setLineDash([0,0])}},drawOrderCircle:function(t,e,i,o,n){n=n||8,t.beginPath(),t.strokeStyle=o,t.arc(e,i,n,0,2*Math.PI),t.stroke(),t.beginPath(),t.fillStyle=o,t.arc(e,i,n/2,0,2*Math.PI),t.fill()},drawButton:function(t,e,i,o,n,s,r){r=r||"bold",n.margin=n.margin||8,n.padding=n.padding||4,n.fontSize=n.fontSize||12,n.width=n.width||0,t.font="".concat(r," ").concat(n.fontSize,"px Arial");var a=t.measureText("".concat(o)),c=a.width,l=a.actualBoundingBoxAscent;a.actualBoundingBoxDescent;i=s?i+(l+2*n.padding):i;var u={x:e-(c+2*n.padding),y:i-(l+2*n.padding)},d=n.widthe.openPrice&&(e.stopLoss=0)),"Sell"===e.orderType&&(e.takeProfit>e.openPrice&&(e.takeProfit=0),e.stopLosse.openPrice,stopLoss:ie.openPrice};o[t.type]?this.changePredictLimitSettings={typeOrder:"Buy",typeLimit:t.type,creater:t}:this.changePredictLimitSettings=null},handleCheckChangeLimitCreated:function(t,e){var i=this;if(this.objectCreatedOrder.length){var o=this.$props.layout,n=this.getEndPoint-6,s=this.objectCreatedOrder.find((function(s){var r=i.$props.layout.$2screen(s.openPrice),a=r+("Buy"===s.orderType?-15:15),c=r+("Buy"===s.orderType?15:-15),l=(i.getEndPoint-8)/2,u="Buy"===s.orderType?-26:26,d="Buy"===s.orderType?26:-26;return!i.hover(t.layerX,e,n,a)&&!i.hover(t.layerX,e,l,r+u)||s.takeProfit?!i.hover(t.layerX,e,n,c)&&!i.hover(t.layerX,e,l,r+d)||s.stopLoss?s.takeProfit&&(i.hover(t.layerX,e,n,o.$2screen(s.takeProfit))||i.hover(t.layerX,e,l,o.$2screen(s.takeProfit)))?(i.onChangePrdictLimit={type:"takeProfit",id:s.id,creater:s},i.stopChart(!0),s):s.stopLoss&&(i.hover(t.layerX,e,n,o.$2screen(s.stopLoss))||i.hover(t.layerX,e,l,o.$2screen(s.stopLoss)))?(i.onChangePrdictLimit={type:"stopLoss",id:s.id,creater:s},i.stopChart(!0),s):void 0:(i.onChangePrdictLimit={type:"stopLoss",id:s.id,creater:s},i.stopChart(!0),s):(i.onChangePrdictLimit={type:"takeProfit",id:s.id,creater:s},i.stopChart(!0),s)}));return this.onChangePrdictLimit?(this.oldObjectCreatedOrder=s,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),!0):void 0}},removeCreater:function(t){this.objectCreatedOrder=this.objectCreatedOrder.filter((function(e){return e.id!==t.id}))},handleCheckChangeLimit:function(t,e){var i=this,o=this.onHoveredLimit.find((function(o){if(i.hover(t.layerX,e,o.x+9,o.y+4)&&!o[o.type])return o}));return!!o&&(this.changedOrderLimit={order:o,typeChanged:o.type},this.stopChart(!0),!!o||void 0)},handleCheckClickOnMoveCreatedPendingOrder:function(t,e){var i=this,o=this.$props.layout;if(this.objectCreatedOrder.length)return this.objectCreatedOrder.find((function(n){var s=o.$2screen(n.openPrice),r=i.hover(t.layerX,e,i.getEndPoint/2,s,56);if(i.hover(t.layerX,e,i.getEndPoint-9,s)||r)return i.isMoveCreatedPendingOrder=n,i._$emit("custom-event",{event:"scroll-lock",args:[!0]}),n}))},handleCheckClickOnOpenOrder:function(t){Jpt.$emit("sentOrder",{name:"sentOrder",data:{type:t,volume:this.defaultVolume,symbol:this.symbol}}),this.defaultVolume=1e3,this.isShowControls=!1},handleCheckClickOnControlsChangeVolumeNewLimitOrder:function(t,e){return this.addVolume&&this.hover(t.layerX,e,this.addVolume.x,this.addVolume.y)?(this.changeVolume("add"),!0):this.turnOutVolume&&this.hover(t.layerX,e,this.turnOutVolume.x,this.turnOutVolume.y)?(this.changeVolume("turnOut"),!0):void 0},handleCheckClickOnControlsChangeVolumeNewOrder:function(t,e){if("todo"===t){var i=JSON.parse(JSON.stringify(this.Todo_objectCreatedOrder));return this.addVolumeCreated&&this.hover(t.layerX,e,this.addVolumeCreated.x,this.addVolumeCreated.y)?(i.volume+=1e3,this.Todo_objectCreatedOrder=i,Jpt.$emit("setNewValuePendingOrder",{data:this.Todo_objectCreatedOrder,symbol:this.symbol}),!0):this.turnOutVolumeCreated&&this.hover(t.layerX,e,this.turnOutVolumeCreated.x,this.turnOutVolumeCreated.y)?(i.volume-1e3>=1e3&&(i.volume-=1e3),this.Todo_objectCreatedOrder=i,Jpt.$emit("setNewValuePendingOrder",{data:this.Todo_objectCreatedOrder,symbol:this.symbol}),!0):void 0}},changeVolumeCreatedOrder:function(t,e){var i=JSON.parse(JSON.stringify(e)),o="Money"===e.volumeType?"volume":"volumeDinamic",n="Money"===e.volumeType?1e3:.01;i[o]=t>=n?t:n,this.updateCreater(i),this.debouncer("checkerVolume",500,[i])},calcVolumeCreatedOrder:function(t,e,i){var o=this.objectCreatedOrder[e],n="Money"===o.volumeType?1e3:.01,s="Money"===o.volumeType?"volume":"volumeDinamic",r=t?+o[s]+n:o[s]-n,a=r.toFixed(2),c=JSON.parse(JSON.stringify(o));c[s]=r>=n?+a:n,this.updateCreater(c),i?this.checkerVolume(c):this.debouncer("checkerVolume",500,[c])},checkerVolume:function(t){if(t.volume<1e3)return t.volume=1e3,void this.updateCreater(t)},handleCheckClickOnChangeVolume:function(t,e){var i=this;this.listPlannedOrders.forEach((function(o){o&&o.controlsPositions&&o.controlsPositions.add&&i.hover(t.layerX,e,o.controlsPositions.add.x,o.controlsPositions.add.y)&&(i.listPlannedOrders=i.listPlannedOrders.map((function(t){return t.id===o.id&&(t.volume+=1e3),t}))),o&&o.controlsPositions&&o.controlsPositions.turnOut&&i.hover(t.layerX,e,o.controlsPositions.turnOut.x,o.controlsPositions.turnOut.y)&&(i.listPlannedOrders=i.listPlannedOrders.map((function(t){return t.id===o.id&&(t.volume=t.volume-1e3>=0?t.volume-1e3:t.volume),t})))}))},openModal:function(t,e){if(!(this.onHoverds.length>0)){var i=this.ctx.canvas.offsetHeight-t.offsetY,o=this.ctx.canvas.offsetWidth-260,n=i>260?t.offsetY:this.ctx.canvas.offsetHeight-260;this.settingsModal={symbol:this.symbol,prec:this.getPrec,price:e,event:t,paramName:"ModalListActionsForPlannedOrder",id:"ModalListActionsForPlannedOrder",key:"ModalListActionsForPlannedOrder_".concat(Math.floor(Math.random()*(new Date).getTime())),offsetY:n,offsetX:o}}},notificationHandler:function(t){if(t&&t.command&&"None"===t.command&&"OrderExecution"===t.data.dataType){var e=JSON.parse(t.data.data);"TrailingSL"===e.Message&&this.setHistoryOrders(this.$orderStorage.getOrdersOnStorage())}},changeVolume:function(t){var e=this,i={add:function(){return e.defaultVolume+=1e3},turnOut:function(){return e.defaultVolume>1e3?e.defaultVolume-=1e3:null}};i[t]()},controlSubribeWS:function(t){if(!t)return this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler),void this.$socketStream.$on("apiWS3",this.setMessageHandler);this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},Quotes:function(t){var e=this;this.qoute=t.find((function(t){return t.s===e.symbol}))||this.qoute},isMyAccount:function(t){if(t&&this.getProfileAccount)return this.getProfileAccount.find((function(e){return e.id===t}))},setHistoryOrders:function(t){var e=this;this.isMyAccount(t.accountId)&&(this.listPlannedOrders=t.pendingOrders.filter((function(t){if(e.getDefaultAccount.id===t.accountId&&t.contractName===e.symbol)return t})))},toIsoString:function(t){t.getTimezoneOffset();var e=function(t){return(t<10?"0":"")+t};return t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())},createPendingOrder:function(t){var e="createrPendingOrder_".concat(t.price,"_").concat(Math.floor(Math.random()*(new Date).getTime())),i={id:e,volume:1e3,hours:1,openPrice:t.price,orderType:t.type,takeProfit:0,stopLoss:0,isFromModal:!1,volumeType:"Money",volumeDinamic:.01,isActiveTsl:!1};this.objectCreatedOrder.push(i)},momentSell:function(t){var e={volume:1e3,hours:760,openPrice:t.price,orderType:t.type,takeProfit:0,stopLoss:0};this.openPosition(e)},momentBuy:function(t){var e={volume:1e3,hours:696,openPrice:t.price,orderType:t.type,takeProfit:0,stopLoss:0};this.openPosition(e)},CancelPendingTradingOrder:function(t){var e=this;this.orderToCancel&&(this.listPlannedOrders=this.listPlannedOrders.filter((function(t){return t.id!==e.orderToCancel.id}))),this.onHoverds=[]},PendingTradingOrder:function(t){if("CreatePendingOrderResponse"===t.className){var e=this.orderToOpen;if(!e)return void this.setHistoryOrders(this.$orderStorage.getOrdersOnStorage());var i=this.getWithHours(e.hours),o={id:t.result.orderId,accountId:this.getDefaultAccount.id,comment:"",contractName:this.symbol,volume:e.volume,orderType:e.orderType,stopLoss:e.stopLoss,takeProfit:e.takeProfit,trailingSL:e.trailingSl,trailingStart:e.trailingStart,pendingStopDT:this.toIsoString(i),pendingStartDT:this.getServerTime.now,priceType:"Stop",timeStart:this.getServerTime.now,timeEnd:this.toIsoString(i),price:+e.openPrice,pendingPrice:+e.openPrice};this.listPlannedOrders=[].concat(Object(x["a"])(this.listPlannedOrders),[o]),Jpt.$emit("setNewValuePendingOrder",{data:this.objectCreatedOrder,symbol:this.symbol}),this.onHoverds=[]}},reopenOrderWithModify:function(t){},openAtPriceBuy:function(t){var e={volume:1e3,hours:696,openPrice:t.price,orderType:t.type,takeProfit:0,stopLoss:0};this.openPosition(e)},openAtPriceSell:function(t){var e={volume:1e3,hours:696,openPrice:t.price,orderType:"Sell",takeProfit:0,stopLoss:0};this.openPosition(e)},getWithHours:function(t){var e=new Date(this.getServerTime.now),i=(new Date).getTimezoneOffset()/60;return e.setHours(e.getHours()+i+t),e},openPosition:function(t){var e=this.getWithHours(t.hours),i={command:"PendingTradingOrder",Token:this.getToken,data:{accountId:this.getDefaultAccount.id,comment:"",contractName:this.symbol,volume:"Money"===t.volumeType?t.volume:t.volumeDinamic,volumeType:"Money"===t.volumeType?0:1,orderType:t.orderType,trailingSL:t.trailingSl,trailingStart:t.trailingStart,stopLoss:+t.stopLoss,takeProfit:+t.takeProfit,priceType:"Stop",timeEnd:this.toIsoString(e),price:+t.openPrice}};t.id&&(this.objectCreatedOrder=this.objectCreatedOrder.filter((function(e){return e.id!==t.id}))),this.orderToOpen=t,this.$socketStream.sendCommand({ws:"apiWS",command:i})},closeOrder:function(t,e){t.closePrice=0,delete t["controlsPositions"];var i={Command:"CancelPendingTradingOrder",data:{accountId:t.accountId,id:t.id},Token:this.getToken};this.orderToCancel=t,this.$socketStream.sendCommand({ws:"apiWS",command:i})},updatePendingOrder:function(t){if(t.symbol===this.symbol)if(t.destroy)this.objectCreatedOrder=this.objectCreatedOrder.filter((function(e){return e.id!==t.id}));else{var e=this.objectCreatedOrder.find((function(e){return e.id===t.id})),i={id:t.id,volume:t.volume,hours:t.hours||1,openPrice:t.price,orderType:t.type,trailingStart:t.trailingStart,trailingSl:t.trailingSl,takeProfit:t.takeProfit,stopLoss:t.stopLoss,isFromModal:!0};e?this.updateCreater(i):this.objectCreatedOrder.push(i)}},addPosPriceAlert:function(t){if(t.symbol===this.symbol){var e=this.listAlerts.find((function(e){return e.id===t.id}));e||this.listAlerts.push(t),e&&(this.listAlerts=this.listAlerts.map((function(e){return e.id==t.id&&(e=t),e})))}},addHorizontalLine:function(t){if(t.symbol===this.symbol){var e=this.listHorizontalLines.find((function(e){return e.id===t.id}));e||this.listHorizontalLines.push(t),e&&(this.listHorizontalLines=this.listHorizontalLines.map((function(e){return e.id==t.id&&(e=t),e})))}},removeOverlay:function(t){if(t&&t.data.isAlertPriceSymbol===this.symbol){var e=this.listAlerts.find((function(e){return e.id===t.data.id}));e&&(this.listAlerts=this.listAlerts.filter((function(e){return e.id!==t.data.id})));var i=this.listHorizontalLines.find((function(e){return e.id===t.data.id}));i&&(this.listHorizontalLines=this.listHorizontalLines.filter((function(e){return e.id!==t.data.id})))}},stopChart:function(t){this._$emit("custom-event",{event:"scroll-lock",args:[t]})},changeDefaultVolume:function(t,e){if(!e)return this.defaultVolume=t,void this.debouncer("checkDefaultVolume",500,t);this.defaultVolume=+t>=1e3?t:1e3},checkDefaultVolume:function(t){this.defaultVolume=+t<1e3?1e3:+this.defaultVolume}},mounted:function(){this.symbol=this.$props.settings.symbol,this.disabledLim=JSON.parse(localStorage.getItem("disabledLim")),this.controlSubribeWS(),this.$orderStorage.getOrdersOnStorage()&&this.setHistoryOrders(this.$orderStorage.getOrdersOnStorage()),Jpt.$on("updatePendingOrder",this.updatePendingOrder),Jpt.$on("changeDisabledLim",this.changeDisabledLim),Jpt.$on("removeOverlay",this.removeOverlay),Jpt.$on("addPosPriceAlert",this.addPosPriceAlert),Jpt.$on("addHorizontalLine",this.addHorizontalLine)},destroyed:function(){this.controlSubribeWS(!0),this.shader&&this.shader.removeAllEventListner(),Jpt.$off("updatePendingOrder",this.updatePendingOrder),Jpt.$off("changeDisabledLim",this.changeDisabledLim),Jpt.$off("removeOverlay",this.removeOverlay),Jpt.$off("addPosPriceAlert",this.addPosPriceAlert),Jpt.$off("addHorizontalLine",this.addHorizontalLine)}},Kgt=Jgt,Zgt=(i("b0c3"),Object(C["a"])(Kgt,Fgt,jgt,!1,null,"5695e0b1",null)),tft=Zgt.exports,eft={name:"WatchingForGetChancs",mixins:[tgt["a"]],mounted:function(){this.symbol=this.$props.settings.symbol,this.timeFrame=this.$props.settings.timeFrame,this.arrCnd=this.$props.settings.candles,this.groupId=this.$props.settings.groupId,this.indexToCheckScroll=this.$props.sub[this.$props.sub.length-1][0]-10},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["WatchingForGetChancs"]},draw:function(){var t=this;this.arrCnd&&(this.isShowButtonBack=!this.$props.sub.some((function(e){return e[0]===t.indexToCheckScroll})),this.$props.meta.sub_start<300&&this.arrCnd.length&&Jpt.$emit("getNewChancWidthChandles",{name:"getNewChancWidthChandles",data:{dateFromCandles:this.getArrCnd[0][0],symbol:this.symbol,timeFrame:this.timeFrame,groupId:this.groupId}}))},mousemove:function(){},mousedown:function(){}},computed:{sett:function(){return this.$props.settings},getArrCnd:function(){return this.$props.settings.candles}},watch:{isShowButtonBack:function(t){Jpt.$emit("handlerShowButtonBack",{name:"handlerShowButtonBack",data:{isShowButtonBack:t,symbol:this.symbol,timeFrame:this.timeFrame,groupId:this.groupId}})}},data:function(){return{ctx:void 0,mouse:{x:void 0,y:void 0},arrCnd:[],isShowButtonBack:!1}}},ift=eft,oft=Object(C["a"])(ift,Lpt,Fpt,!1,null,null,null),nft=oft.exports,sft={name:"MinMaxCandleDay",mixins:[tgt["a"]],mounted:function(){this.arrCnd=this.$props.settings.candles},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["MinMaxCandleDay"]},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else Array.isArray(this.arrCnd)&&this.arrCnd[t]&&this.arrCnd[t][0]&&(e=this.arrCnd[t][0]);return e},drawCircle:function(t,e,i){t.beginPath(),t.lineWidth="1",t.strokeStyle="green",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fillStyle="#fff",t.fill(),t.fillStyle="#fff"},draw:function(t){var e=this;if(this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.showAllDateScale){this.ctx=t;var i=this.$props.sub.reduce((function(t,i){if(t.length){var o=t.findIndex((function(t){if(new Date(e.getTimeCandle(t[0][0])).getUTCDate()===new Date(e.getTimeCandle(i[0])).getUTCDate()&&new Date(e.getTimeCandle(t[0][0])).getUTCFullYear()===new Date(e.getTimeCandle(i[0])).getUTCFullYear())return t}));void 0!==o&&o>=0?t[o].push(i):t.push([i])}else t.push([i]);return t}),[]),o=i.reduce((function(t,e){var i=e.reduce((function(t,e){return t[1]e[3]&&(t[0]=e[0],t[1]=e[3]),t}),[10,10]);return t.push(i),t}),[]);o.forEach((function(i){t.fillStyle="green",t.fillText("H ".concat(i[1]),e.$props.layout.t2screen(i[0]),e.$props.layout.$2screen(i[1]))})),n.forEach((function(i){t.fillStyle="red",t.fillText("L ".concat(i[1]),e.$props.layout.t2screen(i[0]),e.$props.layout.$2screen(i[1]))}))}},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mousedown:function(t){}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme",getAccountsSettings:"accountsTradeSettings/getAccountsSettings"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{ctx:void 0,mouse:{x:void 0,y:void 0}}}},rft=sft,aft=Object(C["a"])(rft,jpt,Rpt,!1,null,null,null),cft=aft.exports,lft={name:"CursorInformation",mixins:[tgt["a"]],mounted:function(){},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CursorInformation"]},draw:function(t){var e=sessionStorage.getItem("cursorType");"CrosshairWithInformation"===e&&this.drawWindowInfromation(t)},drawRadiusRect:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e+s,i),t.lineTo(e+o-s,i),t.arc(e+o-s,i+s,s,-Math.PI/2,0),t.lineTo(e+o,i+n-s),t.arc(e+o-s,i+n-s,s,0,Math.PI/2),t.lineTo(e+s,i+n),t.arc(e+s,i+n-s,s,Math.PI/2,Math.PI),t.lineTo(e,i+s),t.arc(e+s,i+s,s,Math.PI,3*Math.PI/2),t.closePath()},createListStringParams:function(){var t,e,i=null===(t=this.$props)||void 0===t?void 0:t.cursor,o=i.values;if(!o)return[];var n=null===(e=o[0])||void 0===e?void 0:e.ohlcv,s=Object(D["a"])(n,5),r=(s[0],s[1]),a=s[2],c=s[3],l=s[4],u=["Цена открытия: ".concat(r),"Максимальная цена: ".concat(a),"Минимальная цена: ".concat(c),"Цена закрытия: ".concat(l)];return u},drawWindowInfromation:function(t){var e=this.mouse.x+12,i=this.mouse.y+12,o=e+8,n=i+16,s=this.createListStringParams(),r=this.getParamsOrDrawDescription(t,s,o,n),a=r.width,c=r.height;t.fillStyle="rgba(255, 0, 0, 0.3)",this.drawRadiusRect(t,e,i,a+16,c+8,6),t.fill(),this.getParamsOrDrawDescription(t,s,o,n,!0)},getParamsOrDrawDescription:function(t,e,i,o,n){var s=18;n&&t.save(),n&&t.beginPath();var r=e.reduce((function(e,o){n&&(t.fillStyle="rgba(255, 255, 255, 1)"),t.font="Arial 12px";var r=t.measureText(o).width;return r>e.width&&(e.width=r),e.height+=s,n&&t.fillText(o,i,e.yOffset),e.yOffset+=s,e}),{width:0,height:0,yOffset:o});return n&&t.fill(),n&&t.restore(),r},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY}},computed:{getSettings:function(){return this.$props.settings}},data:function(){return{ctx:void 0,mouse:{x:void 0,y:void 0}}}},uft=lft,dft=Object(C["a"])(uft,Wpt,Npt,!1,null,null,null),hft=dft.exports,pft=(i("70f7"),document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix()),gft={name:"Flag",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$on("saveNewSettings",(function(e){e.id===t.$props.id&&(t.saveNewParams(e),e.pos?"string"===typeof e.positionPin[0]&&"string"===typeof e.positionPin[1]?(t.layout.screen2t(+e.positionPin[0].replace(/[^\d.]/g,"")),t.layout.screen2$(+e.positionPin[1].replace(/[^\d.]/g,""))):(e.positionPin[0],e.positionPin[1]):"string"===typeof e.positionPin[0]&&"string"===typeof e.positionPin[1]?(e.positionPin[0],e.positionPin[1]):(t.layout.t2screen(e.positionPin[0]),t.layout.$2screen(e.positionPin[1])))})),Jpt.$on("moveMessage",(function(e){e.id===t.$props.id&&t.saveNewParams(e,!0)}))},mounted:function(){var t=this,e=JSON.parse(localStorage.getItem(this.$props.id));e&&e.data&&(this.wathCursor=!1),Jpt.$on("saveNewSettings",(function(e){e.id===t.$props.id&&(t.saveNewParams(e),e.pos?"string"===typeof e.positionPin[0]&&"string"===typeof e.positionPin[1]?(t.layout.screen2t(+e.positionPin[0].replace(/[^\d.]/g,"")),t.layout.screen2$(+e.positionPin[1].replace(/[^\d.]/g,""))):(e.positionPin[0],e.positionPin[1]):"string"===typeof e.positionPin[0]&&"string"===typeof e.positionPin[1]?(e.positionPin[0],e.positionPin[1]):(t.layout.t2screen(e.positionPin[0]),t.layout.$2screen(e.positionPin[1])))})),Jpt.$on("moveMessage",(function(e){e.id===t.$props.id&&t.saveNewParams(e,!0)}))},methods:{saveNewParams:function(t,e){t.id===this.$props.id&&(this.cursorUp=e,this.dataMessage=t.data,this.width=t.data.width,this.height=t.data.height,this.tclr=t.tclr,this.bclr=t.bclr,this.newSavePinPpsition=t.positionPin,this.pos=t.pos,this.fsm=t.fsm)},init:function(){},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},draw:function(t){if(this.ctx=t,this.wathCursor){var e=pft.scale(this.width/24),i=new Path2D,o=new Path2D("M14 9l-1-2H7V5.72c.6-.34 1-.98 1-1.72 0-1.1-.9-2-2-2s-2 .9-2 2c0 .74.4 1.38 1 1.72V21h2v-4h5l1 2h7V9h-6zm4 8h-4l-1-2H7V9h5l1 2h5v6z");t.translate(this.mouse.x-this.width/2,this.mouse.y-this.height/2),i.addPath(o,e),t.strokeStyle="#3d85c6",t.stroke(i)}},use_for:function(){return["Flag"]},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mouseup:function(t){if(this.cursorUp){this.cursorUp=!1;this.layout.screen2t(this.mouse.x-this.width/2),this.layout.screen2$(this.mouse.y-this.height/2);this.dataMessage=void 0}},mousedown:function(t){if(this.wathCursor){this.layout.screen2t(this.mouse.x-this.width/2),this.layout.screen2$(this.mouse.y-this.height/2);this.wathCursor=!1,this.dataMessage=void 0}},legend:function(t){return[{value:"",color:"green"},{value:""}]}},computed:{sett:function(){return this.$props.settings},new_font:function(){return"16px "+this.$props.font.split("px").pop()}},data:function(){return{width:50,height:50,dataMessage:void 0,wathCursor:!0,ctx:void 0,mouse:{x:void 0,y:void 0}}}},fft=gft,mft=Object(C["a"])(fft,Ept,Upt,!1,null,null,null),vft=mft.exports,yft={name:"CandleInfo",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$off("cursor",(function(e){t.view="cursorCrosshairWIthInfo"===e}))},mounted:function(){var t=this;this.allCnd=JSON.parse(localStorage.getItem("allCnd")),Jpt.$on("cursor",(function(e){t.view="cursorCrosshairWIthInfo"===e}))},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CandleInfo"]},draw:function(t){this.view&&(this.ctx=t,this.drawModalInfo(t))},drawModalInfo:function(t){var e=this.$props.layout.screen2t(this.mouse.x),i=this.$props.cursor.values["0"].Candles_0;if(this.allCnd&&!(e.toFixed()>i[0]+3)){var o=t||this.ctx,n=20,s=this.mouse.x+15+n/2,r=this.mouse.y+15+n/2,a=this.allCnd[i[0]-1][0];o.beginPath(),o.lineJoin="round",o.lineWidth=n,o.strokeStyle=i[4]>i[1]?this.colorCandleUp:this.colorCandleDw,o.strokeRect(s,r,this.widthModal-n,this.heightModal-n),o.fillStyle=i[4]>i[1]?this.colorCandleUp:this.colorCandleDw,o.fillRect(s+n/2,r+n/2,this.widthModal-2*n,this.heightModal-2*n),o.fillStyle="#fff",o.font="16px Arial",o.fillText("".concat(new Date(a).toLocaleString("ru")),s+10,r+15),o.fillText("open",s+10,r+40),o.fillText("".concat(i[1]),s+70,r+40),o.fillText("close",s+10,r+65),o.fillText("".concat(i[4]),s+70,r+65),o.fillText("lowest",s+10,r+90),o.fillText("".concat(i[3]),s+70,r+90),o.fillText("highest",s+10,r+115),o.fillText("".concat(i[2]),s+70,r+115)}},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mousedown:function(t){}},computed:{sett:function(){return this.$props.settings}},data:function(){return{view:!1,ctx:void 0,widthModal:190,heightModal:140,backgroundColor:"#1c658b61",borderColor:"#1c378b00",colorCandleDw:"#e5415047",colorCandleUp:"#23a77647",mouse:{x:void 0,y:void 0}}}},Cft=yft,bft=Object(C["a"])(Cft,Vpt,Hpt,!1,null,null,null),Sft=bft.exports,Pft=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e,this.pips=null,this.percent=null,this.rpip=null,this.rprofit=null,this.isDark=!1,this.rpercent=null}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.comp.$props.layout,i=this.comp.$props.config,o=function(){return t.last_bar()};this.comp.$emit("new-shader",{target:"sidebar",draw:function(n){var s=o();if(s){var r=n.canvas.width,a=i.PANHEIGHT,c=t.comp.$props.meta.last,l=c[4]>=c[1],u=l?t.green():t.red(),d=s.price.toFixed(e.prec),h=-.5,p=s.y-.5*a-.5,g=7,f=localStorage.getItem("typesQuotes");t[t.initationTypesQuotes(f)](n,h,p,a,r,u,d,g)}}}),this.shader=!0}},{key:"getPercent",value:function(){return this.percent||"load."}},{key:"currentQuote",value:function(t,e,i,o,n,s,r,a){t.beginPath(),t.rect(e-.5,i,58,o),t.clip(),t.fillStyle=s,t.fillRect(e-.5,i,58,o),t.fillStyle=this.comp.$props.colors.textHL,t.textAlign="left",t.fillText(r,a,i+15)}},{key:"dayQuote",value:function(t,e,i,o,n,s,r,a){t.beginPath(),t.rect(e-.5,i,58,o),t.fillStyle=s,t.fillRect(e-.5,i,58,o),t.fillStyle=this.comp.$props.colors.textHL,t.fillText(r,a,i+15),t.rect(e-.5,i+o,58,o+13),t.clip(),t.fillStyle=this.isDark?"#314456":"white",t.fillRect(e-.5,i+o,58,o+13),t.strokeStyle=s,t.strokeRect(e+1,i+o,58,o+13),t.fillStyle=s,t.fillStyle=this.comp.$props.colors.textHL,t.strokeRect(e+1,i+o,58,o+13),t.textAlign="left",t.fillStyle=this.getPip()>=0?this.green():this.red(),t.fillText("".concat(this.getPip()," pip"),a,i+36),t.fillStyle=this.getPercent()>=0?this.green():this.red(),t.fillText("".concat(this.getPercent()," %"),a,i+50),t.fillStyle=s,t.fillRect(e-.5,i,58,o),t.fillStyle=this.comp.$props.colors.textHL,t.textAlign="left",t.fillText(r,a,i+15)}},{key:"finQoute",value:function(t,e,i,o,n,s,r,a){t.beginPath(),t.rect(e-.5,i,58,o),t.fillStyle=s,t.fillRect(e-.5,i,58,o),t.fillStyle=this.comp.$props.colors.textHL,t.fillText(r,a,i+15),t.rect(e+1,i+o,58,o+26),t.clip(),t.fillStyle=this.isDark?"#314456":"white",t.fillRect(e-.5,i+o,58,o+26),t.strokeStyle=s,t.strokeRect(e+1,i+o,58,o+26),t.fillStyle=s,t.fillStyle=this.comp.$props.colors.textHL,t.strokeRect(e+1,i+o,58,o+26),t.fillStyle=this.getRprofit()>=0?this.green():this.red(),t.fillText("".concat(this.getRprofit()," $"),a,i+36),t.fillStyle=this.getRpercent()>=0?this.green():this.red(),t.fillText("".concat(this.getRpercent()," %"),a,i+50),t.fillStyle=this.getRpip()>=0?this.green():this.red(),t.fillText("".concat(this.getRpip()," pip"),a,i+64)}},{key:"getPip",value:function(){return this.pips||"load."}},{key:"getRpip",value:function(){var t=this.isNan(+this.rpip)?0:+this.rpip;return 1*t||0}},{key:"getRprofit",value:function(){var t=+this.rprofit||0;return+t.toFixed(2)}},{key:"getRpercent",value:function(){var t=+this.rpercent||0;return+t.toFixed(3)}},{key:"draw",value:function(t,e,i,o,n,s,r){if(this.isDark=r,this.comp.$props.meta.last){this.shader||this.init_shader(),this.rpip=o,this.rprofit=n,this.rpercent=s;var a=this.comp.$props.layout,c=this.comp.$props.meta.last,l=c[4]>=c[1],u=l?this.green():this.red(),d=a.$2screen(c[4])+(l?1:0);this.percent=e,this.pips=i,t.strokeStyle=u,t.setLineDash([1,1]),t.beginPath(),t.moveTo(0,d),t.lineTo(a.width,d),t.stroke(),t.setLineDash([])}}},{key:"isNan",value:function(t){var e=t>0,i=t<0,o=null===t;return!e&&!i&&!o}},{key:"initationTypesQuotes",value:function(t){if(!t)return"dayQuote";var e=JSON.parse(t);for(var i in e)if(e[i])return i}},{key:"last_bar",value:function(){var t=this.comp.$props.layout,e=this.comp.$props.meta.last,i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.isDark?"#1ef0b1":this.comp.$props.colors.candleUp}},{key:"red",value:function(){return this.isDark?"#ff3232":this.comp.$props.colors.candleDw}}]),t}(),Tft={name:"ResultProfits",mixins:[tgt["a"]],mounted:function(){Jpt.$on(this.EventList,this.eventsHandles),this.controlSubribeWS(),this.timeFrame=this.$props.settings.timeFrame,this.symbol=this.$props.settings.symbol,this.HistoryOrders(this.$orderStorage.getOrdersOnStorage()),this.firstCandle=this.$props.sub[this.$props.sub.length-1]},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme"})),{},{positive:function(){return"dark"===this.getActiveTheme?"#1ff0b1":"#008e72"},negative:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},getPercent:function(){if(this.getNewDelta)return xft("ceil",100/(this.priceQuote.bid/this.getNewDelta),-2)},getPips:function(){if(this.getPrecision&&this.getNewDelta)return Math.trunc(this.getNewDelta*Ph(this.getPrecision))},getNewDelta:function(){if(this.priceQuote.bid&&this.priceQuote.open)return this.priceQuote.bid-this.priceQuote.open},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},getQoute:function(){return this.qoute&&this.qoute.a&&this.qoute.b?this.qoute:{a:this.$props.sub[this.$props.sub.length-1][1],b:this.$props.sub[this.$props.sub.length-1][3]}}}),destroyed:function(){Jpt.$off(this.EventList,this.eventsHandles),this.controlSubribeWS(!0)},methods:{init:function(){var t=this;this.$nextTick((function(){setTimeout((function(){return t.shader=new Pft(t)}),1e3)}))},meta_info:function(){return{author:"Alexey Pushkin",version:"2.0.0"}},use_for:function(){return["ResultProfits"]},updateQuote:function(t){var e=this,i=t.find((function(t){return t.s===e.symbol}));i&&(this.priceQuote.bid=i.b,this.priceQuote.ask=i.a,this.priceQuote.open=i.o,this.priceQuote.profit=!(i.d<0))},mousedown:function(t){},getProcent:function(t){return this.equity&&t?t/this.equity*100:0},getPip:function(t,e,i){var o=this;if(!e)return 0;var n={Buy:function(){return(+e.a-+i)*Ph(o.getPrecision-1)},Sell:function(){return(+i-+e.b)*Ph(o.getPrecision-1)}};return n[t]()},getDelta:function(t,e,i){var o="Sell"===t?i.a:i.b;return o?o-e:0},getAvaragePips:function(t){var e=this,i=this.openOrders.reduce((function(i,o){var n=t===o.orderType?o.volume*e.getPip(o.orderType,e.getQoute,o.openPrice):0;return i+n}),0),o=this.openOrders.reduce((function(t,e){return t+e.volume}),0);return(i/o/10).toFixed(0)},getAvarageprocent:function(){return 0},getAvarageProfit:function(t){var e=this.openOrders.reduce((function(e,i){var o=t===i.orderType?i.volume*i.profit:0;return e+o}),0),i=this.openOrders.reduce((function(t,e){return t+e.volume}),0);return(e/i/10).toFixed(0)},getAvarage:function(t,e,i){if(t&&Array.isArray(t)){var o=t.reduce((function(t,o){return t+=o[e]*o[i],t}),0),n=t.reduce((function(t,e){return t+=e[i],t}),0);return o/n}},draw:function(t){if(this.getToken&&this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.totalForOpen){var e=this.getPip("Sell",this.getQoute,+this.getAvarage(this.openOrders,"openPrice","volume").toFixed(this.getPrecision)).toFixed(0),i=this.openOrders.reduce((function(t,e){return t+=e.profit,t}),0),o=Math.abs(+e),n=+i<0?-1:1,s=o*n,r=this.getProcent(i);this.shader&&this.shader.draw(t,this.getPercent,this.getPips,s,i,r,"dark"===this.getActiveTheme);var a=this.$props.layout,c=a.candles[a.candles.length-1];t.lineWidth=0;var l=this.openOrders;if(l&&l.length){var u=this.getQoute;if(u){this.openOrders&&(this.resultAllPip=s,this.resultAllProfit=i,this.resultAllPercent=r,this.resultProfit={Buy:this.openOrders.filter((function(t){return"Buy"===t.orderType})).reduce((function(t,e){return t+=e.profit,t}),0),Sell:this.openOrders.filter((function(t){return"Sell"===t.orderType})).reduce((function(t,e){return t+=e.profit,t}),0)},this.procent={Buy:this.getProcent(this.resultProfit.Buy),Sell:this.getProcent(this.resultProfit.Sell)},this.resultPip={Sell:this.getPip("Sell",this.getQoute,+this.getAvarage(this.openOrders.filter((function(t){return"Sell"===t.orderType})),"openPrice","volume").toFixed(this.getPrecision)).toFixed(0),Buy:this.getPip("Sell",this.getQoute,+this.getAvarage(this.openOrders.filter((function(t){return"Buy"===t.orderType})),"openPrice","volume").toFixed(this.getPrecision)).toFixed(0)});this.openOrders.reduce((function(t,e){return t[e.orderType]++,t}),{Sell:0,Buy:0});this.drawDataInfo(t,c.x,a.$2screen(u.b)||0)}}}},drawDataInfo:function(t,e,i){var o=this.resultAllProfit>=0?1:-1,n=Math.abs(+this.resultAllPip)*o,s=n.toFixed(0),r=e+32;t.beginPath(),t.font="14px",t.strokeStyle="white";var a=7;this.getSettingsParamsLeftBar.showPipsResult&&(t.fillStyle=+s>=0?this.positive:this.negative,t.fillText("".concat(s," pip"),r,i-a),a+=13),this.getSettingsParamsLeftBar.showProcentResult&&(t.fillStyle=+this.resultAllPercent>=0?this.positive:this.negative,t.fillText("".concat(this.resultAllPercent.toFixed(3)," %"),r,i-a),a+=13),this.getSettingsParamsLeftBar.showDollarsResult&&(t.fillStyle=+this.resultAllProfit>=0?this.positive:this.negative,t.fillText("".concat(this.resultAllProfit.toFixed(2)," $"),r,i-a),a+=13)},drawTestData:function(t,e,i,o){var n=e+32,s=[{Sell:i+16,Buy:i-34},{Sell:i+29,Buy:i-20},{Sell:i+43,Buy:i-7}],r=[(+this.resultProfit[o]).toLocaleString().replace(",","."),this.procent[o],+this.resultProfit[o]>=0?Math.abs(+this.resultPip[o]):-1*Math.abs(+this.resultPip[o])];r.some((function(t){return void 0===t}))||(t.font="14px",t.fillStyle=+r[0]>=0?this.positive:this.negative,t.strokeStyle="white",t.fillText("".concat(r[0],"$"),n,s[0][o]),t.fillText("".concat(r[1].toFixed(3),"%"),n,s[1][o]),t.fillText("".concat(r[2]," pip"),n,s[2][o]),t.fill())},HistoryOrders:function(t){var e=this;this.getOpenOrders(t.tradingOrders).forEach((function(t){var i=e.openOrders.find((function(e){return e.id===t.id}));i||e.openOrders.push(t)}))},getOpenOrders:function(t){var e=this,i=t.filter((function(t){return t.instrumentName===e.symbol})),o=i.filter((function(t){return t.accountId===e.getDefaultAccount.id})),n=o.map((function(t){return e.createObjectOrder(t)}));return n},eventsHandles:function(t){t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},controlSubribeWS:function(t){if(!t)return this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler),void this.$socketStream.$on("apiWS3",this.setMessageHandler);this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},AccountsDetails:function(t){var e=this.getDataForCurrentAccaunt(t);e&&e.openOrders&&this.updateProfitInOpenOrders(e.openOrders.tradingOrders),this.equity=this.getEquity(t)},updateProfitInOpenOrders:function(t){var e=this;if(Array.isArray(this.openOrders))for(var i=function(){var i=e.openOrders[o],n=t.find((function(t){return t.id===i.id}));n&&(e.openOrders[o].profit=n.profit)},o=0;o=0?t.getPositiveColorOrder:t.getNegativeColorOrder,flexDirection:"column"}},[e("div",{staticClass:"overlay-profitAbs"},[t._v("$ "+t._s(t.positionCloseOrderModal.order.profit))]),e("div",{staticClass:"overlay-profitRel"},[t._v("% "+t._s((100*t.positionCloseOrderModal.order.profit/t.positionCloseOrderModal.order.volume).toFixed(2)))])])]):t._e(),t.positionOpenOrderModal?e("div",{class:"overlay-openOrder overlay-openOrder_".concat(t.getActiveTheme),style:{position:"absolute",top:"down"===t.positionOpenOrderModal.place?"".concat(t.positionOpenOrderModal.y,"px"):"".concat(t.positionOpenOrderModal.y-35,"px"),left:"".concat(t.positionOpenOrderModal.x-100,"px")}},[e("div",{staticClass:"overlay-orderInfo",style:{color:"Buy"===t.positionCloseOrderModal.order.orderType?t.getPositiveColorOrder:t.getNegativeColorOrder}},[e("div",{staticClass:"overlay-orderType"},[t._v(t._s(t.positionOpenOrderModal.order.orderType))]),e("div",{staticClass:"overlay-orderVolume"},[t._v(t._s(t.positionOpenOrderModal.order.volume))])]),e("div",{staticClass:"overlay-orderInfo",style:{color:"Buy"===t.positionCloseOrderModal.order.orderType?t.getPositiveColorOrder:t.getNegativeColorOrder}},[t._v(t._s(t.positionCloseOrderModal.order.openPrice))])]):t._e()])},Eft=[],Uft={name:"ClosedOrders",mixins:[tgt["a"]],components:{ModalOrder:hgt},data:function(){return{hoveredClosed:[],positionCloseOrderModal:null,positionOpenOrderModal:null,settingsOrder:null,keyForChart:null,EventList:["onChangeOrders"],arrClosedOrders:[],highlighted:null,orderToDraw:[],countModal:0,sl:"red",tp:"green",sell:"red",buy:"green",lineFrom:{x:void 0,y:void 0},lineEnd:{x:void 0,y:void 0},selected:null,intr:null,ct:null,arr:[]}},watch:{getDefaultAccount:function(t){var e=localStorage.getItem(this.$props.settings.symbol);if(e){var i=JSON.parse(e);this.arrClosedOrders=i.myCloseOrdres,this._$emit("custom-event",{event:"change-settings",args:[!0]})}},getStatusCloseOtherPositions:function(t){this._$emit("custom-event",{event:"change-settings",args:[!0]})},getStatusClosePositions:function(t){this._$emit("custom-event",{event:"change-settings",args:[!0]})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPositiveColorOrder:function(){return"dark"===this.getActiveTheme?"#00ffac":"#008e72"},getNegativeColorOrder:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},boxColor:function(){return"dark"===this.getActiveTheme?"#4c5b6a":"#dfdfdf"},getStatusCloseOtherPositions:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"closeOtherPositions"===t.name}));return!t||t.isActive}},getStatusClosePositions:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"closePositions"===t.name}));return!t||t.isActive}},getStatusBlackThemeChart:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"blackThemeChart"===t.name}));return!t||t.isActive}}}),methods:{draw:function(t){var e=this;if(this.getToken&&(this.getStatusCloseOtherPositions||this.getStatusClosePositions)){this.ctx=t;var i=this.$props.layout;t.lineWidth=0,this.arrClosedOrders&&Array.isArray(this.arrClosedOrders)&&this.arrClosedOrders.length&&(this.getOrderToDraw(),this.drawClosedOrders(t,this.orderToDraw)),this.positionCloseOrderModal=null,this.positionOpenOrderModal=null,this.hoveredClosed.forEach((function(i){e.drawLineFrom(i.lineFromX,i.lineFromY,i.lineToX,i.lineToY,t);var o=i.order.openPrice-i.order.closePrice>=0?"down":"up",n=i.order.openPrice-i.order.closePrice>=0?"up":"down";e.positionCloseOrderModal={x:i.lineFromX,y:"down"===o?"Sell"===i.order.orderType?i.lineFromY:i.lineFromY-65:"Sell"===i.order.orderType?i.lineFromY+65:i.lineFromY,place:o,order:i.order},e.positionOpenOrderModal={x:i.lineToX,y:"up"===n?"Buy"===i.order.orderType?i.lineToY-35:i.lineToY:"Buy"===i.order.orderType?i.lineToY:i.lineToY+35,place:o,order:i.order}})),this.isDrawLineFrom&&this.drawLineFrom(i.t2screen(this.lineFrom.x),i.$2screen(this.lineFrom.y),i.t2screen(this.lineEnd.x),i.$2screen(this.lineEnd.y),t),this.xLine&&this.yLine&&(t.beginPath(),t.setLineDash([2,3]),t.strokeStyle="Sell"===this.typeOrder?"red":"green",t.moveTo(i.t2screen(this.xLine),i.$2screen(this.yLine)),t.lineTo(i.t2screen(this.xLine),i.$2screen(this.yLine)-146),t.setLineDash([0,0]),t.stroke())}},getOrderToDraw:function(){var t=this,e=this.$props.settings.candles,i=this.$props.sub,o=i[0],n=i[i.length-1];if(Array.isArray(i)&&Array.isArray(e)&&Array.isArray(o)&&void 0!==o[0]&&Array.isArray(n)&&void 0!==n[0]&&e[o[0]]&&e[n[0]]){var s=e[o[0]][0],r=e[n[0]][0];this.orderToDraw=this.arrClosedOrders.filter((function(e){var i=e,o=$pt(new Date(i.closedDate),t.timeFrame||60).getTimeWithoutUTC();if(o>=s&&o<=r)return e}))}},drawClosedOrders:function(t,e){var i=this,o=this.$props.layout;e.forEach((function(e){t.beginPath();var n=o.t2screen($pt(e.closedDate,i.timeFrame||60).getTimeWithoutUTC()),s=o.$2screen(e.closePrice),r=o.t2screen($pt(new Date(e.openDate),i.timeFrame||60).getTimeWithoutUTC()),a=o.$2screen(e.openPrice);if(t.strokeStyle="#fff",t.lineWidth="0.5",t.globalCompositeOperation="source-over",null!==e.closedDate){var c="Sell"===e.orderType?-5.5:7,l="Sell"===e.orderType?5.5:-5.5,u="Sell"===e.orderType?-10:10;if(i.getDefaultAccount.id===e.accountId&&i.getStatusClosePositions){if(!i.getSettingsParamsLeftBar||!i.getSettingsParamsLeftBar.myClosedOrders||!i.getSettingsParamsLeftBar.showMyActions)return;i.drawTriangle(t,n,s,c,l,u,e),i.drawArrow(t,r,a,c,l,u,e);var d=i.onHoverCircle(n,s,i.mouseX,i.mouseY,9),h=i.onHoverCircle(r,a,i.mouseX,i.mouseY,9);if(d||h){var p=i.hoveredClosed.find((function(t){return t.order.id===e.id}));p||i.hoveredClosed.push({order:e,lineFromX:n,lineFromY:s,lineToX:r,lineToY:a})}else{var g=i.hoveredClosed.find((function(t){return t.order.id===e.id}));g&&(i.hoveredClosed=i.hoveredClosed.filter((function(t){return t.order.id!==g.order.id})))}}if(i.getDefaultAccount.id!==e.accountId&&i.getStatusCloseOtherPositions){if(!i.getSettingsParamsLeftBar||!i.getSettingsParamsLeftBar.providersClosedOrders||!i.getSettingsParamsLeftBar.showProviders)return;i.drawTriangle(t,n,s,c,l,u,e),i.drawArrow(t,r,a,c,l,u,e)}}t.fill(),t.beginPath()}))},drawTriangle:function(t,e,i,o,n,s,r){t.save(),t.beginPath(),t.moveTo(e,i),t.lineTo(e+o,i+s),t.lineTo(e+n,i+s),t.lineTo(e,i),t.fillStyle="#7f7f7f",t.fill(),t.strokeStyle="white",t.stroke(),t.closePath(),t.beginPath(),t.strokeStyle="white",t.fillStyle=r.profit>=0?"#A6C4BE":"#DDB6B6",t.font="800 8px Arial",t.strokeText(r.profit>0?"TP":"SL","Sell"===r.orderType?e-20:e-18,"Sell"===r.orderType?i-2:i+8),t.fillText(r.profit>0?"TP":"SL","Sell"===r.orderType?e-20:e-18,"Sell"===r.orderType?i-2:i+8),t.fill(),t.stroke(),t.closePath(),t.restore()},drawArrow:function(t,e,i,o,n,s,r){t.save(),"Sell"!==r.orderType?(t.beginPath(),t.moveTo(e,i),t.lineTo(e+o,i+s),t.lineTo(e+n,i+s),t.lineTo(e,i),t.fillStyle="#7f7f7f",t.fill(),t.strokeStyle="#fff",t.stroke(),t.closePath(),t.beginPath(),t.font="800 8px Arial",t.fillStyle="#A6C4BE",t.strokeStyle="#fff",t.strokeText("B",e-13,i+8),t.fillText("B",e-13,i+8),t.closePath()):(t.beginPath(),t.moveTo(e,i),t.lineTo(e-5,i-9),t.lineTo(e+4.5,i-9),t.lineTo(e,i),t.fillStyle="#7f7f7f",t.strokeStyle="#fff",t.fill(),t.stroke(),t.closePath(),t.beginPath(),t.font="800 8px Arial",t.fillStyle="#DDB6B6",t.strokeStyle="#fff",t.strokeText("S",e-15,i-2),t.fillText("S",e-15,i-2),t.closePath()),t.restore()},eventsHandles:function(t){t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},onChangeOrders:function(){this.setColsedOrders()},changeColor:function(t){this[t.type]=t.value,localStorage.setItem("colorsOpenOrders",JSON.stringify({tp:this.tp,sl:this.sl,sell:this.sell,buy:this.buy})),this._$emit("custom-event",{event:"change-settings",args:[!0]})},meta_info:function(){return{author:"C451",version:"1.0.0"}},ft:function(t,e,i,o,n,s,r,a){var c=(i-t)*(s-o)-(n-i)*(o-e),l=(n-t)*(a-s)-(r-n)*(s-e),u=(r-t)*(o-a)-(i-r)*(a-e);return c>0&&l>0&&u>0||(c<0&&l<0&&u<0||void 0)},getColor:function(t){var e=localStorage.getItem("allColors");if(!e)return wgt[this.getActiveTheme][t];var i=JSON.parse(e);return i[this.getActiveTheme][t]},getPercent:function(t){return this.getDefaultAccount&&this.getDefaultAccount.equity&&t?(t/this.getDefaultAccount.equity*100).toFixed(4):0},use_for:function(){return["ClosedOrders"]},testClick:function(t,e,i,o,n){if(t&&e&&i){var s=(t[0]-o)*(e[1]-t[1])-(e[0]-t[0])*(t[1]-n),r=(e[0]-o)*(i[1]-e[1])-(i[0]-e[0])*(e[1]-n),a=(i[0]-o)*(t[1]-i[1])-(t[0]-i[0]*(i[1]-n));return[s,r,a]}},drawLineFrom:function(t,e,i,o,n){n.beginPath(),n.strokeStyle="dark"===this.getActiveTheme?"#bbcee0":"#202020",n.lineWidth="0.75",n.setLineDash([8,5]),n.moveTo(t,e),n.lineTo(i,o),n.stroke()},onHoverCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.colorCandleUp}},{key:"red",value:function(){return this.comp.colorCandleDw}}]),t}(),Zft={name:"HorizontalLine",mixins:[tgt["a"]],data:function(){return{colorLine:"red",colorText:"red",yPrice:null,counterDoubleClick:0,changePosition:!0,onHover:!1,arrCnd:void 0,ctx:void 0,mouse:{x:void 0,y:void 0},isRemoved:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},getEndPoint:function(){return this.$props.layout.spacex-8},getPositionButtonClose:function(){var t=this.$props.layout,e=this.getEndPoint-44,i=t.screen2$(t.$2screen(this.yPrice));return{top:i-10+"px",left:e+"px"}},sett:function(){return this.$props.settings}}),methods:{addInstrumentToChart:function(){this.y$||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},removeOverlay:function(){Jpt.$emit("removeOverlay",{name:"removeOverlay",data:{id:this.idCurrentOverlay}}),this.shader.remove(),this.isRemoved=!0},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},saveNewPosition:function(){if(this.getToken){var t=this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,gropuId:this.groupId,timeFrame:this.timeFrame,name:t,symbol:this.symbol,y$:this.y$});Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:i}),this.addToListExceptions(i)}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["HorizontalLine"]},init:function(){this.shader=new Kft(this)},draw:function(t){if(!this.isRemoved&&(this.ctx=t,this.y$)){this.yPrice=this.$props.layout.$2screen(this.y$),this.drawLine(t,this.y$);var e=+this.y$.toFixed(this.getPrecision);this.shader&&this.shader.draw(t,e)}},drawLine:function(t,e){var i=this.$props.layout.spacex,o=this.$props.layout.$2screen(e);t.beginPath(),t.lineWidth=this.okdel||this.changePosition?2.5:1,t.strokeStyle=this.colorLine,t.setLineDash([8,5]),t.moveTo(0,this.$props.layout.$2screen(e)),t.lineTo(i,this.$props.layout.$2screen(e)),t.stroke(),this.mouse.y>=o-10&&this.mouse.y<=o+10?(this.onHover=!0,this.drawDragZone(t,this.getEndPoint,o)):this.onHover=!1},addToListExceptions:function(t){var e=JSON.parse(JSON.stringify(t));e.id||(e.id=this.idCurrentOverlay),Jpt.$emit("addHorizontalLine",e)},drawDragZone:function(t,e,i){t.beginPath,t.rect(e-18,i-10,18,18),t.fillStyle=this.colorLine,t.fill(),t.beginPath(),t.fillStyle="white",t.font="bold 6px",t.fillText("•••".split("").join(String.fromCharCode(8202)),e-15.3,i),t.fillText("•••".split("").join(String.fromCharCode(8202)),e-15.3,i+6)},doubelClick:function(){var t=this;this.counterDoubleClick++,1!==this.counterDoubleClick?this.okdel=!0:this.timerDoubleClick=setTimeout((function(){t.counterDoubleClick=0}),300)},listener:function(t){"Delete"===t.key&&this.okdel&&Jpt.$emit("delMessage",{id:this.idCurrentOverlay})},drawText:function(t,e,i,o){t.beginPath(),t.fillStyle=this.colorText,t.font="12px Arial",t.fillText(e.toFixed(5),i,o+4.5)},mousemove:function(t){this.isRemoved||(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&(this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY)))},mouseup:function(t){this.isRemoved||this.changePosition&&(this.changePosition=!1,this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},mousedown:function(t){if(!this.isRemoved){var e=this.$props.layout.screen2$(t.layerY);this.$props.layout.$2screen(this.y$)-3<=this.$props.layout.$2screen(e)&&this.$props.layout.$2screen(e)<=this.$props.layout.$2screen(this.y$)+3?(this.changePosition=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t)):this.okdel=!1}}},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&e.y$&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1,this.y$=e.y$,this.addToListExceptions(e)),e&&e.createdWithDefault&&(this.y$=+e.price,this.changePosition=!1,this.saveNewPosition()),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)}},tmt=Zft,emt=(i("edf3"),Object(C["a"])(tmt,Qft,Jft,!1,null,"dd225dfe",null)),imt=emt.exports,omt={name:"VerticalLine",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1,this.xt=e.xt),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.xt||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},saveNewPosition:function(){if(this.getToken){var t=this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,gropuId:this.groupId,timeFrame:this.timeFrame,name:t,symbol:this.symbol,xt:this.xt});Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:i})}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["VerticalLine"]},draw:function(t){this.ctx=t,this.xt&&this.drawLine(t,this.xt)},drawLine:function(t,e){var i=this.$props.layout.$2screen(this.$props.layout.$_hi),o=this.$props.layout.$2screen(this.$props.layout.$_lo);t.beginPath(),t.lineWidth=this.okdel||this.changePosition?2.5:1,t.strokeStyle=this.colorLine,t.setLineDash([8,5]),t.moveTo(this.$props.layout.t2screen(e),i),t.lineTo(this.$props.layout.t2screen(e),o-35),t.stroke(),this.drawText(t,this.arrCnd[e-1][0],this.$props.layout.t2screen(e),o-15)},drawText:function(t,e,i,o){var n=new Date(e).toLocaleString("ru"),s=6.5*n.length/2;t.beginPath(),t.fillStyle=this.colorText,t.font="12px Arial",t.fillText(n,i-s,o)},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?this.okdel=!0:this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0}),300)},listener:function(t){"Delete"===t.key&&this.okdel&&Jpt.$emit("delMessage",{id:this.idCurrentOverlay})},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&(this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY))},mouseup:function(t){this.changePosition&&(this.changePosition=!1,this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},mousedown:function(t){var e=this.$props.layout.screen2t(t.layerX).toFixed();this.$props.layout.t2screen(e)===this.$props.layout.t2screen(this.xt)?(this.changePosition=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t)):this.okdel=!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{colorLine:"red",colorText:"red",counterDoubleClick:0,changePosition:!0,arrCnd:void 0,ctx:void 0,mouse:{x:void 0,y:void 0}}}},nmt=omt,smt=Object(C["a"])(nmt,Dft,kft,!1,null,null,null),rmt=smt.exports,amt={name:"BigLineOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["BigLineOverlay"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:"".concat(this.idCurrentOverlay),timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.fillStyle="#fff",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"BigLine",nameIconTitle:"new-arrow-fat",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Fill",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]},{index:1,name:"Border",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"borderColor",value:this.borderColor,color:function(){return i.borderColor},fast:!0}]}],typeModal:t}}})},onHoverCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.$props.layout.screen2t(t.layerX),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));s&&(this.ferstPin.x=s[0],this.ferstPin.y=n,this.counterClick++),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.$props.layout.screen2t(t.layerX),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var c=this.$props.sub.find((function(t){return t[0]===+r.toFixed(0)}));c&&(this.secondPin.x=c[0],this.secondPin.y=a,this.counterClick++),this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{title:"arrFatWord",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",borderColor:"#fff0",typeLine:[],lineWidth:2}}},cmt=amt,lmt=Object(C["a"])(cmt,Ift,Bft,!1,null,null,null),umt=lmt.exports,dmt={name:"MiddleLineOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["MiddleLineOverlay"]},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.fillStyle="#fff",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Средняя стрелка",nameIconTitle:"new-arrow-mid",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Заливка",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]},{index:1,name:"Края",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"borderColor",value:this.borderColor,color:function(){return i.borderColor},fast:!0}]}],typeModal:t}}})},onHoverCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeFirstPos=!0);if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeSecPos=!0);if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1,this.rect&&this.pointInRectangle({x:t.layerX,y:t.layerY},this.rect)&&this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}if(1===this.counterClick){var e=this.$props.layout.screen2t(t.layerX),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var o=this.$props.sub.find((function(t){return t[0]===+e.toFixed(0)}));o&&(this.ferstPin.x=o[0],this.ferstPin.y=i,this.counterClick++),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var n=this.$props.layout.screen2t(t.layerX),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var r=this.$props.sub.find((function(t){return t[0]===+n.toFixed(0)}));r&&(this.secondPin.x=r[0],this.secondPin.y=s,this.counterClick++),this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,mousedownOnLine:!1,title:"midArrWord",counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",borderColor:"#fff0",typeLine:[],lineWidth:2}}},hmt=dmt,pmt=Object(C["a"])(hmt,Mft,$ft,!1,null,null,null),gmt=pmt.exports,fmt={name:"ArrowShowing",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ArrowShowing"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.fillStyle="#fff",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"ArrowPointer",nameIconTitle:"new-bigarrow",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Fill",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]},{index:1,name:"Border",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"borderColor",value:this.borderColor,color:function(){return i.borderColor},fast:!0}]}],typeModal:t}}})},onHoverCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))=80?80:.12*u,h={x:u,y:0},p={x:h.x-.2*h.x,y:d},g={x:p.x+.04*p.x,y:.4*p.y},f={x:0,y:0},m={x:g.x,y:-g.y},v={x:p.x,y:-d};t.save(),t.translate(e,i),t.rotate(l),t.beginPath(),t.moveTo(h.x,h.y),t.lineTo(p.x,p.y),t.lineTo(g.x,g.y),t.lineTo(f.x,f.y),t.lineTo(m.x,m.y),t.lineTo(v.x,v.y),t.closePath(),t.fillStyle=this.colorLine,t.strokeStyle=this.colorLine,"none"!==this.borderColor&&(t.strokeStyle=this.borderColor),t.fill(),"none"!==this.borderColor&&t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},mouseClickEvent:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*16},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var t=this.$props.layout.screen2t(event.layerX),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1;var i=this.$props.sub.find((function(e){return e[0]===+t.toFixed(0)}));i&&(this.secondPin.x=i[0],this.secondPin.y=e,this.counterClick++),this.openModal(null,event),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.$props.layout.screen2t(t.layerX),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));s&&(this.ferstPin.x=s[0],this.ferstPin.y=n,this.counterClick++),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.$props.layout.screen2t(t.layerX),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var c=this.$props.sub.find((function(t){return t[0]===+r.toFixed(0)}));c&&(this.secondPin.x=c[0],this.secondPin.y=a,this.counterClick++),this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{title:"arrPointWord",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",borderColor:"#fff0",typeLine:[],lineWidth:2}}},mmt=fmt,vmt=Object(C["a"])(mmt,Lft,Fft,!1,null,null,null),ymt=vmt.exports;function Cmt(t,e,i){return"undefined"===typeof i||0===+i?Math[t](e):(e=+e,i=+i,isNaN(e)||"number"!==typeof i||i%1!==0?NaN:(e=e.toString().split("e"),e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+i:i))))}var bmt,Smt,Pmt=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e,this.medianPrice=null}return Object(Jh["a"])(t,[{key:"init_shader",value:function(t){var e=this;this.comp;this.comp.openOrders,this.comp.$emit("new-shader",{target:"sidebar",draw:function(t){e.medianPrice&&e.drawPricePoint(t,e.medianPrice,"red")}}),this.shader=!0}},{key:"drawPricePoint",value:function(t,e,i){var o=this.comp.$props.layout,n=this.comp.$props.config,s=t.canvas.width,r=(n.PANHEIGHT,-.5),a=7;t.beginPath();var c=o.$2screen(e);t.fillStyle=i,t.fillRect(r-.5,c-7,s+1,14),t.fillStyle="white",t.textAlign="left",t.font="".concat(10,"px Arial"),t.fillText(e,a,c+4)}},{key:"draw",value:function(t,e){this.medianPrice=e,this.comp&&this.comp.$props.meta.last&&(this.shader||this.init_shader())}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.colorCandleUp}},{key:"red",value:function(){return this.comp.colorCandleDw}}]),t}(),Tmt={name:"MedianAveragePrice",mixins:[tgt["a"]],mounted:function(){var t=this;this.symbol=this.$props.settings.symbol;var e=this.$props.settings.data;e&&Object.keys(e).forEach((function(i){t[i]=e[i]})),this.myOpenOrders=this.$props.settings.additionallyData,this.prec=this.getContracts.find((function(e){return e.name===t.symbol})).precision;var i=this.myOpenOrders.filter((function(t){return"Sell"===t[1]})),o=this.myOpenOrders.filter((function(t){return"Buy"===t[1]}));this.resultArr=i.length<=o.length?o:i},methods:{init:function(){this.shader=new Pmt(this)},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["MedianAveragePrice"]},draw:function(t){if(this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.averagePrice){if(this.getToken){this.ctx=t;var e=this.resultArr;if(Array.isArray(e)&&this.resultArr.length){var i=e.reduce((function(t,e){return t.price+=e[2]*e[4].volume,t.profit+=e[4].profit,t.vol+=e[4].volume,t}),{price:0,profit:0,vol:0});this.drawLine(t,i.price/i.vol,i.profit)}}}else this.shader&&this.shader.draw(t,0)},drawLine:function(t,e,i){var o=this.$props.layout,n=this.$props.layout.spacex;this.shader&&this.shader.draw(t,+e.toFixed(this.getPrecision));var s=o.$2screen(e);t.beginPath(),t.strokeStyle=i>0?"green":"red",t.font="10px Arial",t.fillStyle=i>0?"green":"red";var r="".concat(e.toFixed(this.getPrecision)),a=t.measureText(r).width;t.fillText(r,10,s+3),t.moveTo(8,s-8),t.lineTo(a+12,s-8),t.lineTo(a+12,s+8),t.lineTo(8,s+8),t.closePath(),t.strokeStyle=i>0?"green":"red",t.stroke(),t.moveTo(a+12,s),t.setLineDash([8,5]),t.lineWidth="1",t.lineTo(n,s),t.stroke()},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mousedown:function(t){this.$props.layout}},computed:Object(c["a"])({sett:function(){return this.$props.settings},new_font:function(){return"16px "+this.$props.font.split("px").pop()},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e}},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getToken:"auth/getToken",getContracts:"contracts/getContracts"})),data:function(){return{mouse:{x:void 0,y:void 0},ctx:null}}},xmt=Tmt,Omt=Object(C["a"])(xmt,bmt,Smt,!1,null,null,null),wmt=Omt.exports,_mt=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e,this.arrOrder=[],this.hedging=null,this.isHidden=!1,this.isDark=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(t){var e=this,i={Buy:"#008E72",Sell:"#e91213"};this.comp;this.comp.openOrders,this.comp.$emit("new-shader",{target:"sidebar",draw:function(t){e.arrOrder&&Array.isArray(e.arrOrder)&&(e.isHidden||e.arrOrder.forEach((function(o){"Buy"!==o.orderType||e.hedging&&e.hedging.buy?e.hedging&&e.hedging.buy&&e.drawPricePoint(t,e.hedging.buy.openPrice,i["Buy"]):(e.drawPricePoint(t,o.openPrice,i[o.orderType]),e.drawLimits(t,o)),"Sell"!==o.orderType||e.hedging&&e.hedging.sell?e.hedging&&e.hedging.sell&&(e.drawPricePoint(t,e.hedging.sell.openPrice,i["Sell"]),e.drawLimits(t,e.hedging.sell)):e.drawPricePoint(t,o.openPrice,i[o.orderType])})))}}),this.shader=!0}},{key:"drawLimits",value:function(t,e){var i={takeProfit:"#008E72",stopLoss:"#e91213"};e.takeProfit>0&&this.drawPricePoint(t,e.takeProfit,i["takeProfit"]),e.stopLoss>0&&this.drawPricePoint(t,e.stopLoss,i["stopLoss"])}},{key:"drawPricePoint",value:function(t,e,i){var o=this.comp.$props.layout,n=this.comp.$props.config,s=t.canvas.width,r=(n.PANHEIGHT,-.5),a=7;t.beginPath();var c=o.$2screen(e);t.fillStyle=this.isDark?"#23313f":"white",t.fillRect(r-.5,c-7,s+1,14),t.strokeStyle=i,t.strokeRect(r-.5,c-7,s+1,14),t.fillStyle=i,t.textAlign="left",t.font="".concat(10,"px Arial"),t.fillText(e,a,c+4)}},{key:"draw",value:function(t,e,i,o,n){this.isDark="dark"===n,this.isHidden=o,this.comp&&this.comp.$props.meta.last&&(this.arrOrder=e,this.hedging=i,this.shader||this.init_shader(e))}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.colorCandleUp}},{key:"red",value:function(){return this.comp.colorCandleDw}}]),t}(),Amt={name:"TradingLinesOrder",mixins:[tgt["a"]],data:function(){return{onHoverHedj:[],openOrders:[],settingsDisabledHedjOrders:null,"с":null,symbol:"",shoModalChart:!1,isAll:!1,shader:null,hedgingToResultBuy:null,hedgingToResultSell:null,resultAllProfit:0,mouse:{x:null,y:null},resultAllPip:0,listPoints:[],EventList:[],equity:null,qoute:null,dataClick:null}},watch:{stopChangePosition:function(t){Dmt(this.stopChart,300,!0)(!t)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme",getAccountsSettings:"accountsTradeSettings/getAccountsSettings"})),{},{getRed:function(){return"dark"===this.getActiveTheme?"#ff3232":"#E91212"},getGreen:function(){return"dark"===this.getActiveTheme?"#1ef0b1":"#008E72"},getColorTrendChart:function(){var t=this;return function(e){return{color:"light"===t.getActiveTheme?e?"#008e72":"#E91212":e?"#1ef0b1":"#FA4C4A",zeroGradient:"light"===t.getActiveTheme?e?"rgba(137, 239, 215, 0.73)":"#FFDCDC":e?"#1EF059":"#FA6A4A",firstGradient:"light"===t.getActiveTheme?"#fafafa":"rgba(49, 68, 86, 0.7)",colorText:"light"===t.getActiveTheme?"rgba(255,255,255,1)":"#314456",colorWindow:"light"===t.getActiveTheme?e?"#008e72":"#e91212":e?"#1ef0b1":"#FF3232"}}},getQute:function(){return this.qoute&&this.qoute.a&&this.qoute.b?this.qoute:{a:this.$props.sub[this.$props.sub.length-1][1],b:this.$props.sub[this.$props.sub.length-1][3]}},getPrecision:function(){var t=this;if(this.getContracts){var e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e}},BUY:function(){return"dark"===this.getActiveTheme?"#1ff0b1":"#008e72"},SELL:function(){return"dark"===this.getActiveTheme?"#ff4444":"#e91213"},getOrdersData:function(){var t=this,e=this.openOrders,i=this.getPrecision;return function(o,n){return t.getOrderHedging(o,n,e,i)}}}),methods:{closeModalInform:function(){this.shoModalChart=!1,this.listPoints=[]},init:function(){this.shader=new _mt(this)},showModalChart:function(){this.getStatisticByContract(),this.shoModalChart=!0},getStatisticByContract:function(){var t={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:this.getDefaultAccount.id,contracts:[this.symbol]}};this.$socketStream.sendCommand({ws:"apiWS",command:t})},changeShowing:function(){this.isAll=!this.isAll,this.shoModalChart=!1},createDescription:function(t){this.getOrderHedging({Buy:!0},"Buy"),this.getOrderHedging({Sell:!0},"Sell")},getOrderHedging:function(t,e){var i=this.getPrecision,o=this.openOrders;if(Array.isArray(o)){if(t&&t[e]){var n=o.filter((function(t){return t.orderType===e})),s=o.filter((function(t){return t.orderType===e&&t.takeProfit>0})),r=o.filter((function(t){return t.orderType===e&&t.stopLoss>0})),a={takeProfit:+this.getAvarage(s,"takeProfit","volume").toFixed(i),stopLoss:+this.getAvarage(r,"stopLoss","volume").toFixed(i),profit:n.reduce((function(t,e){return t+=e.profit,t}),0),openPrice:+this.getAvarage(n,"openPrice","volume").toFixed(i),volume:this.getAvarageVolume(n),count:n.length,orders:n,orderType:e,isMinimaize:!0,positionButtonMinimaize:{x:!1,y:!1},positionButtonHeging:{x:!1,y:!1}};return a}return null}},meta_info:function(){return{author:"Alexey Pushkin",version:"3.0.0"}},use_for:function(){return["TradingLinesOrder"]},mousemove:function(t){this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.tradeLevels&&(this.mouse.x=t.layerX,this.mouse.y=t.layerY)},saveChange:function(t,e,i){var o,n="takeProfit"===e?"stopLoss":"takeProfit",s=(o={id:t.id,accountId:t.accountId,orderType:t.orderType,volume:t.volume,contractName:t.contractName},Object(Vt["a"])(o,e,+i.toFixed(this.getPrecision)),Object(Vt["a"])(o,n,+t[n]),Object(Vt["a"])(o,"openDate",t.openDate),Object(Vt["a"])(o,"openPrice",t.openPrice),o);Jpt.$emit("updateOrder",{name:"updateOrder",data:{symbol:this.symbol,order:s}})},mouseup:function(t){var e=this;if(this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.tradeLevels){if(this.mouseDown=null,this.orderToCorrectLineLimit){var i=this.$props.layout.screen2$(t.layerY);this.orderToCorrectLineLimit.orders&&Array.isArray(this.orderToCorrectLineLimit.orders)?this.orderToCorrectLineLimit.orders.forEach((function(t){e.saveChange(t,e.orderToCorrectLineLimit.typeCorrectLineLimit,i)})):this.saveChange(this.orderToCorrectLineLimit,this.orderToCorrectLineLimit.typeCorrectLineLimit,i),this.stopChangePosition=!1,this.orderToCorrectLineLimit=null}Array.isArray(this.openOrders)&&(this.generateClickEvent(t),this.counterMouseUp=this.counterMouseUp?this.counterMouseUp+1:1)}},mousedown:function(t){},checkIsHedj:function(t){return!!this.hedging&&this.hedging[t.orderType.toLowerCase()]},handleClickOnIconHedging:function(t,e){var i=this.checkIsHedj(e),o={top:t.layerY,left:t.layerX,arrOrders:this.openOrders.filter((function(t){return t.orderType===e.orderType})),imitationQuote:this.getQute,hedjItem:e,paramName:i?"ModalDisabledHedj":"modalHedj",symbol:this.symbol,positions:{left:t.clientX,top:t.layerY}};return i?i&&(this.settingsDisabledHedjOrders=o):this.settingsHedjOrders=o,!0},checkClickOnHedj:function(t){var e=this;this.openOrders.forEach((function(i){var o=e.checkIsHedj(i);if(!o){var n=i.positionButtonHeging.y,s=i.positionButtonHeging.x,r=e.onCircle(t.layerX,t.layerY,s,n,8);r&&e.handleClickOnIconHedging(t,i)}}))},checkClickOnDisabledHedj:function(t){if(this.hedging)for(var e in this.hedging){var i=this.hedging[e];if(i){var o=i.positionButtonHeging.x,n=i.positionButtonHeging.y,s=this.onCircle(t.layerX,t.layerY,o,n,8);s&&this.handleClickOnIconHedging(t,i)}}},checkClickOnCloseOrder:function(t){var e=this,i=this.$props.layout;this.openOrders.forEach((function(o){var n=i.$2screen(o.openPrice),s=20,r=e.onCircle(t.layerX,t.layerY,s,n,8);if(r){var a={order:Array.isArray(o)?null:o,all:Array.isArray(o),orders:Array.isArray(o)?o:null,type:o.orderType};Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:t.y-32,left:t.x,paramName:"modalCloseOrder",params:a,positions:{left:t.clientX,bottom:t.layerY}}}})}}))},checkClick:function(t,e){if(this.onCircle(t.layerX,t.layerY,e.x,e.y,8))return!0},checkClickOnButtonHedj:function(t){var e=this;if(this.hedging){var i=this.hedging.buy&&this.hedging.buy.positionButtonHeging&&this.hedging.buy.positionButtonHeging.x,o=this.hedging.sell&&this.hedging.sell.positionButtonHeging&&this.hedging.sell.positionButtonHeging.x;i&&this.checkClick(t,this.hedging.buy.positionButtonHeging),o&&this.checkClick(t,this.hedging.sell.positionButtonHeging),this.openOrders.find((function(i){var o=i.positionButtonHeging&&e.onCircle(t.layerX,t.layerY,i.positionButtonHeging.x,i.positionButtonHeging.y,8);if(o)return i}))}},mouseclick:function(t){var e=this;this.dataClick=t,setTimeout((function(){return e.dataClick=null}),0),this.countermouseclick=this.countermouseclick?this.countermouseclick+1:1},generateClickEvent:function(t){this.timeClick?((new Date).getTime()-this.timeClick<=230&&Dmt(this.emitMouseClick,10,!0)(t),this.timeClick=null):this.timeClick=(new Date).getTime()},emitMouseClick:function(t){this.timerStoreDataClick&&(clearTimeout(this.timerStoreDataClick),this.dataClick=null,this.timerStoreDataClick=null),this.mouseclick(t)},getColorOrderType:function(t){return"dark"===this.getActiveTheme?"Sell"===t.orderType?"#ff4444":"#22a776":"Sell"===t.orderType?"#e91213":"#008e72"},getColorLimitOrder:function(t,e){return t.typeOrder,"dark"===this.getActiveTheme?"stopLoss"===e?"#ff4444":"#22a776":"stopLoss"===e?"#e91213":"#008e72"},draw:function(t){if(this.openOrders&&this.openOrders.length>0){this.hedgingToResultSell=this.getOrderHedging({Sell:!0},"Sell"),this.hedgingToResultBuy=this.getOrderHedging({Buy:!0},"Buy"),this.resultAllProfit=+(this.hedgingToResultBuy.profit+this.hedgingToResultSell.profit).toFixed(2);var e=this.getPip("Sell",this.getQute,+this.getAvarage(this.openOrders,"openPrice","volume").toFixed(this.getPrecision)).toFixed(0),i=Math.abs(e),o=this.resultAllProfit<0?-1:1;this.resultAllPip=i*o}this.createDescription(t),this.shader.draw(t,this.openOrders,this.hedging,!this.getSettingsParamsLeftBar||!this.getSettingsParamsLeftBar.tradeLevels,this.getActiveTheme),this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.tradeLevels&&(this.hedging&&(this.createLineTradingOrder(t,this.hedging.sell),this.createLineTradingOrder(t,this.hedging.buy)),Array.isArray(this.openOrders)&&this.createOrder(t,this.openOrders))},drawDescriptionChart:function(t,e,i,o,n){if(e&&i){var s=+i.profit.toFixed(2),r=+e.profit.toFixed(2);t.beginPath(),t.fillStyle=o;var a="".concat(i.orderType," ").concat(i.orders.length," ").concat(i.volume.toLocaleString()," $").concat(s.toLocaleString().replace(",",".")," ").concat(this.getPip(i.orderType,this.getQute,i.openPrice).toFixed(0)," pip ").concat(this.getProcent(s),"% Lev. 0.0\n "),c="".concat(e.orderType," ").concat(e.orders.length," ").concat(e.volume.toLocaleString()," $").concat(r.toLocaleString().replace(",",".")," ").concat(this.getPip(e.orderType,this.getQute,e.openPrice).toFixed(0)," pip ").concat(this.getProcent(r),"% Lev. 0.0\n "),l="".concat(e.orderType," ").concat(e.orders.length," "),u="".concat(i.orderType," ").concat(i.orders.length," "),d=i.orders.length>0?a:u,h=e.orders.length>0?c:l,p=t.measureText("".concat(d," ")).width;t.measureText("".concat(h)).width;i.orders.length>0&&(t.fillStyle="#E91212",t.fillText("".concat(d," "),20,n)),e.orders.length>0&&(t.fillStyle="#008E72",t.fillText("".concat(h),i.orders.length>0?20+p:20,n))}},createLineCorrectLimit:function(t,e){if(this.mouse.x&&this.mouse.y){this.getActiveTheme;var i=this.$props.layout.screen2$(this.mouse.y);this.createDescriptionLineLimit(t,e,30,this.mouse.y,i,e.typeCorrectLineLimit,!1)}},getProfit:function(t,e,i,o,n){var s={Sell:function(){return(t-i)*o},Buy:function(){return(i-t)*o}},r=this.getPrecision<=3;return r?s[n]()/Ph(this.getPrecision-1):s[n]()},createOrder:function(t,e){var i=this;e.forEach((function(e){var o=i.hedging&&i.hedging[e.orderType.toLowerCase()];o||i.createLineTradingOrder(t,e,!0,!0)}))},drawLineLimitLeftPointPrice:function(t,e,i,o){t.beginPath(),t.font="10px Arial";var n=t.measureText("".concat(i.toFixed(this.getPrecision))).width,s=n+8+5;return t.beginPath(),t.moveTo(0,e-6),t.lineTo(s-5,e-6),t.lineTo(s,e),t.lineTo(s-5,e+6),t.lineTo(0,e+6),t.closePath(),t.fillStyle=o,t.fill(),t.beginPath(),t.fillStyle="white",t.font="10px Arial",t.fillText("".concat(i.toFixed(this.getPrecision)),4,e+4),s+10},createLineTradingOrder:function(t,e,i,o){if(e){var n=this.$props.layout,s=e.price>n.$_lo&&e.price0&&h.push(this.$props.layout.$2screen(e.takeProfit)),e.stopLoss>0&&h.push(this.$props.layout.$2screen(e.stopLoss))}}}},handleClickOnCrossLimit:function(t,e,i,o,n,s){if(i&&i.layerX){var r=i.layerX,a=i.layerY;this.onCircle(r,a,t,e,4)&&(n?this.removeLimitOrder(o,s,i,o.orders):this.removeLimitOrder(o,s,i,o))}},removeLimitOrder:function(t,e,i,o){Array.isArray(o)?Jpt.$emit("changeShowModalCloseAllLimit",{name:"changeShowModalCloseAllLimit",data:{settings:{top:i.y-32,left:i.x,type:e,orderType:t.orderType,arrOrders:o}}}):Jpt.$emit("changeShowModalAcceptCloseLimit",{name:"changeShowModalAcceptCloseLimit",data:{settings:{top:i.y-32,left:i.x,type:e,orderType:t.orderType,order:o}}})},drawType:function(t,e,i,o,n,s){var r={takeProfit:"TP",stopLoss:"SL"},a=r[o],c="dark"===this.getActiveTheme?"#182129":"#d5d5d5";return this.checkOnTypeLimit(t,e+4.2,i-4,n,s,o),t.beginPath(),t.font="7px Arial",t.strokeStyle=c,t.lineWidth=1.5,t.strokeText(a,e,i),t.lineWidth=1,t.beginPath(),t.font="7px Arial",t.fillStyle=n,t.fillText(a,e,i),e+t.measureText(a).width+3},createDescriptionLineLimit:function(t,e,i,o,n,s,r,a){this.getActiveTheme;var c=this.getColorLimitOrder(e,s||e.typeCorrectLineLimit),l=this.getProfit(e.openPrice,s,+n,e.volume,e.orderType),u=this.getPip(e.orderType,{a:+n,b:+n},e.openPrice),d=this.getProcent(r||l),h=[{value:n},{value:"".concat((+(r||l).toFixed(2)).toLocaleString(),"$"),color:+(r||l)>0?this.SELL:this.BUY},{value:"".concat(d,"%")},{value:"".concat(u.toFixed(0)," pip")}];Dmt(this.handleClickOnCrossLimit,180)(7,o-1.5,this.dataClick,e,!a,s);var p=this.drawType(t,7,o+2,s,c,e),g=this.drawLineLimitDescription(t,p+2,o+2.5,h,c,e,s),f=this.createRightPointerPrice(t,o,+n.toFixed(this.getPrecision),e,c);this.createLineOrder(t,g,f,o,e,c)},drawLineLimitDescription:function(t,e,i,o,n,s,r){var a="dark"===this.getActiveTheme?"#182129":"#d5d5d5";return o.reduce((function(e,o){t.beginPath(),t.font="7px Arial",t.strokeStyle=a,t.lineWidth=1.5,t.strokeText(o.value,e,i),t.lineWidth=1,t.beginPath(),t.font="7px Arial",t.fillStyle=n,t.fillText(o.value,e,i);var s=t.measureText(o.value).width+4;return e+=s,e}),e)},checkOnTypeLimit:function(t,e,i,o,n,s){if(this.onCircle(this.mouse.x,this.mouse.y,e,i,6)&&this.drawBorderTp(t,e-6,i-6,o),this.checkOnLine(this.mouse.y,i)){var r=this.$props.layout.$2screen(n.openPrice);this.createLinePointer(t,i,[r])}this.mouseDown&&this.handleMouseDownOnLimit(e,i,n,this.mouseDown,s)},checkOnLine:function(t,e){return t>=e-2&&t<=e+2},createLinePointer:function(t,e,i){var o=this,n="dark"===this.getActiveTheme?"#bbcde0":"#333333";i.forEach((function(i){o.drawLinePointer(t,e,i,n)}));var s="dark"===this.getActiveTheme,r=s?"#182129":"#d5d5d5";this.drawCircleForGap(t,400,e,n,r,!0),i.forEach((function(e){o.drawCircleForGap(t,400,e,n,r,!0)}))},drawLinePointer:function(t,e,i,o){t.beginPath(),t.moveTo(400,e),t.lineTo(400,i),t.lineWidth=.5,t.strokeStyle=o,t.stroke()},handleMouseDownOnLimit:function(t,e,i,o,n){this.onCircle(o.layerX,o.layerY,t,e,6)&&(this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.orderToCorrectLineLimit=Object(c["a"])(Object(c["a"])({},i),{},{typeCorrectLineLimit:n}))},drawBorderTp:function(t,e,i,o){t.beginPath(),t.moveTo(e,i),t.lineTo(e+15,i),t.lineTo(e+15,i+12),t.lineTo(e,i+12),t.closePath(),t.strokeStyle=o,t.stroke()},createObjectDescription:function(t,e){this.getActiveTheme;return[{value:t.orderType.toLocaleUpperCase(),color:this[t.orderType.toUpperCase()],isCircleForGap:!0,isShow:!0},{value:"".concat(t.volume.toLocaleString()),color:this[t.orderType.toUpperCase()],isCircleForGap:!0,isShow:!0},{value:"".concat((+t.profit.toFixed(2)).toLocaleString().replace(",","."),"$"),color:t.profit<0?this.SELL:this.BUY,isCircleForGap:!0,isShow:t.isMinimaize},{value:"".concat(this.getProcent(t.profit),"%"),color:t.profit<0?this.SELL:this.BUY,isCircleForGap:!0,isShow:t.isMinimaize},{value:"".concat(e?this.getPip(t.orderType,this.getQute,t.openPrice).toFixed(0):this.getAvaragePip(t,this.getQute)," pip"),color:t.profit<0?this.SELL:this.BUY,isCircleForGap:!1,isShow:t.isMinimaize}]},getAvaragePip:function(t,e){var i=this,o=t.orders.reduce((function(t,o){return t+=i.getPip(o.orderType,e,o.openPrice)*o.volume,t}),0),n=t.orders.reduce((function(t,e){return t+=e.volume,t}),0);return(o/n).toFixed(0)},createRightPointerPrice:function(t,e,i,o,n){var s=this.$props.layout.spacex;"".concat(i);t.font="10px Arial";var r=0,a=s-(r+5);return this.drawPointerBox(t,a,e,this.getColorOrderType(o),s,n),a},drawPointerBox:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e,i),t.lineTo(e+5,i+7),t.lineTo(e+n+5,i+7),t.lineTo(e+n+5,i-7),t.lineTo(e+5,i-7),t.closePath(),t.fillStyle=s||o,t.fill()},drawPriceInEndPointer:function(t,e,i,o){t.beginPath(),t.font="10px Arial",t.fillStyle="white",t.fillText(o,e+3,i)},createLineOrder:function(t,e,i,o,n,s){t.beginPath(),t.setLineDash([]),t.moveTo(e,o),t.lineTo(i,o),t.strokeStyle="dark"===this.getActiveTheme?"rgba(187, 206, 224, 0.7)":"#dfdfdf",t.lineWidth=.5,t.stroke(),t.setLineDash([])},createControlsLine:function(t,e,i,o,n,s){},createButtonHedging:function(t,e,i,o,n){return this.drawIconHedging(t,e,i,o,n)},drawIconHedging:function(t,e,i,o,n){return"dark"===this.getActiveTheme&&(t.beginPath(),t.moveTo(e-2.5,i-4),t.lineTo(e,i-2),t.lineTo(e+2.5,i-4),t.stroke(),t.moveTo(e-2.5,i+4),t.lineTo(e,i+2),t.lineTo(e+2.5,i+4),t.lineWidth=3,t.lineCap="round",t.strokeStyle="#172028",t.stroke()),t.beginPath(),t.moveTo(e-2.5,i-4),t.lineTo(e,i-2),t.lineTo(e+2.5,i-4),t.stroke(),t.moveTo(e-2.5,i+4),t.lineTo(e,i+2),t.lineTo(e+2.5,i+4),t.lineWidth=1,t.lineCap="round",t.strokeStyle="#8fa8c1",t.stroke(),t.beginPath(),t.fillStyle="#8fa8c1",t.arc(e,i,1,0,2*Math.PI,!1),t.strokeStyle="#172028",t.lineWidth=1,t.stroke(),t.fill(),t.beginPath(),t.arc(e,i,8,0,2*Math.PI,!1),t.strokeStyle="#8c8c8c",t.stroke(),o.positionButtonHeging={x:e,y:i},e+10.5},createButtonMinimaize:function(t,e,i,o){var n="red";return this.drawIconMinimaize(t,e,i,n,o.isMinimaize,o)},drawIconMinimaize:function(t,e,i,o,n,s){var r=n?e+6:e+4,a=i+5;return n?(t.beginPath(),t.moveTo(r-8,a),t.lineTo(r-4,a-4),t.moveTo(r-8,a),t.lineTo(r-4,a+4),t.lineCap="round",t.lineWidth=1.5,t.strokeStyle=o,t.stroke()):(t.beginPath(),t.moveTo(r,a),t.lineTo(r-4,a-4),t.moveTo(r,a),t.lineTo(r-4,a+4),t.lineCap="round",t.lineWidth=1.5,t.strokeStyle=o,t.stroke()),Dmt(this.handleClickOnIconMinimaize,180)(e,i+5,this.dataClick,s),r+8},handleClickOnIconMinimaize:function(t,e,i,o){if(i&&i.layerX){var n=i.layerX,s=i.layerY;this.onCircle(n,s,t,e,4)&&(o.isMinimaize=!o.isMinimaize)}},createDescriptionHedgingOrders:function(t,e,i,o,n){var s=this;return n.reduce((function(i,n){return n.isShow&&(i.positionText=s.drawChunkDescription(t,i.positionText,o+3,n.value,n.color,n.isCircleForGap,null,n.isShow,e)),i}),{positionText:i})},drawChunkDescription:function(t,e,i,o,n,s,r,a,c){var l="dark"===this.getActiveTheme,u=l?"#182129":"#d5d5d5";l&&(t.beginPath(),t.strokeStyle=u,t.font="8px Arial",t.lineWidth=2,t.strokeText(o,e,i)),t.beginPath(),t.fillStyle=n,t.font="8px Arial",t.fillText(o,e,i);var d=e+t.measureText(o).width+7,h=r||4;return s?this.drawCircleForGap(t,d,i-h+1,n,u,a):d},drawCircleForGap:function(t,e,i,o,n,s){if(s)return t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!1),t.fillStyle=o,t.fill(),t.strokeStyle=n,t.lineWidth=1,t.stroke(),e+7},createControlsHedgingOrders:function(t,e,i,o){var n=14,s=15,r=0;return o||(r+=this.drawHedgingCounter(t,n,i,s,e.count)),this.drawHedgingCross(t,n+r,i,e,!o),n+r+20},isShowUp:function(t,e,i,o){return!!e||("Sell"===t.orderType&&t.stopLoss>0?this.onCircle(this.mouse.x,this.mouse.y,i+6,o-13.5,6):!("Buy"===t.orderType&&t.takeProfit>0)||this.onCircle(this.mouse.x,this.mouse.y,i+6,o-13.5,6))},isShowDown:function(t,e,i,o){return!!e||("Sell"===t.orderType&&t.takeProfit>0?this.onCircle(this.mouse.x,this.mouse.y,i+6,o+14,6):!("Buy"===t.orderType&&t.stopLoss>0)||this.onCircle(this.mouse.x,this.mouse.y,i+6,o+14,6))},drawControlChangeUpLimit:function(t,e,i,o,n){t.beginPath(),t.fillStyle=this[o.toLocaleUpperCase()],this.drawRadiusRectUp(t,e-1,i-21,15,18,4),t.fillStyle=this[o.toLocaleUpperCase()],t.fill(),t.beginPath(),t.font="8px Arial";var s="Buy"===o?"TP":"SL",r=t.measureText(s).width,a=e+6.5-r/2,c=i-11;t.fillStyle="white",t.fillText(s,a,c),t.strokeStyle="pink",this.mouseDown&&this.handleMouseDownUp(e,i,this.mouseDown,n)},drawControlChangeDownLimit:function(t,e,i,o,n){t.beginPath(),t.fillStyle=this[o.toLocaleUpperCase()],this.drawRadiusRectDown(t,e-1,i+6.5,15,15,4),t.fillStyle="Buy"===o?this.SELL:this.BUY,t.fill(),t.beginPath(),t.font="8px Arial";var s="Sell"===o?"TP":"SL",r=t.measureText(s).width,a=e+6.5-r/2,c=i+17;t.fillStyle="white",t.fillText(s,a,c),this.mouseDown&&this.handleMouseDownBottom(e,i,this.mouseDown,n)},handleMouseDownUp:function(t,e,i,o){var n=i.layerX,s=i.layerY;this.onCircle(n,s,t+6,e-13.5,6)&&(this.stopChangePosition=!0,this.orderToCorrectLineLimit=Object(c["a"])(Object(c["a"])({},o),{},{typeCorrectLineLimit:"Sell"===o.orderType?"stopLoss":"takeProfit"}))},handleMouseDownBottom:function(t,e,i,o){var n=i.layerX,s=i.layerY;this.onCircle(n,s,t+6,e+14,6)&&(this.stopChangePosition=!0,this.orderToCorrectLineLimit=Object(c["a"])(Object(c["a"])({},o),{},{typeCorrectLineLimit:"Sell"===o.orderType?"takeProfit":"stopLoss"}))},drawHedgingCounter:function(t,e,i,o,n){var s="dark"===this.getActiveTheme?"#bbcde0":"#8c8c8c";return this.drawRadiusRectLeft(t,e,i-7.5,o,15,4),t.fillStyle=s,t.fill(),t.beginPath(),t.fillStyle="white",t.fillText("".concat(n),e+(7.5-t.measureText("".concat(n)).width/2),i+3.5),o},drawHedgingCross:function(t,e,i,o,n){var s="dark"===this.getActiveTheme?"#4c5b6a":"#fafafa";this.getActiveTheme;t.fillStyle=s,t.fill(),this.dataClick&&Dmt(this.handleClickOnCross,180)(e+8,i-.5,this.dataClick,o,n)},handleClickOnCross:function(t,e,i,o,n){if(i&&i.layerX){var s=i.layerX,r=i.layerY;this.onCircle(s,r,t,e,6)&&n&&Jpt.$emit("changeShowModalAcceptCloseAllOrders",{name:"changeShowModalAcceptCloseAllOrders",data:{settings:{top:i.y-32,left:i.x,orderType:o.orderType,orders:o.orders}}})}},drawCross:function(t,e,i,o,n){if(o)return t.beginPath(),t.lineWidth=1,t.moveTo(e-3,i-3),t.lineTo(e+3,i+3),t.stroke(),t.moveTo(e+3,i-3),t.lineTo(e-3,i+3),t.strokeStyle=n||"white",t.stroke(),e+8},onCircle:function(t,e,i,o,n){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*n},getColor:function(t){var e=localStorage.getItem("allColors");if(!e)return wgt[this.getActiveTheme][t];var i=JSON.parse(e);return i[this.getActiveTheme][t]},getProcent:function(t){return this.equity&&t?(t/this.equity*100).toFixed(3):0},getPip:function(t,e,i){var o=this;if(!e)return 0;var n={Buy:function(){return(+e.a-+i)*Ph(o.getPrecision-1)},Sell:function(){return(+i-+e.b)*Ph(o.getPrecision-1)}};return n[t]()||0},getDelta:function(t,e,i){var o="Sell"===t?i.a:i.b;return o?o-e:0},drawRadiusRectUp:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e+s,i),t.lineTo(e+o-s,i),t.arc(e+o-s,i+s,s,-Math.PI/2,0),t.lineTo(e+o,i+n-s),t.lineTo(e,i+n-s),t.lineTo(e,i+s),t.arc(e+s,i+s,s,Math.PI,3*Math.PI/2),t.closePath()},drawRadiusRectDown:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e,i),t.lineTo(e+o,i),t.lineTo(e+o,i+n-s),t.arc(e+o-s,i+n-s,s,0,Math.PI/2),t.lineTo(e,i+n),t.arc(e+s,i+n-s,s,Math.PI/2,Math.PI),t.closePath()},drawRadiusRectLeft:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e+s,i),t.lineTo(e+o,i),t.lineTo(e+o,i+n),t.lineTo(e+s,i+n),t.arc(e+s,i+n-s,s,Math.PI/2,Math.PI),t.lineTo(e,i+s),t.arc(e+s,i+s,s,Math.PI,3*Math.PI/2),t.closePath()},drawRadiusRectRight:function(t,e,i,o,n,s){t.beginPath(),t.moveTo(e,i),t.lineTo(e+o-s,i),t.arc(e+o-s,i+s,s,-Math.PI/2,0),t.lineTo(e+o,i+n-s),t.arc(e+o-s,i+n-s,s,0,Math.PI/2),t.lineTo(e,i+n),t.lineTo(e,i+s),t.closePath()},removeHedj:function(t){t.data.symbol===this.symbol&&(this.hedging[t.data.order.orderType.toLowerCase()]=null)},createOrdersHedging:function(){var t=this,e=this.getAccountsSettings.accounts.find((function(e){return e.accountId===t.getDefaultAccount.id}));if(e){var i=e.hedging.find((function(e){return e.symbol===t.symbol}));this.hedging={buy:this.getOrderHedging(i,"Buy"),sell:this.getOrderHedging(i,"Sell")},this.updateDraw()}},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]})},toHedj:function(t){this.hedging||(this.hedging={}),this.hedging[t.data.order.orderType.toLowerCase()]=this.getOrderHedging(Object(Vt["a"])({},t.data.order.orderType,t.data.order),t.data.order.orderType),this.updateDraw()},getAvarage:function(t,e,i){var o=t.reduce((function(t,o){return t+=o[e]*o[i],t}),0),n=t.reduce((function(t,e){return t+=e[i],t}),0);return o/n},getAvarageVolume:function(t){return t.reduce((function(t,e){return t+=e.volume,t}),0)},getOpenOrders:function(t){var e=this,i=t.filter((function(t){return t.instrumentName===e.symbol})),o=i.filter((function(t){return t.accountId===e.getDefaultAccount.id})),n=o.map((function(t){return e.createObjectOrder(t)}));return n},eventsHandles:function(t){this.getSettingsParamsLeftBar&&this.getSettingsParamsLeftBar.tradeLevels&&t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},controlSubribeWS:function(t){if(!t)return this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler),void this.$socketStream.$on("apiWS3",this.setMessageHandler);this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},ContractStatisticsByAccount:function(t){var e=this,i=t.data.filter((function(t){return t.contract===e.symbol}));i.length>0&&!this.listPoints.length&&(this.listPoints=i.map((function(t){return t.equity})))},setHistoryOrders:function(t){var e=this;this.getOpenOrders(t.tradingOrders).forEach((function(t){var i=e.openOrders.find((function(e){return e.id===t.id}));i||e.openOrders.push(t)})),this.createOrdersHedging(this.openOrders)},AccountsDetails:function(t){var e=this.getDataForCurrentAccaunt(t);e&&e.openOrders&&this.updateProfitInOpenOrders(e.openOrders.tradingOrders),this.equity=this.getEquity(t)},updateProfitInOpenOrders:function(t){var e=this;if(Array.isArray(this.openOrders))for(var i=function(){var i=e.openOrders[o],n=t.find((function(t){return t.id===i.id}));n&&(e.openOrders[o].profit=n.profit)},o=0;othis.mouse.y&&e-21?3:6;t.beginPath(),t.moveTo(i,e),t.lineTo(i+5,e+7),t.lineTo(i+12,e+7),t.lineTo(i+17,e),t.lineTo(i+12,e-7),t.lineTo(i+5,e-7),t.closePath(),t.strokeStyle=n,t.stroke(),t.fillStyle="white",t.fill(),t.fillStyle=n,2==="".concat(o).length?t.fillText(o,i+s-3,e+3):t.fillText(o,i+s,e+3)},drawLineHadj:function(t,e,i,o,n,s,r,a){var c=!1;this.hedjOrdersHid.find((function(t){return t[0]===i[0]}))&&(c=!0);var l=this.$props.layout.spacex,u=JSON.parse(localStorage.getItem("currentContract")),d=t.measureText("".concat(i[1].toFixed(u.precision),"$")).width;t.lineWidth="0.5";var h=this.symbol,p=this.getContracts.find((function(t){return t.name===h})).precision-1,g=+"".concat(this.getProfit(i[1],s,i[0],"TP"===n?"takeProfit":"stopLoss",i[3]).toFixed(p));this.hiddenOrders,this.drawHedjCounter(t,e,l-(d+30),a,"SL"===n?"red":"#008E72"),t.beginPath(),t.font="12px Arial",t.fillStyle="SL"===n?"red":"#008E72",t.fillText("".concat(n),45,e+3),t.lineWidth="0.5",t.font="10px Arial",t.fillStyle="SL"===n?"red":"#008E72";var f=c?t.measureText("".concat(s.toFixed(u.precision))).width:t.measureText("".concat(s.toFixed(u.precision)," ").concat(g," ").concat(this.getProcent(i[2]),"% ").concat(this.getPip(i[1],s),"pip")).width;return c?t.fillText("".concat(s.toFixed(u.precision)),65,e+3):t.fillText("".concat(s.toFixed(u.precision)," ").concat(g," ").concat(this.getProcent(i[2]),"% ").concat(this.getPip(i[1],s),"pip"),65,e+3),t.font="10px Arial",t.fillStyle="SL"===n?"red":"#008E72",t.fillText("".concat(s.toFixed(u.precision)),l-(d+5),e+3),t.beginPath(),t.lineWidth="0.3",t.moveTo(f+95,e),t.strokeStyle=o,t.lineTo(l-(d+30),e),t.setLineDash([2,4]),t.stroke(),t.setLineDash([0,0]),this.drawCross(t,f+75,e),t.lineWidth="0.5",(e+2>this.mouse.y&&e-20&&(i[6]=e.drawLine(t,o.$2screen(i[4].takeProfit),i[4],"green","TP",i[4].takeProfit,"takeProfit")),i[4].stopLoss>0&&(i[7]=e.drawLine(t,o.$2screen(i[4].stopLoss),i[4],"red","SL",i[4].stopLoss,"stopLoss"))))})),this.needArr=i,this.countTPs=this.needArr.reduce((function(t,e){return"Sell"===e[1]&&e[4].takeProfit>0&&t++,t}),0),this.countSLs=this.needArr.reduce((function(t,e){return"Sell"===e[1]&&e[4].stopLoss>0&&t++,t}),0),this.countTPb=this.needArr.reduce((function(t,e){return"Buy"===e[1]&&e[4].takeProfit>0&&t++,t}),0),this.countSLb=this.needArr.reduce((function(t,e){return"Buy"===e[1]&&e[4].stopLoss>0&&t++,t}),0),this.hedjOrders.forEach((function(t){"Sell"===t[0]&&(e.SellTP=e.needArr.reduce((function(e,i){return i[1]===t[0]&&(e[0]+=i[4].takeProfit,e[1]=t),e}),[0]),e.SellSL=e.needArr.reduce((function(e,i){return i[1]===t[0]&&(e[0]+=i[4].stopLoss,e[1]=t),e}),[0])),"Buy"===t[0]&&(e.BuyTP=e.needArr.reduce((function(e,i){return i[1]===t[0]&&(e[0]+=i[4].takeProfit,e[1]=t),e}),[0]),e.BuySL=e.needArr.reduce((function(e,i){return i[1]===t[0]&&(e[0]+=i[4].stopLoss,e[1]=t),e}),[0]))})),this.BuyTP&&(this.BuyTP[0]=this.BuyTP[0]/this.countTPb),this.BuySL&&(this.BuySL[0]=this.BuySL[0]/this.countSLb),this.SellTP&&(this.SellTP[0]=this.SellTP[0]/this.countTPs),this.SellSL&&(this.SellSL[0]=this.SellSL[0]/this.countSLs),this.p&&this.drawLine(t,o.$2screen(this.p[this.typeTrade]),this.p,"takeProfit"===this.typeTrade?"green":"red","takeProfit"===this.typeTrade?"TP":"SL",this.p[this.typeTrade],this.typeTrade);var n=this.needArr.find((function(t){return e.$props.layout.$2screen(t[4].takeProfit)+2>e.mouse.y&&e.$props.layout.$2screen(t[4].takeProfit)-2e.mouse.y&&e.$props.layout.$2screen(t[4].stopLoss)-2e.mouse.y&&e.$props.layout.$2screen(t[4].openPrice)-20&&(t.moveTo(360,this.$props.layout.$2screen(n[4].openPrice)),t.lineTo(360,this.$props.layout.$2screen(n[4].takeProfit)),t.lineWidth="1",t.strokeStyle="#dfdfdf",t.stroke(),this.drawCircle(t,360,this.$props.layout.$2screen(n[4].takeProfit))),n[4].stopLoss>0&&(t.moveTo(360,this.$props.layout.$2screen(n[4].openPrice)),t.lineTo(360,this.$props.layout.$2screen(n[4].stopLoss)),t.lineWidth="1",t.strokeStyle="#dfdfdf",t.stroke(),this.drawCircle(t,360,this.$props.layout.$2screen(n[4].stopLoss)),t.lineWidth="1",t.strokeStyle="#dfdfdf",this.drawCircle(t,360,this.$props.layout.$2screen(n[4].openPrice))))}}}},createArrTP:function(t,e){var i=this;this.arrLines.find((function(t){return t[1].id===e.id}))?this.arrLines.forEach((function(o,n){o[1].id===e.id&&i.$set(i.arrLines,n,[t,e])})):this.arrLines.push([t,e])},createArrSL:function(t,e){var i=this;this.arrLinesSL.find((function(t){return t[1].id===e.id}))?this.arrLinesSL.forEach((function(o,n){o[1].id===e.id&&i.$set(i.arrLinesSL,n,[t,e])})):this.arrLinesSL.push([t,e])},getTypeTrade:function(t,e,i){var o;return o="Sell"===t?this.$props.layout.screen2$(e)i?"stopLoss":"takeProfit",o},setTypeTrade:function(){"Sell"===this.p[4].orderType?this.$props.layout.screen2$(this.mouse.y)>this.p.openPrice?this.typeTrade="stopLoss":this.typeTrade="takeProfit":this.$props.layout.screen2$(this.mouse.y)0&&Jpt.$emit("updateOrder",[[t[4],t[4],t[4],t[4],t[4],t[4]],"takeProfit",i,"stopLoss",t[4].stopLoss])})),this._$emit("custom-event",{event:"scroll-lock",args:[!1]});var n=this.getProfit(this.BuyTPMove[1][1],this.BuyTPMove[0],"Buy","takeProfit",this.BuyTPMove[1][3]).toFixed(o.precision),s=document.getElementById("chartWrap").clientHeight-t.layerY-150,r=s>=0?t.layerY+"px":t.layerY-150+"px";return this.$emit("new-interface",{target:"grid",component:Emt,pin:["200px",r],win_styling:!1,win_header:!1,vars:{data:{settings:{type:"takeProfit",initPrice:this.BuyTP[0].toFixed(o.precision),resultPrice:this.BuyTPMove[0].toFixed(o.precision),finRes:"".concat(n," ").concat(this.getProcent(this.BuyTPMove[1][2]),"% ").concat(this.getPip(this.BuyTPMove[1][1],this.BuyTPMove[0]),"pip")}},p_text:"Interface"}}),void(this.BuyTPMove=void 0)}if(this.BuySLMove){this.needArr.forEach((function(t){"Buy"===t[1]&&t[4].stopLoss>0&&Jpt.$emit("updateOrder",[[t[4],t[4],t[4],t[4],t[4],t[4]],"stopLoss",i,"takeProfit",t[4].takeProfit])})),this._$emit("custom-event",{event:"scroll-lock",args:[!1]});var a=this.getProfit(this.BuySLMove[1][1],this.BuySLMove[0],"Buy","stopLoss",this.BuySLMove[1][3]).toFixed(o.precision),c=document.getElementById("chartWrap").clientHeight-t.layerY-150,l=c>=0?t.layerY+"px":t.layerY-150+"px";return this.$emit("new-interface",{target:"grid",component:Emt,pin:["200px",l],win_styling:!1,win_header:!1,vars:{data:{settings:{type:"stopLoss",initPrice:this.BuySL[0].toFixed(o.precision),resultPrice:this.BuySLMove[0].toFixed(o.precision),finRes:"".concat(a," ").concat(this.getProcent(this.BuySLMove[1][2]),"% ").concat(this.getPip(this.BuySLMove[1][1],this.BuySLMove[0]),"pip")}},p_text:"Interface"}}),void(this.BuySLMove=void 0)}if(this.SellSLMove){this.needArr.forEach((function(t){"Sell"===t[1]&&t[4].stopLoss>0&&Jpt.$emit("updateOrder",[[t[4],t[4],t[4],t[4],t[4],t[4]],"stopLoss",i,"takeProfit",t[4].takeProfit])})),this._$emit("custom-event",{event:"scroll-lock",args:[!1]});var u=this.getProfit(this.SellSLMove[1][1],this.SellSLMove[0],"Sell","stopLoss",this.SellSLMove[1][3]).toFixed(o.precision),d=document.getElementById("chartWrap").clientHeight-t.layerY-150,h=d>=0?t.layerY+"px":t.layerY-150+"px";return this.$emit("new-interface",{target:"grid",component:Emt,pin:["200px",h],win_styling:!1,win_header:!1,vars:{data:{settings:{type:"stopLoss",initPrice:this.SellSL[0].toFixed(o.precision),resultPrice:this.SellSLMove[0].toFixed(o.precision),finRes:"".concat(u," ").concat(this.getProcent(this.SellSLMove[1][2]),"% ").concat(this.getPip(this.SellSLMove[1][1],this.SellSLMove[0]),"pip")}},p_text:"Interface"}}),void(this.SellSLMove=void 0)}if(this.SellTPMove){this.needArr.forEach((function(t){"Sell"===t[1]&&t[4].takeProfit>0&&Jpt.$emit("updateOrder",[[t[4],t[4],t[4],t[4],t[4],t[4]],"takeProfit",i,"stopLoss",t[4].stopLoss])})),this._$emit("custom-event",{event:"scroll-lock",args:[!1]});var p=this.getProfit(this.SellTPMove[1][1],this.SellTPMove[0],"Sell","takeProfit",this.SellTPMove[1][3]).toFixed(o.precision),g=document.getElementById("chartWrap").clientHeight-t.layerY-150,f=g>=0?t.layerY+"px":t.layerY-150+"px";return this.$emit("new-interface",{target:"grid",component:Emt,pin:["200px",f],win_styling:!1,win_header:!1,vars:{data:{settings:{type:"takeProfit",initPrice:this.SellTP[0].toFixed(o.precision),resultPrice:this.SellTPMove[0].toFixed(o.precision),finRes:"".concat(p," ").concat(this.getProcent(this.SellTPMove[1][2]),"% ").concat(this.getPip(this.SellTPMove[1][1],this.SellTPMove[0]),"pip")}},p_text:"Interface"}}),void(this.SellTPMove=void 0)}if(this.p){var m=this.needArr.find((function(t){return t[4].id===e.p.id}));if(Jpt.$emit("updateOrder",[[this.p,this.p,this.p,this.p,this.p],this.typeTrade,i,"takeProfit"===this.typeTrade?"stopLoss":"takeProfit","takeProfit"===this.typeTrade?this.p.stopLoss:this.p.takeProfit]),m){var v=this.getProfit(this.p.openPrice,this.p[this.typeTrade],this.p.orderType,this.typeTrade,this.p.volume).toFixed(o.precision),y=document.getElementById("chartWrap").clientHeight-t.layerY-150,C=y>=0?t.layerY+"px":t.layerY-150+"px";this.$emit("new-interface",{target:"grid",component:Emt,pin:["200px",C],win_styling:!1,win_header:!1,vars:{data:{settings:{type:this.typeTrade,initPrice:m[4][this.typeTrade],resultPrice:this.p[this.typeTrade].toFixed(o.precision),finRes:"".concat(v," ").concat(this.getProcent(this.p.profit),"% ").concat(this.getPip(this.p.openPrice,this.p[this.typeTrade]),"pip")}},p_text:"Interface"}})}return this.typeTrade=void 0,this.newLimit=void 0,this.indexNeedArr=void 0,this.p=void 0,this.newLimit=void 0,void this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}}},mousedown:function(t){var e=this;if(this.getStatusOpenPositions&&!this.stopWork){var i=t.layerY,o=t.layerX;if(this.BuyTP&&this.BuyTP[2]){if(this.onCircle(o,i,this.BuyTP[2].x,this.$props.layout.$2screen(this.BuyTP[0]))){var n=this.needArr.filter((function(t){return"Buy"===t[1]&&t[4].takeProfit>0})),s=document.getElementById("chartWrap").clientHeight-t.layerY-100,r=s>=0?t.layerY+"px":t.layerY-100+"px";return void this.$emit("new-interface",{target:"grid",component:zmt,pin:["200px",r],win_styling:!1,win_header:!1,vars:{data:{settings:{orders:n,type:"takeProfit",otherType:"stopLoss"}},p_text:"Interface"}})}this.pointInRectangle({x:this.mouse.x,y:this.mouse.y},{A:{x:42,y:this.$props.layout.$2screen(this.BuyTP[0])+8},B:{x:63,y:this.$props.layout.$2screen(this.BuyTP[0])+8},C:{x:63,y:this.$props.layout.$2screen(this.BuyTP[0])-10},D:{x:42,y:this.$props.layout.$2screen(this.BuyTP[0])-10}})&&(this.BuyTPMove=this.BuyTP,this.mouseDown=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}if(this.BuySL&&this.BuySL[2]){if(this.onCircle(o,i,this.BuySL[2].x,this.$props.layout.$2screen(this.BuySL[0]))){var a=this.needArr.filter((function(t){return"Buy"===t[1]&&t[4].stopLoss>0})),c=document.getElementById("chartWrap").clientHeight-t.layerY-100,l=c>=0?t.layerY+"px":t.layerY-100+"px";return void this.$emit("new-interface",{target:"grid",component:zmt,pin:["200px",l],win_styling:!1,win_header:!1,vars:{data:{settings:{orders:a,type:"stopLoss",otherType:"takeProfit"}},p_text:"Interface"}})}this.pointInRectangle({x:this.mouse.x,y:this.mouse.y},{A:{x:42,y:this.$props.layout.$2screen(this.BuySL[0])+8},B:{x:63,y:this.$props.layout.$2screen(this.BuySL[0])+8},C:{x:63,y:this.$props.layout.$2screen(this.BuySL[0])-10},D:{x:42,y:this.$props.layout.$2screen(this.BuySL[0])-10}})&&(this.mouseDown=!0,this.BuySLMove=this.BuySL,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}if(this.SellSL&&this.SellSL[2]){if(this.onCircle(o,i,this.SellSL[2].x,this.$props.layout.$2screen(this.SellSL[0]))){var u=this.needArr.filter((function(t){return"Sell"===t[1]&&t[4].stopLoss>0})),d=document.getElementById("chartWrap").clientHeight-t.layerY-100,h=d>=0?t.layerY+"px":t.layerY-100+"px";return void this.$emit("new-interface",{target:"grid",component:zmt,pin:["200px",h],win_styling:!1,win_header:!1,vars:{data:{settings:{orders:u,type:"stopLoss",otherType:"takeProfit"}},p_text:"Interface"}})}this.pointInRectangle({x:this.mouse.x,y:this.mouse.y},{A:{x:42,y:this.$props.layout.$2screen(this.SellSL[0])+8},B:{x:63,y:this.$props.layout.$2screen(this.SellSL[0])+8},C:{x:63,y:this.$props.layout.$2screen(this.SellSL[0])-10},D:{x:42,y:this.$props.layout.$2screen(this.SellSL[0])-10}})&&(this.mouseDown=!0,this.SellSLMove=this.SellSL,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}if(this.SellTP&&this.SellTP[2]){if(this.onCircle(o,i,this.SellTP[2].x,this.$props.layout.$2screen(this.SellTP[0]))){var p=this.needArr.filter((function(t){return"Sell"===t[1]&&t[4].takeProfit>0})),g=document.getElementById("chartWrap").clientHeight-t.layerY-100,f=g>=0?t.layerY+"px":t.layerY-100+"px";return void this.$emit("new-interface",{target:"grid",component:zmt,pin:["200px",f],win_styling:!1,win_header:!1,vars:{data:{settings:{orders:p,type:"takeProfit",otherType:"stopLoss"}},p_text:"Interface"}})}this.pointInRectangle({x:this.mouse.x,y:this.mouse.y},{A:{x:42,y:this.$props.layout.$2screen(this.SellTP[0])+8},B:{x:63,y:this.$props.layout.$2screen(this.SellTP[0])+8},C:{x:63,y:this.$props.layout.$2screen(this.SellTP[0])-10},D:{x:42,y:this.$props.layout.$2screen(this.SellTP[0])-10}})&&(this.mouseDown=!0,this.SellTPMove=this.SellTP,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}if(this.needArr){var m=this.needArr.find((function(n,s){if(n[6]&&e.onCircle(o,i,n[6].x,e.$props.layout.$2screen(n[4].takeProfit))){var r=document.getElementById("chartWrap").clientHeight-t.layerY-100,a=r>=0?t.layerY+"px":t.layerY-100+"px";e.$emit("new-interface",{target:"grid",component:Zmt,pin:["200px",a],win_styling:!1,win_header:!1,vars:{data:{settings:{order:n,type:"takeProfit",otherType:"stopLoss"}},p_text:"Interface"}})}else{if(!n[7]||!e.onCircle(o,i,n[7].x,e.$props.layout.$2screen(n[4].stopLoss)))return e.pointInRectangle({x:e.mouse.x,y:e.mouse.y},{A:{x:42,y:e.$props.layout.$2screen(n[4].takeProfit)+8},B:{x:63,y:e.$props.layout.$2screen(n[4].takeProfit)+8},C:{x:63,y:e.$props.layout.$2screen(n[4].takeProfit)-10},D:{x:42,y:e.$props.layout.$2screen(n[4].takeProfit)-10}})?(e.mouseDown=!0,e.typeTrade="takeProfit",e.indexNeedArr=s,e._$emit("custom-event",{event:"scroll-lock",args:[!0]}),n):e.pointInRectangle({x:e.mouse.x,y:e.mouse.y},{A:{x:42,y:e.$props.layout.$2screen(n[4].stopLoss)+8},B:{x:63,y:e.$props.layout.$2screen(n[4].stopLoss)+8},C:{x:63,y:e.$props.layout.$2screen(n[4].stopLoss)-10},D:{x:42,y:e.$props.layout.$2screen(n[4].stopLoss)-10}})?(e.mouseDown=!0,e.typeTrade="stopLoss",e.indexNeedArr=s,e._$emit("custom-event",{event:"scroll-lock",args:[!0]}),n):void 0;var c=document.getElementById("chartWrap").clientHeight-t.layerY-100,l=c>=0?t.layerY+"px":t.layerY-100+"px";e.$emit("new-interface",{target:"grid",component:Zmt,pin:["200px",l],win_styling:!1,win_header:!1,vars:{data:{settings:{order:n,type:"stopLoss",otherType:"takeProfit"}},p_text:"Interface"}})}}));this.p=m&&m[4]}}},keydown:function(t){"Escape"===t.key&&(this.selected=null,this.hint=null)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getToken:"auth/getToken",getContracts:"contracts/getContracts",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart"})),{},{getStatusOpenPositions:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"openPositions"===t.name}));return!t||t.isActive}},sett:function(){return this.$props.settings}}),data:function(){return{EventList:["onChangeOrders"],buy:{takeProfit:void 0,stopLoss:void 0},sell:{takeProfit:void 0,stopLoss:void 0},hedjOrdersHid:[],hiddenOrders:[],hedjOrders:[],arrLines:[],arrLinesSL:[],p:void 0,openPrice:void 0,stopWork:!1,typeTrade:void 0,hoverOnLine:!1,mouseDown:!1,ferstCrd:{},chart:document.getElementById("chartWrap"),line:!1,mouse:{x:void 0,y:void 0},highlighted:null,selected:null,intr:null,ct:null,arr:[]}}};function evt(t,e,i){return"undefined"===typeof i||0===+i?Math[t](e):(e=+e,i=+i,isNaN(e)||"number"!==typeof i||i%1!==0?NaN:(e=e.toString().split("e"),e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+i:i))))}function ivt(t){return 0===t?1:1===t?10:2===t?100:3===t?1e3:4===t?1e4:5===t?1e5:1e6}var ovt,nvt,svt,rvt,avt,cvt,lvt,uvt,dvt,hvt,pvt,gvt,fvt,mvt,vvt,yvt,Cvt,bvt,Svt,Pvt,Tvt,xvt,Ovt,wvt,_vt,Avt,Dvt,kvt,Ivt,Bvt,Mvt,$vt,Lvt,Fvt,jvt,Rvt,Wvt,Nvt,Evt,Uvt,Vvt,Hvt,Gvt,qvt,zvt,Yvt,Xvt,Qvt,Jvt,Kvt,Zvt,tyt,eyt,iyt,oyt,nyt,syt,ryt,ayt,cyt,lyt=tvt,uyt=Object(C["a"])(lyt,ovt,nvt,!1,null,null,null),dyt=uyt.exports,hyt={name:"LineOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&"arrCnd"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["LineOverlay"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Line",nameIconTitle:"new-trands-line",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Lines",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"ShowPriceRange",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:2,name:"ShowPriceRangeBars",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:3,name:"ShowAngle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowAngle,controllerCheckBox:function(t){i.isShowAngle=t.value},settings:[]},{index:4,name:"AlwaysShowValues",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowValues,controllerCheckBox:function(t){i.isShowValues=t.value},settings:[]},{index:5,name:"AlwaysShowTheMiddle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isMidlePin,controllerCheckBox:function(t){i.isMidlePin=t.value},settings:[]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,this.typeStart,this.typeEnd),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),this.change&&!this.isShowValues?this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)):this.isShowValues&&this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x))}},drawValueBox:function(t,e,i,o,n){var s=this.symbol,r=this.getContracts.find((function(t){return t.name===s})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=[this.isShowPriceB,this.isShowBars,this.isShowAngle],d=0;u.forEach((function(t){t&&(d+=14)}));var h=Cmt("trunc",c,a),p=h/this.ferstPin.y*100,g=Cmt("trunc",p,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var f=0;this.isShowPriceB&&(f=t.measureText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l)).width+28),this.isShowBars&&!this.isShowPriceB&&(f=t.measureText("".concat(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)," bars")).width+28),this.isShowBars||this.isShowPriceB||!this.isShowAngle||(f=t.measureText("".concat(Math.abs(this.angle),"°")).width+28);var m={x:void 0,y:void 0},v={x:void 0,y:void 0},y={x:void 0,y:void 0},C={x:void 0,y:void 0};ni+d+8?(m.y=i+20-d+8,v.y=m.y,y.y=m.y+d+8,C.y=y.y):(m.y=i+20,v.y=m.y,y.y=m.y+d+8,C.y=y.y),t.moveTo(m.x,m.y),t.lineTo(v.x,v.y),t.lineTo(y.x,y.y),t.lineTo(C.x,C.y),t.closePath(),t.stroke(),t.beginPath(),this.isShowAngle&&(t.fillText(Math.abs(this.angle)+"°",m.x+14,m.y+d),d-=14),this.isShowBars&&(t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",m.x+14,m.y+d),d-=14),this.isShowPriceB&&(t.fillText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l),m.x+14,m.y+d),d-=14,t.fill())},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]||!this.arrCnd[t][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l);this.angle=(57.2958*d).toFixed(0);var h=Math.sqrt(l*l+u*u);t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),t.stroke(),"larrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s),t.stroke()):"strokesqarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-10,5),t.lineTo(-10,-5),t.lineTo(0,-5),t.closePath(),t.stroke()):"strokecrclarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(-5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===a?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-5,5),t.lineTo(-5,-5),t.lineTo(0,-5),t.closePath(),t.fill()):"whatarrow"===a&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-5,-5),t.lineTo(0,0),t.lineTo(-5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-7-this.lineWidth,-5),t.lineTo(-2-this.lineWidth,0),t.lineTo(-7-this.lineWidth,5),t.stroke()),"new-arrow-mid"===c?(t.beginPath(),t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s),t.stroke()):"strokesqarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h,0),t.lineTo(h,5),t.lineTo(h+10,5),t.lineTo(h+10,-5),t.lineTo(h,-5),t.closePath(),t.stroke()):"strokecrclarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(h+5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===c?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h,0),t.lineTo(h,5),t.lineTo(h+5,5),t.lineTo(h+5,-5),t.lineTo(h,-5),t.closePath(),t.fill()):"whatarrow"===c&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h+5,-5),t.lineTo(h,0),t.lineTo(h+5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h+7+this.lineWidth,-5),t.lineTo(h+2+this.lineWidth,0),t.lineTo(h+7+this.lineWidth,5),t.stroke()),this.isMidlePin&&this.drawCirlce(t,h/2,0),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.ferstPinBars=this.$props.layout.screen2t(t.layerX),this.counterClick++,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{isShowPriceB:!1,isShowBars:!0,isShowAngle:!0,isShowValues:!1,isMidlePin:!0,typeEnd:"none",typeStart:"none",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"rgba(101,142,232,1)",title:"trendLineWord",typeLine:[],lineWidth:1}}},pyt=hyt,gyt=Object(C["a"])(pyt,svt,rvt,!1,null,null,null),fyt=gyt.exports,myt={name:"ConeOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ConeOverlay"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),t.threePin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.threePin.y)+60),t.threePin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.threePin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Cone",nameIconTitle:"new-chanels-fibonacci",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:0,name:"Levels",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowProcent",value:this.isShowProcent,change:function(t){i.isShowProcent=t,i.updateDraw()}}},{index:1,name:"Background",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowSection",value:this.isShowSection,change:function(t){i.isShowSection=t,i.updateDraw()}}}]}]},{index:4,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowText,controllerCheckBox:function(t){i.isShowText=t.value},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Rightо",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:5,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},getWidth:function(t,e,i,o){var n=i-t,s=o-e,r=Math.sqrt(n*n+s*s);return r},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawDescription:function(t,e,i,o){t.beginPath();var n=t.measureText(o).width+10;t.fillStyle="#000",t.fillText(o,e-n,i),t.fill()},drawSection:function(t,e,i,o,n,s,r,a,c,l){if(!c)return t.beginPath(),t.setLineDash(this.typeLine||[]),t.lineWidth=this.lineWidth,t.strokeStyle=a.colorLine,t.fillStyle=a.color,t.moveTo(e,i),t.lineWidth=0,t.closePath(),t.arc(e,i,o,n,s,r),this.isShowSection&&t.fill(),void t.stroke();if(a.f&&c.f){t.beginPath(),t.setLineDash(this.typeLine||[]),t.lineWidth=this.lineWidth,t.strokeStyle=a.colorLine,t.fillStyle=a.color;var u=this.symbol,d=-1*this.getContracts.find((function(t){return t.name===u})).precision,h=this.$props.layout.t2screen(c.f.x),p=this.$props.layout.$2screen(Cmt("trunc",c.f.y,d)),g=this.$props.layout.t2screen(c.s.x),f=this.$props.layout.$2screen(Cmt("trunc",c.s.y,d)),m=this.$props.layout.t2screen(a.f.x),v=this.$props.layout.$2screen(Cmt("trunc",a.f.y,d));t.moveTo(h,p),t.lineTo(m,v),t.lineWidth=0,t.arc(e,i,o,n,s,r),t.strokeStyle=a.colorLine,t.lineWidth=this.lineWidth,t.lineTo(g,f),t.arc(e,i,this.widthCD*c.procent,s+.001*s,n+.001*n,!r),this.isShowSection&&t.fill(),t.beginPath(),t.arc(e,i,o,n,s,r),t.stroke()}},getVector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},crossProduct:function(t,e){return t.x*e.y-t.y*e.x},getAngle1:function(t,e){var i=this.dotProduct(t,e),o=this.crossProduct(t,e);return Math.atan2(o,i)},draw:function(t){var e=this;if(this.ctx=t,this.ferstPin.x){t.beginPath();var i=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,o=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;if(t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.widthCD=this.getWidth(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.threePin&&this.threePin.x&&(t.beginPath(),t.stroke(),this.drawSecondLine(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.threePin.x),this.$props.layout.$2screen(this.threePin.y),this.widthCD),this.testBC&&this.testBC.x)){var n=this.symbol,s=-1*this.getContracts.find((function(t){return t.name===n})).precision,r=Cmt("trunc",this.testBC.y,s),a=this.getAngle(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(r));this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(r);var c=this.getVector({x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:this.$props.layout.t2screen(this.testBC.x),y:this.$props.layout.$2screen(r)}),l=this.getVector({x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:this.$props.layout.t2screen(this.secondPin.x),y:this.$props.layout.$2screen(this.secondPin.y)});this.superAngle&&this.levels.forEach((function(i,o){e.drawSection(t,e.$props.layout.t2screen(e.ferstPin.x),e.$props.layout.$2screen(e.ferstPin.y),e.widthCD*i.procent,e.superAngle,a,!(e.getAngle1(c,l)/(Math.PI/180)<0),i,e.levels[o-1])}))}t.strokeStyle=this.colorLine,this.drawFertsLine(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),i,o,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(this.testBC.y)))}},getAngle:function(t,e,i,o){var n=i-t,s=o-e,r=Math.atan2(s,n);return r},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},toOldCoord:function(t,e,i,o,n){var s=Math.sin(n),r=Math.cos(n),a=i*r-o*s,c=i*s+o*r;return{x:this.$props.layout.screen2t(this.$props.layout.t2screen(t)+a),y:this.$props.layout.screen2$(this.$props.layout.$2screen(e)+c)}},drawFertsLine:function(t,e,i,o,n){var s=this,r=o-e,a=n-i,c=Math.atan2(a,r);this.superAngle=c;var l=Math.sqrt(r*r+a*a),u=Math.sin(c),d=Math.cos(c),h=l+30,p=0,g=h*d-p*u,f=h*u+p*d;this.ferstBz={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+g),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+f)},this.widthCD=l,this.levels=this.levels.map((function(t){return t.f=s.toOldCoord(s.ferstPin.x,s.ferstPin.y,l*t.procent,0,c),t})),this.levels.forEach((function(e){("right"===s.typeShowLevels||"all"===s.typeShowLevels&&!s.isShowText&&s.isShowProcent)&&s.drawDescription(t,s.$props.layout.t2screen(e.f.x),s.$props.layout.$2screen(e.f.y),e.procent+"")})),t.save(),t.lineWidth=this.lineWidth,t.translate(e,i),t.rotate(c),t.beginPath(),t.moveTo(0,0),t.lineTo(l,0),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},drawSecondLine:function(t,e,i,o,n,s){var r=this,a=o-e,c=n-i,l=Math.atan2(c,a),u=s,d=Math.sin(l),h=Math.cos(l),p=u,g=0,f=p*h-g*d,m=p*d+g*h;this.levels=this.levels.map((function(t){return t.s=r.toOldCoord(r.ferstPin.x,r.ferstPin.y,u*t.procent,0,l),t})),"left"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.isShowText||!this.isShowProcent||this.levels.forEach((function(e){r.drawDescription(t,r.$props.layout.t2screen(e.s.x),r.$props.layout.$2screen(e.s.y),e.procent+"")}));var v={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+f),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+m)};this.testBC=v;var y=u+30,C=0,b=y*h-C*d,S=y*d+C*h;this.secondBz={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+b),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+S)},t.save(),t.lineWidth=this.lineWidth,t.setLineDash(this.levels[0].type||[]),t.translate(e,i),t.rotate(l),t.beginPath(),t.moveTo(0,0),t.lineTo(u,0),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)||this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.threePin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.threePin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}if(this.changeThreePin){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.threePin.x=s,void(this.threePin.y=r)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},mouseup:function(){this.mousedownOnLine=void 0,this.changeThreePin&&this.counterClick>3&&(this.saveNewPosition(),this.openModal(null,event),this.changeThreePin=!1),this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=[];if(this.counterClick>3){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeSecPos=!0);if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(this.testBC.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeThreePin=!0);if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.changeThreePin=!0,this.saveNewPosition()}else if(3===this.counterClick){var a=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),c=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.threePin.x=a,this.threePin.y=c,this.counterClick++,this.changeThreePin=!1,this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{lineWidth:1,testBC:{x:null,y:null},levels:[{index:0,procent:.2,color:"rgba(153,0,0,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:1,procent:.3,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:2,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:3,procent:.7,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:4,procent:.8,color:"rgba(153,22,123,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:5,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,title:"projWord",threePin:{x:void 0,y:void 0},ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],isShowSection:!0,isShowText:!1,typeShowLevels:"full",isShowProcent:!1,leftText:!0,rigthText:!0}}},vyt=myt,yyt=Object(C["a"])(vyt,avt,cvt,!1,null,null,null),Cyt=yyt.exports,byt={name:"ChanelsOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t,e=this,i=[{index:0,procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:.2,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:.3,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:4,procent:.7,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:5,procent:.9,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection&&(this.levels=(t=this.levels).concat.apply(t,i)),Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var o=this.clonnedInitSettings(this.sett.data);this.addToContext(o),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),o&&o.id&&(this.idCurrentOverlay="".concat(o.id),this.countBarsSecondPin=+"".concat(o.countBarsSecondPin),this.countBarsFerstPin=+"".concat(o.countBarsFerstPin),this.changeDpos=!1),o&&o.copy&&setTimeout((function(){return e.saveNewPosition()}),100)},watch:{isShowProection:function(){var t=[{procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{procent:.2,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{procent:.3,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{procent:.7,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{procent:.9,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection?this.levels=[].concat(t,Object(x["a"])(this.levels)):this.levels=this.levels.filter((function(e){if(!t.find((function(t){return t.procent===e.procent})))return e}))}},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ChanelsOverlay"]},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"ParallelChannels",nameIconTitle:"new-chanels-fibonacci",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.lineWidth,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowLabelsLevels,controllerCheckBox:function(t){i.isShowLabelsLevels=t},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Right",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:2,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!1,value:this.levels,fast:!1}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash([]);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=e,this.ferstPin.y=i}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}if(this.changeDpos){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var a=this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,c=this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2;return this.needPsevdoOne=this.revert?-1:1,void this.getWidth(a,c,this.$props.layout.t2screen(s),this.$props.layout.$2screen(r))}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},getWidth:function(t,e,i,o){var n=-1,s=i-t,r=o-e,a=Math.sqrt(s*s+r*r);return this.widthCD=a*this.needPsevdoOne,a*n},drawSection:function(t,e,i,o,n,s,r,a,c,l){l&&(t.beginPath(),t.lineWidth=this.lineWidth,t.strokeStyle=a||this.colorLine,t.setLineDash(c||[]),t.moveTo(e,i),t.lineTo(o,i),t.stroke(),t.setLineDash([]),this.isShowSection&&(t.beginPath(),t.setLineDash([]),t.fillStyle=r,t.strokeStyle="rgba(255,255,255,0)",t.moveTo(e,i),t.lineTo(o,i),t.lineTo(o,n),t.lineTo(e,n),t.closePath(),t.fill()),this.isShowText&&(this.leftText&&this.fillTextDraw(t,s,e,i,a),this.rigthText&&this.fillTextDrawRight(t,s,o+10,i,a)))},fillTextDraw:function(t,e,i,o,n){if(this.isShowText){t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial";var s=t.measureText(e).width+10;t.fillText(e,i-s,o+3),t.fill()}},fillTextDrawRight:function(t,e,i,o,n){this.isShowText&&(t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial",t.fillText(e,i,o+3),t.fill())},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=this,u=o-e,d=n-i,h=Math.atan2(d,u),p=(Math.PI,Math.sin(h)),g=Math.cos(h),f=(this.mouse.x,this.mouse.y,(e-this.mouse.x)*p-(i-this.mouse.y)*g);this.revert=f>0;var m=Math.sqrt(u*u+d*d),v=this.levels;t.save(),t.translate(e,i),t.rotate(h),t.beginPath(),t.strokeStyle="rgba(255,255,255,0)",t.lineWidth=.5,t.moveTo(0,0),t.lineTo(m,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(m-r,-s),t.lineTo(m,0),t.lineTo(m-r,s)),t.stroke();var y=.5*m,C=-1*this.widthCD,b=y*g-C*p,S=y*p+C*g;this.$props.layout.t2screen(this.ferstPin.x),this.mouse.x,this.$props.layout.$2screen(this.ferstPin.y),this.mouse.y;this.testNew={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+b),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+S)},this.levels.forEach((function(e,i){var o=v[i+1]?v[i+1].procent:-l.widthCD*e.procent;l.drawSection(t,0,-l.widthCD*e.procent,m,o,e.procent,e.color,e.colorLine,e.type,e.isShow)})),t.beginPath(),t.lineWidth=.5,t.setLineDash([5,15]),t.moveTo(.5*m,0),t.lineTo(.5*m,-this.widthCD),t.stroke(),t.setLineDash([]),this.drawCirlce(t,.5*m,-this.widthCD),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.changeDpos&&(this.saveNewPosition(),this.changeDpos=!1),this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var t=this.getTimeCandle(this.$props.layout.screen2t(event.layerX).toFixed(0)),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1,this.secondPin.x=t,this.secondPin.y=e,this.counterClick++,this.openModal(null,event),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){var o=this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,n=this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2;if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.testNew.x),this.$props.layout.$2screen(this.testNew.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeDpos=!0));if(this.hover(t.layerX,t.layerY,o,n))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeDpos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=s,this.ferstPin.y=r,this.counterClick++,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var a=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),c=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=a,this.secondPin.y=c,this.counterClick++,this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{levels:[{index:0,procent:0,color:"rgba(153,153,153,0.18)",colorLine:"rgba(101,142,232,1)",dash:[],isShow:!0},{index:1,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(101,142,232,1)",dash:[],isShow:!0}],title:"parChWord",colorTradeLine:"rgba(24, 36, 64, 0.7)",widthTradeLine:1,dashTradeLine:[10,10],revert:void 0,isStaticWidth:!0,isShowProection:!1,isShowText:!1,isShowSection:!1,isShowLabelsLevels:!1,changeDpos:!1,counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,typeShowLevels:"all",leftText:!0,rigthText:!0,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,widthCD:0}}},Syt=byt,Pyt=Object(C["a"])(Syt,lvt,uvt,!1,null,null,null),Tyt=Pyt.exports,xyt={name:"Forecast",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["Forecast"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"CurveLine",nameIconTitle:"new-forecast-line",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Lines",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"ShowPriceRange",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:2,name:"ShowPriceRangeBars",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:3,name:"ShowAngle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowAngle,controllerCheckBox:function(t){i.isShowAngle=t.value},settings:[]},{index:4,name:"AlwaysShowValues",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowValues,controllerCheckBox:function(t){i.isShowValues=t.value},settings:[]},{index:5,name:"AlwaysShowTheMiddle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isMidlePin,controllerCheckBox:function(t){i.isMidlePin=t.value},settings:[]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,this.typeStart,this.typeEnd),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),this.change&&!this.isShowValues?this.ferstPin.x&&this.secondPin.y&&(this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)),this.drawInitBox(t,this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x))):this.isShowValues&&this.ferstPin.x&&this.secondPin.y&&(this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)),this.drawInitBox(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y))),this.testNew&&this.testNew.x&&this.drawCirlce(t,this.testNew.x,this.testNew.y)}},drawInitBox:function(t,e,i){var o=new Date(this.ferstPin.x).toLocaleString("ru-RU");this.secondPin.ythis.ferstPin.x?e=e-t.measureText(o).width+5:e+=5,t.fillStyle=this.colorLine,t.fillText("".concat(o),e,i),t.fill()},drawValueBox:function(t,e,i,o,n){var s=this.symbol,r=this.getContracts.find((function(t){return t.name===s})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=[this.isShowPriceB,this.isShowBars,this.isShowAngle,this.showOffsetDate],d=0;u.forEach((function(t){t&&(d+=14)}));var h=Cmt("trunc",c,a),p=h/this.ferstPin.y*100,g=Cmt("trunc",p,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var f=0;this.isShowPriceB&&(f=t.measureText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l)).width+28),this.isShowBars&&!this.isShowPriceB&&(f=t.measureText("".concat(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)," bars")).width+28),this.isShowBars||this.isShowPriceB||!this.isShowAngle||(f=t.measureText("".concat(Math.abs(this.angle),"°")).width+28);var m={x:void 0,y:void 0},v={x:void 0,y:void 0},y={x:void 0,y:void 0},C={x:void 0,y:void 0};if(ni+d+8?(m.y=i+.03*i-d+8,v.y=m.y,y.y=m.y+d+8,C.y=y.y):(m.y=i+.03*i,v.y=m.y,y.y=m.y+d+8,C.y=y.y),t.moveTo(m.x,m.y),t.lineTo(v.x,v.y),t.lineTo(y.x,y.y),t.lineTo(C.x,C.y),t.closePath(),t.stroke(),t.beginPath(),this.isShowAngle&&(this.angle<0&&(this.angle=+this.angle+360),t.fillText(Math.abs(this.angle)+"°",m.x+14,m.y+d),d-=14),this.isShowBars&&(t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",m.x+14,m.y+d),d-=14),this.isShowPriceB&&(t.fillText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l),m.x+14,m.y+d),d-=14,t.fill()),this.showOffsetDate){var b=(this.secondPin.x-this.ferstPin.x)/36e5;b>24?b="".concat((b/24).toFixed(0),"д ").concat(b%24,"ч"):b+="ч",t.fillText("".concat(b),m.x+14,m.y+d),d-=14,t.fill()}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]||!this.arrCnd[t]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else this.arrCnd[t]&&(e=this.arrCnd[t][0]);return e},changePosition1:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}this.mousedownOnLine&&this.changePosition1(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l);this.angle=(57.2958*d).toFixed(0),+(57.2958*d*-1).toFixed(0)<0?this.angle=+(57.2958*d*-1).toFixed(0)+360:this.angle=+(57.2958*d*-1).toFixed(0);var h=this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x),p=this.angle%90/89,g=Math.sqrt(l*l+u*u),f=0,m=0;this.angle>=0&&this.angle<90?(f=g*p,m=g*p,Math.abs(m)>=h&&(m=h-.5*h)):this.angle>=90&&this.angle<180?this.angle>=90&&this.angle<135?(f=g*p,m=g*p*-1):(f=g*p,m=-1*(g-g*p)):this.angle>=180&&this.angle<270?(f=g*p,m=g*p,Math.abs(m)>=Math.abs(h)&&(m=Math.abs(h)-.5*Math.abs(h))):this.angle>=270&&this.angle<=360&&(this.angle>=270&&this.angle<315?(f=g*p,m=g*p*-1):(f=g*p,m=-1*(g-g*p)));var v={x:0,y:0},y={x:g,y:0},C={x:f,y:m},b={x:((v.x+C.x)/2+(y.x+C.x)/2)/2,y:((v.y+C.y)/2+(y.y+C.y)/2)/2},S=Math.atan2(C.y-v.y,C.x-v.x);t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(v.x,v.y),t.quadraticCurveTo(C.x,C.y,y.x,y.y),t.stroke(),this.isMidlePin&&this.drawCirlce(t,b.x,b.y),t.stroke(),t.strokeStyle=this.colorLine,"larrow"===a?(t.rotate(S),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s),t.stroke(),t.rotate(-S)):"strokesqarrow"===a?(t.rotate(S),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-10,5),t.lineTo(-10,-5),t.lineTo(0,-5),t.closePath(),t.stroke(),t.rotate(-S)):"strokecrclarrow"===a?(t.rotate(S),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(-5,0,5,0,2*Math.PI,!0),t.stroke(),t.rotate(-S)):"fillsqarrow"===a?(t.rotate(S),t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-5,5),t.lineTo(-5,-5),t.lineTo(0,-5),t.closePath(),t.fill(),t.rotate(-S)):"whatarrow"===a&&(t.rotate(S),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-5,-5),t.lineTo(0,0),t.lineTo(-5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-7-this.lineWidth,-5),t.lineTo(-2-this.lineWidth,0),t.lineTo(-7-this.lineWidth,5),t.stroke(),t.rotate(-S)),this.drawEndArrow(t,y,C,g,r,s,S,c),t.setTransform(1,0,0,1,0,0),t.restore()},drawEndArrow:function(t,e,i,o,n,s,r,a){o=0;var c=e.x-i.x,l=e.y-i.y,u=Math.atan2(l,c),d=r+3.141590000682;t.save(),t.translate(e.x,e.y),t.rotate(u),"new-arrow-mid"===a?(t.beginPath(),t.moveTo(o-n,-s),t.lineTo(o,0),t.lineTo(o-n,s),t.stroke()):"strokesqarrow"===a?(t.rotate(d),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(o,0),t.lineTo(o,5),t.lineTo(o+10,5),t.lineTo(o+10,-5),t.lineTo(o,-5),t.closePath(),t.stroke(),t.rotate(-d)):"strokecrclarrow"===a?(t.rotate(d),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(o+5,0,5,0,2*Math.PI,!0),t.stroke(),t.rotate(-d)):"fillsqarrow"===a?(t.rotate(d),t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(o,0),t.lineTo(o,5),t.lineTo(o+5,5),t.lineTo(o+5,-5),t.lineTo(o,-5),t.closePath(),t.fill(),t.rotate(-d)):"whatarrow"===a&&(t.rotate(d),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(o+5,-5),t.lineTo(o,0),t.lineTo(o+5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(o+7+this.lineWidth,-5),t.lineTo(o+2+this.lineWidth,0),t.lineTo(o+7+this.lineWidth,5),t.stroke(),t.rotate(-d)),t.setTransform(1,0,0,1,0,0),t.restore()},drawLimitRect:function(t,e,i){t.beginPath(),t.strokeStyle="red",t.lineWidth=1,t.moveTo(-e,-e),t.lineTo(e,-e),t.lineTo(e,e),t.lineTo(-e,e),t.closePath(),t.stroke(),t.beginPath(),t.strokeStyle="green",t.lineWidth=.5,t.setLineDash([5,5]),t.moveTo(-e,0),t.lineTo(e,0),t.stroke(),t.fillStyle="green",t.fillText("x",-e-10,0),t.beginPath(),t.strokeStyle="blue",t.lineWidth=.5,t.setLineDash([5,5]),t.moveTo(0,-e),t.lineTo(0,e),t.stroke(),t.fillStyle="blue",t.fillText("y",0,-e-10),t.setLineDash([]),this.drawCirlce(t,-e,-e),this.drawCirlce(t,e,-e),this.drawCirlce(t,e,e),this.drawCirlce(t,-e,e),this.drawCirlce(t,i.x,i.y),t.fillStyle="blue",t.fillText("".concat(i.x+" "+i.y),0,i.x,i.y)},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.ferstPinBars=this.$props.layout.screen2t(t.layerX),this.counterClick++,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{showOffsetDate:!0,isShowPriceB:!1,isShowBars:!0,isShowAngle:!0,isShowValues:!0,isMidlePin:!0,typeEnd:"none",typeStart:"none",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,title:"forcWord",ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"rgba(101,142,232,1)",typeLine:[],lineWidth:1}}},Oyt=xyt,wyt=Object(C["a"])(Oyt,dvt,hvt,!1,null,null,null),_yt=wyt.exports,Ayt={name:"CurveLine",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CurveLine"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),t.P3.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.P3.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Forecast",nameIconTitle:"new-arrow-arc",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"ShowPriceRange",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:2,name:"ShowPriceRangeBars",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:3,name:"ShowAngle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowAngle,controllerCheckBox:function(t){i.isShowAngle=t.value},settings:[]},{index:4,name:"AlwaysShowValues",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowValues,controllerCheckBox:function(t){i.isShowValues=t.value},settings:[]},{index:5,name:"AlwaysShowTheMiddle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isMidlePin,controllerCheckBox:function(t){i.isMidlePin=t.value},settings:[]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,{x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:e,y:i},this.P3,5,8,this.typeStart,this.typeEnd),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),this.change&&!this.isShowValues?this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)):this.isShowValues&&this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)),this.testNew&&this.testNew.x&&this.drawCirlce(t,this.testNew.x,this.testNew.y)}},drawValueBox:function(t,e,i,o,n){var s=this.symbol,r=this.getContracts.find((function(t){return t.name===s})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=[this.isShowPriceB,this.isShowBars,this.isShowAngle],d=0;u.forEach((function(t){t&&(d+=14)}));var h=Cmt("trunc",c,a),p=h/this.ferstPin.y*100,g=Cmt("trunc",p,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var f=0;this.isShowPriceB&&(f=t.measureText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l)).width+28),this.isShowBars&&!this.isShowPriceB&&(f=t.measureText("".concat(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)," bars")).width+28),this.isShowBars||this.isShowPriceB||!this.isShowAngle||(f=t.measureText("".concat(Math.abs(this.angle),"°")).width+28);var m={x:void 0,y:void 0},v={x:void 0,y:void 0},y={x:void 0,y:void 0},C={x:void 0,y:void 0};ni+d+8?(m.y=i+.03*i-d+8,v.y=m.y,y.y=m.y+d+8,C.y=y.y):(m.y=i+.03*i,v.y=m.y,y.y=m.y+d+8,C.y=y.y),t.moveTo(m.x,m.y),t.lineTo(v.x,v.y),t.lineTo(y.x,y.y),t.lineTo(C.x,C.y),t.closePath(),t.stroke(),t.beginPath(),this.isShowAngle&&(this.angle<0&&(this.angle=+this.angle+360),t.fillText(Math.abs(this.angle)+"°",m.x+14,m.y+d),d-=14),this.isShowBars&&(t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",m.x+14,m.y+d),d-=14),this.isShowPriceB&&(t.fillText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l),m.x+14,m.y+d),d-=14,t.fill())},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition1:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeControlPin){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.P3.x=s,void(this.P3.y=r)}this.mousedownOnLine&&this.changePosition1(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a){o&&o.x&&(o={x:this.$props.layout.t2screen(o.x),y:this.$props.layout.$2screen(o.y)});var c=i.x-e.x,l=i.y-e.y,u=Math.atan2(l,c);Math.sin(u),Math.cos(u);this.angle=(57.2958*u).toFixed(0),+(57.2958*u*-1).toFixed(0)<0?this.angle=+(57.2958*u*-1).toFixed(0)+360:this.angle=+(57.2958*u*-1).toFixed(0);var d=Math.sqrt(c*c+l*l),h={x:e.x+(i.x-e.x)/Math.sqrt(Math.abs(e.x-i.x))*3+.2*d,y:i.y+.2*i.y};if(o&&o.x&&this.secondPin&&this.secondPin.x){var p=2*o.x-.5*e.x-.5*i.x,g=2*o.y-.5*e.y-.5*i.y;h.x=p,h.y=g}Math.atan2(h.y-e.y,h.x-e.x);t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(h.x,h.y,i.x,i.y),t.stroke(),t.strokeStyle=this.colorLine,this.drawEndArrow(t,i,h,s,n,a),this.drawEndArrow(t,e,h,s,n,r),this.drawLimitRect(e,i,h),this.P3.x&&this.drawCirlce(t,this.$props.layout.t2screen(this.P3.x),this.$props.layout.$2screen(this.P3.y))},drawEndArrow:function(t,e,i,o,n,s){var r=e.x-i.x,a=e.y-i.y,c=Math.atan2(a,r);t.save(),t.translate(e.x,e.y),t.rotate(c),"new-arrow-mid"===s||"larrow"===s?(t.beginPath(),t.moveTo(0-o,-n),t.lineTo(0,0),t.lineTo(0-o,n),t.stroke()):"strokesqarrow"===s?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(10,5),t.lineTo(10,-5),t.lineTo(0,-5),t.closePath(),t.stroke()):"strokecrclarrow"===s?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===s?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(5,5),t.lineTo(5,-5),t.lineTo(0,-5),t.closePath(),t.fill()):"whatarrow"===s&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(5,-5),t.lineTo(0,0),t.lineTo(5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(7+this.lineWidth,-5),t.lineTo(2+this.lineWidth,0),t.lineTo(7+this.lineWidth,5),t.stroke()),t.setTransform(1,0,0,1,0,0),t.restore()},drawLimitRect:function(t,e,i){(!this.P3||!this.P3.x&&this.secondPin&&this.secondPin.x)&&(this.P3={x:this.getTimeCandle(this.$props.layout.screen2t(((t.x+i.x)/2+(e.x+i.x)/2)/2).toFixed(0)),y:this.$props.layout.screen2$(((t.y+i.y)/2+(e.y+i.y)/2)/2)})},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeControlPin&&(this.changeControlPin=!1,this.saveNewPosition()),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.P3&&this.P3.x&&this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.P3.x),this.$props.layout.$2screen(this.P3.y))&&(this.changeControlPin=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})),this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.ferstPinBars=this.$props.layout.screen2t(t.layerX),this.counterClick++,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{P3:{x:void 0,y:void 0},isShowPriceB:!1,isShowBars:!0,isShowAngle:!0,title:"curArrWord",isShowValues:!1,midlePin:!0,typeEnd:"none",typeStart:"none",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"rgba(101,142,232,1)",typeLine:[],lineWidth:1}}},Dyt=Ayt,kyt=Object(C["a"])(Dyt,pvt,gvt,!1,null,null,null),Iyt=kyt.exports,Byt={name:"CurveLineWithData",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CurveLineWithData"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),t.P3.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.P3.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"CurveLineWithData",nameIconTitle:"new-arrowwithinfo-arc",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Lines",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"ShowPriceRange",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:2,name:"ShowPriceRangeBars",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:3,name:"ShowAngle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowAngle,controllerCheckBox:function(t){i.isShowAngle=t.value},settings:[]},{index:4,name:"AlwaysShowValues",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowValues,controllerCheckBox:function(t){i.isShowValues=t.value},settings:[]},{index:5,name:"AlwaysShowTheMiddle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isMidlePin,controllerCheckBox:function(t){i.isMidlePin=t.value},settings:[]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,{x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:e,y:i},this.P3,5,8,this.typeStart,this.typeEnd),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),this.change&&!this.isShowValues?this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)):this.isShowValues&&this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)),this.testNew&&this.testNew.x&&this.drawCirlce(t,this.testNew.x,this.testNew.y)}},drawValueBox:function(t,e,i,o,n){var s=this.symbol,r=this.getContracts.find((function(t){return t.name===s})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=[this.isShowPriceB,this.isShowBars,this.isShowAngle],d=0;u.forEach((function(t){t&&(d+=14)}));var h=Cmt("trunc",c,a),p=h/this.ferstPin.y*100,g=Cmt("trunc",p,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var f=0;this.isShowPriceB&&(f=t.measureText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l)).width+28),this.isShowBars&&!this.isShowPriceB&&(f=t.measureText("".concat(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)," bars")).width+28),this.isShowBars||this.isShowPriceB||!this.isShowAngle||(f=t.measureText("".concat(Math.abs(this.angle),"°")).width+28);var m={x:void 0,y:void 0},v={x:void 0,y:void 0},y={x:void 0,y:void 0},C={x:void 0,y:void 0};ni+d+8?(m.y=i+.03*i-d+8,v.y=m.y,y.y=m.y+d+8,C.y=y.y):(m.y=i+.03*i,v.y=m.y,y.y=m.y+d+8,C.y=y.y),t.moveTo(m.x,m.y),t.lineTo(v.x,v.y),t.lineTo(y.x,y.y),t.lineTo(C.x,C.y),t.closePath(),t.stroke(),t.beginPath(),this.isShowAngle&&(this.angle<0&&(this.angle=+this.angle+360),t.fillText(Math.abs(this.angle)+"°",m.x+14,m.y+d),d-=14),this.isShowBars&&(t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",m.x+14,m.y+d),d-=14),this.isShowPriceB&&(t.fillText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l),m.x+14,m.y+d),d-=14,t.fill())},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition1:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeControlPin){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.P3.x=s,void(this.P3.y=r)}this.mousedownOnLine&&this.changePosition1(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a){o&&o.x&&(o={x:this.$props.layout.t2screen(o.x),y:this.$props.layout.$2screen(o.y)});var c=i.x-e.x,l=i.y-e.y,u=Math.atan2(l,c);Math.sin(u),Math.cos(u);this.angle=(57.2958*u).toFixed(0),+(57.2958*u*-1).toFixed(0)<0?this.angle=+(57.2958*u*-1).toFixed(0)+360:this.angle=+(57.2958*u*-1).toFixed(0);var d=Math.sqrt(c*c+l*l),h={x:e.x+(i.x-e.x)/Math.sqrt(Math.abs(e.x-i.x))*3+.2*d,y:i.y+.2*i.y};if(o&&o.x&&this.secondPin&&this.secondPin.x){var p=2*o.x-.5*e.x-.5*i.x,g=2*o.y-.5*e.y-.5*i.y;h.x=p,h.y=g}Math.atan2(h.y-e.y,h.x-e.x);t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(h.x,h.y,i.x,i.y),t.stroke(),t.strokeStyle=this.colorLine,this.drawEndArrow(t,i,h,s,n,a),this.drawEndArrow(t,e,h,s,n,r),this.drawLimitRect(e,i,h),this.P3.x&&this.drawCirlce(t,this.$props.layout.t2screen(this.P3.x),this.$props.layout.$2screen(this.P3.y))},drawEndArrow:function(t,e,i,o,n,s){var r=e.x-i.x,a=e.y-i.y,c=Math.atan2(a,r);t.save(),t.translate(e.x,e.y),t.rotate(c),"new-arrow-mid"===s||"larrow"===s?(t.beginPath(),t.moveTo(0-o,-n),t.lineTo(0,0),t.lineTo(0-o,n),t.stroke()):"strokesqarrow"===s?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(10,5),t.lineTo(10,-5),t.lineTo(0,-5),t.closePath(),t.stroke()):"strokecrclarrow"===s?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===s?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(5,5),t.lineTo(5,-5),t.lineTo(0,-5),t.closePath(),t.fill()):"whatarrow"===s&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(5,-5),t.lineTo(0,0),t.lineTo(5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(7+this.lineWidth,-5),t.lineTo(2+this.lineWidth,0),t.lineTo(7+this.lineWidth,5),t.stroke()),t.setTransform(1,0,0,1,0,0),t.restore()},drawLimitRect:function(t,e,i){(!this.P3||!this.P3.x&&this.secondPin&&this.secondPin.x)&&(this.P3={x:this.getTimeCandle(this.$props.layout.screen2t(((t.x+i.x)/2+(e.x+i.x)/2)/2).toFixed(0)),y:this.$props.layout.screen2$(((t.y+i.y)/2+(e.y+i.y)/2)/2)})},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeControlPin&&(this.changeControlPin=!1,this.saveNewPosition()),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.P3&&this.P3.x&&this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.P3.x),this.$props.layout.$2screen(this.P3.y))&&(this.changeControlPin=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})),this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.ferstPinBars=this.$props.layout.screen2t(t.layerX),this.counterClick++,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{P3:{x:void 0,y:void 0},isShowPriceB:!0,isShowBars:!0,isShowAngle:!0,isShowValues:!0,title:"curArrWord",midlePin:!0,typeEnd:"none",typeStart:"none",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"rgba(101,142,232,1)",typeLine:[],lineWidth:1}}},Myt=Byt,$yt=Object(C["a"])(Myt,fvt,mvt,!1,null,null,null),Lyt=$yt.exports,Fyt={name:"LineRuler",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["LineRuler"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},drawPriceBox:function(t,e,i,o,n){var s=this.symbol,r=this.getContracts.find((function(t){return t.name===s})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=Cmt("trunc",c,a),d=u/this.ferstPin.y*100,h=Cmt("trunc",d,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var p=t.measureText(""+u).width+28,g={x:void 0,y:void 0},f={x:void 0,y:void 0},m={x:void 0,y:void 0},v={x:void 0,y:void 0};ni+50?(g.y=i-50,f.y=g.y,m.y=g.y+50,v.y=m.y):(g.y=i,f.y=g.y,m.y=g.y+50,v.y=m.y),t.moveTo(g.x,g.y),t.lineTo(f.x,f.y),t.lineTo(m.x,m.y),t.lineTo(v.x,v.y),t.closePath(),t.stroke(),t.beginPath(),t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",g.x+14,g.y+14),t.fillText(l+" pips",g.x+14,g.y+28),t.fillText(h+"%",g.x+14,g.y+42),t.fill()},drawDateAndPrice:function(t,e,i,o,n){if(this.arrCnd&&Array.isArray(this.arrCnd)){var s=this.symbol;t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var r=-1*this.getContracts.find((function(t){return t.name===s})).precision,a=this.$props.layout.screen2t(e).toFixed(0)-1>this.arrCnd.length?this.getTimeCandle(this.$props.layout.screen2t(e).toFixed(0)):this.arrCnd[Math.round(this.$props.layout.screen2t(e).toFixed(0))][0],c=this.$props.layout.screen2t(o).toFixed(0)-1>this.arrCnd.length?this.getTimeCandle(this.$props.layout.screen2t(o).toFixed(0)):this.arrCnd[Math.round(this.$props.layout.screen2t(o))][0],l="".concat(new Date(a).toLocaleDateString("ru")," ").concat(new Date(a).toISOString().substr(11,8)," ").concat(Cmt("trunc",this.$props.layout.screen2$(i),r)),u="".concat(new Date(a).toLocaleDateString("ru")," ").concat(new Date(c).toISOString().substr(11,8)," ").concat(Cmt("trunc",this.$props.layout.screen2$(n),r)),d=t.measureText(l).width+28,h={x:void 0,y:void 0},p={x:void 0,y:void 0},g={x:void 0,y:void 0},f={x:void 0,y:void 0};o>e+d?(h.x=e-d,p.x=h.x+d,g.x=p.x,f.x=h.x):(h.x=e,p.x=h.x+d,g.x=h.x+d,f.x=h.x),n>i+36?(h.y=i-36,p.y=h.y,g.y=h.y+36,f.y=g.y):(h.y=i,p.y=h.y,g.y=h.y+36,f.y=g.y),t.moveTo(h.x,h.y),t.lineTo(p.x,p.y),t.lineTo(g.x,g.y),t.lineTo(f.x,f.y),t.closePath(),t.stroke(),t.beginPath(),t.fillText(l,h.x+14,h.y+14),t.fillText(u,h.x+14,h.y+28),t.fill()}},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Ruler",nameIconTitle:"newLineRuler",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&(this.drawDateAndPrice(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.drawPriceBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)),this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l),h=Math.sqrt(l*l+u*u);t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var t=this.getTimeCandle(this.$props.layout.screen2t(event.layerX).toFixed(0)),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1,this.secondPin.x=t,this.secondPin.y=e,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(event.layerX).toFixed(0),this.openModal(null,event),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getContracts:"contracts/getContracts",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,title:"rulerWord",mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1}}},jyt=Fyt,Ryt=Object(C["a"])(jyt,vvt,yvt,!1,null,null,null),Wyt=Ryt.exports,Nyt={name:"RayOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["RayOverlay"]},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"BiDirectionalBeam",nameIconTitle:"new-trands-ray",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.change=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeFirstPos=!0);if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeSecPos=!0);if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,this.counterClick++,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,this.counterClick++,this.saveNewPosition(),this.openModal(null,t)}},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l),h=Math.sqrt(l*l+u*u)+1e4;t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(-9999,0),t.lineTo(h,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,typeLine:[],mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",lineWidth:2,title:"biDiDeam"}}},Eyt=Nyt,Uyt=Object(C["a"])(Eyt,Cvt,bvt,!1,null,null,null),Vyt=Uyt.exports,Hyt={name:"OnePinRay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["OnePinRay"]},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"UnidirectionalBeam",nameIconTitle:"new-trands-oneray",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",color:function(){return i.colorLine},value:this.colorLine,fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.change=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},init:function(){},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeFirstPos=!0);if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeSecPos=!0);if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.counterClick++}else if(2===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,this.counterClick++,this.saveNewPosition(),this.openModal(null,t)}},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l),h=Math.sqrt(l*l+u*u)+1e4;t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,typeLine:[],title:"chartTradingLeftBarMenuSettingTrendLinesList2",mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",lineWidth:2}}},Gyt=Hyt,qyt=Object(C["a"])(Gyt,Svt,Pvt,!1,null,null,null),zyt=qyt.exports,Yyt={name:"LineDoubleArrow",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["LineDoubleArrow"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"DoubleArrow",nameIconTitle:"new-doublearrow",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!0,!0),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l),h=Math.sqrt(l*l+u*u);t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var t=this.getTimeCandle(this.$props.layout.screen2t(event.layerX).toFixed(0)),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1,this.secondPin.x=t,this.secondPin.y=e,this.counterClick++,this.openModal(null,event),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.counterClick++,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],title:"arrowWord",lineWidth:2}}},Xyt=Yyt,Qyt=Object(C["a"])(Xyt,Tvt,xvt,!1,null,null,null),Jyt=Qyt.exports,Kyt={name:"TrajectoryOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.isSetPins=!1),e&&e.copy&&(setTimeout((function(){return t.saveNewPosition()}),100),this.isSetPins=!1)},methods:{addInstrumentToChart:function(){this.listPins.length>0||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["TrajectoryOverlay"]},createObjectForSaveOrCopy:function(){var t=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:t,symbol:this.symbol,groupId:this.groupId});return Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),i},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},copyOverlay:function(){var t=this,e=this.createObjectForSaveOrCopy();e.groupId=this.sett.groupId,e.listPins=e.listPins.map((function(e){return e.y=t.$props.layout.screen2$(t.$props.layout.$2screen(e.y)+15),e})),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:e}),this.saveNewPosition()},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",nameIconTitle:"new-trajectory",title:"Траектория",id:this.idCurrentOverlay,idProps:this.$props.id,setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,typeModal:t,listSections:[{index:0,name:"Линии",startCheckBox:!1,settings:[{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"Цвет понижения",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"downColor",value:this.downColor,color:function(){return i.downColor},fast:!0}]},{index:2,name:"Цвет повышения",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"upColor",color:function(){return i.upColor},value:this.upColor,fast:!0}]},{index:3,name:"Показать диапозон цен",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:4,name:"Отоброжать диапозон цен в барах",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:5,name:"Отображать линии траектории",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowLines,controllerCheckBox:function(t){i.isShowLines=t.value},settings:[]},{index:6,name:"Показать пункты",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPips,controllerCheckBox:function(t){i.isShowPips=t.value},settings:[]},{index:7,name:"Показать проценты",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowProcentB,controllerCheckBox:function(t){i.isShowProcentB=t.value},settings:[]}]}}})},drawText:function(t,e,i){t.fillStyle=this.colorLine;var o=[this.isShowPriceB,this.isShowBars,this.isShowPips,this.isShowProcentB],n=o.reduce((function(t,e){return e&&(t+=14),t}),0),s=i.y0?-1:1;this.listPins[e+1]&&(this.isShowPips&&this.listPins[e+1].pips&&(t.fillText("".concat(this.listPins[e+1].pips," pips"),this.$props.layout.t2screen(this.listPins[e+1].x),this.$props.layout.$2screen(this.listPins[e+1].y)+s),s+=14*r),this.isShowBars&&this.listPins[e+1].bars&&(t.fillText("".concat(Math.abs(this.listPins[e+1].bars)," bars"),this.$props.layout.t2screen(this.listPins[e+1].x),this.$props.layout.$2screen(this.listPins[e+1].y)+s),s+=14*r),this.isShowProcentB&&this.listPins[e+1].procent&&(t.fillText("".concat(this.listPins[e+1].procent,"%"),this.$props.layout.t2screen(this.listPins[e+1].x),this.$props.layout.$2screen(this.listPins[e+1].y)+s),s+=14*r),this.isShowPriceB&&this.listPins[e+1].price&&(t.fillText("".concat(this.listPins[e+1].price),this.$props.layout.t2screen(this.listPins[e+1].x),this.$props.layout.$2screen(this.listPins[e+1].y)+s),s+=14*r))},drawTextEndStart:function(t,e,i){if(i&&i.x&&i.y){var o=this.symbol,n=0;i&&i.color&&(t.fillStyle=i.color),n=this.listPins[e+1]?this.listPins[e+1].y>i.y?20:-20:this.listPins[e-1]e.$props.layout.$2screen(e.listPins[o-1].y)&&(e.listPins[o-1].color=e.downColor),e.$props.layout.$2screen(i.y)===e.$props.layout.$2screen(e.listPins[o-1].y)&&(e.listPins[o-1].color=e.listPins[o-2].color?e.listPins[o-1].color:e.upColor)),e.listPins[o+1]&&(0===o?(e.isShowLines&&e.drawLineWithArrows(t,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y),e.$props.layout.t2screen(e.listPins[o+1].x),e.$props.layout.$2screen(e.listPins[o+1].y),5,8,e.typeStart,"none",e.colorLine,e.lineWidth,e.typeLine,i,e.listPins[o-1]),e.drawText(t,o,i)):o===e.listPins.length-2?e.isShowLines&&e.drawLineWithArrows(t,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y),e.$props.layout.t2screen(e.listPins[o+1].x),e.$props.layout.$2screen(e.listPins[o+1].y),5,8,"none",e.typeEnd,e.colorLine,e.lineWidth,e.typeLine,i,e.listPins[o-1]):(e.isShowLines&&e.drawLineWithArrows(t,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y),e.$props.layout.t2screen(e.listPins[o+1].x),e.$props.layout.$2screen(e.listPins[o+1].y),5,8,"none","none",e.colorLine,e.lineWidth,e.typeLine,i,e.listPins[o-1]),e.drawText(t,o,i)),e.drawCirlce(t,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y)))})),this.isSetPins||this.drawCirlce(t,this.$props.layout.t2screen(this.listPins[this.listPins.length-1].x),this.$props.layout.$2screen(this.listPins[this.listPins.length-1].y)),this.isSetPins&&this.listPins[0]&&(this.drawCirlce(t,this.$props.layout.t2screen(this.listPins[this.listPins.length-1].x),this.$props.layout.$2screen(this.listPins[this.listPins.length-1].y)),this.drawLineWithArrows(t,this.$props.layout.t2screen(this.listPins[this.listPins.length-1].x),this.$props.layout.$2screen(this.listPins[this.listPins.length-1].y),this.mouse.x,this.mouse.y,5,8,"none","none",this.colorLine,this.lineWidth,this.typeLine,{color:this.$props.layout.$2screen(this.listPins[this.listPins.length-1].y)this.$props.sub[this.$props.sub.length-1][0]||!this.arrCnd[t][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition:function(t,e){if(this.testible)this.mouse.x1,this.mouse.y2},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePin)if(this.changePin.index>0){var e=this.symbol,i=this.getContracts.find((function(t){return t.name===e})).precision-1,o=-1*this.getContracts.find((function(t){return t.name===e})).precision,n=this.$props.layout.screen2$(t.layerY)-this.listPins[this.listPins.length-1].y,s=Cmt("trunc",n*Ph(i),-1),r=Cmt("trunc",n,o),a=r/this.listPins[this.listPins.length-1].y*100,c=Cmt("trunc",a,-4);this.listPins[this.changePin.index]={x:this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),y:this.$props.layout.screen2$(t.layerY),xBar:this.$props.layout.screen2t(t.layerX).toFixed(0),bars:this.listPins[this.listPins.length-1].xBar-this.$props.layout.screen2t(t.layerX).toFixed(0),price:(+this.$props.layout.screen2$(t.layerY)).toFixed(i),procent:c,pips:s}}else this.listPins[this.changePin.index].x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),this.listPins[this.changePin.index].y=this.$props.layout.screen2$(t.layerY)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c,l,u,d,h){l=h.color;var p=o-e,g=n-i,f=Math.atan2(g,p);this.angle=(57.2958*f).toFixed(0);var m=Math.sqrt(p*p+g*g);t.beginPath(),t.save(),t.lineWidth=u,t.strokeStyle=l,t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0,0),t.lineTo(m,0),Array.isArray(d)&&t.setLineDash(d),t.stroke(),"larrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s),t.stroke()):"strokesqarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-10,5),t.lineTo(-10,-5),t.lineTo(0,-5),t.closePath(),t.stroke()):"strokecrclarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(-5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===a?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-5,5),t.lineTo(-5,-5),t.lineTo(0,-5),t.closePath(),t.fill()):"whatarrow"===a&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-5,-5),t.lineTo(0,0),t.lineTo(-5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-7-this.lineWidth,-5),t.lineTo(-2-this.lineWidth,0),t.lineTo(-7-this.lineWidth,5),t.stroke()),"new-arrow-mid"===c?(t.beginPath(),t.moveTo(m-r,-s),t.lineTo(m,0),t.lineTo(m-r,s),t.stroke()):"strokesqarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(m,0),t.lineTo(m,5),t.lineTo(m+10,5),t.lineTo(m+10,-5),t.lineTo(m,-5),t.closePath(),t.stroke()):"strokecrclarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(m+5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===c?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(m,0),t.lineTo(m,5),t.lineTo(m+5,5),t.lineTo(m+5,-5),t.lineTo(m,-5),t.closePath(),t.fill()):"whatarrow"===c&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(m+5,-5),t.lineTo(m,0),t.lineTo(m+5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(m+7+this.lineWidth,-5),t.lineTo(m+2+this.lineWidth,0),t.lineTo(m+7+this.lineWidth,5),t.stroke()),this.midlePin&&this.drawCirlce(t,m/2,0),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClickModal:function(t){var e=this;this.counterDoubleClickModal++,1!==this.counterDoubleClickModal||(this.timerDoubleClick=setTimeout((function(){e.change=!0,e.openModal(null,t),e.counterDoubleClickModal=0}),300))},doubelClick:function(t){var e=this;if(this.counterDoubleClick++,1===this.counterDoubleClick)return t&&t(),void(this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.counterDoubleClick=0}),300));this.change=!1,this.isSetPins=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",event)}),200)},mouseup:function(){this.changePin&&(this.saveNewPosition(),this.changePin=void 0),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.isSetPins||this.listPins.some((function(i,o){if(e.hover(t.layerX,t.layerY,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y)))e.changePin=Object(c["a"])(Object(c["a"])({},i),{},{index:o}),e._$emit("custom-event",{event:"scroll-lock",args:[!0]});else if(e.listPins[o+1]&&e.checkPinOnLIne(e.$props.layout.t2screen(i.x),e.$props.layout.t2screen(e.listPins[o+1].x),e.$props.layout.$2screen(i.y),e.$props.layout.$2screen(e.listPins[o+1].y),t.layerX,t.layerY,e.lineWidth))return e.doubelClickModal(t),void e._$emit("custom-event",{event:"scroll-lock",args:[!0]})})),this.isSetPins&&this.listPins.length>0){var o=this.symbol,n=this.getContracts.find((function(t){return t.name===o})).precision-1,s=-1*this.getContracts.find((function(t){return t.name===o})).precision,r=this.$props.layout.screen2$(t.layerY)-this.listPins[this.listPins.length-1].y,a=Cmt("trunc",r*Ph(n),-1),l=Cmt("trunc",r,s),u=l/this.listPins[this.listPins.length-1].y*100,d=Cmt("trunc",u,-4);this.saveNewPosition(),this.doubelClick((function(){e.listPins.push({x:e.getTimeCandle(e.$props.layout.screen2t(t.layerX).toFixed(0)),y:e.$props.layout.screen2$(t.layerY),xBar:e.$props.layout.screen2t(t.layerX).toFixed(0),bars:e.listPins[e.listPins.length-1].xBar-e.$props.layout.screen2t(t.layerX).toFixed(0),price:(+e.$props.layout.screen2$(t.layerY)).toFixed(n),procent:d,pips:a})}))}else this.isSetPins&&this.listPins.push({x:this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),y:this.$props.layout.screen2$(t.layerY),xBar:this.$props.layout.screen2t(t.layerX).toFixed(0),bars:void 0,procent:void 0,pips:void 0})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{downColor:"rgba(244,0,0,1)",upColor:"rgba(0,244,0,1)",typeEnd:"new-arrow-mid",typeStart:"larrow",counterDoubleClickModal:0,isShowPriceB:!0,isShowLines:!0,isShowBars:!1,isShowPips:!1,isShowProcentB:!0,title:"teajectoryWord",isSetPins:!0,counterDoubleClick:0,counterClick:1,listPins:[],ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1}}},Zyt=Kyt,tCt=Object(C["a"])(Zyt,Ovt,wvt,!1,null,null,null),eCt=tCt.exports,iCt={name:"LineArrow",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["LineArrow"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Arrow",nameIconTitle:"new-arrow-thin",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!0),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l),h=Math.sqrt(l*l+u*u);t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var t=this.getTimeCandle(this.$props.layout.screen2t(event.layerX).toFixed(0)),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1,this.secondPin.x=t,this.secondPin.y=e,this.counterClick++,this.openModal(null,event),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.counterClick++,this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,title:"fibRetraceWord",ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:2}}},oCt=iCt,nCt=Object(C["a"])(oCt,_vt,Avt,!1,null,null,null),sCt=nCt.exports,rCt={name:"AngleOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["AngleOverlay"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||"".concat(this.$props.id).replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+15),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+15),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Angle",nameIconTitle:"new-angle-line",nameIconEndLine:"line".concat(this.lineWidth,"px"),nameIconStartLine:"line".concat(this.lineWidth,"px"),setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Line",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeStart",listDrawType:[{name:"larrow",value:"larrow"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth},{component:"ModifyreDxDporDown",nameParam:"typeLine",listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}],value:this.lineWidth,fast:!0},{component:"ModifyreDxDporDown",nameParam:"typeEnd",listDrawType:[{name:"new-arrow-mid",value:"new-arrow-mid"},{name:"fillsqarrow",value:"fillsqarrow"},{name:"strokesqarrow",value:"strokesqarrow"},{name:"strokecrclarrow",value:"strokecrclarrow"},{name:"whatarrow",value:"whatarrow"},{name:"line1px",value:"line1px"}],value:this.lineWidth}]},{index:1,name:"ShowPriceRange",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowPriceB,controllerCheckBox:function(t){i.isShowPriceB=t.value},settings:[]},{index:2,name:"ShowPriceRangeBars",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowBars,controllerCheckBox:function(t){i.isShowBars=t.value},settings:[]},{index:3,name:"ShowAngle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowAngle,controllerCheckBox:function(t){i.isShowAngle=t.value},settings:[]},{index:4,name:"AlwaysShowValues",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowValues,controllerCheckBox:function(t){i.isShowValues=t.value},settings:[]},{index:5,name:"AlwaysShowTheMiddle",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isMidlePin,controllerCheckBox:function(t){i.isMidlePin=t.value},settings:[]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash(this.typeLine);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,this.typeStart,this.typeEnd),this.ferstPin.x&&this.secondPin.x&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),this.change&&!this.isShowValues?this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x)):this.isShowValues&&this.ferstPin.x&&this.secondPin.y&&this.drawValueBox(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.ferstPin.x))}},drawValueBox:function(t,e,i,o,n){var s=this,r=this.getContracts.find((function(t){return t.name===s.symbol})).precision-1,a=-1*this.getContracts.find((function(t){return t.name===s.symbol})).precision,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(o),l=Cmt("trunc",c*Ph(r),-1),u=[this.isShowPriceB,this.isShowBars,this.isShowAngle],d=0;u.forEach((function(t){t&&(d+=14)}));var h=Cmt("trunc",c,a),p=h/this.ferstPin.y*100,g=Cmt("trunc",p,-4);t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=1;var f=0;this.isShowPriceB&&(f=t.measureText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l)).width+28),this.isShowBars&&!this.isShowPriceB&&(f=t.measureText("".concat(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)," bars")).width+28),this.isShowBars||this.isShowPriceB||!this.isShowAngle||(f=t.measureText("".concat(Math.abs(this.angle),"°")).width+28);var m={x:void 0,y:void 0},v={x:void 0,y:void 0},y={x:void 0,y:void 0},C={x:void 0,y:void 0};ni+d+8?(m.y=i+.03*i-d+8,v.y=m.y,y.y=m.y+d+8,C.y=y.y):(m.y=i+.03*i,v.y=m.y,y.y=m.y+d+8,C.y=y.y),t.moveTo(m.x,m.y),t.lineTo(v.x,v.y),t.lineTo(y.x,y.y),t.lineTo(C.x,C.y),t.closePath(),t.stroke(),t.beginPath(),this.isShowAngle&&(t.fillText(Math.abs(this.angle)+"°",m.x+14,m.y+d),d-=14),this.isShowBars&&(t.fillText(Math.abs(this.countBarsSecondPin-this.countBarsFerstPin)+" bars",m.x+14,m.y+d),d-=14),this.isShowPriceB&&(t.fillText("".concat(this.secondPin.y.toFixed(r)," (").concat(g,") ").concat(l),m.x+14,m.y+d),d-=14,t.fill())},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,this.ferstPin.y=i,void(this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}if(this.changeSecPos){this.counterClick++;var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,void(this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0))}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=o-e,u=n-i,d=Math.atan2(u,l);+(57.2958*d*-1).toFixed(0)<0?this.angle=+(57.2958*d*-1).toFixed(0)+360:this.angle=+(57.2958*d*-1).toFixed(0);var h=Math.sqrt(l*l+u*u);t.fillStyle=this.colorLine,t.fillText(this.angle+"°",e+51,i-3),t.fill(),t.moveTo(e,i),t.lineTo(e+65.5,i),t.setLineDash([2,3]),t.stroke(),t.setLineDash(this.typeLine),t.save(),t.translate(e,i),t.rotate(d),t.beginPath(),t.moveTo(0,0),t.lineTo(h,0),t.stroke(),t.setLineDash([3,2]),t.arc(0,0,50,0,-d),t.stroke(),t.setLineDash(this.typeLine),"larrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s),t.stroke()):"strokesqarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-10,5),t.lineTo(-10,-5),t.lineTo(0,-5),t.closePath(),t.stroke()):"strokecrclarrow"===a?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(-5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===a?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(0,0),t.lineTo(0,5),t.lineTo(-5,5),t.lineTo(-5,-5),t.lineTo(0,-5),t.closePath(),t.fill()):"whatarrow"===a&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-5,-5),t.lineTo(0,0),t.lineTo(-5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(-7-this.lineWidth,-5),t.lineTo(-2-this.lineWidth,0),t.lineTo(-7-this.lineWidth,5),t.stroke()),"new-arrow-mid"===c?(t.beginPath(),t.moveTo(h-r,-s),t.lineTo(h,0),t.lineTo(h-r,s),t.stroke()):"strokesqarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h,0),t.lineTo(h,5),t.lineTo(h+10,5),t.lineTo(h+10,-5),t.lineTo(h,-5),t.closePath(),t.stroke()):"strokecrclarrow"===c?(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.arc(h+5,0,5,0,2*Math.PI,!0),t.stroke()):"fillsqarrow"===c?(t.beginPath(),t.fillStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h,0),t.lineTo(h,5),t.lineTo(h+5,5),t.lineTo(h+5,-5),t.lineTo(h,-5),t.closePath(),t.fill()):"whatarrow"===c&&(t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h+5,-5),t.lineTo(h,0),t.lineTo(h+5,5),t.stroke(),t.beginPath(),t.strokeStyle=this.colorLine,t.lineWidth=this.lineWidth,t.moveTo(h+7+this.lineWidth,-5),t.lineTo(h+2+this.lineWidth,0),t.lineTo(h+7+this.lineWidth,5),t.stroke()),this.isMidlePin&&this.drawCirlce(t,h/2,0),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(t){if(this.mousedownOnLine=void 0,this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0)),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),2===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i,this.counterClick++,this.openModal(null,t),this.saveNewPosition(),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX);this.getTimeCandle(i.toFixed(0));var o=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),o.length&&o.find((function(t){return t===e.$props.id}))||(o.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:o}))),void(0===o.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var n=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),s=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.ferstPin.x=n,this.ferstPin.y=s,this.ferstPinBars=this.$props.layout.screen2t(t.layerX),this.counterClick++,this.countBarsFerstPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})}else if(2===this.counterClick){var r=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),a=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=r,this.secondPin.y=a,this.counterClick++,this.countBarsSecondPin=this.$props.layout.screen2t(t.layerX).toFixed(0),this.openModal(null,t),this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{isShowPriceB:!1,isShowBars:!0,isShowAngle:!0,isShowValues:!1,isMidlePin:!0,typeEnd:"none",typeStart:"none",counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"rgba(101,142,232,1)",typeLine:[],lineWidth:1,title:"AngleOverlay"}}},aCt=rCt,cCt=Object(C["a"])(aCt,Dvt,kvt,!1,null,null,null),lCt=cCt.exports,uCt={name:"ChanelsFibonacci",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay)},mounted:function(){var t,e=this,i=[{procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{procent:.236,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection&&(this.levels=(t=this.levels).concat.apply(t,i)),Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var o=this.clonnedInitSettings(this.sett.data);this.addToContext(o),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),o&&o.id&&(this.idCurrentOverlay="".concat(o.id)),o&&o.copy&&setTimeout((function(){return e.saveNewPosition()}),100)},watch:{isShowProection:function(){var t=[{procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{procent:.236,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection?this.levels=[].concat(t,Object(x["a"])(this.levels)):this.levels=this.levels.filter((function(e){if(!t.find((function(t){return t.procent===e.procent})))return e}))},colorTradeLine:function(t){t&&this.levels.forEach((function(e){e.colorLine=t;var i=t.replace(/[^,\d]/g,"").split(",");i[3]="0.2",e.colorSection="rgba(".concat(i.join(","),")")}))}},methods:{addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ChanelsFibonacci"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciChannels",nameIconTitle:"new-chanels-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorTradeLine",value:this.colorTradeLine,color:function(){return i.colorTradeLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"widthTradeLine",withDescription:!0,value:this.widthTradeLine,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"dashTradeLine",value:this.dashTradeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowText,controllerCheckBox:function(t){i.isShowText=t.value},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Right",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:2,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){t.beginPath(),t.setLineDash([]);var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2),this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))))}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=e,this.ferstPin.y=i}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}if(this.changeDpos){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1;var a=this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,c=this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2;return this.needPsevdoOne=this.revert?-1:1,void this.getWidth(a,c,this.$props.layout.t2screen(s),this.$props.layout.$2screen(r))}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},getWidth:function(t,e,i,o){var n=-1,s=i-t,r=o-e,a=Math.sqrt(s*s+r*r);return this.widthCD=a*this.needPsevdoOne,a*n},drawSection:function(t,e,i,o,n,s,r,a,c,l){l&&(t.beginPath(),t.lineWidth=this.widthTradeLine,t.strokeStyle=a||this.colorLine,t.setLineDash(this.dashTradeLine),t.moveTo(e,i),t.lineTo(o,i),t.stroke(),this.isBackground&&(t.beginPath(),t.fillStyle=r,t.strokeStyle="rgba(255,255,255,0)",t.moveTo(e,i),t.lineTo(o,i),t.lineTo(o,n),t.lineTo(e,n),t.closePath(),t.fill()),this.isShowText&&("left"===this.typeShowLevels&&this.fillTextDraw(t,s,e,i,a),"right"===this.typeShowLevels&&this.fillTextDrawRight(t,s,o+10,i,a),"all"===this.typeShowLevels&&(this.fillTextDraw(t,s,e,i,a),this.fillTextDrawRight(t,s,o+10,i,a))))},fillTextDraw:function(t,e,i,o,n){if(this.isShowText){t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial";var s=t.measureText(e).width+10;t.fillText(e,i-s,o+3),t.fill()}},fillTextDrawRight:function(t,e,i,o,n){this.isShowText&&(t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial",t.fillText(e,i,o+3),t.fill())},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c){var l=this,u=o-e,d=n-i,h=Math.atan2(d,u),p=Math.sin(h),g=Math.cos(h),f=(e-this.mouse.x)*p-(i-this.mouse.y)*g;this.revert=f>0;var m=Math.sqrt(u*u+d*d),v=this.levels;t.save(),t.translate(e,i),t.rotate(h),t.beginPath(),t.lineWidth=.5,t.moveTo(0,0),t.lineTo(m,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(m-r,-s),t.lineTo(m,0),t.lineTo(m-r,s)),t.stroke();var y=.5*m,C=-1*this.widthCD,b=y*g-C*p,S=y*p+C*g;this.testNew={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+b),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+S)},this.levels.forEach((function(e,i){var o=v[i+1]?v[i+1].procent:-l.widthCD*e.procent;l.drawSection(t,0,-l.widthCD*e.procent,m,o,e.procent,e.color,e.colorLine,e.type,e.isShow)})),t.beginPath(),t.lineWidth=.5,t.setLineDash([5,15]),t.moveTo(.5*m,0),t.lineTo(.5*m,-this.widthCD),t.stroke(),t.setLineDash([]),this.drawCirlce(t,.5*m,-this.widthCD),t.setTransform(1,0,0,1,0,0),t.restore()},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mouseup:function(){if(this.changeDpos=!1,this.mousedownOnLine=void 0,2===this.counterClick){var t=this.getTimeCandle(this.$props.layout.screen2t(event.layerX).toFixed(0)),e=this.$props.layout.screen2$(event.layerY);this.fromMouse=!1,this.secondPin.x=t,this.secondPin.y=e,this.counterClick++,this.saveNewPosition(),this.openModal(null,event),this.changeThreePin=!0}this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){var o=this.$props.layout.t2screen(this.ferstPin.x)+(this.$props.layout.t2screen(this.secondPin.x)-this.$props.layout.t2screen(this.ferstPin.x))/2,n=this.$props.layout.$2screen(this.ferstPin.y)+(this.$props.layout.$2screen(this.secondPin.y)-this.$props.layout.$2screen(this.ferstPin.y))/2;if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.testNew.x),this.$props.layout.$2screen(this.testNew.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeDpos=!0));if(this.hover(t.layerX,t.layerY,o,n))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeDpos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=s,this.ferstPin.y=r,this.counterClick++}else if(2===this.counterClick){var a=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),c=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=a,this.secondPin.y=c,this.counterClick++,this.saveNewPosition()}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{levels:[{index:0,procent:1,color:"rgba(255,255,255,0)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:1,procent:1.382,color:"rgba(255,255,255,0)",colorLine:"rgba(255,153,153,1)",dash:[],isShow:!0},{index:2,procent:1.618,color:"rgba(255,255,255,0)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:3,procent:1.786,color:"rgba(255,255,255,0)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:4,procent:2,color:"rgba(255,255,255,0)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:5,procent:2.618,color:"rgba(255,255,255,0)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:6,procent:3.618,color:"rgba(255,255,255,0)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0}],isOneColor:!1,isBackground:!1,title:"fibChWord",colorTradeLine:"rgba(24, 36, 64, 0.7)",widthTradeLine:1,dashTradeLine:[0,0],revert:void 0,isStaticWidth:!0,isShowProection:!1,isShowText:!1,isShowSection:!1,changeDpos:!1,counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,typeShowLevels:"all",ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,widthCD:0}}},dCt=uCt,hCt=Object(C["a"])(dCt,Ivt,Bvt,!1,null,null,null),pCt=hCt.exports,gCt={name:"PriceLineFibonacci",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t,e,i=this,o=[{index:0,procent:1.618,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:2.618,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:3.618,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:4.236,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0}];this.isShowProection&&(this.levels=(t=this.levels).concat.apply(t,o)),this.isShowProection&&(this.levels=(e=this.levels).concat.apply(e,o)),Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var n=this.clonnedInitSettings(this.sett.data);this.addToContext(n),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),n&&n.id&&(this.idCurrentOverlay="".concat(n.id)),n&&n.copy&&setTimeout((function(){return i.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["PriceLineFibonacci"]},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciCorrection",nameIconTitle:"new-correction-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",color:function(){return i.colorLine},value:this.colorLine,fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"LevelLine",startCheckBox:!0,valueStartCheckBox:this.isShowTrandLine,controllerCheckBox:function(t){i.isShowTrandLine=t.value,i.updateDraw()},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorTradeLine",color:function(){return i.colorTradeLine},value:this.colorTradeLine},{component:"ModifyreDxDporDown",nameParam:"widthTradeLine",withDescription:!0,value:this.widthTradeLine,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"dashTradeLine",value:this.dashTradeLine,fast:!0,listDrawType:[{name:"line".concat(this.widthTradeLine,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:2,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:0,name:"Width",settings:{component:"ModifyreDxDporDown",nameParam:"staticWidth",value:this.staticWidth,change:function(t){i.staticWidth=t,i.updateDraw()},listDrawType:[{name:"150",value:150,onlyTextWidth:!0},{name:"250",value:250,onlyTextWidth:!0},{name:"450",value:450,onlyTextWidth:!0}]}},{index:0,name:"Offset",settings:{component:"ModifyreDxDporDown",nameParam:"ident",value:this.ident,change:function(t){i.ident=t,i.updateDraw()},listDrawType:[{name:"30",value:30,onlyTextWidth:!0},{name:"60",value:60,onlyTextWidth:!0},{name:"90",value:90,onlyTextWidth:!0}]}}]}]},{index:3,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:0,name:"Levels",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowPrice",value:this.isShowPrice,change:function(t){i.isShowPrice=t,i.updateDraw()}}},{index:1,name:"Price",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowProcent",value:this.isShowProcent,change:function(t){i.isShowProcent=t,i.updateDraw()}}},{index:2,name:"Background",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowSection",value:this.isShowSection,change:function(t){i.isShowSection=t,i.updateDraw()}}}]}]},{index:4,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowText,controllerCheckBox:function(t){i.isShowText=t.value,i.updateDraw()},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,withArrow:!0,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Right",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:5,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,changeLevels:function(t){i.levels=t,i.updateDraw()},fast:!1}]}],typeModal:t}}})},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},draw:function(t){if(this.ctx=t,this.ferstPin.x){var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1,!0,this.colorTradeLine,this.widthTradeLine),this.drawLinesFibocci(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),t.setLineDash([]),t.beginPath()}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.ferstPin.x&&this.dinmycDraw){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i}if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=o,void(this.ferstPin.y=n)}if(this.changeSecPos){this.counterClick++;var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=s,void(this.secondPin.y=r)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},getWidthFromPins:function(t,e){var i=Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2));return i},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c,l,u,d){t.beginPath(),d&&(t.lineWidth=d+""),u&&(t.strokeStyle=u);var h=o-e,p=n-i,g=Math.atan2(p,h),f=Math.sqrt(h*h+p*p);t.setLineDash(this.dashTradeLine),t.save(),t.translate(e,i),t.rotate(g),t.beginPath(),this.isShowTrandLine&&(t.moveTo(0,0),t.lineTo(f,0)),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(f-r,-s),t.lineTo(f,0),t.lineTo(f-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore(),t.setLineDash([])},fillTextDraw:function(t,e,i,o,n){if(this.isShowText){t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial";var s=t.measureText(e).width+10;t.fillText(e,i-s,o+3),t.fill()}},fillTextDrawRight:function(t,e,i,o,n){this.isShowText&&(t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial",t.fillText(e,i,o+3),t.fill())},drawSection:function(t,e,i,o,n,s,r,a,c,l,u){if(u&&(t.beginPath(),t.lineWidth=this.lineWidth,t.strokeStyle=c||this.colorLine,t.setLineDash(this.typeLine),t.moveTo(e+this.ident,i),t.lineTo(o+this.ident,i),t.stroke(),this.isShowSection&&(t.beginPath(),t.setLineDash(this.typeLine),t.fillStyle=a,t.strokeStyle="rgba(255,255,255,0)",t.moveTo(e+this.ident,i),t.lineTo(o+this.ident,i),t.lineTo(o+this.ident,n),t.lineTo(e+this.ident,n),t.closePath(),t.fill()),this.isShowText)){var d="";this.isShowPrice&&!this.isShowProcent&&(d=""+s),!this.isShowPrice&&this.isShowProcent&&(d=""+r),this.isShowPrice&&this.isShowProcent&&(d=s+"("+r+")"),"left"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.fillTextDraw(t,d,e+this.ident,i,c),"right"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.fillTextDrawRight(t,d,o+10+this.ident,i,c)}},drawLinesFibocci:function(t,e,i,o,n){var s=this,r=i>n?-1:1,a=e>o?-1:1;if(ethis.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},clickOnLineFibonacci:function(t,e){var i=this;return this.levels.some((function(o){return eo.y-2.5&&t>=o.x1+i.ident&&t<=o.x2+i.ident}))},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.clickOnLineFibonacci(t.layerX,t.layerY)&&this.doubelClick(t),this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++,this.dinmycDraw=!0}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.dinmycDraw=!1,this.saveNewPosition()}},newAlphaChannel:function(t){var e=t.replace(/[^,\d]/g,"").split(",");return e[3]=.2*e[3],"rgba(".concat(e.join(","),")")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getContracts:"contracts/getContracts",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),watch:{isShowProection:function(){var t=[{index:0,procent:1.618,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:2.618,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:3.618,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:4.236,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0}];this.isShowProection?this.levels=[].concat(t,Object(x["a"])(this.levels)):this.levels=this.levels.filter((function(e){if(!t.find((function(t){return t.procent===e.procent})))return e}))},colorLine:function(t){var e=this;this.initiationsValues||t&&this.levels.forEach((function(i){i.colorLine=t,i.color=e.newAlphaChannel(t)}))}},data:function(){return{levels:[{index:0,procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:.236,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:4,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:5,procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:6,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],isShowTrandLine:!0,colorTradeLine:"rgba(24, 36, 64, 0.7)",widthTradeLine:1,initiationsValues:!0,dashTradeLine:[10,10],ident:30,isStaticWidth:!0,staticWidth:250,isShowProection:!1,isShowText:!0,isShowSection:!1,typeShowLevels:"all",leftText:!0,rigthText:!0,counterDoubleClick:0,isShowProcent:!1,isShowPrice:!0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,title:"fibRetrWord"}}},fCt=gCt,mCt=Object(C["a"])(fCt,Mvt,$vt,!1,null,null,null),vCt=mCt.exports,yCt={name:"PriceLineFibonacciWithOutCorrection",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t,e=this,i=[{index:0,procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:.236,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:4,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:5,procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection&&(this.levels=(t=this.levels).concat.apply(t,i)),Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var o=this.clonnedInitSettings(this.sett.data);this.addToContext(o),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),o&&o.id&&(this.idCurrentOverlay="".concat(o.id)),o&&o.copy&&setTimeout((function(){return e.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["PriceLineFibonacciWithOutCorrection"]},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciProection",nameIconTitle:"new-proection-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"LevelLine",startCheckBox:!0,valueStartCheckBox:this.isShowTrandLine,controllerCheckBox:function(t){i.isShowTrandLine=t.value,i.updateDraw()},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorTradeLine",color:function(){return i.colorTradeLine},value:this.colorTradeLine},{component:"ModifyreDxDporDown",nameParam:"widthTradeLine",withDescription:!0,value:this.widthTradeLine,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"dashTradeLine",value:this.dashTradeLine,fast:!0,listDrawType:[{name:"line".concat(this.widthTradeLine,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:2,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:0,name:"Width",settings:{component:"ModifyreDxDporDown",nameParam:"staticWidth",value:this.staticWidth,change:function(t){i.staticWidth=t,i.updateDraw()},listDrawType:[{name:"150",value:150,onlyTextWidth:!0},{name:"250",value:250,onlyTextWidth:!0},{name:"450",value:450,onlyTextWidth:!0}]}},{index:0,name:"Offset",settings:{component:"ModifyreDxDporDown",nameParam:"ident",value:this.ident,change:function(t){i.ident=t,i.updateDraw()},listDrawType:[{name:"30",value:30,onlyTextWidth:!0},{name:"60",value:60,onlyTextWidth:!0},{name:"90",value:90,onlyTextWidth:!0}]}}]}]},{index:3,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:0,name:"Levels",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowPrice",value:this.isShowPrice,change:function(t){i.isShowPrice=t,i.updateDraw()}}},{index:1,name:"Price",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowProcent",value:this.isShowProcent,change:function(t){i.isShowProcent=t,i.updateDraw()}}},{index:2,name:"Background",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowSection",value:this.isShowSection,change:function(t){i.isShowSection=t,i.updateDraw()}}}]}]},{index:4,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowText,controllerCheckBox:function(t){i.isShowText=t.value,i.updateDraw()},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,withArrow:!0,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Right",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:5,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},draw:function(t){if(this.ctx=t,this.ferstPin.x){var e=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,i=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.drawLineWithArrows(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),e,i,5,8,!1,!1,!0,this.colorTradeLine,this.widthTradeLine),this.drawLinesFibocci(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y))),t.setLineDash([]),t.beginPath()}},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.ferstPin.x&&this.dinmycDraw){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=e,this.secondPin.y=i}if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=o,void(this.ferstPin.y=n)}if(this.changeSecPos){this.counterClick++;var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=s,void(this.secondPin.y=r)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},getWidthFromPins:function(t,e){var i=Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2));return i},drawLineWithArrows:function(t,e,i,o,n,s,r,a,c,l,u,d){t.beginPath(),d&&(t.lineWidth=d+""),u&&(t.strokeStyle=u);var h=o-e,p=n-i,g=Math.atan2(p,h),f=Math.sqrt(h*h+p*p);t.setLineDash(this.dashTradeLine),t.save(),t.translate(e,i),t.rotate(g),t.beginPath(),this.isShowTrandLine&&(t.moveTo(0,0),t.lineTo(f,0)),t.lineTo(f,0),a&&(t.moveTo(r,-s),t.lineTo(0,0),t.lineTo(r,s)),c&&(t.moveTo(f-r,-s),t.lineTo(f,0),t.lineTo(f-r,s)),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},fillTextDraw:function(t,e,i,o,n){if(this.isShowText){t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial";var s=t.measureText(e).width+14;t.fillText(e,i-s,o+6),t.fill()}},fillTextDrawRight:function(t,e,i,o,n){this.isShowText&&(t.beginPath(),t.fillStyle=n||this.colorLine,t.font="10px Arial",t.fillText(e,i,o+3),t.fill())},drawSection:function(t,e,i,o,n,s,r,a,c,l,u){if(u&&(t.beginPath(),t.lineWidth=this.lineWidth,t.strokeStyle=c||this.colorLine,t.setLineDash(this.typeLine||[]),t.moveTo(e+this.ident,i),t.lineTo(o+this.ident,i),t.stroke(),this.isShowSection&&(t.beginPath(),t.setLineDash(this.typeLine||[]),t.fillStyle=a,t.strokeStyle="rgba(255,255,255,0)",t.moveTo(e+this.ident,i),t.lineTo(o+this.ident,i),t.lineTo(o+this.ident,n),t.lineTo(e+this.ident,n),t.closePath(),t.fill()),this.isShowText&&(this.isShowPrice||this.isShowProcent))){var d="".concat(s);this.isShowPrice&&!this.isShowProcent&&(d=""+s),!this.isShowPrice&&this.isShowProcent&&(d=""+r),this.isShowPrice&&this.isShowProcent&&(d=s+"("+r+")"),"left"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.fillTextDraw(t,d,e+this.ident,i,c),"right"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.fillTextDrawRight(t,d,o+10+this.ident,i,c)}},drawLinesFibocci:function(t,e,i,o,n){var s=this,r=i>n?-1:1,a=e>o?-1:1;if(ethis.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},clickOnLineFibonacci:function(t,e){var i=this;return this.levels.some((function(o){return eo.y-2.5&&t>=o.x1+i.ident&&t<=o.x2+i.ident}))},mousedown:function(t){if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeFirstPos=!0);if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.changeSecPos=!0);if(this.clickOnLineFibonacci(t.layerX,t.layerY)&&this.doubelClick(t),this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=e,this.ferstPin.y=i,this.counterClick++,this.dinmycDraw=!0}else if(2===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=o,this.secondPin.y=n,this.counterClick++,this.dinmycDraw=!1,this.saveNewPosition()}},newAlphaChannel:function(t){var e=t.replace(/[^,\d]/g,"").split(",");return e[3]=.2*e[3],"rgba(".concat(e.join(","),")")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getContracts:"contracts/getContracts",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),watch:{isShowProection:function(){var t=[{index:0,procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:.236,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:2,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:3,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:4,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:5,procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0}];this.isShowProection?this.levels=[].concat(t,Object(x["a"])(this.levels)):this.levels=this.levels.filter((function(e){if(!t.find((function(t){return t.procent===e.procent})))return e}))},colorTradeLine:function(t){this.initiationsValues},colorLine:function(t){var e=this;this.initiationsValues||this.levels.forEach((function(i){t&&(i.colorLine=t,i.color=e.newAlphaChannel(t))}))},typeLine:function(t){this.initiationsValues||this.levels.forEach((function(e){Array.isArray(t)&&(e.dash=t)}))},dashTradeLine:function(t){this.initiationsValues}},data:function(){return{levels:[{index:0,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:1,procent:1.618,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{index:2,procent:2.618,color:"rgba(106,168,79,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:3,procent:3.618,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:4,procent:4.236,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0}],isShowTrandLine:!0,initiationsValues:!0,colorTradeLine:"rgba(24, 36, 64, 0.7)",widthTradeLine:1,dashTradeLine:[10,10],ident:30,isStaticWidth:!0,staticWidth:250,isShowProection:!1,isShowText:!0,typeShowLevels:"all",isShowSection:!1,leftText:!0,rigthText:!0,counterDoubleClick:0,isShowProcent:!1,isShowPrice:!0,mousedownOnLine:!1,counterClick:1,ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,title:"fibProjWord"}}},CCt=yCt,bCt=Object(C["a"])(CCt,Lvt,Fvt,!1,null,null,null),SCt=bCt.exports,PCt={name:"ConeFibonacci",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),t.threePin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.threePin.y)+60),t.threePin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.threePin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciWedge",nameIconTitle:"new-cone-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"Background",withOutLine:!0,startCheckBox:!0,valueStartCheckBox:this.isShowSection,controllerCheckBox:function(t){i.isShowSection=t.value},settings:[]},{index:2,name:"Tags",startCheckBox:!0,valueStartCheckBox:this.isShowText,controllerCheckBox:function(t){i.isShowText=t.value},settings:[{component:"ModifyreDxDporDown",nameParam:"typeShowLevels",value:this.typeShowLevels,fast:!1,listDrawType:[{name:"BothMeanings",value:"all",onlyTextWidth:!0},{name:"Right",value:"right",onlyTextWidth:!0},{name:"Left",value:"left",onlyTextWidth:!0}]}]},{index:3,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ConeFibonacci"]},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,this.openModal("full",t)):this.timerDoubleClick=setTimeout((function(){e.change=!0,e.openModal(null,t),e.counterDoubleClick=0}),300)},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},getWidth:function(t,e,i,o){var n=i-t,s=o-e,r=Math.sqrt(n*n+s*s);return r},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawDescription:function(t,e,i,o){t.beginPath();var n=t.measureText(o).width+10;t.fillStyle="#000",t.fillText(o,e-n,i),t.fill()},drawSection:function(t,e,i,o,n,s,r,a,c,l){if(!c)return t.beginPath(),t.setLineDash(this.typeLine||[]),t.lineWidth=this.lineWidth,t.strokeStyle=a.colorLine,t.fillStyle=a.color,t.moveTo(e,i),t.lineWidth=0,t.closePath(),t.arc(e,i,o,n,s,r),this.isShowSection&&t.fill(),void t.stroke();if(a.f&&c.f){t.beginPath(),t.setLineDash(this.typeLine||[]),t.lineWidth=this.lineWidth,t.strokeStyle=a.colorLine,t.fillStyle=a.color;var u=this.symbol,d=-1*this.getContracts.find((function(t){return t.name===u})).precision,h=this.$props.layout.t2screen(c.f.x),p=this.$props.layout.$2screen(Cmt("trunc",c.f.y,d)),g=this.$props.layout.t2screen(c.s.x),f=this.$props.layout.$2screen(Cmt("trunc",c.s.y,d)),m=this.$props.layout.t2screen(a.f.x),v=this.$props.layout.$2screen(Cmt("trunc",a.f.y,d));t.moveTo(h,p),t.lineTo(m,v),t.lineWidth=0,t.arc(e,i,o,n,s,r),t.strokeStyle=a.colorLine,t.lineWidth=this.lineWidth,t.lineTo(g,f),t.arc(e,i,this.widthCD*c.procent,s+.001*s,n+.001*n,!r),this.isShowSection&&t.fill(),t.beginPath(),t.arc(e,i,o,n,s,r),t.stroke()}},getVector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},crossProduct:function(t,e){return t.x*e.y-t.y*e.x},getAngle1:function(t,e){var i=this.dotProduct(t,e),o=this.crossProduct(t,e);return Math.atan2(o,i)},draw:function(t){var e=this;if(this.ctx=t,this.ferstPin.x){t.beginPath();var i=this.$props.layout.t2screen(this.secondPin.x)||this.mouse.x,o=this.$props.layout.$2screen(this.secondPin.y)||this.mouse.y;if(t.lineWidth=this.lineWidth+"",t.strokeStyle=this.colorLine,this.widthCD=this.getWidth(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.threePin&&this.threePin.x&&(t.beginPath(),t.stroke(),this.drawSecondLine(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.threePin.x),this.$props.layout.$2screen(this.threePin.y),this.widthCD),this.testBC&&this.testBC.x)){var n=this.symbol,s=-1*this.getContracts.find((function(t){return t.name===n})).precision,r=Cmt("trunc",this.testBC.y,s),a=this.getAngle(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(r));this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(r);var c=this.getVector({x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:this.$props.layout.t2screen(this.testBC.x),y:this.$props.layout.$2screen(r)}),l=this.getVector({x:this.$props.layout.t2screen(this.ferstPin.x),y:this.$props.layout.$2screen(this.ferstPin.y)},{x:this.$props.layout.t2screen(this.secondPin.x),y:this.$props.layout.$2screen(this.secondPin.y)});this.superAngle&&this.levels.forEach((function(i,o){e.drawSection(t,e.$props.layout.t2screen(e.ferstPin.x),e.$props.layout.$2screen(e.ferstPin.y),e.widthCD*i.procent,e.superAngle,a,!(e.getAngle1(c,l)/(Math.PI/180)<0),i,e.levels[o-1])}))}t.strokeStyle=this.colorLine,this.drawFertsLine(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y),i,o,5,8,!1,!1),this.ferstPin.x&&this.secondPin.x&&this.change&&(this.drawCirlce(t,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)),this.drawCirlce(t,this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(this.testBC.y)))}},getAngle:function(t,e,i,o){var n=i-t,s=o-e,r=Math.atan2(s,n);return r},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},toOldCoord:function(t,e,i,o,n){var s=Math.sin(n),r=Math.cos(n),a=i*r-o*s,c=i*s+o*r;return{x:this.$props.layout.screen2t(this.$props.layout.t2screen(t)+a),y:this.$props.layout.screen2$(this.$props.layout.$2screen(e)+c)}},drawFertsLine:function(t,e,i,o,n){var s=this,r=o-e,a=n-i,c=Math.atan2(a,r);this.superAngle=c;var l=Math.sqrt(r*r+a*a),u=Math.sin(c),d=Math.cos(c),h=l+30,p=0,g=h*d-p*u,f=h*u+p*d;this.ferstBz={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+g),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+f)},this.widthCD=l,this.levels=this.levels.map((function(t){return t.f=s.toOldCoord(s.ferstPin.x,s.ferstPin.y,l*t.procent,0,c),t})),this.levels.forEach((function(e){!s.isShowText||"right"!==s.typeShowLevels&&"all"!==s.typeShowLevels||s.drawDescription(t,s.$props.layout.t2screen(e.f.x),s.$props.layout.$2screen(e.f.y),e.procent+"")})),t.save(),t.lineWidth=this.lineWidth,t.translate(e,i),t.rotate(c),t.beginPath(),t.moveTo(0,0),t.lineTo(l,0),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},drawSecondLine:function(t,e,i,o,n,s){var r=this,a=o-e,c=n-i,l=Math.atan2(c,a),u=s,d=Math.sin(l),h=Math.cos(l),p=u,g=0,f=p*h-g*d,m=p*d+g*h;this.levels=this.levels.map((function(t){return t.s=r.toOldCoord(r.ferstPin.x,r.ferstPin.y,u*t.procent,0,l),t})),!this.isShowText||"left"!==this.typeShowLevels&&"all"!==this.typeShowLevels||this.levels.forEach((function(e){r.drawDescription(t,r.$props.layout.t2screen(e.s.x),r.$props.layout.$2screen(e.s.y),e.procent+"")}));var v={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+f),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+m)};this.testBC=v;var y=u+30,C=0,b=y*h-C*d,S=y*d+C*h;this.secondBz={x:this.$props.layout.screen2t(this.$props.layout.t2screen(this.ferstPin.x)+b),y:this.$props.layout.screen2$(this.$props.layout.$2screen(this.ferstPin.y)+S)},t.save(),t.lineWidth=this.lineWidth,t.setLineDash(this.levels[0].type||[]),t.translate(e,i),t.rotate(l),t.beginPath(),t.moveTo(0,0),t.lineTo(u,0),t.stroke(),t.setTransform(1,0,0,1,0,0),t.restore()},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)||this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.threePin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.threePin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}if(this.changeThreePin){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.threePin.x=s,void(this.threePin.y=r)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},mouseup:function(){this.mousedownOnLine=void 0,this.changeThreePin&&this.counterClick>3&&(this.saveNewPosition(),this.openModal(null,event),this.changeThreePin=!1),this.changeFirstPos&&(this.saveNewPosition(),this.changeFirstPos=!1),this.changeSecPos&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>3){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.testBC.x),this.$props.layout.$2screen(this.testBC.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeThreePin=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.changeThreePin=!0,this.saveNewPosition()}else if(3===this.counterClick){var a=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),c=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.threePin.x=a,this.threePin.y=c,this.counterClick++,this.changeThreePin=!1,this.saveNewPosition()}},newAlphaChannel:function(t){var e=t.replace(/[^,\d]/g,"").split(",");return e[3]=.2*e[3],"rgba(".concat(e.join(","),")")}},watch:{colorLine:function(t){var e=this;this.initiationsValues||t&&this.levels.forEach((function(i){i.colorLine=t,i.color=e.newAlphaChannel(t)}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{lineWidth:1,levels:[{index:0,procent:.236,color:"rgba(153,0,0,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:1,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:2,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:3,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:4,procent:.786,color:"rgba(153,22,123,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:5,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,threePin:{x:void 0,y:void 0},ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],typeShowLevels:"all",isShowSection:!0,isShowText:!1,isShowProcent:!0,title:"fibWedWord"}}},TCt=PCt,xCt=Object(C["a"])(TCt,jvt,Rvt,!1,null,null,null),OCt=xCt.exports,wCt={name:"ArcResistFibonacci",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ArcResistFibonacci"]},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,this.counterDoubleClick=0,setTimeout((function(){e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,e.openModal(null,t),e.counterDoubleClick=0}),300)},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),t.threePin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.threePin.y)+60),t.threePin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.threePin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciResistanceArcs",nameIconTitle:"new-arc-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:1,name:"Tags",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowText",value:this.isShowText,change:function(t){i.isShowText=t,i.updateDraw()}}},{index:2,name:"Background",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowSection",value:this.isShowSection,change:function(t){i.isShowSection=t,i.updateDraw()}}}]}]},{index:2,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},getWidth:function(t,e,i,o){var n=i-t,s=o-e,r=Math.sqrt(n*n+s*s);return r},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawDescription:function(t,e,i,o,n){t.beginPath(),t.save();var s=0;this.ferstPin.y2&&(this.saveNewPosition(),this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.saveNewPosition(),this.changeThreePin=!0}},newAlphaChannel:function(t){var e=t.replace(/[^,\d]/g,"").split(",");return e[3]=.2*e[3],"rgba(".concat(e.join(","),")")}},watch:{colorLine:function(t){var e=this;this.initiationsValues||t&&this.levels.forEach((function(i){i.colorLine=t,i.color=e.newAlphaChannel(t)}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{title:"fraWord",levels:[{index:0,procent:.236,color:"rgba(153,0,0,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:1,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:2,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:3,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:4,procent:.786,color:"rgba(153,22,123,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:5,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,threePin:{x:void 0,y:void 0},ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,isShowText:!1,isShowProcent:!0,leftText:!0,rigthText:!0,typeShowLevels:"left",isShowProection:!0,isShowSection:!0,isOneColor:!1}}},_Ct=wCt,ACt=Object(C["a"])(_Ct,Wvt,Nvt,!1,null,null,null),DCt=ACt.exports,kCt={name:"CircleFibonacci",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.ferstPin.x||this.ferstPin.y||this.secondPin.x||this.secondPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CircleFibonacci"]},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,this.counterDoubleClick=0,setTimeout((function(){e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,e.openModal(null,t),e.counterDoubleClick=0}),300)},createObjectForSaveOrCopy:function(){var t=["ctx","mouse"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.ferstPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.ferstPin.y)+60),t.ferstPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.ferstPin.x)+40),t.secondPin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.secondPin.y)+60),t.secondPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.secondPin.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"FibonacciСircle",nameIconTitle:"new-circle-fibonacci",setSettings:this.newSetSettings,listSections:[{index:0,name:"Lines",startCheckBox:!1,controllerCheckBox:function(){},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0},{component:"ModifyreDxDporDown",nameParam:"lineWidth",withDescription:!0,value:this.lineWidth,fast:!0,listDrawType:[{name:"line1px",value:1,description:"1px"},{name:"line2px",value:2,description:"2px"},{name:"line3px",value:3,description:"3px"},{name:"line4px",value:4,description:"4px"}]},{component:"ModifyreDxDporDown",nameParam:"typeLine",value:this.typeLine,fast:!0,listDrawType:[{name:"line".concat(this.lineWidth,"px"),value:[]},{name:"new-dashedline",value:[10,10]},{name:"new-dottedline",value:[1,2]}]}]},{index:1,name:"",withOutLine:!0,startCheckBox:!1,settings:[{component:"RowSettings",index:0,settings:[{index:1,name:"Tags",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowText",value:this.isShowText,change:function(t){i.isShowText=t,i.updateDraw()}}},{index:2,name:"Background",withOutLine:!0,settings:{component:"DxCheckBox",nameParam:"isShowSection",value:this.isShowSection,change:function(t){i.isShowSection=t,i.updateDraw()}}}]}]},{index:2,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"ListDropDowns",nameParam:"levels",isShowColorPicker:!0,value:this.levels,fast:!1}]}],typeModal:t}}})},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},getWidth:function(t,e,i,o){var n=i-t,s=o-e,r=Math.sqrt(n*n+s*s);return r},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawDescription:function(t,e,i,o){t.beginPath(),t.save(),this.ferstPin.ythis.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.saveNewPosition(),this.changeThreePin=!0}},newAlphaChannel:function(t){var e=t.replace(/[^,\d]/g,"").split(",");return e[3]=.2*e[3],"rgba(".concat(e.join(","),")")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),watch:{colorLine:function(t){var e=this;this.initiationsValues||t&&this.levels.forEach((function(i){i.colorLine=t,i.color=e.newAlphaChannel(t)}))}},data:function(){return{levels:[{index:0,procent:.236,color:"rgba(153,0,0,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{index:1,procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{index:2,procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{index:3,procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{index:4,procent:.786,color:"rgba(153,22,123,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{index:5,procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],isShowSection:!0,isShowProcent:!0,counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,threePin:{x:void 0,y:void 0},ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:1,title:"fibCirWord",isShowText:!1,leftText:!0,rigthText:!0}}},ICt=kCt,BCt=Object(C["a"])(ICt,Evt,Uvt,!1,null,null,null),MCt=BCt.exports,$Ct={name:"FanFibonacci",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$off("setSettings",(function(e){return t.setSettings(e)}))},mounted:function(){var t=this;this.arrCnd=JSON.parse(localStorage.getItem("allCnd")),Jpt.$on("setSettings",(function(e){return t.setSettings(e)}))},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["FanFibonacci"]},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.change=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.counterDoubleClick=0}),300)},drawSaveingObjects:function(t){var e=localStorage.getItem("currentSymbol").replace(/"/g,""),i={};i[e]={},Object.keys(t).forEach((function(o){if("overlays"!==o&&t[o]&&"trading"===t[o].page){var n=t[o].symbol.replace(/"/g,"");e===n&&(i[n][t[o].group]||(i[n][t[o].group]=[]),i[n][t[o].group].push(t[o]))}})),localStorage.setItem(e,JSON.stringify(i[e])),this.newObject=i},saveFormatedData:function(t){var e,i=this,o=localStorage.getItem(localStorage.getItem("currentSymbol").replace(/"/g,"")),n=JSON.parse(o),s=n["default"];e=s&&s.length>0?s.map((function(e){return e.id===i.$props.id?(e=t,e):e})):[t];var r={};r["default"]=e,localStorage.setItem(localStorage.getItem("currentSymbol").replace(/"/g,""),JSON.stringify(r))},setSettings:function(t){var e=this;t.idFromEvent===this.$props.id&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this._$emit("custom-event",{event:"change-settings",args:[!0]}))},checkPinOnLIne:function(t,e,i,o,n,s,r){var a=e-t,c=o-i,l=n-t,u=s-i,d=a*u-l*c,h=Math.sqrt(a*a+c*c),p=d/h;if(Math.abs(p)<5/this.lineWidth)return!0},getWidth:function(t,e,i,o){var n=i-t,s=o-e,r=Math.sqrt(n*n+s*s);return r},cntX:function(t){return this.$props.layout.t2screen(this.$props.layout.screen2t(t))},cntY:function(t){return this.$props.layout.$2screen(this.$props.layout.screen2$(t))},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawDescription:function(t,e,i,o){t.beginPath(),t.save(),this.ferstPin.ythis.ferstPin.y&&this.secondPin.x>this.ferstPin.x?(t.moveTo(e,i),t.lineTo(e+9999,i),t.moveTo(e,i),o=-.785398,n=9999,t.lineTo(e,i-9999)):this.secondPin.y>this.ferstPin.y&&this.secondPin.xthis.ferstPin.x&&(o=.785398,n=9999,t.moveTo(e,i),t.lineTo(e+9999,i),t.moveTo(e,i),t.lineTo(e,i+9999)),t.stroke(),this.levels.map((function(a,c){a.f={x:s.$props.layout.screen2t(e-r*a.procent),y:s.$props.layout.screen2$(i)},a.s={x:s.$props.layout.screen2t(e+r*a.procent),y:s.$props.layout.screen2$(i)},a&&a.procent&&s.levels[c+1]&&(s.drawFertsLine(t,e,i,n,o*a.procent,o*s.levels[c+1].procent,a.colorLine,a.color),s.drawFertsLine(t,e,i,n,2*o-o*a.procent,2*o-o*s.levels[c+1].procent,a.colorLine,a.color))}))},changePosition:function(t,e){if(this.testible){var i={x:t-this.mouse.x1,y:e-this.mouse.y2};this.secondPin.x+=i.x,this.secondPin.y+=i.y,this.ferstPin.x+=i.x,this.ferstPin.y+=i.y}},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth)||this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.threePin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.threePin.y),t.layerX,t.layerY,this.lineWidth)?this.change=!0:this.change=!1,this.changeFirstPos){var e=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.ferstPin.x=e,void(this.ferstPin.y=i)}if(this.changeSecPos){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.secondPin.x=o,void(this.secondPin.y=n)}if(this.changeThreePin){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);return this.fromMouse=!1,this.threePin.x=s,void(this.threePin.y=r)}this.mousedownOnLine&&this.changePosition(this.mousedownOnLine.x,this.mousedownOnLine.y)},init:function(){var t=this;if(this.getToken){var e,i=JSON.parse(localStorage.getItem(localStorage.getItem("currentSymbol").replace(/"/g,"")))["default"];Array.isArray(i)&&(e=i.find((function(e){return e.id===t.$props.id}))),e&&Object.keys(e).forEach((function(i){t[i]=e[i]}))}},mouseup:function(){this.mousedownOnLine=void 0,this.changeFirstPos&&(this.changeFirstPos=!1),this.changeSecPos&&(this.changeSecPos=!1),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=JSON.parse(localStorage.getItem("dragOverlay")).arr;if(this.counterClick>2){if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.$2screen(this.ferstPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeFirstPos=!0));if(this.hover(t.layerX,t.layerY,this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.secondPin.y)))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),i.length&&i.find((function(t){return t===e.$props.id}))||(i.push(this.$props.id),localStorage.setItem("dragOverlay",JSON.stringify({arr:i}))),void(0===i.findIndex((function(t){return t===e.$props.id}))&&(this.changeSecPos=!0));if(this.checkPinOnLIne(this.$props.layout.t2screen(this.ferstPin.x),this.$props.layout.t2screen(this.secondPin.x),this.$props.layout.$2screen(this.ferstPin.y),this.$props.layout.$2screen(this.secondPin.y),t.layerX,t.layerY,this.lineWidth))return this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),void(this.mousedownOnLine={x:t.pageX,y:t.pageY});this.change=!1}if(1===this.counterClick){var o=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.ferstPin.x=o,this.ferstPin.y=n,this.counterClick++}else if(2===this.counterClick){var s=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),r=this.$props.layout.screen2$(t.layerY);this.fromMouse=!1,this.secondPin.x=s,this.secondPin.y=r,this.counterClick++,this.changeThreePin=!0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{testBC:{x:null,y:null},levels:[{procent:.236,color:"rgba(153,0,0,0.25)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{procent:.786,color:"rgba(153,22,123,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],reverLevels:[{procent:1,color:"rgba(153,153,153,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0},{procent:.786,color:"rgba(217,217,217,0.25)",colorLine:"rgba(11,83,148, 1)",dash:[],isShow:!0},{procent:.618,color:"rgba(11,83,148, 0.25)",colorLine:"rgba(19,92,76, 1)",dash:[],isShow:!0},{procent:.5,color:"rgba(19,92,76, 0.25)",colorLine:"rgba(27,143,108,1)",dash:[],isShow:!0},{procent:.382,color:"rgba(27,143,108,0.25)",colorLine:"rgba(106,168,79,1)",dash:[],isShow:!0},{procent:.236,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,0,0,1)",dash:[],isShow:!0},{procent:0,color:"rgba(153,0,0,0.18)",colorLine:"rgba(153,153,153,1)",dash:[],isShow:!0}],counterDoubleClick:0,mousedownOnLine:!1,counterClick:1,title:"fibRetraceWord",threePin:{x:void 0,y:void 0},ferstPin:{x:void 0,y:void 0},secondPin:{x:void 0,y:void 0},ctx:void 0,mouse:{x:void 0,y:void 0},colorLine:"#2e66e0",typeLine:[],lineWidth:2,isShowText:!1,leftText:!0,rigthText:!0}}},LCt=$Ct,FCt=Object(C["a"])(LCt,Vvt,Hvt,!1,null,null,null),jCt=FCt.exports,RCt=(i("cc71"),i("c5d0"),function(){var t=this,e=this,i=e._self._c;return i("div",{style:{zIndex:15,position:"absolute",top:"40px",right:"250px"}},["full"===e.typeModal?i("DxDraggable",{attrs:{handle:"#zone-drag"}},[i("div",{staticClass:"container-full"},[i("div",{staticClass:"zone-drag full",attrs:{id:"zone-drag"}},[i("svgIcon",{attrs:{name:"Drag"}})],1),i("div",{staticClass:"right-section"},[i("div",{staticClass:"header-full"},[i("div",{staticClass:"title-modal-box"},[i("svgIcon",{attrs:{name:e.nameIconTitle}}),i("div",{staticClass:"title-modal"},[e._v(e._s(e.$t(e.title)))])],1),void 0===e.isVideo&&void 0===e.isAudio?i("div",{staticClass:"shablon-box"},[i("div",[e._v(e._s(e.$t("sampleWord")))]),i("svgIcon",{attrs:{name:"dropdown-arrow"}})],1):e._e(),void 0===e.isVideo&&void 0===e.isAudio?i("div",{staticClass:"batton-box"},[i("svgIcon",{attrs:{name:"new-refrash"}})],1):e._e(),i("div",{staticClass:"batton-box",on:{click:function(){return e.typeModal="fast"}}},[i("svgIcon",{attrs:{name:"new-close"}})],1)]),void 0!==e.videoURL&&e.videoShow?i("video",{staticClass:"video-tag",attrs:{autoplay:"autoplay",id:"id-video",controls:"",src:e.videoURL}}):e._e(),e.videoShow?i("video",{directives:[{name:"show",rawName:"v-show",value:e.isRecordVideo&&void 0===e.videoURL,expression:"isRecordVideo && videoURL === undefined"}],ref:"videoref",staticClass:"video-tag"}):e._e(),e.videoShow&&!e.proetcionVideo?i("div",{staticClass:"cnt-video-btn"},["Стоп"===this.textButtonAudio?i("div",{staticClass:"button-record video"},[i("div",{staticClass:"container-button",on:{click:e.testFunction}},[i("svgIcon",{attrs:{name:"Video-stop"}}),i("div",{staticClass:"text-button"},[e._v(" "+e._s(this.getTimerTime)+" ")])],1)]):e._e(),"Стоп"!==this.textButtonAudio?i("div",{staticClass:"button-record video",on:{click:e.testFunction}},[i("div",{staticClass:"container-button"},[i("div",{staticClass:"text-button"},[e._v(" "+e._s(this.textButtonAudio)+" ")])])]):e._e(),e.isSave?i("div",{staticClass:"button-record video sGreen mL30",on:{click:e.sendVideo}},[i("div",{staticClass:"container-button"},[i("div",{staticClass:"text-button"},[e._v(e._s(e.$t("save")))])])]):e._e()]):e._e(),e.videoShow?e._e():i("div",{staticClass:"body-full"},[void 0!==e.borderColor?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param"},[e._v(e._s(e.$t("boundWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.dashLineIcon?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLine,expression:"closeShowListTypeLine"}],staticClass:"drop-down mxW37 btn-brd mr-r",on:{click:function(){return t.openDropDown("showListTypeLine")}}},[i("div",{staticClass:"drop-element mxW37 drop-elem-btn"},[i("svgIcon",{attrs:{name:e.dashLineIcon}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLine?i("div",{staticClass:"drop-list drop-list-full mHeigth mxW37 test-left"},[i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownDashLine("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownDashLine("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownDashLine("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1):e._e(),void 0!==e.lineWidth?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListWidthLine,expression:"closeShowListWidthLine"}],staticClass:"drop-down btn-brd mr-r",attrs:{id:"dropdownwidth"},on:{click:function(){return t.openDropDown("showListWidthLine")}}},[i("div",{staticClass:"drop-element without-shadow drop-elem-btn"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.lineWidth))]),i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListWidthLine?i("div",{staticClass:"drop-list drop-list-full"},e._l(e.listWidthsLine,(function(t){return i("div",{key:t,staticClass:"drop-element drop-elem-list",on:{click:function(){return e.changeValueFromDropDown("lineWidth",t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))]),i("svgIcon",{attrs:{name:"line".concat(t.replace(/\s/g,""))}})],1)})),0):e._e()])],1):e._e(),void 0!==e.mainColor&&void 0===e.mainColorLine?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.borderColor},on:{changeColor:e.setNewBorderColor}})],1):e._e()]):e._e(),void 0!==e.borderColor?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param"},[e._v(e._s(e.$t("backWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.mainColor&&void 0===e.mainColorLine?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.mainColor},on:{changeColor:e.setNewColor}})],1):e._e()]):e._e(),void 0===e.fontSizeMessage&&void 0===e.borderColor&&void 0!==e.colorPrice?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param whSp"},[e._v(e._s(e.$t("lbltxtWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.mainColor&&void 0===e.mainColorLine?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.colorPrice},on:{changeColor:e.setColorText}})],1):e._e()]):e._e(),void 0===e.fontSizeMessage&&void 0===e.borderColor&&void 0===e.colorPrice&&void 0===e.textColorMedia?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param"},[e._v(e._s(e.$t("linesWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.mainColor&&void 0===e.mainColorLine&&void 0===e.upColor?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.mainColor},on:{changeColor:e.setNewColor}})],1):e._e(),void 0!==e.mainColorLine&&void 0===e.upColor?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.mainColorLine,disabled:e.oneColor},on:{changeColor:e.setNewColorLine}})],1):e._e(),void 0!==e.lineWidth?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListWidthLine,expression:"closeShowListWidthLine"}],staticClass:"drop-down btn-brd mr-r",attrs:{id:"dropdownwidth"},on:{click:function(){return t.openDropDown("showListWidthLine")}}},[i("div",{staticClass:"drop-element without-shadow drop-elem-btn"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.lineWidth))]),i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListWidthLine?i("div",{staticClass:"drop-list drop-list-full"},e._l(e.listWidthsLine,(function(t){return i("div",{key:t,staticClass:"drop-element drop-elem-list",on:{click:function(){return e.changeValueFromDropDown("lineWidth",t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))]),i("svgIcon",{attrs:{name:"line".concat(t.replace(/\s/g,""))}})],1)})),0):e._e()])],1):e._e(),void 0!==e.nameIconStartLine?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListStartLine,expression:"closeShowListStartLine"}],staticClass:"drop-down mxW37 btn-brd mr-r",attrs:{id:"dropdowstartLine"},on:{click:function(){return t.openDropDown("showListStartLine")}}},[i("div",{staticClass:"drop-element without-shadow mxW37 drop-elem-btn"},[i("svgIcon",{attrs:{name:e.nameIconStartLine}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListStartLine?i("div",{staticClass:"drop-list drop-list-full mxW37 test-left mxH212"},[i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","larrow")}}},[i("svgIcon",{attrs:{name:"larrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","fillsqarrow")}}},[i("svgIcon",{attrs:{name:"fillsqarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","strokesqarrow")}}},[i("svgIcon",{attrs:{name:"strokesqarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","strokecrclarrow")}}},[i("svgIcon",{attrs:{name:"strokecrclarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","whatarrow")}}},[i("svgIcon",{attrs:{name:"whatarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeStartLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1)]):e._e()])],1):e._e(),void 0!==e.nameIconTypeLine&&void 0===e.nameIconTypeLineLevel?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLine,expression:"closeShowListTypeLine"}],staticClass:"drop-down mxW45 btn-brd mr-r",attrs:{id:"dropdowsTypeLine"},on:{click:function(){return t.openDropDown("showListTypeLine")}}},[i("div",{staticClass:"drop-element without-shadow mxW45"},[i("svgIcon",{attrs:{name:e.nameIconTypeLine}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLine?i("div",{staticClass:"drop-list mHeigth mxW45 pd2-6 lineWhitoutWidth"},[i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1):e._e(),void 0!==e.nameIconTypeLineLevel?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLineLevel,expression:"closeShowListTypeLineLevel"}],staticClass:"drop-down mxW37 btn-brd mr-r",attrs:{id:"dropdowsnameIconTypeLineLevel"},on:{click:function(){return t.openDropDown("showListTypeLineLevel")}}},[i("div",{staticClass:"drop-element without-shadow mxW37 drop-elem-btn"},[i("svgIcon",{attrs:{name:e.nameIconTypeLineLevel}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLineLevel?i("div",{staticClass:"drop-list drop-list-full mHeigth mxW37 test-left"},[i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1):e._e(),void 0!==e.nameIconEndLine?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListEndLine,expression:"closeShowListEndLine"}],staticClass:"drop-down mxW37 btn-brd mr-r",attrs:{id:"dropdowsnameIconEndLine"},on:{click:function(){return t.openDropDown("showListEndLine")}}},[i("div",{staticClass:"drop-element without-shadow mxW37 drop-elem-btn"},[i("svgIcon",{attrs:{name:e.nameIconEndLine}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListEndLine?i("div",{staticClass:"drop-list drop-list-full mxW37 test-left mxH212"},[i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","new-arrow-mid")}}},[i("svgIcon",{attrs:{name:"new-arrow-mid"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","fillsqarrow")}}},[i("svgIcon",{attrs:{name:"fillsqarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","strokesqarrow")}}},[i("svgIcon",{attrs:{name:"strokesqarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","strokecrclarrow")}}},[i("svgIcon",{attrs:{name:"strokecrclarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","whatarrow")}}},[i("svgIcon",{attrs:{name:"whatarrow"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDown("typeEndLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1)]):e._e()])],1):e._e()]):e._e(),void 0!==e.midlePin?i("div",{staticClass:"setting"},[void 0!==e.midlePin?i("div",[i("DxCheckBox",{attrs:{value:e.midlePin,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("midlePin")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("shmpWord")))])]):e._e(),void 0!==e.downColor?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param"},[e._v(e._s(e.$t("slclWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.downColor?i("div",{staticClass:"btn-brd mr-r"},[void 0!==e.downColor?i("NewColorPicker",{attrs:{color:e.downColor,icon:"colorLine"},on:{changeColor:function(t){return e.setAnyColor(t,"downColor")}}}):e._e()],1):e._e()]):e._e(),void 0!==e.upColor?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param"},[e._v(e._s(e.$t("bstclWord")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.upColor?i("div",{staticClass:"btn-brd mr-r"},[void 0!==e.upColor?i("NewColorPicker",{attrs:{color:e.upColor,icon:"colorLine"},on:{changeColor:function(t){return e.setAnyColor(t,"upColor")}}}):e._e()],1):e._e()]):e._e(),void 0!==e.isShowPriceB?i("div",{staticClass:"setting"},[void 0!==e.isShowPriceB?i("div",[i("DxCheckBox",{attrs:{value:e.isShowPriceB,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowPriceB")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dprWord")))])]):e._e(),void 0!==e.isShowLines?i("div",{staticClass:"setting"},[void 0!==e.isShowLines?i("div",[i("DxCheckBox",{attrs:{value:e.isShowLines,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowLines")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("stlWord")))])]):e._e(),void 0!==e.isShowPips?i("div",{staticClass:"setting"},[void 0!==e.isShowPips?i("div",[i("DxCheckBox",{attrs:{value:e.isShowPips,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowPips")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dspsWord")))])]):e._e(),void 0!==e.isShowProcentB?i("div",{staticClass:"setting"},[void 0!==e.isShowProcentB?i("div",[i("DxCheckBox",{attrs:{value:e.isShowProcentB,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowProcentB")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dspprcWord")))])]):e._e(),void 0!==e.isShowBars?i("div",{staticClass:"setting"},[void 0!==e.isShowBars?i("div",[i("DxCheckBox",{attrs:{value:e.isShowBars,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowBars")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("daropib")))])]):e._e(),void 0!==e.isShowAngle?i("div",{staticClass:"setting"},[void 0!==e.isShowAngle?i("div",[i("DxCheckBox",{attrs:{value:e.isShowAngle,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowAngle")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("showAngle")))])]):e._e(),void 0!==e.isShowValues?i("div",{staticClass:"setting"},[void 0!==e.isShowValues?i("div",[i("DxCheckBox",{attrs:{value:e.isShowValues,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowValues")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("advWord")))])]):e._e(),void 0!==e.showTime?i("div",{staticClass:"setting"},[void 0!==e.showTime?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.showTime,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("showTime")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dsptm")))])]):e._e(),void 0!==e.widthTradeLine?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("lvln"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListWidthLineLevels,expression:"closeShowListWidthLineLevels"}],staticClass:"drop-down btn-brd mr-r",on:{click:function(){return t.openDropDown("showListWidthLineLevels")}}},[i("div",{staticClass:"drop-element without-shadow drop-elem-btn"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.lineWidth))]),i("svgIcon",{attrs:{name:e.widthTradeLineIcon}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListWidthLineLevels?i("div",{staticClass:"drop-list drop-list-full"},e._l(e.listWidthsLine,(function(t){return i("div",{key:t,staticClass:"drop-element drop-elem-list",on:{click:function(){return e.changeValueWidthTradeLine(parseInt(t))}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))]),i("svgIcon",{attrs:{name:"line".concat(t.replace(/\s/g,""))}})],1)})),0):e._e()])],1),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLine,expression:"closeShowListTypeLine"}],staticClass:"drop-down mxW37 btn-brd mr-r",on:{click:function(){return t.openDropDown("showListTypeLine")}}},[i("div",{staticClass:"drop-element mxW37 drop-elem-btn"},[i("svgIcon",{attrs:{name:e.dashTradeLineIcon}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLine?i("div",{staticClass:"drop-list drop-list-full mHeigth mxW37 test-left"},[i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTradeLine("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTradeLine("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element drop-elem-list mxW37 test-size",on:{click:function(){return e.changeValueFromDropDownTradeLine("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1)]):e._e(),void 0!==e.staticWidth?i("div",{style:{display:"flex"}},[void 0!==e.staticWidth?i("div",{staticClass:"setting",style:{marginRight:"15px"}},[i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("lenWord"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListStacicWidthLineLevels,expression:"closeShowListStacicWidthLineLevels"}],staticClass:"drop-down btn-brd mr-r",on:{click:function(){return t.openDropDown("showListWidthLineLevelsFib")}}},[i("div",{staticClass:"drop-element without-shadow mxW37 mHeigth drop-elem-btn"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.staticWidth))])]),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListWidthLineLevelsFib?i("div",{staticClass:"drop-list mHeigth drop-list-full",style:{maxHeight:"105px",zIndex:702}},e._l(e.listStaticWidthsLine,(function(t){return i("div",{key:t,staticClass:"drop-element mxW37 drop-elem-list",on:{click:function(){return e.changeValueStaticWidthTradeLine(parseInt(t))}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))])])})),0):e._e()])],1)]):e._e(),void 0!==e.staticWidth?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("distance"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListIdent,expression:"closeShowListIdent"}],staticClass:"drop-down btn-brd mr-r",on:{click:function(){return t.openDropDown("showListIdent")}}},[i("div",{staticClass:"drop-element without-shadow mxW37 mHeigth drop-elem-btn"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.ident))])]),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListIdent?i("div",{staticClass:"drop-list mHeigth drop-list-full",style:{maxHeight:"105px",zIndex:702}},e._l(e.identList,(function(t){return i("div",{key:t,staticClass:"drop-element mxW37 drop-elem-list",on:{click:function(){return e.changeValueIdentList(parseInt(t))}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))])])})),0):e._e()])],1)]):e._e()]):e._e(),void 0!==e.textColorMedia?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("chartTradingLeftBarMenuSettingTextMarketsList0"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.textColorMedia,icon:"colorText"},on:{changeColor:function(t){return e.setAnyColor(t,"textColorMedia")}}})],1)]):e._e(),void 0!==e.fontSizeMessage?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("chartTradingLeftBarMenuSettingTextMarketsList0"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.textColor,icon:"colorText"},on:{changeColor:e.setNewColorText}})],1),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListFontSizeMessageList,expression:"closeShowListFontSizeMessageList"}],staticClass:"drop-down mxW42 btn-brd",on:{click:function(){return t.openDropDown("showListFontSizeMessageList")}}},[i("div",{staticClass:"drop-element without-shadow"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.fontSizeMessage))]),i("svgIcon",{attrs:{name:"dropdown-arrow"}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListFontSizeMessageList?i("div",{staticClass:"drop-list",style:{height:"287px"}},e._l(e.fontSizeMessageList,(function(t){return i("div",{key:t+"fntszm",staticClass:"drop-element mxW42",on:{click:function(){return e.changeFontSize(t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))])])})),0):e._e()])],1),void 0!==e.bold?i("div",{staticClass:"btn-brd mr-r",style:{padding:"4px",marginLeft:"6px",cursor:"pointer"},on:{click:function(){return e.changeTypeText("bold")}}},[i("svgIcon",{attrs:{name:"new-bold"}})],1):e._e(),void 0!==e.italic?i("div",{staticClass:"btn-brd mr-r",style:{padding:"4px",cursor:"pointer"},on:{click:function(){return e.changeTypeText("italic")}}},[i("svgIcon",{attrs:{name:"new-italic"}})],1):e._e()]):e._e(),void 0!==e.messageText?i("div",{staticClass:"text-area-box"},[i("textarea",{staticClass:"setting-text-area",attrs:{placeholder:"Изменяемый текст"},domProps:{value:e.messageText},on:{input:function(t){return e.debouncerForText(e.changeText,t,350)}}})]):e._e(),void 0===e.borderColor&&void 0!==e.colorCircle?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param whSp"},[e._v(e._s(e.$t("lbb")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.colorCircle?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.colorCircle},on:{changeColor:e.setColorCircle}})],1):e._e()]):e._e(),void 0!==e.colorCircle&&void 0!==e.colorLine?i("div",{staticClass:"setting"},[i("div",{staticClass:"title-param whSp"},[e._v(e._s(e.$t("linCol")))]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.colorLine?i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.colorLine,icon:"colorLine"},on:{changeColor:e.setNewColor}})],1):e._e()]):e._e(),void 0!==e.fontSizeMessage&&void 0===e.colorCircle&&void 0===e.colorUp?i("div",{staticClass:"setting"},[void 0!==e.fillBackGround?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.fillBackGround,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("fillBackGround")}}})],1):e._e(),i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("backWord"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.mainColor},on:{changeColor:e.setNewColor}})],1)]):e._e(),void 0!==e.colorUp?i("div",{staticClass:"setting"},[void 0!==e.isShowUp?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.isShowUp,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowUp")}}})],1):e._e(),i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("stopLevel"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.colorUp},on:{changeColor:function(t){return e.setAnyColor(t,"colorUp")}}})],1)]):e._e(),void 0!==e.colorDown?i("div",{staticClass:"setting"},[void 0!==e.isShowDown?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.isShowDown,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowUp")}}})],1):e._e(),i("div",{staticClass:"title-param",style:{whiteSpace:"nowrap"}},[e._v(" "+e._s(e.$t("trg"))+" ")]),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.colorDown},on:{changeColor:function(t){return e.setAnyColor(t,"colorDown")}}})],1)]):e._e(),void 0!==e.showTime?i("div",{staticClass:"setting"},[void 0!==e.showTime?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.showTime,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("showTime")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dsptm")))])]):e._e(),void 0!==e.showPrice?i("div",{staticClass:"setting"},[void 0!==e.showPrice?i("div",{style:{marginRight:"8px"}},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.showPrice,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("showPrice")}}})],1):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("dsppr")))])]):e._e(),e.levels&&e.levels.length>0?i("div",{staticClass:"setting",style:{marginBottom:"16px",display:"flex"}},[i("div",{staticClass:"check-box-conatiner"},[i("DxCheckBox",{attrs:{"element-attr":{class:"dx-checkbox-container.dxNoneOverfolw"},value:e.oneColor,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("oneColor")}}}),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("uoc")))])],1),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:e.oneColorValue},on:{changeColor:e.setOneColor}})],1)]):e._e(),i("div",[e.levels&&e.levels.length>0?i("div",{staticClass:"modifyContent",style:{marginBottom:"16px",display:"flex",maxWidth:void 0===e.isShowPrice&&"170px"}},[i("div",{staticClass:"check-box-conatiner"},[i("DxCheckBox",{attrs:{value:e.isShowProcent,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowProcent")}}}),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("lvls")))])],1),void 0!==e.isShowPrice?i("div",{staticClass:"check-box-conatiner"},[void 0!==e.isShowPrice?i("DxCheckBox",{attrs:{value:e.isShowPrice,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowPrice")}}}):e._e(),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("pricesWord")))])],1):e._e(),i("div",{staticClass:"check-box-conatiner"},[i("DxCheckBox",{attrs:{value:e.isShowSection,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowSection")}}}),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("backWord")))])],1)]):e._e(),void 0!==e.leftText||void 0!==e.rigthText||void 0!==e.isShowText?i("div",{staticClass:"setting",style:{marginBottom:"16px",display:"flex"}},[i("div",{staticClass:"check-box-conatiner"},[i("DxCheckBox",{attrs:{value:e.isShowText,width:25},on:{valueChanged:function(){return e.handleChangeCheckBox("isShowText")}}}),i("div",{staticClass:"check-box-label"},[e._v(e._s(e.$t("lbls")))])],1),i("div",{staticClass:"gray-line-container"},[i("div",{staticClass:"gray-line"})]),void 0!==e.descriptionShowingDescription?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListPositionLevelDescription,expression:"closeShowListPositionLevelDescription"}],staticClass:"drop-down btn-brd mr-r w121",style:{zIndex:99},on:{click:function(){return t.openDropDown("showListPositionLevelDescription")}}},[i("div",{staticClass:"drop-element drop-elem-btn w121"},[i("div",{staticClass:"mt3 whSp"},[e._v(" "+e._s(e.descriptionShowingDescription)+" ")]),i("div",{style:{zIndex:700}},[i("svgIcon",{attrs:{name:"dropdown-arrow"}})],1)]),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListPositionLevelDescription?i("div",{staticClass:"drop-list drop-list-full w121 h107"},[i("div",{staticClass:"drop-element drop-elem-list w121",on:{click:function(){return e.changePositionDescription("second")}}},[i("div",{staticClass:"mt3"},[e._v(e._s(e.$t("btmn")))])]),i("div",{staticClass:"drop-element drop-elem-list w121",on:{click:function(){return e.changePositionDescription("right")}}},[i("div",{staticClass:"mt3"},[e._v(e._s(e.$t("rightWr")))])]),i("div",{staticClass:"drop-element drop-elem-list w121",on:{click:function(){return e.changePositionDescription("left")}}},[i("div",{staticClass:"mt3"},[e._v(e._s(e.$t("LeftWr")))])])]):e._e()])],1):e._e()]):e._e(),e.levels&&e.levels.length>0?i("div",{staticClass:"fib-levels"},e._l(e.levels,(function(t,o){return i("div",{key:"".concat(t.procent,"-setting"),staticClass:"level-setting"},[i("DxCheckBox",{attrs:{value:t.isShow,width:80},on:{valueChanged:function(){return e.handleShowLvl(o,t.isShow)}}}),i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeSettingProcent,expression:"closeSettingProcent"}],staticClass:"drop-down btn-brd mr-r",style:{cursor:"pointer"},attrs:{id:"node-fib".concat(o)}},[i("div",{staticClass:"drop-element drop-elem-btn"},[i("input",{staticClass:"input-setting",attrs:{type:"text"},domProps:{value:t.procent},on:{input:function(i){return e.debouncer(e.testFunc,i,300,o,t)},click:function(){return e.openDropDownSetting(o,!t.openDropDown)}}}),i("div",{style:{display:"flex",width:"24px",height:"24px"},attrs:{id:"dropdownicon"},on:{click:function(){return e.openDropDownSetting(o,!t.openDropDown,100)}}},[i("svgIcon",{attrs:{name:"input-dropdown-arrow"}})],1)]),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.levels[o].openDropDown?i("div",{staticClass:"drop-list drop-list-full mxH282"},e._l(e.fibList,(function(t){return i("div",{key:t,staticClass:"drop-element drop-elem-list",on:{click:function(){return e.changeLvlProcent(o,t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))])])})),0):e._e()])],1),i("div",{staticClass:"btn-brd mr-r"},[i("NewColorPicker",{attrs:{color:t.color,disabled:e.oneColor},on:{changeColor:function(t){return e.setLvlColor(o,t)}}})],1),i("div",{style:{width:"22px",height:"22px",color:"rgba(140, 140, 140, 1)",cursor:"pointer"},on:{click:function(){return e.delLevel(o)}}},[i("svgIcon",{attrs:{name:"new-close"}})],1)],1)})),0):e._e(),e.levels&&e.levels.length>0?i("div",{staticClass:"btn-add-levels whSp",on:{click:e.addLevel}},[e._v(" "+e._s(e.$t("addlvl"))+" ")]):e._e()])])])])]):e._e(),"fast"===e.typeModal?i("DxDraggable",{attrs:{handle:"#zone-drag"}},[i("div",{staticClass:"container",attrs:{boundary:"#zone-drag"}},[i("div",{staticClass:"drag-box",attrs:{id:"zone-drag"}},[i("svgIcon",{attrs:{name:"Drag"}})],1),void 0!==e.mainColor&&void 0===e.mainColorLine?i("NewColorPicker",{attrs:{color:e.mainColor},on:{changeColor:e.setNewColor}}):e._e(),void 0!==e.colorPrice?i("NewColorPicker",{attrs:{color:e.colorPrice,icon:"colorText"},on:{changeColor:e.setColorText}}):e._e(),void 0!==e.textColor?i("NewColorPicker",{attrs:{color:e.textColor,icon:"colorText"},on:{changeColor:e.setNewColorText}}):e._e(),void 0!==e.colorLine?i("NewColorPicker",{attrs:{color:e.colorLine,icon:"colorLine"},on:{changeColor:e.setNewColor}}):e._e(),void 0!==e.mainColorLine?i("NewColorPicker",{attrs:{color:e.mainColorLine,disabled:e.oneColor},on:{changeColor:e.setNewColorLine}}):e._e(),void 0!==e.borderColor?i("NewColorPicker",{attrs:{color:e.borderColor},on:{changeColor:e.setNewBorderColor}}):e._e(),void 0!==e.colorUp?i("NewColorPicker",{attrs:{color:e.colorUp},on:{changeColor:function(t){return e.setAnyColor(t,"colorUp")}}}):e._e(),void 0!==e.colorDown?i("NewColorPicker",{attrs:{color:e.colorDown},on:{changeColor:function(t){return e.setAnyColor(t,"colorDown")}}}):e._e(),void 0!==e.upColor?i("NewColorPicker",{attrs:{color:e.upColor,icon:"colorLine"},on:{changeColor:function(t){return e.setAnyColor(t,"upColor")}}}):e._e(),void 0!==e.downColor?i("NewColorPicker",{attrs:{color:e.downColor,icon:"colorLine"},on:{changeColor:function(t){return e.setAnyColor(t,"downColor")}}}):e._e(),void 0!==e.isVideo?i("div",{staticClass:"button-record video hei80p",on:{click:e.handleRecordVideo}},[i("div",{staticClass:"container-button"},[i("svgIcon",{attrs:{name:"Video"}}),i("div",{staticClass:"text-button"},[e._v(" "+e._s(this.textForButton)+" ")])],1)]):e._e(),void 0!==e.isVideo&&void 0!==e.videoURL?i("div",{staticClass:"button-record sGreen video hei80p",on:{click:e.handleStartVideo}},[i("div",{staticClass:"container-button",style:{marginLeft:"4px"}},[i("svgIcon",{attrs:{name:"play-video"}})],1)]):e._e(),void 0!==e.isAudio?i("div",{staticClass:"button-record"},[i("div",{staticClass:"container-button"},[i("svgIcon",{attrs:{name:"new-audio-note"}}),i("div",{staticClass:"text-button",style:{whiteSpace:"nowrap"},on:{click:e.handleRecord}},[e._v(" "+e._s(this.textForButton)+" "+e._s(" "+this.stopwatch)+" ")])],1)]):e._e(),void 0!==e.isAudio?i("audio",{staticClass:"audio-block",attrs:{controls:"",src:e.audioURL}}):e._e(),void 0!==e.fontSizeMessage&&void 0===e.borderColor&&void 0===e.colorPrice&&void 0===e.isVideo?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListFontSizeMessageList,expression:"closeShowListFontSizeMessageList"}],staticClass:"drop-down mxW42",on:{click:function(){return t.openDropDown("showListFontSizeMessageList")}}},[i("div",{staticClass:"drop-element"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.fontSizeMessage))]),i("svgIcon",{attrs:{name:"dropdown-arrow"}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListFontSizeMessageList?i("div",{staticClass:"drop-list",style:{height:"307px"}},e._l(e.fontSizeMessageList,(function(t){return i("div",{key:t+"fntszm",staticClass:"drop-element mxW42",on:{click:function(){return e.changeFontSize(t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))])])})),0):e._e()])],1):e._e(),void 0===e.fontSizeMessage&&void 0===e.borderColor&&void 0!==e.lineWidth&&void 0===e.colorPrice&&void 0===e.isVideo?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListWidthLine,expression:"closeShowListWidthLine"}],staticClass:"drop-down",on:{click:function(){return t.openDropDown("showListWidthLine")}}},[i("div",{staticClass:"drop-element"},[i("div",{staticClass:"mt3"},[e._v(e._s(e.lineWidth))]),i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListWidthLine?i("div",{staticClass:"drop-list lineWidthList"},e._l(e.listWidthsLine,(function(t){return i("div",{key:t,staticClass:"drop-element",on:{click:function(){return e.changeValueFromDropDown("lineWidth",t)}}},[i("div",{staticClass:"mt3"},[e._v(e._s(t))]),i("svgIcon",{attrs:{name:"line".concat(t.replace(/\s/g,""))}})],1)})),0):e._e()])],1):e._e(),void 0===e.nameIconTypeLineLevel&&void 0!==e.nameIconTypeLine&&void 0===e.fontSizeMessage&&void 0===e.borderColor&&void 0===e.colorPrice&&void 0===e.isVideo?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLine,expression:"closeShowListTypeLine"}],staticClass:"drop-down mxW45",on:{click:function(){return t.openDropDown("showListTypeLine")}}},[i("div",{staticClass:"drop-element mxW45"},[i("svgIcon",{attrs:{name:e.nameIconTypeLine}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLine?i("div",{staticClass:"drop-list mHeigth mxW45 pd2-6 lineWhitoutWidth"},[i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element mxW45",on:{click:function(){return e.changeValueFromDropDown("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1):e._e(),void 0!==e.nameIconTypeLineLevel&&void 0===e.borderColor&&void 0===e.colorPrice&&void 0===e.isVideo?i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.closeShowListTypeLineLevel,expression:"closeShowListTypeLineLevel"}],staticClass:"drop-down mxW37",attrs:{id:"dropdowsnameIconTypeLineLevel"},on:{click:function(){return t.openDropDown("showListTypeLineLevel")}}},[i("div",{staticClass:"drop-element mxW49"},[i("svgIcon",{attrs:{name:e.nameIconTypeLineLevel}})],1),i("transition",{attrs:{name:"fast-setting-drop-down"}},[e.showListTypeLineLevel?i("div",{staticClass:"drop-list mHeigth mxW49 lineWhitoutWidth"},[i("div",{staticClass:"drop-element mxW49",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","line".concat(e.lineWidth.replace(/\s/g,"")))}}},[i("svgIcon",{attrs:{name:"line".concat(e.lineWidth.replace(/\s/g,""))}})],1),i("div",{staticClass:"drop-element mxW49",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","new-dashedline")}}},[i("svgIcon",{attrs:{name:"new-dashedline"}})],1),i("div",{staticClass:"drop-element mxW49",on:{click:function(){return e.changeValueFromDropDownTypeLine("typeLine","new-dottedline")}}},[i("svgIcon",{attrs:{name:"new-dottedline"}})],1)]):e._e()])],1):e._e(),i("div",{staticClass:"grey-box",on:{click:this.openSetting}},[i("svgIcon",{attrs:{name:"new-setting"}})],1),i("div",{staticClass:"grey-box",on:{click:this.deleteOverlay}},[i("svgIcon",{attrs:{name:"new-delete"}})],1),void 0===e.isVideo&&void 0===e.isAudio?i("div",{staticClass:"grey-box",on:{click:this.copyOverlay}},[i("svgIcon",{attrs:{name:"new-copy"}})],1):e._e(),i("div",{staticClass:"grey-box",on:{click:this.closeModal}},[i("svgIcon",{attrs:{name:"new-close"}})],1)],1)]):e._e()],1)}),WCt=[],NCt=function(){var t,e=this,i=e._self._c;return i("div",{style:{position:e.byRightSide?"relative":"static"}},[e.id?i("div",{staticClass:"select-color",class:e.modyfire||" ",style:{width:e.widthPicker},attrs:{id:e.id},on:{click:function(){e.disabled||(e.showColorPicker=!e.showColorPicker)}}},[i("svgIcon",{style:{color:e.newColor||e.color,stroke:"#C3C3C333"},attrs:{id:e.id+"svg",name:e.icon}})],1):e._e(),i("transition",{attrs:{name:"fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.showColorPicker,expression:"showColorPicker"},{name:"click-outside",rawName:"v-click-outside",value:e.closeModal,expression:"closeModal"}],staticClass:"container-colors",class:"container-colors_".concat(e.getActiveTheme," ").concat(e.className),style:e.styleForPicker},[i("div",[i("div",{staticClass:"last-colors"},[i("div",{staticClass:"list-colors mWidth"},[i("div",{style:{display:"flex"}},[i("div",{staticClass:"color mb mr red-line",style:{backgroundColor:"rgba(255,255,255,0)"},on:{click:function(){return e.changeColor("rgba(255,255,255,0)")}}}),e._l(e.parentColors,(function(t){return i("div",{key:t,staticClass:"color mb mr",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})}))],2)])]),i("div",{staticClass:"select-colors"},[i("div",{staticClass:"list-colors pTop2"},[i("div",{staticClass:"row-colors mr"},e._l(e.whiteList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.tealList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.darkslateblueList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.darkPurpleList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.purpleList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.lightPurpleList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.firebrick,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.orangered,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.yellowList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors mr"},e._l(e.darkGreenList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0),i("div",{staticClass:"row-colors"},e._l(e.salatList,(function(t){return i("div",{key:t,staticClass:"color mb",style:{backgroundColor:t},on:{click:function(){return e.changeColor(t)}}})})),0)])]),e.visibleOpacityLine?i("div",{staticClass:"opacity-color"},[i("div",{staticClass:"slider-color"},[i("div",{style:{paddingTop:"14px"}},[i("div",{staticClass:"slider trans",style:(t={marginBottom:"-8px",width:"100%",background:"rgb(255,255,255)"},Object(Vt["a"])(t,"background","linear-gradient(90deg, rgba(255,255,255,1) 0, ".concat(e.changeAlfa(e.newColor||e.color,1)," 100%)")),Object(Vt["a"])(t,"backgroundColor",e.color),t)}),i("input",{directives:[{name:"model",rawName:"v-model",value:e.procent,expression:"procent"}],staticClass:"inputRange",attrs:{type:"range",min:"0",value:"100",max:"100",step:"1"},domProps:{value:e.procent},on:{__r:function(t){e.procent=t.target.value}}})]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.procent,expression:"procent"}],staticClass:"input-procent",attrs:{type:"text"},domProps:{value:e.procent},on:{input:function(t){t.target.composing||(e.procent=t.target.value)}}})])]):e._e()]),e.isRighSection?i("div",{staticClass:"container-righ-section"},[i(e.rightSection,{tag:"component",attrs:{color:e.newColor}})],1):e._e()])])],1)},ECt=[],UCt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"80px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"40px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})]),e("div",{staticClass:"candle-cnt"},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})])])])},VCt=[],HCt={name:"candleUpSection",props:{color:{type:String}},components:{},mounted:function(){},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{}}},GCt=HCt,qCt=(i("4c02"),Object(C["a"])(GCt,UCt,VCt,!1,null,"7da5bf64",null)),zCt=qCt.exports,YCt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt"},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"40px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"80px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.color}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.color}})])])])},XCt=[],QCt={name:"candleDownSection",props:{color:{type:String}},components:{},mounted:function(){},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{}}},JCt=QCt,KCt=(i("ef85"),Object(C["a"])(JCt,YCt,XCt,!1,null,"6934ab26",null)),ZCt=KCt.exports,tbt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[t.colorUp&&t.colorDw?e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"30px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"60px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"order-cp",style:{color:t.color}},[e("svgIcon",{attrs:{name:"order-color-picker"}})],1)]),e("div",{staticClass:"candle-cnt",style:{marginTop:"10px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})])]):t._e()])},ebt=[],ibt={name:"openOrder",props:{color:{type:String}},mounted:function(){},created:function(){var t=JSON.parse(localStorage.getItem("colorsCandles"));if(!t)return this.colorUp="green",void(this.colorDw="red");this.colorUp=t.colorCandleUp,this.colorDw=t.colorCandleDw},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{colorUp:null,colorDw:null}}},obt=ibt,nbt=(i("e24e"),Object(C["a"])(obt,tbt,ebt,!1,null,"395a096a",null)),sbt=nbt.exports,rbt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[t.colorUp&&t.colorDw?e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"30px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"60px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"order-cp",style:{color:t.color}},[e("svgIcon",{attrs:{name:"negative-order-color-picker"}}),t._m(0)],1)]),e("div",{staticClass:"candle-cnt",style:{marginTop:"10px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})])]):t._e()])},abt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"prof-info"},[e("span",[t._v("Sell 1.1134")]),e("span",[t._v("(-3$ -0.1% -1p)")])])}],cbt={name:"negativeProfitOrder",props:{color:{type:String}},mounted:function(){},created:function(){var t=JSON.parse(localStorage.getItem("colorsCandles"));if(!t)return this.colorUp="green",void(this.colorDw="red");this.colorUp=t.colorCandleUp,this.colorDw=t.colorCandleDw},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{colorUp:null,colorDw:null}}},lbt=cbt,ubt=(i("b7cb"),Object(C["a"])(lbt,rbt,abt,!1,null,"10d9b842",null)),dbt=ubt.exports,hbt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[t.colorUp&&t.colorDw?e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"30px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"60px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"order-cp",style:{color:t.color}},[e("svgIcon",{attrs:{name:"order-color-picker"}}),t._m(0)],1)]),e("div",{staticClass:"candle-cnt",style:{marginTop:"10px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})])]):t._e()])},pbt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"prof-info"},[e("span",[t._v("Buy 1.1134")]),e("span",[t._v("(10$ 0.1% 1p)")])])}],gbt={name:"positiveProfitOrder",props:{color:{type:String}},mounted:function(){},created:function(){var t=JSON.parse(localStorage.getItem("colorsCandles"));if(!t)return this.colorUp="green",void(this.colorDw="red");this.colorUp=t.colorCandleUp,this.colorDw=t.colorCandleDw},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{colorUp:null,colorDw:null}}},fbt=gbt,mbt=(i("a6e4"),Object(C["a"])(fbt,hbt,pbt,!1,null,"55b1e61e",null)),vbt=mbt.exports,ybt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[t.colorUp&&t.colorDw?e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"30px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"60px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"order-cp",style:{color:t.color}},[e("svgIcon",{attrs:{name:"order-color-picker"}}),t._m(0)],1)]),e("div",{staticClass:"candle-cnt",style:{marginTop:"10px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})])]):t._e()])},Cbt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"prof-info"},[e("span",{staticClass:"TP"},[t._v("TP")])])}],bbt={name:"orderTp",props:{color:{type:String}},mounted:function(){},created:function(){var t=JSON.parse(localStorage.getItem("colorsCandles"));if(!t)return this.colorUp="green",void(this.colorDw="red");this.colorUp=t.colorCandleUp,this.colorDw=t.colorCandleDw},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{colorUp:null,colorDw:null}}},Sbt=bbt,Pbt=(i("6bbc"),Object(C["a"])(Sbt,ybt,Cbt,!1,null,"3e3c2f8f",null)),Tbt=Pbt.exports,xbt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-cnd-up"},[t.colorUp&&t.colorDw?e("div",{staticClass:"candles"},[e("div",{staticClass:"candle-cnt",style:{marginTop:"30px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})]),e("div",{staticClass:"candle-cnt",style:{marginTop:"60px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorDw}}),e("div",{staticClass:"order-cp",style:{color:t.color}},[e("svgIcon",{attrs:{name:"negative-order-color-picker"}}),t._m(0)],1)]),e("div",{staticClass:"candle-cnt",style:{marginTop:"10px"}},[e("div",{staticClass:"cnd-stick",style:{backgroundColor:t.colorUp}}),e("div",{staticClass:"cnd",style:{backgroundColor:t.colorUp}})])]):t._e()])},Obt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"prof-info"},[e("span",{staticClass:"SL"},[t._v("SL")])])}],wbt={name:"orderSl",props:{color:{type:String}},mounted:function(){},created:function(){var t=JSON.parse(localStorage.getItem("colorsCandles"));if(!t)return this.colorUp="green",void(this.colorDw="red");this.colorUp=t.colorCandleUp,this.colorDw=t.colorCandleDw},destroyed:function(){},methods:{},computed:{},watch:{},data:function(){return{colorUp:null,colorDw:null}}},_bt=wbt,Abt=(i("ed31"),Object(C["a"])(_bt,xbt,Obt,!1,null,"7ddf205e",null)),Dbt=Abt.exports,kbt={name:"NewColorPicker",components:{candleUpSection:zCt,candleDownSection:ZCt,openOrder:sbt,negativeProfitOrder:dbt,positiveProfitOrder:vbt,orderTp:Tbt,orderSl:Dbt},props:{widthPicker:{type:String,default:"40px"},color:{type:String},top:{type:String,default:"45px"},right:{type:String,default:"0px"},atoms1:{type:String},disabled:{type:Boolean},icon:{type:String,default:"colorbox"},byRightSide:{type:Boolean,default:function(){return!1}},isRighSection:{type:Boolean,default:!1},rightSection:{type:String},modyfire:{type:[String,void 0,null]},visibleOpacityLine:{type:Boolean,default:!0}},directives:{"click-outside":{bind:function(t,e,i){t.clickOutsideEvent=function(o){t.contains(o.target)||i.context[e.expression](o)},document.body.addEventListener("click",t.clickOutsideEvent)},unbind:function(t){document.body.removeEventListener("click",t.clickOutsideEvent)}}},methods:{draw:function(t){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="red",t.moveTo(40,0),t.lineTo(40,1),t.arc(50,1,5,0,6.283185307),t.stroke(),t.fill()},closeModal:function(t){this.showColorPicker&&t.target.id!==this.id+""&&t.target.id!==this.id+"svg"&&t.target.parentNode.id!==this.id+"svg"&&(this.showColorPicker=!1)},changeAlfa:function(t,e){if(t="".concat(t),!(t.length<5)){var i=t.replace(/[^,\d]/g,"").split(",");return i[3]=+e.toFixed(3),"rgba(".concat(i.join(),")")}},changeColor:function(t){var e=new RegExp(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);this.newColor=t,t&&e.test(t)&&this.$emit("changeColor",t)},setPoint:function(t){return t},moveSliderPointer:function(t){this.movePoint&&(t.srcElement.offsetWidth,this.positionPoint+=-1*t.movementX,this.positionPoint>100?this.positionPoint=100:this.positionPoint<0&&(this.positionPoint=0),this.positionPoint>91&&(this.positionPoint=91),this.procent=this.positionPoint/91*100)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{className:function(){return this.atoms1?"".concat(this.atoms1," ").concat(this.getActiveTheme):"".concat(this.getActiveTheme)},styleForPicker:function(){return this.byRightSide?{top:"25px",right:"-210px",zIndex:2}:{top:this.top,right:this.right,zIndex:2}}}),watch:{procent:function(t){if(t>100)return this.procent=100;this.positionPoint=91*t/100,this.newColor=this.changeAlfa(this.newColor,this.procent/100),this.$emit("changeColor",this.newColor)}},mounted:function(){this.id=this._uid,this.newColor=this.color,this.currentDisabled=this.disabled},destroyed:function(){},data:function(){return{atomsClasses:this.atoms1,id:void 0,showColorPicker:!1,newColor:void 0,movePoint:!1,positionPoint:91,procent:100,stop:!1,parentColors:ji,whiteList:Ri,tealList:Wi,darkslateblueList:Ni,darkPurpleList:Ei,purpleList:Ui,lightPurpleList:Vi,firebrick:Hi,orangered:Gi,yellowList:qi,darkGreenList:zi,salatList:Yi}}},Ibt=kbt,Bbt=(i("5377"),Object(C["a"])(Ibt,NCt,ECt,!1,null,"f8cb8e7a",null)),Mbt=Bbt.exports,$bt={name:"ModalSettingsInstruments",mixins:[],props:{settings:{type:Object,required:!0}},components:{DxDraggable:Se.a,NewColorPicker:Mbt,DxCheckBox:Th["DxCheckBox"]},mounted:function(){var t=this;Jpt.$on("closeAllModalSetting",(function(){t.closeModal()})),Jpt.$on("closeAllFastSettings",(function(){t.closeModal()}));var e=this.settings;this.typeModal=e.typeModal||"fast",this.id=e.id,this.idProps=e.idProps,this.groupId=e.gropuId,this.fillBackGround=e.fillBackGround,this.textColor=e.textColor,this.textColorMedia=e.textColorMedia,this.borderColor=e.borderColor,this.mainColor=e.mainColor,this.isAudio=e.audio,this.isVideo=e.video,this.isShowUp=e.isShowUp,this.isShowDown=e.isShowDown,this.isShowLines=e.isShowLines,this.colorUp=e.colorUp,this.colorDown=e.colorDown,this.isShowProcentB=e.isShowProcentB,this.isShowPips=e.isShowPips,this.videoURL=e.fileVideo,this.textButtonAudio=e.textButtonAudio,this.audioURL=e.file,this.videoShow=e.videoPlayer||!1,this.isShowPriceB=e.isShowPriceB,this.isShowBars=e.isShowBars,this.isShowAngle=e.isShowAngle,this.isShowValues=e.isShowValues,this.ident=e.ident,this.downColor=e.downColor,this.upColor=e.upColor,this.staticWidth=e.staticWidth,this.midlePin=e.midlePin,e.videoPlayer&&(this.typeModal="full",this.initalVideoRecorder(),this.isRecordVideo=!0),this.lineWidth=void 0!==e.lineWidth?e.lineWidth+" px":void 0,this.lineDash=e.lineDash,e.lineDash&&("".concat(this.lineDash)==="".concat([])&&(this.dashLineIcon="line".concat(e.lineWidth,"px")),"".concat(this.lineDash)==="".concat([1,2])&&(this.dashLineIcon="new-dottedline"),"".concat(this.lineDash)==="".concat([10,10])&&(this.dashLineIcon="new-dashedline")),this.typeLine=e.typeLine,this.dashTradeLine=e.dashTradeLine,this.isShowProcent=e.isShowProcent,this.isShowPrice=e.isShowPrice,this.isShowText=e.isShowText,this.messageText=e.messageText,this.fontSizeMessage=e.fontSizeMessage,this.widthTradeLine=e.widthTradeLine,this.widthTradeLineIcon="line".concat(e.widthTradeLine,"px"),"".concat(this.dashTradeLine)==="".concat([])&&(this.dashTradeLineIcon="line".concat(e.lineWidth,"px")),"".concat(this.dashTradeLine)==="".concat([1,2])&&(this.dashTradeLineIcon="new-dottedline"),"".concat(this.dashTradeLine)==="".concat([10,10])&&(this.dashTradeLineIcon="new-dashedline"),this.nameIconTypeLine=e.lineWidth?"line".concat(e.lineWidth,"px"):void 0,this.nameIconStartLine=e.nameIconStartLine,this.nameIconEndLine=e.nameIconEndLine,this.nameIconTitle=e.nameIconTitle,this.title=e.title,this.leftText=e.leftText,this.bold=e.bold,this.italic=e.italic,this.rigthText=e.rigthText,this.isShowSection=e.isShowSection,this.showTime=e.showTime,this.showPrice=e.showPrice,this.colorPrice=e.colorPrice,this.colorCircle=e.colorCircle,this.colorLine=e.colorLine,this.leftText&&this.rigthText?this.descriptionShowingDescription="BothMeanings":this.leftText&&!this.rigthText?this.descriptionShowingDescription="Слево":!this.leftText&&this.rigthText&&(this.descriptionShowingDescription="Справо"),e.levels&&Array.isArray(e.levels)&&(this.levels=e.levels.map((function(t){return t.openDropDown=!1,t.coolDown=!1,t}))),this.nameIconTypeLineLevel,Array.isArray(this.levels)&&("".concat(this.levels[0].dash)==="".concat([])&&(this.nameIconTypeLineLevel="line".concat(e.lineWidth,"px")),"".concat(this.levels[0].dash)==="".concat([1,2])&&(this.nameIconTypeLineLevel="new-dottedline"),"".concat(this.levels[0].dash)==="".concat([10,10])&&(this.nameIconTypeLineLevel="new-dashedline"),this.mainColorLine=this.levels[0].colorLine)},destroyed:function(){var t=this;Jpt.$off("closeAllModalSetting",(function(){t.closeModal()})),Jpt.$off("closeAllFastSettings",(function(){t.closeModal()})),this.stopRecordVideo()},methods:{setAnyColor:function(t,e){this[e]=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[[e,t]]})},changeTypeText:function(t){this[t]?this[t]="":this[t]=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["".concat(t),this[t]]]})},testFunction:function(){"Перезаписать"===this.textButtonAudio||"Записать"===this.textButtonAudio?this.startRecordVideo():this.stopRecordVideo()},startPlayVideo:function(){var t=document.getElementById("id-video");"Старт"===this.playBtn?t.play():t.pause(),this.playBtn="Старт"===this.playBtn?"Пауза":"Старт"},handleStartVideo:function(){this.videoShow=!0,this.typeModal="full",this.proetcionVideo=!0},handleRecordVideo:function(){this.initalVideoRecorder(),this.isRecordVideo=!0,this.startRecordVideo(),this.videoShow=!0,this.typeModal="full",this.proetcionVideo=!1},startRecordVideo:function(){this.videoURL=void 0,this.videoRecorder?this.videoRecorder.start():(this.isRecordVideo=!0,this.videoURL=void 0,this.typeModal="full",this.initalVideoRecorder(!0),this.isRecordVideo=!0)},stopRecordVideo:function(){this.videoRecorder&&("inactive"!==this.videoRecorder.state&&this.videoRecorder.stop(),this.videoStream.getTracks().forEach((function(t){t.stop()})),this.videoRecorder=void 0,this.seconds=30,this.miliSeconds=0)},initalVideoRecorder:function(t){var e=this;navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then((function(i){e.createVideoRecorder(i,t),e.$refs.videoref.srcObject=i,e.$refs.videoref.muted=!0,e.$refs.videoref.play()}))},createVideoRecorder:function(t,e){var i=this,o={mimeType:"video/webm; codecs=vp8"};this.videoStream=void 0,this.videoRecorder=void 0,this.videoStream=t,this.videoRecorder=new MediaRecorder(t,o),this.videoRecorder.onstop=function(){var t=new Blob(i.chunksViedo);i.isRecordVideo=!1,i.videoURL=window.URL.createObjectURL(t),i.isSave=!0,i.textButtonAudio="Перезаписать"},this.videoRecorder.onstart=function(){i.isSave=!1,i.isRecordVideo=!0,i.videoURL=void 0,i.textButtonAudio="Стоп",i.startTimer().then((function(){i.stopTimeOut(!0)}))},this.videoRecorder.ondataavailable=function(t){i.chunksViedo.push(t.data)},e&&this.videoRecorder.start()},sendVideo:function(){var t="".concat((new Date).getTime(),"-chartvideo"),e=new FormData,i=new File([new Blob(this.chunksViedo)],"".concat(t,".webm"),{type:"video/webm; codecs=vp8"});e.append("file",i),this.$http.post("https://api.toptrader.org/api/Image/item",e,{headers:{"X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.signFP,"Content-Type":"multipart/form-data"}}),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["file","https://api.toptrader.org/api/Image/item/".concat(this.getUser.id,"/").concat(t,".webm")]]}),this.isSave=!1,this.chunksViedo=[],this.typeModal="fast"},handleRecord:function(){"Остановить"!==this.textButtonAudio?this.initalRecorder(!0):this.stopRecordAudio()},stopRecordAudio:function(){this.recorder&&(this.stream.getTracks().forEach((function(t){t.stop()})),"inactive"!==this.recorder.state&&this.recorder.stop())},initalRecorder:function(t){var e=this;navigator.mediaDevices.getUserMedia({audio:!0}).then((function(i){return e.createRecorder(i,t)}))},createRecorder:function(t,e){var i=this;this.stream=t,this.recorder=new MediaRecorder(t),e&&this.startAudioRecord(),this.recorder.onstop=function(){i.textButtonAudio="Перезаписать",i.stopStopWatch(),i.sendAudio()},this.recorder.onstart=function(){i.textButtonAudio="Остановить",i.sSeconds=0,i.sMiliSeconds=0,i.startStopWatch()},this.recorder.ondataavailable=function(t){i.chunks.push(t.data)}},startAudioRecord:function(){this.recorder?this.recorder.start():this.initalRecorder(!0)},sendAudio:function(){var t=new Blob(this.chunks,{type:"audio/ogg; codecs=opus"}),e=(new Date).getTime(),i="".concat(e,"-chartaudio"),o="https://api.toptrader.org/api/Image/item/".concat(this.getUser.id,"/").concat(e,"-chartaudio.mp3"),n=new FormData,s=new File([new Blob(this.chunks,{type:"audio/mpeg"})],"".concat(i,".mp3"),{type:"audio/mpeg"});n.append("file",s),this.$http.post("https://api.toptrader.org/api/Image/item",n,{headers:{"X-TAPI-FP":this.getSession.fp,"X-TAPI-SIGN":this.getSession.signFP,"Content-Type":"multipart/form-data"}}),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["file",o]]}),this.audioURL=window.URL.createObjectURL(t),this.chunks=[]},changeText:function(t){this.messageText=t.srcElement.value,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["messageText",t.srcElement.value]]})},setColorText:function(t){this.colorPrice=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["colorPrice",t]]})},setColorCircle:function(t){this.colorCircle=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["colorCircle",t]]})},setNewBorderColor:function(t){this.borderColor=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["borderColor",t]]})},setNewColorText:function(t){this.textColor=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["textColor",t]]})},changeFontSize:function(t){this.fontSizeMessage=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["fontSizeMessage",t]]})},delLevel:function(t){this.levels.splice(t,1),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["levels",this.levels]]})},closeShowListFontSizeMessageList:function(){this.showListFontSizeMessageList=!1},closeShowListStacicWidthLineLevels:function(){this.showListWidthLineLevelsFib=!1},closeShowListWidthLineLevels:function(){this.showListWidthLineLevels=!1},closeShowListIdent:function(){this.showListIdent=!1},closeShowListStartLine:function(){this.showListStartLine=!1},closeShowListEndLine:function(){this.showListEndLine=!1},closeShowListPositionLevelDescription:function(){this.showListPositionLevelDescription=!1},closeSettingProcent:function(t){var e=t.srcElement,i=e.value;this.levels=this.levels.map((function(t){return t.procent!==+i&&(t.openDropDown=!1),t}))},closeShowListWidthLine:function(){this.showListWidthLine=!1},closeShowListTypeLine:function(){this.showListTypeLine=!1},closeShowListTypeLineLevel:function(){this.showListTypeLineLevel=!1},setNewColorLine:function(t){this.levels.map((function(e){return e.colorLine=t,e})),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["levels",this.levels]]})},changeValueIdentList:function(t){this.ident=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["ident",this.ident]]})},changeValueStaticWidthTradeLine:function(t){this.staticWidth=t,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["staticWidth",this.staticWidth]]})},changeValueWidthTradeLine:function(t){this.widthTradeLine=t,this.widthTradeLineIcon="line".concat(t,"px"),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["widthTradeLine",this.widthTradeLine]]})},changeValueFromDropDownDashLine:function(t,e){if("typeLine"===t)switch(e){case"new-dashedline":this.lineDash=[10,10],this.dashLineIcon=e;break;case"new-dottedline":this.lineDash=[1,2],this.dashLineIcon=e;break;default:this.lineDash=[],this.dashLineIcon=e;break}Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["lineDash",this.lineDash]]})},changeValueFromDropDownTradeLine:function(t,e){if("typeLine"===t)switch(e){case"new-dashedline":this.dashTradeLine=[10,10],this.dashTradeLineIcon=e;break;case"new-dottedline":this.dashTradeLine=[1,2],this.dashTradeLineIcon=e;break;default:this.dashTradeLine=[],this.dashTradeLineIcon=e;break}Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["dashTradeLine",this.dashTradeLine]]})},changeValueFromDropDownTypeLine:function(t,e){if("typeLine"===t)switch(e){case"new-dashedline":this.levels.map((function(t){return t.dash=[10,10],t.type=[10,10],t})),this.nameIconTypeLineLevel=e;break;case"new-dottedline":this.levels.map((function(t){return t.dash=[1,2],t.type=[1,2],t})),this.nameIconTypeLineLevel=e;break;default:this.levels.map((function(t){return t.dash=[],t.type=[],t})),this.nameIconTypeLineLevel=e;break}Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["levels",this.levels]]})},setOneColor:function(t){var e=this;this.levels.map((function(i){return i.colorLine=t,i.color=e.changeAlfa(t,.2),i})),this.oneColorValue=t},handleChangeCheckBox:function(t){this[t]=!this[t],Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["".concat(t),this[t]]]})},changeAlfa:function(t,e){var i=t.replace(/[^,\d]/g,"").split(",");return i[3]=+e.toFixed(3),"rgba(".concat(i.join(),")")},changePositionDescription:function(t){"second"===t?(this.leftText=!0,this.rigthText=!0,this.descriptionShowingDescription="BothMeanings"):"left"===t?(this.leftText=!0,this.rigthText=!1,this.descriptionShowingDescription="Слево"):"right"===t&&(this.leftText=!1,this.rigthText=!0,this.descriptionShowingDescription="Справо"),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["leftText",this.leftText],["rigthText",this.rigthText]]})},testFunc:function(t,e){this.levels[e].procent=+t.value},debouncerForText:function(t,e,i){this.timerText&&clearTimeout(this.timerText),this.timerText=setTimeout((function(){t(e)}),i)},debouncer:function(t,e,i,o){this.levels[o].timer&&clearTimeout(this.levels[o].timer),this.levels[o].timer=setTimeout((function(){t(e.target,o)}),i)},handleShowLvl:function(t,e){this.levels[t].isShow=!e},closeListWidth:function(){this.showListWidthLine=!1},setLvlColor:function(t,e){this.levels[t].color=e,Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["levels",this.levels]]})},changeLvlProcent:function(t,e){this.levels[t].procent=+e,this.$forceUpdate()},setNewColor:function(t){Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["colorLine",t]]})},openDropDownSetting:function(t,e,i){var o=this;void 0!==i&&setTimeout((function(){o.levels[t].openDropDown=e,o.$forceUpdate()})),this.levels[t].openDropDown=e,this.$forceUpdate()},addLevel:function(){var t=this.levels.reduce((function(t,e){return+e.procent>t&&(t=e.procent),t}),0);this.levels.push({procent:t+1,color:this.levels[length-1].color,colorLine:this.levels[length-1].colorLine,dash:[],isShow:!0,openDropDown:!1}),Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[["levels",this.levels]]})},openDropDown:function(t,e){this[t]=!e&&!this[t]},changeValueFromDropDown:function(t,e){if("typeLine"===t)switch(e){case"new-dashedline":this.nameIconTypeLine=e,e=[10,10];break;case"new-dottedline":this.nameIconTypeLine=e,e=[1,2];break;default:this.nameIconTypeLine=e,e=[];break}if("typeStartLine"===t||"typeEndLine"===t){var i="typeStartLine"===t?"typeStart":"typeEnd";return"typeEndLine"===t&&(this.nameIconEndLine=e),"typeStartLine"===t&&(this.nameIconStartLine=e),void Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[[i,e]]})}Jpt.$emit("setSettings",{idFromEvent:this.id,settings:[[t,Array.isArray(e)?e:parseInt(e)]]}),this[t]=e},openSetting:function(){this.typeModal="fast"===this.typeModal?"full":"fast"},deleteOverlay:function(){Jpt.$emit("removeOverlay",{name:"removeOverlay",data:{id:this.id,idProps:this.idProps,screen:{id:this.groupId}}}),this.closeModal()},copyOverlay:function(){},hideOverlay:function(){},closeModal:function(){this.stopRecordVideo(),Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"ModalSettingsInstruments"}})},stopTimeOut:function(t){clearInterval(this.timeOurVideo),t?this.stopRecordVideo():this.stopRecordAudio(),this.seconds=30,this.miliSeconds=0,this.modeRecordVideo=!1},startTimer:function(){var t=this;return new Promise((function(e){t.timeOurVideo=setInterval((function(){0===t.miliSeconds&&0===t.seconds?e():t.seconds>=0&&(t.miliSeconds--,t.miliSeconds<0&&(t.miliSeconds=99,t.seconds--))}),10)}))},stopStopWatch:function(){clearInterval(this.stopWatchInterval)},startStopWatch:function(){var t=this;this.stopWatchInterval=setInterval((function(){t.sMiliSeconds++,t.sMiliSeconds>99&&(t.sSeconds++,t.sMiliSeconds=0)}),10)}},directives:{"click-outside":{bind:function(t,e,i){t.clickOutsideEvent=function(o){t.contains(o.target)||i.context[e.expression](o)},document.body.addEventListener("click",t.clickOutsideEvent)},unbind:function(t){document.body.removeEventListener("click",t.clickOutsideEvent)}}},computed:Object(c["a"])({textForButton:function(){return this.textButtonAudio},stopwatch:function(){return"".concat(this.sSeconds<10?"0"+this.sSeconds:this.sSeconds,":").concat(this.sMiliSeconds<10?"0"+this.sMiliSeconds:this.sMiliSeconds)},getTimerTime:function(){return"".concat(this.seconds<10?"0"+this.seconds:this.seconds,":").concat(this.miliSeconds<10?"0"+this.miliSeconds:this.miliSeconds)}},Object(p["c"])({getSession:"auth/getSession",getUser:"user/getUserDetail"})),watch:{oneColor:function(t){var e=!0,i=this.levels[0].colorLine;this.levels.forEach((function(t){t.color!==i&&(e=!1)})),!0===t&&!0!==e&&(this.setOneColor(this.oneColorValue),this.$forceUpdate())}},data:function(){return{downColor:void 0,upColor:void 0,colorUp:void 0,colorDown:void 0,listStaticWidthsLine:[150,250,450],isShowPips:void 0,isShowProcentB:void 0,bold:void 0,isShowPriceB:void 0,isShowBars:void 0,identList:[30,60,90],isShowAngle:void 0,isShowValues:void 0,midlePin:void 0,italic:void 0,seconds:30,miliSeconds:0,showListWidthLineLevelsFib:!1,sSeconds:0,sMiliSeconds:0,isRecordVideo:!1,playBtn:"Старт",videoShow:!1,isAudio:void 0,audioTest:void 0,audioFileSrc:void 0,isVideo:void 0,textColorMedia:void 0,chunks:[],chunksViedo:[],recording:!1,dashLineIcon:void 0,borderColor:void 0,fillBackGround:void 0,colorCircle:void 0,videoURL:void 0,showListFontSizeMessageList:!1,fontSizeMessage:void 0,audioURL:void 0,textColor:void 0,isShowProcent:void 0,isShowPrice:void 0,isShowUp:void 0,isShowLines:void 0,isShowDown:void 0,widthTradeLineIcon:void 0,showListIdent:!1,showListTypeLine:!1,showListTypeLineLevel:!1,mainColorLine:void 0,nameIconTypeLineLevel:void 0,oneColorValue:"rgba(0,0,255,1)",oneColor:!1,isSave:!1,proetcionVideo:void 0,isShowSection:void 0,showListPositionLevelDescription:!1,showListWidthLineLevels:!1,showListStartLine:!1,colorPrice:void 0,showListEndLine:!1,nameIconStartLine:void 0,nameIconEndLine:void 0,title:void 0,typeModal:void 0,nameIconTitle:void 0,isShowText:void 0,showTime:void 0,showPrice:void 0,fast:!1,showListWidthLine:!1,mainColor:void 0,typeLine:void 0,nameIconTypeLine:void 0,textButtonAudio:void 0,levels:void 0,fontSizeMessageList:[10,12,14,18,24,28,32],listWidthsLine:["1 px","2 px","3 px","4 px"],lineWidth:void 0,fibList:[.236,.382,.5,.618,.786,1,1.618,2.618,4.236],messageText:void 0}}},Lbt=$bt,Fbt=(i("431f"),i("d5bd"),Object(C["a"])(Lbt,RCt,WCt,!1,null,"5e23616e",null)),jbt=Fbt.exports,Rbt={name:"VerticalAndHorizontalLines",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1,this.xt=e.xt,this.y$=e.y$),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.y$||this.xt||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},setSettings:function(t){var e=this;t.idFromEvent!==this.newId&&t.idFromEvent!==this.$props.id||(t.settings.forEach((function(t){e[t[0]]=t[1]})),this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition())},init:function(){var t=this;if(this.getToken){var e,i=JSON.parse(localStorage.getItem(localStorage.getItem("currentSymbol").replace(/"/g,"")))["default"];Array.isArray(i)&&(e=i.find((function(e){return e.id===t.$props.id}))),e&&Object.keys(e).forEach((function(i){t[i]=e[i]}))}},saveNewPosition:function(){if(this.getToken){var t=this.$props.id.replace("_","").replace(/[0-9]/g,""),e=localStorage.getItem("allObjects"),i=JSON.parse(e),o=Object.assign({},this.$data),n=Object(c["a"])(Object(c["a"])({},o),{},{id:this.idCurrentOverlay,name:t,symbol:localStorage.getItem("currentSymbol"),page:localStorage.getItem("saveObjectsInPage"),groupId:localStorage.getItem("currentGoupDrawObjects","default")});Object.keys(n).forEach((function(t){"object"!==Object(QD["a"])(n[t])||Array.isArray(n[t])||(n[t]=Object.assign({},n[t]))})),n.ctx=void 0,n.mouse=void 0,n.elementToChangeCurspor=void 0,i["".concat(this.$props.id)]=n;var s={Command:"SaveChartSettings",data:{UserId:this.getUser.id,AccountId:this.getDefaultAccount.id,Instrument:localStorage.getItem("currentSymbol").replace(/"/g,""),Settings:JSON.stringify(n),id:"".concat(this.$props.id)},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS3",command:s}),localStorage.setItem("allObjects",JSON.stringify(i))}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["VerticalAndHorizontalLines"]},draw:function(t){this.ctx=t,this.y$&&this.xt&&(this.drawLine(t,this.y$),this.drawVerticalLine(t,this.xt),this.drawModalInfo(t))},drawLine:function(t,e){var i=this.$props.layout.startx,o=this.$props.layout.spacex;t.beginPath(),this.showPrice&&(t.setLineDash(this.typeLine),t.moveTo(t.measureText("".concat(this.$props.layout.$2screen(e).toFixed(5))).width+8,this.$props.layout.$2screen(e)-7),t.lineTo(t.measureText("".concat(this.$props.layout.$2screen(e).toFixed(5))).width+8,this.$props.layout.$2screen(e)+7),t.lineTo(2,this.$props.layout.$2screen(e)+7),t.lineTo(2,this.$props.layout.$2screen(e)-7),t.strokeStyle=this.colorLine,t.closePath(),t.stroke()),t.beginPath(),t.lineWidth=this.okdel||this.changePosition?this.lineWidth+1.5:this.lineWidth,t.strokeStyle=this.colorLine,t.setLineDash(this.typeLine),this.showPrice?t.moveTo(t.measureText("".concat(this.$props.layout.$2screen(e).toFixed(5))).width+10,this.$props.layout.$2screen(e)):t.moveTo(0,this.$props.layout.$2screen(e)),t.lineTo(o,this.$props.layout.$2screen(e)),t.stroke(),this.showPrice&&this.drawText(t,e,i+16,this.$props.layout.$2screen(e))},drawVerticalLine:function(t,e){var i=this.$props.layout.$2screen(this.$props.layout.$_hi),o=this.$props.layout.$2screen(this.$props.layout.$_lo);if(t.beginPath(),t.lineWidth=this.okdel||this.changePosition?this.lineWidth+1.5:this.lineWidth,t.strokeStyle=this.colorLine,t.setLineDash(this.typeLine),t.moveTo(this.$props.layout.t2screen(e),i),this.showTime)return t.lineTo(this.$props.layout.t2screen(e),o-28),t.stroke(),void this.drawVerticalText(t,this.arrCnd[e-1][0],this.$props.layout.t2screen(e),o-15);t.lineTo(this.$props.layout.t2screen(e),o),t.stroke()},doubelClick:function(t){var e=this;if(this.counterDoubleClick++,1===this.counterDoubleClick)return this.openFastSettings(),Jpt.$emit("closeAllFastSettings"),void(this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0}),300));this.okdel=!0},drawVerticalText:function(t,e,i,o){var n=new Date(e).toLocaleString("ru");t.font="12px Arial";var s=(t.measureText(n).width+20)/2,r=t.measureText(n).width;t.beginPath(),t.moveTo(i-s,o-12),t.lineTo(i+s,o-12),t.lineTo(i+s,o+6),t.lineTo(i-s,o+6),t.closePath(),t.strokeStyle=this.colorLine,t.stroke(),t.beginPath(),t.fillStyle=this.textColor,t.font="12px Arial",t.fillText(n,i-r/2,o)},drawText:function(t,e,i,o){"".concat(e).length;t.beginPath(),t.fillStyle=this.textColor,t.font="12px Arial",t.fillText(e.toFixed(5),i,o+4.5)},listener:function(t){"Delete"===t.key&&this.okdel&&Jpt.$emit("delMessage",{id:this.idCurrentOverlay})},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&(this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY))},mouseup:function(t){this.changePosition&&(this.changePosition=!1,this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY),this.candle=this.$props.cursor.values["0"].Candles_0,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},openFastSettings:function(){var t=document.getElementById("chartWrap"),e=t.offsetWidth,i=t.offsetHeight;this.$emit("new-interface",{target:"grid",component:jbt,pin:[e-.4*e+"px",i-.9*i+"px"],win_styling:!1,win_header:!1,vars:{data:{emit:this.$emit,openModal:this.openModal,settings:{id:this.newId||this.$props.id,title:this.title,nameIconTitle:"new-crossed-line",mainColor:this.colorLine,textColor:this.textColor,typeLine:this.typeLine,lineWidth:this.lineWidth,showPrice:this.showPrice,showTime:this.showTime}},p_text:"Interface"}})},drawModalInfo:function(t){t.setLineDash([]);this.xt;var e=this.candle;if(this.allCnd&&e){var i=t||this.ctx,o=20,n=+this.$props.layout.t2screen(this.xt)+15+o/2,s=+this.$props.layout.$2screen(this.y$)+15+o/2,r=this.allCnd[e[0]-1][0];i.beginPath(),i.lineJoin="round",i.lineWidth=o,i.strokeStyle=e[4]>e[1]?this.colorCandleUp:this.colorCandleDw,i.strokeRect(n,s,this.widthModal-o,this.heightModal-o),i.fillStyle=e[4]>e[1]?this.colorCandleUp:this.colorCandleDw,i.fillRect(n+o/2,s+o/2,this.widthModal-2*o,this.heightModal-2*o),i.fillStyle="#fff",i.font="16px Arial",i.fillText("".concat(new Date(r).toLocaleString("ru")),n+10,s+15),i.fillText("open",n+10,s+40),i.fillText("".concat(e[1]),n+70,s+40),i.fillText("close",n+10,s+65),i.fillText("".concat(e[4]),n+70,s+65),i.fillText("lowest",n+10,s+90),i.fillText("".concat(e[3]),n+70,s+90),i.fillText("highest",n+10,s+115),i.fillText("".concat(e[2]),n+70,s+115)}},mousedown:function(t){var e=this.$props.layout.screen2$(t.layerY),i=this.$props.layout.screen2t(t.layerX).toFixed();this.$props.layout.$2screen(this.y$)-3<=this.$props.layout.$2screen(e)&&this.$props.layout.$2screen(e)<=this.$props.layout.$2screen(this.y$)+3?(this.changePosition=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t)):this.okdel=!1,this.$props.layout.t2screen(i)===this.$props.layout.t2screen(this.xt)?(this.changePosition=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t)):this.okdel=!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{showPrice:!0,showTime:!0,colorLine:"red",textColor:"red",typeLine:[10,10],lineWidth:1,counterDoubleClick:0,changePosition:!0,widthModal:190,heightModal:140,backgroundColor:"#1c658b61",borderColor:"#1c378b00",colorCandleDw:"#e5415047",colorCandleUp:"#23a77647",arrCnd:void 0,ctx:void 0,title:"croLinWord",mouse:{x:void 0,y:void 0}}}},Wbt=Rbt,Nbt=Object(C["a"])(Wbt,Gvt,qvt,!1,null,null,null),Ebt=Nbt.exports,Ubt={name:"InstrumentText",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.xt||this.y$||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["InstrumentText"]},draw:function(t){this.ctx=t,this.drawCircle(t,this.centerCircle.x,this.centerCircle.y),this.xt&&this.y$&&(this.viewChangeSizeCircle=!1)},roundRect:function(t,e,i,o,n,s,r,a,c){var l=this;if("undefined"===typeof a&&(a=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var u={tl:0,tr:0,br:0,bl:0};for(var d in u)s[d]=s[d]||u[d]}if(t.moveTo(e,i),this.A={x:e,y:i},t.lineTo(e+o,i),this.B={x:e+o,y:i},t.lineTo(e+o,i+n),this.C={x:e+o,y:i+n},t.lineTo(e,i+n),this.D={x:e,y:i+n},t.closePath(),t.strokeStyle=!1,t.beginPath(),t.strokeStyle=!1,t.moveTo(e+s.tl,i),t.lineTo(e+o-s.tr,i),t.quadraticCurveTo(e+o,i,e+o,i+s.tr),t.lineTo(e+o,i+n-s.br),t.quadraticCurveTo(e+o,i+n,e+o-s.br,i+n),t.lineTo(e+s.bl,i+n),t.quadraticCurveTo(e,i+n,e+.5*n,i+.933*n),t.lineTo(e+s.bl,i+n+.67*n),t.quadraticCurveTo(e,i+n,e,i+n-s.bl),t.lineTo(e,i+s.tl),t.quadraticCurveTo(e,i,e+s.tl,i),t.closePath(),r){var h=+this.fontSizeMessage;t.fillStyle=this.colorLine,t.fill();var p=this.bold?this.bold+" ":"",g=this.italic?this.italic+" ":"",f=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=g+p+f,t.fillStyle=this.textColor;var m=i+.1*h;t.fillStyle=this.textColor,Array.isArray(c)&&c.forEach((function(i,o){o>0?t.fillText(i,e+ +l.fontSizeMessage,m+h+.3*h):t.fillText(i,e+ +l.fontSizeMessage,m+1.25*h),m=m+h+.3*h}))}},drawCircle:function(t,e,i){var o=this.$props.layout.t2screen(e),n=this.$props.layout.$2screen(i),s=this.bold?this.bold+" ":"",r=this.italic?this.italic+" ":"",a=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=s+r+a,t.fillStyle="red";var c=[this.messageText],l=c[0]||"";c.forEach((function(t){t.length>l.length&&(l=t)}));var u=+this.fontSizeMessage,d=t.measureText(l).width+2*u,h=9;this.heigth=(u+.3*u)*c.length+.6*u,this.roundRect(t,o,n,d,this.heigth,h,!0,void 0,c)},drawNewPositionCircle:function(t,e){var i=this.getTimeCandle(this.$props.layout.screen2t(t).toFixed(0)),o=this.$props.layout.screen2$(e);this.centerCircle.x=i,this.centerCircle.y=o},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200),this.timerDebouncer&&clearInterval(this.timerDebouncer)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},debouncer:function(t,e){this.timerDebouncer=setTimeout((function(){e()}),t)},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.centerCircle.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.centerCircle.y)+60),t.centerCircle.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.centerCircle.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"PopupText",nameIconTitle:"new-popuptext",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"messageText",value:this.messageText,fast:!1}]},{index:2,name:"Background",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},mousemove:function(t){var e=t.layerX,i=t.layerY,o=this.getTimeCandle(this.$props.layout.screen2t(e).toFixed(0)),n=this.$props.layout.screen2$(i);this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.xt=o,this.y$=n,this.changePosition&&this.drawNewPositionCircle(t.layerX,t.layerY)},mousedown:function(t){var e=this,i=t.layerX,o=t.layerY,n=this.getTimeCandle(this.$props.layout.screen2t(i).toFixed(0)),s=this.$props.layout.screen2$(o);this.xt=n,this.y$=s,this.pointInRectangle({x:this.$props.layout.t2screen(n),y:this.$props.layout.$2screen(s)},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.debouncer(200,(function(){e.changePosition=!0})),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))},mouseup:function(t){if(this.timerDebouncer&&clearInterval(this.timerDebouncer),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]})),this.initClick&&(this.initClick=!1),this.changePosition)return this.drawNewPositionCircle(t.layerX,t.layerY),this.changePosition=!1,void this.saveNewPosition();this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{initClick:!0,changePosition:!0,downInChangeSize:!1,viewChangeSizeCircle:!1,initCircle:!0,fontSizeMessage:14,bold:"",italic:"",colorLine:"rgba(109, 158, 235, 0.36)",textColor:"rgba(255,255,255,1)",messageText:this.$t("txtWord"),radiusCircle:30,counterDoubleClick:0,titleBacgroundColor:this.$t("windowColorWord"),titleColorText:this.$t("txtColorWord"),titleModal:this.$t("popUpTxtWord"),ctx:void 0,elementToChangeCurspor:void 0,mouse:{x:void 0,y:void 0},centerCircle:{x:void 0,y:void 0},xt:void 0,y$:void 0}}},Vbt=Ubt,Hbt=Object(C["a"])(Vbt,zvt,Yvt,!1,null,null,null),Gbt=Hbt.exports,qbt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"price-alert__cnt"},[!t.isRemoved&&t.onHover?e("div",{staticClass:"price-alert"},[t.yPrice?e("div",{staticClass:"price-alert__close",style:t.getPositionButtonClose,on:{click:t.removeOverlay}},[e("svgIcon",{attrs:{name:"Close",size:18}})],1):t._e()]):t._e(),t.openModal?e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.closeModal,expression:"closeModal"}],staticClass:"price-alert-modal"},[e("div",{staticClass:"price-alert-modal__header"},[e("span",[t._v("Уведомление о цене")]),e("Button",{attrs:{icon:"Close"},on:{click:t.closeModal}})],1),e("div",{staticClass:"price-alert-modal__body"},[e("div",{staticClass:"price-alert-modal__content"},[e("svgIcon",{style:{color:"#cccccc",marginRight:"8px"},attrs:{name:"Big_NotificationOfPrice",size:100}}),e("div",{staticClass:"price-alert-modal__description"},[e("div",{staticClass:"price-alert-modal__info"},[e("span",[t._v("Инструмент: "+t._s(t.symbol))]),e("span",[t._v("Цена: "+t._s(t.y$))]),e("span",[t._v("Условие Бид ≥ Цены")])]),e("span",[t._v("Цена, по которой вы запросили получение оповещения, была достигнута")])])],1),e("div",{staticClass:"price-alert-modal__btns"},[e("Button",{attrs:{icon:"Check",label:"Ok"},on:{click:t.closeModal}})],1)])]):t._e()])},zbt=[],Ybt=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e,this.arrOrder=[],this.hedging=null,this.isHidden=!1,this.price=0,this.isRemoved=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this;this.comp;this.comp.$emit("new-shader",{target:"sidebar",draw:function(e){t.isRemoved||t.price&&t.drawPricePoint(e,t.price,"#FA860A")}}),this.shader=!0}},{key:"remove",value:function(){this.price=null,this.isRemoved=!0}},{key:"drawPricePoint",value:function(t,e,i){var o=this.comp.$props.layout,n=this.comp.$props.config,s=t.canvas.width,r=(n.PANHEIGHT,-.5),a=7;t.beginPath();var c=o.$2screen(e);t.fillStyle=i,t.fillRect(r-.5,c-7,s+1,14),t.fillStyle="white",t.textAlign="left",t.font="".concat(10,"px Arial"),t.fillText(e,a,c+4)}},{key:"draw",value:function(t,e){this.price=e,this.comp&&this.comp.$props.meta.last&&(this.shader||this.init_shader())}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.colorCandleUp}},{key:"red",value:function(){return this.comp.colorCandleDw}}]),t}(),Xbt={name:"PriceAlert",mixins:[tgt["a"]],components:{Button:zt},destroyed:function(){this.controlSubribeWS(!0),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;this.controlSubribeWS(),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id?e.y$&&(this.idCurrentOverlay="".concat(e.id),this.changePosition=!1,this.initQoute=e.initQoute,this.y$=e.y$,this.addToListExceptions(e)):e&&!e.id&&(this.y$=+e.price,this.changePosition=!1,this.saveNewPosition()),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{init:function(){this.shader=new Ybt(this)},addToListExceptions:function(t){var e=JSON.parse(JSON.stringify(t));e.id||(e.id=this.idCurrentOverlay),Jpt.$emit("addPosPriceAlert",e)},addInstrumentToChart:function(){this.y$||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},saveNewPosition:function(){if(this.getToken){var t=this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,gropuId:this.groupId,timeFrame:this.timeFrame,initQoute:this.initQoute,name:t,symbol:this.symbol,y$:this.y$});Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:i}),this.addToListExceptions(i)}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["PriceAlert"]},draw:function(t){this.ctx=t,this.isRemoved||this.y$&&(this.yPrice=this.$props.layout.$2screen(this.y$),this.drawLine(t,this.y$),this.qoute&&this.qoute.b&&!this.initQoute&&(this.initQoute=this.qoute.b),this.shader.draw(t,this.y$.toFixed(this.getPrecision)),void 0===this.isAsk&&this.y$&&this.initQoute&&(this.isAsk=this.initQoute>this.y$),this.checkQoute(this.y$))},checkQoute:function(){if(this.qoute&&!this.changePosition){var t=this.isAsk?"isAsk":"isBid",e={isAsk:this.y$>=this.qoute.b,isBid:this.y$<=this.qoute.b};if(e[t]&&!this.openModal){var i=new Audio;i.src="https://zvukogram.com/mp3/p2/1941/zvuk-uvedomleniya-o-soobschenii-imassage-v-iphone-30508.mp3",this.openModal=!0,i.play()}}},closeModal:function(){this.openModal=!1,this.removeOverlay()},drawDragZone:function(t,e,i){t.beginPath,t.rect(e-18,i-10,18,18),t.fillStyle=this.colorLine,t.fill(),t.beginPath(),t.fillStyle="white",t.font="bold 6px",t.fillText("•••".split("").join(String.fromCharCode(8202)),e-15.3,i),t.fillText("•••".split("").join(String.fromCharCode(8202)),e-15.3,i+6)},drawLine:function(t,e){var i=this.$props.layout.spacex,o=this.$props.layout.$2screen(e);t.beginPath(),t.lineWidth=this.okdel||this.changePosition?2.5:1,t.strokeStyle=this.colorLine,t.setLineDash([8,5]),t.moveTo(0,o),t.lineTo(i,o),t.stroke(),this.mouse.y>=o-10&&this.mouse.y<=o+10?(this.onHover=!0,this.drawDragZone(t,this.getEndPoint,o)):this.onHover=!1},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?this.okdel=!0:this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0}),300)},listener:function(t){"Delete"===t.key&&this.okdel&&Jpt.$emit("delMessage",{id:this.idCurrentOverlay})},removeOverlay:function(){Jpt.$emit("removeOverlay",{name:"removeOverlay",data:{id:this.idCurrentOverlay,isAlertPrice:!0,isAlertPriceSymbol:this.symbol,isAlertPriceData:this.$props.settings.data}}),this.shader.remove(),this.isRemoved=!0},mousemove:function(t){this.isRemoved||(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&(this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY)))},mouseup:function(t){this.isRemoved||this.changePosition&&(this.isAsk=this.qoute.b>this.y$,this.initQoute=this.qoute.b,this.changePosition=!1,this.xt=this.$props.layout.screen2t(t.layerX).toFixed(),this.y$=this.$props.layout.screen2$(t.layerY),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},mousedown:function(t){if(!this.isRemoved){var e=this.$props.layout.screen2$(t.layerY);this.$props.layout.$2screen(this.y$)-3<=this.$props.layout.$2screen(e)&&this.$props.layout.$2screen(e)<=this.$props.layout.$2screen(this.y$)+3?(this.changePosition=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t)):this.okdel=!1}},controlSubribeWS:function(t){t?this.$socketStream.$off("apiWS2",this.setMessageHandler):this.$socketStream.$on("apiWS2",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},Quotes:function(t){var e=this;this.qoute=t.find((function(t){return t.s===e.symbol}))||this.qoute}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},sett:function(){return this.$props.settings},getEndPoint:function(){return this.$props.layout.spacex-8},getPositionButtonClose:function(){var t=this.$props.layout,e=this.getEndPoint-44,i=t.screen2$(t.$2screen(this.yPrice));return{top:i-10+"px",left:e+"px"}}}),data:function(){return{colorLine:"#FA860A",colorText:"red",yPrice:null,onHover:!1,counterDoubleClick:0,changePosition:!0,isRemoved:!1,arrCnd:void 0,ctx:void 0,openModal:!1,isAsk:void 0,mouse:{x:void 0,y:void 0}}}},Qbt=Xbt,Jbt=(i("7118"),Object(C["a"])(Qbt,qbt,zbt,!1,null,"7387868f",null)),Kbt=Jbt.exports,Zbt={name:"AudioNotes",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$off("setSettings",(function(e){return t.setSettings(e)})),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;this.symbol=this.$props.settings.symbol;var e=this.$props.settings.data;e&&Object.keys(e).forEach((function(i){t[i]=e[i]})),this.timeFrame=this.$props.settings.timeFrame,this.arrCnd=this.$props.settings.candles,Jpt.$on("setSettings",(function(e){return t.setSettings(e)})),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.iconStr="M14.8353 11.8284C14.0851 12.5786 13.0677 13 12.0068 13C10.946 13 9.92855 12.5786 9.17841 11.8284C8.42826 11.0783 8.00684 10.0609 8.00684 9V6C8.00684 4.93913 8.42826 3.92172 9.17841 3.17157C9.92855 2.42143 10.946 2 12.0068 2C13.0677 2 14.0851 2.42143 14.8353 3.17157C15.5854 3.92172 16.0068 4.93913 16.0068 6V9C16.0068 10.0609 15.5854 11.0783 14.8353 11.8284ZM10.5926 4.58579C10.2176 4.96086 10.0068 5.46957 10.0068 6V9C10.0068 9.53043 10.2176 10.0391 10.5926 10.4142C10.9677 10.7893 11.4764 11 12.0068 11C12.5373 11 13.046 10.7893 13.421 10.4142C13.7961 10.0391 14.0068 9.53043 14.0068 9V6C14.0068 5.46957 13.7961 4.96086 13.421 4.58579C13.046 4.21071 12.5373 4 12.0068 4C11.4764 4 10.9677 4.21071 10.5926 4.58579ZM18.7991 10.3776C18.9642 10.5876 19.039 10.8546 19.0072 11.1199C18.8328 12.6393 18.1415 14.0527 17.0492 15.1231C15.9569 16.1936 14.5298 16.8562 13.0072 16.9999V19.9999H14.0072C14.2724 19.9999 14.5267 20.1052 14.7143 20.2927C14.9018 20.4803 15.0072 20.7346 15.0072 20.9999C15.0072 21.2651 14.9018 21.5194 14.7143 21.707C14.5267 21.8945 14.2724 21.9999 14.0072 21.9999H10.0072C9.74196 21.9999 9.48761 21.8945 9.30007 21.707C9.11253 21.5194 9.00718 21.2651 9.00718 20.9999C9.00718 20.7346 9.11253 20.4803 9.30007 20.2927C9.48761 20.1052 9.74196 19.9999 10.0072 19.9999H11.0072V16.9999C9.48452 16.8562 8.05749 16.1936 6.96516 15.1231C5.87283 14.0527 5.18156 12.6393 5.00718 11.1199C4.97535 10.8546 5.05019 10.5876 5.21522 10.3776C5.38025 10.1676 5.62196 10.0317 5.88718 9.99985C6.15239 9.96803 6.41939 10.0429 6.62943 10.2079C6.83947 10.3729 6.97535 10.6146 7.00718 10.8799C7.13821 12.0226 7.6881 13.0762 8.55061 13.8371C9.41313 14.598 10.5271 15.0123 11.6772 14.9999H12.3372C13.4873 15.0123 14.6012 14.598 15.4637 13.8371C16.3263 13.0762 16.8761 12.0226 17.0072 10.8799C17.039 10.6146 17.1749 10.3729 17.3849 10.2079C17.595 10.0429 17.862 9.96803 18.1272 9.99985C18.3924 10.0317 18.6341 10.1676 18.7991 10.3776Z",this.idCurrentOverlay=this.$props.settings.idOvrl,e&&e.id&&(this.idCurrentOverlay=e.id)},methods:{addInstrumentToChart:function(){this.position.x||this.position.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},createObjectForSaveOrCopy:function(){var t=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:t,symbol:this.symbol,groupId:this.groupId});return Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),i},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.startPinRect.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.startPinRect.y)+60),t.centerCircle.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.startPinRect.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Audio",nameIconTitle:"new-audio-note",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,audio:this.file,saveAudio:function(t){i.file=t,i.updateDraw()},getAudio:function(){return i.file},listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColorMedia",value:this.textColorMedia,color:function(){return i.textColorMedia}}]},{index:1,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"messageText",value:this.messageText,fast:!1}]},{index:2,name:"AudioPlayerDesc",startCheckBox:!1,settings:[{component:"AudioPlayer",fast:!0}]}],typeModal:t}}})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["AudioNotes"]},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),100):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0}),300)},draw:function(t){this.ctx=t,this.iconStr&&(this.iconDraw=new Path2D(this.iconStr),t.beginPath(),this.position.x&&this.position.y?(t.translate(this.$props.layout.t2screen(this.position.x),this.$props.layout.$2screen(this.position.y)),t.arc(12,10,10,2*Math.PI,!1),this.drawText(t,12,10)):t.translate(this.mouse.x,this.mouse.y),t.strokeStyle=this.textColorMedia,t.stroke(this.iconDraw))},onCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX),o=this.$props.layout.screen2$(t.layerY);this.position.x&&this.position.y?this.onCircle(12,10,this.$props.layout.t2screen(i)-this.$props.layout.t2screen(this.position.x),this.$props.layout.$2screen(o)-this.$props.layout.$2screen(this.position.y),10)&&(Jpt.$emit("closeAllFastSettings"),this.openModal(null,t),this.doubelClick(t),this.timerMove=setTimeout((function(){e.position={x:void 0,y:void 0},e.cangePosition=!0}),130),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})):(this.position.x=this.getTimeCandle(i.toFixed(0)),this.position.y=o,this.start&&(this.openModal(null,t),this.start=!1),this.saveNewPosition())}},computed:Object(c["a"])({sett:function(){return this.$props.settings}},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),data:function(){return{start:!0,counterDoubleClick:0,file:void 0,messageText:"",ctx:void 0,position:{x:void 0,y:void 0},mouse:{x:void 0,y:void 0},textColorMedia:"rgba(255,128,0,1)"}}},tSt=Zbt,eSt=Object(C["a"])(tSt,Xvt,Qvt,!1,null,null,null),iSt=eSt.exports,oSt={name:"VideoNotes",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$off("openModalFromOverlay",(function(e){e.id===t.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return t.openModal("full",{})}),50))})),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",(function(e){e.id===t.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return t.openModal("full",{})}),50))})),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.$props.settings.symbol;var e=this.$props.settings.data;e&&Object.keys(e).forEach((function(i){t[i]=e[i]})),this.timeFrame=this.$props.settings.timeFrame,this.arrCnd=this.$props.settings.candles,this.iconStr="M5.28 18H13.72C14.0194 18 14.3159 17.941 14.5925 17.8264C14.8691 17.7119 15.1205 17.5439 15.3322 17.3322C15.5439 17.1205 15.7119 16.8691 15.8264 16.5925C15.941 16.3159 16 16.0194 16 15.72V15.3099L18.7604 16H19.0004C19.5309 16 20.0396 15.7893 20.4146 15.4142C20.7897 15.0391 21.0004 14.5304 21.0004 14V11C21.0004 10.4696 20.7897 9.96086 20.4146 9.58579C20.0396 9.21071 19.5309 9 19.0004 9H18.7604L16 9.69011V9.28C16 8.98059 15.941 8.6841 15.8264 8.40748C15.7119 8.13086 15.5439 7.87951 15.3322 7.6678C15.1205 7.45608 14.8691 7.28814 14.5925 7.17355C14.3159 7.05897 14.0194 7 13.72 7H5.28C4.67531 7 4.09538 7.24021 3.6678 7.6678C3.24021 8.09538 3 8.67531 3 9.28V15.72C3 16.3247 3.24021 16.9046 3.6678 17.3322C4.09538 17.7598 4.67531 18 5.28 18ZM14 10.9705V9.28C14.0014 9.24285 13.9951 9.20582 13.9815 9.17121C13.968 9.1366 13.9474 9.10517 13.9211 9.07889C13.8948 9.0526 13.8634 9.03203 13.8288 9.01845C13.7942 9.00488 13.7571 8.9986 13.72 9H5.28C5.24285 8.9986 5.20582 9.00488 5.17121 9.01845C5.1366 9.03203 5.10517 9.0526 5.07889 9.07889C5.0526 9.10517 5.03203 9.1366 5.01845 9.17121C5.00488 9.20582 4.9986 9.24285 5 9.28V15.72C4.9986 15.7571 5.00488 15.7942 5.01845 15.8288C5.03203 15.8634 5.0526 15.8948 5.07889 15.9211C5.10517 15.9474 5.1366 15.968 5.17121 15.9815C5.20582 15.9951 5.24285 16.0014 5.28 16H13.72C13.7571 16.0014 13.7942 15.9951 13.8288 15.9815C13.8634 15.968 13.8948 15.9474 13.9211 15.9211C13.9474 15.8948 13.968 15.8634 13.9815 15.8288C13.9951 15.7942 14.0014 15.7571 14 15.72V14.0295C14 14.0293 14 14.029 14 14.0288V10.9712C14 10.971 14 10.9707 14 10.9705ZM19.0004 14L16.0004 13.22V11.76L19.0004 11V14Z",this.idCurrentOverlay=this.$props.settings.idOvrl,e&&e.id&&(this.idCurrentOverlay=e.id)},methods:{addInstrumentToChart:function(){this.position.x||this.position.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},roundRect:function(t,e,i,o,n,s,r){if("undefined"===typeof r&&(r=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var a={tl:0,tr:0,br:0,bl:0};for(var c in a)s[c]=s[c]||a[c]}t.closePath(),t.fillStyle=this.textColorMedia,t.fill()},createObjectForSaveOrCopy:function(){var t=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:t,symbol:this.symbol,groupId:this.groupId});return Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),i},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.startPinRect.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.startPinRect.y)+60),t.centerCircle.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.startPinRect.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Video",nameIconTitle:"VideoOn",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,video:this.file,tags:this.tags,withVideoSettings:!0,titleVideo:this.titleVideo,getNewDatas:function(){return{titleVideo:i.titleVideo,video:i.file}},changeTitleVideo:function(t){i.titleVideo=t,i.updateDraw()},saveFile:function(t,e){i.file=t,e||i.updateDraw()},listSections:[{index:0,name:"IconsBackground",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColorMedia",value:this.textColorMedia,color:function(){return i.textColorMedia}}]},{index:1,name:"ShowTextOnHover",startCheckBox:!0,withOutLine:!0,valueStartCheckBox:this.isShowOnHover,controllerCheckBox:function(t){i.isShowOnHover=t.value,i.showAllText=!t.value},settings:[]},{index:2,name:"VideoNoteTitle",startCheckBox:!0,valueStartCheckBox:this.isShowTitle,controllerCheckBox:function(t){i.isShowTitle=t.value},settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"colorTitleVideo",value:this.colorTitleVideo,color:function(){return i.textColorMedia}}]},{index:3,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"titleVideo",heightToTextArea:"32px",value:this.titleVideo,fast:!1}]},{index:4,name:"DescriptionVideoNotes",startCheckBox:!0,valueStartCheckBox:this.isShowDesciption,controllerCheckBox:function(t){i.isShowDesciption=t.value},settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"colorDescriptionVideo",value:this.colorDescriptionVideo,color:function(){return i.textColorMedia}}]},{index:5,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"messageText",value:this.messageText,fast:!1}]},{index:6,name:"BtnOpenModal",startCheckBox:!1,settings:[{component:"ButtonOpenModal",icon:"new-icn-play",func:function(t){t.$emit("changeStepModal",{step:"stepViewVideo",buttonsInWrapperSettings:[{icon:"new-setting",event:"openSetting"},{icon:"new-settings-player",event:"openSettingVideo"}]})},description:"Play",fast:!0}]},{index:7,name:"BtnOpenModal",startCheckBox:!1,settings:[{component:"ButtonOpenModal",icon:"new-refrash",func:function(t){t.$emit("changeStepModal",{buttonsInWrapperSettings:[{icon:"new-setting",event:"openSetting"}],step:"stepInitRecordVideo"})},description:"Rerecord",fast:!0}]}],typeModal:t}}})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["VideoNotes"]},draw:function(t){this.ctx=t,this.iconStr&&(this.iconDraw=new Path2D(this.iconStr),t.beginPath(),this.position.x&&this.position.y?(t.translate(this.$props.layout.t2screen(this.position.x),this.$props.layout.$2screen(this.position.y)),t.arc(12,10,10,2*Math.PI,!1),this.isShowTitle&&this.showAllText&&this.drawText(t,this.titleVideo,this.colorTitleVideo,12,3),this.isShowDesciption&&this.showAllText&&this.drawText(t,this.messageText,this.colorDescriptionVideo,12,13)):t.translate(this.mouse.x,this.mouse.y),t.strokeStyle=this.textColorMedia,t.stroke(this.iconDraw))},onCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},mouseup:function(t){if(clearTimeout(this.timerMove),this.cangePosition){this.cangePosition=!1;var e=this.$props.layout.screen2t(t.layerX),i=this.$props.layout.screen2$(t.layerY);this.position.x&&this.position.y||(this.position.x=this.getTimeCandle(e.toFixed(0)),this.position.y=i),this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()}},mousedown:function(t){var e=this,i=this.$props.layout.screen2t(t.layerX),o=this.$props.layout.screen2$(t.layerY);this.position.x&&this.position.y?this.onCircle(12,10,this.$props.layout.t2screen(i)-this.$props.layout.t2screen(this.position.x),this.$props.layout.$2screen(o)-this.$props.layout.$2screen(this.position.y),10)&&(this.timerMove=setTimeout((function(){e.position={x:void 0,y:void 0},e.cangePosition=!0}),200),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]})):(this.position.x=this.getTimeCandle(i.toFixed(0)),this.position.y=o,this.openModal("stepInitRecordVideo",t),this.saveNewPosition())}},computed:Object(c["a"])({sett:function(){return this.$props.settings}},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),data:function(){return{tags:[],isShowOnHover:!0,colorTitleVideo:"rgba(255,128,0,1)",fontSizeTitleVideo:12,colorDescriptionVideo:"rgba(255,128,0,1)",fontSizeDescriptionVideo:12,file:void 0,counterDoubleClick:0,titleVideo:"Заголовок",messageText:"",ctx:void 0,isShowTitle:!0,isShowDesciption:!0,showAllText:!1,position:{x:void 0,y:void 0},mouse:{x:void 0,y:void 0},textColorMedia:"rgba(255,128,0,1)"}}},nSt=oSt,sSt=Object(C["a"])(nSt,Jvt,Kvt,!1,null,null,null),rSt=sSt.exports,aSt={name:"LongPosition",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.prec=this.getContracts.find((function(e){return e.name===t.symbol})).precision,this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.initPin.x||this.initPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["LongPosition"]},drawCircle:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]||t>this.arrCnd.length){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},drawSection:function(t,e,i,o,n,s,r){var a=this.symbol,c=-1*this.getContracts.find((function(t){return t.name===a})).precision,l=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(i+r*n),u=Cmt("trunc",l*Ph(this.prec),-1),d=Cmt("trunc",l,c),h=d/this.initPin.y*100,p=Cmt("trunc",h,-4),g="".concat(Math.abs(this.$props.layout.screen2$(i+r*n).toFixed(this.prec))," (").concat(Math.abs(p.toFixed(2)),"%) ").concat(Math.abs(u)),f=+t.measureText("".concat(g)).fontBoundingBoxAscent+t.measureText("".concat(g)).fontBoundingBoxDescent;t.beginPath(),t.fillStyle=o,t.rect(e,i,s,r*n),t.fill(),this.drawDescription(t,e,i+r*n,"#fff",n>0?this.colorUp:this.colorDown,g,s,n>0?-6:f+6)},drawDescription:function(t,e,i,o,n,s,r,a){t.beginPath(),t.fillStyle=this.textColor;var c=this.bold?this.bold+" ":"",l=this.italic?this.italic+" ":"",u=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=l+c+u;var d=t.measureText(s).width,h=e+r/2-d/2;t.font=l+c+u,t.fillText(s,+h,i+a),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},rgbaToRgb:function(t){var e=t.replace(/[^,\d]/g,"").split(",");e.splice(e.length-1,1);var i=e.join("");return"rgb(".concat(i,")")},drawTextCenter:function(t){t.beginPath(),t.fillStyle="#23a776";var e=this.bold?this.bold+" ":"",i=this.italic?this.italic+" ":"",o=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=i+e+o;var n="Покупка ".concat(this.initPin.y.toFixed(this.prec)),s=+t.measureText("".concat(n)).fontBoundingBoxAscent+t.measureText("".concat(n)).fontBoundingBoxDescent,r=t.measureText("".concat(n)).width,a=this.$props.layout.t2screen(this.initPin.x)+this.width/2-r/2;t.fillText(n,+a,this.$props.layout.$2screen(this.initPin.y)+.5*s),t.fill()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.initPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.initPin.x)+170),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"LongPosition",nameIconTitle:"new-long-pos",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"StopLevel",startCheckBox:!0,valueStartCheckBox:this.isShowDown,controllerCheckBox:function(t){i.isShowDown=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorDown",color:function(){return i.colorDown},value:this.colorDown,fast:!0}]},{index:2,name:"Target",startCheckBox:!0,valueStartCheckBox:this.isShowUp,controllerCheckBox:function(t){i.isShowUp=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorUp",color:function(){return i.colorUp},value:this.colorUp,fast:!0}]}],typeModal:t}}})},draw:function(t){this.ctx=t,this.initPin.x&&this.initPin.y&&(this.isShowUp&&this.drawSection(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y),this.colorUp,-1,this.width,this.heightUp),this.isShowDown&&this.drawSection(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y),this.colorDown,1,this.width,this.heightDown),this.recttangle={A:{x:this.$props.layout.t2screen(this.initPin.x),y:this.$props.layout.$2screen(this.initPin.y)+-1*this.heightUp},B:{x:this.$props.layout.t2screen(this.initPin.x)+this.width,y:this.$props.layout.$2screen(this.initPin.y)+-1*this.heightUp},C:{x:this.$props.layout.t2screen(this.initPin.x),y:this.$props.layout.$2screen(this.initPin.y)+this.heightDown},D:{x:this.$props.layout.t2screen(this.initPin.x)+this.width,y:this.$props.layout.$2screen(this.initPin.y)+this.heightDown}},this.drawTextCenter(t),this.recttangle&&this.pointInRectangle(this.mouse,this.recttangle)&&(this.drawCircle(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y)),this.drawCircle(t,this.$props.layout.t2screen(this.initPin.x)+this.width,this.$props.layout.$2screen(this.initPin.y)),this.drawCircle(t,this.recttangle.A.x,this.recttangle.A.y),this.drawCircle(t,this.recttangle.C.x,this.recttangle.C.y)))},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changeHigthA&&(this.heightUp=Math.abs(this.$props.layout.$2screen(this.initPin.y)-t.layerY)),this.changeHigthC&&(this.heightDown=Math.abs(this.$props.layout.$2screen(this.initPin.y)-t.layerY)),this.changeWidth&&(this.width=Math.abs(t.layerX-this.$props.layout.t2screen(this.initPin.x))),this.changePositionRectangle&&(this.initPin={x:this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),y:this.$props.layout.screen2$(t.layerY)})},mousedown:function(t){var e=this,i=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),o=this.$props.layout.screen2$(t.layerY);if(this.recttangle){if(this.hover(t.layerX,t.layerY,this.recttangle.A.x,this.recttangle.A.y))return this.changeHigthA=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});if(this.hover(t.layerX,t.layerY,this.recttangle.C.x,this.recttangle.C.y))return this.changeHigthC=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});if(this.hover(t.layerX,t.layerY,this.recttangle.D.x,this.$props.layout.$2screen(this.initPin.y)))return this.changeWidth=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});this.pointInRectangle(this.mouse,this.recttangle)&&(this.doubelClick(t),this.timerMove=setTimeout((function(){e.changePositionRectangle=!0,e.pinChangePosition={x:t.layerX,y:t.layerY}}),130),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}i&&o&&!this.initPin.x&&!this.initPin.y&&(this.initPin={x:i,y:o},this.saveNewPosition(),Jpt.$emit("closeAllFastSettings"),this.openModal(null,t))},mouseup:function(){clearTimeout(this.timerMove),this.changeHigthA&&(this.changeHigthA=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changeHigthC&&(this.changeHigthC=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changeWidth&&(this.changeWidth=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changePositionRectangle&&(this.changePositionRectangle=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),setTimeout((function(){e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)}},watch:{isShowUp:function(t){void 0!==t&&t!==this.isShowUp&&(this.isShowUp?this.heightUp=200:this.heightUp=0)},isShowDown:function(t){void 0!==t&&t!==this.isShowDown&&(this.isShowDown?this.heightDown=200:this.heightDown=0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,initPin:{x:null,y:null},ctx:void 0,mouse:{x:void 0,y:void 0},colorUp:"rgba(106,168,79,0.25)",colorDown:"rgba(153,1,1,0.25)",textColor:"rgba(0,205,0,1)",fontSizeMessage:12,typeLine:[],bold:"",italic:"",isShowUp:!0,isShowDown:!0,width:150,heightUp:200,heightDown:180}}},cSt=aSt,lSt=Object(C["a"])(cSt,Zvt,tyt,!1,null,null,null),uSt=lSt.exports,dSt={name:"ShortPosition",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.prec=this.getContracts.find((function(e){return e.name===t.symbol})).precision,this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.initPin.x||this.initPin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["ShortPosition"]},drawCircle:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="rgba(101,142,232,1)",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]||t>this.arrCnd.length){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},drawSection:function(t,e,i,o,n,s,r){var a=-1*this.prec,c=this.$props.layout.screen2$(i)-this.$props.layout.screen2$(i+r*n),l=Cmt("trunc",c*Ph(this.prec),-1),u=Cmt("trunc",c,a),d=u/this.initPin.y*100,h=Cmt("trunc",d,-4),p="".concat(Math.abs(this.$props.layout.screen2$(i+r*n).toFixed(this.prec))," (").concat(Math.abs(h.toFixed(2)),"%) ").concat(Math.abs(l)),g=+t.measureText("".concat(p)).fontBoundingBoxAscent+t.measureText("".concat(p)).fontBoundingBoxDescent;t.beginPath(),t.fillStyle=o,t.rect(e,i,s,r*n),t.fill(),this.drawDescription(t,e,i+r*n,"#fff",n>0?this.colorUp:this.colorDown,p,s,n>0?-6:g+6)},drawDescription:function(t,e,i,o,n,s,r,a){t.beginPath(),t.fillStyle=this.textColor;var c=this.bold?this.bold+" ":"",l=this.italic?this.italic+" ":"",u=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=l+c+u;var d=t.measureText(s).width,h=e+r/2-d/2;t.font=l+c+u,t.fillText(s,+h,i+a),t.fill()},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},rgbaToRgb:function(t){var e=t.replace(/[^,\d]/g,"").split(",");e.splice(e.length-1,1);var i=e.join("");return"rgb(".concat(i,")")},drawTextCenter:function(t){t.beginPath(),t.fillStyle="#e54150";var e=this.bold?this.bold+" ":"",i=this.italic?this.italic+" ":"",o=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=i+e+o;var n="Продажа ".concat(this.initPin.y?this.initPin.y.toFixed(this.prec):0),s=+t.measureText("".concat(n)).fontBoundingBoxAscent+t.measureText("".concat(n)).fontBoundingBoxDescent,r=t.measureText("".concat(n)).width,a=this.$props.layout.t2screen(this.initPin.x)+this.width/2-r/2;t.fillText(n,+a,this.$props.layout.$2screen(this.initPin.y)+.5*s),t.fill()},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.initPin.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.initPin.x)+170),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"ShortPosition",nameIconTitle:"new-short-pos",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"StopLevel",startCheckBox:!0,valueStartCheckBox:this.isShowUp,controllerCheckBox:function(t){i.isShowUp=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorDown",value:this.colorDown,color:function(){return i.colorDown},fast:!0}]},{index:2,name:"Target",startCheckBox:!0,valueStartCheckBox:this.isShowDown,controllerCheckBox:function(t){i.isShowDown=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorUp",value:this.colorUp,color:function(){return i.colorUp},fast:!0}]}],typeModal:t||"fast"}}})},draw:function(t){this.ctx=t,this.initPin&&(this.isShowUp&&this.drawSection(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y),this.colorUp,-1,this.width,this.heightUp),this.isShowDown&&this.drawSection(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y),this.colorDown,1,this.width,this.heightDown),this.recttangle={A:{x:this.$props.layout.t2screen(this.initPin.x),y:this.$props.layout.$2screen(this.initPin.y)+-1*this.heightUp},B:{x:this.$props.layout.t2screen(this.initPin.x)+this.width,y:this.$props.layout.$2screen(this.initPin.y)+-1*this.heightUp},C:{x:this.$props.layout.t2screen(this.initPin.x),y:this.$props.layout.$2screen(this.initPin.y)+this.heightDown},D:{x:this.$props.layout.t2screen(this.initPin.x)+this.width,y:this.$props.layout.$2screen(this.initPin.y)+this.heightDown}},this.drawTextCenter(t),this.recttangle&&this.pointInRectangle(this.mouse,this.recttangle)&&(this.drawCircle(t,this.$props.layout.t2screen(this.initPin.x),this.$props.layout.$2screen(this.initPin.y)),this.drawCircle(t,this.$props.layout.t2screen(this.initPin.x)+this.width,this.$props.layout.$2screen(this.initPin.y)),this.drawCircle(t,this.recttangle.A.x,this.recttangle.A.y),this.drawCircle(t,this.recttangle.C.x,this.recttangle.C.y)))},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changeHigthA&&(this.heightUp=Math.abs(this.$props.layout.$2screen(this.initPin.y)-t.layerY)),this.changeHigthC&&(this.heightDown=Math.abs(this.$props.layout.$2screen(this.initPin.y)-t.layerY)),this.changeWidth&&(this.width=Math.abs(t.layerX-this.$props.layout.t2screen(this.initPin.x))),this.changePositionRectangle&&(this.initPin={x:this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),y:this.$props.layout.screen2$(t.layerY)})},mousedown:function(t){var e=this,i=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),o=this.$props.layout.screen2$(t.layerY);if(this.recttangle){if(this.hover(t.layerX,t.layerY,this.recttangle.A.x,this.recttangle.A.y))return this.changeHigthA=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});if(this.hover(t.layerX,t.layerY,this.recttangle.C.x,this.recttangle.C.y))return this.changeHigthC=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});if(this.hover(t.layerX,t.layerY,this.recttangle.D.x,this.$props.layout.$2screen(this.initPin.y)))return this.changeWidth=!0,void this._$emit("custom-event",{event:"scroll-lock",args:[!0]});this.pointInRectangle(this.mouse,this.recttangle)&&(this.doubelClick(t),this.timerMove=setTimeout((function(){e.changePositionRectangle=!0,e.pinChangePosition={x:t.layerX,y:t.layerY}}),130),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}i&&o&&!this.initPin.x&&!this.initPin.y&&(this.initPin={x:i,y:o},this.saveNewPosition(),Jpt.$emit("closeAllFastSettings"),this.openModal(null,t))},mouseup:function(){clearTimeout(this.timerMove),this.changeHigthA&&(this.changeHigthA=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changeHigthC&&(this.changeHigthC=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changeWidth&&(this.changeWidth=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition()),this.changePositionRectangle&&(this.changePositionRectangle=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.saveNewPosition())},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),setTimeout((function(){e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)}},watch:{isShowUp:function(t){void 0!==t&&t!==this.isShowUp&&(this.isShowUp?this.heightUp=200:this.heightUp=0)},isShowDown:function(t){void 0!==t&&t!==this.isShowDown&&(this.isShowDown?this.heightDown=200:this.heightDown=0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{counterDoubleClick:0,ctx:void 0,mouse:{x:void 0,y:void 0},initPin:{x:null,y:null},colorUp:"rgba(153,1,1,0.25)",colorDown:"rgba(106,168,79,0.25)",textColor:"rgba(0,205,0,1)",fontSizeMessage:12,typeLine:[],bold:null,italic:null,isShowUp:!0,isShowDown:!0,width:150,heightUp:200,heightDown:180}}},hSt=dSt,pSt=Object(C["a"])(hSt,eyt,iyt,!1,null,null,null),gSt=pSt.exports,fSt={name:"PriceNote",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.prec=this.getContracts.find((function(e){return e.name===t.symbol})).precision,this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.centerCircle.x||this.centerCircle.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["PriceNote"]},draw:function(t){this.ctx=t,this.drawCircle(t,this.centerCircle.x,this.centerCircle.y),this.xt&&this.y$&&(this.viewChangeSizeCircle=!1)},roundRect:function(t,e,i,o,n,s,r,a,c){var l=this;if("undefined"===typeof a&&(a=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var u={tl:0,tr:0,br:0,bl:0};for(var d in u)s[d]=s[d]||u[d]}if(t.moveTo(e,i),this.A={x:e,y:i},t.lineTo(e+o,i),this.B={x:e+o,y:i},t.lineTo(e+o,i+n),this.C={x:e+o,y:i+n},t.lineTo(e,i+n),this.D={x:e,y:i+n},t.closePath(),t.strokeStyle=!1,t.beginPath(),t.strokeStyle=!1,t.moveTo(e+s.tl,i),t.lineTo(e+o-s.tr,i),t.quadraticCurveTo(e+o,i,e+o,i+s.tr),t.lineTo(e+o,i+n-s.br),t.quadraticCurveTo(e+o,i+n,e+o-s.br,i+n),t.lineTo(e+s.bl,i+n),t.quadraticCurveTo(e,i+n,e+.5*n,i+.933*n),t.lineTo(e+s.bl,i+n+.67*n),t.quadraticCurveTo(e,i+n,e,i+n-s.bl),t.lineTo(e,i+s.tl),t.quadraticCurveTo(e,i,e+s.tl,i),t.closePath(),r){var h=+this.fontSizeMessage;t.fillStyle=this.colorLine,t.fill();var p=this.bold?this.bold+" ":"",g=this.italic?this.italic+" ":"",f=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=g+p+f,t.fillStyle=this.textColor;var m=i+.1*h;t.fillStyle=this.textColor,Array.isArray(c)&&c.forEach((function(i,o){o>0?t.fillText(i,e+ +l.fontSizeMessage,m+h+.3*h):t.fillText(i,e+ +l.fontSizeMessage,m+1.25*h),m=m+h+.3*h}))}t.beginPath(),this.price=this.$props.layout.screen2$(i+n+.67*n),t.fillStyle="white",t.strokeStyle="#3971ee",t.arc(e+s.bl,i+n+.67*n,5,0,2*Math.PI),t.fill(),t.stroke()},drawCircle:function(t,e,i){var o=this.$props.layout.t2screen(e),n=this.$props.layout.$2screen(i),s=this.bold?this.bold+" ":"",r=this.italic?this.italic+" ":"",a=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=s+r+a,t.fillStyle="red";var c=["".concat(this.price.toFixed(this.prec))],l=c[0]||"";c.forEach((function(t){t.length>l.length&&(l=t)}));var u=+this.fontSizeMessage,d=t.measureText(l).width+2*u,h=9;this.heigth=(u+.3*u)*c.length+.6*u,this.roundRect(t,o,n,d,this.heigth,h,!0,void 0,c)},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*+localStorage.getItem("timeFrame");e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},drawNewPositionCircle:function(t,e){var i=this.getTimeCandle(this.$props.layout.screen2t(t).toFixed(0)),o=this.$props.layout.screen2$(e);this.centerCircle.x=i,this.centerCircle.y=o},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200),this.timerDebouncer&&clearInterval(this.timerDebouncer)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},debouncer:function(t,e){this.timerDebouncer=setTimeout((function(){e()}),t)},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.xt=this.$props.layout.screen2t(this.$props.layout.t2screen(t.xt)+120),t.y$=this.$props.layout.screen2$(this.$props.layout.$2screen(t.y$)-40),t.centerCircle={x:this.$props.layout.screen2t(this.$props.layout.t2screen(t.centerCircle.x)+40),y:this.$props.layout.screen2$(this.$props.layout.$2screen(t.centerCircle.y)+40)},Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;e&&e.x&&e.y&&Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"PriceTag",nameIconTitle:"new-price-pos",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"Background",startCheckBox:!0,valueStartCheckBox:this.isBackground,controllerCheckBox:function(t){i.isBackground=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},mousemove:function(t){var e=t.layerX,i=t.layerY,o=this.getTimeCandle(this.$props.layout.screen2t(e).toFixed(0)),n=this.$props.layout.screen2$(i);this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.xt=o,this.y$=n,this.changePosition&&this.drawNewPositionCircle(t.layerX,t.layerY)},mousedown:function(t){var e=this,i=t.layerX,o=t.layerY,n=this.getTimeCandle(this.$props.layout.screen2t(i).toFixed(0)),s=this.$props.layout.screen2$(o);this.xt=n,this.y$=s,this.pointInRectangle({x:this.$props.layout.t2screen(n),y:this.$props.layout.$2screen(s)},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.debouncer(200,(function(){e.changePosition=!0})),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))},mouseup:function(t){if(this.timerDebouncer&&clearInterval(this.timerDebouncer),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]})),this.initClick&&(this.initClick=!1),this.changePosition)return this.drawNewPositionCircle(t.layerX,t.layerY),this.changePosition=!1,void this.saveNewPosition();this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{initClick:!0,changePosition:!0,downInChangeSize:!1,viewChangeSizeCircle:!1,initCircle:!0,fontSizeMessage:14,bold:"",italic:"",colorLine:"rgba(109, 158, 235, 0.36)",textColor:"rgba(255,255,255,1)",messageTextPrice:"",radiusCircle:30,counterDoubleClick:0,titleBacgroundColor:this.$t("windowColorWord"),titleColorText:this.$t("txtColorWord"),titleModal:this.$t("popUpTxtWord"),ctx:void 0,elementToChangeCurspor:void 0,mouse:{x:void 0,y:void 0},price:0,centerCircle:{x:void 0,y:void 0},xt:void 0,y$:void 0}}},mSt=fSt,vSt=Object(C["a"])(mSt,oyt,nyt,!1,null,null,null),ySt=vSt.exports,CSt={name:"PricePin",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(e.createdWithDefault?(this.pin.x=this.$props.layout.screen2t(e.offsetX-30),this.pin.y=+e.price,this.fromMouse=!1,this.saveNewPosition()):this.idCurrentOverlay="".concat(e.id)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.pin.x||this.pin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.pin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.pin.y)+20),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"PricePin",nameIconTitle:"new-rightprice-text",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"LabelBorder",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorCircle",value:this.colorCircle,color:function(){return i.colorCircle},fast:!0}]},{index:2,name:"LineColor",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},listener:function(t){if("Delete"===t.key){if(!this.fromMouse)return;Jpt.$emit("delMessage",{id:this.idCurrentOverlay})}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},draw:function(t){if(this.ctx=t,t.beginPath(),this.fromMouse){var e=this.mouse.x,i=this.mouse.y;this.drawPricePin(t,e,i)}else if(this.pin.x,this.pin.y){var o=this.arrCnd[+this.pin.x.toFixed(0)];this.drawPricePin(t,this.$props.layout.t2screen(o[0]),this.$props.layout.$2screen(this.pin.y))}},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(setTimeout((function(){return e.fromMouse=!1}),0),this.change=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle=this.colorCircle,t.lineWidth="1",t.strokeStyle="#dfdfdf",t.arc(e,i,5,0,2*Math.PI,!0),t.stroke(),t.fill()},use_for:function(){return["PricePin"]},drawPricePin:function(t,e,i){t.fillStyle=this.textColor;var o=this.bold?this.bold+" ":"",n=this.italic?this.italic+" ":"",s=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=n+o+s;var r=t.measureText("".concat(this.$props.layout.screen2$(i).toFixed(5))).width;this.left;t.moveTo(e,i),t.lineTo(e+r+30,i),t.strokeStyle=this.colorLine,t.stroke(),t.fillText(this.$props.layout.screen2$(i).toFixed(5),e+15,i-5),t.fill(),this.drawCirlce(t,e,i)},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mouseup:function(t){if(this.fromMouse){this.mousedownHover=!1;var e=t.layerX,i=t.layerY,o=this.$props.layout.screen2t(e),n=this.$props.layout.screen2$(i),s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));this._$emit("custom-event",{event:"scroll-lock",args:[!1]});this.arrCnd[this.pin.x];this.drawPricePin(this.ctx,this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n)),this.pin={x:s[0],y:n},this.fromMouse=!1,this.saveNewPosition()}},hoverCircle:function(t,e){var i=this.arrCnd[this.pin.x];return(t-this.$props.layout.t2screen(i[0]))*(t-this.$props.layout.t2screen(i[0]))+(e-this.$props.layout.$2screen(this.pin.y))*(e-this.$props.layout.$2screen(this.pin.y))<2*Math.PI*5},hoverTest:function(t,e){var i=this.arrCnd[this.pin.x];if(t>=this.$props.layout.t2screen(i[0])&&t<=this.$props.layout.t2screen(i[0])+70&&e>=this.$props.layout.$2screen(this.pin.y)&&e<=this.$props.layout.$2screen(this.pin.y)+2)return!0},mousedown:function(t){var e=t.layerX,i=t.layerY,o=this.$props.layout.screen2t(e),n=this.$props.layout.screen2$(i),s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));this.fromMouse?(this.fromMouse=!1,this.pin={x:s[0],y:n},this.saveNewPosition()):(this.hoverTest(this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n))||this.hoverCircle(this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n)))&&(this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.fromMouse=!0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{fromMouse:!0,ctx:void 0,mouse:{x:void 0,y:void 0},counterDoubleClick:0,change:!1,colorCircle:"#e54150",left:!1,colorLine:"#e54150",textColor:"#e54150",fontSizeMessage:14,bold:"",italic:"",pin:{x:null,y:null}}}},bSt=CSt,SSt=Object(C["a"])(bSt,syt,ryt,!1,null,null,null),PSt=SSt.exports,TSt={name:"PricePinLeft",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.pin.x||this.pin.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.pin.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.pin.y)+20),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"PricePinLeft",nameIconTitle:"new-leftprice-text",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"LabelBorder",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorCircle",value:this.colorCircle,color:function(){return i.colorCircle},fast:!0}]},{index:2,name:"LineColor",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},listener:function(t){if("Delete"===t.key){if(!this.fromMouse)return;Jpt.$emit("delMessage",{id:this.idCurrentOverlay})}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},draw:function(t){if(this.ctx=t,t.beginPath(),this.fromMouse){var e=this.mouse.x,i=this.mouse.y;this.drawPricePin(t,e,i)}else if(this.pin.x&&this.pin.y){var o=this.arrCnd[this.pin.x];this.drawPricePin(t,this.$props.layout.t2screen(o[0]),this.$props.layout.$2screen(this.pin.y))}},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(setTimeout((function(){return e.fromMouse=!1}),0),this.change=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},drawCirlce:function(t,e,i){t.beginPath(),t.fillStyle=this.colorCircle,t.lineWidth="1",t.strokeStyle="#dfdfdf",t.arc(e,i,5,0,2*Math.PI,!0),t.stroke(),t.fill()},use_for:function(){return["PricePinLeft"]},drawPricePin:function(t,e,i){t.fillStyle=this.textColor;var o=this.bold?this.bold+" ":"",n=this.italic?this.italic+" ":"",s=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=n+o+s;var r=t.measureText("".concat(this.$props.layout.screen2$(i).toFixed(5))).width;t.moveTo(e,i),t.lineTo(e-30-r,i),t.strokeStyle=this.colorLine,t.stroke(),t.fillText(this.$props.layout.screen2$(i).toFixed(5),e-r-15,i-5),t.fill(),this.drawCirlce(t,e,i)},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY},mouseup:function(t){if(this.fromMouse){this.mousedownHover=!1;var e=t.layerX,i=t.layerY,o=this.$props.layout.screen2t(e),n=this.$props.layout.screen2$(i),s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));this._$emit("custom-event",{event:"scroll-lock",args:[!1]});this.arrCnd[this.pin.x];this.drawPricePin(this.ctx,this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n)),this.pin={x:s[0],y:n},this.fromMouse=!1,this.saveNewPosition()}},hoverCircle:function(t,e){var i=this.arrCnd[this.pin.x];return(t-this.$props.layout.t2screen(i[0]))*(t-this.$props.layout.t2screen(i[0]))+(e-this.$props.layout.$2screen(this.pin.y))*(e-this.$props.layout.$2screen(this.pin.y))<2*Math.PI*5},hoverTest:function(t,e){var i=this.arrCnd[this.pin.x];if(t>=this.$props.layout.t2screen(i[0])&&t<=this.$props.layout.t2screen(i[0])+70&&e>=this.$props.layout.$2screen(this.pin.y)&&e<=this.$props.layout.$2screen(this.pin.y)+2)return!0},mousedown:function(t){var e=t.layerX,i=t.layerY,o=this.$props.layout.screen2t(e),n=this.$props.layout.screen2$(i),s=this.$props.sub.find((function(t){return t[0]===+o.toFixed(0)}));this.fromMouse?(this.fromMouse=!1,this.pin={x:s[0],y:n},this.saveNewPosition()):(this.hoverTest(this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n))||this.hoverCircle(this.$props.layout.t2screen(this.arrCnd[s[0]][0]),this.$props.layout.$2screen(n)))&&(this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.fromMouse=!0)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{fromMouse:!0,ctx:void 0,mouse:{x:void 0,y:void 0},counterDoubleClick:0,change:!1,colorCircle:"#e54150",left:!1,colorLine:"#e54150",textColor:"#e54150",fontSizeMessage:14,bold:"",italic:"",pin:{x:null,y:null}}}},xSt=TSt,OSt=Object(C["a"])(xSt,ayt,cyt,!1,null,null,null),wSt=OSt.exports,_St={name:"OnlyTextOverlay",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.startPinRect.x||this.startPinRect.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]||t>this.arrCnd.length){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},formatMeasureToPins:function(t,e){var i=this.$props.layout.t2screen(+t),o=this.$props.layout.$2screen(+e);return{x:i,y:o}},formatXYtoMeasure:function(t,e){var i=this.getTimeCandle(this.$props.layout.screen2t(+t).toFixed(0)),o=this.$props.layout.screen2$(+e);return{x:i,y:o}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["OnlyTextOverlay"]},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},draw:function(t){this.ctx=t,t.beginPath(),this.drawRect(t,this.startPinRect.x,this.startPinRect.y)},drawRect:function(t,e,i){var o=this.formatMeasureToPins(e,i).x,n=this.formatMeasureToPins(e,i).y,s=this.bold?"bold ":"",r=this.italic?"italic ":"",a=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=s+r+a,t.fillStyle="red";var c=ASt(this.messageText,this.maxLng),l=c[0]||"";c.forEach((function(t){t.length>l.length&&(l=t)}));var u=+this.fontSizeMessage,d=t.measureText(l).width+2*u,h=9;this.heigth=(u+.3*u)*c.length+.3*u,this.roundRect(t,o,n,d,this.heigth+14+1.1*c.length,h,!0,!1,c)},moveStartPinRect:function(t,e){var i=this.formatXYtoMeasure(t,e).x,o=this.formatXYtoMeasure(t,e).y;this.startPinRect.x=i,this.startPinRect.y=o},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200),this.timerDebouncer&&clearInterval(this.timerDebouncer)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},debouncer:function(t,e){this.timerDebouncer=setTimeout((function(){e()}),t)},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.startPinRect.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.startPinRect.y)+60),t.startPinRect.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.startPinRect.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Text",nameIconTitle:"new-instrument-text",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"messageText",value:this.messageText,fast:!1}]},{index:2,name:"Background",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&this.moveStartPinRect(t.layerX,t.layerY)},mousedown:function(t){var e=this,i=this.formatXYtoMeasure(t.layerX,t.layerY).x,o=this.formatXYtoMeasure(t.layerX,t.layerY).y;this.xt=i,this.y$=o,this.pointInRectangle({x:this.formatMeasureToPins(i,o).x,y:this.formatMeasureToPins(i,o).y},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.debouncer(200,(function(){e.changePosition=!0})),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))},mouseup:function(t){this.timerDebouncer&&clearInterval(this.timerDebouncer),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]})),this.initClick&&(this.initClick=!1),this.changePosition&&(this.moveStartPinRect(t.layerX,t.layerY),this.changePosition=!1,this.mountedCallout&&(this.mountedCallout=!1,this.openModal("full",t)),this.saveNewPosition()),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})},roundRect:function(t,e,i,o,n,s,r,a,c){var l=this;if("undefined"===typeof a&&(a=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var u={tl:0,tr:0,br:0,bl:0};for(var d in u)s[d]=s[d]||u[d]}if(this.A={x:e,y:i},this.B={x:e+o,y:i},this.C={x:e+o,y:i+n},this.D={x:e,y:i+n},t.closePath(),t.strokeStyle=!1,t.beginPath(),t.strokeStyle=!1,t.moveTo(e+s.tl,i),t.lineTo(e+o-s.tr,i),t.quadraticCurveTo(e+o,i,e+o,i+s.tr),t.lineTo(e+o,i+n-s.br),t.quadraticCurveTo(e+o,i+n,e+o-s.br,i+n),t.lineTo(e+s.bl,i+n),t.quadraticCurveTo(e,i+n,e,i+n-s.bl),t.lineTo(e,i+s.tl),t.quadraticCurveTo(e,i,e+s.tl,i),t.closePath(),r){var h=+this.fontSizeMessage;t.fillStyle=this.colorLine,this.fillBackGround&&t.fill();var p=this.bold?this.bold+" ":"",g=this.italic?this.italic+" ":"",f=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=g+p+f,t.fillStyle=this.textColor;var m=i+.3*h;c&&c.length>0&&c.forEach((function(i){t.fillText(i,e+ +l.fontSizeMessage,m+h+.3*h),m=m+h+.3*h}))}}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{initClick:!0,italic:!1,bold:!1,fontSizeMessage:14,maxLng:28,changePosition:!0,mountedCallout:!0,downInChangeSize:!1,defaultForm:!0,colorLine:"rgba(109, 158, 235, 0.36)",fillBackGround:!0,textColor:"#fff",messageText:this.$t("txtWord"),pos:"bottom",counterDoubleClick:0,titleBacgroundColor:this.$t("windowColorWord"),titleColorText:this.$t("txtColorWord"),titleModal:this.$t("popUpTxtWord"),ctx:void 0,elementToChangeCurspor:void 0,mouse:{x:void 0,y:void 0},startPinRect:{x:void 0,y:void 0},xt:void 0,y$:void 0}}};function ASt(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))}var DSt,kSt,ISt,BSt,MSt=_St,$St=Object(C["a"])(MSt,DSt,kSt,!1,null,null,null),LSt=$St.exports,FSt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),jSt={name:"InstrumentWithOutText",mixins:[tgt["a"]],destroyed:function(){var t=this;Jpt.$on("saveNewSettings",(function(e){e.id===t.$props.id&&(t.saveNewParams(e.settings),t.status="inactive",e.settings.initialCordinats?"string"===typeof e.settings.initialCordinats[0]&&"string"===typeof e.settings.initialCordinats[1]?(t.layout.screen2t(+e.settings.initialCordinats[0].replace(/[^\d.]/g,"")),t.layout.screen2$(+e.settings.initialCordinats[1].replace(/[^\d.]/g,""))):(e.settings.initialCordinats[0],e.settings.initialCordinats[1]):"string"===typeof e.settings.initialCordinats[0]&&"string"===typeof e.settings.initialCordinats[1]?(e.settings.initialCordinats[0],e.settings.initialCordinats[1]):(t.layout.t2screen(e.settings.initialCordinats[0]),t.layout.$2screen(e.settings.initialCordinats[1])))})),Jpt.$off("moveMessage",(function(e){e.id===t.$props.id&&(t.saveNewParams(e.params.settings),t.$nextTick((function(){t.modalSetting.initialCordinats=[t.layout.screen2t(e.newCordinats[0]-t.modalSetting.width/.7),t.layout.screen2$(e.newCordinats[1]-t.modalSetting.height/.7)]})))}))},mounted:function(){var t=this,e=JSON.parse(localStorage.getItem(this.$props.id));e&&e.settings&&(this.wathCursor=!1),Jpt.$on("saveNewSettings",(function(e){e.id===t.$props.id&&(t.saveNewParams(e.settings),t.status="inactive",e.settings.initialCordinats?"string"===typeof e.settings.initialCordinats[0]&&"string"===typeof e.settings.initialCordinats[1]?(t.layout.screen2t(+e.settings.initialCordinats[0].replace(/[^\d.]/g,"")),t.layout.screen2$(+e.settings.initialCordinats[1].replace(/[^\d.]/g,""))):(e.settings.initialCordinats[0],e.settings.initialCordinats[1]):"string"===typeof e.settings.initialCordinats[0]&&"string"===typeof e.settings.initialCordinats[1]?(e.settings.initialCordinats[0],e.settings.initialCordinats[1]):(t.layout.t2screen(e.settings.initialCordinats[0]),t.layout.$2screen(e.settings.initialCordinats[1])))})),Jpt.$on("moveMessage",(function(e){e.id===t.$props.id&&(t.saveNewParams(e),t.$nextTick((function(){t.modalSetting.initialCordinats=[t.layout.screen2t(e.newCordinats[0]-t.modalSetting.width/1.5),t.layout.screen2$(e.newCordinats[1]-t.modalSetting.height/1.5)]})))}))},methods:{saveNewParams:function(t){t.id===this.$props.id&&(this.modalSetting=t.params.settings)},init:function(){},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},draw:function(t){if(this.ctx=t,this.wathCursor){var e=FSt.scale(this.width/24),i=new Path2D,o=new Path2D("M14.9544 13.3537C16.0466 12.2021 17 11.1969 17 9C17 6 15 4 12 4C9 4 7 6 7 9C7 11.1969 7.95335 12.2021 9.04557 13.3537C10.1906 14.561 11.4882 15.9292 12 19C12.5118 15.9292 13.8094 14.561 14.9544 13.3537ZM12 11C13.1046 11 14 10.1046 14 9C14 7.89543 13.1046 7 12 7C10.8954 7 10 7.89543 10 9C10 10.1046 10.8954 11 12 11Z");t.translate(this.mouse.x-this.width/2,this.mouse.y-this.height/2),i.addPath(o,e),t.strokeStyle="#3d85c6",t.stroke(i)}},use_for:function(){return["InstrumentWithOutText"]},mousemove:function(t){this.mouseEvents.x=t.layerX,this.mouseEvents.y=t.layerY},mouseup:function(t){this.cursorUp&&(this.cursorUp=!1,this.modalSetting.initialCordinats=[this.layout.screen2t(this.mouseEvents.x-this.modalSetting.width/2),this.layout.screen2$(this.mouseEvents.y-this.modalSetting.height/2)])},mousedown:function(t){var e=this;this.wathCursor&&(this.modalSetting.initialCordinats=[this.layout.screen2t(this.mouseEvents.x-this.modalSetting.width/2),this.layout.screen2$(this.mouseEvents.y-this.modalSetting.height/2)],this.$nextTick((function(){e.wathCursor=!1})))}},computed:{sett:function(){return this.$props.settings},new_font:function(){return"16px "+this.$props.font.split("px").pop()}},data:function(){return{modalSetting:{title:this.$t("noteWord"),initialCordinats:void 0,backgroundColor:"rgba(51,122,183,1)",messageText:this.$t("txtWord"),colorTextMessage:"rgba(255,255,255,1)",fontSizeMessage:12,boldTextMessage:!1,italicTextMessage:!1,height:50,width:50,attachment:!0,status:"inactive",offsetText:{left:1.3,top:1.5}},width:50,height:50,dataMessage:void 0,wathCursor:!0,ctx:void 0,mouseEvents:{x:void 0,y:void 0}}}},RSt=jSt,WSt=Object(C["a"])(RSt,ISt,BSt,!1,null,null,null),NSt=WSt.exports,ESt={name:"InstrumentTextCallout",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin)),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.startPinRect.x||this.startPinRect.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},formatMeasureToPins:function(t,e){var i=this.$props.layout.t2screen(+t),o=this.$props.layout.$2screen(+e);return{x:i,y:o}},formatXYtoMeasure:function(t,e){var i=this.getTimeCandle(this.$props.layout.screen2t(+t).toFixed(0)),o=this.$props.layout.screen2$(+e);return{x:i,y:o}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["InstrumentTextCallout"]},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},draw:function(t){this.ctx=t,t.beginPath(),this.drawRect(t,this.startPinRect.x,this.startPinRect.y),this.xt&&this.y$&&(this.viewChangeSizeCircle=!1),this.cricleCallout.x&&this.cricleCallout.y&&this.viewCircleCallout&&this.drawCircleCallout1(t,this.cricleCallout.x,this.cricleCallout.y)},drawCircleCallout1:function(t,e,i){var o=this.formatMeasureToPins(e,i).x,n=this.formatMeasureToPins(e,i).y;t.font="14px Arial",this.drawCircleCallout(t,o,n)},drawRect:function(t,e,i){var o=this.formatMeasureToPins(e,i).x,n=this.formatMeasureToPins(e,i).y,s=this.bold?this.bold+" ":"",r=this.italic?this.italic+" ":"",a=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=s+r+a,t.fillStyle="red";var c=USt(this.messageText,this.maxLng),l=c[0]||"";c.forEach((function(t){t.length>l.length&&(l=t)}));var u=+this.fontSizeMessage,d=t.measureText(l).width+2*u,h=9;this.heigth=(u+.3*u)*c.length+.6*u,this.roundRect(t,o,n,d,this.heigth,h,!0,!1,c)},moveStartPinRect:function(t,e){var i=this.formatXYtoMeasure(t,e).x,o=this.formatXYtoMeasure(t,e).y;this.startPinRect.x=i,this.startPinRect.y=o},moveCirclePinRect:function(t,e){var i=this.formatXYtoMeasure(t,e).x,o=this.formatXYtoMeasure(t,e).y;this.cricleCallout.x=i,this.cricleCallout.y=o},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200),this.timerDebouncer&&clearInterval(this.timerDebouncer)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},debouncer:function(t,e){this.timerDebouncer=setTimeout((function(){e()}),t)},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.cricleCallout.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.cricleCallout.y)+60),t.cricleCallout.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.cricleCallout.x)+40),t.startPinRect.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.startPinRect.y)+60),t.startPinRect.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.startPinRect.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Footnote",nameIconTitle:"new-callout-text",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"",startCheckBox:!1,withOutLine:!0,settings:[{component:"TextArea",icon:"messageText",nameParam:"messageText",value:this.messageText,fast:!1}]},{index:2,name:"Background",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&this.moveStartPinRect(t.layerX,t.layerY),this.changeCircleCallout){this.moveCirclePinRect(t.layerX,t.layerY);var e=this.C.y>t.layerY?this.A.y>t.layerY?"t":"tmb":"b",i=this.A.x>t.layerX?"l":this.B.x>t.layerX?"lmr":"r";"tmb"===e&&"l"===i?this.pos="left":"t"===e&&"lmr"===i?this.pos="top":"b"===e&&"lmr"===i&&(this.pos="bottom")}},mousedown:function(t){var e=this,i=this.formatXYtoMeasure(t.layerX,t.layerY).x,o=this.formatXYtoMeasure(t.layerX,t.layerY).y;if(this.xt=i,this.y$=o,this.defaultForm){var n=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,s=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;this.hover(t.layerX,t.layerY,n,s)&&(this.defaultForm=!1,this.changeCircleCallout=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}else{var r=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,a=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;this.hover(t.layerX,t.layerY,r,a)&&(this.defaultForm=!1,this.changeCircleCallout=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}this.pointInRectangle({x:this.formatMeasureToPins(i,o).x,y:this.formatMeasureToPins(i,o).y},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.debouncer(200,(function(){e.changePosition=!0})),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))},mouseup:function(t){this.timerDebouncer&&clearInterval(this.timerDebouncer),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]})),this.initClick&&(this.initClick=!1),this.changePosition&&(this.moveStartPinRect(t.layerX,t.layerY),this.changePosition=!1,this.mountedCallout&&(this.mountedCallout=!1),this.saveNewPosition()),this.changeCircleCallout&&(this.moveCirclePinRect(t.layerX,t.layerY),this.saveNewPosition(),this.changeCircleCallout=!1,this.mountedCallout&&(this.changePosition=!0)),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})},drawCircleCallout:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.fillStyle="#fff",t.arc(e,i,6,0,2*Math.PI,!0),t.stroke(),t.fill()},roundRect:function(t,e,i,o,n,s,r,a,c){var l=this;if("undefined"===typeof a&&(a=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var u={tl:0,tr:0,br:0,bl:0};for(var d in u)s[d]=s[d]||u[d]}if(this.A={x:e,y:i},this.B={x:e+o,y:i},this.C={x:e+o,y:i+n},this.D={x:e,y:i+n},t.closePath(),t.strokeStyle=!1,t.beginPath(),t.strokeStyle=!1,t.moveTo(e+s.tl,i),"top"===this.pos){if(t.lineTo(e+((o-s.tr)/2-.09*o),i),this.defaultForm)t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var h=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,p=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(h,p)}t.lineTo(e+(o-s.tr)/2+.09*o,i)}if(t.lineTo(e+o-s.tr,i),t.quadraticCurveTo(e+o,i,e+o,i+s.tr),"rigth"===this.pos){if(t.lineTo(e+o,i+(n-s.br)/2-.09*o),this.defaultForm)this.cricleCallout={x:e+(o-s.tr)/2+.09*o,y:i+n-s.br+30},t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var g=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,f=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(g,f)}t.lineTo(e+o,i+(n-s.br)/2+.09*o)}if(t.lineTo(e+o,i+n-s.br),t.quadraticCurveTo(e+o,i+n,e+o-s.br,i+n),"bottom"===this.pos){if(t.lineTo(e+(o-s.tr)/2-.09*o,i+n),this.defaultForm){var m=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,v=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(m,v)}else{var y=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,C=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(y,C)}t.lineTo(e+(o-s.tr)/2+.09*o,i+n)}if(t.lineTo(e+s.bl,i+n),t.quadraticCurveTo(e,i+n,e,i+n-s.bl),t.lineTo(e,i+s.tl),"left"===this.pos){if(t.lineTo(e,i+s.tl+.56*n),this.defaultForm)this.cricleCallout={x:e+(o-s.tr)/2+.09*o,y:i+n-s.br+30},t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var b=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,S=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(b,S)}t.lineTo(e,i+s.tl+.24*n)}if(t.quadraticCurveTo(e,i,e+s.tl,i),t.closePath(),r){var P=+this.fontSizeMessage;this.isBackground&&(t.fillStyle=this.colorLine),this.isBackground&&t.fill();var T=this.bold?this.bold+" ":"",x=this.italic?this.italic+" ":"",O=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=x+T+O,t.fillStyle=this.textColor;var w=i+.1*P;t.fillStyle=this.textColor,c&&c.length>0&&c.forEach((function(i,o){o>0?t.fillText(i,e+ +l.fontSizeMessage,w+P+.3*P):t.fillText(i,e+ +l.fontSizeMessage,w+1.25*P),w=w+P+.3*P}))}this.drawCircleCallout(t,this.cricleCallout.x,this.cricleCallout.y)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{initClick:!0,maxLng:40,viewCircleCallout:!0,fontSizeMessage:14,bold:"",italic:"",cricleCallout:{x:void 0,y:void 0},changePosition:!1,mountedCallout:!0,changeCircleCallout:!0,downInChangeSize:!1,viewChangeSizeCircle:!1,defaultForm:!0,isBackground:!0,colorLine:"rgba(109, 158, 235, 0.36)",textColor:"#fff",messageText:this.$t("txtWord"),radiusCircle:30,pos:"bottom",counterDoubleClick:0,titleBacgroundColor:this.$t("windowColorWord"),titleColorText:this.$t("txtColorWord"),titleModal:this.$t("popUpTxtWord"),ctx:void 0,elementToChangeCurspor:void 0,mouse:{x:void 0,y:void 0},startPinRect:{x:void 0,y:void 0},xt:void 0,y$:void 0}}};function USt(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))}var VSt,HSt,GSt=ESt,qSt=Object(C["a"])(GSt,VSt,HSt,!1,null,null,null),zSt=qSt.exports,YSt={name:"PriceCallout",mixins:[tgt["a"]],destroyed:function(){Jpt.$off("openModalFromOverlay",this.openModalFromOverlay),Jpt.$off("addInstrumentToChart",this.addInstrumentToChart)},mounted:function(){var t=this;Jpt.$on("openModalFromOverlay",this.openModalFromOverlay),Jpt.$on("addInstrumentToChart",this.addInstrumentToChart),this.symbol=this.sett.symbol,this.timeFrame=this.sett.timeFrame;var e=this.clonnedInitSettings(this.sett.data);this.addToContext(e),this.arrCnd=JSON.parse(JSON.stringify(this.sett.candles)),this.prec=-1*this.getContracts.find((function(e){return e.name===t.symbol})).precision,this.idCurrentOverlay="".concat(this.sett.idOvrl),e&&e.id&&(this.idCurrentOverlay="".concat(e.id),this.countBarsSecondPin=+"".concat(e.countBarsSecondPin),this.countBarsFerstPin=+"".concat(e.countBarsFerstPin),this.initClick=!1,this.changePosition=!1,this.changeCircleCallout=!1),e&&e.copy&&setTimeout((function(){return t.saveNewPosition()}),100)},methods:{addInstrumentToChart:function(){this.startPinRect.x||this.startPinRect.y||Jpt.$emit("prevDeleteOverlay",{name:"prevDeleteOverlay",data:{id:this.idCurrentOverlay,idProps:this.$props.id,screen:{id:this.sett.groupId}}})},addToContext:function(t){var e=this;t&&Object.keys(t).forEach((function(i){"id"!==i&&(e[i]=JSON.parse(JSON.stringify(t[i])))}))},openModalFromOverlay:function(t){var e=this;t.id===this.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return e.openModal("full",{})}),50))},clonnedInitSettings:function(t){if(t){var e={},i=["last_ux_id"];return Object.keys(t).forEach((function(o){i.find((function(t){return t===o}))||(e[o]=t[o])})),JSON.parse(JSON.stringify(e))}},createObjectForSaveOrCopy:function(){var t=["ctx","mouse","elementToChangeCurspor"],e=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),i=Object.assign({},this.$data),o=Object(c["a"])(Object(c["a"])({},i),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:e,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});Object.keys(o).forEach((function(t){"object"!==Object(QD["a"])(o[t])||Array.isArray(o[t])||(o[t]=Object.assign({},o[t]))}));var n=function(e){t.find((function(t){return t===e}))&&delete o[e]};for(var s in o)n(s);return o},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},getTimeCandle:function(t){var e;if(t>this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},formatMeasureToPins:function(t,e){var i=this.$props.layout.t2screen(+t),o=this.$props.layout.$2screen(+e);return{x:i,y:o}},formatXYtoMeasure:function(t,e){var i=this.getTimeCandle(this.$props.layout.screen2t(+t).toFixed(0)),o=this.$props.layout.screen2$(+e);return{x:i,y:o}},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["PriceCallout"]},hover:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},draw:function(t){this.ctx=t,t.beginPath(),this.drawRect(t,this.startPinRect.x,this.startPinRect.y),this.xt&&this.y$&&(this.viewChangeSizeCircle=!1),this.cricleCallout.x&&this.cricleCallout.y&&this.viewCircleCallout&&this.drawCircleCallout1(t,this.cricleCallout.x,this.cricleCallout.y)},drawCircleCallout1:function(t,e,i){var o=this.formatMeasureToPins(e,i).x,n=this.formatMeasureToPins(e,i).y,s=Cmt("trunc",i,this.prec);this.messageText=s,t.font="14px Arial",this.drawCircleCallout(t,o,n)},drawRect:function(t,e,i){var o=this.formatMeasureToPins(e,i).x,n=this.formatMeasureToPins(e,i).y,s=this.bold?this.bold+" ":"",r=this.italic?this.italic+" ":"",a=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=s+r+a,t.fillStyle="red";var c=XSt(this.messageText,this.maxLng),l=c[0]||"";c.forEach((function(t){t.length>l.length&&(l=t)}));var u=+this.fontSizeMessage,d=t.measureText(l).width+2*u,h=9;this.heigth=(u+.3*u)*c.length+.6*u,this.roundRect(t,o,n,d,this.heigth,h,this.isBackground,!1,c)},moveStartPinRect:function(t,e){var i=this.formatXYtoMeasure(t,e).x,o=this.formatXYtoMeasure(t,e).y;this.startPinRect.x=i,this.startPinRect.y=o},moveCirclePinRect:function(t,e){var i=this.formatXYtoMeasure(t,e).x,o=this.formatXYtoMeasure(t,e).y;this.cricleCallout.x=i,this.cricleCallout.y=o},pointInRectangle:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l},vector:function(t,e){return{x:e.x-t.x,y:e.y-t.y}},dot:function(t,e){return t.x*e.x+t.y*e.y},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200),this.timerDebouncer&&clearInterval(this.timerDebouncer)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},debouncer:function(t,e){this.timerDebouncer=setTimeout((function(){e()}),t)},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.cricleCallout.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.cricleCallout.y)+60),t.cricleCallout.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.cricleCallout.x)+40),t.startPinRect.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.startPinRect.y)+60),t.startPinRect.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.startPinRect.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;e&&e.x&&e.y&&Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"PriceNote",nameIconTitle:"new-price-pos",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Text",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorText",nameParam:"textColor",value:this.textColor,color:function(){return i.textColor},fast:!0},{component:"ModifyreDxDporDown",nameParam:"fontSizeMessage",listDrawType:[{name:"10",value:10,onlyText:!0},{name:"12",value:12,onlyText:!0},{name:"14",value:14,onlyText:!0},{name:"18",value:18,onlyText:!0},{name:"24",value:24,onlyText:!0},{name:"32",value:32,onlyText:!0},{name:"40",value:40,onlyText:!0}],value:this.fontSizeMessage,fast:!0},{component:"ToggleButton",nameParam:"italic",value:this.italic,icon:"new-italic"},{component:"ToggleButton",nameParam:"bold",value:this.bold,icon:"new-bold"}]},{index:1,name:"Background",startCheckBox:!0,valueStartCheckBox:this.isBackground,controllerCheckBox:function(t){i.isBackground=t.value},settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]}],typeModal:t}}})},mousemove:function(t){if(this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.changePosition&&this.moveStartPinRect(t.layerX,t.layerY),this.changeCircleCallout){this.moveCirclePinRect(t.layerX,t.layerY);var e=this.C.y>t.layerY?this.A.y>t.layerY?"t":"tmb":"b",i=this.A.x>t.layerX?"l":this.B.x>t.layerX?"lmr":"r";"tmb"===e&&"l"===i?this.pos="left":"t"===e&&"lmr"===i?this.pos="top":"b"===e&&"lmr"===i&&(this.pos="bottom")}},mousedown:function(t){var e=this,i=this.formatXYtoMeasure(t.layerX,t.layerY).x,o=this.formatXYtoMeasure(t.layerX,t.layerY).y;if(this.xt=i,this.y$=o,this.defaultForm){var n=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,s=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;this.hover(t.layerX,t.layerY,n,s)&&(this.messageText=o,this.defaultForm=!1,this.changeCircleCallout=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}else{var r=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,a=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;this.hover(t.layerX,t.layerY,r,a)&&(this.defaultForm=!1,this.changeCircleCallout=!0,this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))}this.pointInRectangle({x:this.formatMeasureToPins(i,o).x,y:this.formatMeasureToPins(i,o).y},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.debouncer(200,(function(){e.changePosition=!0})),this.doubelClick(t),this._$emit("custom-event",{event:"scroll-lock",args:[!0]}))},mouseup:function(t){this.timerDebouncer&&clearInterval(this.timerDebouncer),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]})),this.initClick&&(this.initClick=!1),this.changePosition&&(this.moveStartPinRect(t.layerX,t.layerY),this.changePosition=!1,this.mountedCallout&&(this.mountedCallout=!1),this.saveNewPosition()),this.changeCircleCallout&&(this.moveCirclePinRect(t.layerX,t.layerY),this.saveNewPosition(),this.changeCircleCallout=!1,this.mountedCallout&&(this.changePosition=!0)),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})},drawCircleCallout:function(t,e,i){t.beginPath(),t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.fillStyle="#fff",t.arc(e,i,6,0,2*Math.PI,!0),t.stroke(),t.fill()},roundRect:function(t,e,i,o,n,s,r,a,c){var l=this;if("undefined"===typeof a&&(a=!0),"undefined"===typeof s&&(s=5),"number"===typeof s)s={tl:s,tr:s,br:s,bl:s};else{var u={tl:0,tr:0,br:0,bl:0};for(var d in u)s[d]=s[d]||u[d]}if(this.A={x:e,y:i},this.B={x:e+o,y:i},this.C={x:e+o,y:i+n},this.D={x:e,y:i+n},t.closePath(),t.strokeStyle=!1,t.beginPath(),t.strokeStyle=!1,t.moveTo(e+s.tl,i),"top"===this.pos){if(t.lineTo(e+((o-s.tr)/2-.09*o),i),this.defaultForm)t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var h=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,p=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(h,p)}t.lineTo(e+(o-s.tr)/2+.09*o,i)}if(t.lineTo(e+o-s.tr,i),t.quadraticCurveTo(e+o,i,e+o,i+s.tr),"rigth"===this.pos){if(t.lineTo(e+o,i+(n-s.br)/2-.09*o),this.defaultForm)this.cricleCallout={x:e+(o-s.tr)/2+.09*o,y:i+n-s.br+30},t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var g=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,f=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(g,f)}t.lineTo(e+o,i+(n-s.br)/2+.09*o)}if(t.lineTo(e+o,i+n-s.br),t.quadraticCurveTo(e+o,i+n,e+o-s.br,i+n),"bottom"===this.pos){if(t.lineTo(e+(o-s.tr)/2-.09*o,i+n),this.defaultForm){var m=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,v=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(m,v)}else{var y=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,C=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(y,C)}t.lineTo(e+(o-s.tr)/2+.09*o,i+n)}if(t.lineTo(e+s.bl,i+n),t.quadraticCurveTo(e,i+n,e,i+n-s.bl),t.lineTo(e,i+s.tl),"left"===this.pos){if(t.lineTo(e,i+s.tl+.56*n),this.defaultForm)this.cricleCallout={x:e+(o-s.tr)/2+.09*o,y:i+n-s.br+30},t.lineTo(this.cricleCallout.x,this.cricleCallout.y);else{var b=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).x,S=this.formatMeasureToPins(this.cricleCallout.x,this.cricleCallout.y).y;t.lineTo(b,S)}t.lineTo(e,i+s.tl+.24*n)}if(t.quadraticCurveTo(e,i,e+s.tl,i),t.closePath(),r){var P=+this.fontSizeMessage;t.fillStyle=this.colorLine,t.fill();var T=this.bold?this.bold+" ":"",x=this.italic?this.italic+" ":"",O=this.fontSizeMessage?this.fontSizeMessage+"px Arial":"";t.font=x+T+O,t.fillStyle=this.textColor;var w=i+.1*P;t.fillStyle=this.textColor,c&&c.length>0&&c.forEach((function(i,o){o>0?t.fillText(i,e+ +l.fontSizeMessage,w+P+.3*P):t.fillText(i,e+ +l.fontSizeMessage,w+1.25*P),w=w+P+.3*P}))}this.drawCircleCallout(t,this.cricleCallout.x,this.cricleCallout.y)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{sett:function(){return this.$props.settings}}),data:function(){return{initClick:!0,maxLng:40,viewCircleCallout:!0,fontSizeMessage:14,bold:"",italic:"",cricleCallout:{x:void 0,y:void 0},changePosition:!1,mountedCallout:!0,changeCircleCallout:!0,isBackground:!0,downInChangeSize:!1,viewChangeSizeCircle:!1,defaultForm:!0,colorLine:"rgba(109, 158, 235, 0.36)",textColor:"#fff",messageText:this.$t("txtWord"),radiusCircle:30,pos:"bottom",counterDoubleClick:0,titleBacgroundColor:this.$t("windowColorWord"),titleColorText:this.$t("txtColorWord"),titleModal:this.$t("popUpTxtWord"),ctx:void 0,elementToChangeCurspor:void 0,mouse:{x:void 0,y:void 0},startPinRect:{x:void 0,y:void 0},xt:void 0,y$:void 0}}};function XSt(t,e){return t+="",t.match(new RegExp(".{1,"+e+"}","g"))}var QSt,JSt,KSt,ZSt,tPt,ePt,iPt,oPt,nPt,sPt,rPt,aPt,cPt,lPt,uPt,dPt,hPt=YSt,pPt=Object(C["a"])(hPt,QSt,JSt,!1,null,null,null),gPt=pPt.exports,fPt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-to-orders"},[t.ux.vars.data.length>3?e("div",{staticClass:"cnt-arw"},[e("svgIcon",{staticClass:"down-scroll-news",attrs:{name:"Arrow-expand-right",viewBox:"0 0 24 24"}}),t.ux.vars.data.length>3?e("div",{staticClass:"cnt-arw"},[e("svgIcon",{staticClass:"up-scroll-news",attrs:{name:"Arrow-expand-right",viewBox:"0 0 24 24"}})],1):t._e()],1):t._e(),t._l(t.ux.vars.data,(function(i,o){return e("div",{key:o,ref:"ux1",refInFor:!0},[e("div",{ref:"ux2",refInFor:!0}),e("div",{staticClass:"test-ux"},[e("div",{class:[t.getProfitClass(i),"orderOnChartOnGraph","orderOnChartOnGraph--read","orderOnChartOnGraph--onChart",{"orderOnChartOnGraph-open-position":"Position_Create"===i.reason},{"is-users":t.isUsersOrder}]},[e("div",{staticClass:"orderOnChartOnGraph__close",on:{click:t.close}},[e("svgIcon",{attrs:{name:"circle-close"}})],1),e("div",{staticClass:"orderOnChartOnGraph__back"},[e("svgIcon",{attrs:{name:"EURUSD-flag"}}),e("div",{staticClass:"svgOverflow"})],1),e("div",{staticClass:"orderOnChartOnGraph__body"},[e("div",{staticClass:"orderOnChartOnGraph__top"},[e("div",{staticClass:"orderOnChartOnGraph__top-left"},[e("div",{staticClass:"orderOnChartOnGraph-user-avatar"},[e("div",{staticClass:"left"},[e("Avatar",{attrs:{size:"2.4",src:i.avataruri}})],1),e("div",{staticClass:"right"},[e("div",{staticClass:"user-name",attrs:{title:i.userName}},[t._v(" "+t._s(i.userName)+" ")])])]),e("div",{staticClass:"orderOnChartOnGraph-user-avatar second"},[e("div",{staticClass:"left"},[e("Avatar",{attrs:{size:"2.4",src:"taurus.jpg"}})],1),t._m(0,!0)]),e("div",{staticClass:"orderOnChartOnGraph-orders-type"},[e("Avatar",{attrs:{size:"2.4",src:"british_flag.jpg"}}),e("div",{staticClass:"orderOnChartOnGraph-type"},[t._v(" "+t._s(t.getText(i))+" ")])],1),e("div",{staticClass:"orderOnChartOnGraph-orders-info"},[e("div",{staticClass:"orderOnChartOnGraph__info left",staticStyle:{"margin-right":"8px","max-width":"70px"},attrs:{title:t.getOrderNumber(i)}},[t._v(" "+t._s(t.getOrderNumber(i))+" ")]),e("div",{staticClass:"orderOnChartOnGraph__info orderOnChartOnGraph__info--pair",class:"Sell"===i.orderType?"orderOnChartOnGraph__info--decrease":"orderOnChartOnGraph__info--increase"},[t._v(" "+t._s(i.contractName)+" ")])])]),e("div",{staticClass:"orderOnChartOnGraph__top-right"},[e("Progress",{attrs:{progress:82,size:40}})],1)]),t.showGraph?e("div",{staticClass:"orderOnChartOnGraph__ShowGraph"},[e("div",{staticClass:"header__top"},[e("Avatar",{attrs:{size:"2.4",src:"british_flag.jpg"}}),e("Avatar",{attrs:{size:"2.4",src:i.avataruri}}),e("div",{staticClass:"user-name",attrs:{title:i.userName}},[t._v(" "+t._s(i.userName)+" ")])],1),e("div",{staticClass:"header__bottom"},[e("Progress",{attrs:{progress:62,size:24}}),e("div",{staticClass:"svgOnGraph arrow"},[e("svgIcon",{staticStyle:{left:"-2.2px",top:"2.2px"},attrs:{name:this.isProfit(i)?"Arrow-nano-top":"Arrow-nano-bottom"}})],1),e("div",{staticClass:"line"}),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",{staticClass:"orderOnChartOnGraph__val-mainresult"},[t._v(" $ "+t._s(i.profit)+" ")])]),e("div",{staticClass:"line"}),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",[t._v(" % 0.92 ")])]),e("div",{staticClass:"line"}),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",[t._v(" 450 pip ")])]),e("div",{staticClass:"line"}),t._m(1,!0)],1),e("div",{staticClass:"graph"},[e("div",{staticClass:"svgOnGraph"},[e("svgIcon",{attrs:{name:this.isProfit(i)?"fake-table-profit":"fake-table-nonprofit"}}),t._m(2,!0)],1),e("div",{staticClass:"svgGraphOnGraph"})])]):t._e(),e("div",{staticClass:"orderOnChartOnGraph__content"},[e("div",{staticClass:"orderOnChartOnGraph_types_valumes"},[e("div",{staticClass:"top"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v(" Type and volume ")]),e("div",{staticClass:"orderOnChartOnGraph__info orderOnChartOnGraph__info--pair",class:"Sell"===i.orderType?"orderOnChartOnGraph__info--decrease":"orderOnChartOnGraph__info--increase",staticStyle:{"padding-left":"10px"}},[e("svgIcon",{staticStyle:{left:"-4.2px"},attrs:{name:"Sell"===i.orderType?"Arrow-nano-bottom":"Arrow-nano-top"}}),t._v(" "+t._s("Sell"===i.orderType?"SELL":"BUY")+" ")],1),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--type",class:"Sell"===i.orderType?"orderOnChartOnGraph__info--decrease":"orderOnChartOnGraph__info--increase"},[t._v(" $ "+t._s(t.getValueMoney(i))+" ")])]),t._m(3,!0)]),e("div",{staticClass:"orderOnChartOnGraph_all_info"},[e("div",{staticClass:"orderOnChartOnGraph_all_info-third first-grid"},[e("div",{staticClass:"grid-item open-val big"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Price open")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(i.openPrice)+" ")])]),e("div",{staticClass:"grid-item close-val big"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Price close")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(i.closePrice)+" ")])]),e("div",{staticClass:"grid-item open-time middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Open")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(t.getFormatDate(i.createdDate))+" ")])]),e("div",{staticClass:"grid-item close-time middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Close")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(t.getFormatDate(i.closedDate))+" ")])]),e("div",{staticClass:"grid-item sl small"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("S/L")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(i.stopLoss)+" ")])]),e("div",{staticClass:"grid-item tp small"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("T/P")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v(" "+t._s(i.takeProfit)+" ")])]),t._m(4,!0),t._m(5,!0)]),e("div",{staticClass:"orderOnChartOnGraph_all_info-third with_border"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Result")]),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",{staticClass:"orderOnChartOnGraph__val-mainresult"},[t._v(" $ "+t._s(i.profit)+" ")])]),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",[t._v(" % 0.92 ")])]),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result",class:i.profit<0?"orderOnChartOnGraph__val--decrease":"orderOnChartOnGraph__val--increase"},[e("span",[t._v(" 450 pip ")])]),t._m(6,!0)]),t._m(7,!0)])]),e("div",{staticClass:"orderOnChartOnGraph__bottom",staticStyle:{cursor:"pointer"},on:{click:t.changeShow}},[e("svgIcon",{attrs:{name:t.showGraph?"negative-order-color-picker":"order-color-picker"}}),t.showGraph?t._e():e("div",{staticClass:"orderOnChartOnGraph__bottom-txt"},[t._v(" Show the trading chart ")]),t.showGraph?e("div",{staticClass:"orderOnChartOnGraph__bottom-txt"},[t._v(" Hide the trading chart ")]):t._e()],1)])])])])}))],2)},mPt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"right"},[e("div",{staticClass:"user-number",attrs:{title:"№ 4875 5478 6543"}},[t._v(" № 4875 5478 6543 ")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result orderOnChartOnGraph__val--decrease"},[e("span",[t._v(" DD-0,7% ")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"data"},[e("div",{staticClass:"value"},[t._v("$ 1457 687")]),e("div",{staticClass:"percent"},[t._v("% 43")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"bottom"},[e("div",{staticClass:"txt"},[t._v(" Leverage: "),e("p",[t._v("1:2")])]),e("div",{staticClass:"txt"},[t._v(" Percentage of funds: "),e("p",[t._v("0,3%")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"grid-item from-border middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("leverage:")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("1:2")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"grid-item from-border middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v(" Percentage of funds: ")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("0,3%")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--result orderOnChartOnGraph__val--decrease"},[e("span",[t._v(" DD-0,7% ")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"orderOnChartOnGraph_all_info-third second-grid"},[e("div",{staticClass:"grid-item middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v(" Average pp per trade: ")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("420 pip")])]),e("div",{staticClass:"grid-item middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v(" Successful trades: ")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("3%")])]),e("div",{staticClass:"grid-item middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v(" Portfolio rating: ")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("78")])]),e("div",{staticClass:"grid-item middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Max DD:")]),e("div",{staticClass:"orderOnChartOnGraph__val orderOnChartOnGraph__val--decrease"},[t._v(" -2.8% ")])]),e("div",{staticClass:"grid-item middle"},[e("div",{staticClass:"orderOnChartOnGraph__title"},[t._v("Sharpe ratio:")]),e("div",{staticClass:"orderOnChartOnGraph__val"},[t._v("3%")])])])}],vPt={name:"ModalsForOrdersFromBottom",mixins:[jmt["a"]],components:{Avatar:E,Progress:Kz},mounted:function(){var t=this;Jpt.$on("close-ux-modal",(function(){return t.close()}))},destroyed:function(){var t=this;Jpt.$off("close-ux-modal",(function(){return t.close()}))},props:{isUsersOrder:{default:!1}},methods:{changeShow:function(){this.showGraph=!this.showGraph},getValueMoney:function(t){if(t.volume>=1e3){var e=t.volume.toString().split("").reverse().join(""),i=[];if(e.length>3)for(var o=0;o0:"Sell"!==t.orderType},getOrderNumber:function(t){return"№ ".concat(t.externalId)},getText:function(t){return t.reason?"Position_Create"===t.reason?"Order open":"Closed"===t.status?"Order close":"Position_Modify"===t.reason?"Order change":void 0:t.closeDate?"Order open":"Order close"},getProfitClass:function(t){return t.closedDate?t.profit>0?"orderOnChartOnGraph--profit":"orderOnChartOnGraph--nonprofit":"Sell"===t.orderType?"orderOnChartOnGraph--nonprofit":"orderOnChartOnGraph--profit"},getIconName:function(t){return"Sell"===t.orderType?"Arrow-micro-bottom":"Arrow-micro-top"},close:function(){this._$emit("custom-event",{event:"close-interface",args:[this.$props.ux.uuid]})},getFormatDate:function(t){var e=new Date(t),i=e.getFullYear(),o=e.getMonth(),n=e.getDate(),s=e.getHours(),r=e.getMinutes(),a=e.getSeconds(),c="".concat(n<10?"0"+n:n,".").concat(o<10?"0"+o:o,".").concat(i," ").concat(s<10?"0"+s:s,":").concat(r<10?"0"+r:r,":").concat(a<10?"0"+a:a);return c}},computed:{getProfit:function(){return this.profit},getClosedOrder:function(){return this.closedOrder}},watch:{clickOut:function(t){t&&this.close()}},data:function(){return{showGraph:!1}}},yPt=vPt,CPt=(i("596b"),Object(C["a"])(yPt,fPt,mPt,!1,null,null,null)),bPt=CPt.exports,SPt={name:"bottomImages",mixins:[Opt["Overlay"]],watch:{getStatusOpenPositions:function(t){this._$emit("custom-event",{event:"change-settings",args:[!0]})},getStatusOpenOtherPositions:function(t){this._$emit("custom-event",{event:"change-settings",args:[!0]})}},mounted:function(){var t=this;this.symbol=this.$props.settings.symbol,this.timeFrame=this.$props.settings.timeFrame,Jpt.$on("hideAvatar",(function(e){t.toggleHideAvatar=e})),this.controlSubribeWS()},methods:{controlSubribeWS:function(t){t?this.$socketStream.$off("apiWS3",this.setMessageHandler):this.$socketStream.$on("apiWS3",this.setMessageHandler)},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},HistoryOrders:function(t){this.openOrders=[],this.openOrdersToImage=[],this.orders=[],this.openMyOrders=[],this.closedOrders=[],this.agrigateOrders(t)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},agrigateOrders:function(t){var e=this,i=t.tradingOrders,o=t.closedOrders;i.forEach((function(t){var i=e.openOrders.find((function(e){return e[4].id===t.id})),o=e.openOrdersToImage.find((function(e){return e.id===t.id}));if(!i&&t.instrumentName===e.symbol){var n=[];n[0]=$pt(t.createdDate,e.timeFrame||60).getTimeWithoutUTC(),n[1]=t.orderType,n[2]=t.openPrice,n[3]="",n[4]=t,n[5]=t.userAvatar,e.openOrders.push(n),e.orders.find((function(t){return n[4].id===t.id}))||e.orders.push(n[4]),n[4].accountId!==e.getDefaultAccount.id||e.openMyOrders.find((function(t){return n[4].id===t[4].id}))||e.openMyOrders.push(n)}o||e.openOrdersToImage.push(t)})),o.forEach((function(t){var i=e.closedOrders.find((function(e){return e[4].id===t.id}));if(!i&&t.instrumentName===e.symbol){var o=[];o[0]=$pt(t.closedDate,e.timeFrame||60).getTimeWithoutUTC(),o[1]=t.orderType,o[2]=t.closePrice,o[3]="",o[4]=t,o[5]=t.userAvatar,e.closedOrders.push(o)}})),this.arrFormatedOpenOrders=this.getFormatedOpenOrdersToBottomImages(this.openOrdersToImage);var n=this.openOrders.filter((function(t){return t[4].instrumentName===e.symbol&&t[4].accountId!==e.getDefaultAccount.id})),s=this.openMyOrders.filter((function(t){return t[4].instrumentName===e.symbol}));this.openMyOrders=s,this.openOrders=n},getFormatedOpenOrdersToBottomImages:function(t){var e=this,i=t.reduce((function(t,i){return i.closedDate||e.getContracts.find((function(t){return t.name===i.contractName})).instrumentName===e.symbol&&t.push(i),t}),[]),o=i.reduce((function(t,o){var n={timeFrameCandle:$pt(new Date(o.createdDate),e.timeFrame||60).getTimeWithoutUTC(),orders:[]};return i.forEach((function(t){var i=$pt(new Date(t.createdDate),e.timeFrame||60).getTimeWithoutUTC();i===n.timeFrameCandle&&n.orders.push(t)})),t.find((function(t){return t.timeFrameCandle===n.timeFrameCandle}))||t.push(n),t}),[]);return o},d_c:function(t,e,i,o,n){t.lineWidth=3,t.beginPath(),t.save(),t.fillStyle="#dfdfdf",t.fillStyle="Sell"===e?"#e54150":"#23a776",t.strokeStyle="Sell"===e?"#e54150":"#23a776",t.arc(i,o,10,0,2*Math.PI,!0),t.stroke(),t.clip(),t.fill(),t.drawImage(n,i-16,o-16,32,32),t.restore()},draw:function(t){this.getToken},changeRange:function(t){var e=this;if(this.arrFormatedOpenOrders){var i=this.arrFormatedOpenOrders;if(Array.isArray(i)&&t&&i.length){var o=this.$props.layout,n=new Image;n.src=Agt.a,i.forEach((function(i){var s=o.t2screen(i.timeFrameCandle),r=o.$2screen(o.$_lo)-18,a=new Image;if(a.src="User-profile.png"!==i.orders[i.orders.length-1].userAvatar&&i.orders[i.orders.length-1].userAvatar?i.orders[i.orders.length-1].userAvatar:Agt.a,t.beginPath(),e.toggleHideAvatar)e.circleWithOutAvatar(t,1,s,r),e.getDefaultAccount.id!==i.orders[i.orders.length-1].accountId?e.circleWithOutAvatar(t,1,s,r):e.circleWithOutAvatar(t,1,s,r-25);else{if(e.getDefaultAccount&&i.orders[i.orders.length-1]&&e.getDefaultAccount.id!==i.orders[i.orders.length-1].accountId&&e.getStatusOpenOtherPositions&&e.getSettingsParamsLeftBar&&e.getSettingsParamsLeftBar.showAvatarsProviders&&e.getSettingsParamsLeftBar.showProviders){var c=i.orders.find((function(t){return t.accountId===e.getDefaultAccount.id})),l=i.orders[i.orders.length-1],u=c&&("User-profile.png"!==c.userAvatar&&c.userAvatar?a:n),d="User-profile.png"!==l.userAvatar&&l.userAvatar?a:n,h=u||d;e.d_c(t,1,s,r-25,h)}e.getDefaultAccount&&i.orders[i.orders.length-1]&&e.getDefaultAccount.id===i.orders[i.orders.length-1].accountId&&e.getStatusOpenPositions&&e.getSettingsParamsLeftBar&&e.getSettingsParamsLeftBar.myAvatar&&e.getSettingsParamsLeftBar.showMyActions&&e.d_c(t,1,s,r-25,"User-profile.png"!==i.orders[i.orders.length-1].userAvatar&&i.orders[i.orders.length-1].userAvatar?a:n)}t.closePath()}))}}},circleWithOutAvatar:function(t,e,i,o){t.lineWidth=3,t.beginPath(),t.save(),t.fillStyle="#dfdfdf",t.fillStyle=0===e?"#23a776":"#e54150",t.strokeStyle=0===e?"#23a776":"#e54150",t.arc(i,o,16,0,2*Math.PI,!0),t.stroke(),t.clip(),t.fill(),t.restore()},mouseup:function(t){if("asdf"===t){var e,i=this.$props.layout;e=JSON.parse(localStorage.getItem("openOrders")),Array.isArray(e)&&e.forEach((function(t){i.t2screen(t.timeFrameCandle),i.$2screen(i.$_lo);Jpt.$emit("stopQuotes",!1)}))}},mousedown:function(t){var e=this;if("asdf"===t){var i=this.$props.layout,o=this.arrFormatedOpenOrders;Array.isArray(o)&&o.forEach((function(o){var n,s=i.t2screen(o.timeFrameCandle),r=i.$2screen(i.$_lo)-18;o.orders[o.orders.length-1].closedDate?(i.t2screen(new Date(i.$2screen(o.orders[o.orders.length-1].closedDate)+16).getTimeWithoutUTC()),n=o.orders[o.orders.length-1].closePrice):(i.t2screen(new Date(o.orders[o.orders.length-1].openDate).getTimeWithoutUTC()),n=o.orders[o.orders.length-1].openPrice),e.mouseClickEvent(s,r-22,t.layerX,t.layerY)&&(e.ct.beginPath(),e.ct.moveTo(s,r-19),e.ct.strokeStyle=0===o[1]?"#23a776":"#e54150",e.ct.lineTo(s,n+6),e.ct.stroke(),Jpt.$emit("openInChartUxModal",!0),Jpt.$emit("stopQuotes",!0),Jpt.$emit("close-ux-modal"),e.$emit("new-interface",{target:"grid",component:bPt,pin:[e.layout.screen2t(s),o.orders[o.orders.length-1].closePrice],win_styling:!1,win_header:!1,vars:{data:o.orders,p_text:"Interface",button_textF:"OKAY",color:"white"}}))}))}},mouseClickEvent:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*16},use_for:function(){return["bottomImages"]}},computed:Object(c["a"])(Object(c["a"])({sett:function(){return this.$props.settings}},Object(p["c"])({getProfileAccount:"subscribeOrders/getProfileAccount",getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getToken:"auth/getToken",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart"})),{},{getStatusOpenPositions:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"openPositions"===t.name}));return!t||t.isActive}},getStatusOpenOtherPositions:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"openOtherPositions"===t.name}));return!t||t.isActive}}}),destroyed:function(){var t=this;Jpt.$off("hideAvatar",(function(e){t.toggleHideAvatar=e})),this.controlSubribeWS(!0)},data:function(){return{arrFormatedOpenOrders:[],openOrders:[],currentAccountY:0,openOrdersToImage:[],otherAccountY:0,toggleHideAvatar:!1,mouse:{x:void 0,y:void 0},highlighted:null,selected:null,intr:null,ct:null,arr:[]}}},PPt=SPt,TPt=Object(C["a"])(PPt,KSt,ZSt,!1,null,null,null),xPt=TPt.exports,OPt=function(){var t=this,e=t._self._c;return e("div",[t.modalNews&&!t.disabledNews?e("ModalListNews",{attrs:{settings:t.modalNews},on:{close:t.closeModalListNews}}):t._e(),t.allStreams&&t.allStreams.length&&!t.disabledStreams?e("div",t._l(t.allStreams,(function(i){return e("div",{key:"stream_".concat(i.id),style:{color:"#3C73F1",position:"absolute",bottom:"32px",left:i.x+"px",cursor:"pointer",border:"1.5px solid #3C73F1",borderRadius:"100%"},on:{click:function(e){return t.openModalStreams(i)}}},[t.idOpenStream===i.id?e("ModalStreams",{attrs:{streams:t.modalStreamsList},on:{close:t.closeModalStreams}}):t._e(),i?e("Avatar",{attrs:{size:"2.4",src:i.avatar}}):t._e()],1)})),0):t._e()],1)},wPt=[],_Pt=function(){var t=this,e=t._self._c;return e("DxDraggable",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],style:{zIndex:1001},on:{dragStart:t.dragStart,dragEnd:function(e){return t.dragEnd()}}},[e("div",{staticClass:"modal-list-news",style:{bottom:"30px"}},[e("div",{staticClass:"modal-list-news__info",class:t.getActiveTheme},[e("div",[t._v(t._s(t.getTime(t.streams[0].startDateTime)))])]),e("div",{staticClass:"modal-list-news__list"},t._l(t.streams,(function(i){return e("div",{staticClass:"modal-list-news__item",class:t.getActiveTheme},[i?e("Avatar",{style:{marginRight:"8px"},attrs:{size:"2.4",src:i.avatar}}):t._e(),e("div",{staticClass:"modal-list-news__container",class:t.getActiveTheme},[e("div",{staticClass:"modal-list-news__title",class:t.getActiveTheme},[t._v(t._s(i.name))]),e("div",{staticClass:"modal-list-news__description",class:t.getActiveTheme},[t._v(t._s(i.description))])]),e("Button",{style:{marginRight:"8px"},attrs:{icon:"Add"}}),e("Button",{attrs:{icon:"Bell"}})],1)})),0)])])},APt=[],DPt={name:"ModalListNews",mixins:[],components:{DxDraggable:Se.a,Button:zt,Avatar:E},props:["streams"],mounted:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},destroyed:function(){},methods:{dragStart:function(){this.noClose=!0},dragEnd:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},close:function(){this.noClose||this.$emit("close",null)},numberToTime:function(t){var e="".concat(t);return 1===e.length?"0".concat(e):e}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getTime:function(){return function(t){t=new Date(t);var e=t.getHours(),i=t.getMinutes(),o=e>9?"".concat(e):"0".concat(e),n=i>9?"".concat(i):"0".concat(i),s=t.toLocaleDateString();return"".concat(s," ").concat(o,":").concat(n)}}}),watch:{},data:function(){return{noClose:!0}}},kPt=DPt,IPt=(i("d5f3"),Object(C["a"])(kPt,_Pt,APt,!1,null,"1aef6746",null)),BPt=IPt.exports,MPt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"cnt-news-drag",style:Object(c["a"])({position:"absolute"},t.getPosition)},[e("DxDraggable",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.clickOutside,expression:"clickOutside"}],style:{zIndex:1},on:{dragStart:t.dragStart,dragEnd:t.dragEnd}},[e("div",{staticClass:"modal-list-news"},[e("div",{staticClass:"modal-list-news__info",class:t.getActiveTheme},[e("div",[t._v(t._s("".concat(t.getTimeGroupNews," - ").concat(t.settings.news.length," events")))]),t.settings.withButtonClose?e("div",{style:{marginLeft:"8px",height:"12px",marginBottom:"-1px",cursor:"pointer"},on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",size:12}})],1):t._e()]),e("div",{staticClass:"modal-list-news__list"},t._l(t.settings.news,(function(i){return e("div",{staticClass:"modal-list-news__item",class:t.getActiveTheme},[e("div",{staticClass:"modal-list-news__importance",style:{background:t.getColors[i.importance]}}),e("div",{staticClass:"modal-list-news__container",class:t.getActiveTheme},[e("div",{staticClass:"modal-list-news__title",class:t.getActiveTheme},[t._v(t._s(i.eventName))]),e("div",{staticClass:"modal-list-news__description",class:t.getActiveTheme},[t._v(t._s("".concat(t.numberToTime(new Date(i.releaseDate).getHours()),":").concat(t.numberToTime(new Date(i.releaseDate).getMinutes())," Actual: ").concat(i.actualValue,", Previos: ").concat(i.previousValue," Impact: ").concat(i.impactValue)))])])])})),0)])])],1)},$Pt=[],LPt={name:"ModalListNews",mixins:[],components:{DxDraggable:Se.a},props:["settings"],mounted:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},destroyed:function(){},methods:{dragStart:function(){this.noClose=!0},dragEnd:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},clickOutside:function(){this.settings.withButtonClose||this.close()},close:function(){this.noClose||this.$emit("close")},numberToTime:function(t){var e="".concat(t);return 1===e.length?"0".concat(e):e}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPosition:function(){var t=this.settings.onlyTop?64:72*this.settings.news.length;return{top:"".concat(this.settings.top-t,"px"),left:"".concat(this.settings.left,"px"),zIndex:10}},getTimeGroupNews:function(){var t=this.numberToTime(new Date(this.settings.news[0].aggregateStrTime).getHours()),e=this.numberToTime(new Date(this.settings.news[0].aggregateStrTime).getMinutes());return"".concat(new Date(this.settings.news[0].aggregateStrTime).toLocaleDateString()," ").concat(t,":").concat(e)},getColors:function(){return"dark"===this.getActiveTheme?{high:"#FF4444",medium:"#FFF280",low:"#8FA8C1"}:{high:"#E91212",medium:"#FFE600",low:"#B2B2B2"}}}),watch:{},data:function(){return{noClose:!0}}},FPt=LPt,jPt=(i("22b1"),Object(C["a"])(FPt,MPt,$Pt,!1,null,null,null)),RPt=jPt.exports,WPt={components:{ModalListNews:RPt,ModalStreams:BPt,Avatar:E},name:"News",mixins:[Opt["Overlay"]],watch:{},mounted:function(){this.symbol=this.$props.settings.symbol,this.timeFrame=this.$props.settings.timeFrame,Jpt.$on("changeShowingNews",this.changeShowingNews),Jpt.$on("changeDisabledNews",this.changeDisabledNews);var t=JSON.parse(localStorage.getItem("isShowNews"));this.showHistory=t;var e=JSON.parse(localStorage.getItem("isDisabledNews"));this.disabledNews=e,this.getNews(),this.getStreamEvents("ByContract"),this.getStreamHistory()},methods:{getStreamHistory:function(){},getStreamsInfo:function(){var t=localStorage.getItem("streamsInfo");if(t){var e=JSON.parse(t);this.disabledStreams=e.disabledStreams,this.disabledHistoryStreams=e.disabledHistoryStreams}},closeModalStreams:function(){this.idOpenStream=null,this.modalStreamsList=null},openModalStreams:function(t){this.idOpenStream=t.id,this.modalStreamsList=[t]},getUserAvatar:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.abrupt("return",e.$http.get("".concat(e.apiUri,"User/SimpleInfo?userId=").concat(t),"",{headers:{"Content-Type":"application/json"}}).then(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.data.avatarURL;case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 1:case"end":return i.stop()}}),i)})))()},getStreamEvents:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function t(){var i;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i={date:(new Date).toISOString(),searchType:"ByContract",Symbol:e.symbol},t.next=3,e.$http.post("".concat(e.getApiStream,"Stream/sourceinfo"),JSON.stringify(i),{headers:{"Content-Type":"application/json"}}).then(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(i){var o,n;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:o=i.data,n=o.map((function(t){return t.listInstruments=t.tag?t.tag.split("#"):[],t})),e.getDetailInfoByStreams(n);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 3:case"end":return t.stop()}}),t)})))()},getDetailInfoByStreams:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=t.map((function(t){return t.streamId})),i.next=3,e.$http.post("".concat(e.getApiStream,"Stream/detailinfo"),JSON.stringify(o),{headers:{"Content-Type":"application/json"}}).then(function(){var i=Object(a["a"])(Object(r["a"])().mark((function i(o){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.forEach(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e){return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e["logoUrl"]=o.data.find((function(t){return t.streamId===e.streamId})).logoUrl,e["status"]=o.data.find((function(t){return t.streamId===e.streamId})).status;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e.allStreams=t;case 2:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}());case 3:return i.next=5,e.getAvatars(e.allStreams);case 5:e.allStreams=i.sent;case 6:case"end":return i.stop()}}),i)})))()},getAvatars:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:o=[],n=0;case 2:if(!(ni[e.importance]?t:e.importance,t}),"low")},draw:function(t){this.ctx=t,this.allStreamsCreate(),this.drawNews(t),this.getStreamsInfo()},allStreamsCreate:function(){var t=this;this.allStreams.length>0&&(this.allStreams=this.allStreams.map((function(e){return e.x=t.getOffsetX(e.startDateTime),e})))},drawNews:function(t){var e=this;if(!this.disabledNews&&this.aggregateNews){var i=(new Date).getTime(),o=function(){var o=e.$props.layout.t2screen(+n),s=e.$props.layout.$2screen(e.$props.layout.$_lo)-20,r=e.$props.sub.find((function(t){return t[0]===+e.$props.layout.screen2t(o).toFixed(0)})),a=e.getColors[e.getTheMostNews(e.aggregateNews[n])];(e.showHistory||!e.showHistory&&i<+n)&&(e.drawAllNews(t,o,s,a,e.aggregateNews[n],n,i),e.listOldnewsPositions.push(e.drawOldNews(t,r,a)))};for(var n in this.aggregateNews)o()}},findForKeyInObject:function(t,e){var i;for(var o in t)if(e(o)){i=o;break}return i},mousedown:function(t){var e=this;if(this.aggregateNews){var i=this.$props.layout.$2screen(this.$props.layout.$_lo)-20,o=this.findForKeyInObject(this.aggregateNews,(function(o){return e.onCircle(e.$props.layout.t2screen(+o),i,t.layerX,t.layerY,12)}));this.findForKeyInObject(this.aggregateNews,(function(i){var o=e.$props.sub.find((function(t){return t[0]===+e.$props.layout.screen2t(e.$props.layout.t2screen(+i)).toFixed(0)}));if(o){var n=e.$props.layout.$2screen(o[2])-5;return e.onCircle(e.$props.layout.t2screen(+i),n,t.layerX,t.layerY,12)}}));if(o){var n=o<(new Date).getTime();n&&this.showHistory&&this.openModalListNews(this.aggregateNews[o],t),n||this.disabledNews||this.openModalListNews(this.aggregateNews[o],t)}}},closeModalListNews:function(){this.modalNews=null},openModalListNews:function(t,e,i){var o=i||e.layerX,n=this.ctx.canvas.offsetWidth-o,s=n>340?o:o-340;this.modalNews={paramName:"ModalListNews",top:this.ctx.canvas.offsetHeight-64,left:s,news:JSON.parse(JSON.stringify(t))}},onCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))1&&this.drawCircleWithLabel(t,u,d,o,"".concat(n.length),5,"fill",7);var h=(s-r)/6e4,p=(s-r)/1e3;if(p<=1&&p>=0){this.drawTimer(t,e,i+l,o,p.toFixed());var g=this.listException.find((function(t){return t===s}));g||(this.modalNews||(this.modalNews={paramName:"ModalListNews",top:84,onlyTop:!0,left:e-340,news:JSON.parse(JSON.stringify(n)),withButtonClose:!0}),setTimeout((function(){return a.modalNews=null}),5e4),this.listException.push(s))}else h<=60&&h>0&&this.drawTimer(t,e,i+l,o,h.toFixed())},drawBoxTimer:function(t,e,i,o,n,s){return t.beginPath(),t.moveTo(e,i),t.lineTo(e,i+n),t.lineTo(e+s,i+n),t.lineTo(e+s,i),t.closePath(),t.arc(e,i,20,0,2*Math.PI),t.fillStyle=o,t.fill(),{bottomY:i+n}},drawTimer:function(t,e,i,o,n){t.font="14px Arial";var s=15,r=70+s/2;this.drawCountTimer(t,e,r,n,o),this.drawDashLineToUp(t,e,i-20,60+s+24,o),this.drawCircle(t,e,r,s,"stroke",o)},drawCountTimer:function(t,e,i,o,n){0!==o?(t.beginPath(),t.fillStyle=n,t.fillText("".concat(o),e-t.measureText("".concat(o)).width/2,i+5)):this.drawWarningCountTime(t,e,i,this.countSec)},drawWarningCountTime:function(t,e,i,o){o<=0||(t.beginPath(),t.fillStyle="white",t.fillText("".concat(o),e-t.measureText("".concat(o)).width/2,i+5))},drawDashLineToUp:function(t,e,i,o,n){t.beginPath(),t.lineWidth=.5,t.moveTo(e,i-5),t.lineTo(e,o-5),t.strokeStyle=n,t.stroke(),t.beginPath(),t.moveTo(e,0),t.lineTo(e,o-40),t.stroke(),t.lineWidth=1},drawCircleWithLabel:function(t,e,i,o,n,s,r,a){var c=a||.55*s;t.font="".concat(c,"px Arial");var l=Array.isArray(n)?[e-t.measureText(n[0]).width/2,e-t.measureText(n[1]).width/2]:e-t.measureText(n).width/2;this.drawCircle(t,e,i,s,r,o),this.drawLabelForCircle(t,l,i,"stroke"===r?o:"white",n,c)},drawCircle:function(t,e,i,o,n,s){return t.beginPath(),t["".concat(n,"Style")]=s,t.strokeStyle=s,t.arc(e,i,o,0,2*Math.PI),t[n](),{x:e,y:i,r:o}},drawLabelForCircle:function(t,e,i,o,n,s){if(Array.isArray(n))return t.beginPath(),t.fillStyle=o,t.fillText(n[0],e[0],i-3+.22*s),t.font="6px Arial",void t.fillText(n[1],e[1],i-3+.42*s+7);t.beginPath(),t.fillStyle=o,t.fillText(n,e,i+.42*s)},getFerstNews:function(t){var e=t.sort((function(t,e){return t.importance5&&this.getUser&&this.getDefaultAccount&&(this.saveNewPosition(this.pins.init.x,this.pins.init.y),this.initRect=!1),this.A={x:this.layout.t2screen(c),y:this.layout.$2screen(l),circle:new HPt(e,6,{x:this.layout.t2screen(c),y:this.layout.$2screen(l)},"#fff","#2e66e0")},this.B={x:this.layout.t2screen(c)+n,y:this.layout.$2screen(l),circle:new HPt(e,6,{x:this.layout.t2screen(c)+n,y:this.layout.$2screen(l)},"#fff","#2e66e0")},this.C={x:this.layout.t2screen(c)+n,y:this.layout.$2screen(l)+s,circle:new HPt(e,6,{x:this.layout.t2screen(c)+n,y:this.layout.$2screen(l)+s},"#fff","#2e66e0")},this.D={x:this.layout.t2screen(c),y:this.layout.$2screen(l)+s,circle:new HPt(e,6,{x:this.layout.t2screen(c),y:this.layout.$2screen(l)+s},"#fff","#2e66e0")},this.pins.tpBnLtRt={x:this.layout.t2screen(c)+n/2,y:this.layout.$2screen(l)},this.pins.rtBnTpBt={x:this.layout.t2screen(c)+n,y:this.layout.$2screen(l)+s/2},this.pins.btBnLtRt={x:this.layout.t2screen(c)+n/2,y:this.layout.$2screen(l)+s},this.pins.ltBnTpBt={x:this.layout.t2screen(c),y:this.layout.$2screen(l)+s/2},e.closePath(),i&&(e.strokeStyle=i,e.stroleWidth=o,e.stroke()),e.fillStyle=r,e.fill(),this.pins.tpBnLtRt.circle=new HPt(e,6,{x:this.pins.tpBnLtRt.x,y:this.pins.tpBnLtRt.y},"#fff","#2e66e0"),this.pins.rtBnTpBt.circle=new HPt(e,6,{x:this.pins.rtBnTpBt.x,y:this.pins.rtBnTpBt.y},"#fff","#2e66e0"),this.pins.btBnLtRt.circle=new HPt(e,6,{x:this.pins.btBnLtRt.x,y:this.pins.btBnLtRt.y},"#fff","#2e66e0"),this.pins.ltBnTpBt.circle=new HPt(e,6,{x:this.pins.ltBnTpBt.x,y:this.pins.ltBnTpBt.y},"#fff","#2e66e0"),this.pointInRectangle({x:this.layout.t2screen(t.x),y:this.layout.$2screen(t.y)},{A:this.A,B:this.B,C:this.C,D:this.D})&&(this.pins.tpBnLtRt.circle.draw(),this.pins.rtBnTpBt.circle.draw(),this.pins.btBnLtRt.circle.draw(),this.pins.ltBnTpBt.circle.draw(),this.A.circle.draw(),this.B.circle.draw(),this.C.circle.draw(),this.D.circle.draw())}},{key:"pointInRectangle",value:function(t,e){var i=this.vector(e.A,e.B),o=this.vector(e.A,t),n=this.vector(e.B,e.C),s=this.vector(e.B,t),r=this.dot(i,o),a=this.dot(i,i),c=this.dot(n,s),l=this.dot(n,n);return 0<=r&&r<=a&&0<=c&&c<=l}},{key:"vector",value:function(t,e){return{x:e.x-t.x,y:e.y-t.y}}},{key:"dot",value:function(t,e){return t.x*e.x+t.y*e.y}},{key:"changeSize",value:function(t,e,i){return this.oldInit=this.pins.init,"left"===i?(this.width=this.layout.t2screen(this.pins.init.x)-this.layout.t2screen(t)+this.width,this.pins.init.x=t,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"right"===i?(this.width=this.layout.t2screen(t)-this.pins.rtBnTpBt.x+this.width,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"top"===i?(this.height=this.layout.$2screen(this.pins.init.y)-this.layout.$2screen(e)+this.height,this.pins.init.y=e,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"bot"===i?(this.height=this.layout.$2screen(e)-this.pins.btBnLtRt.y+this.height,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"topLeft"===i?(this.width=this.layout.t2screen(this.pins.init.x)-this.layout.t2screen(t)+this.width,this.pins.init.x=t,this.height=this.layout.$2screen(this.pins.init.y)-this.layout.$2screen(e)+this.height,this.pins.init.y=e,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"topRight"===i?(this.width=this.layout.t2screen(t)-this.pins.rtBnTpBt.x+this.width,this.height=this.layout.$2screen(this.pins.init.y)-this.layout.$2screen(e)+this.height,this.pins.init.y=e,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"botRight"===i?(this.width=this.layout.t2screen(t)-this.pins.rtBnTpBt.x+this.width,this.height=this.layout.$2screen(e)-this.pins.btBnLtRt.y+this.height,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):"botLeft"===i?(this.height=this.layout.$2screen(e)-this.pins.btBnLtRt.y+this.height,this.width=this.layout.t2screen(this.pins.init.x)-this.layout.t2screen(t)+this.width,this.pins.init.x=t,void this.saveNewPosition(this.pins.init.x,this.pins.init.y)):void("move"===i&&(this.pins.init={x:t,y:e},this.saveNewPosition(this.pins.init.x,this.pins.init.y)))}},{key:"saveNewPosition",value:function(){this.getToken}},{key:"setPinMouseDonw",value:function(t,e,i,o){this.idOv=o;var n=this.layout.t2screen(t),s=this.layout.$2screen(e);if(i&&n&&s)return"botRight";if(n&&s){if(this.pins.tpBnLtRt.circle.mouseDown(n,s))return"top";if(this.pins.ltBnTpBt.circle.mouseDown(n,s))return"left";if(this.pins.rtBnTpBt.circle.mouseDown(n,s))return"right";if(this.pins.btBnLtRt.circle.mouseDown(n,s))return"bot";if(this.A.circle.mouseDown(n,s))return"topLeft";if(this.B.circle.mouseDown(n,s))return"topRight";if(this.C.circle.mouseDown(n,s))return"botRight";if(this.D.circle.mouseDown(n,s))return"botLeft";if(this.pointInRectangle({x:n,y:s},{A:this.A,B:this.B,C:this.C,D:this.D})){var r=JSON.parse(localStorage.getItem("dragOverlay")).arr;return r.length&&r.find((function(t){return t===o}))||(r.push(o),localStorage.setItem("dragOverlay",JSON.stringify({arr:r})),!(r.findIndex((function(t){return t===o}))>0))?"move":"dontMove"}return!1}return this.mouseDown=!1,!1}},{key:"changeBackground",value:function(t,e){this.background=t,this.idOv=e,this.saveNewPosition(this.pins.init.x,this.pins.init.y,{background:t})}},{key:"changeBorderColor",value:function(t,e){this.borderColor=t,this.idOv=e,this.saveNewPosition(this.pins.init.x,this.pins.init.y,{borderColor:t})}}]),t}(),HPt=function(){function t(e,i,o,n,s){Object(Qh["a"])(this,t),this.ctx=e,this.size=i,this.pin=o,this.background=n,this.borderColor=s}return Object(Jh["a"])(t,[{key:"draw",value:function(){var t=this.ctx,e=this.size,i=this.borderColor,o=this.background,n=this.pin;t.beginPath(),t.arc(n.x,n.y,e,0,2*Math.PI,!0),i&&(t.stroleWidth=3,t.strokeStyle=i,t.stroke()),t.fillStyle=o,t.fill()}},{key:"mouseDown",value:function(t,e,i){if((t-this.pin.x)*(t-this.pin.x)+(e-this.pin.y)*(e-this.pin.y)<2*Math.PI*(this.size+3))return i&&i(),(t-this.pin.x)*(t-this.pin.x)+(e-this.pin.y)*(e-this.pin.y)<2*Math.PI*(this.size+3)}}]),t}(),GPt={name:"Square",mixins:[tgt["a"]],watch:{colorLine:function(t){t&&this.square.changeBackground(t,this.$props.id)},borderColor:function(t){t&&this.square.changeBorderColor(t,this.$props.id)}},destroyed:function(){var t=this;Jpt.$off("setSettings",(function(e){return t.setSettings(e)}))},mounted:function(){var t=this;Jpt.$on("setSettings",(function(e){return t.setSettings(e)})),this.symbol=this.$props.settings.symbol;var e=this.$props.settings.data;e&&Object.keys(e).forEach((function(i){t[i]=e[i]})),this.timeFrame=this.$props.settings.timeFrame,this.arrCnd=this.$props.settings.candles,this.idCurrentOverlay=this.$props.settings.idOvrl,e&&e.id&&(this.idCurrentOverlay=e.id)},methods:{meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["Square"]},setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&t.settings.forEach((function(t){e[t[0]]=t[1]}))},cntX:function(t){return this.$props.layout.screen2t(t)},cntY:function(t){return this.$props.layout.screen2$(t)},openModal:function(){Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:event.y-32,left:event.x,paramName:"ModalSettingsInstruments",emit:this.$emit,openModal:this.openModal,settings:{id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:this.$t("rectangleWord"),nameIconTitle:"new-instrument-square",mainColor:this.colorLine,borderColor:this.borderColor,dashLineIcon:void 0,dashLine:void 0,lineWidth:void 0,typeModal:"full"}},p_text:"Interface"}})},draw:function(t){this.ctx=t,this.initSquare<3&&(this.initiation(),this.initSquare+=1),t.beginPath(),t.stroke(),this.square&&this.square.draw({x:this.cntX(this.mouse.x),y:this.cntY(this.mouse.y)})},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,(this.changeSize||this.init)&&this.square.changeSize(this.cntX(t.layerX),this.cntY(t.layerY),this.changeSize)},openFastSettings:function(){Jpt.$emit("openModal",{name:"openModal",data:{settings:{paramName:"ModalSettingsInstruments",emit:this.$emit,openModal:this.openModal,settings:{id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:this.$t("rectangleWord"),nameIconTitle:"new-instrument-square",mainColor:this.colorLine,borderColor:this.borderColor,dashLineIcon:void 0,dashLine:void 0,lineWidth:void 0}},p_text:"Interface"}})},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal(null,t)}),200):this.timerDoubleClick=setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openFastSettings(),e.counterDoubleClick=0}),300)},initiation:function(){var t,e=this,i=this.symbol,o=localStorage.getItem(i),n=Array.isArray(JSON.parse(o)["default"])?JSON.parse(o)["default"]:[];Array.isArray(n)&&(t=n.find((function(t){return t.id===e.$props.id}))),t&&(this.newId=t.id,this.square=new VPt({id:t.id,ctx:this.ctx,pins:{init:{x:t.x,y:t.y}},width:t.size.width,height:t.size.height,layout:this.$props.layout,getToken:this.getToken,background:t.background,borderColor:t.borderColor,getUser:this.getUser,getDefaultAccount:this.getDefaultAccount,$socketStream:this.$socketStream,symbol:this.symbol}))},mouseup:function(t){this.changeSize&&this._$emit("custom-event",{event:"scroll-lock",args:[!1]}),this.square||(this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.square=new VPt({ctx:this.ctx,pins:{init:{x:this.cntX(t.layerX),y:this.cntY(t.layerY)}},layout:this.$props.layout}),this.changeSize=this.square.setPinMouseDonw(this.cntX(t.layerX),this.cntY(t.layerY),!0)),this.changeSize=this.square.setPinMouseDonw(),localStorage.setItem("dragOverlay",JSON.stringify({arr:[]}))},mousedown:function(t){this.square||(this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.square=new VPt({ctx:this.ctx,pins:{init:{x:this.cntX(t.layerX),y:this.cntY(t.layerY)}},layout:this.$props.layout,getToken:this.getToken,getUser:this.getUser,getDefaultAccount:this.getDefaultAccount,$socketStream:this.$socketStream}),this.changeSize=this.square.setPinMouseDonw(this.cntX(t.layerX),this.cntY(t.layerY),!0)),this.changeSize=this.square.setPinMouseDonw(this.cntX(t.layerX),this.cntY(t.layerY)),this.square.setPinMouseDonw(this.cntX(t.layerX),this.cntY(t.layerY),!1,this.$props.id)&&(this._$emit("custom-event",{event:"scroll-lock",args:[!0]}),this.doubelClick(t))}},computed:Object(c["a"])({},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),data:function(){return{counterDoubleClick:0,initSquare:0,ctx:void 0,pinSquare:void 0,mouse:{x:void 0,y:void 0},changeSize:!1,borderColor:"#dfdfdf",colorLine:"#2e66e0"}}},qPt=GPt,zPt=Object(C["a"])(qPt,tPt,ePt,!1,null,null,null),YPt=zPt.exports,XPt={name:"CircleOverlay",mixins:[tgt["a"]],destroyed:function(){var t=this;document.addEventListener("keydown",this.listener),Jpt.$on("removeOverlay",this.removeOverlay),Jpt.$off("openModalFromOverlay",(function(e){e.id===t.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return t.openModal("full",{})}),50))})),document.removeEventListener("keydown",this.listener)},mounted:function(){var t=this;this.elementToChangeCurspor=document.getElementById("chartWrap"),document.addEventListener("keydown",this.listener),Jpt.$on("removeOverlay",this.removeOverlay),Jpt.$on("openModalFromOverlay",(function(e){e.id===t.idCurrentOverlay&&(Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"NewModalSettingsInstruments"}}),setTimeout((function(){return t.openModal("full",{})}),50))})),document.removeEventListener("keydown",this.listener),this.symbol=this.$props.settings.symbol;var e=this.$props.settings.data?JSON.parse(JSON.stringify(this.$props.settings.data)):null;e&&Object.keys(e).forEach((function(i){t[i]=e[i]})),this.timeFrame=this.$props.settings.timeFrame,this.arrCnd=this.$props.settings.candles,this.groupId=this.$props.settings.groupId,this.idCurrentOverlay=this.$props.settings.idOvrl,e&&e.id&&(this.idCurrentOverlay=e.id),this.groupId=this.$props.settings.groupId},methods:{setSettings:function(t){var e=this;t.idFromEvent===this.idCurrentOverlay&&(t.settings.forEach((function(t){e[t[0]]=t[1]})),this.saveNewPosition())},createObjectForSaveOrCopy:function(){var t=this.name||this.$props.id.replace("_","").replace(/[0-9]/g,""),e=Object.assign({},this.$data),i=Object(c["a"])(Object(c["a"])({},e),{},{id:this.idCurrentOverlay,timeFrame:this.timeFrame,name:t,symbol:this.symbol,groupId:this.groupId,countBarsSecondPin:this.countBarsSecondPin,countBarsFerstPin:this.countBarsFerstPin});return Object.keys(i).forEach((function(t){"object"!==Object(QD["a"])(i[t])||Array.isArray(i[t])||(i[t]=Object.assign({},i[t]))})),i},saveNewPosition:function(){this.getToken&&Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:this.createObjectForSaveOrCopy()})},meta_info:function(){return{author:"Alexey Pushkin",version:"1.0.0"}},use_for:function(){return["CircleOverlay"]},draw:function(t){this.isRemoved||(this.ctx=t,this.drawCircle(t,this.centerCircle.x,this.centerCircle.y),this.xt&&this.y$&&this.changeCursor(this.$props.layout.t2screen(this.centerCircle.x),this.$props.layout.$2screen(this.centerCircle.y),this.$props.layout.t2screen(this.xt),this.$props.layout.$2screen(this.y$)))},drawCircle:function(t,e,i){var o=this.$props.layout.t2screen(e),n=this.$props.layout.$2screen(i),s=n+ +this.radiusCircle;t.beginPath(),t.fillStyle=this.colorLine,t.strokeStyle=this.borderColor,t.arc(o,n,this.radiusCircle,0,2*Math.PI,!0),t.lineWidth=this.lineWidth,t.setLineDash(this.lineDash),t.stroke(),t.fill(),this.viewChangeSizeCircle&&this.drawChangeSizeCircke(t,o,s)},drawChangeSizeCircke:function(t,e,i){e=+e,i=+i,t.beginPath(),t.fillStyle="#fff",t.strokeStyle="#2e66e0",t.lineWidth=1.5,t.arc(e,i,5,2*Math.PI,!1),t.fill(),t.stroke(),t.lineWidth=1},drawNewPositionCircle:function(t,e){var i=this.$props.layout.screen2t(t).toFixed(),o=this.$props.layout.screen2$(e);this.centerCircle.x=i,this.centerCircle.y=o},doubelClick:function(t){var e=this;this.counterDoubleClick++,1!==this.counterDoubleClick?(this.changePosition=!1,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.counterDoubleClick=0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e._$emit("custom-event",{event:"scroll-lock",args:[!1]})}),300)},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.centerCircle.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.centerCircle.y)+60),t.centerCircle.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.centerCircle.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-32,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Circle",nameIconTitle:"new-trands-line",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Fill",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]},{index:1,name:"Broder",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"borderColor",color:function(){return i.borderColor},value:this.borderColor,fast:!0}]}],typeModal:t}}})},radiusLenght:function(t,e,i,o){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2)).toFixed(2)},onHoverCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))this.$props.sub[this.$props.sub.length-1][0]){var i=this.$props.sub[this.$props.sub.length-1][0],o=t,n=this.$props.meta.last[0],s=6e4*this.timeFrame;e=(o-i)*s+n}else e=this.arrCnd[t][0];return e},draw:function(t){this.ctx=t,this.drawTirangle(t,this.A,this.B,this.C)},onTriangle:function(t,e,i,o){var n=(e.x-t.x)*(i.y-e.y)-(i.x-e.x)*(e.y-t.y),s=(i.x-t.x)*(o.y-i.y)-(o.x-i.x)*(i.y-t.y),r=(o.x-t.x)*(e.y-o.y)-(e.x-o.x)*(o.y-t.y);if(n>=0&&s>=0&&r>=0||n<=0&&s<=0&&r<=0)return!0},onCircle:function(t,e,i,o){return(t-i)*(t-i)+(e-o)*(e-o)<2*Math.PI*8.5},drawTirangle:function(t,e,i,o){e={x:this.$props.layout.t2screen(e.x),y:this.$props.layout.$2screen(e.y)},i={x:this.$props.layout.t2screen(i.x),y:this.$props.layout.$2screen(i.y)},o={x:this.$props.layout.t2screen(o.x),y:this.$props.layout.$2screen(o.y)},t.beginPath(),t.strokeStyle=this.borderColor,t.fillStyle=this.colorLine,t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.lineTo(o.x,o.y),t.closePath(),t.fill(),t.stroke(),this.drawCircle(t,e.x,e.y),this.drawCircle(t,i.x,i.y),this.drawCircle(t,o.x,o.y)},drawCircle:function(t,e,i){t.beginPath(),t.fillStyle="#fff",t.lineWidth="1.5",t.strokeStyle="#2e66e0",t.arc(e,i,4,0,2*Math.PI,!0),t.stroke(),t.fill()},mousemove:function(t){this.mouse.x=t.layerX,this.mouse.y=t.layerY,this.A.change&&(this.A.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),this.A.y=this.$props.layout.screen2$(t.layerY)),this.B.change&&(this.B.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),this.B.y=this.$props.layout.screen2$(t.layerY)),this.C.change&&(this.C.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),this.C.y=this.$props.layout.screen2$(t.layerY))},newSetSettings:function(t,e){this[t.nameParam]="string"===typeof e?e:e.value,this.updateDraw()},updateDraw:function(){this._$emit("custom-event",{event:"change-settings",args:[!0]}),this.saveNewPosition()},copyOverlay:function(){var t=this.createObjectForSaveOrCopy();t.groupId=this.sett.groupId,t.A.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.A.y)+60),t.A.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.A.x)+40),t.B.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.B.y)+60),t.B.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.B.x)+40),t.C.y=this.$props.layout.screen2$(this.$props.layout.$2screen(t.C.y)+60),t.C.x=this.$props.layout.screen2t(this.$props.layout.t2screen(t.C.x)+40),Jpt.$emit("copyOverlay",{name:"copyOverlay",data:t}),this.saveNewPosition()},openModal:function(t,e){var i=this;Jpt.$emit("openModal",{name:"openModal",data:{settings:{top:e.y-50,left:e.x,paramName:"NewModalSettingsInstruments",id:this.idCurrentOverlay,gropuId:this.groupId,idProps:this.$props.id,title:"Triangle",nameIconTitle:"new-trands-line",setSettings:this.newSetSettings,copyOverlay:this.copyOverlay,listSections:[{index:0,name:"Fill",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"colorLine",value:this.colorLine,color:function(){return i.colorLine},fast:!0}]},{index:1,name:"Border",startCheckBox:!1,settings:[{component:"NewColorPicker",icon:"colorLine",nameParam:"borderColor",value:this.borderColor,color:function(){return i.borderColor},fast:!0}]}],typeModal:t}}})},doubleClick:function(t){var e=this;1!==this.counterDoubleClick?(this.change=!1,this.isSetPins=!1,Jpt.$emit("closeAllModalSetting",{id:this.idCurrentOverlay}),this.counterDoubleClick=0,setTimeout((function(){Jpt.$emit("closeAllFastSettings"),e.openModal("full",t)}),200)):this.timerDoubleClick=setTimeout((function(){e.change=!0,Jpt.$emit("closeAllFastSettings"),e.openModal(null,t),e.counterDoubleClick=0}),300)},mousedown:function(t){var e=this,i=this.A,o=this.B,n=this.C,s=[i,o,n];i.x||i.y?o.x||o.y?n.x||n.y||(n.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),n.y=this.$props.layout.screen2$(t.layerY),this.saveNewPosition(),this.openModal(null,t)):(o.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),o.y=this.$props.layout.screen2$(t.layerY)):(i.x=this.getTimeCandle(this.$props.layout.screen2t(t.layerX).toFixed(0)),i.y=this.$props.layout.screen2$(t.layerY)),i.x&&o.x&&n.x&&(this.onTriangle({x:t.layerX,y:t.layerY},{x:this.$props.layout.t2screen(i.x),y:this.$props.layout.$2screen(i.y)},{x:this.$props.layout.t2screen(o.x),y:this.$props.layout.$2screen(o.y)},{x:this.$props.layout.t2screen(n.x),y:this.$props.layout.$2screen(n.y)})&&(this.timerMove=setTimeout((function(){e.position={current:void 0,prev:void 0},e.cangePosition=!0,e._$emit("custom-event",{event:"scroll-lock",args:[!0]}),e.initMove={x:t.layerX,y:t.layerY}}),200),this.doubleClick(t)),s.forEach((function(i){e.onCircle(t.layerX,t.layerY,e.$props.layout.t2screen(i.x),e.$props.layout.$2screen(i.y))&&(e[i.name].change=!0,e._$emit("custom-event",{event:"scroll-lock",args:[!0]}))})))},mouseup:function(){this.timerMove&&clearTimeout(this.timerMove),this.cangePosition&&(this.cangePosition=!1,this._$emit("custom-event",{event:"scroll-lock",args:[!1]})),this.A.change&&(this.A.change=!1,this.saveNewPosition()),this.B.change&&(this.B.change=!1,this.saveNewPosition()),this.C.change&&(this.C.change=!1,this.saveNewPosition()),this._$emit("custom-event",{event:"scroll-lock",args:[!1]})}},computed:Object(c["a"])({sett:function(){return this.$props.settings}},Object(p["c"])({getToken:"auth/getToken",getUser:"user/getUserDetail",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),data:function(){return{ctx:void 0,colorLine:"rgba(255,255,255,1)",borderColor:"rgba(255,0,0,1)",mouse:{x:void 0,y:void 0},A:{x:void 0,y:void 0,name:"A",change:!1},B:{x:void 0,y:void 0,name:"B",change:!1},C:{x:void 0,y:void 0,name:"C",change:!1},counterDoubleClick:0}}},tTt=ZPt,eTt=Object(C["a"])(tTt,nPt,sPt,!1,null,null,null),iTt=eTt.exports,oTt=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.comp.$props.layout,i=this.comp.$props.config,o=function(){return t.last_bar()};this.comp.$emit("new-shader",{target:"sidebar",draw:function(n){var s=o();if(s){var r=n.canvas.width,a=i.PANHEIGHT,c=s.price.toFixed(e.prec);n.fillStyle=t.comp.$props.meta.last[4]>=t.comp.$props.meta.last[1]?t.green():t.red();var l=-.5,u=s.y-.5*a-.5,d=7;n.fillRect(l-.5,u,r+1,a),n.fillStyle="white",n.textAlign="left",n.fillText(c,d,u+15)}}}),this.shader=!0}},{key:"draw",value:function(t){if(this.comp.$props.meta.last){this.shader||this.init_shader();var e=this.comp.$props.layout,i=this.comp.$props.meta.last,o=i[4]>=i[1],n=o?this.green():this.red(),s=e.$2screen(i[4])+(o?1:0);t.strokeStyle=n,t.setLineDash([1,1]),t.beginPath(),t.moveTo(0,s),t.lineTo(e.width,s),t.stroke(),t.setLineDash([])}}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.$props.colors.candleUp}},{key:"red",value:function(){return this.comp.$props.colors.candleDw}}]),t}(),nTt={name:"Area51",mixins:[Opt["Overlay"]],methods:{meta_info:function(){return{author:"👽",version:"1.0.0",desc:"Gradient area chart"}},init:function(){this.shader=new oTt(this)},draw:function(t){var e=this.$props.layout,i=this.$props.data,o=t.createLinearGradient(0,0,0,e.height);o.addColorStop(0,this.back1),o.addColorStop(1,this.back2),t.lineWidth=this.line_width,t.strokeStyle=this.color,t.beginPath();var n,s=Object(WD["a"])(i);try{for(s.s();!(n=s.n()).done;){var r=n.value,a=e.t2screen(r[0]),c=e.$2screen(r[1]);t.lineTo(a,c)}}catch(y){s.e(y)}finally{s.f()}var l=e.t2screen(this.$props.meta.last[0]),u=e.$2screen(this.$props.meta.last[4]);t.lineTo(l,u),t.stroke(),t.fillStyle=o,t.beginPath();var d=(i[0]||[])[0],h=(i[i.length-1]||[])[0];t.lineTo(e.t2screen(d),e.height);var p,g=Object(WD["a"])(i);try{for(g.s();!(p=g.n()).done;){var f=p.value,m=e.t2screen(f[0]),v=e.$2screen(f[1]);t.lineTo(m,v)}}catch(y){g.e(y)}finally{g.f()}t.lineTo(e.t2screen(h),e.height),t.fill(),this.shader&&this.shader.draw(t)},use_for:function(){return["Area51"]},data_colors:function(){return[this.color]}},computed:{sett:function(){return this.$props.settings},line_width:function(){return this.sett.lineWidth||1.25},color:function(){return this.sett.color||"#2fd68f"},back1:function(){return this.sett.back1||this.color+"15"},back2:function(){return this.sett.back2||this.color+"01"}},data:function(){return{}}},sTt=nTt,rTt=Object(C["a"])(sTt,rPt,aPt,!1,null,null,null),aTt=rTt.exports,cTt=function(){function t(e,i,o){Object(Qh["a"])(this,t),this.ctx=i,this.self=e,this.style=o.raw[6]||this.self,this._draw(o)}return Object(Jh["a"])(t,[{key:"_draw",value:function(t){var e=this.style.lineWidth,i="HLC"==this.style.chartType,o=e/2,n=t.c<=t.o?this.style.upBarColor:this.style.downBarColor,s=Math.max(t.w,1),r=Math.max(Math.floor(.5*s),1),a=e%2===0?0:.5;this.ctx.strokeStyle=n,this.ctx.lineWidth=e,this.ctx.beginPath(),this.ctx.moveTo(Math.floor(t.x-o)+a,Math.floor(t.h)),this.ctx.lineTo(Math.floor(t.x-o)+a,Math.floor(t.l)),s>1&&(i?(this.ctx.moveTo(Math.floor(t.x-r-o-1),Math.floor(t.c)-a),this.ctx.lineTo(Math.floor(t.x-o),Math.floor(t.c)-a)):(this.ctx.moveTo(Math.floor(t.x-r-o-1),Math.floor(t.o)-a),this.ctx.lineTo(Math.floor(t.x-o),Math.floor(t.o)-a)),this.ctx.moveTo(Math.floor(t.x-o),Math.floor(t.c)-a),this.ctx.lineTo(Math.floor(t.x+r-o+1),Math.floor(t.c)-a)),this.ctx.stroke()}}]),t}(),lTt=function(){function t(e,i,o,n,s){Object(Qh["a"])(this,t),this.ctx=i,this.$p=e.$props,this.self=e,this.style=o.raw[6]||this.self,this._draw(o,n,s)}return Object(Jh["a"])(t,[{key:"_draw",value:function(t,e,i){if(i){var o=t.green?this.style.upVolBarColor:this.style.downVolBarColor,n=this.style.volBarWidth,s=n/2,r=this.$p.layout.height,a=Math.floor(t.h);this.ctx.strokeStyle=o,this.ctx.lineWidth=n,this.ctx.beginPath(),this.ctx.moveTo(Math.floor(e.x-s),Math.floor(r-a-.5)),this.ctx.lineTo(Math.floor(e.x-s),Math.floor(r+.5)),this.ctx.stroke()}else{var c=this.$p.layout.height,l=t.x2-t.x1,u=Math.floor(t.h);this.ctx.fillStyle=t.green?this.style.upVolBarColor:this.style.downVolBarColor,this.ctx.fillRect(Math.floor(t.x1),Math.floor(c-u-.5),Math.floor(l),Math.floor(u+1))}}}]),t}(),uTt=function(){function t(e){Object(Qh["a"])(this,t),this.comp=e}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.comp.$props.layout,i=this.comp.$props.config,o=function(){return t.last_bar()};this.comp.$emit("new-shader",{target:"sidebar",draw:function(n){var s=o();if(s){var r=n.canvas.width,a=i.PANHEIGHT,c=s.price.toFixed(e.prec);n.fillStyle=t.comp.$props.meta.last[4]>=t.comp.$props.meta.last[1]?t.green():t.red();var l=-.5,u=s.y-.5*a-.5,d=7;n.fillRect(l-.5,u,r+1,a),n.fillStyle="white",n.textAlign="left",n.fillText(c,d,u+15)}}}),this.shader=!0}},{key:"draw",value:function(t){if(this.comp.$props.meta.last){this.shader||this.init_shader();var e=this.comp.$props.layout,i=this.comp.$props.meta.last,o=i[4]>=i[1],n=o?this.green():this.red(),s=e.$2screen(i[4])+(o?1:0);t.strokeStyle=n,t.setLineDash([1,1]),t.beginPath(),t.moveTo(0,s),t.lineTo(e.width,s),t.stroke(),t.setLineDash([])}}},{key:"last_bar",value:function(){if(this.comp.data.length){var t=this.comp.$props.layout,e=this.comp.data[this.comp.data.length-1],i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}}},{key:"last_price",value:function(){return this.comp.$props.meta.last?this.comp.$props.meta.last[4]:void 0}},{key:"green",value:function(){return this.comp.$props.colors.candleUp}},{key:"red",value:function(){return this.comp.$props.colors.candleDw}}]),t}(),dTt={name:"XOhlcBars",mixins:[Opt["Overlay"]],methods:{meta_info:function(){return{author:"X",version:"1.3.0",desc:"Bar Chart"}},init:function(){this.price=new uTt(this)},draw:function(t){if(this.$props.sub===this.$props.data)var e={ohlcbars:this.$props.layout.candles,volume:this.$props.layout.volume};else e=Object(Opt["layout_cnv"])(this);if(this.show_volume)for(var i=0;i=0&&n.news.push(t)})),!i.find((function(t){return t.timeFrameCandle===n.timeFrameCandle}))&&n.news.length&&i.push(n),i}),[]);this.saveGroupNews(i)}},saveGroupNews:function(t){var e=localStorage.getItem("groupsNews");if(e){var i=JSON.parse(e);return i[this.getSymbol]=t,void localStorage.setItem("groupsNews",JSON.stringify(i))}var o=Object(Vt["a"])({},this.getSymbol,t);localStorage.setItem("groupsNews",JSON.stringify(o))},addOverlayUnicInDataCube:function(t,e){var i=this;this.dataCube&&(Array.isArray(t)?t.forEach((function(t){i.dataCube.get("onchart.".concat(t,"0")).length||i.dataCube.add("onchart",{name:t,type:t,data:[],auto_scroll:!1,settings:{zIndex:"ResultProfits"===t?20:10,changeDom:function(){},legend:!1,pendingOrders:i.pendingOrders,symbol:"".concat(i.getSymbol),timeFrame:"".concat(i.getTimeFrame),candles:i.allCandles,groupId:i.getSelectedButtonForActiveScreen.groupPreset,additionallyData:e}})})):this.dataCube.get("onchart.".concat(t,"0")).length||this.dataCube.add("onchart",{name:t,type:t,data:[],auto_scroll:!1,settings:{zIndex:10,legend:!1,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset,additionallyData:e}}))},prevDeleteOverlay:function(t){t&&t.id&&t.screen.id===this.getDataQuoteButton.groupPreset&&(this.dataCube.del("onchart."+t.idProps.replace("_","")),this.requsetToRemoveOrverlays([t.id]))},removeOverlay:function(t){if(t&&t.id){var e=this.dataCube.get("onchart"),i=e.find((function(e){return e.settings.idOvrl===t.id}));i&&(this.dataCube.hide(i.id),this.requsetToRemoveOrverlays([t.id]))}},sentOrder:function(t){if(t.symbol===this.getSymbol)if(this.getActiveAccount){var e={Command:"OpenTradingOrder",data:{accountId:this.getActiveAccount.id,orderType:t.type,volume:t.volume,contractName:this.getActiveAccount.brokerId?this.getSymbol+".a":this.getSymbol,comment:""},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e})}else this.$store.dispatch("modal/setPopupData",{visible:!0,modalComponentName:"ModalLogin",title:"sign_in"})},removeAllOverlays:function(t){var e=this;if(this.getDataQuoteButton.groupPreset===t.screen.groupPreset&&this.getDataQuoteButton.id===t.screen.id){var i=this.dataCube.get("onchart"),o=["OpenOrders","MinMaxCandleDay","CursorInformation","ResultProfits","WayOpenOrderFromQuote","Screenshot","ClosedOrders","News","MedianAveragePrice","bottomImages","WatchingForGetChancs"],n=i.filter((function(t){var e=o.find((function(e){return e===t.name}));if(!e)return t}));n.forEach((function(t){e.dataCube.del(t.id)}));var s=n.reduce((function(t,e){var i=t.find((function(t){return t===e.data.id}));return i||t.push(e.data.id),t}),[]);this.requsetToRemoveOrverlays(s)}},createIndicator:function(t){var e=t.defaultValues;e.type="indicator";var i=t.chartId!==this.getChartId||t.symbol!==this.getSymbol;if(!i){var o=this.getOverlayInDataCube(e.state,e.name);if(Array.isArray(o)&&o.length){this.removeListOverlays(o);var n=this.listOverlays.find((function(t){return t.name===o[0].name}));n&&this.removeListOverlays([n])}else{t.settings.$props=void 0,t.settings.$uuid=void 0,t.settings.dataIndex=1,t.settings.skipNaN=!0;var s={name:e.name,type:e.name,skipNaN:!0,data:this.dataCube.get("chart.data")[0],settings:t.settings};this.dataCube.add(e.state,s),this.saveIndicator(t)}}},saveIndicator:function(t){if(this.getToken){var e=this.createObjectForSave(t);Jpt.$emit("saveSettingsOverlay",{name:"saveSettingsOverlay",data:e})}},createObjectForSave:function(t){return t.id="".concat(t.chartId,"_").concat(t.symbol,"_").concat(t.name),t.skipNaN=!0,t},removeListOverlays:function(t){var e=this;t.forEach((function(t){e.dataCube.del(t.id)}))},removeAllIndicators:function(t){var e=this;if(t.screen.id===this.getChartId){this.dataCube.get(".").forEach((function(t){var i=ATt.find((function(e){return e.name===t.name}));i&&e.dataCube.del(t.id)}));var i=this.listOverlays.filter((function(t){var e=t.setting.defaultValues,i=e&&"indicator"===e.type;if(e&&i)return t})),o=i.map((function(t){return t.id}));this.requsetToRemoveOrverlays(o)}},getOverlayInDataCube:function(t,e){var i=this.dataCube.get("".concat(t,".").concat(e));return i},requsetToRemoveOrverlays:function(t){if(Array.isArray(t)){var e={Command:"RemoveChartSettings",Token:this.getToken,data:{GroupId:this.getDataQuoteButton.groupPreset,Ids:t}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},addOverlayInDataCube:function(t,e){var i=this;if(this.dataCube)if(Array.isArray(t))t.forEach((function(t){i.createOverlayInCube(t,e)}));else{var o=ATt.find((function(e){return e.name===t}));o?this.createIndicator(e):this.createOverlayInCube(t,e)}},createOverlayInCube:function(t,e){var i="".concat(t,"_").concat(this.getSymbol,"_").concat(this.getTimeFrame,"_").concat(Math.floor(Math.random()*(new Date).getTime()),"_").concat((new Date).getTime()),o=!(!e||Array.isArray(e))&&e.id,n=o||i;this.dataCube.add("onchart",{name:t,type:t,data:e||[],auto_scroll:!1,settings:{idOvrl:n,zIndex:10,legend:!1,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset,data:e}})},createOrUpadeteDataCube:function(t,e){var i=this;this.dataCube?this.dataCube.set("chart.data",t):this.dataCube=new Opt["DataCube"]({chart:{type:"Candles",data:t,indexBased:!0,settings:{auto_scroll:!0}},offchart:[],onchart:[]}),this.$orderStorage.getOrdersOnStorage()&&this.setHistoryOrders(this.$orderStorage.getOrdersOnStorage()),this.addOverlayUnicInDataCube(["News","OpenOrders"]),e&&(this.isInitToGetPreset=!0,setTimeout((function(){return i.getPresetSettingsForChart()}),150))},resizeWidthCell:function(t){this.changedSize={width:t.listWidthCells[this.getGroupIndex][this.getChartIndex],height:this.changedSize?this.changedSize.height:this.getHeightCurrentChart}},resizeHeightCell:function(t){this.changedSize={width:this.changedSize?this.changedSize.width:this.getWidthCurrentChart,height:(this.getGroupIndex,t.heightRows[this.getGroupIndex])}},controlSubribeWS:function(t){if(!t)return this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler),this.$socketStream.$on("apiWS3",this.setMessageHandler),void this.$socketStream.$on("WSSstatus",this.getStatusWS);this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler),this.$socketStream.$off("WSSstatus",this.getStatusWS)},getCandles:function(t){var e={command:"Candles",method:"get",data:{quote:this.getSymbol,timeframe:this.getTimeFrame,count:t}};this.$socketStream.sendCommand({ws:"apiWS2",command:e}),t>1&&this.addWsCommandToScriptLoad({ws:"apiWS2",command:e})},getCandles2:function(t,e){var i={command:"Candles2",method:"get",data:{quote:this.getSymbol,timeframe:this.getTimeFrame,count:t,date:e}};this.$socketStream.sendCommand({ws:"apiWS2",command:i}),t>1&&this.addWsCommandToScriptLoad({ws:"apiWS2",command:i})},setHistoryOrders:function(t){t&&(this.openOrders=[],this.openOrdersToImage=[],this.orders=[],this.openMyOrders=[],this.agrigateOrders(t))},removeOrderLinesFromDataCube:function(){this.dataCube.get("onchart.ownerOrdersLines0").length&&this.dataCube.del("onchart.ownerOrdersLines0"),this.dataCube.get("onchart.TakeProfitAndStopLose0").length&&this.dataCube.del("onchart.TakeProfitAndStopLose0")},addWsCommandToScriptLoad:function(t){if(this.scriptWSCommands.length){var e=this.scriptWSCommands.findIndex((function(e){return e.command===t.command}));e>=0?this.scriptWSCommands.splice(e,1,t):this.scriptWSCommands.push(t)}else this.scriptWSCommands.push(t)},getStatusWS:function(t){"connect"===t.status&&this.$socketStream.sendScriptCommands(this.scriptWSCommands.filter((function(e){return e.ws===t.ws})))},zoomIn:function(t){if(this.getDataQuoteButton.groupPreset===t.screen.groupPreset&&this.getDataQuoteButton.id===t.screen.id){var e=this.$refs["tvjs-".concat(this.getGroupId,"-").concat(this.getSymbol,"-").concat(this.getTimeFrame)],i=e.getRange();if((i[1]-i[0])/(60*this.getTimeFrame*1e3)<15)return;var o=[i[0]+60*this.getTimeFrame*1e3*5,i[1]-60*this.getTimeFrame*1e3*5];e.setRange(o[0],o[1])}},zoomOut:function(t){if(this.getDataQuoteButton.groupPreset===t.screen.groupPreset&&this.getDataQuoteButton.id===t.screen.id){var e=this.$refs["tvjs-".concat(this.getGroupId,"-").concat(this.getSymbol,"-").concat(this.getTimeFrame)],i=e.getRange(),o=[i[0]-60*this.getTimeFrame*1e3*5,i[1]+60*this.getTimeFrame*1e3*5];e.setRange(o[0],o[1])}},Candles:function(t){var e=this;t.quote===this.getSymbol&&(this.lastTime=t.candels[t.candels.length-1].timeOpen,t.candels.length>1?(this.allCandles=this.getFormattedArr(t.candels),this.debouncer("createOrUpadeteDataCube",700,this.allCandles),setTimeout((function(){return e.addOverlayUnicInDataCube(["WatchingForGetChancs"])}),750),this.dataCube&&(this.dataCube.get("onchart.OpenOrders")&&this.dataCube.set("onchart.OpenOrders.settings",{zIndex:10,changeDom:function(){},legend:!1,pendingOrders:this.pendingOrders,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset}),this.dataCube.get("onchart.ClosedOrders")&&this.dataCube.set("onchart.ClosedOrders.settings",{zIndex:10,changeDom:function(){},legend:!1,pendingOrders:this.pendingOrders,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset}))):1===t.candels.length&&(this.uploadLastCandle(t.candels[0],t.quote),this.dataCube&&this.dataCube.get("onchart.OpenOrders")&&this.dataCube.set("onchart.OpenOrders.settings",{zIndex:10,changeDom:function(){},legend:!1,pendingOrders:this.pendingOrders,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset}),this.dataCube&&this.dataCube.get("onchart.ClosedOrders")&&this.dataCube.set("onchart.ClosedOrders.settings",{zIndex:10,changeDom:function(){},legend:!1,pendingOrders:this.pendingOrders,symbol:"".concat(this.getSymbol),timeFrame:"".concat(this.getTimeFrame),candles:this.allCandles,groupId:this.getSelectedButtonForActiveScreen.groupPreset})))},getFormatedCandles:function(t){var e=this,i=t.reduce((function(i,o,n){return t.length===n+1&&(e.newTLastCandle=o),i.push(Object.values(o)),i}),[]),o=i.map((function(t){var e=[+"".concat(new Date(t[t.length-2]).getTimeWithoutUTC())].concat(Object(x["a"])(t));return e.splice(-2,2),e}));return o},uploadLastCandle:function(t,e){if(e===this.getSymbol&&this.dataCube){var i=this.dataCube.get("chart.data")[0],o=this.getFormatedCandles([t],"dontupdate")[0][0];i[i.length-1][0]!==o&&this.dataCube.merge("chart.data",[this.getFormatedCandles([t])[0]])}},Candles2:function(t){var e=this;if(this.getSymbol===t.quote&&(t.length5&&(i.splice(1,1),i[4]=t.b),this.$refs["tvjs-".concat(this.getGroupId,"-").concat(this.getSymbol,"-").concat(this.getTimeFrame)]&&this.dataCube.merge("chart.data",[[i[0],i[1],t.b>i[2]?t.b:i[2],t.b0&&(this.isInitToGetPreset=!1,this.listOverlays.forEach((function(t){e.addOverlayInDataCube(t.setting.name,t.setting)}))))},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},eventsHandles:function(t){t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},updateOrder:function(t){if(t.symbol===this.getSymbol){var e={Command:"ModifyTradingOrder",data:t.order,Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e})}},closePosition:function(t){if(t.order.instrumentName===this.getSymbol){var e={Command:"CloseTradingOrder",data:{accountId:t.order.accountId,id:t.order.id},Token:this.getToken};this.$socketStream.sendCommand({ws:"apiWS",command:e})}}},mounted:function(){var t=this;this.contractStat=JSON.parse(sessionStorage.getItem("statContract".concat(this.getSymbol)));var e=sessionStorage.getItem("cursorType");e&&this.changeCursor(e),this.controlSubribeWS(!1),Jpt.$on(this.eventsList,this.eventsHandles),this.getCandles(this.stepGetCandles),this.$nextTick((function(){t.checkFullScreen()})),Jpt.$on("changeColors",(function(e){t.colors[e.type]=e.value})),this.getStatusSetSettingsChat&&(this.isInitToGetPreset=!0,this.getPresetSettingsForChart());var i=localStorage.getItem("getAllColors")?JSON.parse(localStorage.getItem("getAllColors")):null;i&&(this.allColors=i[this.getActiveTheme])},destroyed:function(){var t=this;this.controlSubribeWS(!0),Jpt.$off(this.eventsList,this.eventsHandles),Jpt.$off("changeColors",(function(e){t.colors[e.type]=e.value}))}},kTt=DTt,ITt=(i("b579"),i("b2bb"),Object(C["a"])(kTt,Tpt,xpt,!1,null,"9bba614e",null)),BTt=ITt.exports,MTt={components:{Multichart:BTt,WidgetCpmpareContracts:fpt,WidgetPeriodsContracts:Ppt,UserProfileGridWidgetTopBar:nM,UserProfileEquityBalanceContractWidget:UB,UserProfileForecastChartByContract:UM,UserProfileComparisonInstrumentsChart:DM},mixins:[yn],props:{theme:{type:String}},data:function(){return{size:{width:0,height:0},activeIndex:0,topBarWidgetParams:{row:"normal",col:{index:1,mode:"normal"},directionModeRows:!1},arrayTabsComponents:[{component:"UserProfileEquityBalanceContractWidget",config:{contract:this.getSymbol,containerReport:".widgetByContracts"}},{component:"UserProfileForecastChartByContract",config:{contract:this.getSymbol,statusGistigramm:!1}},{component:"UserProfileComparisonInstrumentsChart",config:{contract:this.getSymbol,period:"week"}},{component:"UserProfileComparisonInstrumentsChart",config:{contract:this.getSymbol,period:"month"}}],activeComponent:null,dataButtons:[{icon:"holow-pig",hedler:"",status:!0},{icon:"Prognoz",hedler:"",status:!1},{icon:"TimePeriod_2W",hedler:"",status:!1},{icon:"TimePeriod_2M",hedler:"",status:!1}]}},watch:{getGridStatus:function(t){this.activeComponent=t?this.getGrid:this.getGridConfig[this.activeIndex]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUsingAccountContracts:"contracts/getUsingAccountContracts",getStatusWidgetsContracts:"settingsTradingChart/getStatusWidgetsContracts"})),{},{getSymbol:function(){return this.getStatusWidgetsContracts.data.symbol},getGridConfig:function(){return this.arrayTabsComponents},getGrid:function(){return{component:"UserProfileGrid",config:{arrayWidgets:[{name:"WidgetMultiChartContract"},{name:"UserProfileEquityBalanceContractWidget",configObject:{contract:this.getSymbol,containerReport:".widgetByContracts"}},{name:"WidgetPeriodsContracts",configObject:{period:"day",activeDate:new Date,showControlButton:!0,showTabButtons:!0,mode:"account",contract:this.getSymbol}},{name:"WidgetCpmpareContracts",configObject:{}}],directionSize:800,downMarginGrid:0,direction:!0}}},getGridStatus:function(){return!0},getStatusTradeAccount:function(){var t=this;return this.getUsingAccountContracts.some((function(e){return e===t.getSymbol}))}}),methods:{setActiveComponent:function(t){this.activeIndex=t,this.dataButtons.forEach((function(e,i){e.status=i===t})),this.activeComponent=this.getGridConfig[t]},onResize:function(t){this.size={width:t[0].contentRect.width,height:t[0].contentRect.height}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrapWigets})),this.activeComponent=this.getGrid}},$Tt=MTt,LTt=(i("f401"),Object(C["a"])($Tt,cpt,lpt,!1,null,null,null)),FTt=LTt.exports,jTt=function(){var t=this,e=t._self._c;return e("Modal",{attrs:{isOpen:"isOpen",title:t.getSettingsIndicatorModal.data,modifier:"modal--compare modal-compare ".concat(t.getActiveTheme),isWithoutMask:!0},on:{close:t.goToDefaultSettings},scopedSlots:t._u([{key:"modal-body",fn:function(){return[e("div",{key:t.key,staticClass:"settings-indicators-body"},[e("div",{staticClass:"settings-indicators-body__buttons",class:t.getActiveTheme},[t.getAcceptedInputsContent?e("Button",{style:{marginRight:"12px",height:"32px"},attrs:{label:"Inputs",activated:"inputs"===t.typeContent},on:{click:function(e){return t.setType("inputs")}}}):t._e(),t.getAcceptedStylesContent?e("Button",{style:{marginRight:"12px",height:"32px"},attrs:{label:"Styles",activated:"styles"===t.typeContent},on:{click:function(e){return t.setType("styles")}}}):t._e()],1),t.getSettingsIndictor&&"inputs"===t.typeContent?e("div",{staticClass:"settings-indicators-body__content",class:t.getActiveTheme},[void 0!==t.settingsIndicator.length?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("periodWord")))]),e("div",{staticClass:"row-settings__field"},[e("InputCounter",{attrs:{value:t.settingsIndicator.length,step:1},on:{minus:function(e){return t.setOptions(e,"length","int",1)},add:function(e){return t.setOptions(e,"length","int",1)},change:function(e){return t.setOptions(e,"length","int",1)}}})],1)]):t._e(),void 0!==t.settingsIndicator.offset?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("shift")))]),e("div",{staticClass:"row-settings__field"},[e("InputCounter",{attrs:{step:.1,value:t.settingsIndicator.offset},on:{minus:function(e){return t.setOptions(e,"offset","int",.1)},add:function(e){return t.setOptions(e,"offset","int",.1)},change:function(e){return t.setOptions(e,"offset","int",.1)}}})],1)]):t._e(),void 0!==t.settingsIndicator.sigma?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v("Sigma")]),e("div",{staticClass:"row-settings__field"},[e("InputCounter",{attrs:{step:1,value:t.settingsIndicator.offset},on:{minus:function(e){return t.setOptions(e,"offset","int",1)},add:function(e){return t.setOptions(e,"offset","int",1)},change:function(e){return t.setOptions(e,"offset","int",1)}}})],1)]):t._e()]):t._e(),t.settingsIndicator&&"styles"===t.typeContent?e("div",{staticClass:"settings-indicators-body__content",class:t.getActiveTheme},[void 0!==t.settingsIndicator.color?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("linCol")))]),e("NewColorPicker",{attrs:{color:t.settingsIndicator.color,byRightSide:!0},on:{changeColor:function(e){return t.setColor(e,"color")}}})],1):t._e(),void 0!==t.settingsIndicator.color?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("backColor")))]),e("NewColorPicker",{attrs:{color:t.settingsIndicator.backColor,byRightSide:!0},on:{changeColor:function(e){return t.setColor(e,"backColor")}}})],1):t._e(),void 0!==t.settingsIndicator.back1?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("topgrCol")))]),e("NewColorPicker",{attrs:{color:t.settingsIndicator.back1,byRightSide:!0},on:{changeColor:function(e){return t.setColor(e,"back1")}}})],1):t._e(),void 0!==t.settingsIndicator.back2?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("botgrCol")))]),e("NewColorPicker",{attrs:{color:t.settingsIndicator.back2,byRightSide:!0},on:{changeColor:function(e){return t.setColor(e,"back2")}}})],1):t._e(),void 0!==t.settingsIndicator.lineWidth?e("div",{staticClass:"row-settings"},[e("div",{staticClass:"row-settings__label",class:t.getActiveTheme},[t._v(t._s(t.$t("lineWidth"))+", px")]),e("div",{staticClass:"row-settings__field"},[e("InputCounter",{attrs:{step:1,value:t.settingsIndicator.lineWidth},on:{minus:function(e){return t.setOptions(e,"lineWidth","int",1)},add:function(e){return t.setOptions(e,"lineWidth","int",1)},change:function(e){return t.setOptions(e,"lineWidth","int",1)}}})],1)]):t._e()]):t._e()])]},proxy:!0},{key:"modal-footer",fn:function(){return[e("div",{staticClass:"settings-indicators-footer",class:t.getActiveTheme},[t.isRemove?t._e():e("Button",{attrs:{label:t.getLabelButtonComplete,icon:"Instrument-indicator"},on:{click:function(e){return t.saveStatusIndicator("add")}}}),t.isRemove?e("div",{staticClass:"settings-indicators-footer__buttons"},[e("Button",{style:{marginRight:"8px"},attrs:{label:"Confirm",icon:"Check"},on:{click:function(e){return t.acceptSettings()}}}),e("Button",{attrs:{label:"Cancel",icon:"Close"},on:{click:function(e){return t.goToDefaultSettings()}}})],1):t._e()],1)]},proxy:!0}])})},RTt=[],WTt={components:{Modal:Oe,Button:zt,Toggle:qo,DxColorBox:f6.a,InputText:Aa,InputCounter:Sh,InputNumber:Xd,NewColorPicker:Ki},data:function(){return{isRemove:!1,defaultSettings:null,key:"containerSettingsIndicator",typeContent:"inputs",allSettings:{lineWidth:null,length:null,color:null,offset:null,dataIndex:null,skipNaN:!0},updateIndicator:null,settingsIndicator:{}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSettingsIndicatorModal:"modal/getSettingsIndicatorModal",getActiveTheme:"headerSettings/getActiveTheme",getIndicators:"settingsTradingChart/getIndicators",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen"})),{},{getSettingsIndicatorModalData:function(){return this.getSettingsIndicatorModal.data},getStatusIndicator:function(){var t=this;if(this.getIndicators&&this.getSettingsIndicatorModal.data)return this.getIndicators.find((function(e){return e.name===t.getSettingsIndicatorModal.data})).isActive},getSettingsIndictor:function(){return this.settingsIndicator},getAcceptedStylesContent:function(){if(this.getSettingsIndictor){var t=void 0!==this.getSettingsIndictor.color||void 0!==this.getSettingsIndictor.back1||void 0!==this.getSettingsIndictor.back2||void 0!==this.getSettingsIndictor.lineWidth;return t}},getAcceptedInputsContent:function(){if(this.getSettingsIndictor){var t=void 0!==this.getSettingsIndictor.length||void 0!==this.getSettingsIndictor.offset||void 0!==this.getSettingsIndictor.sigma;return t}},getLabelButtonComplete:function(){return this.isRemove?"Удалить индикатор":"Добавить индикатор"}}),mounted:function(){this.getAcceptedInputsContent||(this.typeContent="styles"),this.getAcceptedInputsContent&&(this.typeContent="inputs")},watch:{getSettingsIndicatorModalData:function(t){this.getAcceptedInputsContent||(this.typeContent="styles"),this.getAcceptedInputsContent&&(this.typeContent="inputs"),this.isRemove=!1,this.settingsIndicator=ATt.find((function(e){return t===e.name})),this.defaultSettings=null,this.getSettingsIndicator(t)},getAcceptedStylesContent:function(t){t||(this.typeContent="inputs")},getAcceptedInputsContent:function(t){t||(this.typeContent="styles"),t&&(this.typeContent="inputs")}},methods:{getSettingsIndicator:function(t){if(t){var e,i,o=ATt.find((function(e){return t===e.name}));o&&(i=o.settings,e=JSON.parse(JSON.stringify(i)),this.settingsIndicator=e,this.getSettingIndicatorFromChart(t,o.state))}},getSettingIndicatorFromChart:function(){},setSettings:function(t,e){if(e){this.isRemove=!0,this.updateIndicator=e;var i=this.getSettingsIndicatorModalData===t.name,o=ATt.find((function(e){return t.name===e.name})),n=o.settings,s=JSON.parse(JSON.stringify(n));if(i){for(var r in s.skipNaN=!0,s){var a=void 0!==[r];a&&(s[r]=t.settings[r])}this.defaultSettings||(this.defaultSettings=s),this.settingsIndicator=JSON.parse(JSON.stringify(s)),this.key="containerSettingsIndicator_".concat(Math.floor(Math.random()*(new Date).getTime()))}}},goToDefaultSettings:function(){this.updateIndicator&&"function"===typeof this.updateIndicator&&this.updateIndicator(this.getSettingsIndicatorModalData,this.defaultSettings),this.handleCloseModal()},acceptSettings:function(){this.updateIndicator(this.getSettingsIndicatorModalData,this.settingsIndicator),this.handleCloseModal()},setType:function(t){t!==this.typeContent&&(this.typeContent=t)},close:function(){this.$store.dispatch("modal/switchSettingsIndicatorModal","")},handleCloseModal:function(){this.close()},saveStatusIndicator:function(t){"update"===t?this.$emit("changeSettings",this.getSettingsIndicatorModal.data):this.close()},setOptions:function(t,e,i,o){t5&&void 0!==arguments[5]?arguments[5]:5,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:10;t.beginPath(),t.moveTo(e,i),t.lineTo(e-s,"Sell"===n?i-r:i+r),t.lineTo(e+s,"Sell"===n?i-r:i+r),t.lineTo(e,i),t.fillStyle="dark"===this.getActiveTheme?"#bbcee0":"#cfcfcf",t.fill(),t.strokeStyle="#fff",t.stroke(),o&&(t.textAlign="end",t.font="800 9px Arial",t.fillText(o,e-(s+2),"Sell"===n?i-1:i+8),t.fill())},drawPorviderAvatar:function(t,e,i,o){var n=new Image(15,15);n.src=o,t.save(),t.beginPath(),t.arc(e+10,i+10,10,0,2*Math.PI),t.clip(),t.drawImage(n,e,i,20,20),t.restore()},drawClosedOrderInfo:function(t,e,i,o,n){var s,r=n?98:74;s="Sell"===o.orderType?n?i-r-3:i-r:i+3;var a=o.subscriptionId?o.sourceUserAvatar:o.userAvatar,c="Sell"===o.orderType?"BUY":"SELL",l=new Date(o.closedDate).toLocaleString("ru"),u="".concat(c," ").concat(this.$moneyf(o.volume)),d="".concat(o.closePrice),h=this.getCryptoStatus?100*o.profit/(o.volume*o.openPrice):100*o.profit/o.volume,p="$ ".concat(this.$moneyf(o.profit)," (").concat(this.$moneyf(h,Math.abs(h)<.01?5:2)," %)"),g=o.subscriptionId?"".concat(o.sourceUserName):"".concat(o.userName);t.font="400 12px Arial";var f=t.measureText("CLOSE").width,m=t.measureText(l).width,v=t.measureText(u).width,y=t.measureText(d).width,C=t.measureText(p).width,b=t.measureText(g).width+24,S=[f,m,v,y,C,b],P=Math.max.apply(null,S);t.save(),t.textAlign="right",t.beginPath(),t.rect(e,s,P+8,r),t.fillStyle="dark"===this.getActiveTheme?"#4c5b6b":"#fff",t.strokeStyle="dark"===this.getActiveTheme?"#333":"#e4e4e4",t.stroke(),t.fill(),n&&this.drawPorviderAvatar(t,e+4,s+4,a),t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#bbcee0":"#333",n&&t.fillText(g,e+b+4,s+18),t.fillText("CLOSE",e+f+4,n?s+14+24:s+14),t.fillText(l,e+m+4,n?s+28+24:s+28),t.fill(),t.beginPath(),t.fillStyle="SELL"===c?this.getRedColor.color:this.getGreenColor.color,t.fillText(u,e+v+4,n?s+42+24:s+42),t.fillText(d,e+y+4,n?s+56+24:s+56),t.fill(),t.beginPath(),t.fillStyle=o.profit<0?this.getRedColor.color:this.getGreenColor.color,t.fillText(p,e+C+4,n?s+70+24:s+70),t.fill(),t.restore()},drawOpenedOrderInfo:function(t,e,i,o,n){var s=n?84:60,r="Sell"===o.orderType?i+3:n?i-84-3:i-60-3,a=o.subscriptionId?o.sourceUserAvatar:o.userAvatar,c=o.orderType.toUpperCase(),l=new Date(o.openDate).toLocaleString("ru"),u="".concat(c," ").concat(this.$moneyf(o.volume)),d="".concat(o.openPrice),h=o.subscriptionId?"".concat(o.sourceUserName):"".concat(o.userName);t.font="400 12px Arial";var p=t.measureText(l).width,g=t.measureText(h).width+24,f=n?[p,g]:[p],m=Math.max.apply(null,f);t.save(),t.beginPath(),t.textAlign="left",t.rect(e-m-8,r,m+8,s),t.fillStyle="dark"===this.getActiveTheme?"#4c5b6b":"#fff",t.strokeStyle="dark"===this.getActiveTheme?"#333":"#e4e4e4",t.fill(),t.stroke(),n&&this.drawPorviderAvatar(t,e-m-4,r+4,a),t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#bbcee0":"#333",n&&t.fillText(h,e-m+20,r+18),t.fillText("OPEN",e-p-4,n?r+14+24:r+14),t.fillText(l,e-p-4,n?r+28+24:r+28),t.fill(),t.beginPath(),t.fillStyle="Sell"===o.orderType?this.getRedColor.color:this.getGreenColor.color,t.fillText(u,e-p-4,n?r+42+24:r+42),t.fillText(d,e-p-4,n?r+56+24:r+56),t.fill(),t.restore()},drawLineFrom:function(t,e,i,o,n){n.save(),n.beginPath(),n.strokeStyle="dark"===this.getActiveTheme?"#bbcee0":"#cfcfcf",n.lineWidth=.5,n.setLineDash([5,5]),n.moveTo(t,e),n.lineTo(i,o),n.stroke(),n.restore()}}},txt={name:"ClosedOrders",mixins:[Opt["Overlay"],qe,ZTt],data:function(){return{closedOrdersByContract:[],orderToDraw:null}},watch:{getStatusHistoryClosedOrders:function(){this.forceRedrawChart()},getDefaultAccount:function(){this.closedOrdersByContract=[],this.forceRedrawChart()},getStatByOrders:function(t){t&&(this.setClosedOrdersByContract(),this.forceRedrawChart())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getServerTime:"serverTime/getServerTime",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings"})),{},{getSymbol:function(){return this._props.settings.symbol},getStatusHistoryClosedOrders:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.historyClosedOrders},getTimeFrame:function(){return this._props.settings.timeFrame}}),methods:{meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Trades overlay closed orders"}},use_for:function(){return["ClosedOrders"]},draw:function(t){this.ctx=t,this.getOrderToDraw(),this.drawClosedOrders(t,this.orderToDraw)},drawClosedOrders:function(t,e){var i=this;if(e&&e.length){var o=this.$props.layout;e.forEach((function(e){var n=o.t2screen($pt(new Date(e.closedDate),i.getTimeFrame||60).getTimeWithoutUTC()),s=o.$2screen(e.closePrice),r=o.t2screen($pt(new Date(e.openDate),i.getTimeFrame||60).getTimeWithoutUTC()),a=o.$2screen(e.openPrice);i.drawTriangleOpened(t,r,a,e),i.drawTriangleClosed(t,n,s,e)}))}},drawTriangleClosed:function(t,e,i,o){this.drawClosedOrder(t,e,i,"Position_TP"===o.reason?"TP":"SL","Sell"===o.orderType?"Buy":"Sell",5,10)},drawTriangleOpened:function(t,e,i,o){this.drawClosedOrder(t,e,i,"Sell"===o.orderType?"S":"B",o.orderType,5,10)},getOrderToDraw:function(){var t=this;if(this.$props.settings.timeFrame<60)this.orderToDraw=this.closedOrdersByContract;else{var e=new Date(this.getServerTime.now).getTime(),i=e-6048e5,o=this.$props.settings.dataSet.get("chart.data")[0],n=this.$props.sub,s=n[0],r=n[n.length-1];if(Array.isArray(n)&&Array.isArray(o)&&Array.isArray(s)&&void 0!==s[0]&&Array.isArray(r)&&void 0!==r[0]&&o[s[0]]&&o[r[0]]){var a=o[s[0]][0],c=o[r[0]][0];this.orderToDraw=this.closedOrdersByContract.filter((function(o){var n=$pt(new Date(o.closedDate),t.getTimeFrame||60),s=$pt(new Date(o.openDate),t.getTimeFrame||60),r=n>=a&&n<=c||s>=a&&s<=c,l=n>=a&&n<=c&&n>=i&&n<=e||s>=a&&s<=c&&s>=i&&s<=e;if(t.getStatusHistoryClosedOrders?r:l)return o})),Zh.emit("drawClosedOrders",this.orderToDraw)}}},setMessageHendler:function(t){if(t&&t.command&&"BrokerPosition"===t.command){var e=t.data;e.contractName===this.getSymbol&&"Closed"===e.status&&(this.setClosedOrdersByContract(),this.ctx&&this.draw(this.ctx))}},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.ClosedOrders.settings",{key:new Date})},setClosedOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage(),i=e.closedOrders;this.closedOrdersByContract=i.filter((function(e){return e.contractName===t.getSymbol}))}},mounted:function(){this.setClosedOrdersByContract(),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},ext=txt,ixt=(i("1f90"),Object(C["a"])(ext,JTt,KTt,!1,null,"5b94baca",null)),oxt=ixt.exports,nxt=function(){var t=this,e=t._self._c;return e("div")},sxt=[],rxt={name:"ClosedOrders",mixins:[Opt["Overlay"],qe,ZTt],data:function(){return{orderToDraw:null,hoveredOrdersByGlobalEvent:null,closedOrdersByContract:null,mouseX:null,mouseY:null,hoverOrder:null,hoveredOrders:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getSymbol:function(){return this._props.settings.symbol}}),methods:{meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Overlay for info on closed orders"}},use_for:function(){return["ClosedOrdersInfo"]},mousemove:function(t){this.mouseX=t.layerX,this.mouseY=t.layerY},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.ClosedOrdersInfo.settings",{key:new Date})},hoverInCube:function(t,e,i,o,n,s){return n>=t&&n<=e&&s<=i&&s>=o},draw:function(t){var e=this;if(this.ctx=t,this.orderToDraw&&this.orderToDraw.length){var i=this.$props.layout;this.orderToDraw.forEach((function(o){var n=i.t2screen($pt(new Date(o.closedDate),e.getTimeFrame||60).getTimeWithoutUTC()),s=i.$2screen(o.closePrice),r=i.t2screen($pt(new Date(o.openDate),e.getTimeFrame||60).getTimeWithoutUTC()),a=i.$2screen(o.openPrice);e.hoveredOrdersByGlobalEvent&&e.drawHoveredOrderByGlobalEvent(t),e.drawHoveredOrders(t,n,s,r,a,o)}))}},drawHoveredOrderByGlobalEvent:function(t){var e=this.$props.layout,i=e.t2screen($pt(new Date(this.hoveredOrdersByGlobalEvent.closedDate),this.getTimeFrame||60).getTimeWithoutUTC()),o=e.$2screen(this.hoveredOrdersByGlobalEvent.closePrice),n=e.t2screen($pt(new Date(this.hoveredOrdersByGlobalEvent.openDate),this.getTimeFrame||60).getTimeWithoutUTC()),s=e.$2screen(this.hoveredOrdersByGlobalEvent.openPrice);this.drawLineFrom(i,o,n,s,t),this.drawClosedOrderInfo(t,i,o,this.hoveredOrdersByGlobalEvent,!1),this.drawOpenedOrderInfo(t,n,s,this.hoveredOrdersByGlobalEvent,!0),this.drawClosedOrder(t,i,o,"","Sell"===this.hoveredOrdersByGlobalEvent.orderType?"Buy":"Sell",7,14),this.drawClosedOrder(t,n,s,"",this.hoveredOrdersByGlobalEvent.orderType,7,14)},drawHoveredOrders:function(t,e,i,o,n,s){var r=s.orderType,a=this.hoverInCube(e-5,e+5,"Sell"===r?i+10:i,"Sell"===r?i:i-10,this.mouseX,this.mouseY),c=this.hoverInCube(o-5,o+5,"Sell"===r?n:n+10,"Sell"===r?n-10:n,this.mouseX,this.mouseY);if(a||c){this.hoverOrder||(this.hoverOrder=s),this.hoveredOrders.length||this.hoveredOrders.push(s);var l=this.hoveredOrders.find((function(t){return t.id===s.id}));if(l||this.hoveredOrders.push(s),this.hoverOrder=this.hoveredOrders.at(-1),this.hoverOrder.id===s.id)this.drawLineFrom(e,i,o,n,t),this.drawClosedOrderInfo(t,e,i,s,a),this.drawOpenedOrderInfo(t,o,n,s,c),this.drawClosedOrder(t,e,i,"","Sell"===s.orderType?"Buy":"Sell",7,14),this.drawClosedOrder(t,o,n,"",s.orderType,7,14);else{var u=this.hoveredOrders.find((function(t){return t.id===s.id}));u&&(this.hoveredOrders=this.hoveredOrders.filter((function(t){return t.id!==u.id})))}}},getOrdersForDraw:function(t){this.orderToDraw=t},setHoverOrderByGlobalEvent:function(t){if(t&&t.symbol===this.getSymbol){if(t.id&&this.orderToDraw&&this.orderToDraw.length){var e=this.orderToDraw.find((function(e){return e.id===t.id}));if(e||(e=this.closedOrdersByContract.find((function(e){return e.id===t.id}))),!e)return;this.hoveredOrdersByGlobalEvent=e}else this.hoveredOrdersByGlobalEvent=null;this.forceRedrawChart()}},setClosedOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage(),i=e.closedOrders;this.closedOrdersByContract=i.filter((function(e){return e.contractName===t.getSymbol}))}},mounted:function(){this.setClosedOrdersByContract(),Zh.subscribe("drawClosedOrders",this.getOrdersForDraw),Zh.subscribe("hoverClosedOrder",this.setHoverOrderByGlobalEvent)},destroyed:function(){Zh.unsubscribe("drawClosedOrders",this.getOrdersForDraw),Zh.unsubscribe("hoverClosedOrder",this.setHoverOrderByGlobalEvent)}},axt=rxt,cxt=(i("9753"),Object(C["a"])(axt,nxt,sxt,!1,null,"03651818",null)),lxt=cxt.exports,uxt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OpenOrders"})},dxt=[],hxt={methods:{checkMouseCursorOnTakeProfit:function(t,e,i,o,n){return this.hoverInCube(t,t+24,"Buy"===i?e:e+18,"Buy"===i?e-18:e,o,n)||this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===i?e:e+18,"Buy"===i?e-18:e,o,n)},checkMouseCursorOnCloseTakeProfit:function(t,e){var i=this.$props.layout,o=i.$2screen(this.hoverOrder.takeProfit),n=this.hoverOrder.orderType;return this.hoverInCube(this.ctx.canvas.clientWidth-48,this.ctx.canvas.clientWidth-24,"Buy"===n?o:o+18,"Buy"===n?o-18:o,t,e)},checkMouseCursorOnCloseStopLoss:function(t,e){var i=this.$props.layout,o=i.$2screen(this.hoverOrder.stopLoss),n=this.hoverOrder.orderType;return this.hoverInCube(this.ctx.canvas.clientWidth-48,this.ctx.canvas.clientWidth-24,"Buy"===n?o+18:o,"Buy"===n?o:o-18,t,e)},checkMouseCursorOnStopLoss:function(t,e,i,o,n){return this.hoverInCube(t,t+24,"Buy"===i?e+18:e,"Buy"===i?e:e-18,o,n)||this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===i?e+18:e,"Buy"===i?e:e-18,o,n)},changeMouseCursorOnOrderSettings:function(t,e,i){var o=[],n=t.orderType,s=t.takeProfit?t.takeProfit:t.openPrice,r=t.stopLoss?t.stopLoss:t.openPrice,a=this.$props.layout.t2screen($pt(new Date(this.hoverOrder.openDate),this.getTimeFrame||60).getTimeWithoutUTC()),c=this.$props.layout.$2screen(s),l=this.$props.layout.$2screen(r);if(this.checkMouseCursorOnTakeProfit(a,c,n,e,i)&&o.push("TakeProfit"),this.checkMouseCursorOnStopLoss(a,l,n,e,i)&&o.push("StopLoss"),t.trailingStart){var u=t.trailingStart,d=t.trailingSL,h=this.$props.layout.$2screen("Buy"===n?t.openPrice+u/Ph(this.getPrecision):t.openPrice-u/Ph(this.getPrecision)),p=this.$props.layout.$2screen("Buy"===n?t.openPrice+d/Ph(this.getPrecision):t.openPrice-d/Ph(this.getPrecision)),g=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===n?h:h+18,"Buy"===n?h-18:h,e,i),f=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===n?p:p+18,"Buy"===n?p-18:p,e,i);g&&o.push("TrailingStart"),f&&o.push("TrailingSL")}return o},clearRedactSetting:function(){this.changeTPorderStatus=!1,this.changeSLorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1,this.fantomTP=0,this.fantomSL=0,this.fantomTSL=0,this.fantomStartTSL=0},mousedown:function(t){if(this.start=(new Date).getTime(),this.redactOrderStatus){var e=this.changeMouseCursorOnOrderSettings(this.hoverOrder,t.layerX,t.layerY);this.changeTPorderStatus=!!e.length&&e.some((function(t){return"TakeProfit"===t})),this.changeSLorderStatus=!!e.length&&e.some((function(t){return"StopLoss"===t})),this.hoverOrder.trailingStart&&(this.changeStratTSLorderStatus=!!e.length&&e.some((function(t){return"TrailingStart"===t})),this.changeTSLorderStatus=!!e.length&&e.some((function(t){return"TrailingSL"===t}))),this.getChangeSLorTPonChart&&this.stopChart(!0)}},mouseup:function(t){if((new Date).getTime()-this.start<270){if(this.getChangeSLorTPonChart&&(this.stopChart(!1),this.changeSLorderStatus=!1,this.changeTPorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1),!this.hoverOrder||this.hoverOrder.subscriptionId)return void(this.redactOrderStatus=!1);var e=this.checkClickOrder(t.layerX,t.layerY,"order"),i=this.checkClickOrder(t.layerX,t.layerY,"settings"),o=!!this.redactOrderStatus&&this.checkMouseCursorOnCloseStopLoss(t.layerX,t.layerY),n=!!this.redactOrderStatus&&this.checkMouseCursorOnCloseTakeProfit(t.layerX,t.layerY);if(o){var s=structuredClone(this.hoverOrder);s.stopLoss=0,this.modifyOrder(s)}if(n){var r=structuredClone(this.hoverOrder);r.takeProfit=0,this.modifyOrder(r)}if(e){if(this.redactOrderStatus)return;this.$props.settings.storageActiveObjectsChart.setActiveObject({name:"OpenOrder",rang:1,data:this.hoverOrder}),this.redactOrderStatus=!0}else i?this.openSettingModal():e||i||this.statusOpenSettingModal||o||n||(this.fantomSL=0,this.fantomTP=0,this.fantomStartTSL=0,this.fantomTSL=0,this.redactOrderStatus=!1,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"OpenOrder"}))}else if(this.redactOrderStatus&&this.getChangeSLorTPonChart&&(this.fantomTP||this.fantomSL||this.fantomStartTSL||this.fantomTSL)){var a=structuredClone(this.hoverOrder);this.fantomTP&&(a.takeProfit=this.fantomTP),this.fantomSL&&(a.stopLoss=this.fantomSL),this.fantomStartTSL&&(a.trailingStart=this.fantomStartTSL),this.fantomTSL&&(a.trailingSL=this.fantomTSL),this.modifyOrder(a),this.clearRedactSetting(),this.stopChart(!1)}else this.statusOpenSettingModal||this.clearRedactSetting()},mouseout:function(){this.statusOpenSettingModal||(this.changeTPorderStatus=!1,this.changeSLorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1,this.fantomTP=0,this.fantomSL=0,this.fantomTSL=0,this.fantomStartTSL=0,this.stopChart(!1))},mousemove:function(t){var e=this.$props.layout;if(this.mouseX=t.layerX,this.mouseY=t.layerY,this.hoverOrder){var i=this.changeMouseCursorOnOrderSettings(this.hoverOrder,this.mouseX,this.mouseY),o=this.checkMouseCursorOnCloseStopLoss(this.mouseX,this.mouseY),n=this.checkMouseCursorOnCloseTakeProfit(t.layerX,t.layerY);this.redactOrderStatus?!i.length||o||n?i.length||!o&&!n?i.length||o||n||this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:null}):this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:"hover"}):this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:"move"}):this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:"hover"})}else this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:null});if(this.getChangeSLorTPonChart){var s=this.hoverOrder.orderType;if(this.changeTPorderStatus){var r=+e.screen2$(t.layerY).toFixed(this.getPrecision),a="Buy"===s?r>=this.hoverOrder.openPrice:r<=this.hoverOrder.openPrice;a&&(this.fantomTP=r)}if(this.changeSLorderStatus){var c=+e.screen2$(t.layerY).toFixed(this.getPrecision);this.fantomSL=c}if(this.changeStratTSLorderStatus){var l=+e.screen2$(t.layerY).toFixed(this.getPrecision),u="Buy"===s?l>=this.hoverOrder.openPrice:l<=this.hoverOrder.openPrice;if(u){var d="Buy"===s?Math.round((l-this.hoverOrder.openPrice)*Ph(this.getPrecision)):Math.round((this.hoverOrder.openPrice-l)*Ph(this.getPrecision));this.fantomStartTSL=d}}if(this.changeTSLorderStatus){var h=+e.screen2$(t.layerY).toFixed(this.getPrecision),p="Buy"===s?h>=this.hoverOrder.openPrice:h<=this.hoverOrder.openPrice;if(p){var g="Buy"===s?Math.round((h-this.hoverOrder.openPrice)*Ph(this.getPrecision)):Math.round((this.hoverOrder.openPrice-h)*Ph(this.getPrecision));this.fantomTSL=g}}}}}},pxt="M10.7879 19.9502H13.2079C13.4424 19.9462 13.6681 19.8599 13.8454 19.7063C14.0227 19.5528 14.1404 19.3418 14.1779 19.1102L14.5979 17.1102H14.6879C14.8979 17.0102 15.0979 16.9002 15.2979 16.7802L15.3979 16.7102L17.4879 17.3802C17.7015 17.4491 17.932 17.4441 18.1424 17.3662C18.3528 17.2882 18.5308 17.1417 18.6479 16.9502L19.8479 14.9502C19.9619 14.7454 20.0004 14.507 19.9565 14.2767C19.9127 14.0464 19.7893 13.8388 19.6079 13.6902L17.9979 12.3502V12.2802V11.9502V11.6102V11.5502L19.6379 10.2402C19.8218 10.0862 19.9443 9.87112 19.9828 9.6343C20.0214 9.39748 19.9735 9.1547 19.8479 8.95025L18.6479 6.95025C18.534 6.77107 18.3659 6.63282 18.1682 6.55551C17.9704 6.4782 17.7532 6.46585 17.5479 6.52025L15.4579 7.19025L15.3579 7.12025C15.1579 7.00025 14.9579 6.89025 14.7479 6.79025H14.6579L14.2379 4.79025C14.1891 4.56282 14.0626 4.35951 13.88 4.21532C13.6975 4.07113 13.4704 3.99507 13.2379 4.00025H10.8179C10.5854 3.99507 10.3583 4.07113 10.1758 4.21532C9.99324 4.35951 9.86669 4.56282 9.8179 4.79025L9.3979 6.79025H9.3079C9.0979 6.89025 8.8979 7.00025 8.6979 7.12025L8.5979 7.19025L6.5079 6.52025C6.29434 6.45138 6.06383 6.45635 5.85343 6.53434C5.64303 6.61233 5.46498 6.75882 5.3479 6.95025L4.1479 8.95025C4.03045 9.15179 3.98715 9.38805 4.0255 9.61815C4.06385 9.84824 4.18143 10.0577 4.3579 10.2102L5.9979 11.5502V11.6202V11.9502V12.2902V12.3502L4.3579 13.6602C4.17396 13.8143 4.05155 14.0294 4.013 14.2662C3.97444 14.503 4.02232 14.7458 4.1479 14.9502L5.3479 16.9502C5.45609 17.1445 5.62593 17.2971 5.83057 17.3841C6.03521 17.471 6.26299 17.4872 6.4779 17.4302L8.5579 16.7602L8.6779 16.8302C8.87118 16.952 9.07153 17.0622 9.2779 17.1602H9.3679L9.7879 19.1602C9.83669 19.3877 9.96324 19.591 10.1458 19.7352C10.3283 19.8794 10.5554 19.9554 10.7879 19.9502ZM12.3879 17.9502H11.6079L11.2479 16.2702C11.2165 16.119 11.1505 15.9771 11.0551 15.8557C10.9597 15.7342 10.8374 15.6365 10.6979 15.5702L10.1679 15.3102C10.0251 15.249 9.88791 15.1754 9.7579 15.0902L9.2579 14.7802C9.13496 14.7047 8.99713 14.6566 8.85385 14.6394C8.71058 14.6221 8.56527 14.636 8.4279 14.6802L6.6479 15.2502L6.2979 14.6802L7.6379 13.5602C7.75892 13.4599 7.85458 13.3325 7.91713 13.1883C7.97968 13.0441 8.00735 12.8872 7.9979 12.7302V12.1802C7.99292 12.1037 7.99292 12.0268 7.9979 11.9502C7.99269 11.877 7.99269 11.8035 7.9979 11.7302V11.1702C8.00735 11.0133 7.97968 10.8564 7.91713 10.7122C7.85458 10.568 7.75892 10.4406 7.6379 10.3402L6.2979 9.22025L6.6479 8.65025L8.4279 9.22025C8.56527 9.26445 8.71058 9.2784 8.85385 9.26114C8.99713 9.24388 9.13496 9.19582 9.2579 9.12025L9.7579 8.81025L10.1679 8.58025L10.6979 8.33025C10.8374 8.26397 10.9597 8.16627 11.0551 8.04483C11.1505 7.92338 11.2165 7.78148 11.2479 7.63025L11.6079 5.95025H12.3879L12.7479 7.63025C12.7793 7.78148 12.8453 7.92338 12.9407 8.04483C13.0361 8.16627 13.1584 8.26397 13.2979 8.33025L13.8279 8.58025L14.2379 8.81025L14.7379 9.12025C14.8608 9.19582 14.9987 9.24388 15.142 9.26114C15.2852 9.2784 15.4305 9.26445 15.5679 9.22025L17.3479 8.65025L17.6979 9.22025L16.3579 10.3402C16.2369 10.4406 16.1412 10.568 16.0787 10.7122C16.0161 10.8564 15.9885 11.0133 15.9979 11.1702V11.7202C16.0029 11.7968 16.0029 11.8737 15.9979 11.9502C16.0031 12.0235 16.0031 12.097 15.9979 12.1702V12.7302C15.9885 12.8872 16.0161 13.0441 16.0787 13.1883C16.1412 13.3325 16.2369 13.4599 16.3579 13.5602L17.6979 14.6802L17.3479 15.2502L15.5679 14.6802C15.4305 14.636 15.2852 14.6221 15.142 14.6394C14.9987 14.6566 14.8608 14.7047 14.7379 14.7802L14.2479 15.0902C14.1133 15.1734 13.9729 15.2469 13.8279 15.3102L13.2979 15.5702C13.1584 15.6365 13.0361 15.7342 12.9407 15.8557C12.8453 15.9771 12.7793 16.119 12.7479 16.2702L12.3879 17.9502ZM13.9979 11.9503C13.9979 13.0548 13.1025 13.9503 11.9979 13.9503C10.8933 13.9503 9.99789 13.0548 9.99789 11.9503C9.99789 10.8457 10.8933 9.95026 11.9979 9.95026C13.1025 9.95026 13.9979 10.8457 13.9979 11.9503Z",gxt="M5 3.5L5 2.5L4 2.5L4 3.5L5 3.5ZM5 5.5L5 4.5L4 4.5L4 5.5L5 5.5ZM3 4.5L3 5.5L2 5.5L2 4.5L3 4.5ZM3 3.5L3 2.5L2 2.5L2 3.5L3 3.5ZM1 2.5L1 3.5L1.19249e-08 3.5L0 2.5L1 2.5ZM5 7.5L5 6.5L4 6.5L4 7.5L5 7.5Z",fxt="M4 5.5L5 5.5L5 4.5L4 4.5L4 5.5ZM2 5.5L3 5.5L3 4.5L2 4.5L2 5.5ZM3 3.5L2 3.5L2 2.5L3 2.5L3 3.5ZM4 3.5L5 3.5L5 2.5L4 2.5L4 3.5ZM5 1.5L4 1.5L4 0.5L5 0.5L5 1.5ZM0 5.5L1 5.5L1 4.5L8.74228e-08 4.5L0 5.5Z",mxt="M17.3 8.1a.99.99 0 1 0-1.4-1.4L12 10.6 8.1 6.7a.99.99 0 1 0-1.4 1.4l3.9 3.9-3.9 3.9a.99.99 0 1 0 1.4 1.4l3.9-3.9 3.9 3.9a.99.99 0 1 0 1.4-1.4L13.4 12l3.9-3.9z",vxt={methods:{drawOpenOrders:function(t,e){var i=this,o=this.$props.layout;e.forEach((function(e){var n=o.t2screen($pt(new Date(e.openDate),i.getTimeFrame||60).getTimeWithoutUTC()),s=o.$2screen(e.openPrice);i.drawOpenOrder(t,n,s,12,e.orderType)})),this.redactOrderStatus?this.drawRedactOrder(t,o):(this.hoverOrderByEvent&&this.drawHoverOrderByEvent(t,o),e.forEach((function(e){var n=o.t2screen($pt(new Date(e.openDate),i.getTimeFrame||60).getTimeWithoutUTC()),s=o.$2screen(e.openPrice);i.drawHoveredOrders(t,n,s,e)})))},drawOpenOrder:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:12,n=arguments.length>4?arguments[4]:void 0,s="dark"===this.getActiveTheme?this.getGreenColor.color:"green",r="dark"===this.getActiveTheme?"#EE204D":"red",a="dark"===this.getActiveTheme?"#000":"#fff";t.save(),t.beginPath(),t.moveTo(e,i),t.lineTo(e-o/2,"Buy"===n?i+o:i-o),t.lineTo(e+o/2,"Buy"===n?i+o:i-o),t.lineTo(e,i),t.fillStyle="Buy"===n?s:r,t.lineWidth=1,t.strokeStyle=a,t.fill(),t.stroke(),t.restore()},drawHoverOrderByEvent:function(t,e){var i=e.t2screen($pt(new Date(this.hoverOrderByEvent.openDate),this.getTimeFrame||60).getTimeWithoutUTC()),o=e.$2screen(this.hoverOrderByEvent.openPrice);this.shader.draw(this.getActiveTheme),this.hoverOrderByEvent.subscriptionId||(this.drawTakeProfit(t,i,o,this.hoverOrderByEvent),this.drawStopLoss(t,i,o,this.hoverOrderByEvent),this.drawTrailingSL(t,i,o,this.hoverOrderByEvent)),this.drawPriceLine(t,i,o,this.hoverOrderByEvent),this.drawOpenedOrderInfo(t,i,o,this.hoverOrderByEvent),this.drawOpenOrder(t,i,o,16,this.hoverOrderByEvent.orderType)},drawHoveredOrders:function(t,e,i,o){this.isHover=this.hoverInCube(e-6,e+6,"Sell"===o.orderType?i:i+12,"Sell"===o.orderType?i-12:i,this.mouseX,this.mouseY);var n=!1;if(this.hoveredOrders.length&&(n=this.hoverInCube(e-24,e+6,"Sell"===o.orderType?i+6:i+12,"Sell"===o.orderType?i-12:i-6,this.mouseX,this.mouseY)),this.isHover||n){this.hoverOrder||(this.hoverOrder=o),this.hoveredOrders.length||this.hoveredOrders.push(o);var s=this.hoveredOrders.find((function(t){return t.id===o.id}));s||this.hoveredOrders.push(o),this.hoverOrder=this.hoveredOrders.at(-1),this.hoverOrder.id===o.id&&(this.shader.draw(this.getActiveTheme),o.subscriptionId||(this.drawTakeProfit(t,e,i,this.hoverOrder),this.drawStopLoss(t,e,i,this.hoverOrder),this.drawTrailingSL(t,e,i,this.hoverOrder)),this.drawPriceLine(t,e,i,this.hoverOrder),this.drawOpenedOrderInfo(t,e,i,this.hoverOrder),this.drawOpenOrder(t,e,i,16,this.hoverOrder.orderType))}else{var r=this.hoveredOrders.find((function(t){return t.id===o.id}));r&&(this.hoveredOrders=this.hoveredOrders.filter((function(t){return t.id!==r.id})))}this.hoveredOrders.length||(this.hoverOrder=null,this.$props.settings.eventBus.emit("mouseEvent",{name:"OpenOrders",event:null}),this.shader.draw(this.getActiveTheme))},drawPorviderAvatar:function(t,e,i,o){var n=new Image(15,15);n.src=o,t.save(),t.beginPath(),t.arc(e+10,i+10,10,0,2*Math.PI),t.clip(),t.drawImage(n,e,i,20,20),t.restore()},drawSettingsIcon:function(t,e,i){t.save();var o=new Path2D(pxt);t.translate(e-12,i-12),t.fillStyle=this.getBlueColor.color,t.fill(o),t.restore()},drawOpenedOrderInfo:function(t,e,i,o){var n,s=98,r="Sell"===o.orderType?i-12:i-83-3,a=e-8,c=o.subscriptionId?o.sourceUserAvatar:o.userAvatar,l=o.orderType.toUpperCase();if(this.updatedOrders){var u=this.updatedOrders.find((function(t){return t.id===o.id}));u&&(n=u.profit)}else n=o.profit;var d=this.$props.meta.last?this.$props.meta.last.at(-1):0,h=this.getCryptoStatus?100*n/(d*o.volume):100*n/o.volume,p="$ ".concat(this.$moneyf(n,2)," ").concat(this.$moneyf(h,Math.abs(h)<.01?3:2)," %"),g=new Date(o.openDate).toLocaleString("ru"),f="".concat(l," ").concat(this.$moneyf(o.volume)),m="".concat(o.openPrice),v=o.subscriptionId?"".concat(o.sourceUserName):"".concat(o.userName);t.font="400 12px Arial";var y=t.measureText(g).width,C=t.measureText(v).width+24,b=t.measureText(p).width,S=[y,C,b],P=Math.max.apply(null,S)+24;t.save(),t.beginPath(),t.textAlign="left",t.rect(a-P-8,r,P+8,s),t.fillStyle="dark"===this.getActiveTheme?"#4c5b6b":"#fff",t.strokeStyle="dark"===this.getActiveTheme?"#333":"#e4e4e4",t.fill(),t.stroke(),this.drawPorviderAvatar(t,a-P-4,r+4,c),t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#bbcee0":"#333",t.fillText(v,a-P+20,r+18),t.fillText("OPEN",a-P-4,r+14+24),t.fillText(g,a-P-4,r+28+24),t.fill(),t.beginPath(),t.fillStyle="Sell"===o.orderType?this.getRedColor.color:this.getGreenColor.color,t.fillText(f,a-P-4,r+42+24),t.fillText(m,a-P-4,r+56+24),t.fill(),t.beginPath(),t.fillStyle=n<0?this.getRedColor.color:this.getGreenColor.color,t.fillText(p,a-P-4,r+70+24),t.fill(),t.restore(),o.subscriptionId||this.drawSettingsIcon(t,e-18,"Buy"===o.orderType?i+2:i-2)},drawPriceLine:function(t,e,i,o){var n=o.orderType;t.beginPath(),t.strokeStyle="Sell"===n?"#EE204D":this.getGreenColor.color,t.moveTo(e,i),t.lineTo(t.canvas.clientWidth,i),t.stroke()},drawRedactOrder:function(t,e){var i=e.t2screen($pt(new Date(this.hoverOrder.openDate),this.getTimeFrame||60).getTimeWithoutUTC()),o=e.$2screen(this.hoverOrder.openPrice);if(this.drawTakeProfit(t,i,o,this.hoverOrder,"redact"),this.drawStopLoss(t,i,o,this.hoverOrder,"redact"),this.drawTrailingSL(t,i,o,this.hoverOrder),this.drawPriceLine(t,i,o,this.hoverOrder),this.drawOpenedOrderInfo(t,i,o,this.hoverOrder),this.fantomTP&&this.drawWithRangeZone(t,i,o,this.fantomTP,"dark"===this.getActiveTheme?"#fafafa":"#808080","dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","TP",!0,"Buy"===this.hoverOrder.orderType?"up":"down","fantom"),this.fantomSL&&this.drawWithRangeZone(t,i,o,this.fantomSL,"dark"===this.getActiveTheme?"#fafafa":"#808080","dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","SL",!0,"Buy"===this.hoverOrder.orderType?"down":"up","fantom"),this.fantomStartTSL){var n=this.hoverOrder.orderType,s="Buy"===n?+(this.hoverOrder.openPrice+this.fantomStartTSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.hoverOrder.openPrice-this.fantomStartTSL/Ph(this.getPrecision)).toFixed(this.getPrecision),r="Buy"===n?+(this.hoverOrder.openPrice+this.hoverOrder.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.hoverOrder.openPrice-this.hoverOrder.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision);this.drawWithRangeZoneOnSacle(t,i,o,s,"dark"===this.getActiveTheme?"#fafafa":"#808080","dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","TS",!0,"Buy"===n?"up":"down","START ".concat(s," (").concat(this.fantomStartTSL,")"),r)}if(this.fantomTSL){var a=this.hoverOrder.orderType,c="Buy"===a?+(this.hoverOrder.openPrice+this.fantomTSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.hoverOrder.openPrice-this.fantomTSL/Ph(this.getPrecision)).toFixed(this.getPrecision);this.drawWithRangeZoneOnSacle(t,i,o,c,"dark"===this.getActiveTheme?"#fafafa":"#808080","dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","TS",!1,"Buy"===a?"up":"down","SL ".concat(c," (").concat(this.fantomTSL,")"),null)}},drawTrailingSL:function(t,e,i,o){if(o.trailingStart){var n=o.orderType,s="Buy"===n?+(o.openPrice+o.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision):+(o.openPrice-o.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision),r="Buy"===n?+(o.openPrice+o.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(o.openPrice-o.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision);this.drawWithRangeZoneOnSacle(t,e,i,s,this.getBlueColor.color,this.getBlueColor.fill,"TS",!0,"Buy"===n?"up":"down","START ".concat(s," (").concat(o.trailingStart,")"),r),this.drawWithRangeZoneOnSacle(t,e,i,r,this.getBlueColor.color,this.getBlueColor.fill,"TS",!1,"Buy"===n?"up":"down","SL ".concat(r," (").concat(o.trailingSL,")"),null)}},drawStopLoss:function(t,e,i,o,n){var s=o.orderType;"Sell"===s?o.stopLoss?this.drawWithRangeZone(t,e,i,o.stopLoss,"#EE204D","rgba(238,32,77, 0.05)","SL",!0,"up"):"redact"===n&&this.drawWithRangeZone(t,e,i,i-1,"#EE204D",this.getRedColor.fill,"SL",!1,"up"):o.stopLoss?this.drawWithRangeZone(t,e,i,o.stopLoss,"#EE204D","rgba(238,32,77, 0.05)","SL",!0,"down"):"redact"===n&&this.drawWithRangeZone(t,e,i,i+1,"#EE204D",this.getRedColor.fill,"SL",!1,"down")},drawTakeProfit:function(t,e,i,o,n){var s=o.orderType;"Sell"===s?o.takeProfit?this.drawWithRangeZone(t,e,i,o.takeProfit,"dark"===this.getActiveTheme?this.getGreenColor.color:"green","light"===this.getActiveTheme?"rgba(0, 142, 114, 0.03)":"rgba(0, 255, 172, 0.03)","TP",!0,"down"):"redact"===n&&this.drawWithRangeZone(t,e,i,i+1,"dark"===this.getActiveTheme?this.getGreenColor.color:"green",this.getGreenColor.fill,"TP",!1,"down"):o.takeProfit?this.drawWithRangeZone(t,e,i,o.takeProfit,"dark"===this.getActiveTheme?this.getGreenColor.color:"green","light"===this.getActiveTheme?"rgba(0, 142, 114, 0.03)":"rgba(0, 255, 172, 0.03)","TP",!0,"up"):"redact"===n&&this.drawWithRangeZone(t,e,i,i-1,"dark"===this.getActiveTheme?this.getGreenColor.color:"green",this.getGreenColor.fill,"TP",!1,"up")},drawWithRangeZoneOnSacle:function(t,e,i,o,n,s,r,a,c,l,u){var d=this.$props.layout,h=d.$2screen(o);if(t.beginPath(),t.strokeStyle=n,t.moveTo(t.canvas.clientWidth,i),t.lineTo(t.canvas.clientWidth,"down"===c?h+18:h-18),t.stroke(),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?h:h-18,24,18),t.fill(),a){var p=d.$2screen(u);t.beginPath(),t.fillStyle=s,t.moveTo(e+1,p),t.lineTo(t.canvas.clientWidth,p),t.lineTo(t.canvas.clientWidth,"down"===c?h-1:h+1),t.lineTo(e+1,"down"===c?h-1:h+1),t.fill()}t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",t.fillText(r,t.canvas.clientWidth-22,"down"===c?h+14:h-8),t.restore(),t.fill(),t.save(),t.beginPath(),t.fillStyle=n,t.font="400 9px Arial",t.textAlign="left";var g=t.measureText(l).width;if(t.fillText(l,t.canvas.clientWidth-28-g,"down"===c?h+7:h),t.fill(),t.beginPath(),t.setLineDash([2,2]),t.moveTo(e,h),t.lineTo(t.canvas.clientWidth-g-32,h),t.stroke(),t.restore(),this.redactOrderStatus){t.save();var f=new Path2D("down"===c?fxt:gxt);t.translate(t.canvas.clientWidth-7,"down"===c?h+11:h-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(f),t.restore()}},drawWithRangeZone:function(t,e,i,o,n,s,r,a,c,l){var u=this.$props.layout,d=a?u.$2screen(o):o,h=t.measureText(o).width;if(a&&(t.beginPath(),t.strokeStyle=n,t.moveTo(e,i),t.lineTo(e,"down"===c?d+18:d-18),t.stroke()),t.beginPath(),t.fillStyle=n,t.rect(e,"down"===c?d:d-18,24,18),t.fill(),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?d:d-18,24,18),t.fill(),a&&(t.beginPath(),t.fillStyle=s,t.moveTo(e+1,i+1),t.lineTo(t.canvas.clientWidth,i+1),t.lineTo(t.canvas.clientWidth,"down"===c?d-1:d+1),t.lineTo(e+1,"down"===c?d-1:d+1),t.fill()),t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",t.fillText(r,e+2,"down"===c?d+14:d-8),t.fillText(r,t.canvas.clientWidth-22,"down"===c?d+14:d-8),t.restore(),t.fill(),a&&(t.save(),t.beginPath(),t.textAlign="left",t.fillStyle=n,t.font="400 9px Arial",t.fillText(o,e+28,"down"===c?d+7:d),t.fill(),t.beginPath(),t.setLineDash([2,2]),t.moveTo(e+h+25+4,d),t.lineTo(t.canvas.clientWidth-24,d),t.stroke(),t.restore()),this.redactOrderStatus){var p=new Path2D("down"===c?fxt:gxt),g=new Path2D(mxt);a&&"fantom"!==l&&(t.save(),t.translate(t.canvas.clientWidth-45,"down"===c?d-2:d-21),t.fillStyle="TP"===r?this.getGreenColor.color:this.getRedColor.color,t.fill(g),t.restore()),t.save(),t.translate(e+17,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(p),t.restore(),t.save(),t.translate(t.canvas.clientWidth-7,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(p),t.restore()}}}},yxt=function(){function t(e){Object(Qh["a"])(this,t),this.chartComponent=e,this.shader=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.chartComponent.$props.layout;this.chartComponent.$emit("new-shader",{target:"sidebar",draw:function(i){if(t.chartComponent.hoverOrder||t.chartComponent.hoverOrderByEvent){var o=t.chartComponent.hoverOrder?t.chartComponent.hoverOrder:t.chartComponent.hoverOrderByEvent;t.drawPriceOrder(i,o,e),o.stopLoss&&t.drawScaleIndicator(i,o,e,"#EE204D","#fff","light"===t.chartComponent.getActiveTheme?"rgba(233, 18, 18, 0.1)":"rgba(250, 76, 74, 0.1)","Sell"===o.orderType?"up":"down",o.stopLoss),o.takeProfit&&t.drawScaleIndicator(i,o,e,"dark"===t.chartComponent.getActiveTheme?"#00ffac":"green","dark"===t.chartComponent.getActiveTheme?"#333":"#fff","light"===t.chartComponent.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)","Sell"===o.orderType?"down":"up",o.takeProfit),o.trailingStart&&(t.drawScaleIndicator(i,o,e,"light"===t.chartComponent.getActiveTheme?"#2462db":"#00b9fc","dark"===t.chartComponent.getActiveTheme?"#333":"#fff","light"===t.chartComponent.getActiveTheme?"rgba(36, 98, 219, 0.1)":"rgba(0, 185, 252, 0.1)","Sell"===o.orderType?"down":"up","Buy"===o.orderType?+(o.openPrice+o.trailingStart/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision):+(o.openPrice-o.trailingStart/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision)),t.drawScaleIndicator(i,o,e,"light"===t.chartComponent.getActiveTheme?"#2462db":"#00b9fc","dark"===t.chartComponent.getActiveTheme?"#333":"#fff","light"===t.chartComponent.getActiveTheme?"rgba(36, 98, 219, 0.1)":"rgba(0, 185, 252, 0.1)","Sell"===o.orderType?"down":"up","Buy"===o.orderType?+(o.openPrice+o.trailingSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision):+(o.openPrice-o.trailingSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision))),t.chartComponent.fantomSL&&t.drawScaleIndicator(i,o,e,"dark"===t.chartComponent.getActiveTheme?"#fafafa":"#808080","#333","dark"===t.chartComponent.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","Sell"===o.orderType?"up":"down",t.chartComponent.fantomSL),t.chartComponent.fantomTP&&t.drawScaleIndicator(i,o,e,"dark"===t.chartComponent.getActiveTheme?"#fafafa":"#808080","#333","dark"===t.chartComponent.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","Sell"===o.orderType?"down":"up",t.chartComponent.fantomTP),t.chartComponent.fantomStartTSL&&t.drawScaleIndicator(i,o,e,"dark"===t.chartComponent.getActiveTheme?"#fafafa":"#808080","#333","dark"===t.chartComponent.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","Sell"===o.orderType?"down":"up","Buy"===o.orderType?+(o.openPrice+t.chartComponent.fantomStartTSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision):+(o.openPrice-t.chartComponent.fantomStartTSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision)),t.chartComponent.fantomTSL&&t.drawScaleIndicator(i,o,e,"dark"===t.chartComponent.getActiveTheme?"#fafafa":"#808080","#333","dark"===t.chartComponent.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(128,128,128,0.1)","Sell"===o.orderType?"down":"up","Buy"===o.orderType?+(o.openPrice+t.chartComponent.fantomTSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision):+(o.openPrice-t.chartComponent.fantomTSL/Ph(t.chartComponent.getPrecision)).toFixed(t.chartComponent.getPrecision))}}}),this.shader=!0}},{key:"getProfit",value:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=n[o]().toFixed(2);return+s}},{key:"drawScaleIndicator",value:function(t,e,i,o,n,s,r,a){var c=i.$2screen(a),l=this.getProfit(e.openPrice,a,e.volume,e.orderType);t.beginPath(),t.fillStyle=o,t.rect(0,c-9,t.canvas.clientWidth,18),t.fill(),t.save(),t.font="400 11px Arial",t.textAlign="center",t.beginPath(),t.fillStyle=n,t.fillText(a,t.canvas.clientWidth/2,c+4),t.restore(),t.beginPath(),t.fillStyle="dark"===this.chartComponent.getActiveTheme?"#151924":"#fff",t.rect(1,"up"===r?c-27:c+9,t.canvas.clientWidth-1,18),t.fill(),t.beginPath(),t.fillStyle=s,t.strokeStyle=o,t.rect(1,"up"===r?c-27:c+9,t.canvas.clientWidth-1,18),t.fill(),t.stroke(),t.save(),t.font="400 11px Arial",t.textAlign="center",t.beginPath(),t.fillStyle=o,t.fillText("$ ".concat(l),t.canvas.clientWidth/2,"up"===r?c-15:c+22,t.canvas.clientWidth-2),t.restore()}},{key:"drawPriceOrder",value:function(t,e,i){var o=i.$2screen(e.openPrice),n="Sell"===e.orderType?"#EE204D":"dark"===this.chartComponent.getActiveTheme?"#00ffac":"green",s="Buy"===e.orderType&&"dark"===this.chartComponent.getActiveTheme?"#000":"#fff";t.beginPath(),t.fillStyle=n,t.rect(1,o-9,t.canvas.clientWidth,18),t.fill(),t.save(),t.textBaseline="middle",t.font="400 11px Arial",t.beginPath(),t.fillStyle=s,t.fillText(e.openPrice,6,o),t.restore()}},{key:"draw",value:function(){this.shader||this.init_shader()}},{key:"last_bar",value:function(){var t=this.chartComponent.$props.layout,e=this.chartComponent.$props.meta.last,i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}},{key:"last_price",value:function(){return this.chartComponent.$props.meta.last?this.chartComponent.$props.meta.last[4]:void 0}}]),t}(),Cxt={mixins:[Opt["Overlay"],qe,vxt,hxt],data:function(){return{mouseX:null,start:0,mouseY:null,openOrdersByContract:[],hoveredOrders:[],hoverOrder:null,orderToDraw:null,updatedOrders:null,redactOrderStatus:!1,fantomTP:0,fantomSL:0,fantomStartTSL:0,fantomTSL:0,changeTPorderStatus:!1,changeSLorderStatus:!1,changeStratTSLorderStatus:!1,changeTSLorderStatus:!1,statusOpenSettingModal:!1,shader:null,isHover:!1}},watch:{getVisibleSettingOrderModal:function(t){t||(this.fantomSL||this.fantomTP)&&(this.fantomSL=0,this.fantomTP=0,this.forceRedrawChart())},getDefaultAccount:function(){this.openOrdersByContract=[],this.forceRedrawChart()},getStatByOrders:function(t){t&&(this.setOpenOrdersByContract(),this.forceRedrawChart())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getNewOrderModal:"modal/getNewOrderModal",getContracts:"contracts/getContracts",getSession:"auth/getSession"})),{},{getCryptoStatus:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).executionGroup;return"Crypto"===e},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).precision;return e},getChangeSLorTPonChart:function(){return this.changeTPorderStatus||this.changeSLorderStatus||this.changeStratTSLorderStatus||this.changeTSLorderStatus},getSymbol:function(){return this._props.settings.symbol},getVisibleSettingOrderModal:function(){return this.getNewOrderModal.status},getTimeFrame:function(){return this._props.settings.timeFrame}}),methods:{init:function(){this.shader=new yxt(this)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Trades overlay open orders"}},use_for:function(){return["OpenOrders"]},draw:function(t){this.ctx=t,this.getOrderToDraw(),this.drawOpenOrders(t,this.orderToDraw)},modifyOrder:function(t){var e={Command:"ModifyTradingOrder",data:t,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e})},checkClickOrder:function(t,e,i){var o=this.$props.layout,n=o.t2screen($pt(new Date(this.hoverOrder.openDate),this.getTimeFrame||60).getTimeWithoutUTC()),s=o.$2screen(this.hoverOrder.openPrice);return"order"===i?this.hoverInCube(n-10,n+10,"Sell"===this.hoverOrder.orderType?s:s+20,"Sell"===this.hoverOrder.orderType?s-20:s,t,e):this.hoverInCube(n-30,n+15,"Sell"===this.hoverOrder.orderType?s+6:s+20,"Sell"===this.hoverOrder.orderType?s-10:s,t,e)},getOrderToDraw:function(){var t=this;if(this.$props.settings.timeFrame<60)this.orderToDraw=this.openOrdersByContract;else{var e=this.$props.settings.dataSet.get("chart.data")[0],i=this.$props.sub,o=i[0],n=i[i.length-1];if(Array.isArray(i)&&Array.isArray(e)&&Array.isArray(o)&&void 0!==o[0]&&Array.isArray(n)&&void 0!==n[0]&&e[o[0]]&&e[n[0]]){var s=e[o[0]][0],r=e[n[0]][0];this.orderToDraw=this.openOrdersByContract.filter((function(e){var i=$pt(new Date(e.openDate),t.getTimeFrame||60);if(i>=s&&i<=r)return e}))}}},setOpenOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage(),i=e.tradingOrders;this.openOrdersByContract=i.filter((function(e){return e.contractName===t.getSymbol}))},hoverInCube:function(t,e,i,o,n,s){return n>=t&&n<=e&&s<=i&&s>=o},setFantomTPorSL:function(t){this.redactOrderStatus&&this.hoverOrder&&t&&t.length&&this.hoverOrder.id===t[0].id&&(this.fantomTP=t[0].takeProfit&&t[0].takeProfit!==this.hoverOrder.takeProfit?t[0].takeProfit:0,this.fantomSL=t[0].stopLoss&&t[0].stopLoss!==this.hoverOrder.stopLoss?t[0].stopLoss:0,this.forceRedrawChart())},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.OpenOrders.settings",{key:new Date})},stopChart:function(t){this._$emit("custom-event",{event:"scroll-lock",args:[t]})},setMessageHendler:function(t){if(t&&t.command&&"BrokerPosition"===t.command){var e=t.data;e.contractName!==this.getSymbol||"Opened"!==e.status&&"Closed"!==e.status||(this.setOpenOrdersByContract(),this.hoverOrder&&("Closed"===e.status&&e.id===this.hoverOrder.id&&(this.redactOrderStatus=!1,this.hoverOrder=null,this.fantomTP=0,this.fantomSL=0,this.fantomStartTSL=0,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"OpenOrder"})),"Position_Modify"===e.reason&&this.hoverOrder&&this.hoverOrder.id===e.id&&(this.hoverOrder=e,this.fantomTP&&this.fantomTP===this.hoverOrder.takeProfit&&(this.fantomTP=0),this.fantomSL&&this.fantomSL===this.hoverOrder.stopLoss&&(this.fantomSL=0),this.fantomStartTSL&&this.fantomStartTSL===this.hoverOrder.trailingStart&&(this.fantomStartTSL=0),this.fantomTSL&&this.fantomTSL===this.hoverOrder.trailingSL&&(this.fantomTSL=0))),this.forceRedrawChart())}else t&&t.command&&"AccountsDetails"===t.command&&(this.updatedOrders=t.data[0].openOrders.tradingOrders)},checkActiveObject:function(){var t=this.$props.settings.storageActiveObjectsChart.getActiveObjects();t&&t.length&&"OpenOrder"!==t.at(-1).name&&(this.redactOrderStatus=!1,this.hoverOrder=null,this.fantomTP=0,this.fantomSL=0,this.fantomStartTSL=0,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"OpenOrder"}))},setChangeSetting:function(t){t.field?this[t.name][t.field]=t.data:this[t.name]=t.data,this.forceRedrawChart()},setStatusSettingPopup:function(){this.statusOpenSettingModal=!1},openSettingModal:function(){if(!this.statusOpenSettingModal){this.$props.settings.storageActiveObjectsChart.setActiveObject({name:"OpenOrder",rang:1,data:this.hoverOrder}),this.redactOrderStatus=!0;var t=this.hoverOrder.id;this.$props.settings.eventBus.emit("changeSettingOpenOrder",t),this.statusOpenSettingModal=!0}},setRedactOrderByGlobalEvent:function(t){t&&t.symbol===this.getSymbol&&(this.hoverOrder=t.order,this.redactOrderStatus=!0,this.forceRedrawChart(),this.openSettingModal())},setHoverOrderByGlobalEvent:function(t){t&&t.symbol===this.getSymbol&&(t.id?this.hoverOrderByEvent=this.openOrdersByContract.find((function(e){return e.id===t.id})):this.hoverOrderByEvent=null,this.forceRedrawChart())}},mounted:function(){this.$props.settings.eventBus.subscribe("setNewActiveObject",this.checkActiveObject),this.$props.settings.eventBus.subscribe("closeSettingOpenOrderPopup",this.setStatusSettingPopup),this.$props.settings.eventBus.subscribe("changeOpenOrderSetting",this.setChangeSetting),Zh.subscribe("hoverOpenOrder",this.setHoverOrderByGlobalEvent),Zh.subscribe("redactOpenOrder",this.setRedactOrderByGlobalEvent),this.setOpenOrdersByContract(),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),this.$props.settings.eventBus.unsubscribe("closeSettingOpenOrderPopup",this.setStatusSettingPopup),this.$props.settings.eventBus.unsubscribe("changeOpenOrderSetting"),this.$props.settings.eventBus.unsubscribe("setNewActiveObject",this.checkActiveObject),Zh.unsubscribe("hoverOpenOrder",this.setHoverOrderByGlobalEvent),Zh.unsubscribe("redactOpenOrder",this.setRedactOrderByGlobalEvent)}},bxt=Cxt,Sxt=(i("203b"),Object(C["a"])(bxt,uxt,dxt,!1,null,"1ad1a130",null)),Pxt=Sxt.exports,Txt=function(){var t=this,e=t._self._c;return e("div")},xxt=[],Oxt={M1:1,M2:2,M3:3,M5:5,M10:10,M15:15,M30:30,M45:45,H1:60,H2:120,H3:180,H4:240,H6:360,H9:540,D1:1440,W1:10080,MN:43200,1:"M1",2:"M2",3:"M3",5:"M5",10:"M10",15:"M15",30:"M30",45:"M45",60:"H1",120:"H2",180:"H3",240:"H4",360:"H6",540:"H9",1440:"D1",10080:"W1",43200:"MN"},wxt={mixins:[Opt["Overlay"]],data:function(){return{}},watch:{getStatusFonChart:function(){this.getStatusFonChart&&this.forceRedrawChart()},getServerTime:function(){this.getStatusFonChart&&this.forceRedrawChart()},getTimeFrame:function(){this.getStatusFonChart&&this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime",getContract:"contracts/getContracts",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings"})),{},{getContractBySymbol:function(){var t=this;if(this.getContract)return this.getContract.find((function(e){return e.name===t.getSymbol}))},getTimeFrame:function(){return this.$props.settings.timeFrame},getSymbol:function(){return this._props.settings.symbol},getStatusFonChart:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.fonChart},getLastPrice:function(){return this.$props.meta.last?this.$props.meta.last[4]:0}}),methods:{meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Watermark Title for Chart"}},use_for:function(){return["WatermarkTitleChart"]},draw:function(t){this.ctx=t,this.getStatusFonChart&&(this.drawWaterMark(t),this.drawPriceWaterMark(t),this.drawTimeWaterMark(t))},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.WatermarkTitleChart.settings",{key:new Date})},drawWaterMark:function(t){t.save(),t.textAlign="center",t.textBaseline="bottom",t.fillStyle="dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(143,168,193,0.2)",t.font="600 ".concat(Math.round(t.canvas.clientHeight/5),"px Arial"),t.fillText(this.getSymbol,t.canvas.clientWidth/2,t.canvas.clientHeight/2,t.canvas.clientWidth),t.restore()},drawPriceWaterMark:function(t){this.getContractBySymbol&&(t.save(),t.textAlign="center",t.textBaseline="top",t.fillStyle="dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(143,168,193,0.2)",t.font="600 ".concat(Math.round(t.canvas.clientHeight/6),"px Arial"),t.fillText("".concat(this.getLastPrice.toFixed(this.getContractBySymbol.chartPrecision)," (").concat(Oxt[this.$props.settings.timeFrame],")"),t.canvas.clientWidth/2,t.canvas.clientHeight/2,t.canvas.clientWidth),t.restore())},drawTimeWaterMark:function(t){t.save(),t.textAlign="right",t.textBaseline="top",t.fillStyle="dark"===this.getActiveTheme?"rgba(143,168,193,0.1)":"rgba(143,168,193,0.2)";var e=t.canvas.clientWidth>500?25:12;t.font="600 ".concat(e,"px Arial"),t.fillText("".concat(new Date(this.getServerTime.now).toLocaleString("ru",{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})," UTC"),t.canvas.clientWidth-24,64,t.canvas.clientWidth),t.restore()}}},_xt=wxt,Axt=(i("dc6d"),Object(C["a"])(_xt,Txt,xxt,!1,null,"508ea975",null)),Dxt=Axt.exports,kxt=function(){var t=this,e=t._self._c;return e("div")},Ixt=[],Bxt={mixins:[Opt["Overlay"],qe],data:function(){return{currentProfit:0,volumeClose:0,percentProfit:0,percentLeverage:0,accountLeverage:0,contactLeverage:0,topMargin:64,leftMargin:6}},watch:{getStatusFonChart:function(){this.forceRedrawChart()},getStatusProfitLeftWidgets:function(){this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContract:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings"})),{},{getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getContractBySymbol:function(){var t=this;if(this.getContract)return this.getContract.find((function(e){return e.name===t.getSymbol}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getSymbol:function(){return this._props.settings.symbol},getStatusFonChart:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.fonChart},getStatusProfitLeftWidgets:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.profitLeftWidgets},getLastPrice:function(){return this.$props.meta.last?this.$props.meta.last[4]:0}}),methods:{meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Watermark for profit left widgets"}},use_for:function(){return["WatermarkProfitWidgets"]},draw:function(t){this.ctx=t,this.getStatusFonChart&&(this.drawProfitWaterMark(t),this.drawSubProfitWaterMark(t))},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.WatermarkProfitWidgets.settings",{key:new Date})},setMessageHandler:function(t){var e=this;if("AccountsDetails"===(null===t||void 0===t?void 0:t.command)){if(!t.data[0].statisticByContracts||!t.data[0].statisticByContracts.length)return;var i=t.data[0].statisticByContracts.find((function(t){return t.contract===e.getSymbol})),o=t.data[0].openOrders.tradingOrders.length?t.data[0].openOrders.tradingOrders.filter((function(t){return t.contractName===e.getSymbol})):[];o.length?this.volumeClose=this.getCryptoStatus?o.reduce((function(t,e){return t+e.volume*e.openPrice}),0):o.reduce((function(t,e){return t+e.volume}),0):this.volumeClose=0,this.currentProfit=i?i.floatingProfit:0,this.accountLeverage=t.data[0].account.maxLeverage,this.contactLeverage=i?i.leverage:0,this.percentProfit=i&&i.pClosedCount&&i.closedCount?100*i.pClosedCount/i.closedCount:0,this.percentLeverage=this.accountLeverage&&this.contactLeverage?100*this.contactLeverage/this.accountLeverage:0,this.forceRedrawChart()}},drawProfitWaterMark:function(t){t.save(),t.textAlign="right",t.textBaseline="top",t.fillStyle=this.currentProfit<0?this.getStatusProfitLeftWidgets?this.getRedColor.color:this.getRedColor.fill:this.getStatusProfitLeftWidgets?this.getGreenColor.color:this.getGreenColor.fill,t.font="600 ".concat(t.canvas.clientHeight/7,"px Arial"),t.fillText("".concat(this.getCurrencyChar).concat(this.$moneyf(this.currentProfit,2)),t.canvas.clientWidth/2-4,t.canvas.clientHeight/2+t.canvas.clientHeight/6,t.canvas.clientWidth/2-4),t.restore()},drawSubProfitWaterMark:function(t){var e=this.currentProfit&&this.volumeClose?100*this.currentProfit/this.volumeClose:0;t.save(),t.textBaseline="top",t.textAlign="left",t.fillStyle=this.currentProfit<0?this.getStatusProfitLeftWidgets?this.getRedColor.color:this.getRedColor.fill:this.getStatusProfitLeftWidgets?this.getGreenColor.color:this.getGreenColor.fill,t.font="600 ".concat(t.canvas.clientHeight/7,"px Arial"),t.fillText("(".concat(this.$moneyf(e,Math.abs(e)<.01?3:2),"%)"),t.canvas.clientWidth/2+4,t.canvas.clientHeight/2+t.canvas.clientHeight/6,t.canvas.clientWidth/2-4),t.restore()},drawDiagrams:function(t){this.drawProgressDiagramm(t,60,120+this.topMargin,40,10,this.percentProfit,"".concat(Math.round(this.percentProfit),"%"),25),this.drawProgressDiagramm(t,60,220+this.topMargin,40,10,this.percentLeverage,"Lev",21,!0,this.contactLeverage)},drawProgressDiagramm:function(t,e,i,o,n,s,r,a,c,l){this.drawBagroundRing(t,e,i,o,n),this.drawText(t,e,i,r,a,c,l),s&&this.drawRing(t,e,i,o,n,s)},drawBagroundRing:function(t,e,i,o,n){t.beginPath(),t.arc(e,i,o,0,2*Math.PI),t.lineWidth=n,t.strokeStyle=this.getStatusProfitLeftWidgets?this.getRedColor.color:this.getRedColor.fill,t.stroke(),t.closePath()},drawText:function(t,e,i,o,n,s,r){s?(t.save(),t.beginPath(),t.font="bold ".concat(n,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),t.textAlign="center",t.textBaseline="ideographic",t.fillStyle=this.getStatusProfitLeftWidgets?this.getGreenColor.color:this.getGreenColor.fill,t.fillText(o,e,i),t.restore(),t.save(),t.beginPath(),t.font="bold ".concat(n,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),t.textAlign="center",t.textBaseline="top",t.fillStyle=this.getStatusProfitLeftWidgets?this.getGreenColor.color:this.getGreenColor.fill,t.fillText(r,e,i),t.restore()):(t.save(),t.beginPath(),t.font="bold ".concat(n,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.getStatusProfitLeftWidgets?this.getGreenColor.color:this.getGreenColor.fill,t.fillText(o,e,i),t.restore())},drawRing:function(t,e,i,o,n,s){var r=$xt(Math.round(s),n/2,o);t.beginPath(),t.arc(e,i,o,-Math.PI/2+Math.PI/180*Mxt(n/2,o),r),t.lineWidth=n,t.strokeStyle=t.fillStyle=this.getStatusProfitLeftWidgets?this.getGreenColor.color:"dark"===this.getActiveTheme?this.getGreenColor.fill:"rgba(235, 255, 243, 0.7)",t.lineCap="round",t.stroke(),t.closePath()}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}};function Mxt(t,e){return Math.ceil(360*t/(2*Math.PI*e))}function $xt(t,e,i){return t?t&&t<=1?Math.PI/180*(3.6*(25-t)*-1+Mxt(e,i)):t<25?Math.PI/180*(3.6*(25-t)*-1+Math.PI/180*Mxt(e,i)):t>=25&&t<100?Math.PI/180*(3.6*(t-25)-Mxt(e,i)):100===t?Math.PI/180*(3.6*(t-25)+Mxt(e,i)):void 0:0}var Lxt=Bxt,Fxt=(i("cf7e"),Object(C["a"])(Lxt,kxt,Ixt,!1,null,"64ca5ee0",null)),jxt=Fxt.exports,Rxt=function(){var t=this,e=t._self._c;return e("div")},Wxt=[],Nxt={mixins:[Opt["Overlay"],qe],data:function(){return{currentProfitClose:0,closeOrderCount:0,volumeClose:0,avgProfitAbs:0}},watch:{getStatusFonChart:function(){this.forceRedrawChart()},getStatusProfitLeftWidgets:function(){this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings"})),{},{getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getSymbol:function(){return this._props.settings.symbol},getStatusFonChart:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.fonChart},getStatusProfitLeftWidgets:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.profitLeftWidgets}}),methods:{meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Watermark for profit bottom widgets"}},use_for:function(){return["WatermarkProfitBottomWidgets"]},draw:function(t){if(this.ctx=t,this.getStatusFonChart){var e=t.canvas.clientWidth/2,i=120,o=32;this.drawStatWaterMarkItem(t,e,"Доход по закр. сделкам","".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.currentProfitClose,2)),this.currentProfitClose<0?this.getRedColor.fill:this.getGreenColor.fill,i),this.drawStatWaterMarkItem(t,e-(o/2+i),"Объём открыт","".concat(this.$moneyf(this.volumeClose,0)),this.getBlueColor.fill),this.drawStatWaterMarkItem(t,e+(o/2+i),"Средний доход, ".concat(this.getCurrencyChar),"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.avgProfitAbs,2)),this.avgProfitAbs<0?this.getRedColor.fill:this.getGreenColor.fill)}},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.WatermarkProfitLeftWidgets.settings",{key:new Date})},setMessageHandler:function(t){var e=this;if("AccountsDetails"===(null===t||void 0===t?void 0:t.command)){if(!t.data[0].statisticByContracts||!t.data[0].statisticByContracts.length)return;var i=t.data[0].statisticByContracts.find((function(t){return t.contract===e.getSymbol}));this.currentProfitClose=i?i.profitClose:0,this.volumeClose=i?i.volumeClose:0,this.closeOrderCount=i?i.closedCount:0,this.avgProfitAbs=this.closeOrderCount&&this.currentProfitClose?this.currentProfitClose/this.closeOrderCount:0,this.forceRedrawChart()}},drawStatWaterMarkItem:function(t,e,i,o,n,s){this.drawStatWaterMarkItemTitle(t,e,i,s),this.drawStatWaterMarkItemData(t,e,o,n,s)},drawStatWaterMarkItemTitle:function(t,e,i,o){t.save(),t.textBaseline="alphabetic",t.textAlign="center",t.fillStyle=this.getGrayColor.fill,t.font="600 ".concat(12,"px Arial"),t.fillText(i,e,t.canvas.clientHeight-80,o),t.restore()},drawStatWaterMarkItemData:function(t,e,i,o,n){t.save(),t.textBaseline="alphabetic",t.textAlign="center",t.fillStyle=o,t.font="600 ".concat(20,"px Arial"),t.fillText(i,e,t.canvas.clientHeight-55,n),t.restore()}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},Ext=Nxt,Uxt=(i("18d1"),Object(C["a"])(Ext,Rxt,Wxt,!1,null,"16ba2bb5",null)),Vxt=Uxt.exports,Hxt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SetPendingOrder",class:"SetPendingOrder_".concat(t.getActiveTheme)},[t.setPrice?e("div",{staticClass:"SetPendingOrder-setMenu",class:"SetPendingOrder-setMenu_".concat(t.getActiveTheme),style:{top:"".concat(t.getPositonForContextMenu,"px")}},t._l(t.getMenuSetPendingOrder,(function(i,o){return e("div",{key:o,staticClass:"SetPendingOrder-setMenu-item",class:"SetPendingOrder-setMenu-item_".concat(t.getActiveTheme),on:{click:function(e){return t.setPendingOrders(i.type,"scale")}}},[e("div",{staticClass:"SetPendingOrder-setMenu-item-icon",style:{color:i.color}},[e("svgIcon",{attrs:{name:i.icon}})],1),e("div",{staticClass:"SetPendingOrder-setMenu-item-text",class:"SetPendingOrder-setMenu-item-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])})),0):t._e(),t.getRedactOrder?e("div",{key:t.getRedactOrder.closePosition,staticClass:"SetPendingOrder-pendingOrderClose",style:{top:"".concat(t.getRedactOrder.position-9,"px"),left:"".concat(t.getRedactOrder.closePosition,"px")}},[e("div",{staticClass:"SetPendingOrder-close",class:"SetPendingOrder-close_".concat(t.getActiveTheme),on:{click:function(e){return t.deleteOrder(t.getRedactOrder)}}},[e("svgIcon",{attrs:{name:"Close"}})],1)]):t._e(),t._l(t.getFlatPendingOrdersArr(),(function(i,o){return e("div",{staticClass:"SetPendingOrder-pendingOrderRedact",class:"SetPendingOrder-pendingOrderRedact_".concat(t.getActiveTheme),style:{top:"".concat(i.position-9,"px"),right:"".concat(i.clone?33:i.redact?3:11.7,"rem")},on:{mouseenter:t.clearChangeOrder}},[i.redact?e("div",{staticClass:"SetPendingOrder-setVolume",class:"SetPendingOrder-setVolume_".concat(t.getActiveTheme)},[e("div",{staticClass:"SetPendingOrder-setVolume-control",class:"SetPendingOrder-setVolume-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!1,i)},mousedown:function(e){return t.downChange("volumeIntervalMinus","calcVolumeCreatedOrder",[!1,i])},mouseup:function(e){return t.clearThrottle("volumeIntervalMinus")},mouseleave:function(e){return t.clearThrottle("volumeIntervalAdd")}}},[e("svgIcon",{attrs:{name:"Minus",size:17}})],1),"checkbox"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.getVolumeValue)?t._i(t.getVolumeValue,null)>-1:t.getVolumeValue},on:{change:function(e){var i=t.getVolumeValue,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.getVolumeValue=i.concat([s])):r>-1&&(t.getVolumeValue=i.slice(0,r).concat(i.slice(r+1)))}else t.getVolumeValue=n}}}):"radio"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],attrs:{type:"radio"},domProps:{checked:t._q(t.getVolumeValue,null)},on:{change:function(e){t.getVolumeValue=null}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],attrs:{type:t.getVolumeStep>=1?"text":"number"},domProps:{value:t.getVolumeValue},on:{input:function(e){e.target.composing||(t.getVolumeValue=e.target.value)}}}),e("div",{staticClass:"SetPendingOrder-setVolume-control",class:"SetPendingOrder-setVolume-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!0,i)},mousedown:function(e){return t.downChange("volumeIntervalAdd","calcVolumeCreatedOrder",[!0,i])},mouseup:function(e){return t.clearThrottle("volumeIntervalAdd")},mouseleave:function(e){return t.clearThrottle("volumeIntervalAdd")}}},[e("svgIcon",{attrs:{name:"Add",size:17}})],1),e("div",{staticClass:"SetPendingOrder-ddButton",class:"SetPendingOrder-ddButton_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getVolumsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".SetPendingOrder-pendingOrderRedact",width:"6rem"},onValueChanged:t.setVolumeOnList},scopedSlots:t._u([{key:"item",fn:function(o){var n=o.data;return[e("div",{staticClass:"SetPendingOrder-ddButtonList-item",class:n===i.volume?"SetPendingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SetPendingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(n,t.getVolumeStepPrecision)))])]}}],null,!0)})],1),i.clone?t._e():e("div",{staticClass:"SetPendingOrder-setStepVolume-control",class:"SetPendingOrder-setStepVolume-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcStepVolumeCreatedOrder(!1)},mousedown:function(e){return t.downChange("volumeStepIntervalMinus","calcStepVolumeCreatedOrder",[!1])},mouseup:function(e){return t.clearThrottle("volumeStepIntervalMinus")},mouseleave:function(e){return t.clearThrottle("volumeStepIntervalMinus")}}},[e("svgIcon",{attrs:{name:"Minus",size:17}})],1),"checkbox"!==(t.getVolumeStep>=1?"text":"number")||i.clone?"radio"!==(t.getVolumeStep>=1?"text":"number")||i.clone?i.clone?t._e():e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],style:{width:"5rem"},attrs:{type:t.getVolumeStep>=1?"text":"number"},domProps:{value:t.getStepVolumeValue},on:{input:function(e){e.target.composing||(t.getStepVolumeValue=e.target.value)}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],style:{width:"5rem"},attrs:{type:"radio"},domProps:{checked:t._q(t.getStepVolumeValue,null)},on:{change:function(e){t.getStepVolumeValue=null}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],style:{width:"5rem"},attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.getStepVolumeValue)?t._i(t.getStepVolumeValue,null)>-1:t.getStepVolumeValue},on:{change:function(e){var i=t.getStepVolumeValue,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.getStepVolumeValue=i.concat([s])):r>-1&&(t.getStepVolumeValue=i.slice(0,r).concat(i.slice(r+1)))}else t.getStepVolumeValue=n}}}),i.clone?t._e():e("div",{staticClass:"SetPendingOrder-setStepVolume-control",class:"SetPendingOrder-setStepVolume-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcStepVolumeCreatedOrder(!0)},mousedown:function(e){return t.downChange("volumeStepIntervalAdd","calcStepVolumeCreatedOrder",[!0])},mouseup:function(e){return t.clearThrottle("volumeStepIntervalAdd")},mouseleave:function(e){return t.clearThrottle("volumeStepIntervalAdd")}}},[e("svgIcon",{attrs:{name:"Add",size:17}})],1),i.clone?t._e():e("div",{staticClass:"SetPendingOrder-ddButtonStepVolume",class:"SetPendingOrder-ddButtonStepVolume_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getStepVolumsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".SetPendingOrder-pendingOrderRedact",width:"5rem"},onValueChanged:t.setStepVolumeOnList},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"SetPendingOrder-ddButtonList-item",class:o===t.getRedactOrder.volumeStep?"SetPendingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SetPendingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}],null,!0)})],1)]):t._e(),i.redact?e("div",{staticClass:"SetPendingOrder-protection",class:i.trailingStart?"SetPendingOrder-protection_isActive_".concat(t.getActiveTheme):"SetPendingOrder-protection_".concat(t.getActiveTheme),on:{click:function(e){return t.checkStatusTralingPopup(!0)}}},[e("svgIcon",{attrs:{name:i.trailingStart?"Shield_2":"Shield_1"}})],1):t._e(),!i.clone&&i.redact?e("div",{staticClass:"SetPendingOrder-copy",class:"SetPendingOrder-copy_".concat(t.getActiveTheme),on:{click:function(e){return t.checkStatusCopyPopup(!0)}}},[e("svgIcon",{attrs:{name:"Copy"}})],1):t._e(),i.clone?t._e():e("div",{staticClass:"SetPendingOrder-sendOrder",class:"SetPendingOrder-sendOrder_".concat(i.orderType,"_").concat(t.getActiveTheme),on:{click:function(e){return t.placePendingOrder(i)}}},[e("div",{staticClass:"SetPendingOrder-sendOrder-text"},[t._v("Разместить")])]),!i.clone&&i.redact?e("div",{staticClass:"SetPendingOrder-setTime",class:"SetPendingOrder-setTime_".concat(t.getActiveTheme)},[e("div",{staticClass:"SetPendingOrder-setTime-dd"},[e("DxSelectBox",{attrs:{value:t.getActiveLiveTime,items:t.getSetTimesList,hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1,dropDownOptions:{container:".SetPendingOrder"},displayExpr:"title",displayValue:"title",onValueChanged:t.setLiveTime}})],1)]):t._e()])}))],2)},Gxt=[],qxt="M11 7a1 1 0 1 1 2 0v4h4a1 1 0 1 1 0 2h-4v4a1 1 0 1 1-2 0v-4H7a1 1 0 1 1 0-2h4V7z",zxt="M5 3.5L5 2.5L4 2.5L4 3.5L5 3.5ZM5 5.5L5 4.5L4 4.5L4 5.5L5 5.5ZM3 4.5L3 5.5L2 5.5L2 4.5L3 4.5ZM3 3.5L3 2.5L2 2.5L2 3.5L3 3.5ZM1 2.5L1 3.5L1.19249e-08 3.5L0 2.5L1 2.5ZM5 7.5L5 6.5L4 6.5L4 7.5L5 7.5Z",Yxt="M4 5.5L5 5.5L5 4.5L4 4.5L4 5.5ZM2 5.5L3 5.5L3 4.5L2 4.5L2 5.5ZM3 3.5L2 3.5L2 2.5L3 2.5L3 3.5ZM4 3.5L5 3.5L5 2.5L4 2.5L4 3.5ZM5 1.5L4 1.5L4 0.5L5 0.5L5 1.5ZM0 5.5L1 5.5L1 4.5L8.74228e-08 4.5L0 5.5Z",Xxt="M17.3 8.1a.99.99 0 1 0-1.4-1.4L12 10.6 8.1 6.7a.99.99 0 1 0-1.4 1.4l3.9 3.9-3.9 3.9a.99.99 0 1 0 1.4 1.4l3.9-3.9 3.9 3.9a.99.99 0 1 0 1.4-1.4L13.4 12l3.9-3.9z",Qxt={methods:{drawPendingOrders:function(t){var e=this;this.getFlatPendingOrdersArr().forEach((function(i){e.checkHoverOrder(t,i)})),this.pendingOrders.forEach((function(i){e.drawLinePendingOrder(t,i),i.cloneOrders&&(i.cloneOrders[0].length||i.cloneOrders[1].length)&&e.drawClonePendingOrders(t,i)})),this.getRedactOrder&&this.drawRedactPendingOrder(t,this.getRedactOrder),this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId!==this.getRedactOrder.pendingId&&this.drawHoverPendingOrder(t,this.hoverFuturePendingOrder)},drawClonePendingOrders:function(t,e){var i=this,o=e.cloneOrders[0].length?e.cloneOrders[0].map((function(t){return t.price})):[],n=e.cloneOrders[1].length?e.cloneOrders[1].map((function(t){return t.price})):[],s=n.concat(o);s.push(e.price);var r=Math.max.apply(null,s),a=Math.min.apply(null,s);this.drawConnectCloneLine(t,r,a,e.orderType),e.cloneOrders.forEach((function(o){o.length&&o.forEach((function(o){i.drawClonePendingOrder(t,o,r,a,e),o.redact&&i.drawRedactClonePendingOrder(t,o)}))}))},drawConnectCloneLine:function(t,e,i,o){var n="dark"===this.getActiveTheme?this.getGreenColor.color:"green",s="dark"===this.getActiveTheme?"#EE204D":"red",r=this.$props.layout,a=r.$2screen(i),c=r.$2screen(e);t.save(),t.beginPath(),t.strokeStyle="#8fa8c1",t.setLineDash([4,5]),t.moveTo(t.canvas.clientWidth-560,a),t.lineTo(t.canvas.clientWidth-560,c),t.stroke(),t.restore(),t.beginPath(),t.strokeStyle="Buy"===o?n:s,t.lineWidth=2,t.moveTo(t.canvas.clientWidth-155,a),t.lineTo(t.canvas.clientWidth-155,c),t.stroke()},drawClonePendingOrder:function(t,e){var i=this.$props.layout,o=i.$2screen(e.price);e.position=o;var n=e.takeProfit&&e.stopLoss,s="dark"===this.getActiveTheme?"#000":"#fff";t.save(),t.font="400 10px Arial",t.textAlign="left",t.textBaseline="middle";var r=t.measureText("LIMIT ".concat(e.orderType.toUpperCase()," ").concat(e.price.toFixed(this.getPrecision))).width;if(e.closePosition=n?r+6:r+33,t.beginPath(),t.moveTo(n?r+6:e.redact?r+33:r+6,o),t.lineTo(t.canvas.clientWidth,o),t.strokeStyle="#8fa8c1",t.setLineDash([4,5]),t.stroke(),t.beginPath(),t.fillStyle=t.strokeStyle="#8fa8c1",t.fillText("LIMIT ".concat(e.orderType.toUpperCase()," ").concat(e.price.toFixed(this.getPrecision)),n?3:e.redact?27:3,o),t.restore(),!e.redact){if(t.beginPath(),t.arc(t.canvas.clientWidth-560,o,10,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,o,8,0,2*Math.PI),t.fillStyle="#8fa8c1",t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,o,6,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,o,2,0,2*Math.PI),t.fillStyle="#8fa8c1",t.fill(),this.drawVolume(t,e,o),e.takeProfit){var a=i.$2screen(e.takeProfit);this.drawTakeProfit(t,a,e,"hover")}if(e.stopLoss){var c=i.$2screen(e.stopLoss);this.drawStopLoss(t,c,e,"hover")}}},drawVolume:function(t,e,i){t.save(),t.font="400 12px Arial";var o=this.getCryptoStatus?this.getSumONCryptoVolume(e.volume,e.price):this.getPercentVolumeOnEquity(e.volume),n=o;t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#23313f":"#fafafa",t.rect(t.canvas.clientWidth-520,i-9,120,18),t.fill(),t.beginPath(),t.textAlign="center",t.fillStyle="#8fa8c1",t.fillText(n,t.canvas.clientWidth-520+60,i+4,120),t.restore()},checkHoverOrder:function(t,e){var i=this.$props.layout,o=i.$2screen(e.price),n=this.hoverInCube(0,t.canvas.clientWidth,o+5,o-5,this.mouseX,this.mouseY);if(n){this.hoverFuturePendingOrder||(this.hoverFuturePendingOrder=e),this.hoverFuturePendingOrders.length||this.hoverFuturePendingOrders.push(e);var s=this.hoverFuturePendingOrders.find((function(t){return t.pendingId===e.pendingId}));s||this.hoverFuturePendingOrders.push(e),this.hoverFuturePendingOrder=this.hoverFuturePendingOrders.at(-1)}else{var r=this.hoverFuturePendingOrders.find((function(t){return t.pendingId===e.pendingId}));r&&(this.hoverFuturePendingOrders=this.hoverFuturePendingOrders.filter((function(t){return t.pendingId!==r.pendingId})))}this.hoverFuturePendingOrders.length||(this.hoverFuturePendingOrder=null)},drawLinePendingOrder:function(t,e){var i=this.$props.layout,o="dark"===this.getActiveTheme?this.getGreenColor.color:"green",n="dark"===this.getActiveTheme?"#EE204D":"red",s=i.$2screen(e.price),r=e.takeProfit&&e.stopLoss,a="dark"===this.getActiveTheme?"#000":"#fff";e.position=s,t.save(),t.font="400 10px Arial",t.textAlign="left",t.textBaseline="middle";var c=t.measureText("LIMIT ".concat(e.orderType.toUpperCase()," ").concat(e.price)).width;if(e.closePosition=r?c+6:c+33,t.beginPath(),t.setLineDash([4,5]),t.strokeStyle="Sell"===e.orderType?n:o,t.moveTo(r?c+6:e.redact?c+33:c+6,s),t.lineTo(t.canvas.clientWidth,s),t.stroke(),t.beginPath(),t.fillStyle="Sell"===e.orderType?n:o,t.fillText("LIMIT ".concat(e.orderType.toUpperCase()," ").concat(e.price),r?3:e.redact?27:3,s),t.restore(),!(this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId===e.pendingId||e.redact)){if(t.beginPath(),t.arc(t.canvas.clientWidth-560,s,10,0,2*Math.PI),t.fillStyle=a,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,s,8,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,s,6,0,2*Math.PI),t.fillStyle=a,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,s,2,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),this.drawVolume(t,e,s),e.takeProfit){var l=i.$2screen(e.takeProfit);this.drawTakeProfit(t,l,e,"hover")}if(e.stopLoss){var u=i.$2screen(e.stopLoss);this.drawStopLoss(t,u,e,"hover")}}},drawHoverPendingOrder:function(t,e){var i=this.$props.layout,o="dark"===this.getActiveTheme?this.getGreenColor.color:"green",n="dark"===this.getActiveTheme?"#EE204D":"red",s="dark"===this.getActiveTheme?"#000":"#fff",r=i.$2screen(e.price);e.position=r,t.save(),t.beginPath(),t.lineWidth=3,t.setLineDash([4,5]),t.strokeStyle="Sell"===e.orderType?n:o,t.moveTo(0,r),t.lineTo(t.canvas.clientWidth,r),t.stroke(),t.restore(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,12,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,10,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,8,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,4,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),this.drawVolume(t,e,r),this.drawStopLoss(t,r,this.hoverFuturePendingOrder),this.drawTakeProfit(t,r,this.hoverFuturePendingOrder)},drawRedactClonePendingOrder:function(t,e){var i=this.$props.layout,o="dark"===this.getActiveTheme?this.getGreenColor.color:"green",n="dark"===this.getActiveTheme?"#EE204D":"red",s="dark"===this.getActiveTheme?"#000":"#fff",r=i.$2screen(e.price);this.drawTrailingSL(t,r,this.getRedactOrder),this.drawTakeProfit(t,r,this.getRedactOrder,"redact"),this.drawStopLoss(t,r,this.getRedactOrder,"redact"),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,12,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,10,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,8,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,4,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill()},drawRedactPendingOrder:function(t,e){var i=this.$props.layout,o="dark"===this.getActiveTheme?this.getGreenColor.color:"green",n="dark"===this.getActiveTheme?"#EE204D":"red",s="dark"===this.getActiveTheme?"#000":"#fff",r=i.$2screen(e.price);e.cloneOrders&&e.cloneOrders.length&&(this.getCryptoStatus?this.drawSummaryCryptoVolume(t,i,e):this.drawSummaryVolume(t,i,e)),this.drawTrailingSL(t,r,this.getRedactOrder),this.drawTakeProfit(t,r,this.getRedactOrder,"redact"),this.drawStopLoss(t,r,this.getRedactOrder,"redact"),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,12,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,10,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,8,0,2*Math.PI),t.fillStyle=s,t.fill(),t.beginPath(),t.arc(t.canvas.clientWidth-560,r,4,0,2*Math.PI),t.fillStyle="Sell"===e.orderType?n:o,t.fill()},drawTrailingSL:function(t,e,i){if(i.trailingStart){var o=i.orderType,n="Buy"===o?+(i.price+i.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision):+(i.price-i.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision),s="Buy"===o?+(i.price+i.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(i.price-i.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision);this.drawWithRangeZoneOnSacle(t,0,e,n,this.getBlueColor.color,this.getBlueColor.fill,"TS",!0,"Buy"===o?"up":"down","START ".concat(n," (").concat(i.trailingStart,")"),s),this.drawWithRangeZoneOnSacle(t,0,e,s,this.getBlueColor.color,this.getBlueColor.fill,"TS",!1,"Buy"===o?"up":"down","SL ".concat(s," (").concat(i.trailingSL,")"),null)}},drawStopLoss:function(t,e,i){var o=i.orderType,n=i.stopLoss?this.getProfit(i.price,i.stopLoss,i.volume,i.orderType):0;if(i.redact)i.stopLoss?this.drawWithRangeZone(t,t.canvas.clientWidth-560,e,i.stopLoss,"#EE204D","rgba(238,32,77, 0.05)","SL",!0,"Sell"===o?"up":"down",n):this.drawWithRangeZone(t,t.canvas.clientWidth-560,e,e-1,"#EE204D",this.getRedColor.fill,"SL",!1,"Sell"===o?"up":"down",0);else{if(!i.stopLoss)return;var s="light"===this.getActiveTheme?this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId===i.pendingId?"rgba(233, 18, 18)":"rgba(233, 18, 18, 0.5)":this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId===i.pendingId?"rgba(250, 76, 74)":"rgba(250, 76, 74, 0.5)";this.drawShadowTPorSL(t,i.stopLoss,s,"SL","Sell"===o?"up":"down",n)}},drawTakeProfit:function(t,e,i){var o=i.orderType,n=i.takeProfit?this.getProfit(i.price,i.takeProfit,i.volume,i.orderType):0;if(i.redact)i.takeProfit?this.drawWithRangeZone(t,t.canvas.clientWidth-560,e,i.takeProfit,"dark"===this.getActiveTheme?this.getGreenColor.color:"green","light"===this.getActiveTheme?"rgba(0, 142, 114, 0.03)":"rgba(0, 255, 172, 0.03)","TP",!0,"Sell"===o?"down":"up",n):this.drawWithRangeZone(t,t.canvas.clientWidth-560,e,e+1,"dark"===this.getActiveTheme?this.getGreenColor.color:"green",this.getGreenColor.fill,"TP",!1,"Sell"===o?"down":"up",0);else{if(!i.takeProfit)return;var s="light"===this.getActiveTheme?this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId===i.pendingId?"rgba(0, 142, 114)":"rgba(0, 142, 114, 0.5)":this.hoverFuturePendingOrder&&this.hoverFuturePendingOrder.pendingId===i.pendingId?"rgba(0, 255, 172)":"rgba(0, 255, 172, 0.5)";this.drawShadowTPorSL(t,i.takeProfit,s,"TP","Sell"===o?"down":"up",n)}},drawShadowTPorSL:function(t,e,i,o,n,s){var r=this.$props.layout,a=r.$2screen(e);t.beginPath(),t.strokeStyle=i,t.rect(0,"down"===n?a:a-18,24,18),t.stroke(),t.beginPath(),t.strokeStyle=i,t.rect(t.canvas.clientWidth-24,"down"===n?a:a-18,24,18),t.stroke(),s&&(t.save(),t.font="400 12px Arial",t.textAlign="right",t.beginPath(),t.fillStyle=i,t.fillText("$ ".concat(this.$moneyf(s)),t.canvas.clientWidth-27,"up"===n?a-6:a+14),t.restore()),t.save(),t.beginPath(),t.textAlign="left",t.fillStyle=i,t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",t.fillText(o,t.canvas.clientWidth-22,"down"===n?a+14:a-8),t.fillText(o,2,"down"===n?a+14:a-8),t.restore(),t.fill(),t.save(),t.beginPath(),t.textAlign="left",t.fillStyle=i,t.font="400 12px Arial",t.fillText(e.toFixed(this.getPrecision),28,"down"===n?a+15:a-5),t.fill(),t.beginPath(),t.strokeStyle=i,t.setLineDash([2,2]),t.moveTo(29,a),t.lineTo(t.canvas.clientWidth-24,a),t.stroke(),t.restore()},drawWithRangeZoneOnSacle:function(t,e,i,o,n,s,r,a,c,l,u){var d=this.$props.layout,h=d.$2screen(o);if(t.beginPath(),t.strokeStyle=n,t.moveTo(t.canvas.clientWidth,i),t.lineTo(t.canvas.clientWidth,"down"===c?h+18:h-18),t.stroke(),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?h:h-18,24,18),t.fill(),a){var p=d.$2screen(u);t.beginPath(),t.fillStyle=s,t.moveTo(e+1,p),t.lineTo(t.canvas.clientWidth,p),t.lineTo(t.canvas.clientWidth,"down"===c?h-1:h+1),t.lineTo(e+1,"down"===c?h-1:h+1),t.fill()}t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",t.fillText(r,t.canvas.clientWidth-22,"down"===c?h+14:h-8),t.restore(),t.fill(),t.save(),t.beginPath(),t.fillStyle=n,t.font="400 9px Arial",t.textAlign="left";var g=t.measureText(l).width;if(t.fillText(l,t.canvas.clientWidth-28-g,"down"===c?h+7:h),t.fill(),t.beginPath(),t.setLineDash([2,2]),t.moveTo(e,h),t.lineTo(t.canvas.clientWidth-g-32,h),t.stroke(),t.restore(),this.getRedactOrder){t.save();var f=new Path2D("down"===c?Yxt:zxt);t.translate(t.canvas.clientWidth-7,"down"===c?h+11:h-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(f),t.restore()}},drawWithRangeZone:function(t,e,i,o,n,s,r,a,c,l){var u=this.$props.layout,d=a?u.$2screen(o):o,h=0;if(a&&(t.beginPath(),t.strokeStyle=n,t.moveTo(e,i),t.lineTo(e,"down"===c?d+18:d-18),t.stroke()),t.beginPath(),t.fillStyle=n,t.rect(0,"down"===c?d:d-18,24,18),t.fill(),a?(t.beginPath(),t.fillStyle=n,t.rect(e-12,"down"===c?d:d-18,24,18),t.fill()):(t.beginPath(),t.fillStyle=n,t.rect(e-12,"down"===c?d+14:d-32,24,18),t.fill()),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?d:d-18,24,18),t.fill(),l&&(t.save(),t.font="400 12px Arial",t.textAlign="right",t.beginPath(),t.fillText("$ ".concat(this.$moneyf(l)),t.canvas.clientWidth-27,"up"===c?d-6:d+14),t.restore()),a&&(t.beginPath(),t.fillStyle=s,t.moveTo(1,i+1),t.lineTo(t.canvas.clientWidth,i+1),t.lineTo(t.canvas.clientWidth,"down"===c?d-1:d+1),t.lineTo(1,"down"===c?d-1:d+1),t.fill()),t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",a?t.fillText(r,e-10,"down"===c?d+14:d-8):t.fillText(r,e-10,"down"===c?d+28:d-22),t.fillText(r,t.canvas.clientWidth-22,"down"===c?d+14:d-8),t.fillText(r,2,"down"===c?d+14:d-8),t.restore(),a&&(t.save(),h=t.measureText(o.toFixed(this.getPrecision)).width,t.beginPath(),t.textAlign="left",t.fillStyle=n,t.font="400 12px Arial",t.fillText(o.toFixed(this.getPrecision),28,"down"===c?d+15:d-5),t.beginPath(),t.setLineDash([2,2]),t.moveTo(29,d),t.lineTo(t.canvas.clientWidth-24,d),t.stroke(),t.restore()),this.getRedactOrder){if("TP"===r&&this.getRedactOrder.takeProfit||"SL"===r&&this.getRedactOrder.stopLoss){var p=new Path2D(Xxt);t.save(),t.translate(h+33,"down"===c?d-1:d-22),t.fillStyle=n,t.fill(p),t.restore()}var g=new Path2D("down"===c?Yxt:zxt);t.save(),t.translate(17,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore(),a?(t.save(),t.translate(e+5,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()):(t.save(),t.translate(e+5,"down"===c?d+25:d-32),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()),t.save(),t.translate(t.canvas.clientWidth-7,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()}},drawSetButton:function(t){var e=this.setPrice;t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#bbcee0":"#666",t.rect(t.canvas.clientWidth-30,e-10,20,20),t.fill(),t.save(),t.beginPath(),t.setLineDash([2,4]),t.moveTo(t.canvas.clientWidth-35,e),t.lineTo(0,e),t.strokeStyle="dark"===this.getActiveTheme?"#bbcee0":"#666",t.stroke(),t.restore(),t.save();var i=new Path2D(qxt);t.translate(t.canvas.clientWidth-32,e-12),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(i),t.restore();var o=this.hoverInCube(t.canvas.clientWidth-30,t.canvas.clientWidth-10,e+10,e-10,this.mouseX,this.mouseY);o&&(t.canvas.style.cursor="pointer")},drawButton:function(t){if(this.getCursorChart){var e=this.getCursorChart.y;t.beginPath(),t.fillStyle="dark"===this.getActiveTheme?"#fafafa":"#666",t.rect(t.canvas.clientWidth-30,e-10,20,20),t.fill(),t.beginPath(),t.save();var i=new Path2D(qxt);t.translate(t.canvas.clientWidth-32,e-12),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(i),t.restore();var o=this.hoverInCube(t.canvas.clientWidth-30,t.canvas.clientWidth-10,e+10,e-10,this.mouseX,this.mouseY);o&&(t.canvas.style.cursor="pointer")}},drawSummaryCryptoVolume:function(t,e,i){var o=i.cloneOrders&&i.cloneOrders[0].length?i.cloneOrders[0].reduce((function(t,e){return t+ +e.volume*i.price}),0):0,n=i.cloneOrders&&i.cloneOrders[1].length?i.cloneOrders[1].reduce((function(t,e){return t+ +e.volume*i.price}),0):0,s=+i.volume*i.price+n+o;t.save(),t.font="400 12px Arial";var r=this.equityAccount?100*s/this.equityAccount:0,a="$ ".concat(this.$moneyf(s,2)," (").concat(this.$moneyf(r,r<.01?3:2),"%)"),c=t.measureText(a).width+6,l=e.$2screen(i.price);t.beginPath(),t.fillStyle="#FFF9C1",t.rect(t.canvas.clientWidth-c-580,l-9,c,18),t.fill(),t.beginPath(),t.strokeStyle="#FFE600",t.rect(t.canvas.clientWidth-c-580,l-9,c,18),t.fill(),t.textAlign="center",t.textBaseline="middle",t.beginPath(),t.fillStyle="#333",t.fillText(a,t.canvas.clientWidth-c/2-580,l),t.restore()},drawSummaryVolume:function(t,e,i){var o=i.cloneOrders[0].length?i.cloneOrders[0].reduce((function(t,e){return t+ +e.volume}),0):0,n=i.cloneOrders[1].length?i.cloneOrders[1].reduce((function(t,e){return t+ +e.volume}),0):0,s=+i.volume+o+n;t.save(),t.font="400 12px Arial";var r=this.equityAccount?100*s/this.equityAccount:0,a="".concat(this.$moneyf(s)," (").concat(this.$moneyf(r,r<.01?3:2),"%)"),c=t.measureText(a).width+6,l=e.$2screen(i.price);t.beginPath(),t.fillStyle="#FFF9C1",t.rect(t.canvas.clientWidth-c-580,l-9,c,18),t.fill(),t.beginPath(),t.strokeStyle="#FFE600",t.rect(t.canvas.clientWidth-c-580,l-9,c,18),t.fill(),t.textAlign="center",t.textBaseline="middle",t.beginPath(),t.fillStyle="#333",t.fillText(a,t.canvas.clientWidth-c/2-580,l),t.restore()}}},Jxt={methods:{mouseout:function(){this.mouseX=null,this.mouseY=null,this.changePrice=!1,this.changeTakeProfit=!1,this.changeStopLoss=!1,this.changeTralingStart=!1,this.changeTralingSL=!1,this.statusVisibleButton=!1,this.hoverFuturePendingOrders&&this.hoverFuturePendingOrders.length&&(this.hoverFuturePendingOrders=[],this.hoverFuturePendingOrder=null,this.forceRedrawChart()),this.stopChart(!1)},mousemove:function(t){var e=this.$props.layout;this.mouseX=t.layerX,this.mouseY=t.layerY;var i=this.ctx.canvas.clientWidth,o=i-this.mouseX;if(!(o<80&&o>8)||this.getCheckHoverTPRedactOrder||this.getCheckHoverSLRedactOrder||this.getCheckHoverTralingStartRedactOrder||this.getCheckHoverTralingSLRedactOrder?this.statusVisibleButton=!1:this.statusVisibleButton=!0,this.getChangeFieldPendingOrder){var n=+e.screen2$(t.layerY).toFixed(this.getPrecision);if(this.changePrice&&this.getRedactOrder&&(this.getRedactOrder.price=n,this.getRedactOrder.position=t.layerY,this.setStopLossAndTakeProfitByPips(this.getRedactOrder)),this.changeTakeProfit&&this.getRedactOrder&&("Sell"===this.getRedactOrder.orderType&&nthis.getRedactOrder.price)&&(this.getRedactOrder.takeProfit=n,this.setPipsForTakeProfit(this.getRedactOrder)),this.changeStopLoss&&this.getRedactOrder&&("Sell"===this.getRedactOrder.orderType&&n>this.getRedactOrder.price||"Buy"===this.getRedactOrder.orderType&&nthis.getRedactOrder.trailingSL+10&&(this.getRedactOrder.trailingStart=s,this.$props.settings.eventBus.emit("changeDragTralingPendingOrder",{param:"trailingStart",data:s}))}if(this.changeTralingSL&&this.getRedactOrder){var r="Sell"===this.getRedactOrder.orderType?Math.round((this.getRedactOrder.price-n)*Ph(this.getPrecision)):Math.round((n-this.getRedactOrder.price)*Ph(this.getPrecision));r=1?/^\d+$/:new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(this.getVolumeStepPrecision,"}"),")?$"));t&&!i.test(t)||isNaN(+t)?this.volumeRedactOrder=e:+t?this.setVolumeOnList({value:+t}):this.getRedactOrder.volume=t},volumeStepRedactOrder:function(t,e){var i=this.getVolumeStep>=1?/^\d+$/:new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(this.getVolumeStepPrecision,"}"),")?$"));t&&!i.test(t)||isNaN(+t)?this.volumeStepRedactOrder=e:+t?this.setStepVolumeOnList({value:+t}):this.getRedactOrder.volumeStep=t},getCursorChart:function(t){t&&t.y||(this.statusVisibleButton=!1)},getRedactOrder:function(){this.checkStatusCopyPopup(!1),this.checkStatusTralingPopup(!1)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime"})),{},{getVolumeValue:{get:function(){return this.getRedactOrder.volume},set:function(t){this.volumeRedactOrder=t}},getMinVolume:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).minVolume;return e},getMaxVolume:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).maxVolume;return e},getStepVolumeValue:{get:function(){return this.getRedactOrder.volumeStep},set:function(t){this.volumeStepRedactOrder=t}},getActiveLiveTime:function(){var t=this;return this.getSetTimesList.find((function(e){return e.value===t.liveTime}))},getVolumsList:function(){return this.getCryptoStatus?[.01,.03,.05,.1,.15,.25,.5,.75,1]:[1e3,3e3,5e3,1e4,15e3,25e3,5e4,75e3,1e5]},getStepVolumsList:function(){return this.getCryptoStatus?[.01,.02,.03,.04,.05,.06,.07,.08,1]:[1e3,2e3,3e3,4e3,5e3,6e3,7e3,8e3,1e4]},getSetTimesList:function(){return[{title:"1 час",value:1},{title:"2 часа",value:2},{title:"3 часа",value:3},{title:"6 часов",value:6},{title:"12 часов",value:12},{title:"1 день",value:24},{title:"2 дня",value:48},{title:"3 дня",value:72},{title:"4 дня",value:96},{title:"5 дней",value:120},{title:"6 дней",value:144},{title:"Неделя",value:168},{title:"Месяц",value:720}]},getCheckHoverTPRedactOrder:function(){if(this.getRedactOrder){var t=this.$props.layout.$2screen(this.getRedactOrder.takeProfit?this.getRedactOrder.takeProfit:this.getRedactOrder.price);return this.hoverInCube(0,this.ctx.canvas.clientWidth,"Sell"===this.getRedactOrder.orderType?t+30:t+10,"Sell"===this.getRedactOrder.orderType?t-10:t-30,this.mouseX,this.mouseY)}},getCheckHoverTralingStartRedactOrder:function(){if(this.getRedactOrder&&this.getRedactOrder.trailingStart){var t=this.$props.layout.$2screen("Sell"===this.getRedactOrder.orderType?this.getRedactOrder.price-this.getRedactOrder.trailingStart/Ph(this.getPrecision):this.getRedactOrder.price+this.getRedactOrder.trailingStart/Ph(this.getPrecision));return this.hoverInCube(0,this.ctx.canvas.clientWidth,"Sell"===this.getRedactOrder.orderType?t+30:t+10,"Sell"===this.getRedactOrder.orderType?t-10:t-30,this.mouseX,this.mouseY)}},getCheckHoverTralingSLRedactOrder:function(){if(this.getRedactOrder&&this.getRedactOrder.trailingSL){var t=this.$props.layout.$2screen("Sell"===this.getRedactOrder.orderType?this.getRedactOrder.price-this.getRedactOrder.trailingSL/Ph(this.getPrecision):this.getRedactOrder.price+this.getRedactOrder.trailingSL/Ph(this.getPrecision));return this.hoverInCube(0,this.ctx.canvas.clientWidth,"Sell"===this.getRedactOrder.orderType?t+30:t+10,"Sell"===this.getRedactOrder.orderType?t-10:t-30,this.mouseX,this.mouseY)}},getCheckHoverSLRedactOrder:function(){if(this.getRedactOrder){var t=this.$props.layout.$2screen(this.getRedactOrder.stopLoss?this.getRedactOrder.stopLoss:this.getRedactOrder.price);return this.hoverInCube(0,this.ctx.canvas.clientWidth,"Sell"===this.getRedactOrder.orderType?t+10:t+30,"Sell"===this.getRedactOrder.orderType?t-30:t-10,this.mouseX,this.mouseY)}},getLastPrice:function(){return this.$props.meta.last?this.$props.meta.last[4]:void 0},getDefaultCopyDirection:function(){if(this.getRedactOrder)return this.getRedactOrder.price>this.getLastPrice?"up":"down"},getIdChart:function(){return this.$props.settings.idChart},getContractsBySymbol:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.getSymbol}))},getVolumeStepPrecision:function(){var t=this;if(this.getContracts&&this.getSymbol){var e=this.getContracts.find((function(e){return e.name===t.getSymbol})).stepPrecision;return e}},getVolumeStep:function(){var t=this;if(this.getContracts&&this.getSymbol){var e=this.getContracts.find((function(e){return e.name===t.getSymbol})).volumeStep;return e}},getSymbol:function(){return this._props.settings.symbol},getRedactOrder:function(){if(this.pendingOrders.length)return this.getFlatPendingOrdersArr().find((function(t){return t.redact}))},getChangeFieldPendingOrder:function(){return this.changePrice||this.changeTakeProfit||this.changeStopLoss||this.changeTralingStart||this.changeTralingSL},getCryptoStatus:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).executionGroup;return"Crypto"===e},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).precision;return e},getMenuSetPendingOrder:function(){return[{text:"Limit order to Sell",color:this.getRedColor.color,type:"Sell",icon:"Limitorder"},{text:"Limit order to Buy",color:this.getGreenColor.color,type:"Buy",icon:"Limitorder"},{text:"Limit order to Buy + Sell",color:this.getBlueColor.color,type:null,icon:"Limitorder"}]},getCursorChart:function(){return this.$props.settings.cursor},getPositonForContextMenu:function(){if(this.setPrice&&this.ctx){var t=this.ctx.canvas.clientHeight-this.setPrice;return t<105?this.setPrice-105:this.setPrice+5}}}),methods:{init:function(){this.shader=new Kxt(this),Zh.subscribe("setHoverOrder",this.setHoverOrderStatus),Zh.subscribe("setHoverPendingOrder",this.setPendingHoverOrderStatus)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Overlay Set Pending Order"}},use_for:function(){return["SetPendingOrder"]},setHoverOrderStatus:function(t){this.hoverOrder=t},setPendingHoverOrderStatus:function(t){this.hoverPendingOrder=t},hoverInCube:function(t,e,i,o,n,s){return n>=t&&n<=e&&s<=i&&s>=o},draw:function(t){this.ctx=t;var e=this.$props.settings.storageActiveObjectsChart.getActiveObjects();!this.statusVisibleButton||this.hoverOrder||e.length||this.drawButton(t),this.setPrice&&this.drawSetButton(t),this.pendingOrders.length&&(this.drawPendingOrders(t),this.shader.draw(this.getActiveTheme))},getPercentVolumeOnEquity:function(t){if(this.equityAccount){var e=100*t/this.equityAccount;return"".concat(this.$moneyf(t)," (").concat(this.$moneyf(e,e<.01?3:2)," %)")}},getSumONCryptoVolume:function(t,e){return"".concat(this.$moneyf(t)," (₮ ").concat(this.$moneyf(t*e,2),")")},getProfit:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=n[o]().toFixed(2);return+s},clearChangeOrder:function(){this.changePrice=!1},setLiveTime:function(t){this.liveTime=t.value.value,this.$props.settings.eventBus.emit("setLiveTimeSetPendingOrder",this.liveTime)},getFlatPendingOrdersArr:function(){var t=[];return this.pendingOrders.forEach((function(e){t.push(e),e.cloneOrders&&(e.cloneOrders[0].length&&e.cloneOrders[0].forEach((function(e){t.push(e)})),e.cloneOrders[1].length&&e.cloneOrders[1].forEach((function(e){t.push(e)})))})),t},setMessageHandler:function(t){"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.equityAccount=t.data[0].account.equity)},calcVolumeCreatedOrder:function(t){var e=this,i=+this.getContractsBySymbol.volumeStep,o=+this.getRedactOrder.volume;if(t)o!==this.getContractsBySymbol.maxVolume&&(o+=i);else{if(o===this.getContractsBySymbol.minVolume)return;o-=i}this.getRedactOrder.volume=this.getVolumeStep<1?+o.toFixed(this.getVolumeStepPrecision):o,this.getRedactOrder.volumeStep&&this.getRedactOrder.cloneOrders&&(this.getRedactOrder.cloneOrders[0].length||this.getRedactOrder.cloneOrders[1].length)&&(this.getRedactOrder.cloneOrders.forEach((function(t){t.length&&t.forEach((function(t,i){t.volume=e.getRedactOrder.volume+e.getRedactOrder.volumeStep*(i+1)}))})),this.forceRedrawChart())},calcStepVolumeCreatedOrder:function(t){var e=this,i=this.getContractsBySymbol.volumeStep,o=+this.getRedactOrder.volumeStep;if(t)o+=i;else{if(0===o)return;o-=i}this.getRedactOrder.volumeStep=i<1?+o.toFixed(this.getVolumeStepPrecision):o,this.getRedactOrder.cloneOrders&&(this.getRedactOrder.cloneOrders[0].length||this.getRedactOrder.cloneOrders[1].length)&&(this.getRedactOrder.cloneOrders.forEach((function(t){t.length&&t.forEach((function(t,i){t.volume=e.getRedactOrder.volume+e.getRedactOrder.volumeStep*(i+1)}))})),this.forceRedrawChart())},changeStepVolumeCreatedPendingOrder:function(t){var e=this.pendingOrders.find((function(e){return e.pendingId===t.pendingId}));e&&(e.volumeStep=+t.data,e.cloneOrders&&(e.cloneOrders[0].length||e.cloneOrders[1].length)&&(e.cloneOrders.forEach((function(t){t.length&&t.forEach((function(t,i){t.volume=+e.volume+e.volumeStep*(i+1)}))})),this.forceRedrawChart()))},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},deleteOrder:function(t){var e=this;if(this.hoverFuturePendingOrders.length&&(this.hoverFuturePendingOrders=this.hoverFuturePendingOrders.filter((function(t){return t.pendingId!==e.getRedactOrder.pendingId}))),t.clone){var i=this.pendingOrders.find((function(e){return e.pendingId===t.rootPendingId}));i&&i.cloneOrders.forEach((function(e){if(e.length){var o=e.findIndex((function(e){return e.pendingId===t.pendingId}));-1!==o&&(e.splice(o,1),i.redact=!0)}}))}else{var o=this.pendingOrders.findIndex((function(e){return e.pendingId===t.pendingId}));this.pendingOrders.splice(o,1),this.pendingOrders.length&&(this.pendingOrders[0].redact=!0)}this.checkStatusCopyPopup(!1),this.checkStatusTralingPopup(!1),this.copyOrdersPopupStatus=!1,this.$props.settings.eventBus.emit("deletePendingOrder",t),this.forceRedrawChart()},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.SetPendingOrder.settings",{key:new Date})},placePendingOrder:function(t){var e=this;this.sendPendingOrder(t),t.cloneOrders&&(t.cloneOrders[0].length||t.cloneOrders[1].length)&&t.cloneOrders.forEach((function(t){t.length&&t.forEach((function(t){e.sendPendingOrder(t)}))}));var i=this.pendingOrders.findIndex((function(e){return e.pendingId===t.pendingId}));this.pendingOrders.splice(i,1),this.pendingOrders.length&&(this.pendingOrders[0].redact=!0),this.copyOrdersPopupStatus&&(this.copyOrdersPopupStatus=!1),this.$props.settings.eventBus.emit("closePopupCreatePendingOrders")},chekVolumeByStep:function(t){if(!t)return 0;var e=+t.toFixed(this.getVolumeStepPrecision),i=e>=this.getVolumeStep&&!this.getVolumeStepPrecision&&e%this.getVolumeStep;return i?e-i>=this.getMinVolume?e-i:0:e>=this.getMinVolume?e:0},sendPendingOrder:function(t){var e=(new Date).getTimezoneOffset()/60;t.timeStart=new Date(new Date(this.getServerTime.now).getTime()+36e5*Math.abs(e)),t.volume=this.chekVolumeByStep(+t.volume),t.timeEnd=new Date(new Date(this.getServerTime.now).getTime()+36e5*(this.liveTime+Math.abs(e)));var i=this.$props.meta.last?this.$props.meta.last.at(-1):0;"Sell"===t.orderType&&t.price>i?t.priceType="Limit":"Sell"===t.orderType&&t.pricei?t.priceType="Stop":"Buy"===t.orderType&&t.price=this.hoverOrder.pendingPrice:o<=this.hoverOrder.pendingPrice;n&&(this.fantomTP=o)}if(this.changeSLorderStatus){var s=+e.screen2$(t.layerY).toFixed(this.getPrecision),r="Buy"===i?s<=this.hoverOrder.pendingPrice:s>=this.hoverOrder.pendingPrice;r&&(this.fantomSL=+e.screen2$(t.layerY).toFixed(this.getPrecision))}if(this.changeStratTSLorderStatus){var a=+e.screen2$(t.layerY).toFixed(this.getPrecision),c="Buy"===i?a>=this.hoverOrder.pendingPrice:a<=this.hoverOrder.pendingPrice;if(c){var l="Buy"===i?Math.round((a-this.hoverOrder.pendingPrice)*Ph(this.getPrecision)):Math.round((this.hoverOrder.pendingPrice-a)*Ph(this.getPrecision));this.fantomStartTSL=l}}if(this.changeTSLorderStatus){var u=+e.screen2$(t.layerY).toFixed(this.getPrecision),d="Buy"===i?u>=this.hoverOrder.pendingPrice:u<=this.hoverOrder.pendingPrice;if(d){var h="Buy"===i?Math.round((u-this.hoverOrder.pendingPrice)*Ph(this.getPrecision)):Math.round((this.hoverOrder.pendingPrice-u)*Ph(this.getPrecision));this.fantomTSL=h}}}},mousedown:function(t){if(this.start=(new Date).getTime(),this.redactOrderStatus){var e=this.hoverOrder.orderType,i=this.hoverOrder.takeProfit?this.hoverOrder.takeProfit:this.hoverOrder.pendingPrice,o=this.hoverOrder.stopLoss?this.hoverOrder.stopLoss:this.hoverOrder.pendingPrice,n=this.$props.layout.t2screen($pt(new Date(this.hoverOrder.createdDate),this.getTimeFrame||60).getTimeWithoutUTC()),s=this.$props.layout.$2screen(i),r=this.$props.layout.$2screen(o),a="Sell"===e?s+18:s-18,c="Sell"===e?r-18:r+18;if(this.changeTPorderStatus=this.hoverInCube(n-12,n+12,"Buy"===e?this.hoverOrder.takeProfit?s:a:this.hoverOrder.takeProfit?s+18:a+18,"Buy"===e?this.hoverOrder.takeProfit?s-18:a-18:this.hoverOrder.takeProfit?s:a,t.layerX,t.layerY)||this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===e?s:s+18,"Buy"===e?s-18:s,t.layerX,t.layerY)||this.hoverInCube(0,24,"Buy"===e?s:s+18,"Buy"===e?s-18:s,t.layerX,t.layerY),this.changeSLorderStatus=this.hoverInCube(n-12,n+12,"Buy"===e?this.hoverOrder.stopLoss?r+18:c+18:this.hoverOrder.stopLoss?r:c,"Buy"===e?this.hoverOrder.stopLoss?r:c:this.hoverOrder.stopLoss?r-18:c-18,t.layerX,t.layerY)||this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===e?r+18:r,"Buy"===e?r:r-18,t.layerX,t.layerY)||this.hoverInCube(0,24,"Buy"===e?r+18:r,"Buy"===e?r:r-18,t.layerX,t.layerY),this.hoverOrder.trailingStart){var l=this.hoverOrder.trailingStart,u=this.hoverOrder.trailingSL,d=this.$props.layout.$2screen("Buy"===e?this.hoverOrder.pendingPrice+l/Ph(this.getPrecision):this.hoverOrder.pendingPrice-l/Ph(this.getPrecision)),h=this.$props.layout.$2screen("Buy"===e?this.hoverOrder.pendingPrice+u/Ph(this.getPrecision):this.hoverOrder.pendingPrice-u/Ph(this.getPrecision));this.changeStratTSLorderStatus=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===e?d:d+18,"Buy"===e?d-18:d,t.layerX,t.layerY),this.changeTSLorderStatus=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===e?h:h+18,"Buy"===e?h-18:h,t.layerX,t.layerY)}this.getChangeSLorTPonChart&&this.stopChart(!0)}},mouseup:function(t){if((new Date).getTime()-this.start<270){if(this.getChangeSLorTPonChart&&(this.stopChart(!1),this.changeSLorderStatus=!1,this.changeTPorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1),!this.hoverOrder)return this.redactOrderStatus=!1,void Zh.emit("setHoverPendingOrder",this.hoverOrder);var e=this.checkClickOrder(t.layerX,t.layerY,"order"),i=this.checkClickOrder(t.layerX,t.layerY,"close"),o=this.checkClickOrder(t.layerX,t.layerY,"closeTP"),n=this.checkClickOrder(t.layerX,t.layerY,"closeSL");if(o){var s=JSON.parse(JSON.stringify(this.hoverOrder));s.takeProfit=0,this.modifyOrder(s)}if(n){var r=JSON.parse(JSON.stringify(this.hoverOrder));r.stopLoss=0,this.modifyOrder(r)}if(i&&this.closePendingOrder(this.hoverOrder),e||o||n){if(this.redactOrderStatus)return;this.redactOrderStatus=!0,this.$props.settings.storageActiveObjectsChart.setActiveObject({name:"PendingOrder",rang:2,data:this.hoverOrder})}else this.fantomSL=0,this.fantomTP=0,this.fantomStartTSL=0,this.fantomTSL=0,this.redactOrderStatus=!1,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"PendingOrder"})}else if(this.redactOrderStatus&&this.getChangeSLorTPonChart&&(this.fantomTP||this.fantomSL||this.fantomStartTSL||this.fantomTSL)){var a=JSON.parse(JSON.stringify(this.hoverOrder));this.fantomTP&&(a.takeProfit=this.fantomTP),this.fantomSL&&(a.stopLoss=this.fantomSL),this.fantomStartTSL&&(a.trailingStart=this.fantomStartTSL),this.fantomTSL&&(a.trailingSL=this.fantomTSL),this.modifyOrder(a),this.changeTPorderStatus=!1,this.changeSLorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1,this.fantomTP=0,this.fantomSL=0,this.fantomTSL=0,this.fantomStartTSL=0,this.stopChart(!1)}},mouseout:function(){this.changeTPorderStatus=!1,this.changeSLorderStatus=!1,this.changeStratTSLorderStatus=!1,this.changeTSLorderStatus=!1,this.fantomTP=0,this.fantomSL=0,this.fantomTSL=0,this.fantomStartTSL=0,this.stopChart(!1)}}},dOt=function(){function t(e){Object(Qh["a"])(this,t),this.chartComponent=e,this.shader=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.chartComponent.$props.layout;this.chartComponent.$emit("new-shader",{target:"sidebar",draw:function(i){t.drawPricePendingOrder(i,e,t.chartComponent.orderToDraw)}}),this.shader=!0}},{key:"draw",value:function(){this.shader||this.init_shader()}},{key:"drawPricePendingOrder",value:function(t,e,i){var o=this;if(i&&i.length){var n="dark"===this.chartComponent.getActiveTheme?"#151924":"#fff",s="light"===this.chartComponent.getActiveTheme?"rgba(0, 142, 114, 0.5)":"rgba(0, 255, 172, 0.5)",r="light"===this.chartComponent.getActiveTheme?"rgba(233, 18, 18, 0.5)":"rgba(250, 76, 74, 0.5)";i.forEach((function(i){var a=e.$2screen(i.pendingPrice);t.beginPath(),t.fillStyle=n,t.rect(1,a-9,t.canvas.clientWidth-1,18),t.fill(),t.beginPath(),t.strokeStyle="Sell"===i.orderType?r:s,t.rect(1,a-9,t.canvas.clientWidth-1,18),t.stroke(),t.save(),t.beginPath(),t.font="400 11px Arial",t.textBaseline="middle",t.textAlign="center",t.fillStyle="Sell"===i.orderType?r:s,t.fillText(i.pendingPrice.toFixed(o.chartComponent.getPrecision),t.canvas.clientWidth/2,a,t.canvas.clientWidth-2),t.restore()}))}}}]),t}(),hOt={mixins:[Opt["Overlay"],lOt,qe,uOt],data:function(){return{pendingOrdersByContract:[],orderToDraw:null,hoverOrder:null,hoverOrderByEvent:null,hoveredOrders:[],mouseX:null,mouseY:null,start:0,redactOrderStatus:!1,fantomTP:0,fantomSL:0,fantomStartTSL:0,fantomTSL:0,changeTPorderStatus:!1,changeSLorderStatus:!1,changeStratTSLorderStatus:!1,changeTSLorderStatus:!1,widthInfoorder:0}},watch:{getStatByOrders:function(t){t&&(this.setPendingOrdersByContract(),this.forceRedrawChart())},getDefaultAccount:function(){this.pendingOrdersByContract=[],this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getContracts:"contracts/getContracts",getSession:"auth/getSession"})),{},{getSymbol:function(){return this.$props.settings.symbol},getChangeSLorTPonChart:function(){return this.changeTPorderStatus||this.changeSLorderStatus||this.changeStratTSLorderStatus||this.changeTSLorderStatus},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).precision;return e},getTimeFrame:function(){return this._props.settings.timeFrame}}),methods:{init:function(){this.shader=new dOt(this),this.setPendingOrdersByContract(),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Overlay Pending Order"}},use_for:function(){return["PendingOrders"]},modifyOrder:function(t){var e={Command:"ModifyPendingTradingOrder",data:t,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e})},closePendingOrder:function(t){var e={Command:"CancelPendingTradingOrder",data:t,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.$orderStorage.cancelPendingOrder(t),this.setPendingOrdersByContract(t),this.redactOrderStatus=!1,this.hoverOrder=null,this.fantomTP=0,this.fantomSL=0,this.fantomStartTSL=0,this.forceRedrawChart()},hoverInCube:function(t,e,i,o,n,s){return n>=t&&n<=e&&s<=i&&s>=o},setMessageHendler:function(t){if(t&&t.command&&"BrokerPosition"===t.command){var e=t.data;e.contractName!==this.getSymbol||"Opened"!==e.status&&"Position_PoModify"!==e.reason&&"Position_PoClose"!==e.reason||(this.setPendingOrdersByContract(),"Position_PoModify"===e.reason&&this.hoverOrder&&this.hoverOrder.id===e.id&&(this.hoverOrder=e,this.fantomTP&&this.fantomTP===this.hoverOrder.takeProfit&&(this.fantomTP=0),this.fantomSL&&this.fantomSL===this.hoverOrder.stopLoss&&(this.fantomSL=0),this.fantomStartTSL&&this.fantomStartTSL===this.hoverOrder.trailingStart&&(this.fantomStartTSL=0)),this.forceRedrawChart())}},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.PendingOrders.settings",{key:new Date})},draw:function(t){this.ctx=t,this.pendingOrdersByContract.length?(this.getOrderToDraw(),this.drawPendingOrders(t,this.pendingOrdersByContract)):this.orderToDraw=null,this.shader.draw()},getOrderToDraw:function(){var t=this,e=this.$props.settings.dataSet.get("chart.data")[0],i=this.$props.sub,o=i[0],n=i[i.length-1];if(Array.isArray(i)&&Array.isArray(e)&&Array.isArray(o)&&void 0!==o[0]&&Array.isArray(n)&&void 0!==n[0]&&e[o[0]]&&e[n[0]]){var s=e[o[0]][0],r=e[n[0]][0];this.orderToDraw=this.pendingOrdersByContract.filter((function(e){var i=$pt(new Date(e.createdDate),t.getTimeFrame||60);if(i>=s&&i<=r)return e}))}},setPendingOrdersByContract:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage(),i=e.pendingOrders;i&&(this.pendingOrdersByContract=i.filter((function(e){return e.contractName===t.getSymbol})))},getProfit:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=n[o]().toFixed(2);return+s},stopChart:function(t){this._$emit("custom-event",{event:"scroll-lock",args:[t]})},checkClickOrder:function(t,e,i){if(this.hoverOrder){var o=this.$props.layout,n=this.hoverOrder.orderType,s=o.t2screen($pt(new Date(this.hoverOrder.createdDate),this.getTimeFrame||60).getTimeWithoutUTC()),r=o.$2screen(this.hoverOrder.pendingPrice),a=o.$2screen(this.hoverOrder.takeProfit),c=o.$2screen(this.hoverOrder.stopLoss);this.ctx.save(),this.ctx.font="400 10px Arial";var l=this.ctx.measureText("LIMIT ".concat(n.toUpperCase()," ").concat(this.hoverOrder.pendingPrice.toFixed(this.getPrecision))).width,u=this.ctx.measureText(this.hoverOrder.takeProfit.toFixed(this.getPrecision)).width,d=this.ctx.measureText(this.hoverOrder.stopLoss.toFixed(this.getPrecision)).width;this.ctx.restore();var h={order:this.hoverInCube(s-6,s+6,r+6,r-6,t,e),close:this.hoverInCube(l+10,l+30,r+10,r-10,t,e),closeTP:this.hoverInCube(u+24+6,u+24+6+24,"Sell"===n?a+18:a,"Sell"===n?a:a-18,t,e),closeSL:this.hoverInCube(d+24+6,d+24+6+24,"Buy"===n?c+18:c,"Buy"===n?c:c-18,t,e)};return h[i]}},checkActiveObject:function(){var t=this.$props.settings.storageActiveObjectsChart.getActiveObjects();t&&t.length&&"PendingOrder"!==t.at(-1).name&&(this.redactOrderStatus=!1,this.hoverOrder=null,this.fantomTP=0,this.fantomSL=0,this.fantomStartTSL=0,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"PendingOrder"}))},setRedactOrderByGlobalEvent:function(t){t&&t.symbol===this.getSymbol&&(this.hoverOrder=t.order,this.redactOrderStatus=!0,this.forceRedrawChart())},setHoverOrderByGlobalEvent:function(t){t&&t.symbol===this.getSymbol&&(t.id?this.hoverOrderByEvent=this.pendingOrdersByContract.find((function(e){return e.id===t.id})):this.hoverOrderByEvent=null,this.forceRedrawChart())}},mounted:function(){this.$props.settings.eventBus.subscribe("setNewActiveObject",this.checkActiveObject),Zh.subscribe("hoverPendingOrder",this.setHoverOrderByGlobalEvent),Zh.subscribe("redactPendingOrder",this.setRedactOrderByGlobalEvent)},destroyed:function(){this.$props.settings.eventBus.unsubscribe("setNewActiveObject",this.checkActiveObject),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler),Zh.unsubscribe("hoverPendingOrder",this.setHoverOrderByGlobalEvent),Zh.unsubscribe("redactPendingOrder",this.setRedactOrderByGlobalEvent)}},pOt=hOt,gOt=(i("260c"),Object(C["a"])(pOt,oOt,nOt,!1,null,"79fb3327",null)),fOt=gOt.exports,mOt=function(){var t=this,e=t._self._c;return e("div")},vOt=[],yOt=function(){function t(e){Object(Qh["a"])(this,t),this.chartComponent=e,this.shader=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.chartComponent.$props.layout;this.chartComponent.$emit("new-shader",{target:"sidebar",draw:function(i){"currentQuote"!==t.chartComponent.getStatusCurrentBar&&("dayQuote"===t.chartComponent.getStatusCurrentBar?t.drawBarIndicatorDayQuote(i,e):t.drawBarIndicatorProfit(i,e))}}),this.shader=!0}},{key:"draw",value:function(){this.shader||this.init_shader()}},{key:"drawBarIndicatorDayQuote",value:function(t){var e=this.last_bar(),i=14;t.beginPath(),t.rect(0,e.y+10,t.canvas.clientWidth,32),t.fillStyle="dark"===this.chartComponent.getActiveTheme?"#151924":"#fff",t.fill(),t.beginPath(),t.rect(0,e.y+10,t.canvas.clientWidth,32),t.strokeStyle=e.color,t.stroke(),t.save(),t.fillStyle=0===this.chartComponent.getGapByPips?this.gray():this.chartComponent.getGapByPips<0?this.red():this.green(),t.beginPath(),t.textBaseline="top",t.fillText("pip ".concat(this.chartComponent.$moneyf(this.chartComponent.getGapByPips,0)),4,e.y+10+4,t.canvas.clientWidth-8),t.beginPath(),t.fillText("".concat(this.chartComponent.$moneyf(this.chartComponent.getGapByPercent,3)," %"),4,e.y+10+i+4,t.canvas.clientWidth-8),t.restore()}},{key:"drawBarIndicatorProfit",value:function(t){var e=this.last_bar(),i=14;t.beginPath(),t.rect(1,e.y+10,t.canvas.clientWidth-2,48),t.fillStyle="dark"===this.chartComponent.getActiveTheme?"#151924":"#fff",t.fill(),t.beginPath(),t.rect(0,e.y+10,t.canvas.clientWidth,48),t.strokeStyle=e.color,t.stroke(),t.save(),t.fillStyle=0===this.chartComponent.getCurrentAbsProfit?this.gray():this.chartComponent.getCurrentAbsProfit<0?this.red():this.green(),t.beginPath(),t.textBaseline="top",t.fillText("".concat(this.chartComponent.getCurrencyChar," ").concat(this.chartComponent.$moneyf(this.chartComponent.getCurrentAbsProfit,2)),4,e.y+10+4,t.canvas.clientWidth-8),t.beginPath(),t.fillText("".concat(this.chartComponent.$moneyf(this.chartComponent.getPercentVolume,2)," %"),4,e.y+10+i+4,t.canvas.clientWidth-8),t.beginPath(),t.fillText("pip ".concat(this.chartComponent.$moneyf(this.chartComponent.getCurrentAbsProfitPip)),4,e.y+10+2*i+4,t.canvas.clientWidth-8),t.restore()}},{key:"last_bar",value:function(){var t=this.chartComponent.$props.layout,e=this.chartComponent.$props.meta.last,i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}},{key:"green",value:function(){return this.chartComponent.getGreenColor.color}},{key:"gray",value:function(){return this.chartComponent.getGrayColor.color}},{key:"red",value:function(){return this.chartComponent.getRedColor.color}}]),t}(),COt={mixins:[Opt["Overlay"],qe],data:function(){return{shader:null,ctx:null,orders:null,currentProfit:0,currentProfitPip:0,volumeClose:0,last24HClosePrice:null}},watch:{getStatusCurrentBar:function(){this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDataForWidgets:"headerSettings/getDataForWidgets",getDefaultAccount:"subscribeOrders/getDefaultAccount",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatusCurrentBar:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.currentBar},getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getSymbol:function(){return this.$props.settings.symbol},getContractBySymbol:function(){var t=this;if(this.getContracts)return this.getContracts.find((function(e){return e.name===t.getSymbol}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getPrecision:function(){if(this.getContractBySymbol){var t=this.getContractBySymbol.precision;return t}},getLast24Price:function(){var t=this;if(!this.last24HClosePrice||!this.last24HClosePrice)return 0;var e=this.last24HClosePrice.find((function(e){return e.contract===t.$props.settings.symbol}));return e?e.prices.at(-1).closePrice:0},getGapByPips:function(){return this.getLast24Price&&this.getLastPrice?Math.round((this.getLastPrice-this.getLast24Price)*Ph(this.getPrecision)):0},getGapByPercent:function(){if(!this.getLast24Price||!this.getLastPrice)return 0;var t=this.getLastPrice-this.getLast24Price;return 100*t/this.getLast24Price},getLastPrice:function(){return this.$props.meta.last?this.$props.meta.last[4]:0},getCurrentAbsProfit:function(){return this.currentProfit},getCurrentAbsProfitPip:function(){return this.currentProfitPip},getCurrentVolume:function(){return this.volumeClose},getPercentVolume:function(){return this.getCurrentAbsProfit&&this.getCurrentVolume?this.getCryptoStatus?100*this.getCurrentAbsProfit/(this.getCurrentVolume*this.getLastPrice):100*this.getCurrentAbsProfit/this.getCurrentVolume:0}}),methods:{init:function(){this.shader=new yOt(this)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Overlay for Current bar info on scale"}},use_for:function(){return["CurrentBar"]},draw:function(t){this.ctx=t,this.shader.draw()},setMessageHendler:function(t){var e=this;if(t&&t.command&&"AccountsDetails"===t.command){if(!t.data[0].statisticByContracts||!t.data[0].statisticByContracts.length)return;var i=t.data[0].statisticByContracts.find((function(t){return t.contract===e.getSymbol}));this.currentProfit=i?i.floatingProfit:0,this.currentProfitPip=i?i.floatingPip:0,this.volumeClose=i?i.volumeClose:0}},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.CurrentBar.settings",{key:new Date})}},mounted:function(){this.last24HClosePrice=JSON.parse(localStorage.getItem("Last24HClosePrice")),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},bOt=COt,SOt=(i("1f9c"),Object(C["a"])(bOt,mOt,vOt,!1,null,"272f44b3",null)),POt=SOt.exports,TOt=function(){var t=this,e=t._self._c;return e("div")},xOt=[],OOt=function(){function t(e){Object(Qh["a"])(this,t),this.chartComponent=e,this.shader=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.chartComponent.$props.layout;this.chartComponent.$emit("new-shader",{target:"sidebar",draw:function(i){t.chartComponent.getMiddlePrice&&!isNaN(t.chartComponent.getMiddlePrice)&&t.drawBarMiddlePrice(i,e)}}),this.shader=!0}},{key:"draw",value:function(){this.shader||this.init_shader()}},{key:"drawBarMiddlePrice",value:function(t){var e="dark"===this.chartComponent.getActiveTheme?"#151924":"#fff",i=this.chartComponent.$props.layout,o=this.chartComponent.getMiddlePrice,n=i.$2screen(o);t.beginPath(),t.fillStyle=e,t.rect(1,n-9,t.canvas.clientWidth-1,18),t.fill(),t.beginPath(),t.strokeStyle=this.chartComponent.getBlueColor.color,t.rect(1,n-9,t.canvas.clientWidth-1,18),t.stroke(),t.save(),t.beginPath(),t.font="400 11px Arial",t.textBaseline="middle",t.textAlign="center",t.fillStyle=this.chartComponent.getBlueColor.color,t.fillText(o,t.canvas.clientWidth/2,n,t.canvas.clientWidth-2),t.restore()}},{key:"last_bar",value:function(){var t=this.chartComponent.$props.layout,e=this.chartComponent.$props.meta.last,i=t.$2screen(e[4]);return{y:i,price:e[4],color:e[4]>=e[1]?this.green():this.red()}}},{key:"green",value:function(){return this.chartComponent.getGreenColor.color}},{key:"gray",value:function(){return this.chartComponent.getGrayColor.color}},{key:"red",value:function(){return this.chartComponent.getRedColor.color}}]),t}(),wOt={mixins:[Opt["Overlay"],qe],data:function(){return{ctx:null,tradingOrders:null,shader:null}},watch:{getStatByOrders:function(t){var e=this;if(t){var i=this.$orderStorage.getOrdersOnStorage().tradingOrders;this.tradingOrders=i.filter((function(t){return t.contractName===e.getSymbol})),this.forceRedrawChart()}},getDefaultAccount:function(){this.tradingOrders=null,this.forceRedrawChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getContracts:"contracts/getContracts"})),{},{getSymbol:function(){return this.$props.settings.symbol},getContractBySymbol:function(){var t=this;if(this.getContracts)return this.getContracts.find((function(e){return e.name===t.getSymbol}))},getPrecision:function(){if(this.getContractBySymbol){var t=this.getContractBySymbol.precision;return t}},getMiddlePrice:function(){if(this.tradingOrders&&this.tradingOrders.length){var t=this.tradingOrders.reduce((function(t,e){return e.volume+t}),0),e=this.tradingOrders.reduce((function(t,e){return e.openPrice*e.volume+t}),0);return+(e/t).toFixed(this.getPrecision)}}}),methods:{init:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage().tradingOrders;this.tradingOrders=e.filter((function(e){return e.contractName===t.getSymbol})),this.shader=new OOt(this)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Overlay for Middle price open orders"}},use_for:function(){return["MiddlePrice"]},setMessageHendler:function(t){var e=this;if(t&&t.command&&"BrokerPosition"===t.command){var i=t.data;if("openedOrder"===i.typeNoti&&i.contractName===this.getSymbol){var o=this.$orderStorage.getOrdersOnStorage().tradingOrders;this.tradingOrders=o.filter((function(t){return t.contractName===e.getSymbol}))}}},draw:function(t){this.ctx=t,this.drawMiddleLine(t),this.shader.draw()},drawMiddleLine:function(t){if(this.getMiddlePrice&&!isNaN(this.getMiddlePrice)){var e=this.$props.layout,i=e.$2screen(this.getMiddlePrice);t.beginPath(),t.moveTo(0,i),t.lineTo(t.canvas.clientWidth,i),t.strokeStyle=this.getBlueColor.color,t.lineWidth=1,t.stroke()}},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.MiddlePrice.settings",{key:new Date})}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHendler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},_Ot=wOt,AOt=(i("7637"),Object(C["a"])(_Ot,TOt,xOt,!1,null,"d2c4e682",null)),DOt=AOt.exports,kOt=function(){var t=this,e=t._self._c;return e("div")},IOt=[],BOt={mixins:[Opt["Overlay"]],data:function(){return{mouseEvents:[]}},methods:{init:function(){},draw:function(t){this.ctx=t},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Mouse watcher"}},use_for:function(){return["MouseWatcher"]},setMouseEvent:function(t){if(this.mouseEvents.length){var e=this.mouseEvents.findIndex((function(e){return e.name===t.name}));-1!==e?this.mouseEvents.splice(e,1,t):this.mouseEvents.push(t)}else this.mouseEvents.push(t);var i=this.mouseEvents.some((function(t){return"hover"===t.event})),o=this.mouseEvents.some((function(t){return"move"===t.event}));this.ctx&&(o&&(this.ctx.canvas.style.cursor="move"),i&&!o&&(this.ctx.canvas.style.cursor="pointer"),o||i||(this.ctx.canvas.style.cursor=""))}},mounted:function(){this.$props.settings.eventBus.subscribe("mouseEvent",this.setMouseEvent)},destroyed:function(){this.$props.settings.eventBus.unsubscribe("mouseEvent",this.setMouseEvent)}},MOt=BOt,$Ot=Object(C["a"])(MOt,kOt,IOt,!1,null,null,null),LOt=$Ot.exports,FOt=function(){var t=this,e=t._self._c;return e("div")},jOt=[],ROt="M5 3.5L5 2.5L4 2.5L4 3.5L5 3.5ZM5 5.5L5 4.5L4 4.5L4 5.5L5 5.5ZM3 4.5L3 5.5L2 5.5L2 4.5L3 4.5ZM3 3.5L3 2.5L2 2.5L2 3.5L3 3.5ZM1 2.5L1 3.5L1.19249e-08 3.5L0 2.5L1 2.5ZM5 7.5L5 6.5L4 6.5L4 7.5L5 7.5Z",WOt="M4 5.5L5 5.5L5 4.5L4 4.5L4 5.5ZM2 5.5L3 5.5L3 4.5L2 4.5L2 5.5ZM3 3.5L2 3.5L2 2.5L3 2.5L3 3.5ZM4 3.5L5 3.5L5 2.5L4 2.5L4 3.5ZM5 1.5L4 1.5L4 0.5L5 0.5L5 1.5ZM0 5.5L1 5.5L1 4.5L8.74228e-08 4.5L0 5.5Z",NOt="M17.3 8.1a.99.99 0 1 0-1.4-1.4L12 10.6 8.1 6.7a.99.99 0 1 0-1.4 1.4l3.9 3.9-3.9 3.9a.99.99 0 1 0 1.4 1.4l3.9-3.9 3.9 3.9a.99.99 0 1 0 1.4-1.4L13.4 12l3.9-3.9z",EOt={methods:{drawCreateOpenOrder:function(t,e){var i=this.$props.layout,o=i.t2screen(this.getCurrentDate),n=i.$2screen(this.getCurrentPrice),s=i.$2screen(this.order.creatingPrice);this.drawTrailingSL(t,s,e),this.drawStopLoss(t,i,o,n,e),this.drawTakeProfit(t,i,o,n,e)},drawStopLoss:function(t,e,i,o,n){var s=n.orderType,r=n.stopLoss?n.stopLoss:this.getCurrentPrice,a=n.stopLoss?this.getProfit(n.creatingPrice,n.stopLoss,n.volume,n.orderType):0;"Sell"===s?this.drawWithRangeZone(t,i,o,r,"#EE204D","rgba(238,32,77, 0.05)","SL",!0,"up",a):this.drawWithRangeZone(t,i,o,r,"#EE204D","rgba(238,32,77, 0.05)","SL",!0,"down",a)},drawTakeProfit:function(t,e,i,o,n){var s=n.orderType,r=n.takeProfit?n.takeProfit:this.getCurrentPrice,a=n.takeProfit?this.getProfit(n.creatingPrice,n.takeProfit,n.volume,n.orderType):0;"Sell"===s?this.drawWithRangeZone(t,i,o,r,"dark"===this.getActiveTheme?this.getGreenColor.color:"green","light"===this.getActiveTheme?"rgba(0, 142, 114, 0.03)":"rgba(0, 255, 172, 0.03)","TP",!0,"down",a):this.drawWithRangeZone(t,i,o,r,"dark"===this.getActiveTheme?this.getGreenColor.color:"green","light"===this.getActiveTheme?"rgba(0, 142, 114, 0.03)":"rgba(0, 255, 172, 0.03)","TP",!0,"up",a)},drawTrailingSL:function(t,e,i){if(i.trailingStart){var o=i.orderType,n="Buy"===o?+(i.creatingPrice+i.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision):+(i.creatingPrice-i.trailingStart/Ph(this.getPrecision)).toFixed(this.getPrecision),s="Buy"===o?+(i.creatingPrice+i.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision):+(i.creatingPrice-i.trailingSL/Ph(this.getPrecision)).toFixed(this.getPrecision);this.drawWithRangeZoneOnSacle(t,0,e,n,this.getBlueColor.color,this.getBlueColor.fill,"TS",!0,"Buy"===o?"up":"down","START ".concat(n," (").concat(i.trailingStart,")"),s),this.drawWithRangeZoneOnSacle(t,0,e,s,this.getBlueColor.color,this.getBlueColor.fill,"TS",!1,"Buy"===o?"up":"down","SL ".concat(s," (").concat(i.trailingSL,")"),null)}},drawWithRangeZone:function(t,e,i,o,n,s,r,a,c,l){var u=this.$props.layout,d=a?u.$2screen(o):o,h=0;if(a&&(t.beginPath(),t.strokeStyle=n,t.moveTo(e,i),t.lineTo(e,"down"===c?d+18:d-18),t.stroke()),t.beginPath(),t.fillStyle=n,t.rect(0,"down"===c?d:d-18,24,18),t.fill(),a?(t.beginPath(),t.fillStyle=n,t.rect(e-12,"down"===c?d:d-18,24,18),t.fill()):(t.beginPath(),t.fillStyle=n,t.rect(e-12,"down"===c?d+14:d-32,24,18),t.fill()),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?d:d-18,24,18),t.fill(),l&&(t.save(),t.font="400 12px Arial",t.textAlign="right",t.beginPath(),t.fillText("$ ".concat(this.$moneyf(l)),t.canvas.clientWidth-27,"up"===c?d-6:d+14),t.restore()),a&&(t.beginPath(),t.fillStyle=s,t.moveTo(1,i+1),t.lineTo(t.canvas.clientWidth,i+1),t.lineTo(t.canvas.clientWidth,"down"===c?d-1:d+1),t.lineTo(1,"down"===c?d-1:d+1),t.fill()),t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",a?t.fillText(r,e-10,"down"===c?d+14:d-8):t.fillText(r,e-10,"down"===c?d+28:d-22),t.fillText(r,t.canvas.clientWidth-22,"down"===c?d+14:d-8),t.fillText(r,2,"down"===c?d+14:d-8),t.restore(),a&&(t.save(),h=t.measureText(o.toFixed(this.getPrecision)).width,("TP"===r&&this.order.takeProfit||"SL"===r&&this.order.stopLoss)&&(t.beginPath(),t.textAlign="left",t.fillStyle=n,t.font="400 12px Arial",t.fillText(o.toFixed(this.getPrecision),28,"down"===c?d+15:d-5)),t.beginPath(),t.setLineDash([2,2]),t.moveTo(29,d),t.lineTo(t.canvas.clientWidth-24,d),t.stroke(),t.restore()),"TP"===r&&this.order.takeProfit||"SL"===r&&this.order.stopLoss){var p=new Path2D(NOt);t.save(),t.translate(h+33,"down"===c?d-1:d-22),t.fillStyle=n,t.fill(p),t.restore()}var g=new Path2D("down"===c?WOt:ROt);t.save(),t.translate(17,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore(),a?(t.save(),t.translate(e+5,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()):(t.save(),t.translate(e+5,"down"===c?d+25:d-32),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()),t.save(),t.translate(t.canvas.clientWidth-7,"down"===c?d+11:d-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(g),t.restore()},drawWithRangeZoneOnSacle:function(t,e,i,o,n,s,r,a,c,l,u){var d=this.$props.layout,h=d.$2screen(o);if(t.beginPath(),t.strokeStyle=n,t.moveTo(t.canvas.clientWidth,i),t.lineTo(t.canvas.clientWidth,"down"===c?h+18:h-18),t.stroke(),t.beginPath(),t.fillStyle=n,t.rect(t.canvas.clientWidth-24,"down"===c?h:h-18,24,18),t.fill(),a){var p=d.$2screen(u);t.beginPath(),t.fillStyle=s,t.moveTo(e+1,p),t.lineTo(t.canvas.clientWidth,p),t.lineTo(t.canvas.clientWidth,"down"===c?h-1:h+1),t.lineTo(e+1,"down"===c?h-1:h+1),t.fill()}t.save(),t.beginPath(),t.textAlign="left",t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.font="dark"===this.getActiveTheme?"800 9px Arial":"400 9px Arial",t.fillText(r,t.canvas.clientWidth-22,"down"===c?h+14:h-8),t.restore(),t.fill(),t.save(),t.beginPath(),t.fillStyle=n,t.font="400 9px Arial",t.textAlign="left";var g=t.measureText(l).width;t.fillText(l,t.canvas.clientWidth-28-g,"down"===c?h+7:h),t.fill(),t.beginPath(),t.setLineDash([2,2]),t.moveTo(e,h),t.lineTo(t.canvas.clientWidth-g-32,h),t.stroke(),t.restore(),t.save();var f=new Path2D("down"===c?WOt:ROt);t.translate(t.canvas.clientWidth-7,"down"===c?h+11:h-18),t.fillStyle="dark"===this.getActiveTheme?"#333":"#fff",t.fill(f),t.restore()}}},UOt={methods:{checkMouseCursorOnTakeProfit:function(t,e,i,o,n){return this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Sell"===i?e+24:e,"Sell"===i?e:e-24,o,n)||this.hoverInCube(0,24,"Sell"===i?e+24:e,"Sell"===i?e:e-24,o,n)||this.hoverInCube(t-12,t+12,"Sell"===i?e+24:e,"Sell"===i?e:e-24,o,n)},checkMouseCursorOnStopLoss:function(t,e,i,o,n){return this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Sell"===i?e:e+24,"Sell"===i?e-24:e,o,n)||this.hoverInCube(0,24,"Sell"===i?e:e+24,"Sell"===i?e-24:e,o,n)||this.hoverInCube(t-12,t+12,"Sell"===i?e:e+24,"Sell"===i?e-24:e,this.mouseX,this.mouseY)},changeMouseCursorOnOrderSettings:function(t,e,i){var o=[],n=t.orderType,s=t.takeProfit?t.takeProfit:this.getCurrentPrice,r=t.stopLoss?t.stopLoss:this.getCurrentPrice,a=this.$props.layout.t2screen(this.getCurrentDate),c=this.$props.layout.$2screen(s),l=this.$props.layout.$2screen(r);if(this.checkMouseCursorOnTakeProfit(a,c,n,e,i)&&o.push("TakeProfit"),this.checkMouseCursorOnStopLoss(a,l,n,e,i)&&o.push("StopLoss"),t.trailingStart){var u=t.trailingStart,d=t.trailingSL,h=this.$props.layout.$2screen("Buy"===n?t.creatingPrice+u/Ph(this.getPrecision):t.creatingPrice-u/Ph(this.getPrecision)),p=this.$props.layout.$2screen("Buy"===n?t.creatingPrice+d/Ph(this.getPrecision):t.creatingPrice-d/Ph(this.getPrecision)),g=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===n?h:h+18,"Buy"===n?h-18:h,e,i),f=this.hoverInCube(this.ctx.canvas.clientWidth-24,this.ctx.canvas.clientWidth,"Buy"===n?p:p+18,"Buy"===n?p-18:p,e,i);g&&o.push("TrailingStart"),f&&o.push("TrailingSL")}return o},changeMouseCursorOnCloseSettings:function(t,e,i){var o=[];if(t.stopLoss){var n=this.ctx.measureText(t.stopLoss).width,s=this.hoverInCube(n+30,n+54,"Sell"===t.orderType?this.$props.layout.$2screen(t.stopLoss):this.$props.layout.$2screen(t.stopLoss)+24,"Sell"===this.order.orderType?this.$props.layout.$2screen(t.stopLoss)-24:this.$props.layout.$2screen(t.stopLoss),e,i);s&&o.push("closeStopLosss")}if(t.takeProfit){var r=this.ctx.measureText(t.takeProfit).width,a=this.hoverInCube(r+30,r+54,"Buy"===t.orderType?this.$props.layout.$2screen(t.takeProfit):this.$props.layout.$2screen(t.takeProfit)+24,"Buy"===this.order.orderType?this.$props.layout.$2screen(t.takeProfit)-24:this.$props.layout.$2screen(t.takeProfit),e,i);a&&o.push("closeTakeProfit")}return o},mousemove:function(t){var e=this.$props.layout;if(this.mouseX=t.layerX,this.mouseY=t.layerY,this.order){var i=this.changeMouseCursorOnOrderSettings(this.order,this.mouseX,this.mouseY),o=this.changeMouseCursorOnCloseSettings(this.order,this.mouseX,this.mouseY);if(i.length&&!o.length?this.$props.settings.eventBus.emit("mouseEvent",{name:"CreateOpenOrder",event:"move"}):!i.length&&o.length?this.$props.settings.eventBus.emit("mouseEvent",{name:"CreateOpenOrder",event:"hover"}):this.$props.settings.eventBus.emit("mouseEvent",{name:"CreateOpenOrder",event:null}),this.getChangeSLorTPonChart){var n=this.order.orderType;if(this.changeTPorderStatus){var s=+e.screen2$(t.layerY).toFixed(this.getPrecision),r="Buy"===n?s>=this.getCurrentPrice:s<=this.getCurrentPrice;r&&(this.order.takeProfit=s)}if(this.changeSLorderStatus){var a=+e.screen2$(t.layerY).toFixed(this.getPrecision),c="Buy"===n?a<=this.getCurrentPrice:a>=this.getCurrentPrice;c&&(this.order.stopLoss=a)}if(this.changeTralingStart){var l=+e.screen2$(t.layerY).toFixed(this.getPrecision),u="Buy"===n?l>=this.getCurrentPrice:l<=this.getCurrentPrice;if(u){var d="Buy"===n?Math.round((l-this.order.creatingPrice)*Ph(this.getPrecision)):Math.round((this.order.creatingPrice-l)*Ph(this.getPrecision));this.order.trailingStart=d}}if(this.changeTralingSL){var h=+e.screen2$(t.layerY).toFixed(this.getPrecision),p="Buy"===n?h>=this.getCurrentPrice:h<=this.getCurrentPrice;if(p){var g="Buy"===n?Math.round((h-this.order.creatingPrice)*Ph(this.getPrecision)):Math.round((this.order.creatingPrice-h)*Ph(this.getPrecision));this.order.trailingSL=g}}}}},mouseup:function(t){if((new Date).getTime()-this.start<270){if(this.order){if(this.order.takeProfit){var e=this.ctx.measureText(this.order.takeProfit).width,i=this.hoverInCube(e+30,e+54,"Buy"===this.order.orderType?this.$props.layout.$2screen(this.order.takeProfit):this.$props.layout.$2screen(this.order.takeProfit)+24,"Buy"===this.order.orderType?this.$props.layout.$2screen(this.order.takeProfit)-24:this.$props.layout.$2screen(this.order.takeProfit),t.layerX,t.layerY);i&&(this.order.takeProfit=0)}if(this.order.stopLoss){var o=this.ctx.measureText(this.order.stopLoss).width,n=this.hoverInCube(o+30,o+54,"Sell"===this.order.orderType?this.$props.layout.$2screen(this.order.stopLoss):this.$props.layout.$2screen(this.order.stopLoss)+24,"Sell"===this.order.orderType?this.$props.layout.$2screen(this.order.stopLoss)-24:this.$props.layout.$2screen(this.order.stopLoss),t.layerX,t.layerY);n&&(this.order.stopLoss=0)}}}else this.getChangeSLorTPonChart&&(this.clearRedactSetting(),this.stopChart(!1))},mousedown:function(t){if(this.start=(new Date).getTime(),this.order){var e=this.changeMouseCursorOnOrderSettings(this.order,t.layerX,t.layerY);this.changeTPorderStatus=!!e.length&&e.some((function(t){return"TakeProfit"===t})),this.changeSLorderStatus=!!e.length&&e.some((function(t){return"StopLoss"===t})),this.order.trailingStart&&(this.changeTralingStart=!!e.length&&e.some((function(t){return"TrailingStart"===t})),this.changeTralingSL=!!e.length&&e.some((function(t){return"TrailingSL"===t}))),this.getChangeSLorTPonChart&&this.stopChart(!0)}}}},VOt=function(){function t(e){Object(Qh["a"])(this,t),this.chartComponent=e,this.shader=!1}return Object(Jh["a"])(t,[{key:"init_shader",value:function(){var t=this,e=this.chartComponent.$props.layout;this.chartComponent.$emit("new-shader",{target:"sidebar",draw:function(i){t.drawCreateOrder(i,e,t.chartComponent.order)}}),this.shader=!0}},{key:"draw",value:function(){this.shader||this.init_shader()}},{key:"drawCreateOrder",value:function(t,e,i){if(i){var o="dark"===this.chartComponent.getActiveTheme?this.chartComponent.getGreenColor.color:"green",n="dark"===this.chartComponent.getActiveTheme?"#EE204D":"red";if(t.restore(),i.takeProfit){var s=e.$2screen(i.takeProfit);t.beginPath(),t.fillStyle=o,t.rect(1,"Sell"===i.orderType?s:s-18,t.canvas.clientWidth-1,18),t.fill(),t.save(),t.beginPath(),t.font="400 11px Arial",t.textBaseline="Sell"===i.orderType?"top":"bottom",t.textAlign="center",t.fillStyle="dark"===this.chartComponent.getActiveTheme?"#333":"#fff",t.fillText(i.takeProfit.toFixed(this.chartComponent.getPrecision),t.canvas.clientWidth/2,"Sell"===i.orderType?s+4:s-3,t.canvas.clientWidth-2),t.restore()}if(i.stopLoss){var r=e.$2screen(i.stopLoss);t.beginPath(),t.fillStyle=n,t.rect(1,"Sell"===i.orderType?r-18:r,t.canvas.clientWidth-1,18),t.fill(),t.save(),t.beginPath(),t.font="400 11px Arial",t.textBaseline="Buy"===i.orderType?"top":"bottom",t.textAlign="center",t.fillStyle="#fff",t.fillText(i.stopLoss.toFixed(this.chartComponent.getPrecision),t.canvas.clientWidth/2,"Buy"===i.orderType?r+4:r-3,t.canvas.clientWidth-2),t.restore()}}}}]),t}(),HOt={mixins:[Opt["Overlay"],EOt,qe,UOt],data:function(){return{order:null,changeTPorderStatus:!1,changeSLorderStatus:!1,changeTralingStart:!1,changeTralingSL:!1,modeTakeProfit:"USD",modeStopLoss:"USD",start:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts"})),{},{getChangeSLorTPonChart:function(){return this.changeTPorderStatus||this.changeSLorderStatus||this.changeTralingStart||this.changeTralingSL},getCurrentPrice:function(){return this.$props.meta.last?this.$props.meta.last.at(-1):0},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.getSymbol})).precision;return e},getSymbol:function(){return this.$props.settings.symbol},getCurrentDate:function(){return this.$props.meta.last?this.$props.meta.last[0]:(new Date).getTime()}}),methods:{init:function(){this.shader=new VOt(this)},meta_info:function(){return{author:"Toptrader",version:"1.00",desc:"Trades overlay create open order"}},getProfit:function(t,e,i,o){var n={Sell:function(){return(t-e)*i},Buy:function(){return(e-t)*i}},s=n[o]().toFixed(2);return+s},use_for:function(){return["CreateOpenOrder"]},draw:function(t){this.ctx=t,this.order&&(this.drawCreateOpenOrder(t,this.order),this.shader.draw())},stopChart:function(t){this._$emit("custom-event",{event:"scroll-lock",args:[t]})},clearRedactSetting:function(){this.changeTPorderStatus=!1,this.changeSLorderStatus=!1,this.changeTralingStart=!1,this.changeTralingSL=!1},setOrder:function(t){t?(this.order=t,this.order.creatingPrice=this.getCurrentPrice,this.$props.settings.storageActiveObjectsChart.setActiveObject({name:"CreateOpenOrder",rang:1,data:this.order})):(this.order=null,this.$props.settings.storageActiveObjectsChart.deleteActiveObject({name:"CreateOpenOrder"}))},changeOrder:function(){this.forceRedrawChart()},hoverInCube:function(t,e,i,o,n,s){return n>=t&&n<=e&&s<=i&&s>=o},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.CreateOpenOrder.settings",{key:new Date})}},mounted:function(){this.$props.settings.eventBus.subscribe("setOpenOrder",this.setOrder),this.$props.settings.eventBus.subscribe("changeOpenOrder",this.changeOrder)},destroyed:function(){this.$props.settings.eventBus.unsubscribe("setOpenOrder",this.setOrder),this.$props.settings.eventBus.unsubscribe("changeOpenOrder",this.changeOrder)}},GOt=HOt,qOt=(i("f557"),Object(C["a"])(GOt,FOt,jOt,!1,null,"5debffda",null)),zOt=qOt.exports,YOt=function(){var t=this,e=t._self._c;return t.modalNews?e("div",{staticClass:"overlay-news",style:{position:"absolute",left:"".concat(t.modalNews.left,"px"),bottom:"20px",maxHeight:"".concat(t.modalNews.height,"px"),height:"fit-content",width:"320px"}},[e("ListNews",{attrs:{settings:t.modalNews},on:{close:t.closeModalListNews}})],1):t._e()},XOt=[],QOt={methods:{drawNews:function(t){if(this.getStatusNews&&this.aggregateNews&&this.getServerTime){var e=new Date(this.getServerTime.now).getTime();for(var i in this.aggregateNews){var o=this.$props.layout.t2screen(+i),n=this.$props.layout.$2screen(this.$props.layout.$_lo)-20,s=this.getColors[this.getTheMostNews(this.aggregateNews[i])];(this.getStatusNewsHistory||!this.getStatusNewsHistory&&e<+i)&&this.drawAllNews(t,o,n,s,this.aggregateNews[i],+i,e)}}},drawAllNews:function(t,e,i,o,n,s,r){var a=this,c=[this.getFerstNews(n).currencyCode,this.getTimeNews(s)],l=12,u=(2*e+l+.4*l)/2,d=(2*i-l-.4*l)/2;this.drawCircleWithLabel(t,e,i,o,c,l,"stroke",6),n.length>1&&this.drawCircleWithLabel(t,u,d,o,"".concat(n.length),5,"fill",7);var h=(s-r)/6e4,p=(s-r)/1e3;if(p<=1&&p>=0){this.drawTimer(t,e,i+l,o,p.toFixed());var g=this.listException.find((function(t){return t===s}));g||(this.modalNews||(this.modalNews={paramName:"ModalListNews",top:84,onlyTop:!0,left:e-340,news:JSON.parse(JSON.stringify(n)),height:72*n.length+20>this.ctx.canvas.clientHeight-60?this.ctx.canvas.clientHeight-60:72*n.length+20,withButtonClose:!0}),setTimeout((function(){return a.modalNews=null}),5e4),this.listException.push(s))}else h<=60&&h>0&&this.drawTimer(t,e,i+l,o,h.toFixed())},drawOldNews:function(t,e,i){if(e){var o=this.$props.layout.t2screen(e[0]),n=this.$props.layout.$2screen(e[2]);this.drawRectOldNews(t,o,n,i),this.drawLabelOldNews(t,o,n)}},drawRectOldNews:function(t,e,i,o){return t.beginPath(),t.rect(e-5,i-10,10,10),t.fillStyle=o,t.fill(),{x:e,y:i-5}},drawLabelOldNews:function(t,e,i){t.save(),t.beginPath(),t.fillStyle="#000",t.font="bold 8px Arial",t.fillText("N",e-2.8,i-1.8),t.restore()},drawBoxTimer:function(t,e,i,o,n,s){return t.beginPath(),t.moveTo(e,i),t.lineTo(e,i+n),t.lineTo(e+s,i+n),t.lineTo(e+s,i),t.closePath(),t.arc(e,i,20,0,2*Math.PI),t.fillStyle=o,t.fill(),{bottomY:i+n}},drawTimer:function(t,e,i,o,n){t.font="14px Arial";var s=15,r=70+s/2;this.drawCountTimer(t,e,r,n,o),this.drawDashLineToUp(t,e,i-20,60+s+24,o),this.drawCircle(t,e,r,s,"stroke",o)},drawCountTimer:function(t,e,i,o,n){0!==o?(t.beginPath(),t.fillStyle=n,t.fillText("".concat(o),e-t.measureText("".concat(o)).width/2,i+5)):this.drawWarningCountTime(t,e,i,this.countSec)},drawWarningCountTime:function(t,e,i,o){o<=0||(t.beginPath(),t.fillStyle="white",t.fillText("".concat(o),e-t.measureText("".concat(o)).width/2,i+5))},drawDashLineToUp:function(t,e,i,o,n){t.beginPath(),t.lineWidth=.5,t.moveTo(e,i-5),t.lineTo(e,o-5),t.strokeStyle=n,t.stroke(),t.beginPath(),t.moveTo(e,0),t.lineTo(e,o-40),t.stroke(),t.lineWidth=1},drawCircleWithLabel:function(t,e,i,o,n,s,r,a){var c=a||.55*s,l=Array.isArray(n)?[e,e]:e-t.measureText(n).width/2;this.drawCircle(t,e,i,s,r,o),this.drawLabelForCircle(t,l,i,"stroke"===r?o:"#000",n,c)},drawCircle:function(t,e,i,o,n,s){return t.beginPath(),t["".concat(n,"Style")]=s,t.strokeStyle=s,t.arc(e,i,o,0,2*Math.PI),t[n](),{x:e,y:i,r:o}},drawLabelForCircle:function(t,e,i,o,n,s){Array.isArray(n)?(t.save(),t.textAlign="center",t.font="".concat(s,"px Arial"),t.beginPath(),t.fillStyle=o,t.fillText(n[0],e[0],i-3+.22*s),t.font="6px Arial",t.fillText(n[1],e[1],i-3+.42*s+7),t.restore()):(t.save(),t.textAlign="left",t.font="".concat(s,"px Arial"),t.beginPath(),t.fillStyle=o,t.fillText(n,e,i+.42*s),t.restore())}}},JOt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"cnt-news-drag"},[e("DxDraggable",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.clickOutside,expression:"clickOutside"}],style:{zIndex:1},attrs:{height:"".concat(t.settings.height,"px")},on:{dragStart:t.dragStart,dragEnd:t.dragEnd}},[e("div",{staticClass:"modal-list-news",style:{height:"".concat(t.settings.height,"px")}},[e("div",{staticClass:"modal-list-news__info",class:t.getActiveTheme},[e("div",[t._v(t._s("".concat(t.getTimeGroupNews," - ").concat(t.settings.news.length," events")))]),t.settings.withButtonClose?e("div",{style:{marginLeft:"8px",height:"12px",marginBottom:"-1px",cursor:"pointer"},on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",size:12}})],1):t._e()]),e("div",{staticClass:"modal-list-news__list"},t._l(t.settings.news,(function(i){return e("div",{staticClass:"modal-list-news__item",class:t.getActiveTheme},[e("div",{staticClass:"modal-list-news__importance",style:{background:t.getColors[i.importance]}}),e("div",{staticClass:"modal-list-news__container",class:t.getActiveTheme},[e("div",{staticClass:"modal-list-news__title",class:t.getActiveTheme},[t._v(t._s(i.eventName))]),e("div",{staticClass:"modal-list-news__description",class:t.getActiveTheme},[t._v(t._s("".concat(t.numberToTime(new Date(i.releaseDate).getUTCHours()),":").concat(t.numberToTime(new Date(i.releaseDate).getUTCMinutes())," Actual: ").concat(i.actualValue,", Previos: ").concat(i.previousValue," Impact: ").concat(i.impactValue)))])])])})),0)])])],1)},KOt=[],ZOt={name:"ModalListNews",mixins:[],components:{DxDraggable:Se.a},props:["settings"],mounted:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},destroyed:function(){},methods:{dragStart:function(){this.noClose=!0},dragEnd:function(){var t=this;setTimeout((function(){t.noClose=!1}),250)},clickOutside:function(){this.settings.withButtonClose||this.close()},close:function(){this.noClose||this.$emit("close")},numberToTime:function(t){var e="".concat(t);return 1===e.length?"0".concat(e):e}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPosition:function(){return{top:"".concat(10,"px"),left:"".concat(this.settings.left,"px"),zIndex:10}},getTimeGroupNews:function(){var t=this.numberToTime(new Date(this.settings.news[0].aggregateStrTime).getHours()),e=this.numberToTime(new Date(this.settings.news[0].aggregateStrTime).getMinutes());return"".concat(new Date(this.settings.news[0].aggregateStrTime).toLocaleDateString()," ").concat(t,":").concat(e)},getColors:function(){return"dark"===this.getActiveTheme?{high:"#FF4444",medium:"#FFF280",low:"#8FA8C1"}:{high:"#E91212",medium:"#FFE600",low:"#B2B2B2"}}}),watch:{},data:function(){return{noClose:!0}}},twt=ZOt,ewt=(i("9ba6"),Object(C["a"])(twt,JOt,KOt,!1,null,null,null)),iwt=ewt.exports,owt={components:{ListNews:iwt},name:"News",mixins:[Opt["Overlay"],QOt],data:function(){return{modalNews:null,news:[],countSec:59,listException:[],ctx:null}},watch:{getTimeFrame:function(){this.aggregateNews=this.getAggregateNews(this.news),this.forceRedrawChart()},getStatusNews:function(t){t&&this.getNews(),this.forceRedrawChart()},getStatusNewsHistory:function(){this.getNews()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings",getServerTime:"serverTime/getServerTime",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",apiUri:"api/api",getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatusNews:function(){return this.getBottomControlPanelSettings.news},getStatusNewsHistory:function(){return this.getBottomControlPanelSettings.newsHistory},getTimeFrame:function(){return this.$props.settings.timeFrame},getSymbol:function(){return this.$props.settings.symbol},getOffsetX:function(){var t=this;return function(e){var i=new Date(e).getTime();return t.$props.layout.t2screen(i)}},getStatusHightImportance:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"hightImportance"===t.name}));return!t||t.isActive}},getStatusMiddleImportance:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"middleImportance"===t.name}));return!t||t.isActive}},getStatusLowImportance:function(){if(this.getConfigMenuLeftBarTradingChart){var t=this.getConfigMenuLeftBarTradingChart.find((function(t){return"lowImportance"===t.name}));return!t||t.isActive}},getColors:function(){return"dark"===this.getActiveTheme?{high:"#FF4444",medium:"#FFF280",low:"#8FA8C1",none:"#8FA8C1"}:{high:"#E91212",medium:"#FA860A",low:"#B2B2B2",none:"#B2B2B2"}}}),methods:{meta_info:function(){return{author:"TopTrader",version:"1.0.0"}},use_for:function(){return["News"]},draw:function(t){this.ctx=t,this.drawNews(t)},forceRedrawChart:function(){this.$props.settings.dataSet.merge("onchart.News.settings",{key:new Date})},getTheMostNews:function(t){return t.reduce((function(t,e){var i={low:0,none:0,medium:1,height:5};return t=i[t]>i[e.importance]?t:e.importance,t}),"low")},findForKeyInObject:function(t,e){var i;for(var o in t)if(e(o)){i=o;break}return i},mousedown:function(t){var e=this;if(this.aggregateNews&&this.getStatusNews){var i=this.$props.layout.$2screen(this.$props.layout.$_lo)-20,o=this.findForKeyInObject(this.aggregateNews,(function(o){return e.onCircle(e.$props.layout.t2screen(+o),i,t.layerX,t.layerY,12)}));o&&this.openModalListNews(this.aggregateNews[o],t)}},closeModalListNews:function(){this.modalNews=null},openModalListNews:function(t,e,i){var o=i||e.layerX,n=this.ctx.canvas.offsetWidth-o,s=n>340?o:o-340;this.modalNews={paramName:"ModalListNews",top:this.ctx.canvas.offsetHeight-64,left:s,news:JSON.parse(JSON.stringify(t)),height:72*t.length+20>this.ctx.canvas.clientHeight-60?this.ctx.canvas.clientHeight-60:72*t.length+20}},onCircle:function(t,e,i,o,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2))=t&&n<=e&&s<=i&&s>=o}},mounted:function(){this.$socketStream.events.subscribe("streamWS",this.setMessageHendler),this.getStatusStreams&&this.getStreamsByContract()},destroyed:function(){this.$socketStream.events.unsubscribe("streamWS",this.setMessageHendler)}},hwt=dwt,pwt=(i("2b3e"),Object(C["a"])(hwt,awt,cwt,!1,null,"f71f8884",null)),gwt=pwt.exports,fwt=[oxt,POt,gwt,lxt,Pxt,Dxt,jxt,Vxt,iOt,fOt,LOt,zOt,DOt,rwt],mwt=function(){var t=this,e=t._self._c;return e("div",{ref:"topBarMultiChart",staticClass:"topBarMultiChart",class:t.dataQuoteButton.selected&&"one-chart-first"!==t.typeMultiChart?"topBarMultiChart_".concat(t.getActiveTheme," topBarMultiChart-select_").concat(t.getActiveTheme):"topBarMultiChart_".concat(t.getActiveTheme)},[e("div",{staticClass:"topBarMultiChart-leftSideMenu",on:{mouseleave:t.hiddenGroupButton}},["one-chart-first"===t.typeMultiChart||t.getShowStatusWigetsContracts?t._e():e("div",{class:"topBarMultiChart-dragButton topBarMultiChart-dragButton_".concat(t.getActiveTheme),attrs:{id:"sortable-chart"}},[e("svgIcon",{attrs:{name:"Drag"}})],1),t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])&&t.getStatByContract?e("DxButton",{attrs:{icon:t.$iconPath("Wigets"),hoverStateEnabled:!1,elementAttr:{class:"topBarMultiChart-buttonItem ".concat(t.getShowStatusWigetsContracts?"topBarMultiChart-buttonItem_isActive-".concat(this.getActiveTheme):"topBarMultiChart-buttonItem_isIconActive_".concat(this.getActiveTheme))}},on:{click:t.openWigetsContract}}):t._e(),t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])&&t.getStatByContract?e("DxButton",{attrs:{icon:t.$iconPath("holow-pig"),hoverStateEnabled:!1,elementAttr:{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_isIconActive_".concat(this.getActiveTheme)}},on:{click:t.openPigForContract}}):t._e(),t._l(t.getDropDownsComponents,(function(i,o){return e(i.component,{key:o+"dd",tag:"component",class:"topBarMultiChart-dropDown-".concat(t.dataQuoteButton.id),attrs:{position:i.position,content:i.content,size:i.size,defaultSelected:i.defaultSelected},on:{clickIcon:function(e){return t.onSelectListItem(e,i.content.keyOptions)}}})})),"one-chart-first"!==t.typeMultiChart?e("ButtonInfo",{attrs:{dataBtn:t.dataQuoteButton,modePosition:"selectButton",containerForGroupButtons:".topBarMultiChart-leftSideMenu",statusGroupButtons:t.statusGroupButtons,userStatus:t.statusUser,symbol:t.dataQuoteButton.symbol,last24HClosePrice:t.last24HClosePrice,ordersForAccount:t.ordersForAccount,mode:t.getModeButtonInfo,modifier:"group flat selectField"},on:{setStatusGroupButtons:t.setStatusGroupButtons}},[t._v(t._s(t.dataQuoteButton.symbol))]):t._e(),e("div",{staticClass:"topBarMultiChart-leftSideMenu__fullMode"},[t.getShowUserStatus(["unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"])?e("DxButton",{attrs:{icon:t.$iconPath("ordersWidget"),elementAttr:t.getClassForLeftButton,disabled:!t.getOrderByFilter},on:{click:t.openOrdersPanel}}):t._e(),t._l(t.listButtons,(function(i,o){return e(i.component,{key:"".concat(o,"_lb"),ref:i.icon,refInFor:!0,tag:"component",attrs:{icon:t.$iconPath(i.icon),elementAttr:t.getClassForLeftButton,id:"buttonItem_".concat(t.dataQuoteButton.id,"-").concat(i.icon),disabled:i.disabled},on:{click:function(e){return t.eventButtonHendler(e,i.hendler)}}})})),t.listDropDown[0].items.length?e("DxMenu",{key:t.listDropDown[0].items.length,attrs:{items:t.listDropDown},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",[e(o.component,{tag:"component",attrs:{icon:t.$iconPath(o.icon),elementAttr:o.name?t.getClassForButtonSettingMenu:t.getClassForRightButton},on:{click:function(e){return t.eventButtonHendler(e,o.hendler)}}})],1)]}}],null,!1,626723932)}):t._e()],2)],2),t.showRightSideMenu&&"one-chart-first"!==t.typeMultiChart&&!t.getShowStatusWigetsContracts?e("div",{staticClass:"topBarMultiChart-rightSideMenu"},[e("DxButton",{attrs:{icon:t.getIconForFullScreen,elementAttr:t.getClassForRightButton},on:{click:t.setFullScreen}}),e("DxButton",{attrs:{icon:t.$iconPath("Close"),elementAttr:t.getClassForRightButton},on:{click:t.removeChart}})],1):t._e(),t.statusContractWidget?e("div",{staticClass:"topBarMultiChart-widgetContract"},[e("ButtonIconFlat",{attrs:{icon:{name:"normal"===this.topBarWidgetParams.row?"Expand":"Unexpand"},modifier:{class:["topBarMultiChart-buttonItem","topBarMultiChart-buttonItem_".concat(this.getActiveTheme)]}},on:{click:t.setFullScreenMode}})],1):t._e(),t.getWidthWrap<438?e("div",{class:"topBarMultiChart-shadowBlock topBarMultiChart-shadowBlock_".concat(t.getActiveTheme)}):t._e()])},vwt=[],ywt={components:{DxMenu:Iat.a,DxButton:cc.a,ButtonInfo:lat,DropdownSelectIcon:Zrt},props:{dataQuoteButton:{require:!0},typeMultiChart:{type:String},statusContractWidget:{type:Boolean},topBarWidgetParams:{type:Object,default:function(){return{row:"full"}}},fullScreen:{default:!1},statusUser:{type:Object},groupId:{require:!1}},mixins:[Xh],data:function(){return{wrapWidth:0,statusInfoWidgetContract:!1,allTypes:Vrt,timeFrames:ES,chartTypes:US,last24HClosePrice:[],ordersForAccount:null,resizeObserver:null,modeMinimazeUser:!1,showRightSideMenu:!0,showMinimazeMenu:!1,listButtons:[],listDropDown:[{id:"1",name:"",component:"DxButton",icon:"Settings",items:[]}],statusGroupButtons:""}},watch:{getActiveTheme:function(){var t=this;this.showRightSideMenu=!1,this.$nextTick((function(){t.showRightSideMenu=!0}))},getStatusWidgetsAccount:function(t){t&&this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!1})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",getUsingAccountContracts:"contracts/getUsingAccountContracts",getStatusWidgetsContracts:"settingsTradingChart/getStatusWidgetsContracts",getStatusWidgetsAccount:"settingsTradingChart/getStatusWidgetsAccount",getContracts:"contracts/getContracts",getStatusStatByContract:"contracts/getStatusStatByContract"})),{},{getClassForLeftButton:function(){return Object(Vt["a"])({class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_".concat(this.getActiveTheme)},"data-info","buttonIcon-".concat(this.dataQuoteButton.id))},getWidthWrap:function(){return this.wrapWidth},getStatByContract:function(){var t=this;if(this.getUsingAccountContracts&&this.getStatusStatByContract){var e=JSON.parse(sessionStorage.getItem("statContract".concat(this.dataQuoteButton.symbol))),i=this.getUsingAccountContracts.some((function(e){return e===t.dataQuoteButton.symbol}));return e&&e.length&&i}},getShowStatusWigetsContracts:function(){return this.getStatusWidgetsContracts.status},getIconForFullScreen:function(){return this.fullScreen?this.$iconPath("Unexpand"):this.$iconPath("Expand")},getClassForRightButton:function(){return{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItem_".concat(this.getActiveTheme)}},getCountOrders:function(){if(this.ordersForAccount)return this.ordersForAccount.length},getOrderByFilter:function(){var t=this;if(this.ordersForAccount&&this.ordersForAccount.length)return this.ordersForAccount.some((function(e){return e.instrumentName===t.dataQuoteButton.symbol}))},getClassForButtonSettingMenu:function(){return{class:"topBarMultiChart-buttonItem topBarMultiChart-buttonItemMenu_".concat(this.getActiveTheme)}},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getActiveQuotes:function(){return this.getActiveScreenInfo.activeButtons},getActiveMultiChartQuotes:function(){return this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.find((function(t){return t.selected})).setButtons},getModeButtonInfo:function(){return"owner"===this.statusUser.status?this.getTradingTopBarSettings.modeButtonInfo:"averPrice"},getDropDownSetTimeFrame:function(){return{width:"120px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-dropDown-".concat(this.dataQuoteButton.id),offset:{x:20,y:0}},items:ES,keyOptions:"timeFrame"}},getDropDownList:function(){return{width:"196px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-settingsDropDown-".concat(this.dataQuoteButton.id),offset:{x:0,y:0}},items:this.listDropDown,keyOptions:"type"}},getDropDownSetChartType:function(){return{width:"196px",container:".topBarMultiChart",position:{my:"top center",at:"bottom center",of:".topBarMultiChart-dropDown-".concat(this.dataQuoteButton.id),offset:{x:57,y:0}},items:US,keyOptions:"type"}},getStaticButtonWidth:function(){var t="one-chart-first"===this.typeMultiChart?0:"compact"===this.getTradingTopBarSettings.modeButtonInfo?110:185,e="one-chart-first"===this.typeMultiChart?this.getStatByContract?160:64:this.getStatByContract?280:152;return t+e},getDropDownsComponents:function(){var t=this;return[{component:"DropdownSelectIcon",type:"timeFrame",content:this.getDropDownSetTimeFrame,position:this.getDropDownSetTimeFrame.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:ES.find((function(e){return e.timeFrame===t.dataQuoteButton.timeFrame})).timeFrame},{component:"DropdownSelectIcon",type:"chartType",content:this.getDropDownSetChartType,position:this.getDropDownSetChartType.position,elementAttr:{class:"groupButtonForButtonInfo-dropDown groupButtonForButtonInfo-dropDown_".concat(this.getActiveTheme)},size:{width:"32px",height:"32px"},defaultSelected:this.chartTypes.find((function(e){return e.type===t.dataQuoteButton.chartType})).type}]},getButtons:function(){return[{component:"DxButton",name:"Trading-open-new-order",userStatus:["unauthTradingghost","authTradingowner","authUserProfileowner"],id:"1_6",icon:"Trading-open-new-order",hendler:"newOrder",disabled:!1},{component:"DxButton",name:"Limitorder",userStatus:["authTradingowner","authUserProfileowner"],id:"1_6",icon:"Limitorder",hendler:"newPendingOrder",disabled:!1},{component:"DxButton",name:"Zoom-in",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_7",icon:"Zoom-in",hendler:"zoomIn",disabled:!1},{component:"DxButton",name:"Zoom-out",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_8",icon:"Zoom-out",hendler:"zoomOut",disabled:!1,status:!0},{component:"DxButton",name:"Color",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_10",icon:"Color",hendler:"",disabled:!1},{component:"DxButton",name:"Instrument-indicator",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_12",icon:"Instrument-indicator",hendler:"openModalIndicators",disabled:!1},{component:"DxButton",name:"Sync_1",userStatus:["unauthTradingghost","unauthUserProfileghost","authUserProfileghost","authTradingowner","authUserProfileowner"],id:"1_9",icon:"Sync_1",hendler:"resetChart",disabled:!1,status:!0}]}}),methods:{setFullScreenMode:function(){this.$emit("setFullScreenMode")},hiddenGroupButton:function(){this.statusGroupButtons=""},resetChart:function(){this.$emit("resetChart")},zoomIn:function(){this.$emit("zoomIn",{screen:this.dataQuoteButton})},zoomOut:function(){this.$emit("zoomOut",{screen:this.dataQuoteButton})},setStatusGroupButtons:function(t){this.statusGroupButtons=t},openModalIndicators:function(){this.$store.dispatch("modal/switchIndicatorsModal")},openPigForContract:function(){this.$store.dispatch("modal/setPopupData",{visible:!0,payload:this.dataQuoteButton.symbol,modalComponentName:"UserProfileEquityBalanceContractWidget",title:"Баланс/Средства по ".concat(this.dataQuoteButton.symbol),width:"80%",height:"90%"})},openWigetsContract:function(){this.getShowStatusWigetsContracts?this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!1}):this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:this.dataQuoteButton,status:!0})},openMinimazeMenu:function(){this.showMinimazeMenu=!this.showMinimazeMenu},clickOutside:function(t){this.$el.contains(t.target)&&27!==t.keyCode||this.showMinimazeMenu&&(this.showMinimazeMenu=!1)},setDropDownHendler:function(t,e,i){this[e](t,i)},switchModeLeftSide:function(){this.modeMinimazeUser=!this.modeMinimazeUser},eventButtonHendler:function(t,e){"function"===typeof this[e]&&this[e](t)},setMessageHendler:function(t){t&&t.command&&"BrokerPosition"===t.command&&this.debouncer("setOrdersForAccount",500)},setOrdersForAccount:function(){this.ordersForAccount=null,this.ordersForAccount=this.$orderStorage.getOrdersOnStorage().tradingOrders},removeChart:function(){var t=this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.findIndex((function(t){return t.selected}));this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"removeNewButtonInMultichartSet",data:{fromIndex:t,btn:this.dataQuoteButton}}),this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewTypeChartForActiveScreen",data:{indexActiveScreen:this.getActiveScreenInfo,indexActiveSet:this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.findIndex((function(t){return t.selected})),data:this.allTypes[this.getActiveMultiChartQuotes.length-1][0].name}}),this.$emit("removeChart")},setFullScreen:function(){this.$emit("setFullScreen",this.dataQuoteButton.id)},setMenuHendler:function(t){t.itemData.hendler?this[t.itemData.hendler]():!t.itemData.hendler&&t.itemData.type&&this.onSelectListItem(t.itemData,t.itemData.timeFrame?"timeFrame":"chartType")},onSelectListItem:function(t,e){this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewOptionForButtonQuoteActiveScreen",data:{id:this.dataQuoteButton.id,keyOption:"timeFrame"===e?"timeFrame":"chartType",newValue:t.type},role:this.statusUser})},newOrder:function(){this.$emit("createOrder")},newPendingOrder:function(){this.$emit("createPendingOrder")},openOrdersPanel:function(){this.$store.dispatch("modal/switchOrdersPanel",{status:!0,data:{symbol:this.dataQuoteButton.symbol,role:this.statusUser,target:"buttonIcon-".concat(this.dataQuoteButton.id)}})},ver:function(){var t=new ResizeObserver(this.onResize);t.observe(this.$refs.topBarMultiChart),this.resizeObserver=t},getShowUserStatus:function(t){var e="".concat(this.statusUser.user).concat(this.statusUser.route).concat(this.statusUser.status);return t.some((function(t){return t===e}))},onResize:function(){var t=this,e=this.$refs.topBarMultiChart.clientWidth-this.getStaticButtonWidth,i=Math.floor(e/32);this.wrapWidth=this.$refs.topBarMultiChart.clientWidth,this.listButtons=[],this.listDropDown[0].items=[],this.getButtons.forEach((function(e,o){o=i&&t.getShowUserStatus(e.userStatus)&&t.listDropDown[0].items.push(e)}))}},mounted:function(){var t=this;this.$socketStream.$on("apiWS",this.setMessageHendler),this.$orderStorage.getOrdersOnStorage()&&(this.ordersForAccount=this.$orderStorage.getOrdersOnStorage().tradingOrders),this.last24HClosePrice=JSON.parse(localStorage.getItem("Last24HClosePrice")),this.$nextTick((function(){t.ver()})),window.addEventListener("click",this.clickOutside)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHendler)},beforeDestroy:function(){this.resizeObserver&&this.resizeObserver.unobserve(this.$refs.topBarMultiChart),window.removeEventListener("click",this.clickOutside)}},Cwt=ywt,bwt=(i("9e36"),Object(C["a"])(Cwt,mwt,vwt,!1,null,null,null)),Swt=bwt.exports,Pwt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CopyPendingOrders"},[e("DxPopup",{attrs:{visible:t.copyOrdersPopupStatus,position:{my:"top right",at:"top right",of:".Multichart-chartContainer_".concat(t.idChart),offset:{x:-60,y:t.getPosition}},container:".CopyPendingOrders",dragOutsideBoundary:!0,shading:!1,width:"230",height:"auto"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"CopyPendingOrders-copyTitle",class:"CopyPendingOrders-copyTitle_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Drag"}}),t._v("Копировать лимитный ордер")],1)]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"CopyPendingOrders-copyPopup",class:"CopyPendingOrders-copyPopup_".concat(t.getActiveTheme)},[e("div",{staticClass:"CopyPendingOrders-copyControls"},[e("div",{staticClass:"CopyPendingOrders-copyControl"},[e("div",{staticClass:"CopyPendingOrders-setCopyLabel",class:"CopyPendingOrders-setCopyLabel_".concat(t.getActiveTheme)},[t._v("Копии")]),e("div",{staticClass:"CopyPendingOrders-setCopy",class:"CopyPendingOrders-setCopy_".concat(t.getActiveTheme)},[e("div",{staticClass:"CopyPendingOrders-setCopy-control",class:"CopyPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.removeCopyOrder}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"text",readonly:""},domProps:{value:t.copyOrders}}),e("div",{staticClass:"CopyPendingOrders-setCopy-control",class:"CopyPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.addCopyOrder}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"CopyPendingOrders-setCopyLabel",class:"CopyPendingOrders-setCopyLabel_".concat(t.getActiveTheme)},[e("div",{staticClass:"CopyPendingOrders-setCopyLabel-forex"},[t._v("Шаг, pip")])]),e("div",{staticClass:"CopyPendingOrders-setCopy",class:"CopyPendingOrders-setCopy_".concat(t.getActiveTheme)},[e("div",{staticClass:"CopyPendingOrders-setCopy-control",class:"CopyPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.removeCopyStep,mousedown:function(e){return t.downChange("copyStepRemove","removeCopyStep",[])},mouseup:function(e){return t.clearThrottle("copyStepRemove")},mouseleave:function(e){return t.clearThrottle("copyStepRemove")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"number",placeholder:"1"},domProps:{value:t.stepCopyOrder},on:{input:t.setManualCopyStep}}),e("div",{staticClass:"CopyPendingOrders-setCopy-control",class:"CopyPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.addCopyStep,mousedown:function(e){return t.downChange("copyStepAdd","addCopyStep",[])},mouseup:function(e){return t.clearThrottle("copyStepAdd")},mouseleave:function(e){return t.clearThrottle("copyStepAdd")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])]),e("div",{staticClass:"CopyPendingOrders-copyDirection"},[e("div",{staticClass:"CopyPendingOrders-setCopyLabel",class:"CopyPendingOrders-setCopyLabel_".concat(t.getActiveTheme)},[t._v("Направление")]),e("div",{staticClass:"CopyPendingOrders-copyDirectionControl"},[e("ButtonIconFlat",{attrs:{modifier:{class:"up"===t.getCopyDirection?["CopyPendingOrders-controlDirection","CopyPendingOrders-controlDirection_isActive_".concat(t.getActiveTheme)]:["CopyPendingOrders-controlDirection","CopyPendingOrders-controlDirection_".concat(t.getActiveTheme)]},icon:{name:"Arrow-expand-top"}},on:{click:function(e){return t.setDirection("up")}}}),e("ButtonIconFlat",{attrs:{modifier:{class:"down"===t.getCopyDirection?["CopyPendingOrders-controlDirection","CopyPendingOrders-controlDirection_isActive_".concat(t.getActiveTheme)]:["CopyPendingOrders-controlDirection","CopyPendingOrders-controlDirection_".concat(t.getActiveTheme)]},icon:{name:"Arrow-expand-bottom"}},on:{click:function(e){return t.setDirection("down")}}})],1)])]),e("div",{staticClass:"CopyPendingOrders-copyButtons"},[e("ButtonIconFlat",{attrs:{modifier:{class:["CopyPendingOrders-copyButton","CopyPendingOrders-copyButton_".concat(t.getActiveTheme)]},icon:{name:"Check",color:t.getGreenColor.color}},on:{click:t.closePopup}},[t._v("Применить")]),e("ButtonIconFlat",{attrs:{modifier:{class:["CopyPendingOrders-copyButton","CopyPendingOrders-copyButton_".concat(t.getActiveTheme)]},icon:{name:"Close",color:t.getRedColor.color}},on:{click:t.clearCloneOrders}},[t._v("Отмена")])],1)])]},proxy:!0}])})],1)},Twt=[],xwt={components:{DxPopup:wt["DxPopup"]},props:{copyOrdersPopupStatus:{default:!1},configCopyOrderPopup:{type:Object},avpPips:{type:Number},eventEmitter:{default:null},idChart:{default:""}},mixins:[qe],data:function(){return{copyDirection:0,copyOrders:0,stepCopyOrder:50,copyStepAdd:null,copyStepRemove:null,doubleMode:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts"})),{},{getPosition:function(){var t;return null!==(t=this.configCopyOrderPopup)&&void 0!==t&&t.position?this.configCopyOrderPopup.position+20:0},getSymbol:function(){return this.configCopyOrderPopup.order.contractName},getCopyDirection:function(){return this.copyDirection?this.copyDirection:this.configCopyOrderPopup.direction}}),methods:{downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},setManualCopyStep:function(t){t.target.value?this.stepCopyOrder=Math.round(+t.target.value):this.stepCopyOrder=1,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.getCopyDirection})},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},removeCopyOrder:function(){var t=this.configCopyOrderPopup.order.cloneOrders?this.configCopyOrderPopup.order.cloneOrders[0].length+this.configCopyOrderPopup.order.cloneOrders[1].length:0;0!==t&&(t--,this.eventEmitter.emit("removeClonePendingOrder",this.getCopyDirection))},addCopyOrder:function(){var t=this.configCopyOrderPopup.order.cloneOrders?this.configCopyOrderPopup.order.cloneOrders[0].length+this.configCopyOrderPopup.order.cloneOrders[1].length:0;15!==t&&(t++,this.eventEmitter.emit("addClonePendingOrder",{stepCopyOrder:this.stepCopyOrder,direction:this.getCopyDirection}))},removeCopyStep:function(){var t=Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips);this.stepCopyOrder<=1||this.stepCopyOrder<=t||(this.stepCopyOrder-=t,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.getCopyDirection}))},addCopyStep:function(){var t=Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips);this.stepCopyOrder+=t,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.getCopyDirection})},clearCloneOrders:function(){this.eventEmitter.emit("clearClonePendingOrders"),this.copyOrders=0,this.stepCopyOrder=Math.ceil(this.avpPips)},setDirection:function(t){this.copyDirection!==t&&(this.copyDirection=t)},closePopup:function(){this.$emit("closePopup")},setCountCopyOrders:function(){this.configCopyOrderPopup.order.cloneOrders?this.copyOrders=this.configCopyOrderPopup.order.cloneOrders[0].length+this.configCopyOrderPopup.order.cloneOrders[1].length:this.copyOrders=0}},mounted:function(){this.stepCopyOrder=Math.ceil(this.avpPips),this.eventEmitter.subscribe("addClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.subscribe("removeClonePendingOrder",this.setCountCopyOrders),this.configCopyOrderPopup.order.cloneOrders&&(this.configCopyOrderPopup.order.cloneOrders[0].length||this.configCopyOrderPopup.order.cloneOrders[1].length)&&(this.copyOrders=this.configCopyOrderPopup.order.cloneOrders[0].length+this.configCopyOrderPopup.order.cloneOrders[1].length,this.copyDirection=this.configCopyOrderPopup.order.cloneOrders[0].length?"up":"down")},destroyed:function(){this.eventEmitter.unsubscribe("removeClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.unsubscribe("addClonePendingOrder",this.setCountCopyOrders)}},Owt=xwt,wwt=(i("5c48"),Object(C["a"])(Owt,Pwt,Twt,!1,null,null,null)),_wt=wwt.exports,Awt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CreatePendingOrder"},[e("DxPopup",{attrs:{visible:t.createPendingOrderPopupStatus,position:t.getPosition,container:".Trading",dragOutsideBoundary:!0,shading:!1,width:"260",height:"auto"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"CreatePendingOrder-title",class:"CreatePendingOrder-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-dragIcon",class:"CreatePendingOrder-dragIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"CreatePendingOrder-titlePart"},[t._v(t._s("Лимитные ордера ".concat(t.getSymbol)))]),e("div",{staticClass:"CreatePendingOrder-titlePart"},[e("div",{staticClass:"CreatePendingOrder-helpIcon",class:"CreatePendingOrder-helpIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"FAQ-16"}})],1),e("div",{staticClass:"CreatePendingOrder-closeIcon",class:"CreatePendingOrder-closeIcon_".concat(t.getActiveTheme),on:{click:t.closeCreatedPopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"CreatePendingOrder-content",class:"CreatePendingOrder-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-typeOrder"},t._l(t.buttonTypesOrder,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["CreatePendingOrder-typeButton",i.type===t.getTypeOrder?"CreatePendingOrder-typeButton_isActive_".concat(t.getTypeOrder,"_").concat(t.getActiveTheme):"CreatePendingOrder-typeButton_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setTypeOrder(i.type)}}},[t._v(t._s(i.text))])})),1),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Ожидаемая цена")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings"},[e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.removePricePoint,mousedown:function(e){return t.downChange("throttlStatus","removePricePoint",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"text",readonly:""},domProps:{value:t.createdOrder.price}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.addPricePoint,mousedown:function(e){return t.downChange("throttlStatus","addPricePoint",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])])]),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Объем инвестирования")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings"},[e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-setting-label",class:"CreatePendingOrder-setting-label_".concat(t.getActiveTheme),staticStyle:{"min-width":"4.5rem"}},[t._v("Объём")]),e("div",{staticClass:"CreatePendingOrder-setting-controlWrap"},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!1)},mousedown:function(e){return t.downChange("throttlStatus","calcVolumeCreatedOrder",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),"checkbox"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],staticStyle:{width:"12rem"},attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.getVolumeValue)?t._i(t.getVolumeValue,null)>-1:t.getVolumeValue},on:{change:function(e){var i=t.getVolumeValue,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.getVolumeValue=i.concat([s])):r>-1&&(t.getVolumeValue=i.slice(0,r).concat(i.slice(r+1)))}else t.getVolumeValue=n}}}):"radio"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],staticStyle:{width:"12rem"},attrs:{type:"radio"},domProps:{checked:t._q(t.getVolumeValue,null)},on:{change:function(e){t.getVolumeValue=null}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.getVolumeValue,expression:"getVolumeValue"}],staticStyle:{width:"12rem"},attrs:{type:t.getVolumeStep>=1?"text":"number"},domProps:{value:t.getVolumeValue},on:{input:function(e){e.target.composing||(t.getVolumeValue=e.target.value)}}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!0)},mousedown:function(e){return t.downChange("throttlStatus","calcVolumeCreatedOrder",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),e("div",{staticClass:"CreatePendingOrder-ddButtonStepVolume",class:"CreatePendingOrder-ddButtonStepVolume_".concat(t.getActiveTheme," CreatePendingOrder-ddButtonStepVolume_").concat(t.idChart)},[e("DxSelectBox",{attrs:{items:t.getVolumsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".CreatePendingOrder-content",position:{my:"top right",at:"bottom right",of:".CreatePendingOrder-ddButtonStepVolume_".concat(t.idChart)},width:"5.7rem",height:"19.2rem",minHeight:"19.2rem"},onValueChanged:t.setVolumeOnList},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"CreatePendingOrder-ddButtonList-item",class:o===t.createdOrder.volume?"CreatePendingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"CreatePendingOrder-ddButtonList-item_".concat(t.getActiveTheme),style:{borderBottom:o===t.getVolumsList.at(-1)?"none":"light"===t.getActiveTheme?"1px solid #f6f6f6":"1px solid #000"}},[t._v(t._s(t.$moneyf(o)))])]}}])})],1)])]),e("div",{staticClass:"CreatePendingOrder-setting-addData"},[t.getStepWarningMessage||t.getMinVolumeWarning||t.getMaxVolumeWarning?t._e():e("div",{staticClass:"CreatePendingOrder-setting-addDataValue",style:{color:t.createdOrder.volume?t.getBlueColor.color:t.getRedColor.color}},[t._v(t._s(t.getVolumeByValue))]),t.getStepWarningMessage?e("div",{staticClass:"CreatePendingOrder-setting-addDataValue",style:{color:t.getOrangeColor.color}},[t._v(t._s("объём должен быть кратен ".concat(t.getVolumeStep)))]):t._e(),t.getMinVolumeWarning?e("div",{staticClass:"CreatePendingOrder-setting-addDataValue",style:{color:t.getRedColor.color}},[t._v(t._s("объём должен быть больше ".concat(t.getMinVolume)))]):t._e(),t.getMaxVolumeWarning?e("div",{staticClass:"CreatePendingOrder-setting-addDataValue",style:{color:t.getRedColor.color}},[t._v(t._s("объём должен быть меньше ".concat(t.getMaxVolume)))]):t._e()]),e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-top":"0.6rem"}},[e("div",{staticClass:"CreatePendingOrder-setting-label",class:"CreatePendingOrder-setting-label_".concat(t.getActiveTheme),staticStyle:{"min-width":"4.5rem"}},[t._v("Прирост")]),e("div",{staticClass:"CreatePendingOrder-setting-controlWrap"},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcStepVolumeCreatedOrder(!1)},mousedown:function(e){return t.downChange("throttlStatus","calcStepVolumeCreatedOrder",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),"checkbox"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],staticStyle:{width:"12rem"},attrs:Object(Vt["a"])({type:"text"},"type","checkbox"),domProps:{checked:Array.isArray(t.getStepVolumeValue)?t._i(t.getStepVolumeValue,null)>-1:t.getStepVolumeValue},on:{change:function(e){var i=t.getStepVolumeValue,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.getStepVolumeValue=i.concat([s])):r>-1&&(t.getStepVolumeValue=i.slice(0,r).concat(i.slice(r+1)))}else t.getStepVolumeValue=n}}}):"radio"===(t.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],staticStyle:{width:"12rem"},attrs:Object(Vt["a"])({type:"text"},"type","radio"),domProps:{checked:t._q(t.getStepVolumeValue,null)},on:{change:function(e){t.getStepVolumeValue=null}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.getStepVolumeValue,expression:"getStepVolumeValue"}],staticStyle:{width:"12rem"},attrs:Object(Vt["a"])({type:"text"},"type",t.getVolumeStep>=1?"text":"number"),domProps:{value:t.getStepVolumeValue},on:{input:function(e){e.target.composing||(t.getStepVolumeValue=e.target.value)}}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcStepVolumeCreatedOrder(!0)},mousedown:function(e){return t.downChange("throttlStatus","calcStepVolumeCreatedOrder",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),e("div",{staticClass:"CreatePendingOrder-ddButtonStepVolume",class:"CreatePendingOrder-ddButtonVolume CreatePendingOrder-ddButtonStepVolume_".concat(t.getActiveTheme," CreatePendingOrder-ddButtonVolume_").concat(t.idChart)},[e("DxSelectBox",{attrs:{items:t.getStepVolumsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".CreatePendingOrder-content",position:{my:"top right",at:"bottom right",of:".CreatePendingOrder-ddButtonVolume_".concat(t.idChart)},width:"5rem",height:"14.4rem"},onValueChanged:t.setStepVolumeOnList},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"CreatePendingOrder-ddButtonList-item",class:o===t.createdOrder.volumeStep?"CreatePendingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"CreatePendingOrder-ddButtonList-item_".concat(t.getActiveTheme),style:{borderBottom:o===t.getStepVolumsList.at(-1)?"none":"light"===t.getActiveTheme?"1px solid #f6f6f6":"1px solid #000"}},[t._v(t._s(t.$moneyf(o)))])]}}])})],1)])])])]),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Установка TP и SL уровней")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings"},[e("div",{staticClass:"CreatePendingOrder-settingWrap"},[e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-right":"0.4rem"}},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("div",{style:{lineHeight:"2.2rem",color:t.getGreenColor.color}},[t._v("TP")]),e("input",{style:{width:"5.7rem",color:t.getGreenColor.color},attrs:{type:"number"},domProps:{value:t.createdOrder.takeProfit},on:{input:t.changePriceTakeProfitManual}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("div",{style:{lineHeight:"2.2rem",color:t.getRedColor.color}},[t._v("SL")]),e("input",{style:{width:"5.7rem",color:t.getRedColor.color},attrs:{type:"number"},domProps:{value:t.createdOrder.stopLoss},on:{input:t.changePriceStopLossManual}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])])])]),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Активная защита ордера")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings"},[e("div",{staticClass:"CreatePendingOrder-settingWrap"},[e("DxCheckBox",{attrs:{"element-attr":{class:"CreatePendingOrder_checkBox CreatePendingOrder_checkBox_".concat(t.getActiveTheme)},value:t.getDefenceStatus,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setDefenceStatus}}),e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-right":"0.4rem"}},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:t.getDefenceStatus?"CreatePendingOrder-setting-control_".concat(t.getActiveTheme):"CreatePendingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"number",readonly:!t.getDefenceStatus},domProps:{value:t.createdOrder.trailingStart},on:{input:t.changeManualPriceTralingStart}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:t.getDefenceStatus?"CreatePendingOrder-setting-control_".concat(t.getActiveTheme):"CreatePendingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:t.getDefenceStatus?"CreatePendingOrder-setting-control_".concat(t.getActiveTheme):"CreatePendingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"number",readonly:!t.getDefenceStatus},domProps:{value:t.createdOrder.trailingSL},on:{input:t.changeManualPriceTralingSL}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:t.getDefenceStatus?"CreatePendingOrder-setting-control_".concat(t.getActiveTheme):"CreatePendingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])],1)])]),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Копии")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings",staticStyle:{display:"flex"}},[e("div",{staticClass:"CreatePendingOrder-copySettingWrap"},[e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-setting-label",class:"CreatePendingOrder-setting-label_".concat(t.getActiveTheme)},[t._v("Кол-во")]),e("div",{staticClass:"CreatePendingOrder-setting-controlWrap"},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.removeCopyOrder}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"10.2rem"},attrs:{type:"text",readonly:""},domProps:{value:t.copyOrders}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.addCopyOrder}},[e("svgIcon",{attrs:{name:"Add"}})],1)])]),e("div",{staticClass:"CreatePendingOrder-setting",class:"CreatePendingOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-top":"0.4rem"}},[e("div",{staticClass:"CreatePendingOrder-setting-label",class:"CreatePendingOrder-setting-label_".concat(t.getActiveTheme)},[t._v("Шаг PIP")]),e("div",{staticClass:"CreatePendingOrder-setting-controlWrap"},[e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.removeCopyStep,mousedown:function(e){return t.downChange("throttlStatus","removeCopyStep",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"10.2rem"},attrs:{type:"number",placeholder:"1"},domProps:{value:t.stepCopyOrder},on:{input:t.setManualCopyStep}}),e("div",{staticClass:"CreatePendingOrder-setting-control",class:"CreatePendingOrder-setting-control_".concat(t.getActiveTheme),on:{click:t.addCopyStep,mousedown:function(e){return t.downChange("throttlStatus","addCopyStep",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])])]),e("div",{staticClass:"CreatePendingOrder-copyDirection"},[e("div",{staticClass:"CreatePendingOrder-copyDirectionControl"},[e("ButtonIconFlat",{attrs:{modifier:{class:"up"===t.copyDirection?["CreatePendingOrder-controlDirection","CreatePendingOrder-controlDirection_isActive_".concat(t.getActiveTheme)]:["CreatePendingOrder-controlDirection","CreatePendingOrder-controlDirection_".concat(t.getActiveTheme)]},icon:{name:"Arrow-expand-top"}},on:{click:function(e){return t.setDirection("up")}}}),e("ButtonIconFlat",{attrs:{modifier:{class:"down"===t.copyDirection?["CreatePendingOrder-controlDirection","CreatePendingOrder-controlDirection_isActive_".concat(t.getActiveTheme)]:["CreatePendingOrder-controlDirection","CreatePendingOrder-controlDirection_".concat(t.getActiveTheme)]},icon:{name:"Arrow-expand-bottom"}},on:{click:function(e){return t.setDirection("down")}}})],1)])])]),e("div",{staticClass:"CreatePendingOrder-settingBox",class:"CreatePendingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-title",class:"CreatePendingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CreatePendingOrder-settingBox-titleText",class:"CreatePendingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Таймер")])]),e("div",{staticClass:"CreatePendingOrder-settingBox-settings"},[e("div",{staticClass:"CreatePendingOrder-setTimeWrapper"},[e("div",{staticClass:"CreatePendingOrder-setTimeButtons"},t._l(t.getButtonSetTimeList,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["CreatePendingOrder-setTimeButton",t.liveTime===i.value?"CreatePendingOrder-setTimeButton_isActive_".concat(t.getActiveTheme):"CreatePendingOrder-setTimeButton_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setLiveTime(i.value)}}},[t._v(t._s(i.title))])})),1),e("div",{staticClass:"CreatePendingOrder-setTimeList"},[e("div",{staticClass:"CreatePendingOrder-setTimeButtonList",class:"CreatePendingOrder-setTimeButtonList_".concat(t.getActiveTheme),on:{click:t.openSetTimeList}},[e("svgIcon",{attrs:{name:"Horizontal_dots",size:18}})],1)]),e("DxPopup",{attrs:{visible:t.setTimeListPopupStatus,position:{my:"bottom right",at:"top right",of:".CreatePendingOrder-setTimeList"},container:".CreatePendingOrder-content",dragOutsideBoundary:!1,shading:!1,showTitle:!1,width:"auto",height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"CreatePendingOrder-setTimeListPopup"},t._l(t.getSetTimeList,(function(i,o){return e("div",{key:o,staticClass:"CreatePendingOrder-ddButtonList-item",class:t.liveTime===i.value?"CreatePendingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"CreatePendingOrder-ddButtonList-item_".concat(t.getActiveTheme),on:{click:function(e){return t.setLiveTime(i.value)}}},[t._v(t._s(i.title))])})),0)]},proxy:!0}])})],1)])]),e("div",{staticClass:"CreatePendingOrder-footer"},[e("ButtonIconFlat",{attrs:{modifier:{class:["CreatePendingOrder-placeButton","CreatePendingOrder-placeButton_".concat(t.createdOrder.orderType,"_").concat(t.getActiveTheme)],style:{background:"Sell"===t.createdOrder.orderType?t.getRedColor.color:t.getGreenColor.color}}},on:{click:t.placeCreatedPendingOrders}},[t._v(t._s("".concat(t.getPlaceText," ").concat(t.getCryptoStatus?t.getSummuryVolumeCrypto:t.getSummuryVolumeForex)))])],1)])]},proxy:!0}])})],1)},Dwt=[],kwt={components:{DxPopup:wt["DxPopup"],DxTooltip:wt["DxTooltip"],DxCheckBox:wt["DxCheckBox"],DxSelectBox:wt["DxSelectBox"]},props:{createPendingOrderPopupStatus:{default:!1},avpPips:{type:Number},currentPrice:{type:Number},idChart:{default:""},eventEmitter:{default:null}},mixins:[qe],data:function(){return{buttonTypesOrder:[{type:"Sell",text:"SELL Limit",active:!0},{type:"Buy",text:"BUY Limit",active:!1}],createdOrder:{price:0},liveTime:24,equityAccount:null,throttlStatus:null,copyDirection:"up",copyOrders:0,stepCopyOrder:50,position:{},setTimeListPopupStatus:!1,volumeValue:0,volumeStepValue:0}},watch:{volumeValue:function(t,e){var i=this.getVolumeStep>=1?/^\d+$/:new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(this.getVolumeStepPrecision,"}"),")?$"));t&&!i.test(t)||isNaN(+t)?this.volumeValue=e:this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"volume",data:t,addHendler:"additionalHendlerForChangeVolume",pendingId:this.createdOrder.pendingId})},volumeStepValue:function(t,e){var i=this.getVolumeStep>=1?/^\d+$/:new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(this.getVolumeStepPrecision,"}"),")?$"));t&&!i.test(t)||isNaN(+t)?this.volumeStepValue=e:this.eventEmitter.emit("changeStepVolumeCreatedPendingOrder",{data:t,pendingId:this.createdOrder.pendingId})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getVolumeValue:{get:function(){return this.createdOrder.volume},set:function(t){this.volumeValue=t}},getStepPips:function(){return Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips)},getStepVolumeValue:{get:function(){return this.createdOrder.volumeStep},set:function(t){this.volumeStepValue=t}},getDefenceStatus:function(){return!!this.createdOrder.trailingSL&&!!this.createdOrder.trailingStart},getStepWarningMessage:function(){return this.volumeValue>this.getMinVolume&&this.volumeValuethis.getMaxVolume},getStepWarning:function(){return this.volumeValue>this.getMinVolume&&this.volumeValue=750?-735:t.canvasSize.width<=360?0:-1*(t.canvasSize.width-360);this.position={my:"top right",at:"top right",of:".Multichart-chartContainer_".concat(this.idChart),offset:{x:o,y:i}}}},chekVolumeByStep:function(t){if(!t)return 0;var e=+t/this.currentPrice,i=e>=this.getVolumeStep&&e%this.getVolumeStep;return i?e-i>=this.getMinVolume?e-i:0:e>=this.getMinVolume?e:0},setDirection:function(t){this.copyDirection=t},setByEventLiveTime:function(t){this.liveTime=t},setLiveTime:function(t){this.eventEmitter.emit("setLiveTimeCreatePendingOrder",{value:{value:t}}),this.setTimeListPopupStatus&&(this.setTimeListPopupStatus=!1)},setMessageHandler:function(t){"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.equityAccount=t.data[0].account.equity)},setDefenceStatus:function(t){var e=Math.round(5*this.avpPips)<1?5:Math.round(5*this.avpPips),i=Math.round(2*this.avpPips)<1?2:Math.round(2*this.avpPips);this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingStart",data:t.value?e:0,pendingId:this.createdOrder.pendingId}),this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingSL",data:t.value?i:0,pendingId:this.createdOrder.pendingId})},changeManualPriceTralingStart:function(t){if(t.target.value){var e=Math.round(+t.target.value);e>=this.createdOrder.trailingSL+this.getStepPips&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingStart",data:e,pendingId:this.createdOrder.pendingId})}},changeManualPriceTralingSL:function(t){if(t.target.value){var e=Math.round(+t.target.value);e&&e>0&&e<=this.createdOrder.trailingStart-this.getStepPips&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingSL",data:e,pendingId:this.createdOrder.pendingId})}},removeCopyOrder:function(){var t=this.createdOrder.cloneOrders?this.createdOrder.cloneOrders[0].length+this.createdOrder.cloneOrders[1].length:0;0!==t&&(t--,this.eventEmitter.emit("removeClonePendingOrder",this.copyDirection))},addCopyOrder:function(){var t=this.createdOrder.cloneOrders?this.createdOrder.cloneOrders[0].length+this.createdOrder.cloneOrders[1].length:0;15!==t&&(t++,this.eventEmitter.emit("addClonePendingOrder",{stepCopyOrder:this.stepCopyOrder,direction:this.copyDirection,createOrderPendingId:this.createdOrder.pendingId}))},changePriceTralingStart:function(t){if(this.getDefenceStatus){var e=t?this.createdOrder.trailingStart+this.getStepPips:this.createdOrder.trailingStart-this.getStepPips;e&&e>=this.createdOrder.trailingSL+this.getStepPips&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingStart",data:e,pendingId:this.createdOrder.pendingId})}},changePriceTralingSL:function(t){if(this.getDefenceStatus){var e=t?this.createdOrder.trailingSL+this.getStepPips:this.createdOrder.trailingSL-this.getStepPips;e&&e>0&&e<=this.createdOrder.trailingStart-this.getStepPips&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"trailingSL",data:e,pendingId:this.createdOrder.pendingId})}},changePriceStopLoss:function(t){var e=this.createdOrder.stopLoss?this.createdOrder.stopLoss:this.createdOrder.price,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"stopLoss",data:i,pendingId:this.createdOrder.pendingId,addHendler:"setPipsForStopLoss"})},changePriceTakeProfitManual:function(t){var e=+t.target.value,i=+e.toFixed(this.getPrecision);("Sell"===this.createdOrder.orderType&&ithis.createdOrder.price)&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"takeProfit",data:i,pendingId:this.createdOrder.pendingId,addHendler:"setPipsForTakeProfit"})},changePriceStopLossManual:function(t){var e=+t.target.value,i=+e.toFixed(this.getPrecision);i!==this.createdOrder.price&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"stopLoss",data:i,pendingId:this.createdOrder.pendingId,addHendler:"setPipsForStopLoss"})},changePriceTakeProfit:function(t){var e=this.createdOrder.takeProfit?this.createdOrder.takeProfit:this.createdOrder.price,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.createdOrder.orderType&&ithis.createdOrder.price)&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"takeProfit",data:i,pendingId:this.createdOrder.pendingId,addHendler:"setPipsForTakeProfit"})},addPricePoint:function(){var t=+(this.createdOrder.price+1/Ph(this.getPrecision-1)).toFixed(this.getPrecision);this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"price",data:t,pendingId:this.createdOrder.pendingId,addHendler:"setStopLossAndTakeProfitByPips"})},setTypeOrder:function(t){t!==this.getTypeOrder&&(this.buttonTypesOrder.forEach((function(e){e.active=e.type===t})),this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"orderType",data:t,pendingId:this.createdOrder.pendingId,addHendler:"additionalHendlerForChangeTypeOrder"}))},removePricePoint:function(){var t=+(this.createdOrder.price-1/Ph(this.getPrecision-1)).toFixed(this.getPrecision);t>0&&this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"price",data:t,pendingId:this.createdOrder.pendingId,addHendler:"setStopLossAndTakeProfitByPips"})},calcVolumeCreatedOrder:function(t){var e=this.getContractsBySymbol.volumeStep,i=+this.createdOrder.volume;if(t)i!==this.getContractsBySymbol.maxVolume&&(i+=e);else{if(i===this.getContractsBySymbol.minVolume)return;i-=e}this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"volume",data:this.getVolumeStep<1&&i%e?+i.toFixed(this.getVolumeStepPrecision):i,addHendler:"additionalHendlerForChangeVolume",pendingId:this.createdOrder.pendingId})},setVolumeOnList:function(t){this.volumeValue=t.value,this.eventEmitter.emit("changeSettingCreatedPendingOrder",{setting:"volume",data:t.value,addHendler:"additionalHendlerForChangeVolume",pendingId:this.createdOrder.pendingId})},setStepVolumeOnList:function(t){this.createdOrder.volumeStep=t.value,this.eventEmitter.emit("changeStepVolumeCreatedPendingOrder",{data:t.value,pendingId:this.createdOrder.pendingId})},calcStepVolumeCreatedOrder:function(t){var e=this.getContractsBySymbol.volumeStep,i=+this.createdOrder.volumeStep;if(t)i+=e;else{if(0===i)return;i-=e}this.eventEmitter.emit("changeStepVolumeCreatedPendingOrder",{data:this.getVolumeStep<1&&i%e?+i.toFixed(this.getVolumeStepPrecision):i,pendingId:this.createdOrder.pendingId})},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},closePopupByEvent:function(){this.$emit("close")},closePopup:function(t){t.pendingId===this.createdOrder.pendingId?this.$emit("close"):this.copyOrders=this.createdOrder.cloneOrders[0].length+this.createdOrder.cloneOrders[1].length},closeCreatedPopup:function(){this.eventEmitter.emit("deleteCreatedPendingOrder",this.createdOrder),this.$emit("close")},placeCreatedPendingOrders:function(){this.eventEmitter.emit("placeCreatedPendingOrders",this.createdOrder),this.$emit("close")},addCopyStep:function(){this.stepCopyOrder+=this.getStepPips,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.copyDirection})},setManualCopyStep:function(t){t.target.value?this.stepCopyOrder=Math.round(+t.target.value):this.stepCopyOrder=1,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.copyDirection})},removeCopyStep:function(){this.stepCopyOrder<=1||this.stepCopyOrder<=this.getStepPips||(this.stepCopyOrder-=this.getStepPips,this.eventEmitter.emit("changeStepClonePendingOrders",{stepCopyOrder:this.stepCopyOrder,direction:this.copyDirection}))},setCountCopyOrders:function(){this.createdOrder.cloneOrders?this.copyOrders=this.createdOrder.cloneOrders[0].length+this.createdOrder.cloneOrders[1].length:this.copyOrders=0}},mounted:function(){this.stepCopyOrder=Math.ceil(this.avpPips),this.$socketStream.$on("apiWS",this.setMessageHandler),this.eventEmitter.subscribe("createdNewPendingOrder",this.setCreatedPendingOrder),this.eventEmitter.subscribe("closePopupCreatePendingOrders",this.closePopupByEvent),this.eventEmitter.subscribe("addClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.subscribe("removeClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.subscribe("createPendingOrderOnScale",this.closeCreatedPopup),this.eventEmitter.subscribe("deletePendingOrder",this.closePopup),this.eventEmitter.emit("newPendingOrder",this.getTypeOrder),this.eventEmitter.subscribe("setLiveTimeSetPendingOrder",this.setByEventLiveTime),this.getDefaultAccount&&(this.equityAccount=this.getDefaultAccount.equity)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.eventEmitter.unsubscribe("deletePendingOrder",this.closePopup),this.eventEmitter.unsubscribe("setLiveTimeSetPendingOrder",this.setByEventLiveTime),this.eventEmitter.unsubscribe("closePopupCreatePendingOrders",this.closePopupByEvent),this.eventEmitter.unsubscribe("addClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.unsubscribe("removeClonePendingOrder",this.setCountCopyOrders),this.eventEmitter.unsubscribe("createdNewPendingOrder",this.setCreatedPendingOrder),this.eventEmitter.unsubscribe("createPendingOrderOnScale",this.closeCreatedPopup)}},Iwt=kwt,Bwt=(i("5d54"),Object(C["a"])(Iwt,Awt,Dwt,!1,null,null,null)),Mwt=Bwt.exports,$wt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OpenOrder"},[e("DxPopup",{attrs:{visible:t.openOrderPopupStatus,position:{my:"center",at:"center",of:".Multichart-chartContainer_".concat(t.idChart)},container:".Trading",dragOutsideBoundary:!0,shading:!1,width:"260",height:"auto"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"OpenOrder-title",class:"OpenOrder-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"OpenOrder-dragIcon",class:"OpenOrder-dragIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"OpenOrder-titlePart"},[t._v(t._s(t.getTitle))]),e("div",{staticClass:"OpenOrder-closeIcon",class:"OpenOrder-closeIcon_".concat(t.getActiveTheme),on:{click:t.closePopup}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]},proxy:!0},{key:"content",fn:function(){return["new"===t.mode?e("NewOrder",{attrs:{avpPips:t.avpPips,eventEmitter:t.eventEmitter,symbol:t.symbol,idChart:t.idChart,currentPrice:t.currentPrice},on:{close:t.closePopup}}):e("SettingOrder",{attrs:{avpPips:t.avpPips,orderId:t.idOrderForSetting,eventEmitter:t.eventEmitter,symbol:t.symbol,currentPrice:t.currentPrice},on:{close:t.closePopup}})]},proxy:!0}])})],1)},Lwt=[],Fwt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NewOrder-content",class:"NewOrder-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-typeOrder"},t._l(t.buttonTypesOrder,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["NewOrder-typeButton",i.type===t.order.orderType?"NewOrder-typeButton_isActive_".concat(t.order.orderType,"_").concat(t.getActiveTheme):"NewOrder-typeButton_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setTypeOrder(i.type)}}},[t._v(t._s(i.text))])})),1),t.getCryptoStatus?e("div",{staticClass:"NewOrder-avalibaleBalance"},[e("div",{staticClass:"NewOrder-avalibaleBalance-title",class:"NewOrder-avalibaleBalance-title_".concat(t.getActiveTheme)},[t._v("Availble Balance:")]),e("div",{staticClass:"NewOrder-avalibaleBalance-money",style:{color:t.getGreenColor.color}},[t._v(t._s(t.getAvailbleBalance))])]):t._e(),e("div",{staticClass:"NewOrder-settingBox",class:"NewOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-title",class:"NewOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-titleText",class:"NewOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Объем инвестирования")])]),e("div",{staticClass:"NewOrder-settingBox-settings"},[e("div",{staticClass:"NewOrder-setting",class:"NewOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-setting-controlWrap"},[e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!1)},mousedown:function(e){return t.downChange("throttlStatus","calcVolumeCreatedOrder",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),"checkbox"===(!t.typeSettingVolume&&this.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.volumeValue,expression:"volumeValue"}],staticStyle:{width:"17rem"},attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.volumeValue)?t._i(t.volumeValue,null)>-1:t.volumeValue},on:{change:function(e){var i=t.volumeValue,o=e.target,n=!!o.checked;if(Array.isArray(i)){var s=null,r=t._i(i,s);o.checked?r<0&&(t.volumeValue=i.concat([s])):r>-1&&(t.volumeValue=i.slice(0,r).concat(i.slice(r+1)))}else t.volumeValue=n}}}):"radio"===(!t.typeSettingVolume&&this.getVolumeStep>=1?"text":"number")?e("input",{directives:[{name:"model",rawName:"v-model",value:t.volumeValue,expression:"volumeValue"}],staticStyle:{width:"17rem"},attrs:{type:"radio"},domProps:{checked:t._q(t.volumeValue,null)},on:{change:function(e){t.volumeValue=null}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.volumeValue,expression:"volumeValue"}],staticStyle:{width:"17rem"},attrs:{type:!t.typeSettingVolume&&this.getVolumeStep>=1?"text":"number"},domProps:{value:t.volumeValue},on:{input:function(e){e.target.composing||(t.volumeValue=e.target.value)}}}),e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.calcVolumeCreatedOrder(!0)},mousedown:function(e){return t.downChange("throttlStatus","calcVolumeCreatedOrder",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),e("div",{staticClass:"NewOrder-ddButtonStepVolume",class:"NewOrder-ddButtonStepVolume_".concat(t.getActiveTheme," NewOrder-ddButtonStepVolume_").concat(t.idChart)},[e("DxSelectBox",{attrs:{items:t.getVolumsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".NewOrder-content",position:{my:"top right",at:"bottom right",of:".NewOrder-ddButtonStepVolume_".concat(t.idChart)},width:"5.5rem",minHeight:"18.5rem"},onValueChanged:t.setVolumeOnList},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.order.volume?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}])})],1)])]),t.getErrorMinVolume?e("div",{staticClass:"NewOrder-error",style:{color:t.getRedColor.color}},[t._v(t._s("Минимальный объём по контракту ".concat(t.getMinVolume)))]):t._e(),t.getErrorMaxVolume?e("div",{staticClass:"NewOrder-error",style:{color:t.getRedColor.color}},[t._v(t._s("Максимальный объём по контракту ".concat(t.getMaxVolume)))]):t._e(),e("div",{staticClass:"NewOrder-setting-addData"},[e("div",{staticClass:"NewOrder-setting-addDataValue",style:{color:t.volumeValue?t.getBlueColor.color:t.getRedColor.color}},[t._v(t._s(t.getVolumeByValue))]),t.getCryptoStatus?e("div",{staticClass:"NewOrder-selectTypeSetting",class:"NewOrder-selectTypeSetting_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getTypesSettingsVolume,width:"77",value:t.getTypesSettingsVolume[0],activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setTypeProfitVolume,dropDownOptions:{container:".NewOrder-content"}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.order.volume?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}],null,!1,1953561991)})],1):t._e()]),e("div",{staticClass:"NewOrder-marginBar"},[e("div",{staticClass:"NewOrder-marginBar-remainder",class:"NewOrder-marginBar-remainder_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$moneyf(t.getRemainderInvestedVolume,2)," ").concat(t.getCurrencyChar)))]),e("div",{staticClass:"NewOrder-marginBar-free",style:{background:t.getColorRemainderBar}}),e("div",{staticClass:"NewOrder-marginBar-ivested",style:{background:t.getGrayColor.color,minWidth:"".concat(t.getPercentInvestedVolume,"%")}})])])]),e("div",{staticClass:"NewOrder-settingBox",class:"NewOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-title",class:"NewOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-titleText",class:"NewOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Установка TP и SL уровней")])]),e("div",{staticClass:"NewOrder-settingBox-settings"},[e("div",{staticClass:"NewOrder-settingWrapTitle",class:"NewOrder-settingWrapTitle_".concat(t.getActiveTheme)},[t._v("Take profit ")]),e("div",{staticClass:"NewOrder-settingWrap"},[e("div",{staticClass:"NewOrder-setting",class:"NewOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-setting-controlWrap"},[e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{style:{width:0===t.typeTakeProfit?"13rem":"10.5rem",color:t.getGreenColor.color},attrs:{type:"number"},domProps:{value:t.getTakeProfitValue},on:{input:t.changePriceTakeProfitManual}}),e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),1===t.typeTakeProfit?e("div",{staticClass:"NewOrder-ddButtonStepVolume",class:"NewOrder-ddButtonStepVolume_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getPipsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".NewOrder-content",position:{my:"top right",at:"bottom right",of:".NewOrder-ddButtonStepVolume"},width:"5.5rem",minHeight:"10.3rem"}},on:{valueChanged:function(e){return t.setPipsOnList(e,"TP")}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.getTakeProfitValue?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}],null,!1,3225135852)})],1):t._e()])]),e("div",{staticClass:"NewOrder-selectTypeSetting",class:"NewOrder-selectTypeSetting_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getTypesSettings,value:t.getTypesSettings[0],activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setTypeTakeProfit,dropDownOptions:{container:".NewOrder-content"}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.order.volume?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}])})],1)]),e("div",{staticClass:"NewOrder-settingWrapTitle",class:"NewOrder-settingWrapTitle_".concat(t.getActiveTheme)},[t._v("Stop Loss")]),e("div",{staticClass:"NewOrder-settingWrap"},[e("div",{staticClass:"NewOrder-setting",class:"NewOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-setting-controlWrap"},[e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{style:{width:0===t.typeStopLoss?"13rem":"10.5rem",color:t.getRedColor.color},attrs:{type:"number"},domProps:{value:t.getStopLossValue},on:{input:t.changePriceStopLossManual}}),e("div",{staticClass:"NewOrder-setting-control",class:"NewOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),1===t.typeStopLoss?e("div",{staticClass:"NewOrder-ddButtonStepVolume",class:"NewOrder-ddButtonStepVolume_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getPipsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".NewOrder-content",position:{my:"top right",at:"bottom right",of:".NewOrder-ddButtonStepVolume"},width:"5.5rem",minHeight:"10.3rem"}},on:{valueChanged:function(e){return t.setPipsOnList(e,"SL")}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.getStopLossValue?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}],null,!1,886502714)})],1):t._e()])]),e("div",{staticClass:"NewOrder-selectTypeSetting",class:"NewOrder-selectTypeSetting_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getTypesSettings,value:t.getTypesSettings[0],activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setTypeStopLoss,dropDownOptions:{container:".NewOrder-content"}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"NewOrder-ddButtonList-item",class:o===t.order.volume?"NewOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"NewOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}])})],1)])])]),e("div",{staticClass:"NewOrder-settingBox",class:"NewOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-title",class:"NewOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-settingBox-titleText",class:"NewOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Активная защита ордера")])]),e("div",{staticClass:"NewOrder-settingBox-settings"},[e("div",{staticClass:"NewOrder-settingWrap"},[e("DxCheckBox",{attrs:{"element-attr":{class:"OpenOrder_checkBox OpenOrder_checkBox_".concat(t.getActiveTheme)},value:t.activeDefence,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setDefenceStatus}}),e("div",{staticClass:"NewOrder-setting",class:"NewOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-right":"0.4rem"}},[e("div",{staticClass:"NewOrder-setting-control",class:t.activeDefence?"NewOrder-setting-control_".concat(t.getActiveTheme):"NewOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"number",readonly:!t.activeDefence},domProps:{value:t.order.trailingStart},on:{input:t.changeManualPriceTralingStart}}),e("div",{staticClass:"NewOrder-setting-control",class:t.activeDefence?"NewOrder-setting-control_".concat(t.getActiveTheme):"NewOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"NewOrder-setting",class:"NewOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"NewOrder-setting-control",class:t.activeDefence?"NewOrder-setting-control_".concat(t.getActiveTheme):"NewOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"text",readonly:!t.activeDefence},domProps:{value:t.order.trailingSL},on:{input:t.changeManualPriceTralingSL}}),e("div",{staticClass:"NewOrder-setting-control",class:t.activeDefence?"NewOrder-setting-control_".concat(t.getActiveTheme):"NewOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])],1)])]),t.getCryptoStatus?e("div",{staticClass:"NewOrder-avalibaleBalance"},[e("div",{staticClass:"NewOrder-avalibaleBalance-title",class:"NewOrder-avalibaleBalance-title-bordered_".concat(t.getActiveTheme)},[t._v("Amount to Borrow:")]),e("div",{staticClass:"NewOrder-avalibaleBalance-money",class:"NewOrder-avalibaleBalance-money_".concat(t.getActiveTheme),attrs:{title:t.getAmountToBorrow}},[t._v(t._s(t.getAmountToBorrow))])]):t._e(),t.getCryptoStatus?e("div",{staticClass:"NewOrder-avalibaleBalance"},[e("div",{staticClass:"NewOrder-avalibaleBalance-title",class:"NewOrder-avalibaleBalance-title-bordered_".concat(t.getActiveTheme)},[t._v("Max. buying amount:")]),e("div",{staticClass:"NewOrder-avalibaleBalance-money",class:"NewOrder-avalibaleBalance-money_".concat(t.getActiveTheme),attrs:{title:t.getMaxBuyingAmount}},[t._v(t._s(t.getMaxBuyingAmount))])]):t._e(),e("div",{staticClass:"NewOrder-MarketSentiment"},[e("MarketSentiment",{attrs:{symbol:t.symbol}})],1),e("div",{staticClass:"NewOrder-footer"},[e("ButtonIconFlat",{attrs:{modifier:{class:["NewOrder-placeButton","NewOrder-placeButton_".concat(t.order.orderType,"_").concat(t.getActiveTheme)],style:{background:"Sell"===t.order.orderType?t.getRedColor.color:t.getGreenColor.color}}},on:{click:t.placeOpenOrder}},[t._v(t._s(t.getTextPlaceButton)),e("br"),t._v(t._s(t.getVolumeValue))])],1)])},jwt=[],Rwt={components:{DxSelectBox:wt["DxSelectBox"],DxCheckBox:wt["DxCheckBox"],MarketSentiment:Vp},props:{avpPips:{type:Number},eventEmitter:{default:null},symbol:{type:String},idChart:{type:String},currentPrice:{type:Number}},mixins:[qe],data:function(){return{order:{orderType:"Buy"},equityAccount:0,buttonTypesOrder:[{type:"Sell",text:"SELL"},{type:"Buy",text:"BUY"}],typesSettings:["USD","PIPS"],volumeValue:0,typeStopLoss:0,typeTakeProfit:0,typeSettingVolume:0,render:0,activeDefence:!1}},watch:{volumeValue:function(t,e){var i;i=this.typeSettingVolume?new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(4,"}"),")?$")):this.getVolumeStep>=1?/^\d+$/:new RegExp("^(?!0\\d|$)\\d*(\\.\\".concat("d{1,".concat(this.getVolumeStepPrecision,"}"),")?$")),+t&&!i.test(t)||isNaN(+t)?this.volumeValue=e:this.typeSettingVolume?this.order.volume=this.chekVolumeByStep(this.volumeValue):this.order.volume=this.getCryptoStatus?+this.volumeValue:this.volumeByStepForex(this.volumeValue)},getDefaultAccount:function(t){t&&(this.order={accountId:this.getDefaultAccount.id,contractName:this.symbol,orderType:"Buy",stopLoss:0,takeProfit:0,trailingSL:0,trailingStart:0,volume:this.getMinVolume},this.volumeValue=this.getMinVolume)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession"})),{},{getStepPips:function(){return Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips)},getAvailbleBalance:function(){return"".concat(this.$moneyf(this.equityAccount)," ").concat(this.getCurrencyChar)},getRemainderInvestedVolume:function(){var t=this.equityAccount*this.getDefaultAccount.maxLeverage,e=this.getCryptoStatus?t-this.order.volume*this.currentPrice:t-this.order.volume;return e<0?0:e},getColorRemainderBar:function(){return this.getPercentInvestedVolume<=40?this.getGreenColor.color:this.getPercentInvestedVolume>40&&this.getPercentInvestedVolume<=60?this.getYellowColor.color:this.getRedColor.color},getPercentInvestedVolume:function(){var t=this.equityAccount*this.getDefaultAccount.maxLeverage,e=this.getCryptoStatus?this.order.volume*this.currentPrice*100/t:100*this.order.volume/t;return e?e<1?1:e>100?100:e:1},getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getErrorMinVolume:function(){return this.typeSettingVolume?+this.volumeValue&&this.chekVolumeByStep(this.volumeValue)this.getMaxVolume:this.volumeValue&&this.volumeValue>this.getMaxVolume},getTypesSettingsVolume:function(){return["by Qty","by Value"]},getTypesSettings:function(){return this.getCryptoStatus?["USDT","PIPS"]:["USD","PIPS"]},getAmountToBorrow:function(){if(this.getDefaultAccount)return"".concat(this.$moneyf(this.equityAccount*this.getDefaultAccount.maxLeverage)," ").concat(this.getCurrencyChar)},getMaxBuyingAmount:function(){if(this.getDefaultAccount)return"".concat(this.$moneyf(this.equityAccount*this.getDefaultAccount.maxLeverage/this.currentPrice,this.getPrecision)," coins")},getStopLossValue:function(){var t=[this.order.stopLoss?this.order.stopLoss:0,this.order.stopLoss?"Buy"===this.order.orderType?Math.round((this.order.creatingPrice-this.order.stopLoss)*Ph(this.getPrecision)):Math.round((this.order.stopLoss-this.order.creatingPrice)*Ph(this.getPrecision)):0];return t[this.typeStopLoss]},getTakeProfitValue:function(){var t=[this.order.takeProfit?this.order.takeProfit:0,this.order.takeProfit?"Buy"===this.order.orderType?Math.round((this.order.takeProfit-this.order.creatingPrice)*Ph(this.getPrecision)):Math.round((this.order.creatingPrice-this.order.takeProfit)*Ph(this.getPrecision)):0];return t[this.typeTakeProfit]},getTextPlaceButton:function(){return"".concat(this.order.orderType.toUpperCase()," ").concat(this.symbol," ").concat(this.currentPrice)},getVolumsList:function(){if(this.getContractBySymbol){var t=this.getMinVolume;return this.getCryptoStatus?this.typeSettingVolume?[1,30,50,100,150,250,500,750,1e3]:[t,3*t,5*t,10*t,15*t,25*t,50*t,75*t,100*t]:[1e3,3e3,5e3,1e4,15e3,25e3,5e4,75e3,1e5]}},getPipsList:function(){return this.getCryptoStatus?[Math.round(this.avpPips-this.avpPips%5),Math.round(2*this.avpPips-2*this.avpPips%5),Math.round(3*this.avpPips-3*this.avpPips%5),Math.round(5*this.avpPips-5*this.avpPips%5),Math.round(10*this.avpPips-10*this.avpPips%5),Math.round(20*this.avpPips-20*this.avpPips%5)]:[10,20,30,50,100,200]},getVolumeStep:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).volumeStep;return e},getVolumeStepPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).stepPrecision;return e},getMinVolume:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).minVolume;return e},getMaxVolume:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).maxVolume;return e},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},getContractBySymbol:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.symbol}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getVolumeValue:function(){return this.getCryptoStatus?this.getSumONCryptoVolume:this.getPercentVolumeOnEquity},getVolumeByValue:function(){return this.volumeValue?this.typeSettingVolume?"".concat(this.$decimalAdjust("round",this.chekVolumeByStep(this.volumeValue),-this.getVolumeStepPrecision)," Coins"):this.getCryptoStatus?"".concat(this.$moneyf(this.volumeValue*this.currentPrice,4)," ").concat(this.getCurrencyChar):"".concat(this.$moneyf(100*+this.volumeValue/(this.equityAccount*this.getDefaultAccount.maxLeverage),3)," %"):"некорректный объём"},getSumONCryptoVolume:function(){var t;null!==(t=this.order)&&void 0!==t&&t.volume&&(this.typeSettingVolume?Number.isInteger(this.order.volume*this.currentPrice)?(this.order.volume,this.currentPrice):(this.order.volume*this.currentPrice).toFixed(4):Number.isInteger(this.order.volume)?this.order.volume:this.order.volume.toFixed(this.getPrecision))},getPercentVolumeOnEquity:function(){if(this.equityAccount&&this.order){var t=100*this.volumeValue/this.equityAccount;return"".concat(this.$moneyf(+this.volumeValue)," (").concat(this.$moneyf(t,t<.01?3:2)," %)")}}}),methods:{closePopup:function(){this.eventEmitter.emit("setOpenOrder",null),this.$emit("close")},setTypeOrder:function(t){this.order.orderType!==t&&(this.order.orderType=t,this.order.takeProfit&&(this.order.takeProfit=0),this.order.stopLoss&&(this.order.stopLoss=0))},setMessageHandler:function(t){"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.equityAccount=t.data[0].account.equity)},volumeByStepForex:function(t){var e=+t;return e%this.getVolumeStep?e-e%this.getVolumeStep:e},chekVolumeByStep:function(t){if(!t)return 0;var e=+t/this.currentPrice,i=e>=this.getVolumeStep&&e%this.getVolumeStep;return i?e-i>=this.getMinVolume?e-i:0:e>=this.getMinVolume?e:0},setPipsOnList:function(t,e){if("TP"===e){var i="Buy"===this.order.orderType?+(this.order.creatingPrice+t.value/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.creatingPrice-t.value/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.currentPrice)&&(this.order.takeProfit=i,this.eventEmitter.emit("changeOpenOrder"))}else{var o="Buy"===this.order.orderType?+(this.order.creatingPrice-t.value/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.creatingPrice+t.value/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&o>this.currentPrice||"Buy"===this.order.orderType&&othis.order.creatingPrice)&&(this.order.takeProfit=i,this.eventEmitter.emit("changeOpenOrder"))},changeTakeProfitByPrice:function(t){var e=this.order.takeProfit?this.order.takeProfit:this.currentPrice,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.currentPrice)&&(this.order.takeProfit=i,this.eventEmitter.emit("changeOpenOrder"))},changeTakeProfitByPips:function(t){var e=this.order.takeProfit?"Buy"===this.order.orderType?Math.round((this.order.takeProfit-this.order.creatingPrice)*Ph(this.getPrecision)):Math.round((this.order.creatingPrice-this.order.takeProfit)*Ph(this.getPrecision)):0;t?e+=.1*this.avpPips:e-.1*this.avpPips>=0&&(e-=.1*this.avpPips);var i="Buy"===this.order.orderType?+(this.order.creatingPrice+e/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.creatingPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.currentPrice)&&(this.order.takeProfit=i,this.eventEmitter.emit("changeOpenOrder"))},changePriceTakeProfit:function(t){0===this.typeTakeProfit?this.changeTakeProfitByPrice(t):this.changeTakeProfitByPips(t)},changeStopLossByPrice:function(t){var e=this.order.stopLoss?this.order.stopLoss:this.currentPrice,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&i>this.currentPrice||"Buy"===this.order.orderType&&i=0&&(e-=.1*this.avpPips);var i="Buy"===this.order.orderType?+(this.order.creatingPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.creatingPrice+e/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&i>this.currentPrice||"Buy"===this.order.orderType&&i=this.order.trailingSL+this.getStepPips&&(this.order.trailingStart=e)},changeManualPriceTralingSL:function(t){var e=Math.round(+t.target.value);e&&e>0&&e<=this.order.trailingStart-this.getStepPips&&(this.order.trailingSL=e)},changePriceTralingStart:function(t){var e=t?this.order.trailingStart+this.getStepPips:this.order.trailingStart-this.getStepPips;e>=this.order.trailingSL+this.getStepPips&&(this.order.trailingStart=e)},changePriceTralingSL:function(t){var e=t?this.order.trailingSL+this.getStepPips:this.order.trailingSL-this.getStepPips;e&&e>0&&e<=this.order.trailingStart-this.getStepPips&&(this.order.trailingSL=e)},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},placeOpenOrder:function(){this.typeSettingVolume?this.order.volume=this.chekVolumeByStep(this.volumeValue):this.order.volume=this.getCryptoStatus?+this.volumeValue:this.volumeByStepForex(this.volumeValue);var t={Command:"OpenTradingOrder",data:this.order,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:t}),this.$emit("close")}},mounted:function(){this.$socketStream.$on("apiWS",this.setMessageHandler),this.getDefaultAccount&&(this.order={accountId:this.getDefaultAccount.id,contractName:this.symbol,orderType:"Buy",stopLoss:0,takeProfit:0,trailingSL:0,trailingStart:0,creatingPrice:this.currentPrice,volume:this.getMinVolume},this.volumeValue=this.getMinVolume,this.equityAccount=this.getDefaultAccount.equity,this.eventEmitter.emit("setOpenOrder",this.order))},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},Wwt=Rwt,Nwt=(i("1fe1"),Object(C["a"])(Wwt,Fwt,jwt,!1,null,null,null)),Ewt=Nwt.exports,Uwt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SettingOrder-content",class:"SettingOrder-content_".concat(t.getActiveTheme)},[t.order.orderType?e("div",{staticClass:"SettingOrder-orderInfo",class:"SettingOrder-orderInfo_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-orderInfo-item",class:"SettingOrder-orderInfo-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-orderInfo-item-title",class:"SettingOrder-orderInfo-item-title_".concat(t.getActiveTheme)},[t._v("Type")]),e("div",{staticClass:"SettingOrder-orderInfo-item-data",style:{color:"Sell"===t.order.orderType?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(t.order.orderType.toUpperCase()))])]),e("div",{staticClass:"SettingOrder-orderInfo-item",class:"SettingOrder-orderInfo-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-orderInfo-item-title",class:"SettingOrder-orderInfo-item-title_".concat(t.getActiveTheme)},[t._v("Price")]),e("div",{staticClass:"SettingOrder-orderInfo-item-data",style:{color:"Sell"===t.order.orderType?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(t.order.openPrice))])]),e("div",{staticClass:"SettingOrder-orderInfo-item",class:"SettingOrder-orderInfo-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-orderInfo-item-title",class:"SettingOrder-orderInfo-item-title_".concat(t.getActiveTheme)},[t._v("Volume")]),e("div",{staticClass:"SettingOrder-orderInfo-item-data",style:{color:t.getBlueColor.color}},[t._v(t._s(t.$moneyf(t.order.volume)))])]),e("div",{staticClass:"SettingOrder-orderInfo-item",class:"SettingOrder-orderInfo-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-orderInfo-item-title",class:"SettingOrder-orderInfo-item-title_".concat(t.getActiveTheme)},[t._v("Profit")]),e("div",{staticClass:"SettingOrder-orderInfo-item-data",style:{color:t.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$ ".concat(t.$moneyf(t.profit))))])])]):t._e(),e("div",{staticClass:"SettingOrder-settingBox",class:"SettingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-settingBox-title",class:"SettingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-settingBox-titleText",class:"SettingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Установка TP и SL уровней")])]),e("div",{staticClass:"SettingOrder-settingBox-settings"},[e("div",{staticClass:"SettingOrder-settingWrapTitle",class:"SettingOrder-settingWrapTitle_".concat(t.getActiveTheme)},[t._v("Take profit ")]),e("div",{staticClass:"SettingOrder-settingWrap"},[e("div",{staticClass:"SettingOrder-setting",class:"SettingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-setting-controlWrap"},[e("div",{staticClass:"SettingOrder-setting-control",class:"SettingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{style:{width:"USD"===t.typeTakeProfit?"13.3rem":"10.8rem",color:t.getGreenColor.color},attrs:{type:"number"},domProps:{value:t.getTakeProfitValue},on:{input:t.changePriceTakeProfitManual}}),e("div",{staticClass:"SettingOrder-setting-control",class:"SettingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTakeProfit(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTakeProfit",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),"PIPS"===t.typeTakeProfit?e("div",{staticClass:"SettingOrder-ddButtonStepVolume",class:"SettingOrder-ddButtonStepVolume_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getPipsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".SettingOrder-content",position:{my:"top right",at:"bottom right",of:".SettingOrder-ddButtonStepVolume"},width:"5.5rem",minHeight:"10.3rem"}},on:{valueChanged:function(e){return t.setPipsOnList(e,"TP")}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"SettingOrder-ddButtonList-item",class:o===t.getTakeProfitValue?"SettingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SettingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}],null,!1,241955494)})],1):t._e()])]),e("div",{staticClass:"SettingOrder-selectTypeSetting",class:"SettingOrder-selectTypeSetting_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.typesSettings,value:"USD",activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setTypeTakeProfit,dropDownOptions:{container:".SettingOrder-selectTypeSetting"}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"SettingOrder-ddButtonList-item",class:o===t.order.volume?"SettingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SettingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}])})],1)]),e("div",{staticClass:"SettingOrder-settingWrapTitle",class:"SettingOrder-settingWrapTitle_".concat(t.getActiveTheme)},[t._v("Stop Loss")]),e("div",{staticClass:"SettingOrder-settingWrap"},[e("div",{staticClass:"SettingOrder-setting",class:"SettingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-setting-controlWrap"},[e("div",{staticClass:"SettingOrder-setting-control",class:"SettingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{style:{width:"USD"===t.typeStopLoss?"13.3rem":"10.8rem",color:t.getRedColor.color},attrs:{type:"number"},domProps:{value:t.getStopLossValue},on:{input:t.changePriceStopLossManual}}),e("div",{staticClass:"SettingOrder-setting-control",class:"SettingOrder-setting-control_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceStopLoss(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceStopLoss",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1),"PIPS"===t.typeStopLoss?e("div",{staticClass:"SettingOrder-ddButtonStepVolume",class:"SettingOrder-ddButtonStepVolume_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getPipsList,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,dropDownOptions:{container:".SettingOrder-content",position:{my:"top right",at:"bottom right",of:".SettingOrder-ddButtonStepVolume"},width:"5.5rem",minHeight:"10.3rem"}},on:{valueChanged:function(e){return t.setPipsOnList(e,"SL")}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"SettingOrder-ddButtonList-item",class:o===t.getStopLossValue?"SettingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SettingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o)))])]}}],null,!1,3359386096)})],1):t._e()])]),e("div",{staticClass:"SettingOrder-selectTypeSetting",class:"SettingOrder-selectTypeSetting_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.typesSettings,value:"USD",activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setTypeStopLoss,dropDownOptions:{container:".SettingOrder-selectTypeSetting"}},scopedSlots:t._u([{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"SettingOrder-ddButtonList-item",class:o===t.order.volume?"SettingOrder-ddButtonList-item_isActive_".concat(t.getActiveTheme):"SettingOrder-ddButtonList-item_".concat(t.getActiveTheme)},[t._v(t._s(o))])]}}])})],1)])])]),e("div",{staticClass:"SettingOrder-settingBox",class:"SettingOrder-settingBox_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-settingBox-title",class:"SettingOrder-settingBox-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-settingBox-titleText",class:"SettingOrder-settingBox-titleText_".concat(t.getActiveTheme)},[t._v("Активная защита ордера")])]),e("div",{staticClass:"SettingOrder-settingBox-settings"},[e("div",{staticClass:"SettingOrder-settingWrap"},[t.statusCheckBoxDefence?e("DxCheckBox",{attrs:{"element-attr":{class:"OpenOrder_checkBox OpenOrder_checkBox_".concat(t.getActiveTheme)},value:t.activeDefence,activeStateEnabled:!1,focusStateEnabled:!1,hoverStateEnabled:!1,onValueChanged:t.setDefenceStatus}}):t._e(),e("div",{staticClass:"SettingOrder-setting",class:"SettingOrder-setting_".concat(t.getActiveTheme),staticStyle:{"margin-right":"0.4rem"}},[e("div",{staticClass:"SettingOrder-setting-control",class:t.activeDefence?"SettingOrder-setting-control_".concat(t.getActiveTheme):"SettingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"number",readonly:!t.activeDefence},domProps:{value:t.trailingStart},on:{input:t.changeManualPriceTralingStart}}),e("div",{staticClass:"SettingOrder-setting-control",class:t.activeDefence?"SettingOrder-setting-control_".concat(t.getActiveTheme):"SettingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingStart(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingStart",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"SettingOrder-setting",class:"SettingOrder-setting_".concat(t.getActiveTheme)},[e("div",{staticClass:"SettingOrder-setting-control",class:t.activeDefence?"SettingOrder-setting-control_".concat(t.getActiveTheme):"SettingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!1)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!1])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{staticStyle:{width:"5.8rem"},attrs:{type:"text",readonly:!t.activeDefence},domProps:{value:t.trailingSL},on:{input:t.changeManualPriceTralingSL}}),e("div",{staticClass:"SettingOrder-setting-control",class:t.activeDefence?"SettingOrder-setting-control_".concat(t.getActiveTheme):"SettingOrder-setting-control_disabled_".concat(t.getActiveTheme),on:{click:function(e){return t.changePriceTralingSL(!0)},mousedown:function(e){return t.downChange("throttlStatus","changePriceTralingSL",[!0])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])],1)])]),e("div",{staticClass:"SettingOrder-MarketSentiment"},[e("ButtonIconFlat",{attrs:{modifier:{class:["SettingOrder-applyButton","SettingOrder-applyButton_".concat(t.getActiveTheme)]},disabled:t.getStatusDisabledApplyButton},on:{click:t.modifyOrder}},[t._v("Применить")])],1),e("div",{staticClass:"SettingOrder-footer"},[e("ButtonIconFlat",{attrs:{modifier:{class:["SettingOrder-placeButton","SettingOrder-placeButton_".concat("Sell"===t.order.orderType?"Buy":"Sell","_").concat(t.getActiveTheme)],style:{background:"Buy"===t.order.orderType?t.getRedColor.color:t.getGreenColor.color}}},on:{click:t.closePosition}},[t._v(t._s(t.getTextPlaceButton)),e("br"),t._v(t._s(t.getVolumeValue))])],1)])},Vwt=[],Hwt={components:{DxSelectBox:wt["DxSelectBox"],DxCheckBox:wt["DxCheckBox"]},props:{avpPips:{type:Number},orderId:{type:String},eventEmitter:{default:null},symbol:{type:String},currentPrice:{type:Number}},mixins:[qe],data:function(){return{equityAccount:0,typesSettings:["USD","PIPS"],typeStopLoss:"USD",typeTakeProfit:"USD",activeDefence:!1,order:{},takeProfit:0,stopLoss:0,trailingStart:0,profit:0,trailingSL:0,statusCheckBoxDefence:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession"})),{},{getStepPips:function(){return Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips)},getPipsList:function(){return this.getCryptoStatus?[Math.round(this.avpPips-this.avpPips%5),Math.round(2*this.avpPips-2*this.avpPips%5),Math.round(3*this.avpPips-3*this.avpPips%5),Math.round(5*this.avpPips-5*this.avpPips%5),Math.round(10*this.avpPips-10*this.avpPips%5),Math.round(20*this.avpPips-20*this.avpPips%5)]:[10,20,30,50,100,200]},getStatusDisabledApplyButton:function(){return this.takeProfit===this.order.takeProfit&&this.stopLoss===this.order.stopLoss&&(this.order.trailingStart?this.trailingStart===this.order.trailingStart:!this.order.trailingStart)&&(this.order.trailingStart?this.trailingSL===this.order.trailingSL:!this.trailingSL)},getStopLossValue:function(){var t={USD:this.stopLoss?this.stopLoss:0,PIPS:this.stopLoss?"Buy"===this.order.orderType?Math.round((this.order.openPrice-this.stopLoss)*Ph(this.getPrecision)):Math.round((this.stopLoss-this.order.openPrice)*Ph(this.getPrecision)):0};return t[this.typeStopLoss]},getTakeProfitValue:function(){var t={USD:this.takeProfit?this.takeProfit:0,PIPS:this.takeProfit?"Buy"===this.order.orderType?Math.round((this.takeProfit-this.order.openPrice)*Ph(this.getPrecision)):Math.round((this.order.openPrice-this.takeProfit)*Ph(this.getPrecision)):0};return t[this.typeTakeProfit]},getTextPlaceButton:function(){if(this.order.orderType){var t="Sell"===this.order.orderType?"Buy":"Sell";return"".concat(t.toUpperCase()," ").concat(this.symbol," ").concat(this.currentPrice)}},getPrecision:function(){var t=this,e=this.getContracts.find((function(e){return e.name===t.symbol})).precision;return e},getContractBySymbol:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.symbol}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getVolumeValue:function(){return this.getCryptoStatus?this.getSumONCryptoVolume:this.getPercentVolumeOnEquity},getSumONCryptoVolume:function(){return this.order.volume},getPercentVolumeOnEquity:function(){if(this.equityAccount&&this.order){var t=100*this.order.volume/this.equityAccount;return"".concat(this.$moneyf(this.order.volume)," (").concat(this.$moneyf(t,t<.01?3:2)," %)")}}}),methods:{closePopup:function(){this.$emit("close"),this.eventEmitter.emit("closeSettingOpenOrderPopup")},closePosition:function(){var t={Command:"CloseTradingOrder",data:{accountId:this.getDefaultAccount.id,id:this.order.id},FingerPrint:this.getSession.fp};this.$socketStream.sendCommand({ws:"apiWS",command:t}),this.closePopup()},modifyOrder:function(){var t=structuredClone(this.order);t.takeProfit=this.takeProfit,t.stopLoss=this.stopLoss,t.trailingStart=this.trailingStart,t.trailingSL=this.trailingSL;var e={Command:"ModifyTradingOrder",data:t,Token:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.closePopup()},setTypeOrder:function(t){this.order.orderType!==t&&(this.order.orderType=t,this.order.takeProfit&&(this.order.takeProfit=0),this.order.stopLoss&&(this.order.stopLoss=0))},setMessageHandler:function(t){var e=this;if("AccountsDetails"===(null===t||void 0===t?void 0:t.command)){this.equityAccount=t.data[0].account.equity;var i=t.data[0].openOrders.tradingOrders,o=i.find((function(t){return t.id===e.order.id}));o&&(this.profit=o.profit)}else"BrokerPosition"===(null===t||void 0===t?void 0:t.command)&&t.data.id===this.order.id&&(this.order=t.data,this.takeProfit=this.order.takeProfit,this.stopLoss=this.order.stopLoss,this.order.trailingStart?(this.trailingSL=this.order.trailingSL,this.trailingStart=this.order.trailingStart):(this.trailingSL=0,this.trailingStart=0,this.activeDefence=!1))},setTypeStopLoss:function(t){this.typeStopLoss=t.value},setTypeTakeProfit:function(t){this.typeTakeProfit=t.value},setPipsOnList:function(t,e){if("TP"===e){var i="Buy"===this.order.orderType?+(this.order.openPrice+t.value/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.openPrice-t.value/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.order.openPrice)&&(this.takeProfit=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTP",data:this.takeProfit}))}else{var o="Buy"===this.order.orderType?+(this.order.openPrice-t.value/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.openPrice+t.value/Ph(this.getPrecision)).toFixed(this.getPrecision);this.stopLoss=o,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomSL",data:this.stopLoss})}},changePriceTakeProfitManual:function(t){var e=+t.target.value,i="USD"===this.typeTakeProfit?+e.toFixed(this.getContractBySymbol.precision):"Buy"===this.order.orderType?+(e/Ph(this.getPrecision)+this.order.openPrice).toFixed(this.getPrecision):+(this.order.openPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.order.openPrice)&&(this.takeProfit=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTP",data:this.takeProfit}))},changeTakeProfitByPrice:function(t){var e=this.takeProfit?this.takeProfit:this.order.openPrice,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.order.openPrice)&&(this.takeProfit=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTP",data:this.takeProfit}))},changeTakeProfitByPips:function(t){var e=this.takeProfit?"Buy"===this.order.orderType?Math.round((this.takeProfit-this.order.openPrice)*Ph(this.getPrecision)):Math.round((this.order.openPrice-this.takeProfit)*Ph(this.getPrecision)):0;t?e+=.1*this.avpPips:e-.1*this.avpPips>=0&&(e-=.1*this.avpPips);var i="Buy"===this.order.orderType?+(this.order.openPrice+e/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.openPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision);("Sell"===this.order.orderType&&ithis.order.openPrice)&&(this.takeProfit=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTP",data:this.takeProfit}))},changePriceTakeProfit:function(t){"USD"===this.typeTakeProfit?this.changeTakeProfitByPrice(t):this.changeTakeProfitByPips(t)},changePriceStopLoss:function(t){"USD"===this.typeStopLoss?this.changeStopLossByPrice(t):this.changeStopLossByPips(t)},changeStopLossByPips:function(t){var e=this.stopLoss?"Buy"===this.order.orderType?Math.round((this.order.openPrice-this.stopLoss)*Ph(this.getPrecision)):Math.round((this.stopLoss-this.order.openPrice)*Ph(this.getPrecision)):0;t?e+=.1*this.avpPips:e-.1*this.avpPips>=0&&(e-=.1*this.avpPips);var i="Buy"===this.order.orderType?+(this.order.openPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision):+(this.order.openPrice+e/Ph(this.getPrecision)).toFixed(this.getPrecision);this.stopLoss=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomSL",data:this.stopLoss})},changeStopLossByPrice:function(t){var e=this.stopLoss?this.stopLoss:this.order.openPrice,i=t?+(e+this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e-this.getStepPips/Ph(this.getPrecision)).toFixed(this.getPrecision);this.stopLoss=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomSL",data:this.stopLoss})},changePriceStopLossManual:function(t){var e=+t.target.value,i="USD"===this.typeStopLoss?+e.toFixed(this.getContractBySymbol.precision):"Buy"===this.order.orderType?+(this.order.openPrice-e/Ph(this.getPrecision)).toFixed(this.getPrecision):+(e/Ph(this.getPrecision)-this.order.openPrice).toFixed(this.getPrecision);i!==this.currentPrice&&(this.stopLoss=i,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomSL",data:this.stopLoss}))},setDefenceStatus:function(t){this.activeDefence=t.value,this.trailingStart=this.activeDefence?Math.round(5*this.avpPips):0,this.trailingSL=this.activeDefence?Math.round(2*this.avpPips):0,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomStartTSL",data:this.trailingStart}),this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTSL",data:this.trailingSL})},changeManualPriceTralingStart:function(t){var e=Math.round(+t.target.value);e>=this.trailingSL+this.getStepPips&&(this.trailingStart=e,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomStartTSL",data:this.trailingStart}))},changePriceTralingStart:function(t){var e=t?this.trailingStart+this.getStepPips:this.trailingStart-this.getStepPips;e>=this.trailingSL+this.getStepPips&&(this.trailingStart=e,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomStartTSL",data:this.trailingStart}))},changePriceTralingSL:function(t){var e=t?this.trailingSL+this.getStepPips:this.trailingSL-this.getStepPips;e&&e>0&&e<=this.trailingStart-this.getStepPips&&(this.trailingSL=e,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTSL",data:this.trailingSL}))},changeManualPriceTralingSL:function(t){var e=Math.round(+t.target.value);e&&e>0&&e<=this.trailingStart-this.getStepPips&&(this.trailingSL=e,this.eventEmitter.emit("changeOpenOrderSetting",{name:"fantomTSL",data:this.trailingSL}))},downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},placeOpenOrder:function(){var t={Command:"OpenTradingOrder",data:this.order,FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:t}),this.$emit("close")}},mounted:function(){var t=this,e=this.$orderStorage.getOrdersOnStorage().tradingOrders;this.order=e.find((function(e){return e.id===t.orderId})),this.takeProfit=this.order.takeProfit,this.stopLoss=this.order.stopLoss,this.order.trailingStart&&(this.activeDefence=!0,this.trailingSL=this.order.trailingSL,this.trailingStart=this.order.trailingStart),this.statusCheckBoxDefence=!0,this.$socketStream.$on("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},Gwt=Hwt,qwt=(i("0cff"),Object(C["a"])(Gwt,Uwt,Vwt,!1,null,null,null)),zwt=qwt.exports,Ywt={components:{DxPopup:wt["DxPopup"],NewOrder:Ewt,SettingOrder:zwt},props:{idOrderForSetting:{type:String},openOrderPopupStatus:{default:!1},avpPips:{type:Number},idChart:{default:""},eventEmitter:{default:null},mode:{type:String,default:"new"},symbol:{type:String},currentPrice:{type:Number}},mixins:[qe],data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getContracts:"contracts/getContracts",getDefaultAccount:"subscribeOrders/getDefaultAccount",getSession:"auth/getSession"})),{},{getTitle:function(){return"new"!==this.mode?"Redact order":this.getCryptoStatus?"New order Crypto: ".concat(this.symbol):"New order Forex: ".concat(this.symbol)},getContractBySymbol:function(){var t=this;return this.getContracts.find((function(e){return e.name===t.symbol}))},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup}}),methods:{closePopup:function(){this.eventEmitter.emit("setOpenOrder",null),this.eventEmitter.emit("closeSettingOpenOrderPopup"),this.$emit("close")}},mounted:function(){},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},Xwt=Ywt,Qwt=(i("68694"),Object(C["a"])(Xwt,$wt,Lwt,!1,null,null,null)),Jwt=Qwt.exports,Kwt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TralingPendingOrders",class:"TralingPendingOrders_".concat(t.getActiveTheme)},[e("DxPopup",{attrs:{visible:t.tralingOrdersPopupStatus,position:{my:"top right",at:"top right",of:".Multichart-chartContainer_".concat(t.idChart),offset:{x:-300,y:t.getPosition}},container:".TralingPendingOrders",dragOutsideBoundary:!0,shading:!1,width:"210",height:"auto"},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"TralingPendingOrders-copyTitle",class:"TralingPendingOrders-copyTitle_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Drag"}}),t._v("Активная защита ордера"),e("div",{staticClass:"TralingPendingOrders-helpIcon",class:"TralingPendingOrders-helpIcon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"FAQ-16"}})],1)],1)]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"TralingPendingOrders-copyPopup",class:"TralingPendingOrders-copyPopup_".concat(t.getActiveTheme)},[e("div",{staticClass:"TralingPendingOrders-copyControls"},[e("div",{staticClass:"TralingPendingOrders-copyControl"},[e("div",{staticClass:"TralingPendingOrders-setCopyLabel",class:"TralingPendingOrders-setCopyLabel_".concat(t.getActiveTheme)},[t._v("Перенос при достижении, pips")]),e("div",{staticClass:"TralingPendingOrders-setCopy",class:"TralingPendingOrders-setCopy_".concat(t.getActiveTheme)},[e("div",{staticClass:"TralingPendingOrders-setCopy-control",class:"TralingPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.removeTralingStart,mousedown:function(e){return t.downChange("throttlStatus","removeTralingStart",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"text",readonly:""},domProps:{value:t.trailingStart}}),e("div",{staticClass:"TralingPendingOrders-setCopy-control",class:"TralingPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.addTralingStart,mousedown:function(e){return t.downChange("throttlStatus","addTralingStart",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)]),e("div",{staticClass:"TralingPendingOrders-setCopyLabel",class:"TralingPendingOrders-setCopyLabel_".concat(t.getActiveTheme)},[t._v("на уровень, pips")]),e("div",{staticClass:"TralingPendingOrders-setCopy",class:"TralingPendingOrders-setCopy_".concat(t.getActiveTheme)},[e("div",{staticClass:"TralingPendingOrders-setCopy-control",class:"TralingPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.removeTralingSL,mousedown:function(e){return t.downChange("throttlStatus","removeTralingSL",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Minus"}})],1),e("input",{attrs:{type:"text",readonly:""},domProps:{value:t.trailingSL}}),e("div",{staticClass:"TralingPendingOrders-setCopy-control",class:"TralingPendingOrders-setCopy-control_".concat(t.getActiveTheme),on:{click:t.addTralingSL,mousedown:function(e){return t.downChange("throttlStatus","addTralingSL",[])},mouseup:function(e){return t.clearThrottle("throttlStatus")},mouseleave:function(e){return t.clearThrottle("throttlStatus")}}},[e("svgIcon",{attrs:{name:"Add"}})],1)])])]),e("div",{staticClass:"TralingPendingOrders-copyButtons"},[e("ButtonIconFlat",{attrs:{modifier:{class:["TralingPendingOrders-copyButton","TralingPendingOrders-copyButton_".concat(t.getActiveTheme)]},icon:{name:"Check",color:t.getGreenColor.color}},on:{click:t.applyTraling}},[t._v("Применить")]),e("ButtonIconFlat",{attrs:{modifier:{class:["TralingPendingOrders-copyButton","TralingPendingOrders-copyButton_".concat(t.getActiveTheme)]},icon:{name:"Close",color:t.getRedColor.color}},on:{click:t.clearTraling}},[t._v("Отмена")])],1)])]},proxy:!0}])}),e("DxTooltip",{attrs:{target:".TralingPendingOrders-helpIcon",showEvent:"mouseenter",hideEvent:"mouseleave",container:".TralingPendingOrders",height:"auto"},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"TralingPendingOrders-helpTooltip"},[t._v("При активной защите стоп лосс остается на фиксированном расстоянии (в пипсах) от текущей спотовой цены. Если спотовая цена движется против направления позиции, стоп лосс изменить нельзя. Изменяется с каждым пипом. ")])]},proxy:!0}])})],1)},Zwt=[],t_t={components:{DxPopup:wt["DxPopup"],DxTooltip:wt["DxTooltip"]},mixins:[qe],props:{tralingOrdersPopupStatus:{default:!1},configTralingOrderPopup:{type:Object},eventEmitter:{default:null},idChart:{default:""},avpPips:{type:Number}},data:function(){return{trailingSL:100,trailingStart:500,step:10,throttlStatus:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPosition:function(){var t;return null!==(t=this.configTralingOrderPopup)&&void 0!==t&&t.position?this.configTralingOrderPopup.position+20:0}}),methods:{downChange:function(t,e,i){var o=this;this[t]&&this.clearThrottle(t),this[t]=setInterval((function(){o[e].apply(o,Object(x["a"])(i))}),150)},clearThrottle:function(t){clearInterval(this[t]),this[t]=null},applyTraling:function(){this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart}),this.closePopup()},addTralingStart:function(){this.trailingStart+=this.step,this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart})},addTralingSL:function(){this.trailingSL+this.step>=this.trailingStart||(this.trailingSL+=this.step,this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart}))},removeTralingStart:function(){this.trailingStart-this.step<=this.trailingSL||(this.trailingStart-=this.step,this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart}))},removeTralingSL:function(){this.trailingSL!==this.step&&(this.trailingSL-=this.step,this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart}))},clearTraling:function(){this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:0,trailingStart:0}),this.closePopup()},closePopup:function(){this.$emit("closePopup")},setDragTraling:function(t){this[t.param]=t.data}},mounted:function(){this.trailingSL=Math.round(2*this.avpPips)<1?2:Math.round(2*this.avpPips),this.trailingStart=Math.round(5*this.avpPips)<1?5:Math.round(5*this.avpPips),this.step=Math.round(.1*this.avpPips)<1?1:Math.round(.1*this.avpPips),this.eventEmitter.subscribe("changeDragTralingPendingOrder",this.setDragTraling),this.configTralingOrderPopup.order.trailingStart&&this.configTralingOrderPopup.order.trailingSL?(this.trailingStart=this.configTralingOrderPopup.order.trailingStart,this.trailingSL=this.configTralingOrderPopup.order.trailingSL):this.eventEmitter.emit("applyTralingPendingOrder",{trailingSL:this.trailingSL,trailingStart:this.trailingStart})},destroyed:function(){this.eventEmitter.unsubscribe("changeDragTralingPendingOrder",this.setDragTraling)}},e_t=t_t,i_t=(i("da5a"),Object(C["a"])(e_t,Kwt,Zwt,!1,null,null,null)),o_t=i_t.exports,n_t=function(){function t(e){Object(Qh["a"])(this,t),this.storage=[],this.eventEmiter=e}return Object(Jh["a"])(t,[{key:"getActiveObjects",value:function(){return this.storage}},{key:"setActiveObject",value:function(t){if(this.storage.length){var e=this.storage.findIndex((function(e){return e.name===t.name}));-1!==e?this.storage.splice(e,1,t):(this.storage.push(t),this.eventEmiter.emit("setNewActiveObject"))}else this.storage.push(t),this.eventEmiter.emit("setNewActiveObject")}},{key:"deleteActiveObject",value:function(t){if(this.storage.length){var e=this.storage.findIndex((function(e){return e.name===t.name}));-1!==e&&this.storage.splice(e,1)}}}]),t}(),s_t=new Kh,r_t={components:{TradingVue:Opt["TradingVue"],TopBarMultiChart:Swt,CopyPendingOrders:_wt,TralingPendingOrders:o_t,CreatePendingOrders:Mwt,OpenOrder:Jwt},props:{configObject:{type:Object},topBarWidgetParams:{type:Object,default:function(){return{row:"full"}}}},mixins:[lW,Xh],data:function(){return{EventBusLocal:null,storageActiveObjectsChart:null,copyOrdersPopupStatus:!1,createPendingOrderPopupStatus:!1,tralingOrdersPopupStatus:!1,configCopyOrderPopup:null,configTralingOrderPopup:null,dataCube:null,currentChartRange:null,stepGetCandles:350,typeCommand:"",lastTime:null,allCandles:null,overlays:fwt,quote:null,avpPips:0,pendingOpenPopupPendingOrder:!1,openOrderPopupStatus:!1,modeOpenOrderModal:"new",idOrderForSetting:null}},watch:{getTimeFrame:function(){this.dataCube&&this.getCandlesForChangeTimeFrame()},getStatusAddOverlay:function(t){t&&this.$orderStorage.getOrdersOnStorage()&&(this.addOverlayUnicInDataCube({name:"MouseWatcher",settings:{legend:!1,eventBus:this.EventBusLocal}}),this.addOverlayUnicInDataCube({name:"MiddlePrice",settings:{legend:!1,zIndex:1,symbol:this.getSymbol,dataSet:this.dataCube}}),this.addOverlayUnicInDataCube({name:"WatermarkProfitWidgets",settings:{legend:!1,symbol:this.getSymbol,dataSet:this.dataCube}}),this.addOverlayUnicInDataCube({name:"WatermarkTitleChart",settings:{legend:!1,symbol:this.getSymbol,dataSet:this.dataCube,timeFrame:this.getTimeFrame}}),this.addOverlayUnicInDataCube({name:"News",settings:{legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}}),this.addOverlayUnicInDataCube({name:"Streams",settings:{legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,idChart:this.getDataQuoteButton.id}}),this.addOverlayUnicInDataCube({name:"CurrentBar",settings:{zIndex:0,legend:!1,symbol:this.getSymbol,dataSet:this.dataCube}}),this.addOverlayUnicInDataCube({name:"ClosedOrders",settings:{zIndex:1,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}}),this.addOverlayUnicInDataCube({name:"SetPendingOrder",settings:{zIndex:3,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,idChart:this.getButtonId,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart}}),this.addOverlayUnicInDataCube({name:"PendingOrders",settings:{zIndex:1,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,idChart:this.getButtonId,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart}}),this.addOverlayUnicInDataCube({name:"OpenOrders",settings:{zIndex:2,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart}}),this.addOverlayUnicInDataCube({name:"CreateOpenOrder",settings:{zIndex:3,legend:!1,symbol:this.getSymbol,dataSet:this.dataCube,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart}}),this.addOverlayUnicInDataCube({name:"ClosedOrdersInfo",settings:{zIndex:3,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getStatByOrders:"contracts/getStatByOrders",getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime"})),{},{getStatusAddOverlay:function(){return this.getStatByOrders&&!!this.dataCube},getTypeMultichart:function(){return this.configObject.typeMultichart},getlastPriceCandle:function(){if(this.dataCube){var t=this.dataCube.get("chart.data"),e=t[0].at(-1);return this.quote?this.quote.b:e[1]}},getCandleUpColor:function(){return"light"===this.getActiveTheme?"#008e72":"#26A69A"},getChartId:function(){return this.getDataQuoteButton.id},getCandleDownColor:function(){return"light"===this.getActiveTheme?"#e91212":"#fa4c4a"},getBackgroundChart:function(){return"dark"===this.getActiveTheme?"#151924":"#fff"},getColorTextChart:function(){return"light"===this.getActiveTheme?"#8c8c8c":"#e4e4e4"},getDataQuoteButton:function(){return this.configObject.dataQuoteButton},getButtonId:function(){return this.configObject.dataQuoteButton.id},getChartIndex:function(){return this.configObject.chartIndex},getGroupIndex:function(){return this.configObject.groupIndex},getColor:function(){return this.allColors[this.getActiveTheme]},getSymbol:function(){return this.getDataQuoteButton.symbol},getTimeFrame:function(){return this.$frames[this.getDataQuoteButton.timeFrame]},getActiveTypeChartForScreen:function(){return this.getDataQuoteButton.typeMultichart},getFullScreenStatus:function(){return this.configObject.fullScreen},getGroupId:function(){return this.configObject.groupId},getWidthCurrentChart:function(){return this.configObject.widthCurrentChart},getHeightCurrentChart:function(){return this.configObject.heightCurrentChart},getSizeChart:function(){if(this.getWidthCurrentChart&&this.getHeightCurrentChart)return{width:this.getWidthCurrentChart,height:this.getHeightCurrentChart}},getChartConfig:function(){var t=Math.round(this.getWidthCurrentChart/8),e={DEFAULT_LEN:t>this.stepGetCandles?this.stepGetCandles:t};return e},getPrecisionForScaleChart:function(){var t,e=this,i=null===(t=this.getContracts)||void 0===t||null===(t=t.find((function(t){return t.name===e.getSymbol})))||void 0===t?void 0:t.chartPrecision;return i}}),methods:{setChunk:function(t){var e=this.dataCube.get("chart.data"),i=e[0][0];i[0]>=new Date(t[0]).getTime()&&this.getCandlesChunk(t)},mouseMove:function(){this.dataCube.merge("onchart.SetPendingOrder.settings",{cursor:this.$refs["tvjs-".concat(this.getGroupId,"-").concat(this.getSymbol,"-").concat(this.getTimeFrame)].getCursor()})},changeRange:function(t){this.currentChartRange=t,this.debouncer("setChunk",200,t)},createDataCube:function(t){this.dataCube=new Opt["DataCube"]({chart:{type:"Candles",data:t,indexBased:!0,settings:{auto_scroll:!0,ww_ram_limit:256}},offchart:[],onchart:[]})},setNewCandles:function(t){if(this.dataCube.set("chart.data",t),this.currentChartRange){var e=t[0][0];e>this.currentChartRange[1]&&this.$refs["tvjs-".concat(this.getGroupId,"-").concat(this.getSymbol,"-").concat(this.getTimeFrame)].resetChart()}this.dataCube.set("onchart.WatermarkTitleChart.settings",{legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}),this.dataCube.set("onchart.News.settings",{legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}),this.dataCube.set("onchart.Streams.settings",{legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,idChart:this.getDataQuoteButton.id}),this.dataCube.set("onchart.ClosedOrders.settings",{zIndex:1,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube}),this.dataCube.set("onchart.OpenOrders.settings",{zIndex:2,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart}),this.dataCube.set("onchart.PendingOrders.settings",{zIndex:1,legend:!1,symbol:this.getSymbol,timeFrame:this.getTimeFrame,dataSet:this.dataCube,eventBus:this.EventBusLocal,storageActiveObjectsChart:this.storageActiveObjectsChart})},setNewCandlesChunk:function(t){this.dataCube.merge("chart.data",t)},setMessageHandler:function(t){var e=this;if(t&&t.command&&"Candles"===t.command)this.setCandles(t.data);else if(t&&t.command&&"Quotes"===t.command){var i=t.data,o=i.find((function(t){return t.s===e.getSymbol}));o&&(this.setCurrentQuote(o),this.lastTime&&!Mpt(new Date(this.lastTime),this.getTimeFrame||60,this.getServerTime)&&this.getCandles(1,"candleChunk"))}},setCurrentQuote:function(t){if(this.quote=t,this.dataCube){var e=this.dataCube.get("chart.data"),i=e[0].at(-1);i.length>5&&(i.splice(1,1),i[4]=t.b),this.dataCube.merge("chart.data",[[i[0],i[1],t.b>i[2]?t.b:i[2],t.bthis.stepGetCandles?(t={command:"Candles",method:"get",data:{quote:this.getSymbol,timeframe:this.getTimeFrame,count:null,DateFrom:new Date(this.currentChartRange[0]),DateTo:new Date,requestId:this.getButtonId}},this.$socketStream.sendCommand({ws:"apiWS2",command:t})):this.getCandles(this.stepGetCandles,this.typeCommand)}else this.getCandles(this.stepGetCandles,this.typeCommand)},getCandlesChunk:function(t){this.typeCommand="candleChunk";var e=Math.floor((new Date(t[1]).getTime()-new Date(t[0]).getTime())/(6e4*this.getTimeFrame)),i={command:"Candles",method:"get",data:{quote:this.getSymbol,timeframe:this.getTimeFrame,count:e||this.stepGetCandles,DateFrom:e?new Date(t[1]):new Date,requestId:this.getButtonId}};this.$socketStream.sendCommand({ws:"apiWS2",command:i})},getCandles:function(t,e){this.typeCommand=e;var i={command:"Candles",method:"get",data:{quote:this.getSymbol,timeframe:this.getTimeFrame,count:t,requestId:this.getButtonId}};this.$socketStream.sendCommand({ws:"apiWS2",command:i})},addOverlayUnicInDataCube:function(t){this.dataCube&&(this.dataCube.get("onchart.".concat(t.name,"0")).length||this.dataCube.add("onchart",{name:t.name,type:t.name,data:[],auto_scroll:!0,settings:t.settings}))},openCopyPendingOrdersModal:function(t){t?(this.copyOrdersPopupStatus=!0,this.configCopyOrderPopup=t):(this.copyOrdersPopupStatus=!1,this.configCopyOrderPopup=null)},closeCreatedOrderPopup:function(){this.createPendingOrderPopupStatus=!1,this.configCreatePendingOrderPopup=null},openPopupCreatePendingOrder:function(){this.createPendingOrderPopupStatus||(this.createPendingOrderPopupStatus=!0,this.configCreatePendingOrderPopup={symbol:this.getSymbol})},openPopupCreateOrder:function(){this.modeOpenOrderModal="new",this.openOrderPopupStatus=!0},openTralingPendingOrdersModal:function(t){t?(this.tralingOrdersPopupStatus=!0,this.configTralingOrderPopup=t):(this.tralingOrdersPopupStatus=!1,this.configTralingOrderPopup=null)},openOpenOrderSettings:function(t){t?(this.openOrderPopupStatus=!0,this.modeOpenOrderModal="settings",this.idOrderForSetting=t):(this.openOrderPopupStatus=!1,this.idOrderForSetting=null)},openPendinOrderEvent:function(t){t.id===this.getButtonId&&this.openPopupCreatePendingOrder()},openNewOrderEvent:function(t){t.id===this.getButtonId&&this.openPopupCreateOrder()},selectedChart:function(){this.getDataQuoteButton.selected||this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setNewButtonForActiveSet",data:this.getChartId,role:this.getStatusUser.status})},setFullScreen:function(){this.$emit("setFullScreen"),this.selectedChart()}},mounted:function(){this.EventBusLocal||(this.EventBusLocal=Kh.from(s_t),this.storageActiveObjectsChart=new n_t(this.EventBusLocal)),this.$socketStream.$on("apiWS2",this.setMessageHandler),this.$socketStream.$on("apiWS3",this.setMessageHandler),this.getCandles(this.stepGetCandles,"firstSet"),Zh.subscribe("openNewPendingOrder",this.openPendinOrderEvent),Zh.subscribe("openNewOrder",this.openNewOrderEvent),this.EventBusLocal.subscribe("setStatusCopyPendingOrders",this.openCopyPendingOrdersModal),this.EventBusLocal.subscribe("changeSettingOpenOrder",this.openOpenOrderSettings),this.EventBusLocal.subscribe("setStatusTralingPendingOrders",this.openTralingPendingOrdersModal)},destroyed:function(){this.$socketStream.$off("apiWS2",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler),Zh.unsubscribe("openNewPendingOrder",this.openPendinOrderEvent),Zh.unsubscribe("openNewOrder",this.openNewOrderEvent),this.EventBusLocal.unsubscribe("setStatusCopyPendingOrders",this.openCopyPendingOrdersModal),this.EventBusLocal.unsubscribe("changeSettingOpenOrder",this.openOpenOrderSettings),this.EventBusLocal.unsubscribe("setStatusTralingPendingOrders",this.openTralingPendingOrdersModal),this.$socketStream.$off("apiWS2",this.setMessageHandler)}},a_t=r_t,c_t=(i("9068"),Object(C["a"])(a_t,XTt,QTt,!1,null,"e26a49e4",null)),l_t=c_t.exports,u_t=function(){var t=this,e=t._self._c;return t.getSession?e("div",{staticClass:"chart-control-panel",class:t.getActiveTheme,staticStyle:{bottom:"6px"},on:{mouseenter:t.handleMouseEnterOnPanel,mouseleave:t.handleMouseLeaveOnPanel}},[t.telegramPopup?e("DxPopup",{attrs:{visible:t.telegramPopup,shading:!1,"drag-enabled":!1,"show-title":!1,width:455,height:"auto"}},[e("TelegramReports",{on:{closePopup:t.setTelegramPopup}})],1):t._e(),e("div",{staticClass:"chart-control-panel__item tradeServer",class:t.getTradeNotification?"chart-control-panel__item_isActive_".concat(t.getActiveTheme):t.isOpen?"chart-control-panel__item_yellow_".concat(t.getActiveTheme):"chart-control-panel__item_".concat(t.getActiveTheme),on:{click:t.showTradeNotification,mouseleave:function(e){return t.handleMouseLeaveItem("isShowTooltipTradeServer")},mouseenter:function(e){return t.handleMouseEnterItem("isShowTooltipTradeServer")}}},[e("DxTooltip",{attrs:{visible:t.isShowTooltipTradeServer,target:".tradeServer",position:"top",wrapperAttr:{class:"tooltip-control-panel ".concat(t.getActiveTheme)}}},[t._v("Уведомления торгового сервера")]),e("svgIcon",{attrs:{name:"TradeNotifiction"}})],1),t._l(t.getControlsStettings,(function(i,o){return t.isOpen?e("div",{key:o,class:i.class,on:{mouseleave:function(e){return t.handleMouseLeaveItem(i.tooltipVariable)},mouseenter:function(e){return t.handleMouseEnterItem(i.tooltipVariable)},click:function(e){return t.setStatusControl(i)}}},[e("svgIcon",{attrs:{name:i.iconName}}),e("DxTooltip",{attrs:{visible:i.toolTipStatus,target:i.tooltipId,position:"top",wrapperAttr:{class:"tooltip-control-panel ".concat(t.getActiveTheme)}}},[t._v(t._s(i.textTooltip))])],1):t._e()})),t.isOpen?e("div",{staticClass:"chart-control-panel__control",class:"chart-control-panel__control_".concat(t.getActiveTheme),on:{click:function(){return t.isOpen=!1}}},[e("svgIcon",{attrs:{name:"Block-expand-right"}})],1):e("div",{staticClass:"chart-control-panel__control",class:"chart-control-panel__control_".concat(t.getActiveTheme),on:{click:function(){return t.isOpen=!0},mouseenter:t.handleMouseEnterOnButtonOpen}},[e("svgIcon",{attrs:{name:"Block-expand-right-close"}})],1)],2):t._e()},d_t=[],h_t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TelegramReports"},[e("div",{staticClass:"TelegramReports-title",class:"TelegramReports-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"TelegramReports-title-text",class:"TelegramReports-title-text_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("btit")))]),e("div",{staticClass:"TelegramReports-title-close"},[e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["TelegramReports_closeButton","TelegramReports_closeButton_".concat(t.getActiveTheme)]}},on:{click:t.closePopup}})],1)]),e("div",{staticClass:"TelegramReports-content",class:"TelegramReports-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"TelegramReports-leftSide"},[t.getCreatedChannel?e("div",{staticClass:"TelegramReports-inputWrap"},[e("div",{staticClass:"TelegramReports-inputLabel",class:"TelegramReports-inputLabel_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("cltta"),":")))]),e("div",{staticClass:"TelegramReports-createdChannel"},[e("div",{staticClass:"TelegramReports-createdChannel-wrap"},[e("div",{staticClass:"TelegramReports-createdChannel-icon",style:{color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Messenger-Telegramm"}})],1),e("div",{staticClass:"TelegramReports-createdChannel-name",class:"TelegramReports-createdChannel-name_".concat(t.getActiveTheme)},[t._v(" "+t._s(t.getCreatedChannel.name))])]),e("div",{staticClass:"TelegramReports-createdChannel-del",style:{color:t.getRedColor.color},on:{click:t.removeTelegram}},[this.isLoadDel?e("DxLoadIndicator",{attrs:{width:"25",height:"25"}}):e("svgIcon",{attrs:{name:"Close"}})],1)])]):e("div",{staticClass:"TelegramReports-inputWrap"},[e("div",{staticClass:"TelegramReports-inputLabel",class:"TelegramReports-inputLabel_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("channel_name"),":"))+" ")]),e("div",{staticClass:"TelegramReports-input",class:"TelegramReports-input_".concat(t.getActiveTheme)},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.nameChannel,expression:"nameChannel"}],attrs:{type:"text"},domProps:{value:t.nameChannel},on:{input:function(e){e.target.composing||(t.nameChannel=e.target.value)}}})])]),e("div",{staticClass:"TelegramReports-inputWrap"},[e("div",{staticClass:"TelegramReports-inputLabel",class:"TelegramReports-inputLabel_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("account_for_broadcasting"),":")))]),t.selectAccount?e("div",{staticClass:"TelegramReports-input",class:"TelegramReports-input_".concat(t.getActiveTheme)},[e("DxDropDownBox",{ref:"dropDownAccount",attrs:{items:t.getProfileAccount,focusStateEnabled:!1,hoverStateEnabled:!1,value:t.selectAccount,fieldTemplate:"field"},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{staticClass:"TelegramReports-selectAccountWrap"},[e("DxTextBox",{attrs:{width:"0",visible:!1,height:"0",value:"","read-only":!0}}),e("div",{staticClass:"TelegramReports-selectAccount"},[t._v(t._s(o.sequenceId))])],1)]}},{key:"content",fn:function(i){i.data;return[e("div",{staticClass:"TelegramReports-accounts",class:"TelegramReports-accounts_".concat(t.getActiveTheme)},t._l(t.getProfileAccount,(function(i,o){return e("div",{staticClass:"TelegramReports-accountItem",class:i.sequenceId===t.selectAccount.sequenceId?"TelegramReports-accountItem_isActive_".concat(t.getActiveTheme):"TelegramReports-accountItem_".concat(t.getActiveTheme),on:{click:function(e){return t.setSelectAccount(i)}}},[t._v(t._s(i.sequenceId))])})),0)]}}],null,!1,70512265)})],1):t._e()])]),e("div",{staticClass:"TelegramReports-rightSide"},[e("div",{staticClass:"TelegramReports-instuction",class:"TelegramReports-instuction_".concat(t.getActiveTheme)},[e("p",[t._v(t._s(t.$t("tsubo"))),e("a",[t._v("@ttPlatformBot ")]),t._v(t._s(t.$t("tetno"))+" ")]),e("p",[t._v(t._s(t.$t("ycact"))),e("a",[t._v(t._s(t.$t("personal_cabinet")))])]),e("p",[e("a",{staticStyle:{cursor:"pointer"},attrs:{href:"https://about.toptrader.ru/docs/telegram_report.pdf",target:"_blank"}},[t._v(t._s(t.$t("detailed_instruction")))])])])])]),e("div",{staticClass:"TelegramReports-footer",class:"TelegramReports-footer_".concat(t.getActiveTheme)},[t.isLoad||t.statusMsg?t._e():e("ButtonIconFlat",{attrs:{modifier:{class:["TelegramReports_connectButton","TelegramReports_connectButton_".concat(t.getActiveTheme)]},disabled:t.getCreatedChannel||!t.nameChannel||t.isLoadDel},on:{click:t.connectTelegram}},[t._v(t._s(t.$t("connect")))]),t.statusMsg?e("div",{staticClass:"TelegramReports-statusMsg",style:{color:t.statusMsg.color}},[t._v(t._s(t.statusMsg.text))]):t._e(),t.isLoad?e("DxLoadIndicator",{attrs:{width:"25",height:"25"}}):t._e()],1)])},p_t=[],g_t={components:{DxDropDownBox:wt["DxDropDownBox"],DxTextBox:wt["DxTextBox"],DxLoadIndicator:wt["DxLoadIndicator"]},mixins:[qe],data:function(){return{nameChannel:"",selectAccount:null,userChannels:null,isLoad:!1,isLoadDel:!1,statusMsg:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getProfileAccount:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getApiUrl:"api/api",getSession:"auth/getSession"})),{},{getCreatedChannel:function(){var t=this;if(this.selectAccount&&this.userChannels&&this.userChannels.length)return this.userChannels.find((function(e){return e.accountId===t.selectAccount.id}))},getRequsetForSave:function(){return JSON.stringify({accountId:this.selectAccount.id,name:this.nameChannel})}}),methods:{setSelectAccount:function(t){this.selectAccount=t,this.nameChannel="",this.$refs.dropDownAccount.instance.close()},closePopup:function(){this.$emit("closePopup")},getChannels:function(t){this.userChannels=t},setStatusConnectMessage:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if("Already have a connection"!==t){i.next=6;break}return e.statusMsg={text:e.$t("tcial"),color:e.getOrangeColor.color},i.next=4,setTimeout((function(){e.statusMsg=null}),2e3);case 4:i.next=10;break;case 6:if(t!=="For ".concat(e.nameChannel," bot not found")){i.next=10;break}return e.statusMsg={text:e.$t("btinf"),color:e.getRedColor.color},i.next=10,setTimeout((function(){e.statusMsg=null}),2e3);case 10:case"end":return i.stop()}}),i)})))()},connectTelegram:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoad=!0,e.next=3,t.$workKeys.signMessage(JSON.stringify(t.getRequsetForSave),t.getSession.sk);case 3:i=e.sent,t.$http.post(t.getApiUrl+"ConnectTelegram",t.getRequsetForSave,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":i}}).then((function(e){t.setStatusConnectMessage(e.data).then((function(){return t.getAllTelegrams().then((function(){return t.isLoad=!1}))}))})).catch((function(e){return t.setStatusConnectMessage(e)}));case 5:case"end":return e.stop()}}),e)})))()},removeTelegram:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoadDel=!0,e.next=3,t.$workKeys.signMessage(JSON.stringify({id:t.selectAccount.id}),t.getSession.sk);case 3:i=e.sent,t.$http.post(t.getApiUrl+"DeleteTelegram",{id:t.selectAccount.id},{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":i}}).then((function(){t.getAllTelegrams().then((function(){return t.isLoadDel=!1}))}));case 5:case"end":return e.stop()}}),e)})))()},getAllTelegrams:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.get(t.getApiUrl+"GetUserMessangerInfo",{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":t.getSession.singFP}}).then((function(e){t.getChannels(e.data)}));case 2:case"end":return e.stop()}}),e)})))()}},mounted:function(){this.selectAccount=this.getDefaultAccount,this.getAllTelegrams()}},f_t=g_t,m_t=(i("0114"),Object(C["a"])(f_t,h_t,p_t,!1,null,"360f15c2",null)),v_t=m_t.exports,y_t={props:[],components:{DxPopup:wt["DxPopup"],DxTooltip:wt["DxTooltip"],svgIcon:L,Avatar:E,TelegramReports:v_t},data:function(){return{showAvatarsProviders:null,timeOnEnter:null,timeOnLeave:null,isOpen:!1,myAvatars:!1,providers:!0,historyNews:!1,disabledNews:!1,disabledStreams:!1,disabledHistoryStreams:!1,isOpenDropDown:!1,disabledLim:!1,isShowTooltipProfitLeftWidgets:!1,isShowTooltipFonChart:!1,isShowTooltipTradeServer:!1,isShowTooltipStreams:!1,isShowTooltipStreamsHistory:!1,isShowTooltipNews:!1,isShowTooltipHistoryNews:!1,isShowTooltipLim:!1,isShowTooltipAveragePrice:!1,isShowTooltipMyOpenOrders:!1,isShowTooltipMyClosedOrders:!1,isShowTooltipTradeLevels:!1,isShowTooltipDataOnOrder:!1,disabledNotificationOnGaph:!1,isShowTooltipNotificationOnGaph:!1,isShowTooltipMaxMinDay:!1,"isShowTooltipеSettings":!1,isShowTooltipGraphSettings:!1,isShowTooltipReportTelegram:!1,telegramPopup:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSettingsParamsLeftBar:"settingsTradingChart/getSettingsParamsLeftBar",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings",getProfileAccount:"subscribeOrders/getProfileAccount",getTradeNotification:"modal/getTradeNotification",getActiveTheme:"headerSettings/getActiveTheme",getUserInfo:"user/getUserDetail",getSession:"auth/getSession"})),{},{getControlsStettings:function(){return[{textTooltip:"Вся история закрытых сделок",tooltipId:".closeOrders",field:"historyClosedOrders",tooltipVariable:"isShowTooltipMyClosedOrders",toolTipStatus:this.isShowTooltipMyClosedOrders,status:this.getStatusHistoryClosedOrders,iconName:"CloseOrders",class:"chart-control-panel__item closeOrders ".concat(this.getStatusHistoryClosedOrders?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_yellow_".concat(this.getActiveTheme))},{textTooltip:"Стримы",tooltipId:".streams",field:"streams",tooltipVariable:"isShowTooltipStreams",toolTipStatus:this.isShowTooltipStreams,status:this.getStatusStreams,iconName:"Stream",class:"chart-control-panel__item streams ".concat(this.getStatusStreams?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_".concat(this.getActiveTheme))},{textTooltip:"Новости",tooltipId:".news",field:"news",tooltipVariable:"isShowTooltipNews",toolTipStatus:this.isShowTooltipNews,status:this.getStatusNews,iconName:"News",class:"chart-control-panel__item news ".concat(this.getStatusNews?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_".concat(this.getActiveTheme))},{textTooltip:"История новостей",tooltipId:".newsHistory",field:"newsHistory",tooltipVariable:"isShowTooltipHistoryNews",toolTipStatus:this.isShowTooltipHistoryNews,status:this.getStatusNewsHistory,iconName:"HistoryNews",class:"chart-control-panel__item newsHistory ".concat(this.getStatusNewsHistory?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_".concat(this.getActiveTheme))},{textTooltip:"Фон графика",tooltipId:".fonChart",field:"fonChart",tooltipVariable:"isShowTooltipFonChart",toolTipStatus:this.isShowTooltipFonChart,status:this.getStatusFonChart,iconName:"FonGrafika",class:"chart-control-panel__item fonChart ".concat(this.getStatusFonChart?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_green_".concat(this.getActiveTheme))},{textTooltip:"Вкл/Выкл Виджетов (левый верхний угол)",tooltipId:".profitLeftWidgets",field:"profitLeftWidgets",tooltipVariable:"isShowTooltipProfitLeftWidgets",toolTipStatus:this.isShowTooltipProfitLeftWidgets,status:this.getStatusProfitLeftWidgets,iconName:"SortDollar",class:"chart-control-panel__item profitLeftWidgets ".concat(this.getStatusProfitLeftWidgets?"chart-control-panel__item_isActive_".concat(this.getActiveTheme):"chart-control-panel__item_green_".concat(this.getActiveTheme))},{textTooltip:"Транслировать сделки в Телеграм",tooltipId:".reportTelegram",field:"reportTelegram",tooltipVariable:"isShowTooltipReportTelegram",toolTipStatus:this.isShowTooltipReportTelegram,status:!1,iconName:"Messenger-Telegramm",class:"chart-control-panel__item reportTelegram ".concat("chart-control-panel__item_".concat(this.getActiveTheme))}]},getStatusHistoryClosedOrders:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.historyClosedOrders},getStatusNewsHistory:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.newsHistory},getStatusNews:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.news},getStatusStreams:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.streams},getStatusFonChart:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.fonChart},getStatusProfitLeftWidgets:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.profitLeftWidgets}}),methods:{setStatusControl:function(t){"reportTelegram"!==t.field?this.$store.dispatch("settingsTradingChart/setSettingsTradingChartSettings",{mutation:"setSettingForTradingChartSettings",data:{key:t.field,option:"bottomControlPanel",data:!t.status}}):this.setTelegramPopup()},setTelegramPopup:function(){this.telegramPopup=!this.telegramPopup},closeDropdown:function(){this.isOpenDropDown=!1},showTradeNotification:function(){this.$store.commit("modal/setTradeNotification",!0)},handleMouseLeaveItem:function(t){this[t]=!1},handleMouseEnterItem:function(t){this[t]=!0},getItemId:function(t){return document.getElementById(t)},handleMouseEnterOnPanel:function(){this.isOpen&&this.timeOnLeave&&(clearTimeout(this.timeOnLeave),this.timeOnLeave=null)},handleMouseLeaveOnPanel:function(){var t=this;this.isOpen&&!this.timeOnLeave&&(this.timeOnLeave=setTimeout((function(){t.isOpenDropDown?t.handleMouseLeaveOnPanel():t.isOpen=!1}),7e3))},handleMouseEnterOnButtonOpen:function(){var t=this;this.timeOnEnter=setTimeout((function(){t.isOpen=!0}),55)},handleMouseLeaveOnButtonOpen:function(){this.timeOnEnter&&(clearTimeout(this.timeOnEnter),this.timeOnEnter=null)},toggleVisibleItemOnChart:function(t){var e=JSON.parse(JSON.stringify(this.getSettingsParamsLeftBar));e[t]=!e[t],this.$store.dispatch("settingsTradingChart/setNewSettingsParamLeftBar",e)},changeShowingNews:function(){var t=JSON.parse(localStorage.getItem("isShowNews"));this.historyNews=!t,localStorage.setItem("isShowNews",JSON.stringify(this.historyNews))},changeDisabledNews:function(){var t=JSON.parse(localStorage.getItem("isDisabledNews"));this.disabledNews=!t,localStorage.setItem("isDisabledNews",JSON.stringify(this.disabledNews))},changeDisabledLim:function(){var t=JSON.parse(localStorage.getItem("disabledLim"));this.disabledLim=!t,localStorage.setItem("disabledLim",JSON.stringify(this.disabledLim))},changeShowStreams:function(){this.disabledStreams=!this.disabledStreams,this.updateStorage()},changeShowStreamsHistory:function(){this.disabledHistoryStreams=!this.disabledHistoryStreams,this.updateStorage()},updateStorage:function(){var t={disabledStreams:this.disabledStreams,disabledHistoryStreams:this.disabledHistoryStreams};localStorage.setItem("streamsInfo",JSON.stringify(t))},getStreamsInfo:function(t){if(t){var e=JSON.parse(t);this.disabledStreams=e.disabledStreams,this.disabledHistoryStreams=e.disabledHistoryStreams}}},mounted:function(){this.historyNews=JSON.parse(localStorage.getItem("isShowNews")),this.disabledNews=JSON.parse(localStorage.getItem("isDisabledNews")),this.disabledLim=JSON.parse(localStorage.getItem("disabledLim"));var t=localStorage.getItem("streamsInfo");this.getStreamsInfo(t)},destroyed:function(){}},C_t=y_t,b_t=(i("9e19"),Object(C["a"])(C_t,u_t,d_t,!1,null,null,null)),S_t=b_t.exports,P_t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container-notification-chart",style:{top:"".concat(t.position.bottom,"px"),left:"".concat(t.position.left,"px")}},[t.all?e("div",{staticClass:"header-notification-canvas-chart"},[t._v(" "+t._s("Вы уверены, что хотите закрыть все ".concat(t.type," ордера?"))+" ")]):e("div",{staticClass:"header-notification-canvas-chart"},[t._v(" "+t._s("Вы уверены, что хотите закрыть ордер?")+" ")]),e("div",{staticClass:"body-notification-chart"},[e("div",{staticClass:"body-notyf-conten btns-group"},[e("div",{staticClass:"btn-closed-order closed",on:{click:t.closeOrder}},[e("svgIcon",{attrs:{name:"del-ok",viewBox:"0 0 24 24"}}),e("div",[t._v("Закрыть")])],1),e("div",{staticClass:"btn-closed-order",on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close",viewBox:"0 0 24 24"}}),e("div",[t._v("Отменить")])],1)])]),t.footer?e("div",{staticClass:"footer-notification-chart"}):t._e()])},T_t=[],x_t={name:"ModalAcceptCloseOrders",mixins:[],props:{settings:{type:Object,required:!0},position:{type:Object,required:!0}},watch:{},mounted:function(){var t=this;this.order=this.settings.order,this.orders=this.settings.orders,this.all=this.settings.all,this.type=this.settings.type,setTimeout((function(){return t.acceptClose=!0}),300)},destroyed:function(){},methods:{close:function(){this.acceptClose&&Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"modalCloseOrder"}})},closeOrder:function(){if(!this.all)return Jpt.$emit("closePosition",{name:"closePosition",data:{order:this.order}}),this.close(),void(this.settings.handler&&this.settings.handler());this.orders.forEach((function(t){Jpt.$emit("closePosition",{name:"closePosition",data:{order:t}})})),this.close()}},computed:{},data:function(){return{order:void 0,footer:void 0,orders:null,all:null,type:null,newData:null}},directives:{"mousedown-outside":{bind:function(t,e,i){t.clickOutsideEvent=function(o){t.contains(o.target)||i.context[e.expression](o)},document.body.addEventListener("mousedown",t.clickOutsideEvent)},unbind:function(t){document.body.removeEventListener("mousedown",t.clickOutsideEvent)}}}},O_t=x_t,w_t=(i("c775"),Object(C["a"])(O_t,P_t,T_t,!1,null,"0b495b63",null)),__t=w_t.exports,A_t=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],staticClass:"close-limit-order",style:t.getPosition},[e("div",{staticClass:"close-limit-order__body"},[t._v(" "+t._s("Вы уверены, что хотите удалить ".concat(t.type," ордера ").concat(t.order.externalId||t.order.sequenceId,"?")))]),e("div",{staticClass:"close-limit-order__footer"},[e("div",{staticClass:"close-limit-order__buttons"},[e("div",{staticClass:"close-limit-order__button",on:{click:t.removeLimits}},[t._v("Удалить")]),e("div",{staticClass:"close-limit-order__button",on:{click:t.close}},[t._v("Отменить")])])])])},D_t=[],k_t={name:"ModalAcceptCloseLimit",mixins:[],props:{settings:{type:Object,required:!0}},mounted:function(){var t=this,e=this.settings.settings;this.updateSettings=e,this.order=e.order,this.type=e.type,this.orderType=e.orderType,setTimeout((function(){return t.acceptClose=!0}),300)},destroyed:function(){},methods:{removeLimits:function(){var t,e="takeProfit"===this.type?"stopLoss":"takeProfit",i=(t={id:this.order.id,accountId:this.order.accountId,orderType:this.order.orderType,volume:this.order.volume,contractName:this.order.contractName},Object(Vt["a"])(t,this.type,0),Object(Vt["a"])(t,e,this.order[e]),Object(Vt["a"])(t,"openDate",this.order.openDate),Object(Vt["a"])(t,"openPrice",this.order.openPrice),t);Jpt.$emit("updateOrder",{name:"updateOrder",data:{symbol:this.order.instrumentName,order:i}}),this.close()},close:function(){this.acceptClose&&Jpt.$emit("changeShowModalAcceptCloseLimit",{name:"changeShowModalAcceptCloseLimit",data:{settings:{}}})}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getPosition:function(){return this.updateSettings?{position:"absolute",left:"".concat(this.updateSettings.left+40,"px"),top:"".concat(this.updateSettings.top-35,"px"),zIndex:11}:{}}}),watch:{},data:function(){return{updateSettings:null,orderType:void 0,type:void 0}}},I_t=k_t,B_t=(i("9bc6"),Object(C["a"])(I_t,A_t,D_t,!1,null,null,null)),M_t=B_t.exports,$_t=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.close,expression:"close"}],staticClass:"modal-settings-type-qoute"},[e("div",{staticClass:"modal-settings-type-qoute__btn"},[e("Button",{style:{background:"none"},attrs:{withoutBorder:"true",icon:"Settings"},on:{click:t.handleClickOnOpenSettingsButton}})],1),t.isOpen?e("div",{directives:[{name:"show",rawName:"v-show",value:t.count>=3,expression:"count >= 3"}],staticClass:"modal-settings-type-qoute__container",class:t.getActiveTheme},[e("div",{staticClass:"modal-settings-type-qoute__item",class:t.getActiveTheme},[e("RadioButton",{attrs:{value:t.type,modelValue:"currentQuote"},on:{change:function(e){return t.changeType("currentQuote")}}}),e("div",{staticClass:"modal-settings-type-qoute__itm"},[e("img",{attrs:{src:t.listImages[0]},on:{load:t.loadImages}})]),e("div",{staticClass:"modal-settings-type-qoute__label"},[t._v("- Текущая котировка")])],1),e("div",{staticClass:"modal-settings-type-qoute__item",class:t.getActiveTheme},[e("RadioButton",{attrs:{value:t.type,modelValue:"dayQuote"},on:{change:function(e){return t.changeType("dayQuote")}}}),e("div",{staticClass:"modal-settings-type-qoute__itm"},[e("img",{attrs:{src:t.listImages[1]},on:{load:t.loadImages}})]),e("div",{staticClass:"modal-settings-type-qoute__label"},[t._v("- Текущая котировка с изменением цены от начала суток")])],1),e("div",{staticClass:"modal-settings-type-qoute__item",class:t.getActiveTheme},[e("RadioButton",{attrs:{value:t.type,modelValue:"finQoute"},on:{change:function(e){return t.changeType("finQoute")}}}),e("div",{staticClass:"modal-settings-type-qoute__itm"},[e("img",{attrs:{src:t.listImages[2]},on:{load:t.loadImages}})]),e("div",{staticClass:"modal-settings-type-qoute__label"},[t._v("- Текущая котировка и финансовый результат")])],1)]):t._e()])},L_t=[],F_t={name:"ModalSettingsTypeQoute",mixins:[],components:{DxDraggable:Se.a,Button:zt,RadioButton:$a},props:{},data:function(){return{isLoad:!1,isOpen:!1,type:"currentQuote",currentQuote:"currentQuote",dayQuote:"dayQuote",finQoute:"finQoute",listImages:["https://api.toptrader.org/api/Image/Partner/quote1_ac7a257f1a384e2ebe9ba1ec51169c2d.png","https://api.toptrader.org/api/Image/Partner/quote2_ac7a257f1a384e2ebe9ba1ec51169c2d.png","https://api.toptrader.org/api/Image/Partner/quote3_ac7a257f1a384e2ebe9ba1ec51169c2d.png"],count:0}},watch:{getStatusCurrentBar:function(t,e){e||(this.type=t)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings",getAccountsSettings:"accountsTradeSettings/getAccountsSettings",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatusCurrentBar:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.currentBar}}),created:function(){this.count=0},methods:{loadImages:function(){this.count+=1},initationTypesQuotes:function(t){if(t){var e=JSON.parse(t);for(var i in e)e[i]&&(this.type=i)}else this.type="dayQuote"},handleClickOnOpenSettingsButton:function(){this.isOpen=!this.isOpen},close:function(){this.isOpen=!1},changeType:function(t){this.type=t,this.$store.dispatch("settingsTradingChart/setSettingsTradingChartSettings",{mutation:"setSettingForTradingChartSettings",data:{key:"currentBar",option:"bottomControlPanel",data:this.type}})}},mounted:function(){this.type=this.getStatusCurrentBar}},j_t=F_t,R_t=(i("eec7"),Object(C["a"])(j_t,$_t,L_t,!1,null,null,null)),W_t=R_t.exports,N_t=function(){var t=this,e=t._self._c;return e("DxDraggable",[e("div",{staticClass:"container-new-settings-colors"},[e("div",{staticClass:"left-sctn-to-new-sett-clrs",class:t.getActiveTheme,attrs:{id:"drag-zone-new-settings-colors"}},[e("svgIcon",{attrs:{name:"Drag"}})],1),e("div",{staticClass:"right-sctn-to-new-sett-clrs"},[e("div",{staticClass:"right-sctn-to-new-sett-clrs__header",class:t.getActiveTheme},[e("div",{staticClass:"right-sctn-to-new-sett-clrs__header__title"},[e("svgIcon",{attrs:{name:"Color"}})],1),e("div",{staticClass:"right-sctn-to-new-sett-clrs__header__buttons"},[e("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.closeDD,expression:"closeDD"}],staticClass:"new-sett-clrs-btn",class:t.getActiveTheme},[e("div",{staticClass:"new-sett-clrs-btn-cnt-dd",on:{click:t.changeShowDD}},[e("div",{staticClass:"new-sett-clrs-btn__title"},[t._v(t._s(t.presetName))]),e("svgIcon",{attrs:{name:"dropdown-arrow"}})],1),t.isShowDD?e("div",{staticClass:"new-presets-btns-change"},[t._l(t.presetsCurrentTheme,(function(i){return e("div",{staticClass:"new-presets-btns-change__item",class:t.getActiveTheme},[e("div",{staticClass:"new-presets-btns-change__item__label",on:{click:function(e){return t.changePresete(i)}}},[t._v(t._s(i.name))]),0!==i.id&&1!==i.id?e("div",{staticClass:"cnt-icn-for-dd",on:{click:function(e){return t.removePreset(i)}}},[e("svgIcon",{attrs:{name:"Close"}})],1):t._e()])})),e("div",{staticClass:"new-presets-btns-change__item",class:t.getActiveTheme},[e("div",{staticClass:"new-presets-btns-change__item__label",on:{click:function(e){return t.createNewPreset(!1)}}},[t._v(t._s(t.$t("CreateNewPreset")))])])],2):t._e()]),e("div",{staticClass:"new-sett-clrs-btn",class:t.getActiveTheme,on:{click:t.close}},[e("svgIcon",{attrs:{name:"Close"}})],1)])]),e("div",{key:t.keyListColorPickers,staticClass:"right-sctn-to-new-sett-clrs__body",class:t.getActiveTheme},[e("div",{staticClass:"cnt-input-name-preset"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.presetName,expression:"presetName"}],staticClass:"input-name-preset__input",class:t.getActiveTheme,attrs:{type:"text"},domProps:{value:t.presetName},on:{change:t.updatePreset,input:function(e){e.target.composing||(t.presetName=e.target.value)}}})]),t._l(t.listBtns,(function(i,o){return e("div",{key:"".concat(i.paramName,"_").concat(i.label,"_").concat(t.keyListColorPickers),staticClass:"cnt-new-sett-clr"},[e("div",{staticClass:"cnt-new-sett-clr__title"},[t._v(t._s(t.$t(i.label)))]),e("div",{staticClass:"cnt-new-sett-clr__line",class:t.getActiveTheme}),e("NewColorPicker",{attrs:{color:t.getColor[i.paramName],right:"-290px",isRighSection:i.isRighSection,rightSection:i.rightSection},on:{changeColor:function(t){return i.change(i.paramName,t)}}})],1)}))],2)])])])},E_t=[],U_t={components:{DxDraggable:Se.a,NewColorPicker:Mbt},data:function(){return{keyListColorPickers:"keyListColorPickers",presetName:"Название присета",listPreset:null,allColors:null,getListPresets:[],isShowDD:!1,presetsCurrentTheme:[],isSave:!0,listBtns:[{label:"AscendingCandleBody",rightSection:"candleUpSection",paramName:"colorCandleUp",change:this.changeCurrentColor,isRighSection:!0},{label:"DownwardCandleBody",rightSection:"candleDownSection",paramName:"colorCandleDw",change:this.changeCurrentColor,isRighSection:!0},{label:"BuyTrades",rightSection:"positiveProfitOrder",paramName:"buy",change:this.changeCurrentColor,isRighSection:!0},{label:"SellTrades",rightSection:"negativeProfitOrder",paramName:"sell",change:this.changeCurrentColor,isRighSection:!0},{label:"TradesClosedByTP",rightSection:"orderTp",paramName:"tp",change:this.changeCurrentColor,isRighSection:!0},{label:"TradesClosedBySl",rightSection:"orderSl",paramName:"sl",change:this.changeCurrentColor,isRighSection:!0},{label:"Crosshair",paramName:"colorCross",change:this.changeCurrentColor},{label:"grid",paramName:"colorGrid",change:this.changeCurrentColor},{label:"Axles",paramName:"colorPanel",change:this.changeCurrentColor}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getColor:function(){return this.allColors&&this.allColors[this.getActiveTheme]?this.allColors[this.getActiveTheme]:{}},getInvertTheme:function(){return"dark"===this.getActiveTheme?"light":"dark"}}),methods:{close:function(){Jpt.$emit("closeModal",{name:"closeModal",data:{labelClose:"ModalSettingsColor"}})},getNewName:function(t,e){var i="New theme ".concat(+t.split(" ")[2]+1);return e.find((function(t){return t.name===i}))?this.getNewName(i,e):i},genererateIdPreset:function(){return"id_preset_".concat(this.getActiveTheme,"_").concat(Math.floor(Math.random()*(new Date).getTime()),"_").concat((new Date).getTime())},changeShowDD:function(){this.isShowDD=!this.isShowDD},closeDD:function(){this.isShowDD&&(this.isShowDD=!1)},changePresete:function(t){this.currentPreset=t,this.presetName=t.name,this.updateAllColorsInLocalStorage(),this.allColors[this.getActiveTheme]=this.getAllColorsFromLocalStorage()[this.getActiveTheme]},removePreset:function(t){var e=this.allPresets.findIndex((function(e){return t.id===e.id})),i=this.presetsCurrentTheme.findIndex((function(e){return t.id===e.id}));e>=0&&this.allPresets.splice(e,1),i>=0&&this.presetsCurrentTheme.splice(i,1),localStorage.setItem("AllPresetsColor",JSON.stringify(this.allPresets))},addNewPresetesInLocalStorage:function(t){var e=this.allPresets.findIndex((function(e){return e.id===t.id}));if(e>=0){this.allPresets[e]=t;var i=this.presetsCurrentTheme.findIndex((function(e){return e.id===t.id}));return i>=0?this.presetsCurrentTheme[i]=t:this.presetsCurrentTheme.push(t),void localStorage.setItem("AllPresetsColor",JSON.stringify(this.allPresets))}this.allPresets.push(t),this.presetsCurrentTheme.push(t),localStorage.setItem("AllPresetsColor",JSON.stringify(this.allPresets))},updatePresetsInList:function(t){this.allPresets=this.allPresets.map((function(e){return e.id===t.id?t:e})),this.indexInCurrentList=this.presetsCurrentTheme.map((function(e){return e.id===t.id?t:e})),localStorage.setItem("AllPresetsColor",JSON.stringify(this.allPresets))},createNewPreset:function(t){var e=this,i=JSON.parse(JSON.stringify(wgt[this.getActiveTheme]));i.id=this.genererateIdPreset(),t||(i.name="New theme"),this.allPresets.find((function(t){return t.id===i.id}))||this.allPresets.push(i),this.presetsCurrentTheme=this.allPresets.filter((function(t){return t.theme===e.getActiveTheme})),this.currentPreset=i,this.presetName=i.name,localStorage.setItem("AllPresetsColor",JSON.stringify(this.allPresets)),this.updateAllColorsInLocalStorage(),this.changeShowDD(),this.keyListColorPickers="keyListColorPickers-".concat(this.currentPreset.id),this.allColors[this.getActiveTheme]=this.getAllColorsFromLocalStorage()[this.getActiveTheme]},handleSavePreset:function(){var t=this,e=this.presetsCurrentTheme.find((function(e){return e.name===t.presetName}));if(!e){this.currentPreset.id=this.genererateIdPreset(),this.currentPreset.name=this.presetName;var i=JSON.parse(JSON.stringify(this.getAllColorsFromLocalStorage()));return i[this.getActiveTheme]=this.currentPreset,this.addNewPresetesInLocalStorage(this.currentPreset),localStorage.setItem("allColors",JSON.stringify(this.allColors)),void this.updateAllColorsInLocalStorage()}},getAllColorsFromLocalStorage:function(){var t=localStorage.getItem("allColors");if(!t)return wgt;var e=JSON.parse(t);return"object"===Object(QD["a"])(e)&&e?e:wgt},changeCurrentColor:function(t,e){if(0===this.currentPreset.id||1===this.currentPreset.id){if(e!==this.currentPreset[t])return this.createNewPreset(!1),void(this.presetName=this.currentPreset.name)}else this.currentPreset[t]=e,this.updatePresetsInList(this.currentPreset),this.updateAllColorsInLocalStorage()},updateAllColorsInLocalStorage:function(){var t=JSON.parse(JSON.stringify(this.getAllColorsFromLocalStorage()));t[this.getActiveTheme]=this.currentPreset,Jpt.$emit("NewChangeColor",{name:"NewChangeColor",data:{allColors:t}}),localStorage.setItem("allColors",JSON.stringify(t))},getAllPresetsColor:function(){var t,e=localStorage.getItem("AllPresetsColor");return e?t=JSON.parse(e):(t=[wgt.dark,wgt.light],localStorage.setItem("AllPresetsColor",JSON.stringify(t))),t},getCurrentPreset:function(){var t,e=localStorage.getItem("allColors");if(e){var i=JSON.parse(e);if(i[this.getActiveTheme])t=i[this.getActiveTheme];else{var o,n=(o={},Object(Vt["a"])(o,this.getActiveTheme,this.getAllColorsFromLocalStorage()[this.getActiveTheme]),Object(Vt["a"])(o,this.getInvertTheme,this.getAllColorsFromLocalStorage()[this.getInvertTheme]),o);t=this.getAllColorsFromLocalStorage()[this.getActiveTheme],localStorage.setItem("allColors",JSON.stringify(n))}}else{var s;t=this.getAllColorsFromLocalStorage()[this.getActiveTheme];var r=(s={},Object(Vt["a"])(s,this.getActiveTheme,this.getAllColorsFromLocalStorage()[this.getActiveTheme]),Object(Vt["a"])(s,this.getInvertTheme,this.getAllColorsFromLocalStorage()[this.getInvertTheme]),s);localStorage.setItem("allColors",JSON.stringify(r))}return t},updatePreset:function(){0!==this.currentPreset.id&&1!==this.currentPreset.id||this.createNewPreset(!0),this.currentPreset.name=this.presetName,this.updateAllColorsInLocalStorage(),this.addNewPresetesInLocalStorage(this.currentPreset)}},watch:{presetName:function(){},getActiveTheme:function(t){var e=this;this.allColors=this.getAllColorsFromLocalStorage(),this.allPresets=this.getAllPresetsColor(),this.presetsCurrentTheme=this.allPresets.filter((function(t){return t.theme===e.getActiveTheme})),this.currentPreset=this.getCurrentPreset(),this.presetName=this.currentPreset.name,this.getAllColorsFromLocalStorage()[t]&&(this.allColors[t]=this.getAllColorsFromLocalStorage()[t]),this.allColors[t]||this.getAllColorsFromLocalStorage()[t]||(this.allColors[t]=wgt[t],localStorage.setItem("allColors",JSON.stringify(this.allColors)))}},mounted:function(){var t=this;this.allColors=this.getAllColorsFromLocalStorage(),this.allPresets=this.getAllPresetsColor(),this.presetsCurrentTheme=this.allPresets.filter((function(e){return e.theme===t.getActiveTheme})),this.currentPreset=this.getCurrentPreset(),this.presetName=this.currentPreset.name},destroyer:function(){}},V_t=U_t,H_t=(i("7563"),Object(C["a"])(V_t,N_t,E_t,!1,null,null,null)),G_t=H_t.exports,q_t={mixins:[yn,Xh,lW],components:{WidgetsByAccount:apt,WidgetsByContracts:FTt,ModalSettingsTypeQoute:W_t,ModalSettingsIndicator:UTt,ModalIndicators:YTt,ChartControlPanel:S_t,MultichartRefactor:l_t,DxSortable:Gn.a,DxResizable:_Tt.a,ModalAcceptCloseOrders:__t,ModalAcceptCloseLimit:M_t,NewModalSettingsColors:G_t},props:{fullScreen:{type:Boolean,default:!1},rightSideBar:{type:Boolean,default:!0},handleZoomIn:{}},data:function(){return{statusLoadChartSize:!1,isFullScreen:!1,containerMultichartKey:"containerMultichartKey",ModalSettingsColor:!1,modalAcceptCloseLimit:null,modalCloseOrder:null,NewModalSettingsInstruments:null,ModalSettingsInstruments:null,countIter:0,openListSettings:null,eventList:["changeMultiChart","saveSettingsOverlay","openModal","closeModal","setFullScreen","updateFullScreen","removeChart","setFullScreenInit"],heightRows:["100%","100%"],listWidthCells:[],sizeChart:{width:null,height:null},multiChartTypes:Vrt}},watch:{getInfoForActiveMultichartByName:function(t){t&&(this[t.typeMultichart](),this.statusLoadChartSize=!0)},getDefaultAccount:function(){this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime()))},getSelectedButtonForActiveScreen:function(){this.oldHeightRows=null,this.fullScreenChart=[null,null]},getButtonsInActiveSet:function(){this.getStatusStreams&&this.subscribeStreams()},getNumberChartsInMulticharts:function(){this.isFullScreen&&this.unexpand()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({apiUri:"api/api",getContracts:"contracts/getContracts",getServerTime:"serverTime/getServerTime",getSession:"auth/getSession",getUser:"user/getUserDetail",getRightSideBar:"userSettings/getRightSideBar",getLeftSideBar:"userSettings/getLeftSideBar",getUISettings:"userSettings/getUserSettings",getProfileAccount:"subscribeOrders/getProfileAccount",getDefaultAccount:"subscribeOrders/getDefaultAccount",getConfigMenuLeftBarTradingChart:"settingsTradingChart/getConfigMenuLeftBarTradingChart",getStatusWidgetsAccount:"settingsTradingChart/getStatusWidgetsAccount",getIndicators:"settingsTradingChart/getIndicators",getSettingsIndicatorModal:"modal/getSettingsIndicatorModal",getIndicatorsModalStatus:"modal/getIndicatorsModalStatus",getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings",getApiUrl:"api/api",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getActiveTheme:"headerSettings/getActiveTheme",getStatusWidgetsContracts:"settingsTradingChart/getStatusWidgetsContracts",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus",getBottomControlPanelSettings:"settingsTradingChart/getBottomControlPanelSettings"})),{},{getStatusStreams:function(){var t;return null===(t=this.getBottomControlPanelSettings)||void 0===t?void 0:t.streams},getScreensQuotes:function(){return this.getTradingTopBarSettings.screensQuotes},getShowStatusWigetsContracts:function(){return this.getStatusWidgetsContracts.status},getActiveScreenInfo:function(){return this.getTradingTopBarSettings.activeScreen},getSelectedSetButtons:function(){if(this.getStatusUser)return this.getTradingTopBarSettings.screensQuotes[this.getActiveScreenInfo].content.find((function(t){return t.selected}))},getTypeMultiChart:function(){return this.getSelectedSetButtons.typeMultichart},getButtonsInActiveSet:function(){if(this.getStatusUser)return this.getSelectedSetButtons.setButtons},getSetDataFormatForMultiChart:function(){if(this.getButtonsInActiveSet){var t={1:[[this.getButtonsInActiveSet.find((function(t){return t.selected}))]],2:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1]]],22:[[this.getButtonsInActiveSet[0]],[this.getButtonsInActiveSet[1]]],3:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1]],[this.getButtonsInActiveSet[2]]],32:[[this.getButtonsInActiveSet[2]],[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1]]],4:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1]],[this.getButtonsInActiveSet[2],this.getButtonsInActiveSet[3]]],51:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1]],[this.getButtonsInActiveSet[2],this.getButtonsInActiveSet[3],this.getButtonsInActiveSet[4]]],61:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1],this.getButtonsInActiveSet[2]],[this.getButtonsInActiveSet[3],this.getButtonsInActiveSet[4],this.getButtonsInActiveSet[5]]],71:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1],this.getButtonsInActiveSet[2]],[this.getButtonsInActiveSet[3],this.getButtonsInActiveSet[4],this.getButtonsInActiveSet[5],this.getButtonsInActiveSet[6]]],81:[[this.getButtonsInActiveSet[0],this.getButtonsInActiveSet[1],this.getButtonsInActiveSet[2],this.getButtonsInActiveSet[3]],[this.getButtonsInActiveSet[4],this.getButtonsInActiveSet[5],this.getButtonsInActiveSet[6],this.getButtonsInActiveSet[7]]]};return t[this.getInfoForActiveMultichartByName.typeNumber]}},getInfoForActiveMultichartByName:function(){if(this.getSelectedSetButtons){var t=this.getSelectedSetButtons.typeMultichart;return this.multiChartTypes.find((function(e){return e.find((function(e){return e.name===t}))})).find((function(e){return e.name===t}))}},getNumberChartsInMulticharts:function(){if(this.getInfoForActiveMultichartByName)return this.getInfoForActiveMultichartByName.typeNumber}}),methods:{onTaskDrop:function(t){var e=t.fromData[t.fromIndex],i=t.toData[t.toIndex];this.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"reorderQuoteChartsInSet",data:{fromIndex:this.getSelectedSetButtons.setButtons.findIndex((function(t){return t.id===e.id})),toIndex:this.getSelectedSetButtons.setButtons.findIndex((function(t){return t.id===i.id})),setId:this.getSelectedSetButtons.setId}})},removeChart:function(){this.isFullScreen&&this.unexpand()},unexpand:function(){this.isFullScreen=!1,this[this.getInfoForActiveMultichartByName.typeMultichart]()},expand:function(t){var e=this;this.isFullScreen=t,this.heightRows=this.heightRows.map((function(t,i){if(i===e.isFullScreen.groupIndex)return e.sizeChart.height})),this.listWidthCells[this.isFullScreen.groupIndex]=this.listWidthCells[this.isFullScreen.groupIndex].map((function(t,i){if(i===e.isFullScreen.chartIndex)return e.sizeChart.width})),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime()))},setFullScreenInit:function(t){this.isFullScreen||this.expand(t)},setFullScreen:function(t,e){this.isFullScreen?this.unexpand():this.expand({groupIndex:t,chartIndex:e})},closeModal:function(t){this[t.labelClose]=null},getElemTimeFrame:function(t){return this.$frames[t]},resizeRow:function(t,e){var i=this.sizeChart.height;this.heightRows[e]=t.height,this.heightRows=this.heightRows.map((function(o,n){return n===e?o:i-t.height}))},resizeCell:function(t,e,i){var o=this.sizeChart.width;if(this.listWidthCells[i][e]=t.width,this.listWidthCells[i].length>2){var n=this.listWidthCells[i].filter((function(t,i){return i!==e&&i!==e-1})).reduce((function(t,e){return t+e}),0);this.listWidthCells[i][e-1]=o-this.listWidthCells[i][e]-n}else this.listWidthCells[i][e-1]=o-this.listWidthCells[i][e];this.resizeRow({height:this.heightRows[i]},i)},handleEvents:function(t){t&&t.name&&"function"===typeof this[t.name]&&this[t.name](t.data)},changeMultiChart:function(t){var e=this;this.isFullScreen=!1,this[t.typeMultichart](),Object.keys(t).forEach((function(i){e[i]=t[i]}))},getHandles:function(t){var e={one:[[""]],twoFirst:[["","left"]],twoSecond:[[""],[""]],threeFirst:[["","left"],[""]],threeSecond:[[""],["","left"]],four:[["","left"],["","left"]],fiveFirst:[["","left"],["","left","left"]],sixFirst:[["","left","left"],["","left","left"]],sevenFirst:[["","left","left"],["","left","left","left"]],eightFirst:[["","left","left","left"],["","left","left","left"]]},i=e[this.getInfoForActiveMultichartByName.typeMultichart][t[0]][t[1]];return i},one:function(){this.currentTypeChart="one",this.listWidthCells[0]=[this.sizeChart.width],this.heightRows=[this.sizeChart.height],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}})},twoFirst:function(){this.isFullScreen||(this.currentTypeChart="twoFirst",this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())),this.listWidthCells[0]=[this.sizeChart.width/2,this.sizeChart.width/2],this.heightRows=[this.sizeChart.height],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}))},twoSecond:function(){this.isFullScreen||(this.currentTypeChart="twoSecond",this.listWidthCells[0]=[this.sizeChart.width],this.listWidthCells[1]=[this.sizeChart.width],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}))},threeFirst:function(){this.isFullScreen||(this.currentTypeChart="threeFirst",this.listWidthCells[0]=[this.sizeChart.width/2,this.sizeChart.width/2],this.listWidthCells[1]=[this.sizeChart.width],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},threeSecond:function(){this.isFullScreen||(this.currentTypeChart="threeSecond",this.listWidthCells[0]=[this.sizeChart.width],this.listWidthCells[1]=[this.sizeChart.width/2,this.sizeChart.width/2],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}))},four:function(){this.isFullScreen||(this.currentTypeChart="four",this.listWidthCells[0]=[this.sizeChart.width/2,this.sizeChart.width/2],this.listWidthCells[1]=[this.sizeChart.width/2,this.sizeChart.width/2],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}))},fiveFirst:function(){this.isFullScreen||(this.currentTypeChart="fiveFirst",this.listWidthCells[0]=[this.sizeChart.width/2,this.sizeChart.width/2],this.listWidthCells[1]=[this.sizeChart.width/3,this.sizeChart.width/3,this.sizeChart.width/3],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},sixFirst:function(){this.isFullScreen||(this.currentTypeChart="sixFirst",this.listWidthCells[0]=[this.sizeChart.width/3,this.sizeChart.width/3,this.sizeChart.width/3],this.listWidthCells[1]=[this.sizeChart.width/3,this.sizeChart.width/3,this.sizeChart.width/3],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},sevenFirst:function(){this.isFullScreen||(this.currentTypeChart="sevenFirst",this.listWidthCells[0]=[this.sizeChart.width/3,this.sizeChart.width/3,this.sizeChart.width/3],this.listWidthCells[1]=[this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},eightFirst:function(){this.isFullScreen||(this.currentTypeChart="eightFirst",this.listWidthCells[0]=[this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4],this.listWidthCells[1]=[this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4,this.sizeChart.width/4],this.heightRows=[this.sizeChart.height/2,this.sizeChart.height/2],Jpt.$emit("resizeHeightCell",{name:"resizeHeightCell",data:{heightRows:this.heightRows}}),Jpt.$emit("resizeWidthCell",{name:"resizeWidthCell",data:{listWidthCells:this.listWidthCells}}),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},controlSubribeWS:function(t){t?this.$socketStream.$off("apiWS3",this.setMessageHandler):this.$socketStream.$on("apiWS3",this.setMessageHandler)},setMessageHandler:function(t){t&&t.command&&"function"===typeof this[t.command]&&this[t.command](t.data)},createGroupAndSaveSettings:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=JSON.stringify({UserId:e.getUser.id,GroupName:"".concat(e.getSelectedButtonForActiveScreen.symbol,":").concat(e.getSelectedButtonForActiveScreen.timeFrame),AccountId:e.getDefaultAccount.id,Instrument:e.getSelectedButtonForActiveScreen.symbol,Timeframe:e.$frames[e.getSelectedButtonForActiveScreen.timeFrame],IsDeleted:!1,SourceType:"Owner"}),i.next=3,e.$workKeys.signMessage(o,e.getSession.sk);case 3:n=i.sent,e.$http.post(e.getApiUrl+"SaveChartGroup",o,{headers:{"Content-Type":"application/json","X-TAPI-FP":e.getSession.fp,"X-TAPI-SIGN":n}}).then((function(i){e.$store.dispatch("tradingTopBarSettings/setSettingsTradingTopBar",{mutation:"setChartPresetForButton",data:{idGroup:i.data.id}}),e.saveSettingChartToServer(t)}));case 5:case"end":return i.stop()}}),i)})))()},saveSettingChartToServer:function(t){var e={Command:"SaveChartSettings",Token:this.getSession.fp,data:{Id:t.id,GroupId:this.getSelectedButtonForActiveScreen.groupPreset,Setting:JSON.stringify(t)}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})},subscribeStreams:function(){var t={Command:"StreamInfoSubscribe",data:{UserId:null,Contracts:this.getButtonsInActiveSet.map((function(t){return t.symbol}))}};this.$socketStream.sendCommand({ws:"streamWS",command:t})},saveSettingsOverlay:function(t){this.getSession&&(t.ctx=null,t.mouse={x:null,y:null},t.typeLine&&(t.typeLine=t.typeLine.filter((function(t){return t}))),t.elementToChangeCurspor&&(t.elementToChangeCurspor={}),this.getSelectedButtonForActiveScreen.groupPreset?this.saveSettingChartToServer(t):this.createGroupAndSaveSettings(t))},openModal:function(t){t.settings&&("ModalListActionsForPlannedOrder"===t.settings.paramName&&(this.openListSettings=t.settings),"ModalSettingsInstruments"===t.paramName&&(this.ModalSettingsInstruments=null),"NewModalSettingsInstruments"!==t.paramName&&(this[t.settings.paramName]=Object(c["a"])({},t.settings)))},setSize:function(t){this.sizeChart.width=t[0].contentRect.width,this.sizeChart.height=t[0].contentRect.height,this.getInfoForActiveMultichartByName&&(this[this.getInfoForActiveMultichartByName.typeMultichart](),this.statusLoadChartSize=!0),this.isFullScreen&&(this.expand(this.isFullScreen),this.containerMultichartKey="containerMultichartKey_".concat(Math.floor(Math.random()*(new Date).getTime())))},onResize:function(t){this.setSize(t)}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.chartWrapper})),this.getButtonsInActiveSet&&this.getStatusStreams&&this.subscribeStreams(),Jpt.$on(this.eventList,this.handleEvents)},destroyed:function(){this.getShowStatusWigetsContracts&&this.$store.commit("settingsTradingChart/setStatusWidgetsContracts",{data:null,status:!1}),Jpt.$off(this.eventList,this.handleEvents)}},z_t=q_t,Y_t=(i("eca3"),i("6a67"),Object(C["a"])(z_t,zht,Yht,!1,null,"5844c3b5",null)),X_t=Y_t.exports,Q_t={components:{ChartTradingTopBar:Zat,UserProfileTable:qht,CandlesChart:X_t},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatByOrders:"contracts/getStatByOrders",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen"})),{},{getActiveSymbol:function(){return this.getSelectedButtonForActiveScreen.symbol}})},J_t=Q_t,K_t=(i("2715"),Object(C["a"])(J_t,Mrt,$rt,!1,null,null,null)),Z_t=K_t.exports,tAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TradingLeftBar",style:{width:t.getLeftSideBar?"36rem":"4rem"}},[e("div",{staticClass:"TradingLeftBar-head",class:"TradingLeftBar-head_".concat(t.getActiveTheme)},[e("div",{staticClass:"TradingLeftBar-headTitle",class:"TradingLeftBar-headTitle_".concat(t.getActiveTheme)},[t.getLeftSideBar?e("div",{staticClass:"TradingLeftBar-headTitleText"},[t._v(t._s(t.getTitle))]):t._e()]),e("div",{staticClass:"TradingLeftBar-barControl"},[t.getLeftSideBar?e("div",{staticClass:"TradingLeftBar-barControl-updateStat"},[e("ButtonIconFlat",{attrs:{icon:{name:"Change",color:t.getBlueColor.color},modifier:{class:["TradingLeftBar-barControl-button","TradingLeftBar-barControl-button_".concat(t.getActiveTheme)]}},on:{click:t.updateStat}})],1):t._e(),e("ButtonIconFlat",{attrs:{icon:{name:t.getIconForControlSidebar},modifier:{class:["TradingLeftBar-barControl-button","TradingLeftBar-barControl-button_".concat(t.getActiveTheme)]}},on:{click:t.toggleVisibleLeftBar}})],1)]),e("div",{staticClass:"TradingLeftBar-body",class:"TradingLeftBar-body_".concat(t.getActiveTheme),style:{overflow:"hidden"}},[t.getLeftSideBar?e("VuePerfectScrollbar",{key:t.symbol,staticClass:"wrapperBody"},[e("StatDataContainer",{attrs:{title:"Чистый доход по контракту"}},[e("div",{staticClass:"TradingLeftBar-profitData"},[e("StatWidgetWithGradient",{attrs:{color:t.currentProfitClose?t.currentProfitClose<0?t.getRedColor.color:t.getBlueColor.color:t.getGrayColor.color,data:t.currentProfitClose,symbol:t.getCurrencyChar,gradient:t.currentProfitClose?t.currentProfitClose<0?t.getRedColor.gradient:t.getBlueColor.gradient:t.getGrayColor.gradient,arrow:t.currentProfitClose?t.getDirectionCloseProfit:"",type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.currentProfitClose?t.currentProfitClose<0?t.getRedColor.color:t.getBlueColor.color:t.getGrayColor.color,data:t.getPercentOfBalance,symbol:"%",gradient:t.currentProfitClose?t.currentProfitClose<0?t.getRedColor.gradient:t.getBlueColor.gradient:t.getGrayColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)]),e("StatDataContainer",{attrs:{title:"Открытые позиции"}},[e("div",{staticClass:"TradingLeftBar-profitData"},[e("StatWidgetWithGradient",{attrs:{color:t.currentFloatingProfit?t.currentFloatingProfit<0?t.getRedColor.color:t.getLemonColor.color:t.getGrayColor.color,data:t.currentFloatingProfit,symbol:t.getCurrencyChar,gradient:t.currentFloatingProfit?t.currentFloatingProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient:t.getGrayColor.gradient,arrow:t.currentFloatingProfit?t.directionFloatingProfit:"",type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.currentFloatingProfit?t.currentFloatingProfit<0?t.getRedColor.color:t.getLemonColor.color:t.getGrayColor.color,data:t.getPercentOfEquity,symbol:"%",gradient:t.currentFloatingProfit?t.currentFloatingProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient:t.getGrayColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1),e("OpenPosition",{attrs:{symbol:t.symbol,statByContract:t.contractStat,currentFloatingProfit:t.currentFloatingProfit,currentEquity:t.currentEquity,sellOrders:t.sellOrders,ordersBySymbol:t.ordersBySymbol,buyOrders:t.buyOrders,limitsOrders:t.limitOrdersBySymbol,render:t.render}})],1),e("StatDataContainer",{attrs:{title:"Маржа счета"}},[e("Margin",{attrs:{currentMargin:t.currentMargin,curentMarginByContract:t.curentMarginByContract,currencyChar:t.getCurrencyChar,currentEquity:t.currentEquity}})],1),e("StatDataContainer",{attrs:{title:"Текущий доход по контракту"}},[e("div",{staticClass:"TradingLeftBar-profitData",style:{color:t.currentProfit<0?t.getRedColor.color:t.getLemonColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.currentProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.currentProfit,symbol:t.getCurrencyChar,gradient:t.currentProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionCurrentProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.currentProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getPercentOfEquityCurrent,symbol:"%",gradient:t.currentProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)]),e("StatDataContainer",{attrs:{title:"Текущий Доход за 20 дней"}},[e("GistogramLeftBarWidget",{attrs:{pointsForGistogramm:t.getPointsForGistogramm}})],1),e("div",{staticClass:"TradingLeftBar-profitData"},[e("StatDataContainer",{attrs:{title:"Закрытые сделки"}},[e("StatWidgetWithGradient",{attrs:{color:t.getBlueColor.color,data:t.getCountClosedOrders,symbol:"",gradient:t.getBlueColor.gradient,arrow:"",type:"abs"}})],1),e("StatDataContainer",{attrs:{title:"Открытые сделки"}},[e("StatWidgetWithGradient",{attrs:{color:t.getGrayColor.color,data:t.getCountOpenOrders,symbol:"",gradient:t.getGrayColor.gradient,arrow:"",type:"abs"}})],1)],1),e("StatDataContainer",{attrs:{title:"% усп. сделок"}},[e("div",{staticClass:"TradingLeftBar-profitData"},[e("StatWidgetWithGradient",{attrs:{color:t.getColorPercentProfitOrders.color,data:t.getPercentProfitOrders,symbol:"%",gradient:t.getColorPercentProfitOrders.gradient,arrow:"",sideSymbol:"right",type:"abs"}})],1)]),e("div",{staticClass:"TradingLeftBar-profitData"},[e("StatDataContainer",{attrs:{title:"Прибыльные сделки"}},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getPositieOrdersCount,symbol:"",gradient:t.getLemonColor.gradient,arrow:"",type:"abs"}})],1),e("StatDataContainer",{attrs:{title:"Убыточные сделки"}},[e("StatWidgetWithGradient",{attrs:{color:t.getRedColor.color,data:t.getNegativeOrdersCount,symbol:"",gradient:t.getRedColor.gradient,arrow:"",type:"abs"}})],1)],1),e("StatDataContainer",{attrs:{title:"Средний доход на сделку"}},[e("div",{staticClass:"TradingLeftBar-profitData",style:{color:t.getAvgProfit<0?t.getRedColor.color:t.getLemonColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getAvgProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getAvgProfit,symbol:t.getCurrencyChar,gradient:t.getAvgProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getAvgProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getPercentOfProfitClose,symbol:"%",gradient:t.getAvgProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)]),e("StatDataContainer",{attrs:{title:"Статистика по контракту ".concat(t.symbol)}},[e("StatisticsOnThePair",{attrs:{shortStatByContract:t.shortStatByContract,shortStatByAccount:t.shortStatByAccount}})],1),e("ListStatisitc",{attrs:{shortStatByContract:t.shortStatByContract,sellOrders:t.sellOrders,buyOrders:t.buyOrders,currentFloatingProfit:t.currentFloatingProfit,currentProfit:t.currentProfit}})],1):t._e(),t.getLeftSideBar&&t.getEmtyStatus?e("div",{staticClass:"emtyStat",class:"emtyStat_".concat(t.getActiveTheme)},[e("div",{staticClass:"emtyStat-content"},[e("div",{staticClass:"emtyStat-icon",class:"emtyStat-icon_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"Big_Notification_of_price",size:100}})],1),e("div",{staticClass:"emtyStat-text",class:"emtyStat-text_".concat(t.getActiveTheme)},[e("span",[t._v("Здесь пока пусто. ")]),t._v("Совершайте сделки и тут Вы увидите статистику по выбранному инструменту")])])]):t._e()],1)])},eAt=[],iAt=function(){var t=this,e=t._self._c;return e("ul",{staticClass:"ListStatistic",class:t.darkClass},[t._l(t.dataList,(function(i,o){return e("li",{key:o},[e("span",{staticClass:"label",style:i.style,on:{mouseenter:function(e){return t.mouseenterHandler(e,i.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(t.$t(i.title)))]),e("span",{staticClass:"result",style:{color:i.color?i.color:""}},[t._v(t._s(i.value))])])})),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.$t(t.tooltipText)))])],2)},oAt=[],nAt={name:"ListStatistic",props:{shortStatByContract:{default:null},sellOrders:{default:null},buyOrders:{default:null},currentFloatingProfit:{default:0},currentProfit:{default:0}},mixins:[xt,qe,Ot],data:function(){return{tooltipText:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{clearProfit:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].profit:0},getCurrencyChar:function(){return this.getDefaultAccount?this.getDefaultAccount.currencyChar:""},getTradeVolume:function(){var t=this.sellOrders&&this.sellOrders.length?this.sellOrders.reduce((function(t,e){return t+e.volume}),0):0,e=this.buyOrders&&this.buyOrders.length?this.buyOrders.reduce((function(t,e){return t+e.volume}),0):0;return t+e},getUsedVolume:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.getTradeVolume+this.shortStatByContract[0].sumOrderVolume:0},getStartTrading:function(){return this.shortStatByContract&&this.shortStatByContract.length?new Date(this.shortStatByContract[0].firstDayTrading).toLocaleDateString("ru"):0},getAverTimeForOrder:function(){if(!this.shortStatByContract||!this.shortStatByContract.length)return 0;var t=this.shortStatByContract[0].avgOrderDurationInms,e=t/6e4,i=e/60,o=i/24,n=o>=1?"".concat(Math.floor(o)).concat(this.$t("d")," ").concat(Math.floor(o%1*24)).concat(this.$t("h"),"."):Math.floor(i)>=1?"".concat(Math.floor(i)).concat(this.$t("h"),"."):"".concat(Math.floor(e)).concat(this.$t("m"));return n},getSellOrdersCount:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[1].ordersCount:0},getBuyOrdersCount:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[2].ordersCount:0},getCountClosedOrders:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].ordersCount:0},getSellNegativeOrders:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[1].negativeOrdersCount:0},getBuyNegativeOrders:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[2].negativeOrdersCount:0},getCountNegativeOrders:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].negativeOrdersCount:0},getPercentProfitOrders:function(){if(!this.shortStatByContract||!this.shortStatByContract.length)return 0;if(!this.shortStatByContract[0].positiveOrdersCount||!this.shortStatByContract[0].ordersCount)return 0;var t=100*this.shortStatByContract[0].positiveOrdersCount/this.shortStatByContract[0].ordersCount;return t},getPositiveOrdersCount:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].positiveOrdersCount:0},getMaxProfitOrder:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].maxProfit:0},getMaxDDOnOrder:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].minProfit:0},getAverProfitOnClosedOrder:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].avgProfit:0},getAllPips:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].sumPipByOrders:0},getAvgProfitPips:function(){return this.shortStatByContract&&this.shortStatByContract.length?Math.round(this.shortStatByContract[0].avgPipByOrders):0},getProfitFactor:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].profitFactor:0},getRecoveryFactor:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].recoveryFactorRound:0},dataList:function(){return[{title:"Начало торговли",value:this.getStartTrading?this.getStartTrading:"--",tooltip:"poct"},{color:this.currentFloatingProfit<0?this.getRedColor.color:this.getGreenColor.color,title:"Прибыль по открытым сделкам",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.currentFloatingProfit,2)),tooltip:"Прибыль по открытым сделкам"},{color:this.clearProfit<0?this.getRedColor.color:this.getGreenColor.color,title:"Прибыль по закрытым сделкам",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.clearProfit,2)),tooltip:"Прибыль по закрытым сделкам"},{color:this.currentProfit<0?this.getRedColor.color:this.getGreenColor.color,title:"Чистый доход",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.currentProfit,2)),tooltip:"Совокупный доход по закрытым сделкам с учетом дохода по закрырым ордерам."},{style:{fontWeight:700},title:"total_trades",value:this.getCountClosedOrders,tooltip:"total_trades"},{color:this.getPercentProfitOrders<30?this.getRedColor.color:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor.color:this.getGreenColor.color,style:{fontWeight:700},title:"post",value:"".concat(Math.round(this.getPercentProfitOrders),"%"),tooltip:"pocto"},{color:this.getPercentProfitOrders<30?this.getRedColor.color:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor.color:this.getGreenColor.color,title:"profitable_trades",style:{fontWeight:700},value:this.getPositiveOrdersCount,tooltip:"Количество закрытых сделок, по которым была зафиксированна прибыль"},{style:{marginLeft:"12px"},color:this.getRedColor.color,title:"positions_for_selling",value:this.getSellOrdersCount,tooltip:"Количество сделок на продажу от числа прибыльных"},{style:{marginLeft:"12px"},color:this.getGreenColor.color,title:"positions_for_buying",value:this.getBuyOrdersCount,tooltip:"Количество сделок на покупку от числа прибыльных"},{title:"unprofitable_trades",style:{fontWeight:700},value:this.getCountNegativeOrders,tooltip:"Количество сделок, по которым зафиксирован убыток"},{style:{marginLeft:"12px"},color:this.getRedColor.color,title:"positions_for_selling",value:this.getSellNegativeOrders,tooltip:"Количество сделок на продажу от числа убыточных"},{style:{marginLeft:"12px"},color:this.getGreenColor.color,title:"positions_for_buying",value:this.getBuyNegativeOrders,tooltip:"Количество сделок на покупку от числа убыточных"},{color:this.getGreenColor.color,title:"Макс. прибыльная сделка",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getMaxProfitOrder)),tooltip:"Максимальный доход при закрытии одной сделки"},{color:this.getRedColor.color,title:"Макс. убыточная сделка",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getMaxDDOnOrder)),tooltip:"Максимально убыточная закрытая сделка"},{color:this.getGreenColor.color,title:"mathematical_expectation",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getAverProfitOnClosedOrder,2)),tooltip:"sotpo"},{color:this.getAllPips>0?this.getGreenColor.color:this.getRedColor.color,title:"tpoi",value:this.$moneyf(this.getAllPips,0),tooltip:"oipp"},{color:this.getAvgProfitPips>0?this.getGreenColor.color:this.getRedColor.color,title:"Средний доход на сделку,pip",value:this.$moneyf(this.getAvgProfitPips,0),tooltip:"Средний доход на сделку,pip"},{color:this.getProfitFactor>1?this.getGreenColor.color:this.getRedColor.color,title:"profit_factor",value:this.$moneyf(this.getProfitFactor,2),tooltip:"rotro"},{title:"recovery_factor",value:this.getRecoveryFactor,tooltip:"rotap"},{title:"average_trade_length",value:this.getAverTimeForOrder,tooltip:"altoa"},{title:"trading_volume",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getTradeVolume,0)),tooltip:"votuf"},{title:"funds_turnover",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getUsedVolume,0)),tooltip:"sovot"}]}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)}},mounted:function(){}},sAt=nAt,rAt=(i("a7cf"),Object(C["a"])(sAt,iAt,oAt,!1,null,"aa387f58",null)),aAt=rAt.exports,cAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Margin"},[e("div",{staticClass:"Margin-bar"},[e("div",{staticClass:"Margin-occupied",style:{background:t.getRedColor.color,width:"".concat(t.getPercentOccupiedMargin,"%")}},[e("div",{staticClass:"Margin-occupiedContract",style:{background:t.getBlueColor.color,width:"".concat(t.getPercentOccupiedMarginContract,"%")}})]),e("div",{staticClass:"Margin-free",style:{background:t.getGreenColor.color}})]),e("div",{staticClass:"Margin-description"},[e("div",{staticClass:"Margin-descriptionItem",style:{color:t.getRedColor.color},attrs:{title:"Занятая маржа по счету"}},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.currentMargin)))),e("br"),t._v(t._s("(".concat(t.$moneyf(t.getPercentOccupiedMargin,2),")%")))]),e("div",{staticClass:"Margin-descriptionItem",style:{color:t.getBlueColor.color,textAlign:"center"},attrs:{title:"Занятая маржа по контракту"}},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.curentMarginByContract)))),e("br"),t._v(t._s("(".concat(t.$moneyf(t.getPercentOccupiedMarginContract,2),")%")))]),e("div",{staticClass:"Margin-descriptionItem",style:{color:t.getGreenColor.color,textAlign:"right"},attrs:{title:"Свободная маржа по счету"}},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.getFreeMargin)))),e("br"),t._v(t._s("(".concat(t.$moneyf(t.getPercentFreeMargin,2),")%")))])])])},lAt=[],uAt={props:{currentEquity:{default:0},currentMargin:{default:0},currencyChar:{default:"$"},curentMarginByContract:{default:0}},mixins:[qe],computed:{getContractMargin:function(){return this.curentMarginByContract},getPercentOccupiedMarginContract:function(){return this.curentMarginByContract&&this.currentMargin?100*this.curentMarginByContract/this.currentMargin:0},getFreeMargin:function(){return this.currentEquity&&this.currentMargin?this.currentEquity-this.currentMargin:0},getPercentFreeMargin:function(){return 100-this.getPercentOccupiedMargin},getPercentOccupiedMargin:function(){return this.currentEquity&&this.currentMargin?100*this.currentMargin/this.currentEquity:0}},methods:{}},dAt=uAt,hAt=(i("35c3"),Object(C["a"])(dAt,cAt,lAt,!1,null,"ed1d4da0",null)),pAt=hAt.exports,gAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NewOrder",class:"NewOrder_".concat(t.getActiveTheme)},[e("Accordion",{attrs:{collapsible:!0,"data-source":t.arrayForAccordion,time:350},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"contentHeader",class:"contentHeader_".concat(t.getActiveTheme)},[e("svgIcon",t._b({},"svgIcon",t.iconOpenOrder,!1)),e("div",{staticClass:"title",class:"title_".concat(t.getActiveTheme)},[t._v(t._s(o.title))])],1)]}},{key:"item",fn:function(i){i.data;return[e("div",{staticClass:"ordersContainer"},[t._v("В процессе разработки")])]}}])})],1)},fAt=[],mAt={name:"NewOrder",mixins:[],props:{symbol:{type:String}},components:{Accordion:zP},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{iconOpenOrder:function(){return{name:"Trading-open-new-order",color:"#FA860A"}},arrayForAccordion:function(){return[{id:1,title:"Новый ордер Forex: ".concat(this.symbol)}]}}),mounted:function(){},destroyed:function(){},methods:{}},vAt=mAt,yAt=(i("3fae"),Object(C["a"])(vAt,gAt,fAt,!1,null,"5b574a3a",null)),CAt=yAt.exports,bAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OpenPosition"},[e("div",{staticClass:"thead",class:"thead_".concat(t.getActiveTheme)},[e("div",{staticClass:"th"}),e("div",{staticClass:"th"},[t._v("Тип")]),e("div",{staticClass:"th"},[t._v("Объем")]),e("div",{staticClass:"th"},[t._v("Цена")]),e("div",{staticClass:"th"},[t._v(t._s("P/L, ".concat(t.getCurrencyChar)))]),e("div",{staticClass:"th"})]),e("Accordion",{attrs:{collapsible:!0,"data-source":t.arrayForAccordion,openIndex:t.openIndex,time:300,isArrow:!1},on:{setAccordionIndex:t.setAccordionIndex},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"headerBlock",class:"headerBlock_".concat(o.type,"_").concat(t.getActiveTheme)},[e("div",{staticClass:"count",class:"".concat(o.type,"_").concat(t.getActiveTheme," count_").concat(t.getActiveTheme)},[t._v(t._s(o.count))]),e("div",{staticClass:"type",class:"".concat(o.type,"_").concat(t.getActiveTheme)},[t._v(t._s(o.type))]),e("div",{staticClass:"volume",class:"volume_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o.totalVolume)))]),e("div",{staticClass:"price",class:"price_".concat(t.getActiveTheme)},[t._v(t._s(o.averagePrice))]),"limit"!==o.type?e("div",{staticClass:"pl",style:{color:o.pl<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(o.pl?"".concat(t.$moneyf(o.pl,2)):""))]):t._e(),"limit"===o.type?e("div",{staticClass:"delete",on:{click:t.closeAllPending}},[e("div",{staticClass:"buttonIcon",style:{color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:"Close"}})],1)]):t._e(),e("div",{staticClass:"buttonDelete"},[e("div",{staticClass:"buttonIcon"},[e("svgIcon",t._b({},"svgIcon",t.iconArrowMicro,!1))],1)])])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{key:t.render,staticClass:"contentAccordion"},[e("OrdersList",{attrs:{orders:o.orders,symbol:t.symbol,theme:t.getActiveTheme}})],1)]}}])})],1)},SAt=[],PAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrdersList"},t._l(t.orders,(function(i,o){return e("div",{key:o,staticClass:"rowOrder",class:"rowOrder_".concat(t.getActiveTheme),on:{mouseenter:function(e){return t.hoverOrderOnChart(i.reason,i)},mouseleave:function(e){return t.hoverOrderOnChart(i.reason,null)}}},[e("div",{staticClass:"td"},[i.subscriptionId?e("Avatar",{attrs:{src:i.sourceUserAvatar,size:"2.1",theme:t.getActiveTheme}}):t._e()],1),e("div",{staticClass:"td type",style:{color:"Sell"===i.orderType?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(i.orderType))]),e("div",{class:"td volume volume_".concat(t.theme)},[t._v(t._s(t.$moneyf(i.volume)))]),e("div",{class:"td price price_".concat(t.theme)},[t._v(t._s("Position_PoCreate"===i.reason?i.pendingPrice:i.openPrice))]),e("div",{staticClass:"td profit",style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},["Position_PoCreate"!==i.reason?e("span",[t._v(t._s("".concat(t.$moneyf(i.profit,2))))]):e("span",{style:{color:t.getRedColor.color,cursor:"pointer"},on:{click:function(e){return t.closePendingOrder(i)}}},[e("svgIcon",{attrs:{name:"Close"}})],1)]),e("div",{staticClass:"td"},[e("div",{staticClass:"buttonIcon",on:{click:function(e){return t.redactOrderOnChart(i)}}},[e("svgIcon",{attrs:{name:"Settings",color:i.subscriptionId?t.getGrayColor.fill:t.getBlueColor.color}})],1)])])})),0)},TAt=[],xAt={name:"OrdersList",mixins:[lW,qe],props:{orders:{type:Array},symbol:{type:String},theme:{default:"dark"}},components:{Avatar:E},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme"})),{},{iconClose:function(){return{name:"Close",color:"#E91212"}},iconSettings:function(){return{name:"Settings",color:this.getGrayColor.fill}}}),methods:{hoverOrderOnChart:function(t,e){Zh.emit("Position_PoCreate"===t?"hoverPendingOrder":"hoverOpenOrder",{symbol:this.symbol,id:e?e.id:e})},closePendingOrder:function(t){var e={Command:"CancelPendingTradingOrder",data:t,FingerPrint:this.getSession.fp};this.$socketStream.sendCommand({ws:"apiWS",command:e}),this.$orderStorage.cancelPendingOrder(t)},redactOrderOnChart:function(t){t.subscriptionId||Zh.emit("Position_PoCreate"===t.reason?"redactPendingOrder":"redactOpenOrder",{symbol:this.symbol,order:t})}},mounted:function(){},destroyed:function(){}},OAt=xAt,wAt=(i("28b6"),Object(C["a"])(OAt,PAt,TAt,!1,null,"74ef8b45",null)),_At=wAt.exports,AAt={name:"OpenPosition",mixins:[lW,qe],props:{sellOrders:{type:[Boolean,Array]},ordersBySymbol:{default:null},buyOrders:{type:[Boolean,Array]},limitsOrders:{type:[Boolean,Array]},statByContract:{default:null},currentFloatingProfit:{default:null},currentEquity:{default:0},symbol:{type:String},render:{type:Boolean}},components:{Accordion:zP,OrdersList:_At,SimpleLineChart:jV},data:function(){return{selectedItems:[],points:null,openIndex:-1}},watch:{currentFloatingProfit:function(t){this.statByContract&&this.statByContract.length?this.getPoints():t&&this.getFirstPoint()},getDefaultAccount:function(){this.points=null,this.openIndex=-1},getActiveTheme:function(){this.statByContract&&this.statByContract.length?this.getPoints():this.getCurrentProfit&&this.getFirstPoint()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getContracts:"contracts/getContracts",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},getCommonVolume:function(){return this.ordersBySymbol&&this.ordersBySymbol.length?this.getCryptoStatus?this.ordersBySymbol.reduce((function(t,e){return t+e.volume*e.openPrice}),0):this.ordersBySymbol.reduce((function(t,e){return t+e.volume}),0):0},getCurrencyChar:function(){if(this.getDefaultAccount)return this.getDefaultAccount.currencyChar},getContractBySymbol:function(){var t=this;if(this.getContracts)return this.getContracts.find((function(e){return e.name===t.symbol}))},getPrecision:function(){if(this.getContractBySymbol)return this.getContractBySymbol.precision},getLineChartConfig:function(){return{type:"line",expandX:{type:"abs",maxExpand:100,minExpand:0},theme:"dark",baseLine:null,expandY:{maxExpand:.1,minExpand:.1},indicators:["carrentDataIndicator"],size:{width:346,height:106},grid:{status:!1,label:{status:!0,units:"$"}},modifier:{class:[],style:{},id:""}}},getCurrentProfit:function(){return null!==this.currentFloatingProfit?this.currentFloatingProfit:this.statByContract&&this.statByContract.length?this.statByContract.at(-1).floatingProfitClose:void 0},getPercentProfit:function(){return this.getCurrentProfit&&this.getCommonVolume?100*this.getCurrentProfit/this.getCommonVolume:0},iconArrowMicro:function(){return{name:"Arrow-expand-bottom-micro",color:"light"===this.getActiveTheme?"#8c8c8c":"#BBCEE0"}},iconClose:function(){return{name:"Close",color:"#E91212"}},iconSettings:function(){return{name:"Settings",color:"#3C73F1"}},countLimits:function(){var t;if(null!==(t=this.limitsOrders)&&void 0!==t&&t.length)return this.limitsOrders.length},countBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length)return this.buyOrders.length},countSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length)return this.sellOrders.length},totalVolumeLimit:function(){return Math.abs(this.totalVolumeBuyLimit-this.totalVolumeSellLimit)},totalVolumeBuyLimit:function(){var t;if(null!==(t=this.limitsOrders)&&void 0!==t&&t.length){var e=this.limitsOrders.filter((function(t){return"Buy"===t.orderType}));return e.length?e.reduce((function(t,e){return t+e.volume}),0):0}return 0},totalVolumeSellLimit:function(){var t;if(null!==(t=this.limitsOrders)&&void 0!==t&&t.length){var e=this.limitsOrders.filter((function(t){return"Sell"===t.orderType}));return e.length?e.reduce((function(t,e){return t+e.volume}),0):0}return 0},totalVolumeBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length)return this.buyOrders.reduce((function(t,e){return t+e.volume}),0)},totalVolumeSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length)return this.sellOrders.reduce((function(t,e){return t+e.volume}),0)},getAveragePriceLimit:function(){var t;if(null!==(t=this.limitsOrders)&&void 0!==t&&t.length){var e=this.limitsOrders.reduce((function(t,e){return t+e.volume}),0),i=this.limitsOrders.reduce((function(t,e){return t+e.pendingPrice*e.volume}),0),o=i/e;return+o.toFixed(this.getPrecision)}return 0},averagePriceBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length){var e=this.buyOrders.reduce((function(t,e){return t+e.openPrice}),0);return+(e/this.buyOrders.length).toFixed(this.getPrecision)}},averagePriceSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length){var e=this.sellOrders.reduce((function(t,e){return t+e.openPrice}),0);return+(e/this.sellOrders.length).toFixed(this.getPrecision)}},plBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length){var e=this.buyOrders.reduce((function(t,e){return t+e.profit}),0);return Fm(e,2)}},plSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length){var e=this.sellOrders.reduce((function(t,e){return t+e.profit}),0);return Fm(e,2)}},arrayForAccordion:function(){var t,e,i,o=[],n={id:1,type:"buy",count:this.countBuy,totalVolume:this.totalVolumeBuy,averagePrice:this.averagePriceBuy,pl:this.plBuy,orders:this.buyOrders},s={id:2,type:"sell",count:this.countSell,totalVolume:this.totalVolumeSell,averagePrice:this.averagePriceSell,pl:this.plSell,orders:this.sellOrders},r={id:3,type:"limit",count:this.countLimits,totalVolume:this.totalVolumeLimit,averagePrice:this.getAveragePriceLimit,pl:0,orders:this.limitsOrders};return null!==(t=this.buyOrders)&&void 0!==t&&t.length&&o.push(n),null!==(e=this.sellOrders)&&void 0!==e&&e.length&&o.push(s),null!==(i=this.limitsOrders)&&void 0!==i&&i.length&&o.push(r),o}}),methods:{setAccordionIndex:function(t){this.openIndex=t},selectionChanged:function(t){this.selectedItems=t.addedItems},getFirstPoint:function(){this.loadStatus=!1,this.points=[[{stroke:this.getCurrentProfit<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getCurrentProfit<0?this.getRedColor.fill:this.getGreenColor.fill}]],this.points[0].push({time:(new Date).getTime(),data:this.getCurrentProfit}),this.chartStatus=!0},getPoints:function(){var t=this;this.points=[[{stroke:this.getCurrentProfit<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getCurrentProfit<0?this.getRedColor.fill:this.getGreenColor.fill}]];var e=this.statByContract.length>30?this.statByContract.slice(-30):this.statByContract;e.forEach((function(e){t.points[0].push({time:new Date(e.date).getTime(),data:e.floatingProfitClose})})),this.points[0].at(-1).data=this.getCurrentProfit},setClickTittle:function(t,e){"close"===t&&"owner"===this.getStatusUser.status?this.closeAllOrdersByType(e):"settings"===t&&"owner"===this.getStatusUser.status&&this.settingsOrders("Sell"===e?this.sellOrders:this.buyOrders)},settingsOrders:function(t){var e=t.map((function(t){return t.id}));this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.symbol,payload:e})},closeAllPending:function(){var t=this;"owner"===this.getStatusUser.status&&this.limitsOrders.forEach((function(e){var i={Command:"CancelPendingTradingOrder",data:e,FingerPrint:t.getSession.fp,Sign:""};t.$socketStream.sendCommand({ws:"apiWS",command:i})}))},closeAllOrdersByType:function(t){var e=this;if("owner"===this.getStatusUser.status){var i="Sell"===t?this.sellOrders:this.buyOrders;i.forEach((function(t){e.closeOrder(t)}))}},closeOrder:function(t){if("owner"===this.getStatusUser.status){var e={Command:"CloseTradingOrder",data:{accountId:t.accountId,id:t.id},FingerPrint:this.getSession.fp};this.$socketStream.sendCommand({ws:"apiWS",command:e})}}},created:function(){},mounted:function(){this.statByContract&&this.statByContract.length?this.getPoints():this.getCurrentProfit&&this.getFirstPoint()},destroyed:function(){}},DAt=AAt,kAt=(i("e37a"),Object(C["a"])(DAt,bAt,SAt,!1,null,"3f66dcd5",null)),IAt=kAt.exports,BAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OpenPosition"},[e("div",{staticClass:"pricePercent",style:{color:t.getCurrentProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$ ".concat(t.$moneyf(t.getCurrentProfit,2)," / ").concat(t.$moneyf(t.getPercentProfit,Math.abs(t.getPercentProfit)<=.01?3:2),"%")))]),e("div",{staticClass:"OpenPosition-chart"},[e("SimpleLineChart",{attrs:{points:t.points,configObject:t.getLineChartConfig}})],1),e("div",{staticClass:"thead",class:"thead_".concat(t.getActiveTheme)},[e("div",{staticClass:"th"},[t._v("Тип")]),e("div",{staticClass:"th"}),e("div",{staticClass:"th"},[t._v("Объем")]),e("div",{staticClass:"th"},[t._v("Цена")]),e("div",{staticClass:"th"},[t._v("P/L, $")]),e("div",{staticClass:"th"}),e("div",{staticClass:"th"})]),e("Accordion",{key:t.render,attrs:{collapsible:!0,"data-source":t.arrayForAccordion,time:300,isArrow:!1},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{staticClass:"headerBlock",class:"headerBlock_".concat(o.type,"_").concat(t.getActiveTheme)},[e("div",{staticClass:"count",class:"".concat(o.type,"_").concat(t.getActiveTheme," count_").concat(t.getActiveTheme)},[t._v(t._s(o.count))]),e("div",{staticClass:"type",class:"".concat(o.type,"_").concat(t.getActiveTheme)},[t._v(t._s(o.type))]),e("div",{staticClass:"volume",class:"volume_".concat(t.getActiveTheme)},[t._v(t._s(t.$moneyf(o.totalVolume)))]),e("div",{staticClass:"price",class:"price_".concat(t.getActiveTheme)},[t._v(t._s(o.averagePrice))]),e("div",{staticClass:"pl",style:{color:o.pl<0?t.getRedColor.color:t.getGreenColor.color}},[t._v("$ "+t._s(o.pl))]),e("div",{staticClass:"buttonSettings"}),e("div",{staticClass:"buttonDelete"},[e("div",{staticClass:"buttonIcon"},[e("svgIcon",t._b({},"svgIcon",t.iconArrowMicro,!1))],1)])])]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{staticClass:"contentAccordion"},[e("OrdersList",{attrs:{orders:o.orders,symbol:t.symbol,theme:t.getActiveTheme}})],1)]}}])})],1)},MAt=[],$At={name:"OpenPosition",mixins:[lW,qe],props:{sellOrders:{type:[Boolean,Array]},buyOrders:{type:[Boolean,Array]},statByContract:{default:null},currentFloatingProfit:{default:null},currentEquity:{default:0},symbol:{type:String},render:{type:Boolean}},components:{DxAccordion:uw.a,Accordion:zP,OrdersList:_At,SimpleLineChart:jV},data:function(){return{selectedItems:[],points:null}},watch:{symbol:function(){this.statByContract&&this.statByContract.length&&this.getPoints()},currentFloatingProfit:function(){this.statByContract&&this.statByContract.length&&this.getPoints()},getActiveTheme:function(){this.statByContract&&this.statByContract.length&&this.getPoints()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getLineChartConfig:function(){return{type:"line",expandX:{type:"abs",maxExpand:100,minExpand:0},theme:"dark",baseLine:null,expandY:{maxExpand:.1,minExpand:.1},indicators:["carrentDataIndicator"],size:{width:346,height:106},grid:{status:!1,label:{status:!0,units:"$"}},modifier:{class:[],style:{},id:""}}},getCurrentProfit:function(){return null!==this.currentFloatingProfit?this.currentFloatingProfit:this.statByContract&&this.statByContract.length?this.statByContract.at(-1).floatingProfitClose:void 0},getPercentProfit:function(){return this.getCurrentProfit&&this.currentEquity?100*this.getCurrentProfit/this.currentEquity:0},iconArrowMicro:function(){return{name:"Arrow-expand-bottom-micro",color:"light"===this.getActiveTheme?"#8c8c8c":"#BBCEE0"}},iconClose:function(){return{name:"Close",color:"#E91212"}},iconSettings:function(){return{name:"Settings",color:"#3C73F1"}},countBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length)return this.buyOrders.length},countSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length)return this.sellOrders.length},totalVolumeBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length)return this.buyOrders.reduce((function(t,e){return t+e.volume}),0)},totalVolumeSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length)return this.sellOrders.reduce((function(t,e){return t+e.volume}),0)},averagePriceBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length){var e=this.buyOrders.reduce((function(t,e){return t+e.openPrice}),0);return Fm(e/this.buyOrders.length,2)}},averagePriceSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length){var e=this.sellOrders.reduce((function(t,e){return t+e.openPrice}),0);return Fm(e/this.sellOrders.length,2)}},plBuy:function(){var t;if(null!==(t=this.buyOrders)&&void 0!==t&&t.length){var e=this.buyOrders.reduce((function(t,e){return t+e.profit}),0);return Fm(e,2)}},plSell:function(){var t;if(null!==(t=this.sellOrders)&&void 0!==t&&t.length){var e=this.sellOrders.reduce((function(t,e){return t+e.profit}),0);return Fm(e,2)}},arrayForAccordion:function(){var t,e,i=[],o={id:1,type:"buy",count:this.countBuy,totalVolume:this.totalVolumeBuy,averagePrice:this.averagePriceBuy,pl:this.plBuy,orders:this.buyOrders},n={id:2,type:"sell",count:this.countSell,totalVolume:this.totalVolumeSell,averagePrice:this.averagePriceSell,pl:this.plSell,orders:this.sellOrders};return null!==(t=this.buyOrders)&&void 0!==t&&t.length&&i.push(o),null!==(e=this.sellOrders)&&void 0!==e&&e.length&&i.push(n),i}}),methods:{selectionChanged:function(t){this.selectedItems=t.addedItems},getPoints:function(){var t=this;this.points=[[{stroke:this.getCurrentProfit<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getCurrentProfit<0?this.getRedColor.fill:this.getGreenColor.fill}]];var e=this.statByContract.length>30?this.statByContract.slice(-30):this.statByContract;e.forEach((function(e){t.points[0].push({time:new Date(e.date).getTime(),data:e.floatingProfitClose})})),this.points[0].at(-1).data=this.getCurrentProfit},setClickTittle:function(t,e){"close"===t&&"owner"===this.getStatusUser.status?this.closeAllOrdersByType(e):"settings"===t&&"owner"===this.getStatusUser.status&&this.settingsOrders("Sell"===e?this.sellOrders:this.buyOrders)},settingsOrders:function(t){var e=t.map((function(t){return t.id}));this.$store.dispatch("modal/switchNewOrderModal",{symbol:this.symbol,payload:e})},closeAllOrdersByType:function(t){var e=this;if("owner"===this.getStatusUser.status){var i="Sell"===t?this.sellOrders:this.buyOrders;i.forEach((function(t){e.closeOrder(t)}))}},closeOrder:function(t){if("owner"===this.getStatusUser.status){var e={Command:"CloseTradingOrder",data:{accountId:t.accountId,id:t.id},FingerPrint:this.getSession.fp,Sign:""};this.$socketStream.sendCommand({ws:"apiWS",command:e})}}},created:function(){},mounted:function(){this.statByContract&&this.statByContract.length&&this.getPoints()},destroyed:function(){}},LAt=$At,FAt=(i("3e8f"),Object(C["a"])(LAt,BAt,MAt,!1,null,"f5ebb5f8",null)),jAt=FAt.exports,RAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"GistogramLeftBarWidget",style:{width:t.width,height:t.height},on:{mouseleave:t.clearHoverPoint}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.pointsForGistogramm?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:!1,maxIndicator:!1,lastIndicator:!1,relevatColor:"dark"===t.getActiveTheme?"#23313f":"#f2f2f2",unrelevantColor:"dark"===t.getActiveTheme?"#23313f":"#f2f2f2",widthYaxis:"0rem",heightXaxis:"0rem"},on:{hover:t.hoverBar}}):t._e()],1),t.positionHoverWidget?e("div",{class:"GistogramLeftBarWidget-hoverWidget GistogramLeftBarWidget-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"GistogramLeftBarWidget-hoverWidgetRow GistogramLeftBarWidget-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"GistogramLeftBarWidget-hoverWidgetStat GistogramLeftBarWidget-hoverWidgetStat_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s(i.stat))])])})),0):t._e()],1)},WAt=[],NAt={props:{pointsForGistogramm:{default:null},width:{type:String,default:"100%"},height:{type:String,default:"17rem"}},components:{GistogrammEventChart:TI,Sceleton:nT},data:function(){return{positionHoverWidget:null,statsForHoverWidget:null}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null!==(t=this.getDefaultAccount)&&void 0!==t&&t.currencyChar?this.getDefaultAccount.currencyChar:""},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getLemonColor.color,fill:this.getLemonColor.fill,positive:{color:this.getLemonColor.color,fill:this.getLemonColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},label:"",lineWidth:3,title:this.$t("income")}]}}}),methods:{clearHoverPoint:function(){this.positionHoverWidget=null,this.statsForHoverWidget=null},hoverBar:function(t){if(t){var e=t.point,i=340-t.cPointX,o=340-t.cPointY;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(o>70?Math.round(t.cPointY):Math.round(t.cPointY-70),"px"),left:"".concat(i>180?t.cPointX:t.cPointX-80,"px")};var n=this.pointsForGistogramm[1].find((function(t){return t.x===e.x}));n&&(this.statsForHoverWidget.push({stat:n.date,color:this.getGrayColor.color}),this.statsForHoverWidget.push({stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(n.y,2)),color:n.y<0?this.getRedColor.color:this.getGreenColor.color}))}else this.positionHoverWidget=null}}},EAt=NAt,UAt=(i("d6c0"),Object(C["a"])(EAt,RAt,WAt,!1,null,"04d6385c",null)),VAt=UAt.exports,HAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatisticsOnThePair"},[e("ContainerWithLabel",{attrs:{label:"Сделки",theme:t.getActiveTheme,mb:8}},[e("div",{staticClass:"lineStatistic"},[e("div",{staticClass:"titleMain",class:"title_".concat(t.getActiveTheme),style:{color:t.getBlueColor.color}},[t._v(t._s(t.getCountOrdersByContract))])]),e("div",{staticClass:"lineTwoStatistic mt"},[e("div",{staticClass:"title",class:"title_".concat(t.getActiveTheme)},[t._v(t._s(t.getPositiveOrdersCountByContract))]),e("div",{staticClass:"containerProgress"},[e("ProgressTwoLine",{attrs:{textLeft:"Прибыльные",textRight:"Убыточные",theme:t.getActiveTheme,leftPercent:t.getPercentPositiveOrdersCount,rightPercent:t.getPercentNegativeOrdersCount}})],1),e("div",{class:"title title_".concat(t.getActiveTheme," right")},[t._v(t._s(t.getNegativeOrdersCountByContract))])]),e("div",{staticClass:"lineTwoStatistic mt"},[e("div",{staticClass:"title",class:"title_".concat(t.getActiveTheme)},[t._v(t._s(t.getBuyCountByContract))]),e("div",{staticClass:"containerProgress"},[e("ProgressTwoLine",{attrs:{textLeft:"Buy",textRight:"Sell",theme:t.getActiveTheme,rightPercent:t.getPercentSellCount,leftPercent:t.getPercentBuyCount}})],1),e("div",{class:"title title_".concat(t.getActiveTheme," right")},[t._v(t._s(t.getSellCountByContract))])])]),e("ContainerWithLabel",{attrs:{label:"Общая прибыль, $",mb:8,theme:t.getActiveTheme}},[e("div",{staticClass:"lineStatistic"},[e("div",{staticClass:"titleMain",class:"title_".concat(t.getActiveTheme),style:{color:t.getProfitByContract&&t.getProfitByContract.data<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$ ".concat(t.getProfitByContract?t.$moneyf(t.getProfitByContract.data,2):0)))])]),e("div",{staticClass:"lineTwoStatistic mt"},[e("div",{staticClass:"title",class:"title_".concat(t.getActiveTheme)},[t._v(t._s(t.getOnlyProfitByContract?t.getOnlyProfitByContract.text:t.getOnlyProfitByContract))]),e("div",{staticClass:"containerProgress"},[e("ProgressTwoLine",{attrs:{textLeft:"Прибыль",textRight:"Убыток",theme:t.getActiveTheme,rightPercent:t.getPercentOnlyLoss,leftPercent:t.getPercentOnlyProfit}})],1),e("div",{class:"title title_".concat(t.getActiveTheme," right")},[t._v(t._s(t.getOnlyLossByContract?t.getOnlyLossByContract.text:t.getOnlyLossByContract))])]),e("div",{staticClass:"lineTwoStatistic mt"},[e("div",{staticClass:"title",class:"title_".concat(t.getActiveTheme)},[t._v(t._s(t.getProfitByContractBuy?t.getProfitByContractBuy.text:t.getProfitByContractBuy))]),e("div",{staticClass:"containerProgress"},[e("ProgressTwoLine",{attrs:{textLeft:"Buy",textRight:"Sell",theme:t.getActiveTheme,rightPercent:t.getPercentProfitSell,leftPercent:t.getPercentProfitBuy}})],1),e("div",{class:"title title_".concat(t.getActiveTheme," right")},[t._v(t._s(t.getProfitByContractSell?t.getProfitByContractSell.text:t.getProfitByContractSell))])])])],1)},GAt=[],qAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ContainerWithLabel",class:"ContainerWithLabel_".concat(t.theme),style:{marginBottom:t.mb+"px"}},[e("div",{staticClass:"label",class:"label_".concat(t.theme)},[t._v(t._s(t.label))]),t._t("default")],2)},zAt=[],YAt={name:"ContainerWithLabel",mixins:[],props:{label:{type:String},theme:{type:String},mb:{type:Number,default:0}},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},XAt=YAt,QAt=(i("385c"),Object(C["a"])(XAt,qAt,zAt,!1,null,"2510735b",null)),JAt=QAt.exports,KAt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProgressLine",style:t.rootStyle})},ZAt=[],tDt={name:"ProgressLine",mixins:[],props:{height:{type:Number,default:8},commonColor:{type:String,default:"#CCCCCC"},fillColor:{type:String,default:"#3C73F1"},percent:{type:Number,default:35},mb:{type:Number,default:0}},components:{},data:function(){return{}},computed:{rootStyle:function(){return{marginBottom:this.mb+"px","--height":this.height+"px","--common-color":this.commonColor,"--fill-color":this.fillColor,"--percent":this.percent+"%"}}},mounted:function(){},destroyed:function(){},methods:{}},eDt=tDt,iDt=(i("efb62"),Object(C["a"])(eDt,KAt,ZAt,!1,null,"7a295067",null)),oDt=iDt.exports,nDt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProgressTwoLine"},[e("div",{staticClass:"left"},[t.textLeft?e("div",{staticClass:"text",class:"text_".concat(t.theme," textLeft")},[t._v(t._s(t.textLeft))]):t._e(),e("div",{staticClass:"lineBarLeft",style:{background:t.getGreenColor.color,width:"".concat(t.leftPercent,"%")}})]),e("div",{staticClass:"center"}),e("div",{staticClass:"right"},[e("div",{staticClass:"lineBarRight",style:{background:t.getRedColor.color,width:"".concat(t.rightPercent,"%")}}),t.textRight?e("div",{staticClass:"text",class:"text_".concat(t.theme," textRight")},[t._v(t._s(t.textRight))]):t._e()])])},sDt=[],rDt={name:"ProgressTwoLine",mixins:[qe],props:{textLeft:{type:String,default:""},leftPercent:{default:100},rightPercent:{default:100},textRight:{type:String,default:""},theme:{default:"dark"}},components:{},data:function(){return{}},computed:{},mounted:function(){},destroyed:function(){},methods:{}},aDt=rDt,cDt=(i("f056"),Object(C["a"])(aDt,nDt,sDt,!1,null,"f6261516",null)),lDt=cDt.exports,uDt={name:"StatisticsOnThePair",mixins:[qe],props:{shortStatByContract:{default:null},shortStatByAccount:{default:null}},components:{ContainerWithLabel:JAt,ProgressLine:oDt,ProgressTwoLine:lDt},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCountOrdersByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].ordersCount:0},getPositiveOrdersCountByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].positiveOrdersCount:0},getNegativeOrdersCountByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[0].negativeOrdersCount:0},getPercentPositiveOrdersCount:function(){return this.getPositiveOrdersCountByContract&&this.getCountOrdersByContract?Math.ceil(100*this.getPositiveOrdersCountByContract/this.getCountOrdersByContract):0},getPercentNegativeOrdersCount:function(){return this.getNegativeOrdersCountByContract&&this.getCountOrdersByContract?Math.ceil(100*this.getNegativeOrdersCountByContract/this.getCountOrdersByContract):0},getProfitByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].profit,1),data:this.shortStatByContract[0].profit}:0},getOnlyProfitByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].onlyProfit,1),data:this.shortStatByContract[0].onlyProfit}:0},getOnlyLossByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].onlyLoss,1),data:this.shortStatByContract[0].onlyLoss}:0},getAllProfitAndLossByContract:function(){return this.getOnlyLossByContract&&this.getOnlyProfitByContract?Math.abs(this.getOnlyLossByContract.data)+this.getOnlyProfitByContract.data:0},getPercentOnlyLoss:function(){var t;return this.getAllProfitAndLossByContract&&null!==(t=this.getOnlyLossByContract)&&void 0!==t&&t.data?-1*Math.ceil(100*this.getOnlyLossByContract.data/this.getAllProfitAndLossByContract):0},getPercentOnlyProfit:function(){var t;return this.getAllProfitAndLossByContract&&null!==(t=this.getOnlyProfitByContract)&&void 0!==t&&t.data?100*this.getOnlyProfitByContract.data/this.getAllProfitAndLossByContract:0},getProfitByContractSell:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[1].profit,1),data:this.shortStatByContract[1].profit}:0},getProfitByContractBuy:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[2].profit,1),data:this.shortStatByContract[2].profit}:0},getPercentProfitSell:function(){var t,e,i;return null!==(t=this.getProfitByContractSell)&&void 0!==t&&t.data?this.getProfitByContractSell.data<0?null!==(e=this.getOnlyLossByContract)&&void 0!==e&&e.data?Math.ceil(100*this.getProfitByContractSell.data/this.getOnlyLossByContract.data):0:null!==(i=this.getOnlyProfitByContract)&&void 0!==i&&i.data?Math.ceil(100*this.getProfitByContractSell.data/this.getOnlyProfitByContract.data):0:0},getPercentProfitBuy:function(){var t,e,i;return null!==(t=this.getProfitByContractBuy)&&void 0!==t&&t.data?this.getProfitByContractBuy.data<0?null!==(e=this.getOnlyLossByContract)&&void 0!==e&&e.data?Math.ceil(100*this.getProfitByContractBuy.data/this.getOnlyLossByContract.data):0:null!==(i=this.getOnlyProfitByContract)&&void 0!==i&&i.data?Math.ceil(100*this.getProfitByContractBuy.data/this.getOnlyProfitByContract.data):0:0},getProfitPips:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].onlyProfitPip,1),data:this.shortStatByContract[0].onlyProfitPip}:0},getLossPips:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].onlyLossPip,1),data:this.shortStatByContract[0].onlyLossPip}:0},getPercentProfitPips:function(){var t;return this.getAllPips&&null!==(t=this.getProfitPips)&&void 0!==t&&t.data?100*this.getProfitPips.data/this.getAllPips:0},getPercentLossPips:function(){var t;return this.getAllPips&&null!==(t=this.getLossPips)&&void 0!==t&&t.data?Math.abs(100*this.getLossPips.data/this.getAllPips):0},getPercentProfitBuyPips:function(){var t,e,i;return null!==(t=this.getSumPipByOrdersContractBuy)&&void 0!==t&&t.data?this.getSumPipByOrdersContractBuy.data<0?null!==(e=this.getLossPips)&&void 0!==e&&e.data?Math.ceil(100*this.getSumPipByOrdersContractBuy.data/this.getLossPips.data):0:null!==(i=this.getProfitPips)&&void 0!==i&&i.data?Math.ceil(100*this.getSumPipByOrdersContractBuy.data/this.getProfitPips.data):0:0},getPercentProfitSellPips:function(){var t,e,i;return null!==(t=this.getSumPipByOrdersContractSell)&&void 0!==t&&t.data?this.getSumPipByOrdersContractSell.data<0?null!==(e=this.getLossPips)&&void 0!==e&&e.data?Math.ceil(100*this.getSumPipByOrdersContractSell.data/this.getLossPips.data):0:null!==(i=this.getProfitPips)&&void 0!==i&&i.data?Math.ceil(100*this.getSumPipByOrdersContractSell.data/this.getProfitPips.data):0:0},getSumPipByOrdersContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[0].sumPipByOrders,1),data:this.shortStatByContract[0].sumPipByOrders}:0},getAllPips:function(){return this.getProfitPips||this.getLossPips?this.getProfitPips.data+Math.abs(this.getLossPips.data):0},getSumPipByOrdersContractBuy:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[2].sumPipByOrders,1),data:this.shortStatByContract[2].sumPipByOrders}:0},getSumPipByOrdersContractSell:function(){return this.shortStatByContract&&this.shortStatByContract.length?{text:Fn(this.shortStatByContract[1].sumPipByOrders,1),data:this.shortStatByContract[1].sumPipByOrders}:0},getSellCountByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[1].ordersCount:0},getBuyCountByContract:function(){return this.shortStatByContract&&this.shortStatByContract.length?this.shortStatByContract[2].ordersCount:0},getPercentSellCount:function(){return this.getSellCountByContract&&this.getCountOrdersByContract?Math.ceil(100*this.getSellCountByContract/this.getCountOrdersByContract):0},getPercentBuyCount:function(){return this.getBuyCountByContract&&this.getCountOrdersByContract?Math.ceil(100*this.getBuyCountByContract/this.getCountOrdersByContract):0}}),mounted:function(){},destroyed:function(){},methods:{}},dDt=uDt,hDt=(i("ce7e"),Object(C["a"])(dDt,HAt,GAt,!1,null,"2403d37f",null)),pDt=hDt.exports,gDt={props:{symbol:{type:[String]}},components:{StatDataContainer:k7,StatWidgetWithGradient:F7,GistogramLeftBarWidget:VAt,VuePerfectScrollbar:Xt.a,NewOrder:CAt,Margin:pAt,OpenPosition:IAt,LimitPosition:jAt,StatisticsOnThePair:pDt,ListStatisitc:aAt},mixins:[qe],data:function(){return{emtyStatus:!0,render:!1,copyOrders:[],closedOrders:[],copyLimitOrders:[],dailyStat:null,contractStat:null,shortStatByContract:null,shortStatByAccount:null,currentLeverage:0,currentProfit:0,currentProfitClose:0,currentMargin:0,curentMarginByContract:0,currentEquity:0,currentBalance:0,currentFloatingProfit:0,directionFloatingProfit:"up",directionCurrentProfit:"up"}},watch:{symbol:function(){this.getDefaultAccount&&this.updateStat()},getStatByOrders:function(t){t&&this.setCopyOrders()},currentProfit:function(t,e){this.directionCurrentProfit=t>=e?"up":"down"},currentFloatingProfit:function(t,e){this.directionFloatingProfit=t>=e?"up":"down"},getDefaultAccount:function(t){t.id&&this.getStatByOrders&&this.setCopyOrders(),t&&this.updateStat()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getLeftSideBar:"userSettings/getLeftSideBar",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders",getContracts:"contracts/getContracts"})),{},{getContractBySymbol:function(){var t,e=this;if(this.getContracts)return null===(t=this.getContracts)||void 0===t?void 0:t.find((function(t){return t.name===e.symbol}))},getCountClosedOrders:function(){var t;return null!==(t=this.shortStatByContract)&&void 0!==t&&t.length?this.shortStatByContract[0].ordersCount:0},getColorPercentProfitOrders:function(){var t=this.getPercentProfitOrders<30?this.getRedColor:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor:this.getLemonColor;return t},getPositieOrdersCount:function(){var t;return null!==(t=this.shortStatByContract)&&void 0!==t&&t.length?this.shortStatByContract[0].positiveOrdersCount:0},getNegativeOrdersCount:function(){var t;return null!==(t=this.shortStatByContract)&&void 0!==t&&t.length?this.shortStatByContract[0].negativeOrdersCount:0},getPercentProfitOrders:function(){if(!this.shortStatByContract||!this.shortStatByContract.length)return 0;if(!this.shortStatByContract[0].positiveOrdersCount||!this.shortStatByContract[0].ordersCount)return 0;var t=100*this.shortStatByContract[0].positiveOrdersCount/this.shortStatByContract[0].ordersCount;return t},getCountOpenOrders:function(){var t;return null!==(t=this.ordersBySymbol)&&void 0!==t&&t.length?this.ordersBySymbol.length:0},getCurrencyChar:function(){return this.getDefaultAccount?this.getDefaultAccount.currencyChar:""},getAvgProfit:function(){var t;return null!==(t=this.shortStatByContract)&&void 0!==t&&t.length?this.shortStatByContract[0].avgProfit:0},getCryptoStatus:function(){if(this.getContractBySymbol)return"Crypto"===this.getContractBySymbol.executionGroup},getPointsForGistogramm:function(){var t;if(null!==(t=this.contractStat)&&void 0!==t&&t.length){var e;e=this.contractStat.length<20?this.contractStat:this.contractStat.slice(-20);for(var i=[[]],o=0;o<=20;o++)if(e[o]){var n=e[o].profitOpen+e[o].floatingProfitOpen,s=e[o].profitClose+e[o].floatingProfitClose,r=s-n;i[0].push({x:o,y:r,date:new Date(e[o].date).toLocaleDateString("ru")})}else i[0].push({x:o});i.unshift([{x:0,y:0,date:new Date}]);var a=i[1].findLast((function(t){return void 0!==t.y})),c=e.at(-1).profitOpen+e.at(-1).floatingProfitOpen;return a?a.y=this.currentProfit-c:i[1][0].y=this.currentProfit-c,i}for(var l=[[]],u=0;u<=20;u++)u?l[0].push({x:u}):l[0].push({x:u,y:this.currentProfit,date:(new Date).toLocaleDateString("ru")});return l.unshift([{x:0,y:0,date:new Date}]),l},getEmtyStatus:function(){return this.ordersBySymbol&&!this.ordersBySymbol.length&&this.shortStatByContract&&!this.shortStatByContract.length&&this.contractStat&&!this.contractStat.length},getTitle:function(){return this.contractStat?"Статистика по ".concat(this.symbol," за ").concat(this.contractStat.length," торг. д."):"Статистика по ".concat(this.symbol)},getDirectionCloseProfit:function(){return this.closedOrders.length&&this.closedOrders.at(-1).profit<0?"down":"up"},getPercentOfEquityCurrent:function(){return this.currentEquity&&this.currentProfit?100*this.currentProfit/this.currentEquity:0},getPercentOfBalance:function(){return this.currentBalance&&this.currentProfitClose?100*this.currentProfitClose/this.currentBalance:0},getPercentOfEquity:function(){return this.currentEquity&&this.currentFloatingProfit?100*this.currentFloatingProfit/this.currentEquity:0},getPercentOfProfitClose:function(){return this.getAvgVolumeCloseOrders&&this.getAvgProfit?100*this.getAvgProfit/this.getAvgVolumeCloseOrders:0},getAvgVolumeCloseOrders:function(){var t=this;if(!this.closedOrders||!this.closedOrders.length)return 0;var e=this.closedOrders.filter((function(e){return e.contractName===t.symbol})),i=e.length?e.reduce((function(e,i){return e+(t.getCryptoStatus?i.volume*i.openPrice:i.volume)}),0):0;return e.length?i/e.length:0},ordersBySymbol:function(){var t=this;if(this.copyOrders.length)return this.copyOrders.filter((function(e){return e.contractName===t.symbol}))},limitOrdersBySymbol:function(){var t=this;if(this.copyLimitOrders.length)return this.copyLimitOrders.filter((function(e){return e.contractName===t.symbol}))},sellOrders:function(){if(this.ordersBySymbol)return this.ordersBySymbol.filter((function(t){return"Sell"===t.orderType}))},buyOrders:function(){if(this.ordersBySymbol)return this.ordersBySymbol.filter((function(t){return"Buy"===t.orderType}))},getIconForControlSidebar:function(){return this.getLeftSideBar?"Block-expand-left-close":"Block-expand-right-close"}}),methods:{updateStat:function(){this.dailyStat=null,this.contractStat=null,this.currentProfit=0,this.currentFloatingProfit=0,this.getStatistics()},setCopyOrders:function(){var t,e,i;this.copyOrders=structuredClone(null===(t=this.$orderStorage.getOrdersOnStorage())||void 0===t?void 0:t.tradingOrders),this.closedOrders=null===(e=this.$orderStorage.getOrdersOnStorage())||void 0===e?void 0:e.closedOrders,this.copyLimitOrders=structuredClone(null===(i=this.$orderStorage.getOrdersOnStorage())||void 0===i?void 0:i.pendingOrders),this.render=!this.render},getStatisticsByContract:function(){var t={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:this.getDefaultAccount.id,contracts:[this.symbol]}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},getStatistics:function(){this.getStatisticsByContract(),this.getShortStatisticByContract(),this.getShortStatisticByAccount()},getShortStatisticByAccount:function(){var t={Command:"AccountShortStatistic",method:"get",Data:{accountId:this.getDefaultAccount.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},getShortStatisticByContract:function(){var t={command:"AccountShortStatisticV2",data:{datas:[{AccountId:this.getDefaultAccount.id,Contracts:[this.symbol]}],ByContract:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setDataOrdersForAccount:function(t){var e=this;if(this.copyOrders){var i=t.find((function(t){return t.account.id===e.getDefaultAccount.id}));if(i){var o=i.openOrders.tradingOrders.filter((function(t){return t.contractName===e.symbol}));o.length&&o.forEach((function(t){var i=e.copyOrders.find((function(e){return e.id===t.id}));i&&(i.profit=t.profit)}))}}},setMessageHandler:function(t){var e=this;if("AccountsDetails"===(null===t||void 0===t?void 0:t.command)){if(t.data[0].statisticByContracts&&t.data[0].statisticByContracts.length){var i=t.data[0].statisticByContracts.find((function(t){return t.contract===e.symbol}));this.currentFloatingProfit=i?i.floatingProfit:0,this.currentProfit=i?i.floatingProfit+i.profitClose:0,this.currentProfitClose=i?i.profitClose:0,this.curentMarginByContract=i?i.margin:0}this.currentLeverage=t.data[0].statisticByAccount.leverage,this.currentEquity=t.data[0].account.equity,this.currentBalance=t.data[0].account.balance,this.currentMargin=t.data[0].statisticByAccount.margin,this.setDataOrdersForAccount(t.data)}else if("BrokerPosition"===(null===t||void 0===t?void 0:t.command))t.data.accountId===this.getDefaultAccount.id&&t.data.contractName===this.symbol&&(setTimeout((function(){e.getStatistics()}),5e3),setTimeout((function(){e.setCopyOrders()}),0));else if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var o=Td(JSON.parse(t.data));if(!o||!o.data.length||o.data[0].contract!==this.symbol||o.dailyData.accountId!==this.getDefaultAccount.id)return;this.dailyStat=o.dailyData,this.contractStat=o.data}else if("AccountShortStatistic"===(null===t||void 0===t?void 0:t.command)){var n=JSON.parse(t.data),s=[];n.forEach((function(t){s.push(zot(t))})),this.shortStatByAccount=s}else if("AccountShortStatisticV2"===(null===t||void 0===t?void 0:t.command)){var r=JSON.parse(t.data),a=[];r.forEach((function(t){a.push(zot(t))})),this.shortStatByContract=a}},toggleVisibleLeftBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!this.getLeftSideBar})}},created:function(){this.getStatByOrders&&this.setCopyOrders()},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS3",this.setMessageHandler),this.symbol&&this.getDefaultAccount&&this.getStatistics()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)}},fDt=gDt,mDt=(i("45be"),Object(C["a"])(fDt,tAt,eAt,!1,null,null,null)),vDt=mDt.exports,yDt={components:{TradingRightBar:RZ,Trading:Z_t,TradingLeftBar:vDt},data:function(){return{loadedSessionTableData:!1,providerBySymbol:null,statusWelcomeModal:!1,noAuthUserWelcoms:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getSession:"auth/getSession",getConnections:"connectionStatus/getConnections",getUISettings:"userSettings/getUserSettings",getWelcomsModals:"userSettings/getWelcomsModals",getOrdersPanel:"modal/getOrdersPanel",getDefaultAccount:"subscribeOrders/getDefaultAccount",getRightSideBar:"userSettings/getRightSideBar",getTradeNotification:"modal/getTradeNotification",getSelectedButtonForActiveScreen:"tradingTopBarSettings/getSelectedButtonForActiveScreen",getStatByOrders:"contracts/getStatByOrders",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus",getActiveTheme:"headerSettings/getActiveTheme",getSelectedViewNotification:"periodReportsSettings/getSelectedViewNotification"})),{},{getActiveSymbol:function(){return this.getSelectedButtonForActiveScreen.symbol},getStatus:function(){return"ready"===this.getUserDetailRequestStatus||"noSent"===this.getAuthRequestStatus}}),watch:{getStatus:function(t){t&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Trading"===t})):!this.getWelcomsModals.length)},getDefaultAccount:function(t){t&&(this.$store.commit("contracts/setStatusByOrders",!1),this.getHistoryOrdersForAccount())}},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getAllTradingInstrumnets:"contracts/getAllTradingInstrumnets",getAllTradingAssets:"contracts/getAllTradingAssets"})),{},{getHistoryOrdersForAccount:function(){this.$store.commit("contracts/setStatusByOrders",!1);var t={Command:"HistoryOrders",Data:{accountId:this.getDefaultAccount.id,filter:{orderTypes:["All"],startTime:null,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHendler:function(t){if("HistoryOrders"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);this.getDefaultAccount.id===e[0]&&(this.$orderStorage.setOrdersToStorage(e),this.$store.dispatch("tradeNotification/lastOrders",this.$orderStorage.getLast24HOrders()),this.$store.commit("contracts/setStatusByOrders",!0),this.loadedSessionTableData=!this.loadedSessionTableData)}else if("None"===(null===t||void 0===t?void 0:t.command)){if("OrderExecution"===t.data.dataType){var i=JSON.parse(t.data.data);"TrailingSL"===i.Message&&this.$orderStorage.setOrderTrailingSL(i)}}else"BrokerPosition"===(null===t||void 0===t?void 0:t.command)&&this.getDefaultAccount.id===t.data.accountId&&"NoError"===t.data.errorCode&&(this.$orderStorage.setUserOrder(t.data),this.getTradeNotification||"event"!==this.getSelectedViewNotification||this.$store.commit("modal/setTradeNotification",!0))}}),mounted:function(){var t;this.getTradingInstruments||(this.getAllTradingInstrumnets(),this.getAllTradingAssets()),this.$socketStream.addConnection({id:"apiWS4",url:"wss://api.toptrader.ru/ws4"}),localStorage.removeItem("sendCommand"),null!==(t=this.getUISettings)&&void 0!==t&&null!==(t=t.rightSidebar)&&void 0!==t&&t.visible||localStorage.setItem("sendCommand","true"),this.getStatus&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Trading"===t})):!this.getWelcomsModals.length),this.$socketStream.$on("apiWS3",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS_NOTI",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.getDefaultAccount&&this.getHistoryOrdersForAccount()},destroyed:function(){this.$socketStream.removeConnection("apiWS4"),this.getOrdersPanel.status&&this.$store.dispatch("modal/switchOrdersPanel",{status:!1,data:null}),this.$socketStream.$off("apiWS3",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS_NOTI",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},CDt=yDt,bDt=(i("a702"),Object(C["a"])(CDt,Irt,Brt,!1,null,"2705b19e",null)),SDt=bDt.exports,PDt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chatPage"},[t.getChatCurrentRoom?e("div",{staticClass:"chatPage-head"},[e("ChatReturn")],1):t._e(),e("div",{staticClass:"chatPage-body",style:t.getChatCurrentRoom?{height:"calc(100vh - 4rem)"}:{height:"100vh"}},[t.readyStatus?e("Chat",{attrs:{roomId:t.roomId}}):t._e()],1)])},TDt=[],xDt={props:{roomId:{type:String}},data:function(){return{readyStatus:!1}},components:{Chat:nK,ProfileModule:Cz,ChatReturn:uK},watch:{getChatAuth:function(t){t&&(this.readyStatus=!0)}},computed:Object(c["a"])({},Object(p["c"])({getChatCurrentRoom:"chat/getChatCurrentRoom",getChatAuth:"chat/getChatAuth",getApiChat:"api/apiChat"})),methods:{openChat:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.statusPreloader=!0,i.next=3,e.$http.get("".concat(e.getApiChat,"rooms.info/?roomId=").concat(t),{headers:{"Content-Type":"application/json","X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId}}).then((function(i){e.getSubsOne(t).then((function(){return e.$store.dispatch("chat/toggleChat",i.data.room)}))})).catch((function(){e.errorServer="Oшибка сервера, повторите запрос позже",setTimeout((function(){e.statusPreloader=!1}),3e3)}));case 3:case"end":return i.stop()}}),i)})))()},getSubsOne:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e.additionalInfoForGroup=null,i.next=3,e.$http.get("".concat(e.getApiChat,"subscriptions.getOne?roomId=").concat(t),{headers:{"X-Auth-Token":e.getChatAuth.authToken,"X-User-Id":e.getChatAuth.userId,"Content-type":"application/json"}}).then((function(t){e.additionalInfoForGroup=t.data.subscription?t.data.subscription:t.data}));case 3:case"end":return i.stop()}}),i)})))()}}},ODt=xDt,wDt=(i("7a6a"),Object(C["a"])(ODt,PDt,TDt,!1,null,null,null)),_Dt=wDt.exports,ADt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Investing"},[e("div",{staticClass:"Investing-content"},[e("Layout",{scopedSlots:t._u([{key:"left",fn:function(){return[t.getCommonPortfolioStatus||t.strategyStatus||t.topsStatus?t._e():e("LeftBar"),!t.getCommonPortfolioStatus||t.strategyStatus||t.topsStatus?t._e():e("LeftBarCalcInvestProfit",{attrs:{commonStatisticsPortfolios:t.commonStatisticsPortfolios,commonNowStatisticsPortfolios:t.commonNowStatisticsPortfolios,statusCommonStatisticsPortfolios:t.statusCommonStatisticsPortfolios,loadStatus:t.loadStatus}}),t.strategyStatus?e("LeftBarFilterStrategy",{attrs:{defaultFilterByTraders:t.defaultFilterByTraders,statusBlockFilter:t.statusBlockFilter},on:{setTypeAccountFilter:t.setTypeAccountFilter,setParamFiltering:t.setParamFiltering}}):t._e(),t.topsStatus?e("LeftBarTops",{attrs:{activeTop:t.activeTop,topsStat:t.topsStat}}):t._e()]},proxy:!0},{key:"center",fn:function(){return[e("div",{staticClass:"Investing-center"},[e("MyInvestments",{attrs:{commonStatisticsPortfolios:t.commonStatisticsPortfolios,commonNowStatisticsPortfolios:t.commonNowStatisticsPortfolios,activeAccountTypeFilter:t.activeAccountTypeFilter,defaultFilterByTraders:t.defaultFilterByTraders},on:{setCurrentPage:t.setCurrentPage,statusBlockFilter:t.setStatusBlockFilter,setActiveTop:t.setActiveTop,setStrategy:t.setStrategy,setTops:t.setTops,setTopsStat:t.setTopsStat}})],1)]},proxy:!0},{key:"right",fn:function(){return[e("RightBar",{attrs:{loadStatus:t.loadStatus}})]},proxy:!0}])}),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.loadStatus?e("Preloader",{attrs:{enabled:t.loadStatus,opacity:"1",sizeIcon:66,icon:!0}}):t._e()],1)],1),t.visiblePopup?e("ModalPortfolioExperts",t._b({attrs:{visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}},"ModalPortfolioExperts",t.modalData,!1)):t._e(),e("DxPopup",{attrs:{width:"740px",height:"386px",shading:!1,visible:t.statusWelcomeModal,showTitle:!1}},[e("WelcomeModals",{attrs:{routeName:"Portfolios"},on:{hideWelcome:t.hideWelcome}})],1)],1)},DDt=[],kDt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LeftBar"},[e("div",{class:"LeftBar-head LeftBar-head_".concat(t.getActiveTheme)},[t.getLeftSideBar?e("div",{staticClass:"LeftBar-namePortfolio"},[t.getStatusPorvider?e("Avatar",{attrs:{size:"2.4",src:t.getAvatarProvider,theme:t.getActiveTheme}}):t._e(),e("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],ref:"inputTitle",class:t.editName?"LeftBar-title LeftBar-title_".concat(t.getActiveTheme):"LeftBar-readonly LeftBar-readonly_".concat(t.getActiveTheme),attrs:{title:t.name,readonly:!t.editName},domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}}),t.getStatusPorvider?t._e():e("ButtonIconFlat",{attrs:{disabled:t.isLoading||t.isLoadingEditName,modifier:t.modifierClass,icon:t.getIconData(t.isLoadingEditName?"":t.editName?"Check":"EditInform")},on:{toggle:t.nameEditing}},[t.isLoadingEditName?e("DxLoadIndicator",{attrs:{height:20,width:20}}):t._e()],1),e("ButtonIconFlat",{attrs:{disabled:t.isLoading||t.isLoadingEditName,modifier:{class:["LeftBar-button","LeftBar-button_".concat(this.getActiveTheme)],style:{marginLeft:"0.3rem"}},icon:t.isLoading?{}:t.getIconData("Delete")},on:{toggle:t.deletePortfolio}},[t.isLoading?e("DxLoadIndicator",{attrs:{height:20,width:20}}):t._e()],1)],1):t._e(),e("div",{class:t.getLeftSideBar?"LeftBar-closeButton":"LeftBar-closeButtonHide"},[e("ButtonIconFlat",{attrs:{icon:t.iconPath,modifier:t.modifierClass},on:{toggle:t.closeLeftSideBar}})],1)]),e("div",{staticClass:"LeftBar-content",class:"LeftBar-content_".concat(t.getActiveTheme)},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.getLeftSideBar?e("SelectedPortfolio"):t._e()],1)],1)])},IDt=[],BDt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SelectedPortfolio"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoadingStatData?e("LoadComponent"):e("div",{staticClass:"wrapperPortfolio"},[e("VuePerfectScrollbar",{staticClass:"SelectedPortfolio-statBlock"},[e("div",{staticClass:"SelectedPortfolio-startStat"},t._l(t.getStartStat,(function(i,o){return e("div",{key:o,class:"SelectedPortfolio-startStat-item SelectedPortfolio-startStat-item_".concat(t.getActiveTheme)},[e("div",{class:"SelectedPortfolio-startStat-itemTitle SelectedPortfolio-startStat-itemTitle_".concat(t.getActiveTheme),on:{mouseenter:function(e){return t.mouseenterHandler(e,i.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(t.$t(i.title)))]),e("hr"),e("div",{class:"SelectedPortfolio-startStat-itemData SelectedPortfolio-startStat-itemData_".concat(t.getActiveTheme)},[t._v(t._s(i.data))])])})),0),e("WidgetsBlock",{attrs:{statProfitsPortfolio:t.statProfitsPortfolio}}),t.getStatusPorvider&&"Created"===t.getStatusBag?e("ProvidersComissionBlock"):t._e(),e("ExpertsTabBlock",{on:{updateProfitsPortfolio:t.setProfitsPortfolio}}),"Active"===t.getStatusBag?e("CountSourceOrders"):t._e(),e("AccordionStatBlock"),e("div",{staticClass:"SelectedPortfolio-titleTable"},[e("div",{class:"SelectedPortfolio-titleTableLabel SelectedPortfolio-titleTableLabel_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("management_statistics")))]),"Created"!==t.getStatusBag?e("div",{class:"SelectedPortfolio-titleTableIcon SelectedPortfolio-titleTableIcon_".concat(t.getActiveTheme),on:{click:t.openExpandStat}},[e("svgIcon",{attrs:{name:"Expand"}})],1):t._e()]),e("PortfolioData"),t.expandStatStatus?e("PopupExtandStatPortfolio",{on:{closePopup:t.openExpandStat}}):t._e()],1),e("div",{staticClass:"SelectedPortfolio-downBlock"},[e("ButtonBlock",t._b({},"ButtonBlock",t.propsButtonBlock,!1))],1)],1)],1),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.$t(t.tooltipText)))])],1)},MDt=[],$Dt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ButtonBlock",class:t.rootClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.statusActive?e("div",{key:"activePortfolio",staticClass:"activePortfolio"},[e("div",{staticClass:"leftPart"},[e("svgIcon",t._b({},"svgIcon",t.iconData,!1)),e("span",{staticClass:"text"},[t._v(t._s(t.$t("you_are_copying")))])],1),e("div",{staticClass:"rightPart"},[e("button",{staticClass:"stop",attrs:{disabled:t.disabledButton},on:{click:function(e){return t.setStatus("Stoped")}}},[t.isLoadingStoped?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[e("svgIcon",t._b({},"svgIcon",t.iconDataStop,!1)),t._v(t._s(t.$t("stop")))]],2)])]):t.statusCreated||t.statusStopped?e("div",{key:"createdPortfolio",staticClass:"createdPortfolio"},[e("ButtonIconFlat",{staticClass:"buttonCustom hollowPig",attrs:{icon:t.iconCopy,disabled:t.isLoadingStart},on:{toggle:t.invest}},[t.isLoadingStart?e("DxLoadIndicator",{attrs:{height:35,width:35}}):t._e(),t.isLoadingStart?t._e():e("span",{staticClass:"textButton"},[t._v(t._s(t.$t("copy")))]),t.isLoadingStart?t._e():e("span",{staticClass:"textButton"},[t._v("SF 33%")])],1)],1):t.statusPaused?e("div",{key:"statusPaused",staticClass:"pausePortfolio"},[e("div",{staticClass:"leftPart"},[e("svgIcon",t._b({},"svgIcon",t.iconData,!1)),t._v("Продолжайте копировать")],1),e("div",{staticClass:"rightPart"},[e("button",{staticClass:"continue",attrs:{disabled:t.disabledButtonActive},on:{click:function(e){return t.setStatus("Active")}}},[t.isLoadingActive?e("DxLoadIndicator",{attrs:{height:20,width:20}}):[e("svgIcon",t._b({},"svgIcon",t.iconDataContinue,!1)),t._v("Продолжить")]],2)])]):t._e()]),t.visiblePopup?e("ModalPortfolioExperts",{attrs:{portfolio:!0,providerCopy:t.isProviderCopy,findPortfolio:t.findPortfolio,expertsByFindPortfolio:t.expertsByFindPortfolio,visiblePopup:t.visiblePopup,closeModal:t.hidden},on:{hidden:t.hidden}}):t._e()],1)},LDt=[],FDt={name:"ButtonBlock",mixins:[xt,$n],props:{expertsByFindPortfolio:{type:Array}},components:{ModalPortfolioExperts:JU,DxLoadIndicator:OT["DxLoadIndicator"]},data:function(){return{visiblePopup:!1,isLoadingStoped:!1,isLoadingPause:!1,isLoadingActive:!1,isLoadingStart:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getApiUri:"api/api",getSession:"auth/getSession"})),{},{iconCopy:function(){return this.isLoadingStart?{}:{name:"Copy",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},statusCreated:function(){return!!this.findPortfolio&&"Created"===this.findPortfolio.status},statusActive:function(){return!!this.findPortfolio&&"Active"===this.findPortfolio.status},statusPaused:function(){return!!this.findPortfolio&&"Pause"===this.findPortfolio.status},statusStopped:function(){return!!this.findPortfolio&&"Stoped"===this.findPortfolio.status},iconData:function(){return{name:"Copy",color:"#66FFC5"}},iconDataStop:function(){return{name:"Stop",color:"#E91212"}},iconDataPause:function(){return{name:"Pause",color:"#3C73F1"}},iconDataContinue:function(){return{name:"Play",color:"#3C73F1"}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{whiteFon:this.statusCreated||this.statusStopped})},disabledButton:function(){return this.isLoadingStoped||this.isLoadingPause},disabledButtonActive:function(){return this.isLoadingActive},isProviderCopy:function(){var t;return"Signal"===(null===(t=this.findPortfolio)||void 0===t?void 0:t.type)}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({changeInvestBagStatus:"expertsPortfolio/changeInvestBagStatus",showToast:"toast/showToast",getDataByBagOpenOrders:"expertsPortfolio/getDataByBagOpenOrders",setUpdatingDataPortfolio:"expertsPortfolio/setUpdatingDataPortfolio",setVisible:"modalPay/setVisible"})),{},{getInvestBagOpenOrders:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return e["isLoading".concat(t)]=!0,i.next=3,e.getDataByBagOpenOrders(e.findPortfolio.id);case 3:return o=i.sent,e["isLoading".concat(t)]=!1,i.abrupt("return",o);case 6:case"end":return i.stop()}}),i)})))()},changeStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.changeInvestBagStatus({bagId:e.findPortfolio.id,status:t,changeStatus:!0});case 2:e.setUpdatingDataPortfolio();case 3:case"end":return i.stop()}}),i)})))()},setStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if("Active"!==t){i.next=6;break}return e.isLoadingActive=!0,i.next=4,e.changeStatus(t);case 4:return e.isLoadingActive=!1,i.abrupt("return");case 6:return i.next=8,e.getInvestBagOpenOrders(t);case 8:o=i.sent,e.showToast({visible:!0,componentName:"StopOrDeletePortfolioAlert",shading:!0,outSideClick:!0,width:"75vw",height:"90vh",dopInfo:{functionSetStatus:e.changeStatus.bind(null,t),stop:!0,profit:o.profit,count:o.count,namePortfolio:e.findPortfolio.name}});case 10:case"end":return i.stop()}}),i)})))()},getTextMessage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.count?"".concat(this.$t("tanotitp")[0](e.count),"
\n ").concat(this.$t("tanotitp")[1]," ≈ $ ").concat(Math.abs(e.profit),". \n ").concat(this.$t("aystywtsi")):this.$t("aystywtsi")},invest:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.needPay();case 2:if(i=e.sent,!i){e.next=10;break}return t.isLoadingStart=!0,e.next=7,t.pendingStatus(i.id);case 7:return t.setVisible(!0),t.isLoadingStart=!1,e.abrupt("return");case 10:t.visiblePopup=!0;case 11:case"end":return e.stop()}}),e)})))()},hidden:function(){this.visiblePopup=!1}})},jDt=FDt,RDt=(i("4c47"),Object(C["a"])(jDt,$Dt,LDt,!1,null,"2a902e6d",null)),WDt=RDt.exports,NDt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LoadComponent",class:t.darkClass},[e("DxLoadIndicator",{attrs:{height:70,width:70}})],1)},EDt=[],UDt={name:"LoadComponent",mixins:[xt],components:{DxLoadIndicator:OT["DxLoadIndicator"]}},VDt=UDt,HDt=(i("0f9c"),Object(C["a"])(VDt,NDt,EDt,!1,null,"34a5d769",null)),GDt=HDt.exports,qDt=function(){var t=this,e=t._self._c;return e("ul",{staticClass:"PortfolioData",class:t.darkClass},[t._l(t.dataList,(function(i,o){return e("li",{key:o},[e("span",{staticClass:"label",style:i.style,on:{mouseenter:function(e){return t.mouseenterHandler(e,i.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(t.$t(i.title)))]),e("span",{staticClass:"result",style:{color:i.color?i.color:""}},[t._v(t._s(i.value))])])})),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.$t(t.tooltipText)))])],2)},zDt=[],YDt={name:"PortfolioData",props:{statMode:{type:String,default:"portfolio"}},mixins:[xt,qe,Ot],data:function(){return{statFullData:null,tooltipText:"",closedOrders:null,openOrders:null}},watch:{closedOrdersPortfolio:function(t){t&&"portfolio"===this.statMode&&(this.closedOrders=this.closedOrdersPortfolio)},getAllSubscriptions:function(t){var e=this;if(t&&"portfolio"!==this.statMode&&this.getStatByOrders){var i=this.$orderStorage.getOrdersOnStorage();this.closedOrders=i.closedOrders.filter((function(t){return e.getAllSubscriptions.some((function(e){return t.subscriptionId===e}))})),this.$emit("setClosedOrders",this.closedOrders),this.openOrders=i.tradingOrders.filter((function(t){return e.getAllSubscriptions.some((function(e){return t.subscriptionId===e}))}))}},getStatByOrders:function(t){var e=this;if(t&&"portfolio"!==this.statMode&&this.getAllSubscriptions){var i=this.$orderStorage.getOrdersOnStorage();this.closedOrders=i.closedOrders.filter((function(t){return e.getAllSubscriptions.some((function(e){return t.subscriptionId===e}))})),this.$emit("setClosedOrders",this.closedOrders),this.openOrders=i.tradingOrders.filter((function(t){return e.getAllSubscriptions.some((function(e){return t.subscriptionId===e}))}))}},openOrdersPortfolio:function(t){t&&"portfolio"===this.statMode&&(this.openOrders=this.openOrdersPortfolio)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",findPortfolio:"expertsPortfolio/findPortfolio",openOrdersPortfolio:"statDataForPortfolio/openOrders",closedOrdersPortfolio:"statDataForPortfolio/closedOrders",getStatistics:"statistic/getStatistics",getStatData:"statDataForPortfolio/getStatData",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getStatByOrders:"contracts/getStatByOrders",getSession:"auth/getSession",apiUrl:"api/api"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getAllSubscriptions:function(){if(this.allSubscriptionCurrentDate)return this.allSubscriptionCurrentDate.map((function(t){return t.subscription.id.toString()}))},getActivePortfolios:function(){if(this.getCreatedPortfolios)return this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}))},getStartDateInvesting:function(){if(this.getActivePortfolios&&this.getActivePortfolios.length)return new Date(Math.min.apply(null,this.getActivePortfolios.map((function(t){return new Date(t.startDateTime?t.startDateTime:new Date).getTime()}))))},getSubscriptionsBySource:function(){var t=this;if(this.findPortfolio&&this.allSubscriptionCurrentDate){var e=this.allSubscriptionCurrentDate,i=e.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}));return i.map((function(t){return t.subscription.id.toString()}))}},clearProfit:function(){return this.closedOrders&&this.closedOrders.length?this.closedOrders.reduce((function(t,e){return t+e.profit}),0):0},getCountProfitOrders:function(){if(!this.closedOrders||!this.closedOrders.length)return[];var t=this.closedOrders.filter((function(t){return t.profit>=0}));return t},getUsedVolume:function(){if(this.closedOrders&&this.openOrders){var t=this.closedOrders.length?this.closedOrders.reduce((function(t,e){return t+e.volume}),0):0,e=this.openOrders.length?this.openOrders.reduce((function(t,e){return t+e.volume}),0):0;return t+e}},getOpenVolume:function(){if(this.openOrders){var t=this.openOrders.length?this.openOrders.reduce((function(t,e){return t+e.volume}),0):0;return t}},getAverTimeForOrder:function(){if(!this.closedOrders||!this.closedOrders.length)return 0;var t=this.closedOrders.map((function(t){return new Date(t.closedDate).getTime()-new Date(t.openDate).getTime()})),e=t.reduce((function(t,e){return t+e}),0),i=e/this.closedOrders.length,o=i/6e4,n=o/60,s=n/24,r=s>=1?"".concat(Math.floor(s)).concat(this.$t("d")," ").concat(Math.floor(s%1*24)).concat(this.$t("h"),"."):Math.floor(n)>=1?"".concat(Math.floor(n)).concat(this.$t("h"),"."):"".concat(Math.floor(o)).concat(this.$t("m"));return r},getSellOrdersCount:function(){return this.getCountProfitOrders&&this.getCountProfitOrders.length?this.getCountProfitOrders.filter((function(t){return"Sell"===t.orderType})).length:0},getBuyOrdersCount:function(){return this.getCountProfitOrders&&this.getCountProfitOrders.length?this.getCountProfitOrders.filter((function(t){return"Buy"===t.orderType})).length:0},getCountClosedOrders:function(){return this.closedOrders&&this.closedOrders.length?this.closedOrders.length:0},getSharp:function(){if("portfolio"===this.statMode){if(!this.getStatData||!this.getStatData.myStat.length)return 0;var t=[];return this.getStatData.myStat.forEach((function(e){t.push(e.data.length?e.data.at(-1).sharp:0)})),t.reduce((function(t,e){return t+e}),0)}return this.getStatistics?this.getStatistics.efficiency.sharp:0},getSellNegativeOrders:function(){return this.getCountNegativeOrders.length?this.getCountNegativeOrders.filter((function(t){return"Sell"===t.orderType})).length:0},getBuyNegativeOrders:function(){return this.getCountNegativeOrders.length?this.getCountNegativeOrders.filter((function(t){return"Buy"===t.orderType})).length:0},getCountNegativeOrders:function(){if(!this.closedOrders||!this.closedOrders.length)return[];var t=this.closedOrders.filter((function(t){return t.profit<0}));return t},getPercentProfitOrders:function(){if(!this.getCountProfitOrders||!this.getCountProfitOrders.length)return 0;var t=100*this.getCountProfitOrders.length/this.closedOrders.length;return t},getMaxDDOnOrder:function(){if(!this.closedOrders||!this.closedOrders.length)return 0;var t=this.closedOrders.filter((function(t){return t.profit<0}));if(!t.length)return 0;var e=t.map((function(t){return 100*t.profit/t.volume}));return Math.max.apply(null,e)},getAverProfitOnClosedOrder:function(){if(!this.closedOrders||!this.closedOrders.length)return 0;var t=this.closedOrders.filter((function(t){return t.profit>=0}));if(!t.length)return 0;var e=t.reduce((function(t,e){return t+e.profit}),0);return e/t.length},getCommision:function(){if(!this.clearProfit||this.clearProfit<0)return 0;var t=33*this.clearProfit/100;return t},startBalance:function(){var t;if(!this.getStatistics)return 0;if("portfolio"===this.statMode&&!this.findPortfolio)return 0;var e,i="portfolio"===this.statMode?this.findPortfolio.startDateTime:this.getStartDateInvesting;return this.getStatistics.accountDaily.length?(e=i?this.getStatistics.accountDaily.find((function(t){return new Date(i).getFullYear()===new Date(t.date).getFullYear()&&new Date(i).getMonth()===new Date(t.date).getMonth()&&new Date(i).getDate()===new Date(t.date).getDate()})):this.getStatistics.accountDaily.at(-1),null===(t=e)||void 0===t?void 0:t.balanceClose):this.getStatistics.account.balance},balance:function(){return this.getStatistics?this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).balanceClose:this.getStatistics.account.balance:0},equity:function(){return this.getStatistics?this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity:0},maxLeverage:function(){return this.getDefaultAccount.maxLeverage},availableAmount:function(){return Lm(this.getDefaultAccount.equity*this.maxLeverage,2,!0)},investmentAmount:function(){return this.findPortfolio.investMoney},investmentAmountFormatted:function(){return Lm(this.investmentAmount,2,!0)},percentByOneContract:function(){return Lm(100/this.findPortfolio.sources.length,2,!0)},getAllPips:function(){if(this.statFullData)return this.statFullData[0].sumPipByOrders},getProfitFactor:function(){if(this.statFullData)return this.statFullData[0].profitFactor},getRecoveryFactor:function(){if(this.statFullData)return this.statFullData[0].recoveryFactorRound},moneyByExpert:function(){return Lm(100/this.findPortfolio.sources.length/100*this.investmentAmount,2,!0)},dataList:function(){return[{color:this.clearProfit<0?this.getRedColor.color:this.getGreenColor.color,title:"net_profit",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.clearProfit,2)),tooltip:"poct"},{color:this.getBlueColor.color,title:"initial_balance",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.startBalance,2)),tooltip:"ubats"},{color:this.getBlueColor.color,title:"current_balance",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.balance,2)),tooltip:"ucb"},{color:this.getGreenColor.color,title:"equity",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.equity,2)),tooltip:"eitmt"},{style:{fontWeight:700},title:"total_trades",value:this.getCountClosedOrders,tooltip:"total_trades"},{color:this.getPercentProfitOrders<30?this.getRedColor.color:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor.color:this.getGreenColor.color,style:{fontWeight:700},title:"post",value:"".concat(Math.round(this.getPercentProfitOrders),"%"),tooltip:"pocto"},{color:this.getPercentProfitOrders<30?this.getRedColor.color:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor.color:this.getGreenColor.color,title:"profitable_trades",style:{fontWeight:700},value:this.getCountProfitOrders.length,tooltip:"Количество закрытых сделок, по которым была зафиксированна прибыль"},{style:{marginLeft:"12px"},color:this.getRedColor.color,title:"positions_for_selling",value:this.getSellOrdersCount,tooltip:"Количество сделок на продажу от числа прибыльных"},{style:{marginLeft:"12px"},color:this.getGreenColor.color,title:"positions_for_buying",value:this.getBuyOrdersCount,tooltip:"Количество сделок на покупку от числа прибыльных"},{title:"unprofitable_trades",style:{fontWeight:700},value:this.getCountNegativeOrders.length,tooltip:"Количество сделок, по которым зафиксирован убыток"},{style:{marginLeft:"12px"},color:this.getRedColor.color,title:"positions_for_selling",value:this.getSellNegativeOrders,tooltip:"Количество сделок на продажу от числа убыточных"},{style:{marginLeft:"12px"},color:this.getGreenColor.color,title:"positions_for_buying",value:this.getBuyNegativeOrders,tooltip:"Количество сделок на покупку от числа убыточных"},{color:this.getSharp<0?this.getRedColor.color:this.getGreenColor.color,title:"the_sharpe_ratio",value:this.$moneyf(this.getSharp,2),tooltip:"arfta"},{color:this.getRedColor.color,title:"maximum_balance_drawdown",value:"% ".concat(this.$moneyf(Math.abs(this.getMaxDDOnOrder),2)),tooltip:"ambrf"},{color:this.getGreenColor.color,title:"mathematical_expectation",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getAverProfitOnClosedOrder,2)),tooltip:"sotpo"},{color:this.getAllPips>0?this.getGreenColor.color:this.getRedColor.color,title:"tpoi",value:this.$moneyf(this.getAllPips,0),tooltip:"oipp"},{color:this.getProfitFactor>1?this.getGreenColor.color:this.getRedColor.color,title:"profit_factor",value:this.$moneyf(this.getProfitFactor,2),tooltip:"rotro"},{title:"recovery_factor",value:this.getRecoveryFactor,tooltip:"rotap"},{title:"average_trade_length",value:this.getAverTimeForOrder,tooltip:"altoa"},{title:"funds_turnover",value:"".concat(this.getCryptoStatus?"Qty":this.getCurrencyChar," ").concat(this.$moneyf(this.getUsedVolume,0)),tooltip:"sovot"},{title:"trading_volume",value:"".concat(this.getCryptoStatus?"Qty":this.getCurrencyChar," ").concat(this.$moneyf(this.getOpenVolume,0)),tooltip:"votuf"},{title:"fee",value:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getCommision,2)),tooltip:"fcftu"}]}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},getFullStatData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.getDefaultAccount){e.next=2;break}return e.abrupt("return");case 2:return t.statData=null,i={AccountId:t.getDefaultAccount.id,SubscriptionId:"portfolio"===t.statMode?t.getSubscriptionsBySource:t.getAllSubscriptions},e.next=6,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 6:o=e.sent,t.$http.post("".concat(t.apiUrl,"GetAccountShortStatistic"),i,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o,"Content-type":"application/json"}}).then((function(e){e.data&&e.data.data.length&&(t.statFullData=e.data.data,t.$emit("setStatisitc",t.statFullData))}));case 8:case"end":return e.stop()}}),e)})))()}},mounted:function(){var t=this;if(this.getFullStatData(),"portfolio"===this.statMode)this.closedOrders=this.closedOrdersPortfolio,this.openOrders=this.openOrdersPortfolio;else if(this.$orderStorage.getOrdersOnStorage()){var e=this.$orderStorage.getOrdersOnStorage();this.closedOrders=e.closedOrders.filter((function(e){return t.getAllSubscriptions.some((function(t){return e.subscriptionId===t}))})),this.$emit("setClosedOrders",this.closedOrders),this.openOrders=e.tradingOrders.filter((function(e){return t.getAllSubscriptions.some((function(t){return e.subscriptionId===t}))}))}}},XDt=YDt,QDt=(i("8aa53"),Object(C["a"])(XDt,qDt,zDt,!1,null,"0118ec9e",null)),JDt=QDt.exports,KDt=function(){var t=this,e=t._self._c;return e("div",{class:"AccordionStatBlock AccordionStatBlock_".concat(t.getActiveTheme)},[t.showAccordion?e("DxAccordion",{attrs:{items:t.getAccordionTabs,selectedItems:[],collapsible:!0,focusStateEnabled:!1,hoverStateEnabled:!1,"item-template":"accordionItem","item-title-template":"accordionTitle"},scopedSlots:t._u([{key:"accordionTitle",fn:function(i){var o=i.data;return[e("div",[t._v(t._s(o.tabName))])]}},{key:"accordionItem",fn:function(i){var o=i.data;return[e("div",{staticClass:"AccordionStatBlock-statDat"},[e("AccordionData",{attrs:{typeStat:o.data}}),1===o.ID&&t.getStatusPorvider&&"Created"!==t.getStatusBag?e("div",{staticClass:"AccordionStatBlock-comissionBlock"},[e("ProvidersComissionBlock")],1):t._e()],1)]}}],null,!1,591369194)}):t._e()],1)},ZDt=[],tkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AccordionData"},[t._l(t.getAccordionTabs,(function(i,o){return t.getAccordionTabs&&t.getAccordionTabs.length?e("div",{key:o,class:"AccordionData-statItem AccordionData-statItem_".concat(t.getActiveTheme),style:{alignItems:Array.isArray(i.data)?"start":"center"}},[e("div",{class:"AccordionData-statItemLabel AccordionData-statItemLabel_".concat(t.getActiveTheme),on:{mouseenter:function(e){return t.mouseenterHandler(e,i.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(i.label))]),e("hr"),Array.isArray(i.data)?e("div",{class:"AccordionData-statItemData AccordionData-statItemData_".concat(t.getActiveTheme),style:{color:i.color?i.color:""}},t._l(i.data,(function(i,o){return e("div",{key:"".concat(o,"_").concat(i.contract),staticClass:"AccordionData-statItemData-item"},[e("div",[t._v(t._s("".concat(i.contract)))]),e("div",{style:{color:t.getBlueColor.color}},[t._v(t._s("".concat(t.$moneyf(i.volume)," qty")))])])})),0):e("div",{class:"AccordionData-statItemData AccordionData-statItemData_".concat(t.getActiveTheme),style:{color:i.color?i.color:""}},[t._v(t._s(i.data))])]):t._e()})),t.getAccordionTabs&&!t.getAccordionTabs.length?e("div",{class:"AccordionData-statItemData AccordionData-statItemData_".concat(t.getActiveTheme)},[t._v("Вы пока не инвестируете в портфель")]):t._e(),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.tooltipText))])],2)},ekt=[],ikt={props:{typeStat:{type:String,default:"manager"}},mixins:[qe,Ot],data:function(){return{portfolioStat:null,tooltipText:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingStatData:"expertsPortfolio/isLoadingStatData",getStatData:"statDataForPortfolio/getStatData",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",fullListSubscription:"subscriptionsContract/fullListSubscription",findPortfolio:"expertsPortfolio/findPortfolio",closedOrders:"statDataForPortfolio/closedOrders",openOrders:"statDataForPortfolio/openOrders",getActiveTheme:"headerSettings/getActiveTheme",apiUrl:"api/api",getSession:"auth/getSession"})),{},{getEquity:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getSubscriptionsBySource:function(){var t=this;if(this.findPortfolio&&this.fullListSubscription){var e="Active"===this.findPortfolio.status?this.allSubscriptionCurrentDate:this.fullListSubscription,i=e.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}));return i}},getTypeManegePortfolio:function(){if(this.getSubscriptionsBySource){var t=this.getSubscriptionsBySource[0].subscription.signalVolumeType;return"Percent"===t?this.$t("dynamic"):this.$t("fixed")}},getVolumeOnOrder:function(){return this.getCryptoStatus?this.getVolumeCryptoOnOrder:this.getVolumeForexOnOrder},getVolumeCryptoOnOrder:function(){if(this.getSubscriptionsBySource){var t=this.getSubscriptionsBySource.map((function(t){return{contract:t.contract,volume:t.subscription.signalVolume}}));return t}},getVolumeForexOnOrder:function(){if(this.getSubscriptionsBySource){var t=this.getSubscriptionsBySource[0].subscription.signalVolume;return"".concat(this.getCurrencyChar," ").concat(this.$moneyf(t))}},getCountOrdersOnPortfolio:function(){if(this.getSubscriptionsBySource){var t=this.getSubscriptionsBySource[0].subscription.maxOpenPositions;return t*this.getSubscriptionsBySource.length}},getCountOrdersOnProvider:function(){if(this.getSubscriptionsBySource){var t=this.getSubscriptionsBySource[0].subscription.maxOpenPositions;return t}},getDDMaxPercentPortfolio:function(){if(this.getSubscriptionsBySource){var t=this.getEquityForProtfolio,e=this.getSubscriptionsBySource[0].subscription.ddMax;return Lm(100-e/(t*this.getInvestLeverage)*100,2,!0)}},getBalnceForProviders:function(){if(!this.getEquityForProtfolio||!this.openOrders)return 0;if(this.openOrders.length){var t=this.openOrders.reduce((function(t,e){return t+e.volume}),0);return this.getEquityForProtfolio-t}return this.getEquityForProtfolio},getStatForManagePortfolio:function(){return this.allSubscriptionCurrentDate&&this.findPortfolio&&this.getSubscriptionsBySource.length?[{label:this.$t("allocated_funds"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getEquityForProtfolio,2)),tooltip:this.$t("caafi")},{label:this.$t("leverage_full"),data:"1/".concat(this.getInvestLeverage),tooltip:this.$t("caafi")},{label:this.$t("volume_per_trade"),data:this.getVolumeOnOrder,tooltip:this.$t("vapot")},{label:this.$t("cnot"),data:this.$moneyf(this.getCountOrdersOnPortfolio),tooltip:this.$t("notca")},{label:this.$t("tttp"),data:this.$moneyf(this.getCountOrdersOnProvider),tooltip:this.$t("notcat")},{color:this.getGreenColor.color,label:this.$t("funds_left"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getResiduePortfolio,2)),tooltip:this.$t("ftwrw")},{color:this.getRedColor.color,label:this.$t("possible_loss"),data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getLossPortfolio,2)),tooltip:this.$t("aoftd")}]:[]},getInvestLeverage:function(){if(this.findPortfolio)return this.findPortfolio.investLeverage},getEquityForProtfolio:function(){if(this.findPortfolio)return this.findPortfolio.investMoney},getLossPortfolio:function(){if(!this.getSubscriptionsBySource)return 0;var t=this.getEquityForProtfolio-this.getResiduePortfolio;return t},getResiduePortfolio:function(){return this.getSubscriptionsBySource?this.getSubscriptionsBySource[0].subscription.ddMax:0},getAllCountClosedOrders:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.ordersCount}),0):0},getAllCountProfitOrders:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.positiveOrdersCount}),0):0},getAllCountNegativeOrders:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.negativeOrdersCount}),0):0},getProfitOrdersPortfolioOnBuy:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.positiveBuyOrdersCount}),0):0},getProfitOrdersPortfolioOnSell:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.positiveSellOrdersCount}),0):0},getNegativeOrdersPortfolioOnBuy:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.negativeBuyOrdersCount}),0):0},getNegativeOrdersPortfolioOnSell:function(){return this.portfolioStat&&this.portfolioStat.length?this.portfolioStat.reduce((function(t,e){return t+e.negativeSellOrdersCount}),0):0},getStatForPortfolio:function(){if(this.getStatData&&this.getStatData.statSubs.length){var t=this.getAllCountProfitOrders&&this.getAllCountClosedOrders?100*this.getAllCountProfitOrders/this.getAllCountClosedOrders:0;return[{label:this.$t("total_trades"),data:this.getAllCountClosedOrders,color:this.getBlueColor.color,tooltip:this.$t("notco")},{label:this.$t("profitable_trades"),data:"".concat(this.getAllCountProfitOrders," (").concat(Math.round(t),"%)"),color:t<30?this.getRedColor.color:t>30&&t<60?this.getOrangeColor.color:this.getGreenColor.color,tooltip:this.$t("napot")},{label:this.$t("positions_for_buying"),data:this.getAllCountProfitOrders&&this.getProfitOrdersPortfolioOnBuy?"".concat(this.getProfitOrdersPortfolioOnBuy," (").concat(Math.round(100*this.getProfitOrdersPortfolioOnBuy/this.getAllCountProfitOrders),"%)"):0,tooltip:this.$t("napob")},{label:this.$t("positions_for_selling"),data:this.getAllCountProfitOrders&&this.getProfitOrdersPortfolioOnSell?"".concat(this.getProfitOrdersPortfolioOnSell," (").concat(Math.round(100*this.getProfitOrdersPortfolioOnSell/this.getAllCountProfitOrders),"%)"):0,tooltip:this.$t("napofs")},{label:this.$t("unprofitable_trades"),data:this.getAllCountNegativeOrders&&this.getAllCountClosedOrders?"".concat(this.getAllCountNegativeOrders," (").concat(Math.round(100*this.getAllCountNegativeOrders/this.getAllCountClosedOrders),"%)"):0,tooltip:this.$t("napos")},{label:this.$t("positions_for_buying"),data:this.getAllCountNegativeOrders&&this.getNegativeOrdersPortfolioOnBuy?"".concat(this.getNegativeOrdersPortfolioOnBuy," (").concat(Math.round(100*this.getNegativeOrdersPortfolioOnBuy/this.getAllCountNegativeOrders),"%)"):0,tooltip:this.$t("napobt")},{label:this.$t("positions_for_selling"),data:this.getAllCountNegativeOrders&&this.getNegativeOrdersPortfolioOnSell?"".concat(this.getNegativeOrdersPortfolioOnSell," (").concat(Math.round(100*this.getNegativeOrdersPortfolioOnSell/this.getAllCountNegativeOrders),"%)"):0,tooltip:this.$t("napos")}]}},getAccordionTabs:function(){var t={manager:this.getStatForManagePortfolio,portfolio:this.getStatForPortfolio};return t[this.typeStat]}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},getPortfolioStat:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.findPortfolio.sources.map((function(t){return t.accountId})),o=JSON.stringify({Accounts:i}),e.next=4,t.$workKeys.signMessage(o,t.getSession.sk);case 4:n=e.sent,t.$http.post("".concat(t.apiUrl,"GetOrdersStatisticsByAccounts"),o,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":n,"Content-type":"application/json"}}).then((function(e){t.portfolioStat=[],e.data&&e.data.length?t.findPortfolio.sources.forEach((function(i){var o=e.data.find((function(t){return i.accountId===t.accountId})),n=o.statistic.find((function(t){return t.contract===i.contract}));t.portfolioStat.push(n)})):t.statusNoStat=!0}));case 6:case"end":return e.stop()}}),e)})))()}},mounted:function(){"portfolio"===this.typeStat&&this.getPortfolioStat()}},okt=ikt,nkt=(i("fb89"),Object(C["a"])(okt,tkt,ekt,!1,null,"33de801e",null)),skt=nkt.exports,rkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProviderComissionBlock"},[e("div",{class:"ProviderComissionBlock-label ProviderComissionBlock-label_".concat(t.getActiveTheme)},[t._v("Комиссии провайдера")]),e("div",{staticClass:"ProviderComissionBlock-content"},[e("div",{staticClass:"ProviderComissionBlock-table"},[e("div",{class:"ProviderComissionBlock-tableHeader ProviderComissionBlock-tableHeader_".concat(t.getActiveTheme)},[e("div",{staticClass:"ProviderComissionBlock-th"},[t._v(t._s(t.$t("instruments")))]),e("div",{staticClass:"ProviderComissionBlock-th"},[t._v(t._s(t.$t("success_rate")))]),e("div",{staticClass:"ProviderComissionBlock-th"},[t._v(t._s(t.$t("fee")))])]),e("div",t._l(t.getSourceProvider,(function(t,i){return e("ProvidersComissionItem",{key:i,attrs:{source:t}})})),1)])])])},akt=[],ckt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProviderComissionItem"},[e("div",{staticClass:"ProviderComissionItem-wrap"},[e("div",{class:"ProviderComissionItem-hrWrap ProviderComissionItem-hrWrap_".concat(t.getActiveTheme)},[e("hr")]),e("div",{staticClass:"ProviderComissionItem-dataWrap"},[e("div",{staticClass:"ProviderComissionItem-name"},[e("div",{class:"ProviderComissionItem-name_wrap ProviderComissionItem-name_wrap_".concat(t.getActiveTheme)},[e("div",{class:"ProviderComissionItem-name_contract ProviderComissionItem-name_contract_".concat(t.getActiveTheme)},[t._v(t._s(t.source.contract))])])]),e("div",{class:"ProviderComissionItem-successfulTransactions ProviderComissionItem-successfulTransactions_".concat(t.getActiveTheme),style:{color:t.getColorProfitOrders}},[e("div",[t._v(t._s("".concat(Math.round(t.getPercentProfitOrders),"%")))])]),e("div",{class:"ProviderComissionItem-comission ProviderComissionItem-comission_".concat(t.getActiveTheme),style:{color:t.getGreenColor.color}},[e("div",[t._v(t._s(t.getComission))])])])])])},lkt=[],ukt={props:{source:{type:Object}},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatData:"statDataForPortfolio/getStatData",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getStatProvider:function(){var t=this;if(this.getStatData)return this.getStatData.statSubs.find((function(e){return e.login===t.source.accountId&&e.symbol===t.source.contract}))},getPercentProfitOrders:function(){if(!this.getStatProvider)return 0;var t=this.getStatProvider.data.at(-1)[10],e=this.getStatProvider.data.at(-1)[11];return t&&e?100*e/t:0},getColorProfitOrders:function(){return this.getPercentProfitOrders?this.getPercentProfitOrders<20?this.getRedColor.color:this.getPercentProfitOrders>20&&this.getPercentProfitOrders<60?this.getOrangeColor.color:this.getGreenColor.color:this.getRedColor.color},getComission:function(){return null!==this.source.monthPrice&&null===this.source.profitPercent?"$ ".concat(this.$moneyf(this.source.monthPrice)):null===this.source.monthPrice&&null!==this.source.profitPercent?"".concat(this.$moneyf(this.source.profitPercent),"%"):null!==this.source.monthPrice&&null!==this.source.profitPercent?"".concat(this.$moneyf(this.source.profitPercent,0),"% | $ ").concat(this.$moneyf(this.source.monthPrice,0)):null===this.source.monthPrice&&null===this.source.profitPercent?0:void 0}})},dkt=ukt,hkt=(i("a69c"),Object(C["a"])(dkt,ckt,lkt,!1,null,"4b4e7b36",null)),pkt=hkt.exports,gkt={components:{ProvidersComissionItem:pkt},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getSourceProvider:function(){if(this.findPortfolio)return this.findPortfolio.sources}})},fkt=gkt,mkt=(i("f6aa"),Object(C["a"])(fkt,rkt,akt,!1,null,"940e95a4",null)),vkt=mkt.exports,ykt={components:{DxAccordion:lw["DxAccordion"],AccordionData:skt,ProvidersComissionBlock:vkt},mixins:[Xh],data:function(){return{showAccordion:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",findPortfolio:"expertsPortfolio/findPortfolio"})),{},{getStatusBag:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getStatusPorvider:function(){if(this.findPortfolio)return"Signal"===this.findPortfolio.type},getAccordionTabs:function(){return"Created"===this.getStatusBag?[{ID:1,tabName:this.$t("portfolio_statistics"),data:"portfolio"}]:[{ID:2,tabName:this.$t("risk_management"),data:"manager"}]}}),methods:{setShowStatusAccordion:function(){this.showAccordion=!0}},mounted:function(){this.debouncer("setShowStatusAccordion",250)}},Ckt=ykt,bkt=(i("195d"),Object(C["a"])(Ckt,KDt,ZDt,!1,null,"5603c761",null)),Skt=bkt.exports,Pkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ExpertsTabBlock",class:t.darkClass},[t.commonDataStatic?e("div",{staticClass:"tableExperts"},[e("div",{staticClass:"tableHeader"},[e("div",{staticClass:"th"},[t._v(t._s(t.$t("instruments")))]),e("div",{staticClass:"th"},[t._v(t._s(t.$t("open_trades")))]),e("div",{staticClass:"th"},[t._v(t._s(t.$t("closed_trades")))])]),t._l(t.commonDataStatic,(function(i,o){return e("ExpertData",{key:o,attrs:{expert:i,currencyChar:t.getCurrencyChar,last:o===t.commonDataStatic.length-1,onlyOneInstrument:1===i.profits.length}})}))],2):t._e(),e("div",{class:"ExpertsTabBlock-profit ExpertsTabBlock-profit_".concat(t.getActiveTheme)},[e("div",{class:"ExpertsTabBlock-profitTitle ExpertsTabBlock-profitTitle_".concat(t.getActiveTheme)},[t._v("Итог")]),e("div",{staticClass:"ExpertsTabBlock-profitData",style:{color:t.getFloatingProfit<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("$ ".concat(this.$moneyf(t.getFloatingProfit,Math.abs(t.getFloatingProfit)>=1e4?0:2))))]),e("div",{staticClass:"ExpertsTabBlock-profitData",style:{color:t.getFixProfit<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("$ ".concat(this.$moneyf(t.getFixProfit,Math.abs(t.getFixProfit)>=1e4?0:2))))])]),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.hintTextStatBlock))])],1)},Tkt=[],xkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ExpertData",class:Object(c["a"])({last:t.last},t.darkClass),style:{"--color-value":t.valueColor}},[e("div",{staticClass:"tbody"},[e("div",{staticClass:"td"},[e("div",{staticClass:"wrapImage",on:{mouseenter:t.mouseenterHandler,mouseleave:t.mouseleaveHandler}},[e("img",{staticClass:"avatar",attrs:{src:t.expert.provider.avatar}})]),e("div",{staticClass:"wrapperName"},[e("span",{staticClass:"name",attrs:{title:t.expert.provider.name}},[t._v(t._s(t.expert.provider.name))]),e("span",{staticClass:"accountSequenceId"},[t._v(t._s(t.expert.provider.accountSequenceId))])])]),e("div",{staticClass:"td income"},[t.onlyOneInstrument?t._e():e("div",{key:t.currentProfit,staticClass:"incomeValue",class:t.currentProfitClass,attrs:{title:t.$moneyf(t.currentProfit)}},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.currentProfit,Math.abs(t.currentProfit)>1e3?0:2))))])]),e("div",{staticClass:"td income"},[t.onlyOneInstrument?t._e():e("div",{staticClass:"incomeValue",class:t.averageMonthClass,attrs:{title:t.$moneyf(t.fixProfit)}},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.fixProfit,Math.abs(t.fixProfit)>1e3?0:2))))])])]),t._l(t.expert.profits,(function(i){return e("InstrumentsByAccount",{attrs:{instrument:i.symbol,currencyChar:t.currencyChar,profit:i,accountId:t.expert.provider.accountId,onlyOneInstrument:t.onlyOneInstrument}})}))],2)},Okt=[],wkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InstrumentsByAccount",class:t.rootClass},[e("div",{staticClass:"name"},[e("span",{staticClass:"instrumentName"},[t._v(t._s(t.instrument))]),e("hr")]),t.profit?e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"value",class:t.profit.currentProfit<0?"red":"green"},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.profit.currentProfit,2))))]),e("hr")]):t._e(),t.profit?e("div",{staticClass:"averageIncome"},[e("div",{staticClass:"value",class:t.profit.fixProfit<0?"red":"green"},[t._v(t._s("".concat(t.currencyChar," ").concat(t.$moneyf(t.profit.fixProfit,2))))])]):t._e()])},_kt=[],Akt={name:"InstrumentsByAccount",mixins:[xt],props:{instrument:{type:String},currencyChar:{type:String},accountId:{type:String},profit:{type:Object}},computed:{rootClass:function(){return Object(c["a"])({},this.darkClass)}}},Dkt=Akt,kkt=(i("53fa"),Object(C["a"])(Dkt,wkt,_kt,!1,null,"3ce0d6f0",null)),Ikt=kkt.exports,Bkt={name:"ExpertData",mixins:[rT,xt],props:{expert:{type:Object},last:{type:Boolean},onlyOneInstrument:{type:Boolean},currencyChar:{type:String}},components:{InstrumentsByAccount:Ikt},data:function(){return{commonDataStatic:[]}},computed:{valueColor:function(){return this.darkClass.dark?"#00ffac":"#008E72"},averageMonthClass:function(){return{green:this.fixProfit>=0,red:this.fixProfit<0}},fixProfit:function(){return this.expert.profits.reduce((function(t,e){return t+e.fixProfit}),0)},currentProfit:function(){return this.expert.profits.reduce((function(t,e){return t+e.currentProfit}),0)},currentProfitClass:function(){return{green:this.currentProfit>=0,red:this.currentProfit<0}}},methods:{mouseenterHandler:function(t){this.mouseEnterFunction(t,{imageForSource:this.expert.provider.avatar,nameSource:this.expert.provider.name,accountId:this.expert.provider.accountId,noActiveButton:!0,locationCall:"portfolio",position:"right"})},mouseleaveHandler:function(){this.mouseLeaveFunction()}}},Mkt=Bkt,$kt=(i("f107"),Object(C["a"])(Mkt,xkt,Okt,!1,null,"6e3e1c5a",null)),Lkt=$kt.exports,Fkt={name:"ExpertsTabBlock",mixins:[xt,Ot,qe],props:{owner:{type:Boolean,default:!0},activeDate:{type:[String,Date],default:""}},data:function(){return{commonDataStatic:null,directionArrow:null}},components:{ExpertData:Lkt},watch:{isLoadingOrders:function(t){t||this.setAllProfit(this.openOrders)},getAbsoluteProfit:function(t,e){void 0!==t&&void 0!==e&&(this.directionArrow=e>t?"down":"up")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolioMembers:"expertsPortfolio/findPortfolioMembers",getActiveTab:"expertsPortfolio/getActiveTab",getStatData:"statDataForPortfolio/getStatData",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",getStatistics:"statistic/getStatistics",findPortfolio:"expertsPortfolio/findPortfolio",isLoadingOrders:"statDataForPortfolio/isLoadingOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",isLoadingStatData:"expertsPortfolio/isLoadingStatData",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getStatusBag:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getInvestMoney:function(){return this.findPortfolio.investMoney},getSubscriptionsByBag:function(){var t=this;return this.allSubscriptionCurrentDate.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}))},getDirectionArrow:function(){if(this.directionArrow)return this.directionArrow;var t=this.getAbsoluteProfit<0?"down":"up";return t},getPercentAbsProfit:function(){return this.getAbsoluteProfit?100*this.getAbsoluteProfit/this.getInvestMoney:0},getFloatingProfit:function(){if(this.commonDataStatic&&this.commonDataStatic.length){var t=this.commonDataStatic.reduce((function(t,e){return t+e.profits.reduce((function(t,e){return t+e.currentProfit}),0)}),0);return t}},getFixProfit:function(){if(this.commonDataStatic&&this.commonDataStatic.length){var t=this.commonDataStatic.reduce((function(t,e){return t+e.profits.reduce((function(t,e){return t+e.fixProfit}),0)}),0);return t}},getAbsoluteProfit:function(){if(this.commonDataStatic&&this.commonDataStatic.length)return this.getFixProfit+this.getFloatingProfit},expertsForStat:function(){if(!this.isLoadingStatData)return this.owner?this.getStatData.myStat:this.getStatData.statSubs},hintTextStatBlock:function(){switch(this.selector){case".sucMonth":return"% Успешных месяцев";case".sucTrans":return"% Успешных сделок";case".perfomanceFee":return"Performance Fee";case".managementFee":return"Management Fee";default:return"No text for tooltip"}}}),methods:{getSubscriptionsBySource:function(t,e){var i=this,o=this.allSubscriptionCurrentDate.filter((function(t){return t.subscription.bagId===i.findPortfolio.id}));return o.length?o.find((function(i){return i.contract===t&&i.sourceAccountId===e})):o.length},setAllProfit:function(t){var e=this;this.findPortfolioMembers&&(this.commonDataStatic=[],this.findPortfolioMembers.forEach((function(i){var o=[];i.instruments.forEach((function(n){var s=e.getSubscriptionsBySource(n,i.accountId),r=s?s.subscription.id:0,a=t.length?t.filter((function(t){return+t.subscriptionId===r})):[],c="Signal"!==e.findPortfolio.type?e.closedOrders.filter((function(t){return+t.subscriptionId===r})):e.closedOrders.filter((function(t){return t.contractName===n}));o.push({symbol:n,fixProfit:e.owner&&!e.activeDate?c.reduce((function(t,e){return t+e.profit}),0):e.getStatForDay(i.accountId,n,"fix"),currentProfit:e.owner&&!e.activeDate?a.reduce((function(t,e){return t+e.profit}),0):e.getStatForDay(i.accountId,n,"float")})})),e.commonDataStatic.push({provider:i,profits:o})})),this.$emit("updateProfitsPortfolio",this.commonDataStatic))},getStatForDay:function(t,e,i){var o=this,n=this.expertsForStat.find((function(i){return i.login===t&&i.symbol===e}));if(!n||!n.data.length)return 0;var s=n.data.find((function(t){return 2===t.statType&&new Date(o.activeDate).getFullYear()===new Date(t.date).getFullYear()&&new Date(o.activeDate).getMonth()===new Date(t.date).getMonth()&&new Date(o.activeDate).getDate()===new Date(t.date).getDate()}));return s?"fix"===i?s.profitClose:s.floatingProfitClose:0},setMessageHandler:function(t){var e=this;if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){var i;if(this.activeDate||"Active"!==(null===(i=this.findPortfolio)||void 0===i?void 0:i.status))return;var o=t.data[0].openOrders.tradingOrders,n=this.openOrders;if(o&&n)if(o.length&&n.length){var s=o.filter((function(t){return e.getSubscriptionsByBag.some((function(e){return e.subscription.id===+t.subscriptionId}))}));this.setAllProfit(s)}else this.setAllProfit([])}}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.isLoadingOrders||this.setAllProfit(this.openOrders)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},jkt=Fkt,Rkt=(i("23e0"),Object(C["a"])(jkt,Pkt,Tkt,!1,null,"21859313",null)),Wkt=Rkt.exports,Nkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CountSourceOrders"},[e("div",{staticClass:"CountSourceOrders-title",class:"CountSourceOrders-title_".concat(t.getActiveTheme),on:{mouseenter:function(e){t.viewTooltipHandler(e,t.$t("oropa"))},mouseleave:t.hideTooltip}},[e("div",{staticClass:"CountSourceOrders-text"},[t._v(t._s(t.$t("lbt"))+" ")]),e("div",{staticClass:"CountSourceOrders-limit"},[t._v(t._s("".concat(t.getAllOpenOrdersByPortfolio," ").concat(t.$t("oo")," ").concat(t.getTotalOrdersCount)))])]),e("div",{staticClass:"CountSourceOrders-providers"},t._l(t.getProviders,(function(i,o){return e("div",{key:o,staticClass:"CountSourceOrders-provider"},[e("div",{staticClass:"CountSourceOrders-providerWrap"},[e("div",{staticClass:"CountSourceOrders-avatar"},[e("Avatar",{attrs:{src:i.avatar,size:"2",theme:t.getActiveTheme}})],1),e("div",{staticClass:"CountSourceOrders-providerData"},[e("div",{staticClass:"CountSourceOrders-name",class:"CountSourceOrders-name_".concat(t.getActiveTheme)},[t._v(t._s(i.name))]),e("div",{staticClass:"CountSourceOrders-sequence",class:"CountSourceOrders-sequence_".concat(t.getActiveTheme)},[t._v(t._s(i.sequence))])])]),e("div",{staticClass:"CountSourceOrders-sourceWrap"},t._l(i.sources,(function(i,o){return e("div",{key:"".concat(o,"_source"),staticClass:"CountSourceOrders-source"},[e("div",{staticClass:"CountSourceOrders-sourceContractWrap"},[e("div",{staticClass:"CountSourceOrders-sourceContract",class:"CountSourceOrders-sourceContract_".concat(t.getActiveTheme)},[t._v(t._s(i.contract))])]),e("div",{staticClass:"CountSourceOrders-progressBarWrap"},[e("div",{staticClass:"CountSourceOrders-progressBarTitle",class:"CountSourceOrders-progressBarTitle_".concat(t.getActiveTheme)},[t._v(t._s("".concat(i.count," ").concat(t.$t("oo")," ").concat(i.totalCount," / ").concat(t.$moneyf(i.volume)," ").concat(t.getCryptoStatus?"Qty":t.getCurrencyChar)))]),e("div",{staticClass:"CountSourceOrders-progressBar",class:"CountSourceOrders-progressBar_".concat(t.getActiveTheme)},[e("div",{staticClass:"CountSourceOrders-progressBarItem",style:{width:t.getPercentBar(i.percent),background:t.getColorBar(i.percent)}})])])])})),0)])})),0),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},Ekt=[],Ukt={components:{Avatar:E,DxTooltip:wt["DxTooltip"]},mixins:[qe,Ot],data:function(){return{openOrders:null,textTooltip:""}},watch:{getStatByOrders:function(t){t&&(this.openOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme",getStatByOrders:"contracts/getStatByOrders",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getTotalOrdersCount:function(){if(this.findPortfolio)return this.findPortfolio.bagContents.reduce((function(t,e){return t+e.maxOpenPositions}),0)},getAllOpenOrdersByPortfolio:function(){var t=this;if(this.findPortfolio&&this.openOrders){var e=this.allSubscriptionCurrentDate.filter((function(e){return e.subscription.bagId===t.findPortfolio.id})).map((function(t){return t.subscription.id})),i=this.openOrders.filter((function(t){return e.some((function(e){return+t.subscriptionId===e}))}));return i.length}},getProviders:function(){var t=this;if(this.findPortfolio&&this.openOrders){var e=Object(x["a"])(new Set(this.findPortfolio.sources.map((function(t){return t.accountId})))),i=[];return e.forEach((function(e){var o=t.findPortfolio.sources.find((function(t){return t.accountId===e})),n=t.findPortfolio.sources.filter((function(t){return t.accountId===e})),s=[];n.forEach((function(e){var i=t.findPortfolio.bagContents.find((function(t){return t.sourceId===e.id})),o=i.maxOpenPositions,n=0,r=t.allSubscriptionCurrentDate.find((function(i){return i.sourceId===e.id&&i.subscription.bagId===t.findPortfolio.id}));if(r){var a=r.subscription.id,c=t.openOrders.filter((function(t){return+t.subscriptionId===a}));c&&(n=c.reduce((function(t,e){return t+e.volume}),0)),s.push({contract:e.contract,totalCount:o,count:c.length,volume:n,percent:c&&c.length?100*c.length/o:0})}})),i.push({name:"".concat(o.userInfo.firstName," ").concat(o.userInfo.lastName),avatar:o.userInfo.avatarURL,sequence:o.accountSequenceId,sources:s})})),i}}}),methods:{viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},getPercentBar:function(t){return t<1&&0!==t?"1%":0===t?"0%":"".concat(t,"%")},setMessageHandler:function(t){null!==t&&void 0!==t&&t.command&&"BrokerPosition"===t.command&&(this.openOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders)},getColorBar:function(t){var e;switch(!0){case t<=50:e=this.getGreenColor.color;break;case t>50&&t<=65:e=this.getYellowColor.color;break;case t>65&&t<=75:e=this.getOrangeColor.color;break;case t>75:e=this.getRedColor.color;break}return e}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$orderStorage&&(this.openOrders=this.$orderStorage.getOrdersOnStorage().tradingOrders)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},Vkt=Ukt,Hkt=(i("18b0"),Object(C["a"])(Vkt,Nkt,Ekt,!1,null,"e3f36f2e",null)),Gkt=Hkt.exports,qkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"WidgetsBlock"},[e("StatDataContainer",{attrs:{title:"Доход по закрытым сделкам"}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"WidgetsBlock-profitData"},[e("StatWidgetWithGradient",{attrs:{color:t.getPofitByCloseOrders<0?t.getRedColor.color:t.getLemonColor.color,data:t.getPofitByCloseOrders,symbol:t.getCurrencyChar,gradient:t.getPofitByCloseOrders<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.getDirectionCloseProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getCalcRelCloseProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcRelCloseProfit,symbol:"%",gradient:t.getCalcRelCloseProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Текущий доход портфеля"}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"WidgetsBlock-profitData",style:{color:t.getCurrentProfit<0?t.getRedColor.color:t.getGreenColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getCurrentProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCurrentProfit,symbol:t.getCurrencyChar,gradient:t.getCurrentProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionCurrentProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getCurrentRelProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCurrentRelProfit,symbol:"%",gradient:t.getCurrentRelProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Доход портфеля за ".concat(t.getServerTime?new Date(t.getServerTime.now).toLocaleDateString("ru"):(new Date).toLocaleDateString("ru"))}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"WidgetsBlock-profitData",style:{color:t.getProfitOnDay<0?t.getRedColor.color:t.getGreenColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getProfitOnDay<0?t.getRedColor.color:t.getLemonColor.color,data:t.getProfitOnDay,symbol:t.getCurrencyChar,gradient:t.getProfitOnDay<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionCurrentProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getProfitRelOnDay<0?t.getRedColor.color:t.getLemonColor.color,data:t.getProfitRelOnDay,symbol:"%",gradient:t.getProfitRelOnDay<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Доход портфеля за 20 дней"}},[e("GistogramLeftBarWidget",{attrs:{pointsForGistogramm:t.getPointsForGistogramm}})],1),e("StatDataContainer",{attrs:{title:"Участнкики Портфеля"}},[e("ParticipantsPortfolio")],1),e("StatDataContainer",{attrs:{title:"Доход Портфеля"}},[e("PortfolioContractsProfits",{attrs:{statProfitsPortfolio:t.statProfitsPortfolio}})],1)],1)},zkt=[],Ykt={computed:{getAllStatByDays:function(){if(!this.getStatData.myStat||!this.getStatData.myStat.length){if(!this.openOrders.length&&!this.closedOrders.length)return;return[{date:new Date,profitOpen:0,profitClose:this.getPofitByCloseOrders,floatingProfitOpen:0,floatingProfitClose:this.profitByOpenOrders}]}var t=[];this.getStatData.myStat.forEach((function(e){e.data.length&&t.push(e.data.filter((function(t){return 2===t.statType})))})),t.every((function(t){return!t.length}))&&this.getStatData.myStat.forEach((function(e){if(e.data.length){var i=e.data.filter((function(t){return 1===t.statType}));t.push([i[0]])}}));var e=this.compineStat(t);return e}},methods:{compineStat:function(t){var e={};return t.forEach((function(t){t.length&&t.forEach((function(t){var i=new Date(t.date).getTime();e[i]?(e[i][0].push(t.profitOpen),e[i][1].push(t.profitClose),e[i][2].push(t.floatingProfitOpen),e[i][3].push(t.floatingProfitClose)):e[i]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]}))})),Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}}))}}},Xkt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ParticipantsPortfolio"},[e("div",{staticClass:"ParticipantsPortfolio-avatars"},t._l(t.getAvatars,(function(i,o){return e("div",{key:o,staticClass:"ParticipantsPortfolio-avatars-item"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"3.4"}})],1)})),0),e("div",{staticClass:"ParticipantsPortfolio-contracts"},t._l(t.getContractsSymbols,(function(i,o){return e("div",{key:o,staticClass:"ParticipantsPortfolio-contracts-item",style:{background:t.getBlueColor.color}},[t._v(t._s(i.logo))])})),0)])},Qkt=[],Jkt={components:{Avatar:E},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme",getTradingInstruments:"contracts/getTradingInstruments",getTradingAssets:"contracts/getTradingAssets",getContracts:"contracts/getContracts"})),{},{getAvatars:function(){if(this.findPortfolio){var t=[];return this.findPortfolio.sources.forEach((function(e){t.length&&t.some((function(t){return t.id===e.userInfo.id}))||t.push({id:e.userInfo.id,avatar:e.userInfo.avatarURL})})),t}},getContractsSymbols:function(){var t=this;if(this.findPortfolio){var e=[];return this.findPortfolio.sources.forEach((function(i){e.length&&e.some((function(t){return t.conract===i.contract}))||e.push({contract:i.contract,logo:t.getSymbolByContract(i.contract)})})),e}}}),methods:{getSymbolByContract:function(t){var e=this.getContracts.find((function(e){return e.name===t})).instrumentName,i=this.getTradingInstruments.find((function(t){return t.name===e})).baseAssetName,o=this.getTradingAssets.find((function(t){return t.code===i})).currencyChar;return o||i}}},Kkt=Jkt,Zkt=(i("6ef8"),Object(C["a"])(Kkt,Xkt,Qkt,!1,null,"5ade4c25",null)),tIt=Zkt.exports,eIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PortfoliosIncomesLeftBarWidget",class:"PortfoliosIncomesLeftBarWidget_".concat(t.getActiveTheme)},t._l(t.getContractsProfits,(function(i,o){return e("div",{key:o,staticClass:"PortfoliosIncomesLeftBarWidget-rowPortfolio"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_avatar"}),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_name",class:"PortfoliosIncomesLeftBarWidget-info_name_".concat(t.getActiveTheme)},[t._v(t._s(i.contract))])]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[i.profit<0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getLossPercentForPortfolio(i.profit),"%"),background:t.getLossColorBar}}):t._e(),i.profit<0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getRedColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profit,2))))]):t._e()]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-devider"}),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[i.profit>=0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getProfitPercentForPortfolio(i.profit),"%"),background:t.getProfitColorBar}}):t._e(),i.profit>=0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profit,2))))]):t._e()])])])})),0)},iIt=[],oIt={components:{Avatar:E},mixins:[qe],props:{statProfitsPortfolio:{default:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",findPortfolio:"expertsPortfolio/findPortfolio",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getContractsProfits:function(){var t=this;if(this.findPortfolio){var e=[];return this.findPortfolio.sources.forEach((function(i){e.length&&e.some((function(t){return t.id===i.userInfo.id}))||e.push({contract:i.contract,profit:t.getProfitByContract(i.contract)})})),e}},getAllProfitsPortfolios:function(){return this.getContractsProfits?this.getContractsProfits.filter((function(t){return t.profit>=0})):[]},getAllLossPortfolios:function(){return this.getContractsProfits?this.getContractsProfits.filter((function(t){return t.profit<0})):[]},getLossColorBar:function(){return"dark"===this.getActiveTheme?"rgba(250, 76, 74, 0.2)":this.getRedColor.fill},getProfitColorBar:function(){return"dark"===this.getActiveTheme?"rgba(0, 255, 172, 0.2)":this.getGreenColor.fill},getAllLoss:function(){return this.getAllLossPortfolios.length?this.getAllLossPortfolios.reduce((function(t,e){return t+e.profit}),0):0},getAllProfit:function(){return this.getAllProfitsPortfolios.length?this.getAllProfitsPortfolios.reduce((function(t,e){return t+e.profit}),0):0}}),methods:{getProfitByContract:function(t){var e;if(null===(e=this.statProfitsPortfolio)||void 0===e||!e.length)return 0;var i=0;return this.statProfitsPortfolio.forEach((function(e){if(e.profits.length){var o=e.profits.find((function(e){return e.symbol===t}));o&&(i+=o.currentProfit+o.fixProfit)}})),i},getLossPercentForPortfolio:function(t){return t&&this.getAllLoss?100*t/this.getAllLoss:0},getProfitPercentForPortfolio:function(t){return t&&this.getAllProfit?100*t/this.getAllProfit:0}}},nIt=oIt,sIt=(i("629d"),Object(C["a"])(nIt,eIt,iIt,!1,null,"29a60537",null)),rIt=sIt.exports,aIt={name:"WidgetsBlock",components:{StatDataContainer:k7,GistogramLeftBarWidget:VAt,ParticipantsPortfolio:tIt,PortfolioContractsProfits:rIt,StatWidgetWithGradient:F7},props:{statProfitsPortfolio:{default:null}},mixins:[qe,Ykt],data:function(){return{profitByOpenOrders:0,directionCurrentProfit:"up",directionProfitOnDay:"up"}},watch:{statProfitsPortfolio:function(t){t&&t.length&&this.updateOpenProfit(t)},getProfitOnDay:function(t,e){this.directionProfitOnDay=t=0?"up":"down":"up"},getPofitByCloseOrders:function(){var t;return null!==(t=this.closedOrders)&&void 0!==t&&t.length?this.closedOrders.reduce((function(t,e){return t+e.profit}),0):0},getCurrentProfit:function(){return this.profitByOpenOrders+this.getPofitByCloseOrders},getCurrentRelProfit:function(){return this.getCurrentProfit?100*this.getCurrentProfit/this.findPortfolio.investMoney:0},getCalcRelCloseProfit:function(){return this.getPofitByCloseOrders?100*this.getPofitByCloseOrders/this.findPortfolio.investMoney:0},getProfitOnDay:function(){return this.getLastDay?this.getLastDay.profitAbs:0},getProfitRelOnDay:function(){return this.getLastDay?this.getLastDay.profitRel:0},getLastDay:function(){var t=this;if(this.getAllStatByDays&&this.getAllStatByDays.length){var e=this.getAllStatByDays.reduce((function(e,i){var o=i.profitOpen+i.floatingProfitOpen,n=i.profitClose+i.floatingProfitClose,s=n-o,r=s?100*s/t.findPortfolio.investMoney:0;return e.push({date:i.date,title:new Date(i.date).getDate(),equityOpen:o,profitAbs:s,profitRel:r}),e}),[]);if(e.length){var i=e.at(-1);return i.profitAbs=this.profitByOpenOrders+this.getPofitByCloseOrders-i.equityOpen,i.profitRel=100*e.at(-1).profitAbs/this.findPortfolio.investMoney,i}}}}),methods:{updateOpenProfit:function(t){var e=0;t.forEach((function(t){t.profits.length&&(e+=t.profits.reduce((function(t,e){return t+e.currentProfit}),0))})),this.profitByOpenOrders=e}}},cIt=aIt,lIt=(i("e831"),Object(C["a"])(cIt,qkt,zkt,!1,null,"4f1e7a7a",null)),uIt=lIt.exports,dIt={name:"SelectedPortfolio",components:{PopupExtandStatPortfolio:$0,WidgetsBlock:uIt,ProvidersComissionBlock:vkt,ButtonBlock:WDt,AccordionStatBlock:Skt,PortfolioData:JDt,VuePerfectScrollbar:Xt.a,LoadComponent:GDt,ExpertsTabBlock:Wkt,CountSourceOrders:Gkt},mixins:[Ot],data:function(){return{expandStatStatus:!1,statProfitsPortfolio:null,tooltipText:""}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingStatData:"expertsPortfolio/isLoadingStatData",findPortfolio:"expertsPortfolio/findPortfolio",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",getActiveTheme:"headerSettings/getActiveTheme",getStatData:"statDataForPortfolio/getStatData"})),{},{getStatusBag:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getStatusPorvider:function(){if(this.findPortfolio)return"Signal"===this.findPortfolio.type},expertsForStat:function(){if(!this.isLoadingStatData)return this.getStatData.statSubs},feeProvider:function(){var t=this.findPortfolio.bagContents;if("Money"===t[0].priceType){var e=t.reduce((function(t,e){return t+e.price}),0);return"FIX $ ".concat(e)}var i=t.reduce((function(t,e){return t+e.price}),0);return"SF "+"".concat(Lm(i/t.length,1,!0),"%")},getStartStat:function(){if(this.findPortfolio){var t=this.findPortfolio.chain?this.findPortfolio.chain.at(-1).createdDateTime:this.findPortfolio.createdDateTime,e=this.findPortfolio.createdDateTime;return this.getStatusPorvider?[{title:"phbc",data:new Date(e).toLocaleString("ru"),tooltip:"dwtuc"},{title:"start_copying",data:this.findPortfolio.startDateTime?new Date(this.findPortfolio.startDateTime).toLocaleString("ru"):"__.__.____",tooltip:"sdocp"},{title:"management_fee",data:this.feeProvider,tooltip:"fsbat"}]:[{title:"phbc",data:new Date(t).toLocaleString("ru"),tooltip:"dwtuc"},{title:"start_investing",data:this.findPortfolio.startDateTime?new Date(this.findPortfolio.startDateTime).toLocaleString("ru"):"__.__.____",tooltip:"siitc"},{title:"management_fee",data:"SF 33%",tooltip:"fsbat"}]}},propsButtonBlock:function(){return{expertsByFindPortfolio:this.expertsForStat}}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},setProfitsPortfolio:function(t){this.statProfitsPortfolio=t},openExpandStat:function(){this.expandStatStatus=!this.expandStatStatus}}},hIt=dIt,pIt=(i("83af"),Object(C["a"])(hIt,BDt,MDt,!1,null,"301ee9a1",null)),gIt=pIt.exports,fIt={components:{DxLoadIndicator:OT["DxLoadIndicator"],SelectedPortfolio:gIt,Avatar:E},data:function(){return{isLoading:!1,isLoadingEditName:!1,editName:!1,name:""}},mixins:[xt],watch:{findPortfolio:function(t){if(null!==t&&void 0!==t&&t.name){if(this.getStatusPorvider){var e=t.name.split("_");this.name=e[0]}else this.name=t.name;this.editName=!1}},editName:function(t){t&&this.$refs.inputTitle.focus()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getLeftSideBar:"userSettings/getLeftSideBar",findPortfolio:"expertsPortfolio/findPortfolio",indexFindPortfolio:"expertsPortfolio/indexFindPortfolio"})),{},{modifierClass:function(){return{class:["LeftBar-button","LeftBar-button_".concat(this.getActiveTheme)]}},iconPath:function(){return{name:"".concat(this.getLeftSideBar?"Block-expand-left-close":"Block-expand-right-close")}},statusPortfolio:function(){return this.findPortfolio?this.findPortfolio.status:null},getStatusPorvider:function(){if(this.findPortfolio){var t=this.findPortfolio.name.split("_");return"#pro#"===t.at(-1)}},getAvatarProvider:function(){return this.findPortfolio?this.findPortfolio.sources[0].userInfo.avatarURL:""}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({showToast:"toast/showToast",saveInvestBag:"expertsPortfolio/saveInvestBag",clearExperts:"expertsPortfolio/clearExperts",clearStatus:"expertsPortfolio/clearStatus",getDataByBagOpenOrders:"expertsPortfolio/getDataByBagOpenOrders",changeInvestBagStatus:"expertsPortfolio/changeInvestBagStatus",physicalDeletePortfolio:"expertsPortfolio/physicalDeletePortfolio"})),{},{closeLeftSideBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!this.getLeftSideBar})},nameEditing:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.editName){e.next=7;break}return t.isLoadingEditName=!0,e.next=4,t.saveInvestBag({name:t.name,investLeverage:t.findPortfolio.investLeverage,investMoney:t.findPortfolio.investMoney,investBagType:t.findPortfolio.type,id:t.findPortfolio.id});case 4:"Signal"===t.findPortfolio.type?t.clearStatus():t.clearExperts(),t.isLoadingEditName=!1,t.$store.commit("expertsPortfolio/setNamePortfolio",{id:t.findPortfolio.id,newName:t.name});case 7:t.editName=!t.editName;case 8:case"end":return e.stop()}}),e)})))()},getTextMessage:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.count&&"Created"!==this.statusPortfolio?"".concat(this.$t("tanotitp")[0](t.count),"
\n ").concat(this.$t("tanotitp")[1]," ≈ $ ").concat(Math.abs(t.profit),". \n ").concat(this.$t("aysywtdtp")):this.$t("aysywtdtp")},deletePortfolio:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Created"===t.statusPortfolio){e.next=3;break}return t.showToast({visible:!0,componentName:"StopOrDeletePortfolioAlert",shading:!0,outSideClick:!0,width:"75vw",height:"90vh",dopInfo:{functionSetStatus:t.deleteFunctionOk,delete:!0,namePortfolio:t.name}}),e.abrupt("return");case 3:t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{visibleButtonAction:!0,functionArray:[t.deleteFunctionOk],message:t.getTextMessage()}});case 4:case"end":return e.stop()}}),e)})))()},deleteFunctionOk:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Created"!==t.statusPortfolio){e.next=5;break}return e.next=3,t.physicalDeletePortfolio(t.findPortfolio.id);case 3:e.next=10;break;case 5:if(!["Active","Pause"].includes(t.statusPortfolio)){e.next=8;break}return e.next=8,t.changeInvestBagStatus({bagId:t.findPortfolio.id,status:"Stoped",changeStatus:!1});case 8:return e.next=10,t.changeInvestBagStatus({bagId:t.findPortfolio.id,status:"Deleted",changeStatus:!0});case 10:t.$store.dispatch("expertsPortfolio/setNextFindPortfolio");case 11:case"end":return e.stop()}}),e)})))()}}),mounted:function(){var t;if(this.findPortfolio&&(null!==(t=this.findPortfolio)&&void 0!==t&&t.name)){if(this.getStatusPorvider){var e=this.findPortfolio.name.split("_");this.name=e[0]}else this.name=this.findPortfolio.name;this.editName=!1}}},mIt=fIt,vIt=(i("c9f9"),Object(C["a"])(mIt,kDt,IDt,!1,null,null,null)),yIt=vIt.exports,CIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LeftBar"},[e("div",{class:"LeftBar-head LeftBar-head_".concat(t.getActiveTheme)},[t.getLeftSideBar?e("div",{staticClass:"LeftBar-namePortfolio"},[e("div",{class:"LeftBar-titleCalc LeftBar-titleCalc_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("your_investments")))])]):t._e(),e("div",{class:t.getLeftSideBar?"LeftBar-closeButton":"LeftBar-closeButtonHide"},[e("ButtonIconFlat",{attrs:{icon:t.iconPath,modifier:t.modifierClass},on:{toggle:t.closeLeftSideBar}})],1)]),t.getLeftSideBar?e("VuePerfectScrollbar",{class:"LeftBar-content LeftBar-content_".concat(t.getActiveTheme)},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.loadStatus?e("Sceleton",{attrs:{width:"34.2rem",height:"5rem",variant:"text"}}):e("CalcInvestProfit",{attrs:{commonStatisticsPortfolios:t.commonStatisticsPortfolios,statusCommonStatisticsPortfolios:t.statusCommonStatisticsPortfolios,emptyPortfolios:t.emptyPortfolios,noStartedPortfolios:t.noStartedPortfolios}})],1)],1):t._e()],1)},bIt=[],SIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CalcInvestProfit"},[t.noStartedPortfolios?t._e():e("div",{staticClass:"CalcInvestProfit-startStat",class:"CalcInvestProfit-startStat_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-startStat-title",class:"CalcInvestProfit-startStat-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("start_investing")))]),e("hr"),e("div",{staticClass:"CalcInvestProfit-startStat-data",class:"CalcInvestProfit-startStat-data_".concat(t.getActiveTheme)},[t._v(t._s(t.getStartDateInvesting))])]),t.noStatStatus?t._e():e("div",{staticClass:"CalcInvestProfit-profitBlock"},[e("div",{staticClass:"CalcInvestProfit-profitBlock-title",class:"CalcInvestProfit-profitBlock-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-profitBlock-titleText"},[t._v(t._s(t.$t("investments")))]),e("div",{staticClass:"CalcInvestProfit-profitBlock-titleText"},[t._v("Средства портфеля")]),e("div",{staticClass:"CalcInvestProfit-profitBlock-titleText"},[t._v("Баланс портфеля")])]),t._l(t.getListInvestPortfolios,(function(i,o){return e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow",class:"CalcInvestProfit-profitBlock-dataRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-name"},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-nameData"},[i.avatar?e("Avatar",{attrs:{theme:t.getActiveTheme,src:i.avatar,size:"1.6"}}):t._e(),e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-nameData-text",class:"CalcInvestProfit-profitBlock-dataRow-nameData-text_".concat(t.getActiveTheme)},[t._v(t._s(i.name))])],1)]),e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profit"},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profitData-wrap",class:"CalcInvestProfit-profitBlock-dataRow-profitData-wrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profitData",class:"CalcInvestProfit-profitBlock-dataRow-profitData_".concat(t.getActiveTheme),style:{color:i.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profitAbs,2))))])])]),e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profit"},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profitData-wrap",class:"CalcInvestProfit-profitBlock-dataRow-profitData-wrap_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-profitBlock-dataRow-profitData",class:"CalcInvestProfit-profitBlock-dataRow-profitData_".concat(t.getActiveTheme),style:{color:i.profitClose<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profitClose,2))))])])]),e("hr")])}))],2),e("StatDataContainer",{attrs:{title:"Доход по закрытым сделкам"}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"CalcInvestProfit-profitData",style:{color:t.getCalcCloseProfit<0?t.getRedColor.color:t.getGreenColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getCalcCloseProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcCloseProfit,symbol:t.getCurrencyChar,gradient:t.getCalcCloseProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionCloseProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getCalcRelCloseProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcRelCloseProfit,symbol:"%",gradient:t.getCalcRelCloseProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Текущий доход портфеля"}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"CalcInvestProfit-profitData",style:{color:t.getCalcAbsProfit<0?t.getRedColor.color:t.getGreenColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getCalcAbsProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcAbsProfit,symbol:t.getCurrencyChar,gradient:t.getCalcAbsProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionProfit,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getCalcRelProfit<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcRelProfit,symbol:"%",gradient:t.getCalcRelProfit<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Доход портфеля за ".concat(t.getServerTime?new Date(t.getServerTime.now).toLocaleDateString("ru"):(new Date).toLocaleDateString("ru"))}},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[e("div",{staticClass:"CalcInvestProfit-profitData",style:{color:t.getProfitOnDay<0?t.getRedColor.color:t.getGreenColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getProfitOnDay<0?t.getRedColor.color:t.getLemonColor.color,data:t.getProfitOnDay,symbol:t.getCurrencyChar,gradient:t.getProfitOnDay<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:t.directionProfitOnDay,type:"abs"}}),e("StatWidgetWithGradient",{attrs:{color:t.getCalcRelProfitOnDay<0?t.getRedColor.color:t.getLemonColor.color,data:t.getCalcRelProfitOnDay,symbol:"%",gradient:t.getCalcRelProfitOnDay<0?t.getRedColor.gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),e("StatDataContainer",{attrs:{title:"Доход портфеля за 20 дней"}},[e("GistogramLeftBarWidget",{attrs:{pointsForGistogramm:t.getPointsForGistogramm}})],1),e("div",{staticClass:"CalcInvestProfit-widgetWrap"},[t.noStatStatus?t._e():e("StatDataContainer",{attrs:{title:"% yсп. сделок"}},[e("div",{staticClass:"CalcInvestProfit-profitData"},[e("StatWidgetWithGradient",{attrs:{color:t.getColorPercentProfitOrders.color,data:t.getPercentProfitOrders,symbol:"%",gradient:t.getColorPercentProfitOrders.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)]),t.noStatStatus?t._e():e("StatDataContainer",{attrs:{title:"Max DD"}},[e("div",{staticClass:"CalcInvestProfit-profitData",style:{color:t.getRedColor.color}},[e("StatWidgetWithGradient",{attrs:{color:t.getRedColor.color,data:Math.abs(t.getMaxDD),symbol:"%",gradient:t.getRedColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1),t.noStatStatus?t._e():e("StatDataContainer",{attrs:{title:"Доход портфеля"}},[e("PortfoliosIncomesLeftBarWidget",{attrs:{portfoliosData:t.getListInvestPortfolios}})],1),t.noStatStatus?t._e():e("div",{staticClass:"CalcInvestProfit-extandStat",class:"CalcInvestProfit-extandStat_".concat(t.getActiveTheme)},[e("div",{staticClass:"CalcInvestProfit-extandStatText"},[t._v(t._s(t.$t("management_statistics")))]),e("div",{staticClass:"CalcInvestProfit-extandStatIcon",class:"CalcInvestProfit-extandStatIcon_".concat(t.getActiveTheme),on:{click:t.openExpandStat}},[e("svgIcon",{attrs:{name:"Expand"}})],1)]),t.noStatStatus?t._e():e("PortfolioData",{attrs:{statMode:"allStat"},on:{setStatisit:t.setExistingStat,setClosedOrders:t.setClosedOrders}}),t.expandStatStatus?e("PopupExtandStatPortfolio",{attrs:{container:".CalcInvestProfit-extandStat",modeStat:"allStat"},on:{closePopup:t.openExpandStat}}):t._e()],1)},PIt=[],TIt={computed:{getPortfoliosForStat:function(){if(this.commonStatisticsPortfolios)return this.commonStatisticsPortfolios.map((function(t){return{investBagId:t[0],data:t[1]}}))},getAllStatByPortfolios:function(){if(this.getPortfoliosForStat){var t=[];return this.getPortfoliosForStat.forEach((function(e){e.data&&e.data.length&&e.data.forEach((function(e){e[1].length&&e[1].forEach((function(e){e[1]&&e[1].length&&t.push(e[1])}))}))})),t}},getAllStatByHours:function(){if(this.getAllStatByPortfolios&&this.getAllStatByPortfolios.length){var t=[];return this.getAllStatByPortfolios.forEach((function(e){if(e.length){var i=e.map((function(t){return $W(t)}));i.forEach((function(e){1===e.statType&&t.push(e)}))}})),t.length?this.combinedData(t):null}},getAllStatByDays:function(){if(this.getAllStatByPortfolios&&this.getAllStatByPortfolios.length){var t=[];return this.getAllStatByPortfolios.forEach((function(e){if(e.length){var i=e.map((function(t){return $W(t)}));i.forEach((function(e){2===e.statType&&t.push(e)}))}})),t.length?this.combinedData(t):null}}},methods:{combinedData:function(t){var e={};return t.forEach((function(t){var i=new Date(t.date).getTime();e[i]?(e[i][0].push(t.profitOpen),e[i][1].push(t.profitClose),e[i][2].push(t.floatingProfitOpen),e[i][3].push(t.floatingProfitClose)):e[i]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]})),Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}}))}}},xIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PortfoliosIncomesLeftBarWidget",class:"PortfoliosIncomesLeftBarWidget_".concat(t.getActiveTheme)},t._l(t.portfoliosData,(function(i,o){return e("div",{key:o,staticClass:"PortfoliosIncomesLeftBarWidget-rowPortfolio"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info"},[i.avatar?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_avatar"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"1.6"}})],1):t._e(),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_name",class:"PortfoliosIncomesLeftBarWidget-info_name_".concat(t.getActiveTheme)},[t._v(t._s(i.name))])]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getLossPercentForPortfolio(i.id),"%"),background:t.getLossColorBar}}),i.profitAbs<0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getRedColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profitAbs,2))))]):t._e()]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-devider"}),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getProfitPercentForPortfolio(i.id),"%"),background:t.getProfitColorBar}}),i.profitAbs>=0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profitAbs,2))))]):t._e()])])])})),0)},OIt=[],wIt={props:{portfoliosData:{default:null}},components:{Avatar:E},mixins:[qe],computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getAllProfitsPortfolios:function(){return this.portfoliosData?this.portfoliosData.filter((function(t){return t.profitAbs>=0})):[]},getAllLossPortfolios:function(){return this.portfoliosData?this.portfoliosData.filter((function(t){return t.profitAbs<0})):[]},getLossColorBar:function(){return"dark"===this.getActiveTheme?"rgba(250, 76, 74, 0.2)":this.getRedColor.fill},getProfitColorBar:function(){return"dark"===this.getActiveTheme?"rgba(0, 255, 172, 0.2)":this.getGreenColor.fill},getAllLoss:function(){return this.getAllLossPortfolios.length?this.getAllLossPortfolios.reduce((function(t,e){return t+e.profitAbs}),0):0},getAllProfit:function(){return this.getAllProfitsPortfolios.length?this.getAllProfitsPortfolios.reduce((function(t,e){return t+e.profitAbs}),0):0}}),methods:{getLossPercentForPortfolio:function(t){if(!this.getAllLossPortfolios.length)return 0;var e=this.getAllLossPortfolios.find((function(e){return e.id===t}));return e?100*e.profitAbs/this.getAllLoss:0},getProfitPercentForPortfolio:function(t){if(!this.getAllProfitsPortfolios.length)return 0;var e=this.getAllProfitsPortfolios.find((function(e){return e.id===t}));return e?100*e.profitAbs/this.getAllProfit:0}}},_It=wIt,AIt=(i("1d12"),Object(C["a"])(_It,xIt,OIt,!1,null,"51003ba8",null)),DIt=AIt.exports,kIt={components:{PortfoliosIncomesLeftBarWidget:DIt,StatWidgetWithGradient:F7,VuePerfectScrollbar:Xt.a,PopupExtandStatPortfolio:$0,GistogramLeftBarWidget:VAt,StatDataContainer:k7,Sceleton:nT,Avatar:E,PortfolioData:JDt},mixins:[qe,TIt],props:{commonStatisticsPortfolios:{default:null},statusCommonStatisticsPortfolios:{default:!1},emptyPortfolios:{type:Boolean},noStartedPortfolios:{type:Boolean}},data:function(){return{investPortolios:null,userOrders:null,openOrders:null,closeOrders:null,closeOrdersByPortfolios:null,directionProfit:"up",directionProfitOnDay:"up",directionCloseProfit:"up",expandStatStatus:!1,noStatStatus:!1,existingStat:null}},watch:{getDefaultAccount:function(t){t&&this.getInvestorStat()},getActivePortfolios:function(t,e){null!==e&&t&&this.getInvestorStat()},getStatByOrders:function(t){t&&this.setOrders()},getCalcAbsProfit:function(t,e){void 0!==t&&void 0!==e&&(this.directionProfit=t>e?"up":"down")},getProfitOnDay:function(t,e){void 0!==t&&void 0!==e&&(this.directionProfitOnDay=t>e?"up":"down")},getCalcCloseProfit:function(t,e){void 0!==t&&void 0!==e&&(this.directionCloseProfit=t>e?"up":"down")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getServerTime:"serverTime/getServerTime",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatByOrders:"contracts/getStatByOrders"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},getCountProfitOrders:function(){if(!this.closeOrdersByPortfolios||!this.closeOrdersByPortfolios.length)return[];var t=this.closeOrdersByPortfolios.filter((function(t){return t.profit>=0}));return t},getPercentProfitOrders:function(){if(!this.getCountProfitOrders||!this.getCountProfitOrders.length)return 0;var t=100*this.getCountProfitOrders.length/this.closeOrdersByPortfolios.length;return t},getColorPercentProfitOrders:function(){return this.getPercentProfitOrders<30?this.getRedColor:this.getPercentProfitOrders>30&&this.getPercentProfitOrders<60?this.getOrangeColor:this.getLemonColor},getMaxDD:function(){var t,e=this;if(null===(t=this.getAllStatByDays)||void 0===t||!t.length)return 0;var i=[];return this.getAllStatByDays.forEach((function(t){var o=t.profitOpen+t.floatingProfitOpen,n=t.profitClose+t.floatingProfitClose,s=n-o;if(s<0){var r=100*Math.abs(s)/e.getInvestMoneyByPortfolios;i.push(r)}})),Math.max.apply(null,i)},getOpenDayProfit:function(){var t,e,i;return null!==(t=this.getAllStatByDays)&&void 0!==t&&t.length||null!==(e=this.getAllStatByHours)&&void 0!==e&&e.length?null!==(i=this.getAllStatByDays)&&void 0!==i&&i.length?this.getAllStatByDays.at(-1).profitOpen+this.getAllStatByDays.at(-1).floatingProfitOpen:void 0:0},getPointsForGistogramm:function(){var t,e,i;if(this.statusCommonStatisticsPortfolios){if((null===(t=this.getAllStatByDays)||void 0===t||!t.length)&&(null===(e=this.getAllStatByHours)||void 0===e||!e.length)){for(var o=[[]],n=0;n<=20;n++)n?o[0].push({x:n}):o[0].push({x:n,y:this.getCalcAbsProfit,date:(new Date).toLocaleDateString("ru")});o.unshift([{x:0,y:0,date:new Date}]);var s=o[1].findLast((function(t){return void 0!==t.y}));return s?s.y=this.getCalcAbsProfit:o[1][0].y=this.getCalcAbsProfit,o}var r;r=null!==(i=this.getAllStatByDays)&&void 0!==i&&i.length?this.getAllStatByDays.length<20?this.getAllStatByDays:this.getAllStatByDays.slice(-20):this.getAllStatByHours.slice(-1);for(var a=[[]],c=0;c<=20;c++)if(r[c]){var l=r[c].profitClose+r[c].floatingProfitClose-(r[c].profitOpen+r[c].floatingProfitOpen);a[0].push({x:c,y:l,date:new Date(r[c].date).toLocaleDateString("ru")})}else a[0].push({x:c});a.unshift([{x:0,y:0,date:new Date}]);var u=a[1].findLast((function(t){return void 0!==t.y})),d=r.at(-1).profitOpen+r.at(-1).floatingProfitOpen;return u?u.y=this.getCalcAbsProfit-d:a[1][0].y=this.getCalcAbsProfit-d,a}},getProfitOnDay:function(){return this.getCalcAbsProfit-this.getOpenDayProfit},getActivePortfolios:function(){return this.getCreatedPortfolios?this.getCreatedPortfolios.filter((function(t){return"Active"===t.status})):null},getStartDateInvesting:function(){if(this.getActivePortfolios&&this.getActivePortfolios.length){var t=Math.min.apply(null,this.getActivePortfolios.map((function(t){return new Date(t.startDateTime).getTime()})));return t?new Date(t).toLocaleString("ru"):new Date(this.getServerTime.now).toLocaleString("ru")}},getInvestMoneyByPortfolios:function(){if(!this.getCreatedPortfolios||!this.getCreatedPortfolios.length)return 0;var t=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));return t.length?t.reduce((function(t,e){return t+e.investMoney}),0):0},getCalcRelProfitOnDay:function(){return this.getProfitOnDay?100*this.getProfitOnDay/this.getInvestMoneyByPortfolios:0},getCalcRelProfit:function(){return this.getCalcAbsProfit?100*this.getCalcAbsProfit/this.getInvestMoneyByPortfolios:0},getCalcRelCloseProfit:function(){return this.getCalcCloseProfit?100*this.getCalcCloseProfit/this.getInvestMoneyByPortfolios:0},getCalcCloseProfit:function(){return this.getListInvestPortfolios&&this.getListInvestPortfolios.length?this.getListInvestPortfolios.reduce((function(t,e){return t+e.profitClose}),0):0},getProfitOpenOrders:function(){var t=this;if(!this.openOrders||!this.openOrders.length)return 0;var e=this.openOrders.filter((function(e){return e.subscriptionId&&t.allSubscriptionCurrentDate.some((function(t){return t.subscription.id===+e.subscriptionId}))}));return e.length?e.reduce((function(t,e){return t+e.profit}),0):0},getCalcAbsProfit:function(){return this.getListInvestPortfolios&&this.getListInvestPortfolios.length?this.getListInvestPortfolios.reduce((function(t,e){return t+e.profitAbs}),0):0},getListInvestPortfolios:function(){var t=this;if(this.investPortolios&&this.investPortolios[1]){var e=Object(x["a"])(new Set(this.investPortolios[1].map((function(t){return t[0]})))),i=[];return e.forEach((function(e){var o=t.investPortolios[1].filter((function(t){return t[0]===e})).map((function(t){return t[1]})),n=t.investPortolios[1].find((function(t){return t[0]===e}))[2],s=t.investPortolios[1].find((function(t){return t[0]===e}))[3],r=t.closeOrders&&t.closeOrders.length?t.getProfitPrortfolio(o,"close"):0,a=t.openOrders&&t.openOrders.length?t.getProfitPrortfolio(o,"open"):0;i.push({id:e,subs:o,name:n,avatar:s,profitClose:r,profitAbs:a+r})})),i}}}),methods:{openExpandStat:function(){this.expandStatStatus=!this.expandStatStatus},getProfitPrortfolio:function(t,e){var i="open"===e?this.openOrders:this.closeOrders,o=i.filter((function(e){return t.some((function(t){return+e.subscriptionId===t}))}));if(!o.length)return 0;var n=o.reduce((function(t,e){return t+e.profit}),0);return n},getInvestorStat:function(){var t={command:"GetInvestorStatisticByContract",data:{id:this.getDefaultAccount.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setExistingStat:function(t){this.existingStat=t},setClosedOrders:function(t){this.closeOrdersByPortfolios=t},setOrders:function(){this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.openOrders=this.userOrders.tradingOrders,this.closeOrders=this.userOrders.closedOrders},setMessageHendler:function(t){if("GetInvestorStatisticByContract"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);e&&e[0]&&e[1]?this.investPortolios=JSON.parse(t.data):this.noStatStatus=!0}else t&&t.command&&"AccountsDetails"===t.command&&(this.openOrders=t.data[0].openOrders.tradingOrders)}},mounted:function(){this.$socketStream.events.subscribe("apiWS3",this.setMessageHendler),this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.getDefaultAccount&&this.getInvestorStat(),this.$orderStorage.getOrdersOnStorage()&&this.setOrders()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},IIt=kIt,BIt=(i("a3f5f"),Object(C["a"])(IIt,SIt,PIt,!1,null,"233a4f11",null)),MIt=BIt.exports,$It=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LeftBarEmptyPortfolio"},[e("StatisticBlock")],1)},LIt=[],FIt={components:{StatisticBlock:G0}},jIt=FIt,RIt=(i("9385"),Object(C["a"])(jIt,$It,LIt,!1,null,"5d381588",null)),WIt=RIt.exports,NIt={components:{CalcInvestProfit:MIt,LeftBarEmptyPortfolio:WIt,VuePerfectScrollbar:Xt.a,Sceleton:nT},data:function(){return{noStartedPortfolios:!1,emptyPortfolios:!1}},props:{commonStatisticsPortfolios:{default:null},statusCommonStatisticsPortfolios:{default:!1},loadStatus:{type:Boolean}},watch:{loadStatus:function(t){t||(this.setEmtyPortfolios(),this.setNoStartedPortfolios())}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getLeftSideBar:"userSettings/getLeftSideBar",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios"})),{},{iconPath:function(){return{name:"".concat(this.getLeftSideBar?"Block-expand-left-close":"Block-expand-right-close")}},modifierClass:function(){return{class:["LeftBar-button","LeftBar-button_".concat(this.getActiveTheme)]}}}),methods:{setEmtyPortfolios:function(){this.emptyPortfolios=0===this.getCreatedPortfolios.length},setNoStartedPortfolios:function(){this.getCreatedPortfolios.length?this.noStartedPortfolios=this.getCreatedPortfolios.every((function(t){return"Active"!==t.status})):this.noStartedPortfolios=!0},closeLeftSideBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!this.getLeftSideBar})}}},EIt=NIt,UIt=(i("49d1"),Object(C["a"])(EIt,CIt,bIt,!1,null,"79c781ca",null)),VIt=UIt.exports,HIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LeftBarFilterStrategyBar"},[e("div",{class:"LeftBarFilterStrategyBar-head LeftBarFilterStrategyBar-head_".concat(t.getActiveTheme)},[t.getLeftSideBar?e("div",{staticClass:"LeftBarFilterStrategyBar-namePortfolio"},[e("div",{class:"LeftBarFilterStrategyBar-titleCalc LeftBarFilterStrategyBar-titleCalc_".concat(t.getActiveTheme)},[t._v("Фильтр стратегий")])]):t._e(),e("div",{class:t.getLeftSideBar?"LeftBarFilterStrategyBar-closeButton":"LeftBarFilterStrategyBar-closeButtonHide"},[e("ButtonIconFlat",{attrs:{icon:t.iconPath,modifier:t.modifierClass,disabled:t.statusBlockFilter},on:{toggle:t.closeLeftSideBar}})],1)]),e("div",{class:"LeftBarFilterStrategyBar-content LeftBarFilterStrategyBar-content_".concat(t.getActiveTheme)},[e("StatDataContainer",{attrs:{title:"Тип счета"}},[e("div",{staticClass:"LeftBarFilterStrategyBar-typeAccount"},t._l(t.getTypesAccountFilter,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["LeftBarFilterStrategyBar-button","LeftBarFilterStrategyBar-button_filter",t.activeAccountTypeFilter===o?"LeftBarFilterStrategyBar-button_isActive_".concat(t.getActiveTheme):"LeftBarFilterStrategyBar-button_".concat(t.getActiveTheme)]}},on:{toggle:function(e){return t.setTypeAccountFilter(o)}}},[t._v(t._s(i.text))])})),1)]),e("StatDataContainer",{attrs:{title:"Успешных сделок"}},[e("div",{staticClass:"LeftBarFilterStrategyBar-filterSlider"},[e("SliderPercent",{attrs:{getStatusProgress:!t.statusBlockFilter,defaultFilterByTraders:t.defaultFilterByTraders,setParamFiltering:t.setParamFiltering}})],1)]),e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments"},[e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments-item"},[e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments-itemCheckbox"},[e("Checkbox",{attrs:{checked:t.getStatusAllInstrumentsFilter},on:{change:t.setAllInstrumtsFilter}})],1),e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments-itemName",class:"LeftBarFilterStrategyBar-filterInstruments-itemName_".concat(t.getActiveTheme)},[t._v("Все Инструменты")])]),e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstrumentsItemsContracts"},t._l(t.getSourcesByTypeAccount,(function(i,o){return e("div",{key:o,staticClass:"LeftBarFilterStrategyBar-filterInstruments-item",class:"LeftBarFilterStrategyBar-filterInstruments-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments-itemCheckbox"},[e("Checkbox",{attrs:{checked:i.status},on:{change:function(e){return t.setInstrumtFilter(o)}}})],1),e("div",{staticClass:"LeftBarFilterStrategyBar-filterInstruments-itemName",class:"LeftBarFilterStrategyBar-filterInstruments-itemName_".concat(t.getActiveTheme)},[t._v(t._s("".concat(i.contract," (").concat(i.count,")")))])])})),0)])],1)])},GIt=[],qIt={components:{StatDataContainer:k7,SliderPercent:jtt,Checkbox:Ya},props:{defaultFilterByTraders:{type:Object},statusBlockFilter:{type:Boolean}},data:function(){return{activeAccountTypeFilter:2,sources:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getLeftSideBar:"userSettings/getLeftSideBar",getCatalogs:"quotesCatalogs/getCatalogs",getApi:"api/api",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},getStatusAllInstrumentsFilter:function(){if(this.sources)return this.sources.every((function(t){return!t.status}))},getSourcesByTypeAccount:function(){if(this.sources)return this.sources.sort((function(t,e){var i=t.contract.toLowerCase(),o=e.contract.toLowerCase();return io?1:0}))},getTypesAccountFilter:function(){return[{text:"Real",type:"real",status:!1},{text:"Demo",type:"demo",status:!1},{text:"Все",type:"all",status:!0}]},iconPath:function(){return{name:"".concat(this.getLeftSideBar?"Block-expand-left-close":"Block-expand-right-close")}},modifierFilterButton:function(){return{class:["LeftBarFilterStrategyBar-button","LeftBarFilterStrategyBar-button_filter","LeftBarFilterStrategyBar-button_".concat(this.getActiveTheme)]}},modifierClass:function(){return{class:["LeftBarFilterStrategyBar-button","LeftBarFilterStrategyBar-button_".concat(this.getActiveTheme)]}}}),methods:{setAllInstrumtsFilter:function(){this.sources=this.sources.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{status:!1})})),this.$emit("setParamFiltering",{param:"contracts",data:null})},setInstrumtFilter:function(t){if(!this.statusBlockFilter){this.$set(this.sources[t],"status",!this.sources[t].status);var e=this.sources.filter((function(t){return t.status}));e.length?this.$emit("setParamFiltering",{param:"contracts",data:e.map((function(t){return t.contract}))}):this.$emit("setParamFiltering",{param:"contracts",data:null})}},setTypeAccountFilter:function(t){this.activeAccountTypeFilter=t,this.setParamFiltering({param:"IsRealAccount",data:!t||1!==t&&null})},setParamFiltering:function(t){this.$emit("setParamFiltering",t)},closeLeftSideBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!this.getLeftSideBar})},getCountsSourses:function(){var t=this;this.$http.get("".concat(this.getApi,"Subscription/GetActiveSourceContractCount")).then((function(e){var i,o=t.getCryptoStatus?"CFD":"ForexSpot";null!==(i=e.data.data)&&void 0!==i&&i.length&&(t.sources=e.data.data.filter((function(t){return t.instrumentType===o})),t.sources.length&&t.setAllInstrumtsFilter())}))}},mounted:function(){this.getCountsSourses()}},zIt=qIt,YIt=(i("8d59"),Object(C["a"])(zIt,HIt,GIt,!1,null,"095ba618",null)),XIt=YIt.exports,QIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LeftBarTops"},[e("div",{class:"LeftBarTops-head LeftBarTops-head_".concat(t.getActiveTheme)},[t.getLeftSideBar?e("div",{staticClass:"LeftBarTops-namePortfolio"},[t.activeTop?e("TopsLabel",{attrs:{top:t.activeTop,market:t.getCryptoStatus?"Crypto":"Forex"}}):t._e(),e("ButtonIconFlat",{attrs:{icon:{name:"Compare"},modifier:{class:["LeftBarTops-button","LeftBarTops-button_".concat(t.getActiveTheme),"LeftBarTops-button_compare"]}},on:{toggle:t.closeLeftSideBar}},[t._v("Сравнить Топы ")])],1):t._e(),e("div",{class:t.getLeftSideBar?"LeftBarTops-closeButton":"LeftBarTops-closeButtonHide"},[e("ButtonIconFlat",{attrs:{icon:t.iconPath,modifier:t.modifierClass},on:{toggle:t.closeLeftSideBar}})],1)]),e("div",{class:"LeftBarTops-content LeftBarTops-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Топ создан"}},[e("StatWidgetWithGradient",{attrs:{color:t.getGrayColor.color,data:t.getCreatedDateTop,format:!1,symbol:"",gradient:t.getGrayColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1),e("StatDataContainer",{attrs:{title:"Комиссия"}},[e("StatWidgetWithGradient",{attrs:{color:t.getBlueColor.color,data:33,symbol:"%",gradient:t.getBlueColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"ROI"}},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getRoiTop,symbol:"%",gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Доход за 30 дней"}},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getProfit30days,symbol:"%",gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1),e("StatDataContainer",{attrs:{title:"Доход за 7 дней"}},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getProfit7days,symbol:"%",gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Инструменты Топа"}},[e("div",{class:"LeftBarTops-instruments-title LeftBarTops-instruments-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"LeftBarTops-instruments-titleItem"},[t._v("Инструмент")]),e("div",{staticClass:"LeftBarTops-instruments-titleItem"},[t._v(t._s("Доход, ".concat(t.getCurrencyChar)))]),e("div",{staticClass:"LeftBarTops-instruments-titleItem"},[t._v("ROI,%")])]),t._l(t.getInstrumentsTops,(function(i,o){return e("div",{key:o,class:"LeftBarTops-instruments-item LeftBarTops-instruments-item_".concat(t.getActiveTheme)},[e("div",{staticClass:"LeftBarTops-instruments-wrapData"},[e("div",{class:"LeftBarTops-instruments-itemContract LeftBarTops-instruments-itemContract_".concat(t.getActiveTheme)},[t._v(t._s(i.contract))])]),e("div",{staticClass:"LeftBarTops-instruments-wrapData"},[e("div",{class:"LeftBarTops-instruments-itemData LeftBarTops-instruments-itemData_".concat(t.getActiveTheme),style:{background:i.profit<0?t.getRedColor.gradient:t.getLemonColor.gradient,color:i.profit<0?t.getRedColor.color:t.getLemonColor.color}},[t._v(t._s(t.$moneyf(i.profit,2)))])]),e("div",{staticClass:"LeftBarTops-instruments-wrapData"},[e("div",{class:"LeftBarTops-instruments-itemData LeftBarTops-instruments-itemData_".concat(t.getActiveTheme),style:{background:i.roi<0?t.getRedColor.gradient:t.getLemonColor.gradient,color:i.roi<0?t.getRedColor.color:t.getLemonColor.color}},[t._v(t._s("".concat(t.$moneyf(i.roi,2),"%")))])]),e("hr")])}))],2)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Участники Топа"}},[e("PerticipantsTops",{attrs:{top:t.activeTop}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Доход Топа"}},[e("TopsContractsProfits",{attrs:{top:t.activeTop}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Прогноз дохода на 30 дней"}},[e("StatWidgetWithGradient",{attrs:{color:t.getOrangeColor.color,data:t.getForecast,symbol:"%",gradient:t.getOrangeColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Под управлением Топ"}},[e("StatWidgetWithGradient",{attrs:{color:t.getBlueColor.color,data:t.getInvestCapital,symbol:t.getCurrencyChar,gradient:t.getBlueColor.gradient,arrow:"",sideSymbol:"left",type:"abs"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Копируют Топ"}},[e("StatWidgetWithGradient",{attrs:{color:t.getBlueColor.color,data:t.getCountSubscribers,symbol:"",gradient:t.getBlueColor.gradient,arrow:"",sideSymbol:"left",type:"abs"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"% усп. сделок"}},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getProfitPercentOrders,symbol:"%",gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1),e("StatDataContainer",{attrs:{title:"Max DD"}},[e("StatWidgetWithGradient",{attrs:{color:t.getRedColor.color,data:t.getMaxDD,symbol:"%",gradient:t.getRedColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Доход за 30 дней"}},[e("GistogramLeftBarWidget",{attrs:{pointsForGistogramm:t.getPointsForGistogramm}})],1)],1),e("div",{staticClass:"LeftBarTops-widgetsWrap"},[e("StatDataContainer",{attrs:{title:"Прибыльные/Убыточные сделки"}},[e("div",{staticClass:"LeftBarTops-dataWrap"},[e("StatWidgetWithGradient",{attrs:{color:t.getLemonColor.color,data:t.getProfitOrdersCount,symbol:"",gradient:t.getLemonColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}}),e("StatWidgetWithGradient",{attrs:{color:t.getRedColor.color,data:t.getLossOrdersCount,symbol:"",gradient:t.getRedColor.gradient,arrow:"",sideSymbol:"right",type:"rel"}})],1)])],1)])])},JIt=[],KIt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopsLabel"},[e("div",{staticClass:"TopsLabel-item"},[t._v(t._s("TOP".concat(t.getCountTop)))]),e("div",{staticClass:"TopsLabel-item"},[t._v(t._s("".concat(t.market)))])])},ZIt=[],tBt={name:"TopsLabel",props:{market:{default:"Forex"},top:{default:function(){return[]}}},computed:{getCountTop:function(){var t;return null===(t=this.top)||void 0===t?void 0:t.length}}},eBt=tBt,iBt=(i("06b8"),Object(C["a"])(eBt,KIt,ZIt,!1,null,null,null)),oBt=iBt.exports,nBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ParticipantsPortfolio"},[e("div",{staticClass:"ParticipantsPortfolio-avatars"},t._l(t.getAvatars,(function(i,o){return e("div",{key:o,staticClass:"ParticipantsPortfolio-avatars-item"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"3.4"}})],1)})),0),e("div",{staticClass:"ParticipantsPortfolio-contracts"},t._l(t.getContractsSymbols,(function(i,o){return e("div",{key:o,staticClass:"ParticipantsPortfolio-contracts-item",style:{background:t.getBlueColor.color}},[t._v(t._s(i.logo))])})),0)])},sBt=[],rBt={components:{Avatar:E},mixins:[qe],props:{top:{default:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getTradingInstruments:"contracts/getTradingInstruments",getTradingAssets:"contracts/getTradingAssets",getContracts:"contracts/getContracts"})),{},{getAvatars:function(){if(this.top){var t=[];return this.top.forEach((function(e){t.length&&t.some((function(t){return t.id===e.accountId}))||t.push({id:e.accountId,avatar:e.avatarURL})})),t}},getContractsSymbols:function(){var t=this;if(this.top){var e=[];return this.top.forEach((function(i){e.length&&e.some((function(t){return t.conract===i.contract}))||e.push({contract:i.contract,logo:t.getSymbolByContract(i.contract)})})),e}}}),methods:{getSymbolByContract:function(t){var e=this.getContracts.find((function(e){return e.name===t})).instrumentName,i=this.getTradingInstruments.find((function(t){return t.name===e})).baseAssetName,o=this.getTradingAssets.find((function(t){return t.code===i})).currencyChar;return o||i}}},aBt=rBt,cBt=(i("5dd8"),Object(C["a"])(aBt,nBt,sBt,!1,null,"23d446bf",null)),lBt=cBt.exports,uBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PortfoliosIncomesLeftBarWidget",class:"PortfoliosIncomesLeftBarWidget_".concat(t.getActiveTheme)},t._l(t.getContractsProfits,(function(i,o){return e("div",{key:o,staticClass:"PortfoliosIncomesLeftBarWidget-rowPortfolio"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_avatar"}),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-info_name",class:"PortfoliosIncomesLeftBarWidget-info_name_".concat(t.getActiveTheme)},[t._v(t._s(i.contract))])]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit"},[e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[i.profit<0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getLossPercentForPortfolio(i.profit),"%"),background:t.getLossColorBar}}):t._e(),i.profit<0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getRedColor.color}},[t._v(t._s("".concat(t.$moneyf(t.getLossPercentForPortfolio(i.profit),2),"%")))]):t._e()]),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-devider"}),e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-wrap"},[i.profit>=0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-bar",style:{width:"".concat(t.getProfitPercentForPortfolio(i.profit),"%"),background:t.getProfitColorBar}}):t._e(),i.profit>=0?e("div",{staticClass:"PortfoliosIncomesLeftBarWidget-barProfit-data",style:{color:t.getGreenColor.color}},[t._v(t._s("".concat(t.$moneyf(t.getProfitPercentForPortfolio(i.profit),2),"%")))]):t._e()])])])})),0)},dBt=[],hBt={components:{Avatar:E},mixins:[qe],props:{top:{default:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getContractsProfits:function(){if(this.top){var t=[];return this.top.forEach((function(e){t.push({contract:e.contract,profit:e.profitClose})})),t}},getAllProfitsPortfolios:function(){return this.getContractsProfits?this.getContractsProfits.filter((function(t){return t.profit>=0})):[]},getAllLossPortfolios:function(){return this.getContractsProfits?this.getContractsProfits.filter((function(t){return t.profit<0})):[]},getLossColorBar:function(){return"dark"===this.getActiveTheme?"rgba(250, 76, 74, 0.2)":this.getRedColor.fill},getProfitColorBar:function(){return"dark"===this.getActiveTheme?"rgba(0, 255, 172, 0.2)":this.getGreenColor.fill},getAllLoss:function(){return this.getAllLossPortfolios.length?this.getAllLossPortfolios.reduce((function(t,e){return t+e.profit}),0):0},getAllProfit:function(){return this.getAllProfitsPortfolios.length?this.getAllProfitsPortfolios.reduce((function(t,e){return t+e.profit}),0):0}}),methods:{getLossPercentForPortfolio:function(t){return t&&this.getAllLoss?100*t/this.getAllLoss:0},getProfitPercentForPortfolio:function(t){return t&&this.getAllProfit?100*t/this.getAllProfit:0}}},pBt=hBt,gBt=(i("b91a5"),Object(C["a"])(pBt,uBt,dBt,!1,null,"52e1f351",null)),fBt=gBt.exports,mBt={name:"LeftBarTops",props:{activeTop:{default:null},topsStat:{default:null}},components:{TopsLabel:oBt,StatDataContainer:k7,StatWidgetWithGradient:F7,GistogramLeftBarWidget:VAt,TopsContractsProfits:fBt,PerticipantsTops:lBt},mixins:[qe],data:function(){return{accountIds:null,investStat:[]}},watch:{activeTop:function(){this.investStat=[],this.getInvestInfo()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getLeftSideBar:"userSettings/getLeftSideBar",getCatalogs:"quotesCatalogs/getCatalogs",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCreatedDateTop:function(){if(this.topsStat)return new Date(+this.topsStat[0][0]).toLocaleDateString("ru")},getProfitOrdersCount:function(){if(this.topsStat)return this.activeTop.reduce((function(t,e){return t+e.pClosedCount}),0)},getAllOrdersCount:function(){if(this.topsStat)return this.activeTop.reduce((function(t,e){return t+e.closedCount}),0)},getLossOrdersCount:function(){if(this.topsStat)return this.getAllOrdersCount-this.getProfitOrdersCount},getInvestCapital:function(){var t;if(this.investStat.length&&this.investStat.length===(null===(t=this.activeTop)||void 0===t?void 0:t.length))return this.investStat.reduce((function(t,e){return t+e.investMoney}),0)},getProfitPercentOrders:function(){if(this.activeTop)return 100*this.getProfitOrdersCount/this.getAllOrdersCount},getMaxDD:function(){if(this.topsStat){var t=[];return this.topsStat.forEach((function(e){e[3]-e[2]<0&&t.push(Math.abs(100*(e[3]-e[2])/e[2]))})),t.length?Math.max.apply(null,t):0}},getPointsForGistogramm:function(){if(this.topsStat){var t;t=this.topsStat.length<30?this.topsStat:this.topsStat.slice(-30);for(var e=[[]],i=0;i<=20;i++)if(t[i]){var o=t[i][3]-t[i][2];e[0].push({x:i,y:o,date:new Date(t[i].date).toLocaleDateString("ru")})}else e[0].push({x:i});return e.unshift([{x:0,y:0,date:new Date}]),e}},getCountSubscribers:function(){if(this.investStat.length&&this.investStat.length===this.activeTop.length)return this.investStat.reduce((function(t,e){return t+e.count}),0)},getInstrumentsTops:function(){if(this.activeTop)return this.activeTop.map((function(t){return{contract:t.contract,profit:t.profitClose,roi:100*t.profitClose/t.volume}}))},getForecast:function(){if(this.topsStat){var t=this.topsStat.slice(-30),e=t[0],i=e[3],o=i+30*i/this.topsStat.length,n=o-i,s=100*n/i;return s}},getCurrencyChar:function(){var t,e;return null!==(t=this.getDefaultAccount)&&void 0!==t&&t.currencyChar?null===(e=this.getDefaultAccount)||void 0===e?void 0:e.currencyChar:"$"},getProfit30days:function(){if(this.topsStat){var t=this.topsStat.slice(-30),e=t[0][2],i=t.at(-1)[3]-e;return 100*i/e}},getProfit7days:function(){if(this.topsStat){var t=this.topsStat.slice(-7),e=t[0][2],i=t.at(-1)[3]-e;return 100*i/e}},getRoiTop:function(){if(this.activeTop){var t=this.activeTop.reduce((function(t,e){return t.push(100*e.profitClose/e.volume),t}),[]),e=t.reduce((function(t,e){return t+e}),0);return e/this.activeTop.length}},getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},iconPath:function(){return{name:"".concat(this.getLeftSideBar?"Block-expand-left-close":"Block-expand-right-close")}},modifierClass:function(){return{class:["LeftBarTops-button","LeftBarTops-button_".concat(this.getActiveTheme)]}}}),methods:{closeLeftSideBar:function(){this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:!this.getLeftSideBar})},setMessageHandler:function(t){var e=this;"GetProviderShortStatistics"===(null===t||void 0===t?void 0:t.command)&&this.accountIds.some((function(e){var i;return e===(null===(i=t.data[0])||void 0===i?void 0:i.accountId)}))&&t.data.forEach((function(t){e.investStat.push(t)}))},getInvestInfo:function(){var t=this;this.accountIds=Object(x["a"])(new Set(this.activeTop.map((function(t){return t.accountId})))),this.accountIds.forEach((function(e){var i=t.activeTop.filter((function(t){return t.accountId===e})).map((function(t){return t.contract}));t.getProfitData(e,i)}))},getProfitData:function(t,e){var i={command:"GetProviderShortStatistics",data:{id:t,contracts:e}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})}},mounted:function(){this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHandler)}},vBt=mBt,yBt=(i("8920"),Object(C["a"])(vBt,QIt,JIt,!1,null,"3f231fcb",null)),CBt=yBt.exports,bBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UserProfileMyInvestments",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[e("TopButtonsBlock",{attrs:{currentPage:t.currentPage,strategyStatus:t.strategyStatus,topsStatus:t.topsStatus},on:{setCurrentPage:t.setCurrentPage,setStratedy:t.setStrategy,setTops:t.setTops}})],1),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.getCreatedPortfolios?t.strategyStatus?e("StrategysForInvesting",{attrs:{activeAccountTypeFilter:t.activeAccountTypeFilter,defaultFilterByTraders:t.defaultFilterByTraders},on:{statusBlockFilter:t.setStatusBlockFilter}}):t.topsStatus?e("TopsForInvesting",{on:{setActiveTop:t.setActiveTop,setTopsStat:t.setTopsStat}}):t.emptyPortfolio?e("EmptyPortfolio",{on:{setCreatePortfolio:t.setCreatePortfolio}}):!t.noStartedPortfolios||"profitMyInvesting"!==t.currentPage&&"DayInvestingStat"!==t.currentPage&&"analiticsPortfolio"!==t.currentPage&&"comparingPortfolio"!==t.currentPage?e("MyInvestContent",{attrs:{currentPage:t.currentPage,createPortfolio:t.createPortfolio,commonStatisticsPortfolios:t.commonStatisticsPortfolios,commonNowStatisticsPortfolios:t.commonNowStatisticsPortfolios}}):e("NoStartPortfolio"):e("div",{staticClass:"loadingBlock"},[e("DxLoadIndicator",{attrs:{id:"large-indicator",height:70,width:70}})],1)],1)],1)},SBt=[],PBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"EmptyPortfolio",class:t.darkClass},[e("div",{staticClass:"screenEmpty"},[e("div",{staticClass:"contentBlock"},[e("img",{attrs:{src:t.getSrcIcon}}),e("div",{staticClass:"textEmpty"},[e("p",[t._v(t._s("".concat(t.$t("start_investing"),"!")))]),t._v(t._s(t.$t("wptbd"))),e("br"),t._v(t._s(t.$t("iatbo")))]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom withText reverse",attrs:{icon:t.getIconData("NewPortfel")},on:{toggle:t.setCreatePortfolio}},[t._v(t._s(t.$t("create_a_portfolio")))])],1)])])])},TBt=[],xBt={name:"EmptyPortfolio",mixins:[xt],components:{CardReadyMadeSolution:xnt},computed:{getSrcIcon:function(){return i("d149")},svgIconData:function(){return Object(c["a"])(Object(c["a"])({},this.getIconData("NewPortfel_BIG")),{},{size:100})}},methods:{setCreatePortfolio:function(){this.$emit("setCreatePortfolio")}}},OBt=xBt,wBt=(i("ff42"),Object(C["a"])(OBt,PBt,TBt,!1,null,"5265aafe",null)),_Bt=wBt.exports,ABt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"EmptyPortfolio",class:t.darkClass},[e("div",{staticClass:"screenEmpty"},[e("div",{staticClass:"contentBlock"},[e("img",{attrs:{src:t.getSrcIcon}}),e("div",{staticClass:"textEmpty"},[e("p",[t._v(t._s(t.$t("start_earning")))]),t._v(t._s(t.$t("yanii"))+" ")])])])])},DBt=[],kBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopPortfoliosForEmpty"},[e("transition",{attrs:{name:"fade"}},[t.getStatusProgress?e("CardAndGraph",{attrs:{empty:!0,accountsArr:t.accountsArr,topPortfolios:t.topPortfolios,statDataReadyMadeSolution:t.statDataReadyMadeSolution,getStatusProgress:t.getStatusProgress,selectedContract:null,getProgress:t.getProgress}}):e("div",{staticClass:"loadingSection"},t._l(9,(function(t){return e("Sceleton",{key:t,attrs:{height:285}})})),1)],1)],1)},IBt=[],BBt={name:"TopPortfoliosForEmpty",components:{CardAndGraph:_tt,Sceleton:nT},props:{},mixins:[Ont],data:function(){return{buttonsValue:{appearance:"blocks",whoAreWeShowing:"tops"}}},watch:{},computed:{getStatusProgress:function(){return"100"===this.getProgressReadyMadeSolution},getProgress:function(){return this.getProgressReadyMadeSolution}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},MBt=BBt,$Bt=(i("71b5"),Object(C["a"])(MBt,kBt,IBt,!1,null,"33a232dc",null)),LBt=$Bt.exports,FBt={name:"NoStartPortfolio",mixins:[xt],components:{TopPortfoliosForEmpty:LBt},computed:{getSrcIcon:function(){return i("35bb")}},methods:{}},jBt=FBt,RBt=(i("31c5"),Object(C["a"])(jBt,ABt,DBt,!1,null,"107c986a",null)),WBt=RBt.exports,NBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StrategysForInvesting"},[e("div",{staticClass:"StrategysForInvesting-head"},[e("ButtonIconFlat",{attrs:{icon:{name:"Youtube-Red"},modifier:{class:["StrategysForInvesting-button","StrategysForInvesting-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setComponent("FavoriteProviders")}}}),e("div",{staticClass:"StrategysForInvesting-titleWrap"},[e("div",{staticClass:"StrategysForInvesting-title",class:"StrategysForInvesting-title_".concat(t.getActiveTheme),style:{background:t.getGreenColor.color}},[t._v("Самые успешные трейдеры платформы")])]),e("div",{staticClass:"StrategysForInvesting-search",class:"StrategysForInvesting-search_".concat(t.getActiveTheme)},[e("DxTextBox",{attrs:{hoverStateEnabled:!1,showClearButton:!0,"focusStateEnabled:":!1,activeStateEnabled:!1,onChange:t.setNameFilter,placeholder:"Поиск по имени",height:"3.2rem",mode:"search"}})],1)],1),e("div",{staticClass:"StrategysForInvesting-content"},[e(t.activeComponent,t._b({key:t.updateByFilter,tag:"component",on:{progressLoaded:t.progressLoaded}},"component",t.getProps,!1))],1)])},EBt=[],UBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"FavoriteProviders",class:t.rootClass},[e("transition-group",{attrs:{name:"fade",appear:""}},[t.emptyProvider?e("div",{key:"noData",staticClass:"noData"},[e("div",{staticClass:"wrapperSvg"},[e("svgIcon",t._b({},"svgIcon",t.iconBigData,!1))],1),t._v(t._s(t.$t("no_data")))]):t.isVisiblePreloader?e("div",{key:"preloader",staticClass:"containerPreloader"},[e("Preloader",{attrs:{opacity:"1",circle:"",enabled:!0,progress:t.getProgress,message:t.alertMessage,enabledMessage:!1,icon:!1}})],1):t._e()]),e("transition-group",{attrs:{name:"fade",appear:""}},[e("div",{directives:[{name:"show",rawName:"v-show",value:"100"===t.getProgress,expression:"getProgress === '100'"}],key:"wrapperCard",ref:"flatTable",staticClass:"wrapperCard"},t._l(t.traders,(function(i,o){return e("ExpertInfoStat",{key:o,attrs:{infoAccount:i,isRows:t.isRows,rowsClass:t.rowsClass,symbol:t.symbol,indexCard:o,skipCount:t.skipCount,isVisiblePreloader:t.isVisiblePreloader,hoveredCard:t.hoveredCard},on:{setDataForGraph:t.setDataForGraph,changeClass:t.changeClass,changeData:t.changeData,openModalSelectPortfolio:t.openModalSelectPortfolio}})})),1)]),e("div",{staticClass:"pagination"},[e("Paginator",{attrs:{pages:t.getPages,toTop:t.toTop},on:{scrollTop:t.onScrollTop,setPage:function(e){return t.getAccounts(e)}}})],1),e("DxTooltip",{attrs:{visible:t.tooltipVisible,target:".cartProviderBlock",position:"bottom",animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v("Добавьте в портфель экспертов")]),t.popupVisible?e("DxPopup",{attrs:{visible:t.popupVisible,"drag-enabled":!1,closeOnOutsideClick:!0,"show-title":!1,position:t.positionPopup,shading:!1,width:t.portfolioSelectionView?250:"auto",height:"auto",container:"body",wrapperAttr:t.wrapperAttrPopup},on:{hidden:t.hidePopup}},[t.portfolioSelectionView?e("PortfolioSelection",{attrs:{portfolio:t.getPortfolioOnlyStatusCreated,refFunctionAddToDraft:t.refFunctionAddToDraft,login:t.login,nameProvider:t.nameProvider,imgFly:t.imgFly,symbol:t.symbol},on:{hiddenModal:t.hidePopup}}):e("ChoiceActionByPortfolio",{attrs:{portfolios:t.getPortfolioOnlyStatusCreated,portfolioId:t.portfolioId},on:{hiddenModal:t.hidePopup}})],1):t._e()],1)},VBt=[],HBt={name:"CardExpertStrategies",inject:["openModalCopyProvider"],mixins:[xt,Ot],props:{traders:{type:Array},buttonsValue:{type:Object},symbol:{type:String,default:""},skipCount:{type:Number},getPages:{type:Array},getAccounts:{type:Function},isVisiblePreloader:{type:Boolean},getProgress:{type:[Number,String]},alertMessage:{type:String},toTop:{type:Boolean},view:{type:String},emptyProvider:{type:Boolean}},components:{ExpertInfoStat:i9,AdaptiveTabBlock:$1,PortfolioSelection:Pq,ChoiceActionByPortfolio:w9,Preloader:ah,Paginator:b9,DxPopup:To["DxPopup"],DxLoadIndicator:OT["DxLoadIndicator"],ButtonView:B9,ControlButtons:R9},data:function(){return{target:null,imgFly:null,refFunctionAddToDraft:null,refContainer:null,login:null,firstFiveStatistic:[],isVisibleModal:!1,timeFade:500,rowsClass:!1,hoveredCard:null,popupVisible:!1,tooltipVisible:!1,nameProvider:"",portfolioId:null,isLoading:!1,portfolioSelectionView:!1,visibleData:{classRow:!1,visibleTopGraphAndVideoBlock:!0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",countPortfolio:"expertsPortfolio/countPortfolio",expertsFace:"expertsPortfolio/expertsFace",getPortfolioOnlyStatusCreated:"expertsPortfolio/getPortfolioOnlyStatusCreated"})),{},{iconBigData:function(){return{name:"BIG_Data",color:this.darkClass.dark?"#bbcee0":"#8c8c8c",size:40}},isRows:function(){return"Rows"===this.view},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{isRows:this.visibleData.classRow})},getPortfolioOnlyStatusCreatedFilter:function(){return this.getPortfolioOnlyStatusCreated.filter((function(t){return"Invest"===t.type}))},isVisiblePortfolio:function(){var t;return(null===(t=this.getPortfolioOnlyStatusCreatedFilter)||void 0===t?void 0:t.length)>0},buttonsArray:function(){return this.getPortfolioOnlyStatusCreatedFilter.map((function(t){var e="Signal"===t.type;return{provider:e,avatarURL:t.avatar,login:t.sources[0].accountId,sequenceId:t.sources[0].accountSequenceId,idBtn:Math.random().toString(36).substring(7),text:t.name,component:t.id,dopClass:"prov_".concat(t.id),disabled:!1,isActive:!1,minWidth:e?40:135,idPortfolio:t.id,status:t.status}}))},positionPopupSelectionPortfolio:function(){return{my:"bottom center",at:"bottom center",of:this.target}},positionPopupChoice:function(){return{my:"top left",at:"bottom left",of:this.target}},positionPopup:function(){return this.portfolioSelectionView?this.positionPopupSelectionPortfolio:this.positionPopupChoice},followIcon:function(){return{name:"Follow",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},wrapperAttrPopup:function(){var t="topPopupPortfolio";return this.darkClass.dark&&(t+=" dark"),{class:t}}}),methods:{viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},setActiveTab:function(t){this.target=".prov_".concat(t),this.portfolioId=t,this.popupVisible=!0},changeClass:function(t){this.rowsClass=t},beforeEnter:function(t){t.style.opacity=0},enter:function(t,e){var i=null,o=this.timeFade;window.requestAnimationFrame((function n(s){i||(i=s);var r=s-i,a=r/o;if(t.style.opacity=a<1?a:1,r0?a:0,r0)return window.requestAnimationFrame(n);e()}))},openVideoModal:function(){var t="https://about.toptrader.ru/wp-content/themes/toptrader/assets/videos/TT_%D0%A1%D0%A2%D0%A0%D0%90%D0%A2%D0%95%D0%93%D0%98%D0%98.mp4";this.$store.dispatch("messenger/setOtherVideo",t),this.$store.dispatch("modal/switchTvWidget",!0)},setDataForGraph:function(t){this.firstFiveStatistic.push(t)},setHover:function(t){this.hoveredCard=t},onScrollTop:function(){this.$refs.flatTable.scrollTop()},openModal:function(){var t=this;this.countPortfolio>0?this.openModalCopyProvider({}):(this.tooltipVisible=!0,setTimeout((function(){t.tooltipVisible=!1}),2e3))},hidePopup:function(){this.popupVisible=!1,this.portfolioSelectionView&&(this.portfolioSelectionView=!1)},openModalSelectPortfolio:function(t){var e=t.target,i=t.refFunctionAddToDraft,o=t.login,n=t.nameProvider,s=t.imgFly;this.target=e,this.refFunctionAddToDraft=i,this.login=o,this.popupVisible=!0,this.nameProvider=n,this.imgFly=s,this.portfolioSelectionView=!0},changeData:function(t){this.visibleData=Object(c["a"])(Object(c["a"])({},this.visibleData),t)}},mounted:function(){this.refContainer=this.$refs.container},destroyed:function(){}},GBt=HBt,qBt=(i("042d"),Object(C["a"])(GBt,UBt,VBt,!1,null,"44d321fb",null)),zBt=qBt.exports,YBt={props:{activeAccountTypeFilter:{default:2},defaultFilterByTraders:{type:Object}},components:{CardExpertStrategies:U9,FavoriteProviders:zBt,DxTextBox:sc["DxTextBox"]},mixins:[qe],data:function(){return{allTraders:[],traders:[],activeComponent:"CardExpertStrategies",theBestFiveTraders:[],skipCount:0,pages:0,countPage:25,progress:0,alertMessage:"",toTop:!1,emptyProvider:!1,timer:null,updateByFilter:!1}},watch:{defaultFilterByTraders:function(){this.sendMessageAccountByFilter(this.defaultFilterByTraders)},getProgressProvider:function(t){"100"===t&&this.$emit("statusBlockFilter",!1)},activeAccountTypeFilter:function(t){var e={takeCount:0,isOrderDesc:!1,IsActiveSource:!0,ProcPosOrdersFrom:50,ProcPosOrdersTo:100,IsRealAccount:!t||1!==t&&null};this.sendMessageAccountByFilter(e)},getDefaultAccount:function(t){t&&this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Created"]})},traders:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!(t.length>0)){i.next=6;break}return o=t.map((function(t){return t.login})),i.next=4,e.getShortSourcesByAccountIds({logins:o,checkStat:!0});case 4:return i.next=6,e.getShortSourcesByAccountIds({logins:o,checkStat:!1});case 6:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getAllFavorites:"favoriteSettings/getAllFavorites",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getColorForFavoriteButton:function(){return"FavoriteProviders"===this.activeComponent?"dark"===this.getActiveTheme?"#333":"#fff":this.getBlueColor.color},getIconForFavorite:function(){var t;return null!==(t=this.getAllFavorites)&&void 0!==t&&t.length?"Favorite-on":"Favorite-off"},getProps:function(){var t={CardExpertStrategies:{traders:this.traders,theBestFiveTraders:this.theBestFiveTraders,skipCount:this.skipCount,getPages:this.getPages,getAccounts:this.getAccounts,getProgress:this.getProgressProvider,toTop:this.toTop,symbol:null,view:"Blocks",emptyProvider:this.emptyProvider,isVisiblePreloader:this.isVisiblePreloader},FavoriteProviders:{traders:this.setFormat(this.getAllFavorites),skipCount:0,getPages:[0],getAccounts:this.getAccounts,getProgress:"100",toTop:this.toTop,symbol:null,view:"Blocks",emptyProvider:this.emptyProvider,isVisiblePreloader:this.isVisiblePreloader}};return t[this.activeComponent]},getTradersByCount:function(){var t=this.allTraders.slice(this.skipCount*this.countPage,this.skipCount*this.countPage+this.countPage);return t},getProgressProvider:function(){if(!this.traders.length)return"";var t=this.progress/this.traders.length*100;return t.toString()},getPages:function(){for(var t=Math.ceil(this.pages/this.countPage),e=[],i=0;i=this.traders.length},isVisiblePreloader:function(){return!this.getStatusProgress}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getShortSourcesByAccountIds:"expertsPortfolio/getShortSourcesByAccountIds",getListsPortfolio:"expertsPortfolio/getListsPortfolio",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},setNameFilter:function(t){if(t.event.target.value){var e={isPublish:!0,order:7,takeCount:0,isOrderDesc:!1,IsActiveSource:!0,FioSubstring:t.event.target.value,GroupType:this.getCryptoStatus?1:0};this.sendMessageAccountByFilter(e)}else this.sendMessageAccountByFilter(this.defaultFilterByTraders)},setFormat:function(t){return t.map((function(t,e){return{accountGroup:t.accountGroupCode,avatar:t.avatarURL,index:e,isOnline:!0,login:t.accountId,sequenceId:t.sequenceId,traderName:t.nameExpert,contract:t.contract}}))},setComponent:function(t){this.activeComponent===t?this.activeComponent="CardExpertStrategies":this.activeComponent=t},sendMessageAccountByFilter:function(t){this.timer=(new Date).getTime(),this.$emit("statusBlockFilter",!0),this.emptyProvider=!1;var e={command:"AccountsByFilter",method:"get",data:t};this.$socketStream.sendCommand({ws:"apiWS",command:e})},setMessageHandler:function(t){"AccountsByFilter"===(null===t||void 0===t?void 0:t.command)&&(this.setStrategy(t.data),0===t.data.length&&(this.emptyProvider=!0,this.$emit("statusBlockFilter",!1))),"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&this.getListsPortfolio(Kq(JSON.parse(t.data)))},progressLoaded:function(){this.progress++},setStrategy:function(t){this.allTraders=t,this.pages=this.allTraders.length,this.allTraders.length?this.getAccounts():this.traders=[]},getAccounts:function(t){var e=this;t&&(this.skipCount=t.skipCount,this.countPage=t.count),this.traders=this.getTradersByCount.map((function(t,i){return{accountGroup:t.accountGroup,sequenceId:t.sequenceId,login:t.accountId,userId:t.ttUserId,userLogin:t.userLogin,index:i+1+e.skipCount*e.countPage,isOnline:!0,avatar:t.avatarURL,traderName:t.firstName+" "+t.lastName}})),this.progress=0,this.updateByFilter=!this.updateByFilter}}),mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler),this.sendMessageAccountByFilter(this.defaultFilterByTraders)},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS3",this.setMessageHandler)}},XBt=YBt,QBt=(i("7493"),Object(C["a"])(XBt,NBt,EBt,!1,null,"63cd9538",null)),JBt=QBt.exports,KBt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopForInvesting"},[e("div",{staticClass:"TopForInvesting-tabs"},[e("div",{ref:"wrapTabs",staticClass:"TopForInvesting-tabsWrap"},[t.getTabsTops?e("AdaptiveTabBlock",{attrs:{tabsSet:t.getTabsTops,refTabWrapper:t.refTabWrapper},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.data;return[e("div",{staticClass:"TopForInvesting-tabItem",on:{click:function(e){return t.setActiveTop(o.index)}}},[e("div",{staticClass:"TopForInvesting-tabItem-title",class:o.index===t.activeTop?"TopForInvesting-tabItem-title_isActive_".concat(t.getActiveTheme):"TopForInvesting-tabItem-title_".concat(t.getActiveTheme)},[t._v(t._s(o.text))]),e("div",{staticClass:"TopForInvesting-tabItem-data",style:{background:t.getLemonColor.gradient,color:t.getLemonColor.color}},[t._v(t._s("".concat(t.$moneyf(o.percent,2),"%")))])])]}}],null,!1,4292472568)}):t._e()],1),e("div",{staticClass:"TopForInvesting-help"})]),e("div",{staticClass:"TopForInvesting-content",staticStyle:{color:"white"}},[e("div",{staticClass:"TopForInvesting-chartTabs"},[e("ButtonIconFlat",{attrs:{modifier:{class:["TopForInvesting-chartTab","RoiChart"===t.activeComponent?"TopForInvesting-chartTab_isActive_".concat(t.getActiveTheme):"TopForInvesting-chartTab_".concat(t.getActiveTheme),"TopForInvesting-chartTab-first"]}},on:{click:function(e){return t.setActiveComponent({component:"RoiChart"})}}},[t._v("ROI")]),e("div",{staticClass:"TopForInvesting-chartTab-profit"},[e("div",{staticClass:"TopForInvesting-chartTab-profit-title",class:"TopForInvesting-chartTab-profit-title_".concat(t.getActiveTheme)},[t._v("Доход за:")]),e("div",{staticClass:"TopForInvesting-chartTab-profitButtons"},[e("ButtonIconFlat",{attrs:{modifier:{class:["TopForInvesting-chartTab","PeriodTopChart"===t.activeComponent&&"week"===t.period?"TopForInvesting-chartTab_isActive_".concat(t.getActiveTheme):"TopForInvesting-chartTab_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({component:"PeriodTopChart",param:["period","week"]})}}},[t._v("7 дней")]),e("ButtonIconFlat",{attrs:{modifier:{class:["TopForInvesting-chartTab","PeriodTopChart"===t.activeComponent&&"month"===t.period?"TopForInvesting-chartTab_isActive_".concat(t.getActiveTheme):"TopForInvesting-chartTab_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({component:"PeriodTopChart",param:["period","month"]})}}},[t._v("30 дней")])],1)]),e("ButtonIconFlat",{attrs:{modifier:{class:["TopForInvesting-chartTab","ComparisonTopParticipants"===t.activeComponent?"TopForInvesting-chartTab_isActive_".concat(t.getActiveTheme):"TopForInvesting-chartTab_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent({component:"ComparisonTopParticipants"})}}},[t._v("Сравнение")]),e("ButtonIconFlat",{attrs:{modifier:{class:["TopForInvesting-chartTab","AnaliticForTops"===t.activeComponent?"TopForInvesting-chartTab_isActive_".concat(t.getActiveTheme):"TopForInvesting-chartTab_".concat(t.getActiveTheme),"TopForInvesting-chartTab-last"]}},on:{click:function(e){return t.setActiveComponent({component:"AnaliticForTops"})}}},[t._v("Аналитика")])],1),e("div",{staticClass:"TopForInvesting-chartWrap"},["100"===t.getProgressReadyMadeSolution?e(t.activeComponent,t._b({tag:"component"},"component",t.getPropsActiveComponent,!1)):t._e()],1)])])},ZBt=[],tMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"RoiChart"},[t.getMetaInfoLines?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.getMetaInfoLines,typeXAxis:"dateClear",theme:t.getActiveTheme,maxIndicator:{lines:[0]},minIndicator:{lines:[0]}}}):t._e()],1)},eMt=[],iMt={props:{combineStat:{default:null}},mixins:[qe],components:{LineEventChart:Uk},data:function(){return{points:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getMetaInfoLines:function(){if(this.points&&this.points[0].length)return[{type:"line",color:this.getBlueColor.color,fill:this.getBlueColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("poct")}]}}),methods:{setPointsForChart:function(){var t=this;this.points=[[]],this.combineStat.forEach((function(e){t.points[0].push({x:+e[0],y:e[1],date:new Date(+e[0])})}))}},mounted:function(){this.setPointsForChart()}},oMt=iMt,nMt=(i("57ad0"),Object(C["a"])(oMt,tMt,eMt,!1,null,null,null)),sMt=nMt.exports,rMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PeriodTopChart"},[e("div",{staticClass:"PeriodTopChart-table"},[e("TableColumnsCustom",{attrs:{dataTable:t.getDataForTable,columns:t.getColumnsForTable,indexHoverRow:t.hoverIndex,stickyHeader:!0},scopedSlots:t._u([{key:"column",fn:function(i){var o=i.data,n=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell",style:{color:o.color}},[t._v(t._s(n))])]}},{key:"date",fn:function(i){var o=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell"},[t._v(t._s(o))])]}}])})],1),e("div",{staticClass:"PeriodTopChart-chartWrap"},[e("div",{ref:"chart",staticClass:"PeriodTopChart-chart"},[t.points?e("SectorLineEventChart",{key:t.period,attrs:{typeXAxis:"week"!==t.period?"date":t.period,points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e(),e("div",{class:"PeriodTopChart-statData PeriodTopChart-statData_".concat(t.getActiveTheme)},[t.getCurrentProfit?e("div",{class:"PeriodTopChart-currentProfit PeriodTopChart-currentProfit_".concat(t.getActiveTheme),style:{color:t.getCurrentProfit[0].data<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"PeriodTopChart-currentProfit-arrow"}),e("div",{staticClass:"PeriodTopChart-currentProfit-data",class:"PeriodTopChart-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getCurrentProfit[0].data,2)," / ").concat(t.$moneyf(t.getCurrentProfit[1].data,2),"%")))]),e("div",{staticClass:"PeriodTopChart-currentProfit-title",class:"PeriodTopChart-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"PeriodTopChart-currentProfit-text",class:"PeriodTopChart-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(t.getCurrentProfit[0].text))])])]):t._e()])],1),e("div",{staticClass:"PeriodTopChart-titleGistogramm",class:"PeriodTopChart-titleGistogramm_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("histogram_of_income"),", %")))]),e("div",{staticClass:"PeriodTopChart-gistogramm"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:"week"!==t.period?"date":t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)])])},aMt=[],cMt={props:{combineStat:{default:null},period:{default:"week"}},components:{SectorLineEventChart:Fj,GistogrammEventChart:TI,TableColumnsCustom:p2},data:function(){return{points:null,pointsForGistogramm:null,hoverIndex:null,positionHoverWidget:{top:"0px",right:"0px"}}},mixins:[qe],watch:{period:function(){this.setPointsForChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getDataForTable:function(){var t=this;return this.getStatForPeriod.map((function(e){var i=e[3]-e[2],o=i?100*i/e[2]:0;return{date:"".concat(new Date(+e[0]).getDate()>9?new Date(+e[0]).getDate():"0".concat(new Date(+e[0]).getDate()),".").concat(new Date(+e[0]).getMonth()+1>9?new Date(+e[0]).getMonth()+1:"0".concat(new Date(+e[0]).getMonth()+1)),profitDay:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i,2),"/ %").concat(t.$moneyf(o,2)),color:i<0?t.getRedColor.color:t.getGreenColor.color,profitMonth:o}}))},getColumnsForTable:function(){return[{title:this.$t("date"),field:"date",sortingEnabled:!1,cellTemplate:"date",width:"60px",align:"center"},{title:this.$t("profit"),field:"profitDay",sortingEnabled:!1,cellTemplate:"column",align:"center"}]},getStatForPeriod:function(){var t={week:-7,month:-30,year:-365};return this.combineStat.slice(t[this.period])},getCurrentProfit:function(){var t=this.getStatForPeriod[0][2],e=this.getStatForPeriod.at(-1)[3],i=e-t,o=i?100*i/t:0;if(this.points&&this.points.length)return[{data:i,text:this.$t("poct")},{data:o,text:this.$t("current_income")}]},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length)return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1].at(-1).y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]},getMetaInfoForLines:function(){if(this.points&&this.points[1].length){var t=this.points[1].at(-1).y;return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"line",color:t<0?this.getRedColor.color:this.getGreenColor.color,fill:t<0?this.getRedColor.fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]}}}),methods:{hoverPoint:function(t){this.hoverIndex=t?this.getStatByPeriod.findIndex((function(e){return new Date(+e[0]).getTime()===new Date(t.point.date).getTime()})):null},setPointsForChart:function(){var t=this,e=this.getStatForPeriod[0][2];this.points=[[]],this.pointsForGistogramm=[[]],this.getStatForPeriod.forEach((function(e,i){var o=e[3]-e[2],n=o?100*o/e[2]:0;t.points[0].push({x:i,y:e[3],date:new Date(+e[0])}),t.pointsForGistogramm[0].push({x:i,y:n,date:new Date(+e[0])})})),this.pointsForGistogramm.unshift([{x:0,y:0,date:new Date}]),this.points.unshift([{x:0,y:e,date:new Date(+this.getStatForPeriod[0][0])}])}},mounted:function(){this.setPointsForChart()}},lMt=cMt,uMt=(i("2d81"),Object(C["a"])(lMt,rMt,aMt,!1,null,null,null)),dMt=uMt.exports,hMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnaliticForTops"},[t.statData?e("AnalyticStatistic",{attrs:{analyticData:t.statData}}):t._e()],1)},pMt=[],gMt={props:{topPortfolios:{default:null}},components:{AnalyticStatistic:bot},data:function(){return{statData:null}},methods:{setMessageHandler:function(t){"AccountShortStatisticV2"===(null===t||void 0===t?void 0:t.command)&&(this.statData=this.getObjectStat(JSON.parse(t.data)))},getObjectStat:function(t){var e=[];return t.forEach((function(t){e.push(zot(t))})),e},getAnalyticData:function(t){var e=this.sourcesByAccounts(t),i={command:"AccountShortStatisticV2",data:{datas:e,ByContract:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:i})},sourcesByAccounts:function(t){var e={};return t.forEach((function(t){e[t.accountId]||(e[t.accountId]=[]),e[t.accountId].push(t.contract)})),Object.entries(e).map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return{accountId:i,contracts:o}}))}},mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler),this.getAnalyticData(this.topPortfolios)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},fMt=gMt,mMt=(i("0b3d"),Object(C["a"])(fMt,hMt,pMt,!1,null,null,null)),vMt=mMt.exports,yMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ComparisonTopParticipants"},[e("div",{staticClass:"ComparisonTopParticipants-chartContent",class:"ComparisonTopParticipants-chartContent_".concat(t.getActiveTheme)},[e("VuePerfectScrollbar",{staticClass:"ComparisonTopParticipants-experts"},[e("transition-group",{attrs:{name:"listExperts",tag:"div"}},t._l(t.expertsSorted,(function(i){return e("div",{key:i.uniqueId,staticClass:"ComparisonTopParticipants-oneExpert",on:{mouseenter:function(e){return t.setHoverExpert(i.uniqueId)},mouseleave:function(e){return t.setHoverExpert(null)}}},[e("DataExpert",{attrs:{location:"portfolio",expert:i,checkedExperts:t.checkedExperts,color:i.color,noName:!1,contractMode:!1}})],1)})),0)],1),e("div",{staticClass:"ComparisonTopParticipants-chart"},[t.points?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.metaInfoLines,typeXAxis:"dateClear",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1,watermark:t.$t("comparison")}}):t._e()],1)],1)])},CMt=[],bMt={name:"ComparisonTopParticipants",mixins:[xt,qe],components:{DataExpert:ZR,UserProfileGridWidgetTopBar:nM,LineEventChart:Uk,VuePerfectScrollbar:Xt.a},provide:function(){return{setCheckedExperts:this.setCheckedExperts}},props:{statDataReadyMadeSolution:{default:null},topPortfolios:{default:null}},data:function(){return{points:null,checkedExperts:[],metaInfoLines:null,hoverExpert:null}},computed:{getColorsForChart:function(){var t=this,e=[];return this.topPortfolios.forEach((function(i,o){var n=t.getSetRandomColors[o]?t.getSetRandomColors[o]:uB();e.push({color:n.color,fill:n.fill,id:i.id})})),e},expertsForStat:function(){var t=this,e=[];return this.topPortfolios.forEach((function(i,o){var n=t.statDataReadyMadeSolution.find((function(t){return t.accountId===i.accountId&&t.contract===i.contract})).data,s=n.at(-1).profitClose&&n.at(-1).usedVolume?100*n.at(-1).profitClose/n.at(-1).usedVolume:0;e.push(Object(c["a"])(Object(c["a"])({},i),{},{data:n,avatar:i.avatarURL,iAmProvider:[],sources:[i],traderName:i.userName,uniqueId:"".concat(i.accountId).concat(i.contract),color:t.getColorsForChart[o].color,fill:t.getColorsForChart[o].fill,activeStatus:!0,login:i.accountId,symbolProfit:"%",profit:s}))})),e},expertsSorted:function(){var t=this;if(this.checkedExperts.length)return this.expertsForStat.sort((function(e,i){var o,n;return!(null===(o=t.checkedExperts.find((function(t){return t.uniqueId===i.uniqueId})))||void 0===o||!o.status)-!(null===(n=t.checkedExperts.find((function(t){return t.uniqueId===e.uniqueId})))||void 0===n||!n.status)})).sort((function(t,e){return e.profit-t.profit}))},expertFiltered:function(){var t=this;if(this.checkedExperts.length)return this.expertsForStat.filter((function(e){var i=t.checkedExperts.find((function(t){return t.uniqueId===e.uniqueId}));return i.status}))}},methods:{setCheckedExperts:function(t,e){var i=e.uniqueId,o=this.checkedExperts.find((function(t){return t.uniqueId===i}));o.status=t,this.setPointsForChart()},setHoverExpert:function(t){this.hoverExpert=t,this.setPointsForChart()},setCheckedExpert:function(){this.expertsForStat&&(this.checkedExperts=this.expertsForStat.map((function(t){return{login:t.login,uniqueId:t.uniqueId,status:!0,profit:t.profit}})))},setPointsForChart:function(){var t=this;this.points=[],this.metaInfoLines=[],this.expertFiltered.forEach((function(e){t.points.push([]),t.metaInfoLines.push({type:"line",color:e.color,fill:t.hoverExpert===e.uniqueId?e.color:e.fill,fillIndicator:"dark"===t.getActiveTheme?"#151924":"#fff",label:"",lineWidth:t.hoverExpert===e.uniqueId?7:3,title:"Доход по закрытым сделкам от ".concat(e.traderName," ").concat(e.symbol)}),e.data.forEach((function(e){var i=e.profitClose&&e.usedVolume?100*e.profitClose/e.usedVolume:0;t.points.at(-1).push({x:new Date(e.date).getTime(),date:e.date,y:i})}))}))}},mounted:function(){this.setCheckedExpert(),this.setPointsForChart()}},SMt=bMt,PMt=(i("10ab"),Object(C["a"])(SMt,yMt,CMt,!1,null,null,null)),TMt=PMt.exports,xMt={components:{AdaptiveTabBlock:$1,RoiChart:sMt,PeriodTopChart:dMt,AnaliticForTops:vMt,ComparisonTopParticipants:TMt},mixins:[qe],data:function(){return{loadingTop:!0,topPortfolios:[],accountsArr:[],statDataReadyMadeSolution:[],countTops:[3,5,10,15,20,25],filtersByReadyMadeSolution:{ProcPosOrdersFrom:80,ProcPosOrdersTo:100,contract:null,limit:25},activeTop:0,instrumentType:"CFD",refTabWrapper:null,activeComponent:"RoiChart",combineStat:null,period:"week"}},watch:{getProgressReadyMadeSolution:function(t){"100"===t&&(this.combineStat=Oq(this.topPortfolios[this.activeTop],this.statDataReadyMadeSolution),this.$emit("setTopsStat",this.combineStat))},getDefaultAccount:function(){this.fetchHandler()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},getPropsActiveComponent:function(){var t={RoiChart:{combineStat:this.combineStat},PeriodTopChart:{combineStat:this.combineStat,period:this.period},AnaliticForTops:{topPortfolios:this.topPortfolios[this.activeTop]},ComparisonTopParticipants:{statDataReadyMadeSolution:this.statDataReadyMadeSolution,topPortfolios:this.topPortfolios[this.activeTop]}};return t[this.activeComponent]},isBlockView:function(){return!1},getProgressReadyMadeSolution:function(){if(!this.topPortfolios.length)return"";var t=this.topPortfolios[this.activeTop].length,e=this.statDataReadyMadeSolution.length,i=e/t*100;return i.toString()},getTabsTops:function(){var t=this;if(this.topPortfolios.length)return this.topPortfolios.map((function(e,i){var o=e.reduce((function(t,e){return t.push(100*e.profitClose/e.volume),t}),[]),n=o.reduce((function(t,e){return t+e}),0);return{text:"Top ".concat(e.length),index:i,icon:"",percent:n?n/e.length:0,dopClass:"TopForInvesting-tab",isActive:t.activeTop===i,component:"TopContent",minWidth:160,ref:"top_".concat(e.length),isVisible:"All"}}))}}),methods:{setActiveComponent:function(t){this.activeComponent=t.component,t.param&&(this[t.param[0]]=t.param[1])},setActiveTop:function(t){"100"===this.getProgressReadyMadeSolution&&(this.activeTop=t,this.statDataReadyMadeSolution=[],this.setStatForActiveTop())},setStatForActiveTop:function(){var t=this;this.$emit("setActiveTop",this.topPortfolios[this.activeTop]),this.topPortfolios[this.activeTop].forEach((function(e){t.getStatForTop(e.accountId,e.contract)}))},fetchHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.emptyProvider=!1,i=Object(c["a"])(Object(c["a"])({},t.filtersByReadyMadeSolution),{},{posProcFrom:t.filtersByReadyMadeSolution.ProcPosOrdersFrom,posProcTo:t.filtersByReadyMadeSolution.ProcPosOrdersTo,instrumentType:t.getCryptoStatus?"CFD":"ForexSpot"}),delete i.ProcPosOrdersFrom,delete i.ProcPosOrdersTo,e.next=6,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 6:return o=e.sent,e.next=9,t.$http.post("".concat(t.getApiUrl,"GetTopAccountsByFilter"),i,{headers:{"Content-Type":"application/json","X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o}});case 9:if(n=e.sent,s=n.data,0!==s.count){e.next=15;break}return t.emptyProvider=!0,t.loadingTop=!1,e.abrupt("return");case 15:a=!1,t.countTops.forEach((function(e){if(!a){var i=s.data.slice(0,e);t.topPortfolios.push(i),i.length>=s.data.length&&(a=!0)}})),t.loadingTop=!1,t.setStatForActiveTop();case 19:case"end":return e.stop()}}),e)})))()},getStatForTop:function(t,e){var i=new Date(this.getServerTime.now),o=i.getFullYear()-1,n=i.getMonth(),s=i.getDay(),r=new Date(o,n,s),a={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:t,contracts:[e],DateRequest:r,forChart:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:a})},setStat:function(t){this.statDataReadyMadeSolution.push({accountId:t.dailyData.accountId,data:t.data,contract:t.data[0].contract})},setMessageHandlerMixin:function(t){if("100"!==this.getProgressReadyMadeSolution&&"ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}}},mounted:function(){var t=this;this.$nextTick((function(){t.refTabWrapper=t.$refs.wrapTabs})),this.fetchHandler(),this.$socketStream.$on("apiWS3",this.setMessageHandlerMixin)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandlerMixin)}},OMt=xMt,wMt=(i("89b2"),Object(C["a"])(OMt,KBt,ZBt,!1,null,null,null)),_Mt=wMt.exports,AMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyInvestContent",class:t.darkClass},[t._t("default"),e("div",{staticClass:"investingContent"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[e(t.currentComponent,t._b({tag:"component"},"component",t.getPropsForComponents,!1))],1)],1)],2)},DMt=[],kMt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"GraphBlock",style:{paddingBottom:"32px"}},[e("div",{staticClass:"GraphBlock-groupButton"},[e("div",{staticClass:"GraphBlock-buttonBlock"},t._l(t.getButtons,(function(i,o){return e("ButtonIconFlat",{attrs:{modifier:{class:["GraphBlock-button",i.component===t.activeComponent?"GraphBlock-button_isActive_".concat(t.getActiveTheme):"GraphBlock-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setActiveComponent(i.component)},mouseenter:function(e){return t.mouseenterHandler(e,i.tooltip)},mouseleave:t.hideTooltip}},[t._v(t._s(i.text))])})),1)]),e("div",{staticClass:"GraphBlock-content"},[e("div",{staticClass:"GraphBlock-contentGrid"},[t.findPortfolio?e(t.activeComponent,t._b({tag:"components",on:{setActiveDate:t.setReportDate}},"components",t.activeConfigComponent,!1)):t._e(),t.isLoadingOrders?t._e():e("UserProfileTable",{key:t.countsOrders,attrs:{loadedSessionTableData:t.loadedSessionTableData,selectorContainer:".MyInvestContent",outsideData:!0,getDataForTableOutside:t.getDataForTable,investPortfolio:!0}}),t.statusDayReport?e("DxPopup",{attrs:{visible:t.statusDayReport,shading:!1,width:360,wrapperAttr:{class:"GraphBlock"},height:800,maxHeight:"calc(100vh - 200px)",dragEnabled:!0,container:".GraphBlock",dragOutsideBoundary:!0,position:{my:"left top",at:"left top",of:".GraphBlock",offset:{y:70,x:t.xWidthPoint<=360?360:0}}},scopedSlots:t._u([{key:"title",fn:function(){return[t.statusDayReport?e("DayReportByPortfolioWidget",{attrs:{statDay:t.statDay},on:{close:t.closeReport}}):t._e()]},proxy:!0}],null,!1,294128263)}):t._e()],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTooltip,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.tooltipText))])],1)},IMt=[],BMt=function(){var t=this,e=t._self._c;return e("div",{ref:"reportWrap",class:"userProfileDayReport userProfileDayReport_".concat(t.getActiveTheme),style:"left"===t.side?{left:0}:{right:0}},[e("div",{staticClass:"userProfileDayReport-wrapper"},[e("div",{class:"userProfileDayReport-title userProfileDayReport-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-titleText"},[t._v(t._s(t.$t("report_for"))+" "+t._s(t.getDateForDay))]),e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["userProfileDayReport-controlButtonItem","userProfileDayReport-controlButtonItem_".concat(t.getActiveTheme)]}},on:{toggle:t.closeReport}})],1),e("div",{class:"userProfileDayReport-content userProfileDayReport-content_".concat(t.getActiveTheme)},[e("DxAccordion",{key:t.getRerenderStatus,attrs:{"data-source":t.getAccordionTabs,height:"100%",hoverStateEnabled:!1},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{class:"userProfileDayReport-titleAccordion userProfileDayReport-titleAccordion_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-textAccordionTitle"},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray"),staticStyle:{"flex-basis":"auto"}},[t._v(t._s(o.title))]),e("div",{class:"userProfileDayReport-count userProfileDayReport-count_".concat(t.getActiveTheme)},[t._v(t._s(o.count))]),3===o.ID&&o.count?e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(t.getSumProfitClose<0?"red":"green"),staticStyle:{"margin-left":"auto"}},[t._v("$ "+t._s(t.$moneyf(t.getSumProfitClose,Math.abs(t.getSumProfitClose)>=1e4?0:2)))]):t._e()])])]}},{key:"item",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{staticClass:"userProfileDayReport-accordionWrap"},[1===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-textItem userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(o)))]),e("div",{class:"userProfileDayReport-valueStat userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(i.data))])])})),0):t._e(),2===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-avatarTitle"}),e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v(t._s(t.$t("open_price")))])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-avatarTitle"},[e("Avatar",{attrs:{src:i.sourceUserAvatar,theme:t.getActiveTheme,size:"2"}})],1),e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-priceOpenTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.openPrice))])])}))],2):t._e(),3===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-avatarTitle"}),e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"userProfileDayReport-profitTitle"},[t._v("PL, %")])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-avatarTitle"},[e("Avatar",{attrs:{src:i.sourceUserAvatar,theme:t.getActiveTheme,size:"2"}})],1),e("div",{class:"userProfileDayReport-contactTitle userProfileDayReport-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"userProfileDayReport-typeOrderTitle ".concat("Buy"===i.orderType?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit))]),e("div",{class:"userProfileDayReport-profitTitle ".concat(i.profit<0?"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-red"):"userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s((100/(i.volume/i.profit)).toFixed(2)))])])}))],2):t._e(),4===o.ID?e("div",{staticClass:"userProfileDayReport-contentAccordion"},[e("div",{staticClass:"userProfileDayReport-contentWrap"},[e("div",{staticClass:"userProfileDayReport-profitTabs"},[e("div",{staticClass:"userProfileDayReport-profitTabWrap"},t._l(t.analiticsTabs,(function(i,o){return e("div",{key:o,staticClass:"userProfileDayReport-profitTab",class:i.mode===t.analiticsMode?"userProfileDayReport-profitTab_isActive_".concat(t.getActiveTheme):"userProfileDayReport-profitTab_".concat(t.getActiveTheme),on:{click:function(e){return t.setAnaliticsMode(i.mode)}}},[t._v(t._s(i.text))])})),0)]),e("div",{staticClass:"userProfileDayReport-closeVolumeWrap"},[t.getAnalitics&&t.getAnalitics.length?e("div",{staticClass:"userProfileDayReport-diagramWrapper"},[e("SectorDiagram",{attrs:{height:210,width:210,widthBorder:65,percents:t.getAnalitics}})],1):e("div",{class:"userProfileDayReport-closeVolumeNoData userProfileDayReport-closeVolumeNoData_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}}),e("div",{class:"userProfileDayReport-closeVolumeTitle userProfileDayReport-closeVolumeTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("twenc")))])],1),e("div",{class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileDayReport-avatarTitle"}),e("div",{staticClass:"userProfileDayReport-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"userProfileDayReport-volumeTitle"},[t._v(t._s(t.$t("income")))]),e("div",{staticClass:"userProfileDayReport-priceOpenTitle"},[t._v(t._s(t.$t("of_total")))])]),t._l(t.getAnalitics,(function(i,o){return e("div",{key:o,class:"userProfileDayReport-listStatItem userProfileDayReport-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"userProfileDayReport-avatarTitle",style:{color:i.color,fontWeight:600}},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"2"}})],1),e("div",{class:"userProfileDayReport-contactTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.symbol))]),e("div",{class:"userProfileDayReport-volumeTitle userProfileDayReport-valueStat_".concat(t.getActiveTheme,"-gray"),style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$".concat(t.$moneyf(i.profit,2))))]),e("div",{class:"userProfileDayReport-priceOpenTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(t.$moneyf(i.data,2)))])])}))],2),e("div",{staticClass:"userProfileDayReport-profitStatWrap"},[e("div",{staticClass:"userProfileDayReport-closeVolumeTitle",class:"userProfileDayReport-closeVolumeTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.getStatusPorvider?t.$t("provider_profit_statistics"):t.$t("psop")))]),e("div",{staticClass:"userProfileDayReport-profitStat"},[e("ExpertTabBlock",{attrs:{owner:"myStat"===t.statDay.mode,activeDate:t.statDay.date}})],1)])])]):t._e()])]}}])})],1)])])},MMt=[],$Mt={components:{ExpertTabBlock:Wkt,Avatar:E,DxAccordion:uw.a,SectorDiagram:MB,VuePerfectScrollbar:Xt.a},mixins:[yn,qe],props:{statDay:{type:[Object,Array]},side:{default:"left"}},data:function(){return{accordionData:null,statSourcesForDate:null,portfolioStat:[],statContract:null,heightWrap:0,analiticsTabs:[{mode:"income",text:this.$t("income")},{mode:"loss",text:this.$t("loss")}],analiticsMode:"income"}},watch:{statDay:function(){this.setDataForPortfolio()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatData:"statDataForPortfolio/getStatData",getActiveTheme:"headerSettings/getActiveTheme",findPortfolio:"expertsPortfolio/findPortfolio",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders"})),{},{getStatusPorvider:function(){if(this.findPortfolio)return"Signal"===this.findPortfolio.type},getAnalitics:function(){return"income"===this.analiticsMode?this.getSectorDiagramObject:this.getSectorDiagramObjectByLoss},getOpenOrdersByDay:function(){var t=this;if(!this.openOrders||!this.openOrders.length)return[];var e=this.openOrders.filter((function(e){return new Date(e.createdDate).getFullYear()===new Date(t.statDay.date).getFullYear()&&new Date(e.createdDate).getMonth()===new Date(t.statDay.date).getMonth()&&new Date(e.createdDate).getDate()===new Date(t.statDay.date).getDate()}));return e},getCloseOrdersByDay:function(){var t=this;if(!this.closedOrders||!this.closedOrders.length)return[];var e=this.closedOrders.filter((function(e){return new Date(e.closedDate).getFullYear()===new Date(t.statDay.date).getFullYear()&&new Date(e.closedDate).getMonth()===new Date(t.statDay.date).getMonth()&&new Date(e.closedDate).getDate()===new Date(t.statDay.date).getDate()}));return e},getDateForDay:function(){return new Date(this.statDay.date).toLocaleDateString("ru")},getStatForReport:function(){return this.getStatData[this.statDay.mode]},getSectorDiagramObject:function(){var t=this;if(this.statSourcesForDate){var e=this.statSourcesForDate.reduce((function(t,e){return t+(e.statDay.profitClose+e.statDay.floatingProfitClose)}),0),i=[];return this.statSourcesForDate.forEach((function(o,n){var s=o.statDay.profitClose+o.statDay.floatingProfitClose;s>0&&i.push({avatar:o.source.avatar,profit:s,symbol:o.statDay.contract,color:t.getSetRandomColors[n]?t.getSetRandomColors[n].color:LMt,data:e&&s?100*s/e:0})})),i}},getSectorDiagramObjectByLoss:function(){var t=this;if(this.statSourcesForDate){var e=this.statSourcesForDate.reduce((function(t,e){return t+(e.statDay.profitClose+e.statDay.floatingProfitClose)}),0),i=[];return this.statSourcesForDate.forEach((function(o,n){var s=o.statDay.profitClose+o.statDay.floatingProfitClose;s<0&&i.push({avatar:o.source.avatar,profit:s,symbol:o.statDay.contract,color:t.getSetRandomColors[n]?t.getSetRandomColors[n].color:LMt,data:e&&s?100*s/e:0})})),i}},getRerenderStatus:function(){return this.getActiveTheme+this.heightWrap},getAccordionTabs:function(){if(this.getStatDataForReport&&this.getSectorDiagramObject)return"myStat"===this.statDay.mode?[{ID:1,title:this.getStatusPorvider?this.$t("prsftd"):this.$t("psftd"),data:this.getStatDataForReport},{ID:2,title:this.$t("open_trades"),count:this.getOpenOrdersByDay.length,data:this.getOpenOrdersByDay},{ID:3,title:this.$t("closed_trades"),count:this.getCloseOrdersByDay.length,data:this.getCloseOrdersByDay},{ID:4,title:this.getStatusPorvider?this.$t("provider_instruments"):this.$t("portfolio_participants"),data:0}]:[{ID:1,title:this.getStatusPorvider?this.$t("prsftd"):this.$t("psftd"),data:this.getStatDataForReport},{ID:4,title:this.getStatusPorvider?this.$t("provider_instruments"):this.$t("portfolio_participants"),data:this.statSourcesForDate}]},getSumProfitOpen:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.profitOpen}),0)},getSharp:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.sharp}),0)},getSumProfitClose:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.profitClose}),0)},getDeltaProfitCloseByDay:function(){if(this.statSourcesForDate)return this.getSumProfitClose-this.getSumProfitOpen},getAverProfitCloseOnSource:function(){if(this.statSourcesForDate)return this.getDeltaProfitCloseByDay?this.getDeltaProfitCloseByDay/this.statSourcesForDate.length:0},getAverProfitCloseOnSourcePercent:function(){if(this.statSourcesForDate)return this.getSumPercentProfitClose?this.getSumPercentProfitClose/this.statSourcesForDate.length:0},getSumPercentProfitClose:function(){if(this.statSourcesForDate){var t=this.getDeltaProfitCloseByDay&&this.getSumProfitOpen?100*this.getDeltaProfitCloseByDay/this.getSumProfitOpen:0;return this.getSumProfitOpen<0&&(t*=-1),t}},getSumCloseOrders:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.closedCount}),0)},getSumProfitCloseOrders:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.pClosedCount}),0)},getSumPercentProfitCloseOrders:function(){if(this.statSourcesForDate)return this.getSumProfitCloseOrders&&this.getSumCloseOrders?100*this.getSumProfitCloseOrders/this.getSumCloseOrders:0},getSumUsedVolume:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.usedVolume}),0)},getSumFloatingOpen:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.floatingProfitOpen}),0)},getSumFloatingClose:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.floatingProfitClose}),0)},getDeltaFloatingCloseByDay:function(){if(this.statSourcesForDate)return this.getSumFloatingClose-this.getSumFloatingOpen},getDeltaFloatingClosePercentByDay:function(){if(this.statSourcesForDate){var t=this.getDeltaFloatingCloseByDay&&this.getSumFloatingOpen?100*this.getDeltaFloatingCloseByDay/this.getSumFloatingOpen:0;return this.getSumFloatingOpen<0&&(t*=-1),t}},getSumVolumegClose:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.volumeClose}),0)},getSumPercentFloating:function(){if(this.statSourcesForDate)return this.statSourcesForDate.reduce((function(t,e){return t+e.statDay.volumeClose}),0)},getAbsoluteOpenProfit:function(){if(this.statSourcesForDate)return this.getSumFloatingOpen+this.getSumProfitOpen},getAbsoluteCloseProfit:function(){if(this.statSourcesForDate)return this.getSumFloatingClose+this.getSumProfitClose},getAbsoluteDeltaProfit:function(){if(this.statSourcesForDate)return this.getAbsoluteCloseProfit-this.getAbsoluteOpenProfit},getAbsoluteDeltaPercentProfit:function(){if(this.statSourcesForDate){var t=this.getAbsoluteDeltaProfit&&this.getAbsoluteOpenProfit?100*this.getAbsoluteDeltaProfit/this.getAbsoluteOpenProfit:0;return this.getAbsoluteOpenProfit<0&&(t*=-1),t}},getSourceCount:function(){if(this.statSourcesForDate){var t=this.statSourcesForDate.map((function(t){return t.source.login}));return Object(x["a"])(new Set(t))}},getStatDataForReport:function(){if(this.statSourcesForDate)return{trading_day:{data:new Date(this.statDay.date).toLocaleDateString("ru"),color:"gray",symbol:""},iocta:{data:this.$moneyf(this.getSumProfitOpen,2),color:this.getSumProfitOpen<0?"red":"blue",symbol:"$"},ioctat:{data:this.$moneyf(this.getSumProfitClose,Math.abs(this.getSumProfitClose)>=1e4?0:2),color:this.getSumProfitClose<0?"red":"blue",symbol:"$"},ifctf:{data:this.$moneyf(this.getDeltaProfitCloseByDay,Math.abs(this.getDeltaProfitCloseByDay)>=1e4?0:2),color:this.getDeltaProfitCloseByDay<0?"red":"blue",symbol:"$"},ifctfp:{data:this.$moneyf(this.getSumPercentProfitClose,2),color:this.getSumPercentProfitClose<0?"red":"blue",symbol:"%"},aippo:{data:this.$moneyf(this.getAverProfitCloseOnSource,Math.abs(this.getAverProfitCloseOnSource)>=1e4?0:2),color:this.getAverProfitCloseOnSource<0?"red":"blue",symbol:"$"},aippop:{data:this.$moneyf(this.getAverProfitCloseOnSourcePercent,2),color:this.getAverProfitCloseOnSourcePercent<0?"red":"blue",symbol:"%"},voct:{data:this.$moneyf(this.getSumUsedVolume),color:"gray",symbol:"$"},total_closed_trades:{data:this.$moneyf(this.getSumCloseOrders),color:"gray"},successful_trades:{data:this.$moneyf(this.getSumProfitCloseOrders),color:"gray"},successful_trades_percent:{data:Math.round(this.getSumPercentProfitCloseOrders),color:this.getSumPercentProfitCloseOrders<30?"red":this.getSumPercentProfitCloseOrders>30&&this.getSumPercentProfitCloseOrders<65?"orange":"green",symbol:"%"},sharpe_ratio:{data:Math.round(this.getSharp),color:this.getSharp<1?"red":"green"},ioota:{data:this.$moneyf(this.getSumFloatingOpen,Math.abs(this.getSumFloatingOpen)>=1e4?0:2),color:this.getSumFloatingOpen<0?"red":"green",symbol:"$"},iootat:{data:this.$moneyf(this.getSumFloatingClose,Math.abs(this.getSumFloatingClose)>=1e4?0:2),color:this.getSumFloatingClose?"red":"green",symbol:"$"},iootf:{data:this.$moneyf(this.getDeltaFloatingCloseByDay,Math.abs(this.getDeltaFloatingCloseByDay)>=1e4?0:2),color:this.getDeltaFloatingCloseByDay<0?"red":"green",symbol:"$"},iootfp:{data:this.$moneyf(this.getDeltaFloatingClosePercentByDay,2),color:this.getDeltaFloatingClosePercentByDay<0?"red":"green",symbol:"%"},volume_of_open_trades:{data:this.$moneyf(this.getSumVolumegClose,0),color:"gray",symbol:"$"},apatb:{data:this.$moneyf(this.getAbsoluteOpenProfit,Math.abs(this.getAbsoluteOpenProfit)>=1e4?0:2),color:this.getAbsoluteOpenProfit<0?"red":"green",symbol:"$"},apate:{data:this.$moneyf(this.getAbsoluteCloseProfit,Math.abs(this.getAbsoluteCloseProfit)>=1e4?0:2),color:this.getAbsoluteCloseProfit<0?"red":"green",symbol:"$"},appd:{data:this.$moneyf(this.getAbsoluteDeltaProfit,Math.abs(this.getAbsoluteDeltaProfit)>=1e4?0:2),color:this.getAbsoluteDeltaProfit<0?"red":"green",symbol:"$"},appdp:{data:this.$moneyf(this.getAbsoluteDeltaPercentProfit,2),color:this.getAbsoluteDeltaPercentProfit<0?"red":"green",symbol:"%"}}}}),methods:{closeReport:function(){this.$emit("close")},setAnaliticsMode:function(t){this.analiticsMode=t},setDataForPortfolio:function(){var t=this;this.statSourcesForDate=[],this.getStatForReport.forEach((function(e){if(e.data.length){var i=e.data.find((function(e){return new Date(e.date).getTime()===new Date(t.statDay.date).getTime()}));i&&t.statSourcesForDate.push({source:e,statDay:i})}}))},onResize:function(t){this.heightWrap=t[0].contentRect.height}},mounted:function(){var t=this;this.setDataForPortfolio(),this.$nextTick((function(){t.observerElem=t.$refs.reportWrap,t.initObserver()}))}};function LMt(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var FMt=$Mt,jMt=(i("c102"),Object(C["a"])(FMt,BMt,MMt,!1,null,"dca965bc",null)),RMt=jMt.exports,WMt=function(){var t=this,e=t._self._c;return e("div",{ref:"widgetWrap",class:"PeriodChart PeriodChart_".concat(t.getActiveTheme)},[e("div",{ref:"titleWrap",staticClass:"PeriodChart-title"},[t._l(t.periodsButtons,(function(i,o){return e("ButtonIconFlat",{attrs:{icon:{name:i.icon},modifier:{class:["PeriodChart-button",t.period===i.period?"PeriodChart-button_isActive_".concat(t.getActiveTheme):"PeriodChart-button_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.setPeriod(i.period)}}})})),t.getTitle?e("div",{class:"PeriodChart-titleText PeriodChart-titleText_".concat(t.getActiveTheme)},[e("span",{class:"PeriodChart-periodTitle PeriodChart-periodTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.getTitle[0]))]),e("span",{staticClass:"PeriodChart-plTitle",style:{color:t.getTitle[1]<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("PL ".concat(t.getCurrencyChar).concat(t.$moneyf(t.getTitle[1],2))))])]):t._e(),e("div",{staticClass:"PeriodChart-titleTypeButtons"},[t.getLastDates&&t.widthForTitle>610?e("div",{staticClass:"PeriodChart-lastDates"},[t._l(t.getLastDates,(function(i,o){return e("div",{key:o,class:"PeriodChart-lastDatesItem PeriodChart-lastDatesItem_".concat(t.getActiveTheme," PeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive"," PeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(t.checkActiveDate(i.date)?"isAcitve":"noActive"),on:{click:function(e){return t.setActiveDate(i.date)},mouseenter:function(e){return t.setHoverIndex(o)},mouseleave:function(e){return t.setHoverIndex(null)}}},[t._v(t._s(i.title)),t.hoverIndex===o?e("div",{class:"PeriodChart-hoverWidgetlastDates PeriodChart-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive")},[e("div",[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.profitAbs,2))))]),e("div",{directives:[{name:"show",rawName:"v-show",value:i.profitRel,expression:"item.profitRel"}]},[t._v("% "+t._s(t.$moneyf(i.profitRel,5)))])]):t._e()])})),e("div",{staticClass:"PeriodChart-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1)],2):t._e()]),t.dateCheckerStatus?e("DataChartChecker",{key:t.period,attrs:{positionPopup:{my:"top right",at:"bottom right",of:t.containerForDataChecker,offset:{x:0,y:5}},statistic:t.getLastDates,period:t.period,activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()],2),t.isLoadingStatData?e("div",{staticClass:"loader"},[e("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:35,circle:!0}})],1):t._e(),t.isLoadingStatData||t.getNoStatStatus?t._e():e("div",{staticClass:"PeriodChart-content"},[e("div",{staticClass:"PeriodChart-chart"},[t.points?e("SectorLineEventChart",{key:t.period,attrs:{typeXAxis:t.period,points:t.points,theme:t.getActiveTheme,interval:t.intervalGrid,watermark:t.$t(t.getWatermarks),watermarkData:t.getWatermarkData,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}},on:{hover:t.hoverPoint}}):t._e(),e("div",{class:"PeriodChart-statData PeriodChart-statData_".concat(t.getActiveTheme)},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit?e("div",{key:o,class:"PeriodChart-currentProfit PeriodChart-currentProfit_".concat(t.getActiveTheme),style:{color:i.data<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"PeriodChart-currentProfit-arrow"},["down"===t.directions[o]?e("div",[e("svgIcon",{attrs:{name:"Arrow_down_direct"}})],1):e("div",[e("svgIcon",{attrs:{name:"Arrow_up_direct"}})],1)]),e("div",{staticClass:"PeriodChart-currentProfit-data",class:"PeriodChart-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data,2))))]),e("div",{staticClass:"PeriodChart-currentProfit-title",class:"PeriodChart-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"PeriodChart-currentProfit-text",class:"PeriodChart-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])]):t._e()})),0),null!==t.hoverIndexPoint?e("div",{class:"PeriodChart-hoverWidget PeriodChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"PeriodChart-hoverWidgetRow PeriodChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"PeriodChart-hoverWidgetLabel PeriodChart-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"PeriodChart-hoverWidgetStat PeriodChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1),e("div",{staticClass:"PeriodChart-titleGistogramm",class:"PeriodChart-titleGistogramm_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.$t("histogram_of_income"),", ").concat(t.getCurrencyChar)))]),e("div",{staticClass:"PeriodChart-gistogramm"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e(),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)]),!t.isLoadingStatData&&t.getNoStatStatus?e("div",{class:"emptyContainer emptyContainer_".concat(t.getActiveTheme)},[e("div",[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",[t._v(t._s("Active"===t.getStatusPortfolio?"Статистика по портфелю формируется":"Вы пока не инвестируете в портфель"))])]):t._e()])},NMt=[],EMt={components:{UserProfileGridWidgetTopBar:nM,TitlesForGistogram:DI,GistogrammEventChart:TI,SectorLineEventChart:Fj,Preloader:ah,DataChartChecker:M3},mixins:[qe,yn,Ykt],data:function(){return{widgetSize:{width:0,height:0},positionHoverWidget:null,lastProfit:0,profitByOpenOrders:0,profitCloseOrders:0,containerForDataChecker:null,dateCheckerStatus:!1,hoverIndex:null,hoverIndexPoint:null,widthForTitle:0,intervalGrid:null,period:"day",activeDate:null,points:null,pointsForGistogramm:null,directions:["up","up"],periodsButtons:[{icon:"TimePeriod_2D",period:"day"},{icon:"TimePeriod_2W",period:"week"},{icon:"TimePeriod_2M",period:"month"}],arrowObject:null,lastHoursDate:null,lastDaysDate:null}},watch:{getStatData:function(){this.activeDate=this.getServerTime.now,this.getStatByPeriod&&this.points&&(this.points=null,this.setPointsForChart(this.getStatByPeriod,"first"))},getFloatingProfit:function(t,e){void 0!==t&&void 0!==e&&(t>=e?this.directions.splice(1,1,"up"):this.directions.splice(1,1,"down"))},getPofitByCloseOrders:function(t,e){void 0!==t&&void 0!==e&&(t>=e?this.directions.splice(0,1,"up"):this.directions.splice(0,1,"down"))},isLoadingStatData:function(t){t||(this.activeDate=this.getServerTime.now,this.setPointsForChart(this.getStatByPeriod,"first"))},getActiveTab:function(){this.activeDate=this.getServerTime.now,this.points=null,this.profitByOpenOrders=0,this.profitCloseOrders=0},period:function(t){if("Active"===this.findPortfolio)this.activeDate=this.getServerTime.utcNow;else if("Stoped"===this.findPortfolio)if("day"===t){if(!this.lastHoursDate)return;this.activeDate=this.lastHoursDate}else this.activeDate=this.lastDaysDate;this.setPointsForChart(this.getStatByPeriod)},activeDate:function(){this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod,"first")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",isLoadingStatData:"expertsPortfolio/isLoadingStatData",findPortfolio:"expertsPortfolio/findPortfolio",getStatData:"statDataForPortfolio/getStatData",getServerTime:"serverTime/getServerTime",getActiveTab:"expertsPortfolio/getActiveTab",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getStat:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm.length&&this.pointsForGistogramm[1].length&&this.pointsForGistogramm[2].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));if(!(t<0)){var e=this.pointsForGistogramm[1][t].y,i=Math.max.apply(null,this.pointsForGistogramm[1].filter((function(t){return t.y})).map((function(t){return t.y}))),o=Math.min.apply(null,this.pointsForGistogramm[1].filter((function(t){return t.y})).map((function(t){return t.y}))),n=this.pointsForGistogramm[2][t].y;return[{label:"P/L",symbol:this.getCurrencyChar,data:this.$moneyf(e,e<.01?5:3),color:e<0?"red":"green"},{label:this.$t("max"),symbol:this.getCurrencyChar,data:this.$moneyf(i,Math.abs(i)<.01?5:3),color:"green"},{label:this.$t("min"),symbol:this.getCurrencyChar,data:this.$moneyf(o,Math.abs(o)<.01?5:3),color:"red"},{label:this.$t("average"),symbol:this.getCurrencyChar,data:this.$moneyf(n,Math.abs(n)<.01?5:3),color:"orange"}]}}},getWatermarkData:function(){return this.getCurrentProfit?{data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getCurrentProfit[1].data,2)),color:this.getCurrentProfit[1].data<0?this.getRedColor.fill:this.getGreenColor.color}:null},getWatermarks:function(){var t={day:"Доход за ".concat(new Date(this.activeDate).toLocaleDateString("ru")),week:"Доход ".concat(new Date(this.activeDate).getWeek()," неделя ").concat(new Date(this.activeDate).getFullYear()),month:"Доход ".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear())};return t[this.period]},getPofitByCloseOrders:function(){return this.closedOrders&&this.closedOrders.length?Cmt("round",this.closedOrders.reduce((function(t,e){return t+e.profit}),0),-2):0},getSubscriptionsByBag:function(){var t=this;return this.allSubscriptionCurrentDate.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}))},getEquityByDate:function(){var t=this;if(this.getStatistics&&this.activeDate){var e=this.getStatusNowDate?this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity:this.getStatistics.accountDaily.find((function(e){return new Date(t.activeDate).getFullYear()===new Date(e.date).getFullYear()&&new Date(t.activeDate).getMonth()===new Date(e.date).getMonth()&&new Date(t.activeDate).getDate()===new Date(e.date).getDate()})).equityClose;return e}},getStatusNowDate:function(){return new Date(this.activeDate).getFullYear()===new Date(this.getServerTime.utcNow).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(this.getServerTime.utcNow).getMonth()&&new Date(this.activeDate).getDate()===new Date(this.getServerTime.utcNow).getDate()},serverTime:function(){var t=new Date(this.getServerTime.utcNow);return"".concat(t.getHours()<10?"0".concat(t.getHours()):t.getHours(),":").concat(t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes()," (UTC)")},getTitle:function(){if(this.points&&this.points[1]){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y})),e=this.points[1][t].y-this.points[0][0].y,i={day:"".concat(this.$t("iftd")," ").concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime),week:"".concat(this.$t("iftw")," ").concat(new Date(this.activeDate).getWeek()),month:"".concat(this.$t("income")," ").concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()," г.")};return[i[this.period],e]}},getNoStatStatus:function(){return!!this.isLoadingStatData||!this.getStatData&&!this.openOrders.length&&!this.closedOrders.length},getStatusPortfolio:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getLastDates:function(){var t=this;if(this.getAllStatByDays&&this.getAllStatByDays.length){var e=this.getAllStatByDays.reduce((function(e,i){var o=i.profitOpen+i.floatingProfitOpen,n=i.profitClose+i.floatingProfitClose,s=n-o,r=t.getEquityByDate?s?100*s/t.getEquityByDate:0:s;return e.push({date:i.date,title:new Date(i.date).getDate(),equityOpen:o,profitAbs:s,profitRel:r}),e}),[]),i=this.profitByOpenOrders+(this.getPofitByCloseOrders?this.getPofitByCloseOrders:0);e.length&&(e.at(-1).profitAbs=i-e.at(-1).equityOpen,e.at(-1).profitRel=100*e.at(-1).profitAbs/this.getEquityByDate);var o=this.compinePeriodStatForDateTabs(this.getAllStatByDays,"week"),n=this.compinePeriodStatForDateTabs(this.getAllStatByDays,"month");o.at(-1).profitAbs=i-o.at(-1).equityOpen,o.at(-1).profitRel=100*o.at(-1).profitAbs/this.getEquityByDate,n.at(-1).profitAbs=i-o.at(-1).equityOpen,n.at(-1).profitRel=100*o.at(-1).profitAbs/this.getEquityByDate;var s={day:e,week:o,month:n};return s[this.period].length>5?s[this.period].splice(-5):s[this.period]}},getStatForDay:function(){var t=this;if(this.getStatData.myStat&&this.getStatData.myStat.length){var e=[];return this.getStatData.myStat.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return 1===e.statType&&new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getMonth()===new Date(t.activeDate).getMonth()&&new Date(e.date).getDate()===new Date(t.activeDate).getDate()})))})),e}},getStatForWeek:function(){var t=this;if(this.getStatData.myStat&&this.getStatData.myStat.length){var e=[];if(this.getStatData.myStat.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return 2===e.statType&&new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getWeek()===new Date(t.activeDate).getWeek()})))})),!e[0].length){e=[],this.getStatData.myStat.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return 1===e.statType&&new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getWeek()===new Date(t.activeDate).getWeek()})))}));var i=e[0].at(-1);return[[i]]}return e}},getStatForMonth:function(){var t=this;if(this.getStatData.myStat&&this.getStatData.myStat.length){var e=[];if(this.getStatData.myStat.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return 2===e.statType&&new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getMonth()===new Date(t.activeDate).getMonth()})))})),!e[0].length){e=[],this.getStatData.myStat.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return 1===e.statType&&new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getWeek()===new Date(t.activeDate).getWeek()})))}));var i=e[0].at(-1);return i.profitOpen=0,i.floatingProfitOpen=0,[[i]]}return e}},getStatByPeriod:function(){var t={day:this.getStatForDay,week:this.getStatForWeek,month:this.getStatForMonth};return t[this.period]},getMetaInfoForLines:function(){if(this.points&&this.points.length)return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"line",color:this.lastProfit<0?this.getRedColor.color:this.getGreenColor.color,fill:this.lastProfit<0?this.getRedColor.fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]},getFloatingProfit:function(){if(this.points&&this.points.length&&this.points[1]&&this.points[1].length){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y}));return this.points[1][t].y}},getCurrentProfit:function(){if(this.points&&this.points.length)return[{data:this.getPofitByCloseOrders,symbol:"$",color:this.getCloseProfit<0?"red":"green",text:this.$t("poct")},{data:this.getFloatingProfit,symbol:"$",color:this.getFloatingProfit<0?"red":"green",text:this.$t("current_income")}]},getStatForChart:function(){if(this.points&&this.points.length){var t=Math.max.apply(null,this.points[1].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[])),e=Math.min.apply(null,this.points[1].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[]));return[{label:"Выделенно средств",data:this.getEquityByDate,symbol:"$",color:"blue"},{label:"Максимум",data:t,symbol:"$",color:t<0?"red":"green"},{label:"Минимум",data:e,symbol:"$",color:e<0?"red":"green"}]}},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("average")}]}}}),methods:{getStatDayForStatHours:function(){var t=this,e=[],i=[];if((!this.getStatData.myStat||!this.getStatData.myStat.length)&&!this.openOrders.length&&!this.closedOrders.length)return[{date:new Date,profitOpen:0,profitClose:this.getPofitByCloseOrders,floatingProfitOpen:0,floatingProfitClose:this.profitByOpenOrders}];this.getStatData.myStat.forEach((function(t){t.data.length&&i.push(t.data.filter((function(t){return 2===t.statType})))}));var o=i.length&&i.some((function(t){return t.length}));return o?i.forEach((function(i){i.length&&e.push(i.filter((function(e){return new Date(e.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e.date).getMonth()===new Date(t.activeDate).getMonth()&&new Date(e.date).getDate()===new Date(t.activeDate).getDate()&&2===e.statType})))})):this.getStatData.myStat.forEach((function(t){t.data.length&&e.push([t.data[0]])})),this.compineStat(e)},hoverPoint:function(t){if(t){var e,i=this.widgetSize.width-t.cPointX,o=this.widgetSize.height-t.cPointY,n=this.compineStat(this.getStatByPeriod),s=n.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}));if(this.positionHoverWidget={top:"".concat(o>54?Math.round(t.cPointY-5):Math.round(t.cPointY-59),"px"),left:"".concat(i>140?t.cPointX+8:t.cPointX-148,"px")},"day"===this.period){var r=this.getStatDayForStatHours()[0];e=new Date(s.date).getHours()?r.profitOpen+r.floatingProfitOpen:n[0].profitOpen+n[0].floatingProfitOpen,n.at(-1).profitClose=r.profitClose,n.at(-1).floatingProfitClose=r.floatingProfitClose}else e=n[0].profitOpen+n[0].floatingProfitOpen;this.getStatusNowDate&&(n.at(-1).floatingProfitClose=this.profitByOpenOrders,n.at(-1).profitClose=this.getPofitByCloseOrders?this.getPofitByCloseOrders:0);var a=s.profitClose+s.floatingProfitClose,c=a-e,l=100*c/this.getEquityByDate,u=0;void 0!==l&&l.toString().split(".").length&&(u=l.toString().split(".").at(-1).length),s&&(this.statsForHoverWidget=[{label:"P/L, ".concat(this.getCurrencyChar),stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(c,Math.abs(c)>1e4?0:2)),color:c<0?"red":"green"},{label:"P/L, %",stat:"% ".concat(u>5?this.$moneyf(l,5):this.$moneyf(l,u)),color:l<0?"red":"green"},{label:"Дата",stat:"day"===this.period?new Date(s.date).toLocaleTimeString("ru"):new Date(s.date).toLocaleDateString("ru"),color:l<0?"red":"green"}]),this.hoverIndexPoint=this.getStatByPeriod.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}))}else this.hoverIndexPoint=null},setMessageHandler:function(t){var e=this;if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){var i;if("Stoped"===(null===(i=this.findPortfolio)||void 0===i?void 0:i.status))return;var o=t.data[0].openOrders.tradingOrders,n=this.openOrders;if(o&&o.length&&n&&n.length&&this.getStatusNowDate){var s=o.filter((function(t){return e.getSubscriptionsByBag.some((function(e){return e.subscription.id===+t.subscriptionId}))}));s.length?this.profitByOpenOrders=s.reduce((function(t,e){return t+e.profit}),0):this.profitByOpenOrders=0}this.setPointsForChart(this.getStatByPeriod)}},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},compinePeriodStatForDateTabs:function(t,e){var i="week"===e?new Date(t[0].date).getWeek():new Date(t[0].date).getMonth(),o=t[0].profitOpen+t[0].floatingProfitOpen,n=t[0].profitClose+t[0].floatingProfitClose,s=n-o,r=o?s?100*s/o:0:s;(s<0&&r>0||s>0&&r<0)&&(r*=-1);var a=[{date:new Date(t[0].date),title:"week"===e?i:i+1,equityOpen:o,profitAbs:s,profitRel:r}];return t.forEach((function(t){var c="week"===e?new Date(t.date).getWeek()===i:new Date(t.date).getMonth()===i;c?(n=t.profitClose+t.floatingProfitClose,s=n-o,r=o?s?100*s/o:0:s,(s<0&&r>0||s>0&&r<0)&&(r*=-1),a.at(-1).profitAbs=s,a.at(-1).profitRel=r):(i="week"===e?new Date(t.date).getWeek():new Date(t.date).getMonth(),o=t.profitOpen+t.floatingProfitOpen,n=t.profitClose+t.floatingProfitClose,s=n-o,r=o?s?100*s/o:0:s,(s<0&&r>0||s>0&&r<0)&&(r*=-1),a.push({date:new Date(t.date),title:"week"===e?i:i+1,equityOpen:o,profitAbs:s,profitRel:r}))})),a},setActiveDate:function(t){this.activeDate=t},getItemsPeriod:function(){var t;return"week"===this.period?t=7:"month"===this.period?t=new Date(this.activeDate).daysInMonth():"day"===this.period&&(t=24),t},setPointsForChart:function(t,e){var i=this;this.points=[[]],this.pointsForGistogramm=[[],[]];var o=this.getItemsPeriod();this.intervalGrid=Math.round(this.widgetSize.width/o);var n,s=t?this.compineStat(t):[{date:new Date,profitOpen:0,profitClose:this.getPofitByCloseOrders,floatingProfitOpen:0,floatingProfitClose:this.profitByOpenOrders}];if("day"===this.period){var r=this.getStatDayForStatHours()[0];n=r.profitOpen+r.floatingProfitOpen,this.getStatusNowDate||(s.at(-1).profitClose=r.profitClose,s.at(-1).floatingProfitClose=r.floatingProfitClose)}else n=s[0].profitOpen+s[0].floatingProfitOpen;for(var a=0,c=function(t){var e;if("day"===i.period?e=s.find((function(e){return new Date(e.date).getHours()===t})):"week"===i.period?e=s.find((function(e){return new Date(e.date).getDay()?new Date(e.date).getDay()-1===t:6})):"month"===i.period&&(e=s.find((function(e){return new Date(e.date).getDate()===t+1}))),e){var o=e.profitClose+e.floatingProfitClose,r=o-n;t||"day"!==i.period||(r=o-(e.profitOpen+e.floatingProfitOpen));var c=n?r?100*r/i.getEquityByDate:0:r;(r<0&&c>0||r>0&&c<0)&&(c*=-1),a+=r,i.points[0].push({x:t,y:r,date:e.date}),i.pointsForGistogramm[0].push({x:t,y:r,date:e.date}),i.pointsForGistogramm[1].push({x:t,y:a/(t+1),date:e.date})}else i.points[0].push({x:t}),i.pointsForGistogramm[0].push({x:t}),i.pointsForGistogramm[1].push({x:t})},l=0;l=150?"incomeEquityTab-contentWrap":"incomeEquityTab-contentWrapDirection"},[e("div",{class:"incomeEquityTab-dataTable incomeEquityTab-dataTable_".concat(t.getActiveTheme),style:{maxHeight:t.widthWrap>=150?"100%":"30rem"}},[e("div",{class:"incomeEquityTab-gistogrammChart-title incomeEquityTab-gistogrammChart-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-gistogrammChart-text"},[t._v(t._s(t.$t("equity_increase")))])]),e("VuePerfectScrollbar",{staticClass:"incomeEquityTab-table"},[e("TableColumnsCustom",{key:t.widthWrap,attrs:{dataTable:t.getDataForTable,columns:t.getColumnsForTable,stickyHeader:!0,indexHoverRow:t.hoverIndex},scopedSlots:t._u([{key:"column",fn:function(i){var o=i.data,n=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell",style:{color:o.color}},[t._v(t._s(n))])]}},{key:"date",fn:function(i){var o=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell"},[t._v(t._s(o))])]}}])})],1),e("div",{staticClass:"incomeEquityTab-absProfit",class:"incomeEquityTab-absProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-absProfitData",style:{color:t.getProfitAbsOnMonth<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"incomeEquityTab-absProfitDataIcon",style:{color:"up"===t.directionsMonthProfit?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directionsMonthProfit,"_direct"),size:14}})],1),e("div",{staticClass:"incomeEquityTab-absProfitAbs"},[t._v(t._s(t.getTotalMonthPercent))])]),e("div",{staticClass:"incomeEquityTab-absProfitTitle"},[e("div",{staticClass:"incomeEquityTab-absProfitTitleText",class:"incomeEquityTab-absProfitTitleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("ipfm")))])])])],1),t.isLoadingStatData||t.getNoStatStatus?t._e():e("div",{ref:"chart",staticClass:"incomeEquityTab-chart"},[e("div",{staticClass:"incomeEquityTab-lineChart"},[e("div",{class:"incomeEquityTab-gistogrammChart-title incomeEquityTab-gistogrammChart-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-gistogrammChart-text"},[t._v(t._s(t.$t("gotcp")))])]),e("div",{staticClass:"incomeEquityTab-chartTitle"},t._l(t.getStatForTitleChart,(function(i,o){return t.getStatForTitleChart?e("div",{key:o,class:"incomeEquityTab-currentProfit incomeEquityTab-currentProfit_".concat(t.getActiveTheme),style:{color:i.color}},[e("div",{staticClass:"incomeEquityTab-currentProfit-arrow"},[e("div",{style:{color:"down"===t.directions[o]?t.getRedColor.color:t.getGreenColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directions[o],"_direct")}})],1)]),e("div",{staticClass:"incomeEquityTab-currentProfit-data",class:"incomeEquityTab-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(i.data)))]),e("div",{staticClass:"incomeEquityTab-currentProfit-title",class:"incomeEquityTab-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-currentProfit-text",class:"incomeEquityTab-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.label))])])]):t._e()})),0),e("div",{staticClass:"incomeEquityTab-lineChartWrap"},[t.points?e("SectorLineEventChart",{key:t.points[0][0].y,attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},watermark:t.$t("equity_increase"),watermarkData:t.getWatermarkData},on:{hover:t.hoverPoint}}):t._e(),null!==t.hoverIndex?e("div",{class:"incomeEquityTab-hoverWidget incomeEquityTab-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"incomeEquityTab-hoverWidgetRow incomeEquityTab-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"incomeEquityTab-hoverWidgetLabel incomeEquityTab-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"incomeEquityTab-hoverWidgetStat incomeEquityTab-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1)]),e("div",{staticClass:"incomeEquityTab-gistogrammChart"},[e("div",{class:"incomeEquityTab-gistogrammChart-title incomeEquityTab-gistogrammChart-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-gistogrammChart-text"},[t._v(t._s("".concat(t.$t("hotpp"),", ").concat(t.getCurrencyChar)))])]),e("div",{staticClass:"incomeEquityTab-gistogrammChart-chart"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)])]),!t.isLoadingStatData&&t.getNoStatStatus?e("div",{class:"incomeEquityTab_emptyContainer incomeEquityTab_emptyContainer_".concat(t.getActiveTheme)},[e("div",[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",[t._v(t._s(t.$t("psabg")))])]):t._e()])])])},KMt=[],ZMt={computed:{getStatByMode:function(){if(this.getStatData)return this.getStatData[this.modeStat]},getNoStatStatus:function(){return!!this.isLoadingStatData||(!this.getStatByMode||!this.getStatByMode.length)},getIncomeEquity:function(){var t=this;if(this.getStatistics&&this.getStatistics&&this.activeDate){var e=this.getStatusNowDate?this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1):this.getStatistics.account.equity:this.getStatistics.accountDaily.find((function(e){return new Date(t.activeDate).getFullYear()===new Date(e.date).getFullYear()&&new Date(t.activeDate).getMonth()===new Date(e.date).getMonth()&&new Date(t.activeDate).getDate()===new Date(e.date).getDate()}));return e.equityClose}},getAllStat:function(){var t=this;if(this.getStatByMode&&this.getStatByMode.length){var e=[];this.getStatByMode.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return"myStat"===t.modeStat?2===e.statType:!e.statType})))}));var i=e.every((function(t){return!t.length}));return i&&(e=[],this.getStatByMode.forEach((function(i){i.data.length&&e.push(i.data.filter((function(e){return"myStat"===t.modeStat?1===e.statType:!e.statType})))}))),this.compineAllStat(e)}},getTabsForYear:function(){if(this.getYearsStatPortfolio){var t=[];for(var e in this.getYearsStatPortfolio){var i=this.getYearsStatPortfolio[e].at(-1).profitAbs,o=i?100*i/this.getYearsStatPortfolio[e].at(-1).equity:0;t.push({year:e,profitAbs:i,profitRel:o,color:i<0?this.getRedColor.color:this.getGreenColor.color})}return t}},getYearsStatPortfolio:function(){var t=this;if(this.getAllStat&&this.getAllStat.length){var e={},i=0,o=0;return this.getAllStat.forEach((function(n){var s=new Date(n.date).getFullYear();if(e[s])if(e[s].find((function(t){return t.month===new Date(n.date).getMonth()}))){var r=n.profitClose+n.floatingProfitClose,a=r-i,c=a?100*a/o:0;e[s].at(-1).profitAbs=a,e[s].at(-1).profitRel=c}else{i=n.profitOpen+n.floatingProfitOpen;var l=t.getStatistics.accountDaily.find((function(t){return new Date(n.date).getFullYear()===new Date(t.date).getFullYear()&&new Date(n.date).getMonth()===new Date(t.date).getMonth()&&new Date(n.date).getDate()===new Date(t.date).getDate()}));if(l){o=l.equityClose;var u=n.profitClose+n.floatingProfitClose,d=u-i,h=d?100*d/o:0;e[s].push({date:new Date(n.date),month:new Date(n.date).getMonth(),profitAbs:d,profitRel:h,openProfit:i,equity:o})}}else{i=n.profitOpen+n.floatingProfitOpen;var p=t.getStatistics.accountDaily.find((function(t){return new Date(n.date).getFullYear()===new Date(t.date).getFullYear()&&new Date(n.date).getMonth()===new Date(t.date).getMonth()&&new Date(n.date).getDate()===new Date(t.date).getDate()}));if(!p)return;o=p.equityClose;var g=n.profitClose+n.floatingProfitClose,f=g-i,m=f?100*f/o:0;e[s]=[{date:new Date(n.date),month:new Date(n.date).getMonth(),profitAbs:f,profitRel:m,openProfit:i,equity:o}]}})),e}},getMonthTabs:function(){var t=this;if(this.getYearsStatPortfolio&&null!==this.activeDate&&this.getTabsForYear){var e=new Date(this.activeDate).getFullYear();return this.getYearsStatPortfolio[e].map((function(e){return{title:t.$t("mounthArr")[e.month],date:e.date,month:e.month,profitAbs:e.profitAbs,profitRel:e.profitRel,color:e.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}}))}}},methods:{compineAllStat:function(t){var e={};return t.forEach((function(t){t.length&&t.forEach((function(t){var i=new Date(t.date).getTime();e[i]?(e[i][0].push(t.profitOpen),e[i][1].push(t.profitClose),e[i][2].push(t.floatingProfitOpen),e[i][3].push(t.floatingProfitClose)):e[i]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]}))})),Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}}))}}},t$t={props:{topBarWidgetParams:{type:Object}},components:{TableColumnsCustom:p2,VuePerfectScrollbar:Xt.a,UserProfileDayReportWidget:RB,DxTextBox:rc.a,DxSelectBox:Bo.a,DxPopup:xo.a,GistogrammEventChart:TI,SectorLineEventChart:Fj},mixins:[qe,yn,ZMt],data:function(){return{widthWrap:0,modeStat:"myStat",activeYear:null,activeTabMonth:null,hoverIndexYear:null,hoverIndexMonth:null,positionHoverWidget:null,hoverIndex:null,type:"abs",widgetSize:{width:0,height:0},lastProfit:0,profitByOpenOrders:0,profitCloseOrders:0,containerForDataChecker:null,dateCheckerStatus:!1,widthForTitle:0,intervalGrid:null,period:"month",activeDate:null,points:null,directions:["up","up"],directionsMonthProfit:"up",pointsForGistogramm:null,periodsButtons:[{icon:"TimePeriod_2D",period:"day"},{icon:"TimePeriod_2W",period:"week"},{icon:"TimePeriod_2M",period:"month"}]}},watch:{isLoadingStatData:function(t){t||(this.activeDate=new Date,this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod))},getActiveTab:function(){this.activeDate=this.getServerTime.now,this.points=null,this.profitByOpenOrders=0,this.profitCloseOrders=0},getEquityCloseByAccount:function(t,e){void 0!==t&&void 0!==e&&(this.directions[0]=t>e?"up":"down")},getProfitAbsOnMonth:function(t,e){void 0!==t&&void 0!==e&&(t>e?(this.directions[1]="up",this.directionsMonthProfit="up"):(this.directions[1]="down",this.directionsMonthProfit="down"))},period:function(){this.activeDate=this.getServerTime.utcNow,this.setPointsForChart(this.getStatByPeriod)},activeDate:function(){this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getYearsStat:"statistic/getYearsStat",getStatistics:"statistic/getStatistics",isLoadingStatData:"expertsPortfolio/isLoadingStatData",findPortfolio:"expertsPortfolio/findPortfolio",getStatData:"statDataForPortfolio/getStatData",getServerTime:"serverTime/getServerTime",getActiveTab:"expertsPortfolio/getActiveTab",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getEquityCloseByAccount:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getNoStatStatus:function(){return!!this.isLoadingStatData||(!this.getStatData||!this.getStatData.myStat.length)},getWatermarkData:function(){return this.getTotalMonthPercent?{data:this.getStatForTitleChart[1].data,color:this.getProfitAbsOnMonth<0?this.getRedColor.fill:this.getGreenColor.fill}:null},getStatForTitleChart:function(){if(void 0!==this.getTotalMonthPercent){var t=this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity;return[{label:this.$t("equity"),data:"".concat(this.getCurrencyChar).concat(this.$moneyf(t,2)),color:this.getGreenColor.color},{label:this.$t("ipfm"),data:this.getTotalMonthPercent,color:this.getProfitAbsOnMonth<0?this.getRedColor.color:this.getGreenColor.color}]}},getTotalMonthPercent:function(){if(this.getStatByPeriod)return"".concat(this.getCurrencyChar).concat(this.$moneyf(this.getProfitAbsOnMonth,this.getProfitAbsOnMonth>=100?0:2)," / %").concat(this.$moneyf(this.getTotalPercentOnMonthAccount,5))},getProfitAbsOnMonth:function(){return this.getEquityClose-this.getEquityOpenMonth},getTotalPercentOnMonthAccount:function(){var t=this;if(this.getStatByPeriod&&this.getStatistics){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.getStatByPeriod[0].date).getTime()}));if(e){var i=e.equityClose,o=this.getProfitAbsOnMonth?100*this.getProfitAbsOnMonth/i:0;return o}}},getProfitRelOnMonth:function(){var t=this.getProfitAbsOnMonth?100*this.getProfitAbsOnMonth/this.getEquityCloseByAccount:0;return t},getEquityOpenMonth:function(){if(this.getStatByPeriod)return this.getStatByPeriod[0].profitOpen+this.getStatByPeriod[0].floatingProfitOpen},getEquityClose:function(){if(this.getStatByPeriod)return this.getStatusNowDate?this.profitByOpenOrders+this.getPofitByCloseOrders:this.getStatByPeriod.at(-1).profitClose+this.getStatByPeriod.at(-1).floatingProfitClose},getListTabs:function(){if(this.getMonthTabs){var t=Math.floor((this.widthWrap-102)/78);if(!(t>=this.getMonthTabs.length||t<0))return this.getMonthTabs.slice(0,this.getMonthTabs.length-t)}},getDataForTable:function(){var t=this;if(this.getStatByPeriod){var e=this.getStatByPeriod.map((function(e){var i=e.profitClose+e.floatingProfitClose,o=e.profitOpen+e.floatingProfitOpen,n=i-o,s=t.getStatistics.accountDaily.find((function(t){return new Date(t.date).getFullYear()===new Date(e.date).getFullYear()&&new Date(t.date).getMonth()===new Date(e.date).getMonth()&&new Date(t.date).getDate()===new Date(e.date).getDate()}));s=s||t.getStatistics.accountDaily.at(-1).equityClose;var r=n?100*n/s.equityClose:0;return{date:"".concat(new Date(e.date).getDate()>9?new Date(e.date).getDate():"0".concat(new Date(e.date).getDate()),".").concat(new Date(e.date).getMonth()+1>9?new Date(e.date).getMonth()+1:"0".concat(new Date(e.date).getMonth()+1)),equity:"".concat(t.getCurrencyChar).concat(t.$moneyf(s.equityClose,0)),color:n<0?t.getRedColor.color:t.getGreenColor.color,profitDay:"".concat(t.getCurrencyChar).concat(t.$moneyf(n,0)," / ").concat(Math.abs(r)?Math.abs(r)<.001?">0.001":Math.abs(r)<.01?t.$moneyf(r,3):t.$moneyf(r,2):0,"%")}})),i=this.getStatByPeriod.at(-1).floatingProfitOpen+this.getStatByPeriod.at(-1).profitOpen,o=this.profitByOpenOrders+this.getPofitByCloseOrders,n=o-i,s=n?100*n/this.getStatistics.accountDaily.at(-1).equityClose:0;return e.at(-1).profitDay="$".concat(this.$moneyf(n,0)," / ").concat(Math.abs(s)<.001?">0.001":Math.abs(s)<.01?this.$moneyf(s,3):this.$moneyf(s,2),"%"),e.at(-1).color=n<0?this.getRedColor.color:this.getGreenColor.color,e}},getStatByPeriod:function(){if(this.getAllStat&&null!==this.activeDate){var t=new Date(this.activeDate).getMonth(),e=new Date(this.activeDate).getFullYear(),i=this.getAllStat.filter((function(i){return new Date(i.date).getFullYear()===e&&new Date(i.date).getMonth()===t}));return i}},getColumnsForTable:function(){return[{title:this.$t("date"),field:"date",sortingEnabled:!1,cellTemplate:"date",width:"60px",align:"center"},{title:this.$t("equity"),field:"equity",sortingEnabled:!1,cellTemplate:"column",align:"center"},{title:"%, ".concat(this.$t("day")),field:"profitDay",sortingEnabled:!1,cellTemplate:"column",width:"150px",align:"center"}]},getMetaInfoForLines:function(){if(this.points&&this.points.length)return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"line",color:this.getProfitAbsOnMonth<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getProfitAbsOnMonth<0?this.getRedColor.fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("current_income"),extandsIndicator:"rel"===this.type?"".concat(this.getCurrencyChar).concat(this.$moneyf(this.getEquityClose,this.getEquityClose>1e3?0:2)):"".concat(this.$moneyf(this.getProfitRelOnMonth,5)," %")}]},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")}]}},getLineTabs:function(){if(this.getMonthTabs){var t=Math.floor((this.widthWrap-102)/78);return t54?Math.round(t.cPointY-5):Math.round(t.cPointY-59),"px"),left:"".concat(i>140?t.cPointX+8:t.cPointX-148,"px")};var n=this.getStatByPeriod.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),s=this.getStatistics.accountDaily.find((function(t){return new Date(t.date).getTime()===new Date(e.getStatByPeriod[0].date).getTime()})),r=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),a=this.getStatByPeriod[0].profitOpen+this.getStatByPeriod[0].floatingProfitOpen,c=n.profitClose+n.floatingProfitClose,l=c-a,u=l?100*l/s.equityOpen:0,d=n.profitClose+n.floatingProfitClose-(n.profitOpen+n.floatingProfitOpen),h=d?100*d/r.equityClose:0;n&&(this.statsForHoverWidget=[{label:this.$t("balance"),stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(r.balanceClose,r.balanceClose>1e4?0:2)),color:"blue"},{label:this.$t("equity"),stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(r.equityClose,r.equityClose>1e4?0:2)),color:"green"},{label:"P/L ".concat(this.$t("day"),", %"),stat:Math.abs(h)<.001?">0.001":"% ".concat(this.$moneyf(h,Math.abs(h)<.01?3:2)),color:d<0?"red":"green"},{label:"P/L ".concat(this.$t("month"),", %"),stat:Math.abs(u)<.001?">0.001":"% ".concat(this.$moneyf(u,Math.abs(u)<.01?3:2)),color:u<0?"red":"green"}]),this.hoverIndex=this.getStatByPeriod.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}))}else this.hoverIndex=null},setMessageHandler:function(t){if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){var e=t.data[0].openOrders.tradingOrders,i=this.openOrders;if(e&&e.length&&i&&i.length&&this.getStatusNowDate){var o=e.filter((function(t){return i.some((function(e){return e.id===t.id}))}));o.length&&(this.profitByOpenOrders=o.reduce((function(t,e){return t+e.profit}),0),this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod))}}},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},setPointsForChart:function(t){var e=this;this.points=[[]],this.pointsForGistogramm=[[]];var i=new Date(this.activeDate).daysInMonth();this.intervalGrid=Math.round(this.widgetSize.width/i);for(var o=new Date(this.activeDate).getFullYear(),n=new Date(this.activeDate).getMonth(),s=[],r=0;r1){var t=this.points[0].at(-1).y,e=this.points[0].at(-2).y;return e>t?"down":"up"}return"up"}},getNoStatStatus:function(){return!!this.isLoadingStatData||(!this.getStatData||!this.getStatData.myStat.length)},getStatForChart:function(){if(this.points&&this.points.length)return{label:"".concat(this.$t("current")," %"),data:this.points[0].at(-1).y,symbol:"%",color:this.points[0].at(-1).y<30?this.getRedColor.color:this.getGreenColor.color}},getActiveLabel:function(){return this.titleButtons[this.activeIndex].label},getMetaInfoLines:function(){if(this.points&&this.points[0].length)return[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.getActiveLabel}]},getDaysStat:function(){if(this.getStatData&&this.getStatData.myStat.length){var t=[];return this.getStatData.myStat.forEach((function(e){if(e.data.length){var i=e.data.filter((function(t){return 2===t.statType}));if(i.length)i.forEach((function(e){t.push(e)}));else{var o=e.data.filter((function(t){return 1===t.statType}));o.length&&t.push(o.at(-1))}}})),t}}}),methods:{setDaysStat:function(){if(this.getDaysStat){var t={};this.getDaysStat.forEach((function(e){var i=new Date(e.date).getTime(),o=e.floatingProfitOpen+e.profitOpen,n=e.profitClose+e.floatingProfitClose,s=n-o;t[i]?t[i].push(s):t[i]=[s]}));var e=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]})),i=0,o=e.map((function(t,e){var o=Object(D["a"])(t,2),n=o[0],s=o[1],r=s.reduce((function(t,e){return t+e}),0);return r>0&&i++,{x:+n,y:i?100*i/(e+1):0,date:new Date(+n)}}));return o}},setMonthStat:function(){var t={};this.getDaysStat.forEach((function(e){var i=new Date(new Date(e.date).getFullYear(),new Date(e.date).getMonth()).getTime(),o=new Date(e.date).getTime(),n=e.floatingProfitOpen+e.profitOpen,s=e.profitClose+e.floatingProfitClose;t[i]?t[i][o]?t[i][o].push([n,s]):t[i][o]=[[n,s]]:t[i]=Object(Vt["a"])({},o,[[n,s]])}));var e=[],i=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]})),o=0;return i.forEach((function(t,i){var n=Object.entries(t[1]).sort((function(t,e){return+t[0]-+e[0]})),s=n[0][1].reduce((function(t,e){return t+e[0]}),0),r=n.at(-1)[1].reduce((function(t,e){return t+e[1]}),0),a=r-s;a>0&&o++,e.push({x:+t[0],y:o?100*o/(i+1):0,date:new Date(+t[0])})})),e},setOrderStat:function(){var t={};this.getDaysStat.forEach((function(e){var i=new Date(e.date).getTime(),o=e.closedCount,n=e.pClosedCount;t[i]?t[i].push([n,o]):t[i]=[[n,o]]}));var e=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]})),i=e.map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1],n=o.reduce((function(t,e){return t+e[1]}),0),s=o.reduce((function(t,e){return t+e[0]}),0);return{x:+i,y:n&&s?100*s/n:0,date:new Date(+i)}}));return i},setPointsForChart:function(){this.points=[];var t={day:this.setDaysStat,orders:this.setOrderStat,month:this.setMonthStat};t[this.activeMode]()&&this.points.push(t[this.activeMode]())},setActiveMode:function(t,e){this.activeIndex=t,this.activeMode=e},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormal:function(){this.$emit("setNormal")}},mounted:function(){!this.isLoadingStatData&&this.getStatData&&this.getStatData.myStat.length&&this.setPointsForChart()}},a$t=r$t,c$t=(i("e974"),Object(C["a"])(a$t,n$t,s$t,!1,null,"62e3584b",null)),l$t=c$t.exports,u$t=function(){var t=this,e=t._self._c;return e("div",{class:"StatWidgetForPrortfolio StatWidgetForPrortfolio_".concat(t.getActiveTheme)},[e("div",{class:"StatWidgetForPrortfolio-title StatWidgetForPrortfolio-title_".concat(t.getActiveTheme)},[t._v("Статистика управления")]),e("div",{staticClass:"StatWidgetForPrortfolio-content"},[e("OrderStatPortfolio")],1)])},d$t=[],h$t={components:{UserProfileGridWidgetTopBar:nM,OrderStatPortfolio:k0},props:{topBarWidgetParams:{type:Object}},computed:Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),methods:{setMinHorizontal:function(){this.$emit("setMinHorizontal")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormal:function(){this.$emit("setNormal")}}},p$t=h$t,g$t=(i("cfa9"),Object(C["a"])(p$t,u$t,d$t,!1,null,"11d1b296",null)),f$t=g$t.exports,m$t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ReportsActivePortfolio"},[e("TopTable",{attrs:{statData:t.statData,statDataCommon:t.statDataCommon,statDataBuy:t.statDataBuy,statDataSell:t.statDataSell}}),e("BottomDetailTable",{attrs:{externalBottomTableData:t.bottomTableData,externalBottomTableResult:t.bottomTableResult}}),e("DistributionLineGraph",{attrs:{workPiece:t.dataDistributionLineGraph}}),e("OpenOrdersAnalitics",{attrs:{outsideData:t.getColorsPortfolios,outsideTotalProfit:t.totalProfit}}),e("PeriodPortfolioChart")],1)},v$t=[];function y$t(t,e){var i,o=t.contractName.split(".")[0],n=null===(i=(e||[]).find((function(t){return t.name===o})))||void 0===i?void 0:i.precision,s=Ph(n).toString().length-1,r={Buy:function(){return Math.round(+(t.closePrice-t.openPrice).toFixed(s)*Ph(n))},Sell:function(){return Math.round(+(t.openPrice-t.closePrice).toFixed(s)*Ph(n))}};return r[t.orderType]()}var C$t={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({closedOrders:"statDataForPortfolio/closedOrders",getContracts:"contracts/getContracts"})),{},{sortedOrdersByInstrument:function(){var t={};return this.closedOrders.forEach((function(e){t[e.contractName]||(t[e.contractName]=[]),t[e.contractName].push(e)})),t},bottomTableData:function(){var t=this,e=Object.entries(this.sortedOrdersByInstrument).map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1],s=n.reduce((function(t,e){return t+e.profit}),0),r=n.filter((function(t){return t.profit>=0})).length,a=n.filter((function(t){return t.profit<0})).length,c=n.filter((function(t){return"Sell"===t.orderType})),l=c.reduce((function(t,e){return t+e.profit}),0),u=n.filter((function(t){return"Buy"===t.orderType})),d=u.reduce((function(t,e){return t+e.profit}),0),h=n.reduce((function(e,i){return e+y$t(i,t.getContracts)}),0),p=c.reduce((function(e,i){return e+y$t(i,t.getContracts)}),0),g=u.reduce((function(e,i){return e+y$t(i,t.getContracts)}),0);return{contract:{value:o,dopClass:""},count:{value:Lm(n.length,2,!0),absValue:n.length,dopClass:"blue"},pips:{value:Lm(h,2,!0),absValue:h,dopClass:s>=0?"green":"red"},prof:{value:Lm(s,2,!0),absValue:s,dopClass:s>=0?"green":"red"},profitCount:{value:Lm(r,2,!0),absValue:r,dopClass:"green"},lossCount:{value:Lm(a,2,!0),absValue:a,dopClass:"red"},countSell:{value:Lm(c.length,2,!0),absValue:c.length,dopClass:"blue"},pipsSell:{value:Lm(p,2,!0),absValue:p,dopClass:s>=0?"green":"red"},profitSell:{value:Lm(l,2,!0),absValue:l,dopClass:l>=0?"green":"red"},countBuy:{value:Lm(u.length,2,!0),absValue:u.length,dopClass:"blue"},pipsBuy:{value:Lm(g,2,!0),absValue:g,dopClass:s>=0?"green":"red"},profitBuy:{value:Lm(d,2,!0),absValue:d,dopClass:d>=0?"green":"red"}}}));return[{contract:{value:this.$t("instrument")},count:{value:this.$t("trades")},pips:{value:this.$t("pips")},prof:{value:this.$t("net_profit")},profitCount:{value:this.$t("profitable_trades")},lossCount:{value:this.$t("unprofitable_trades")},countSell:{value:this.$t("trades")},pipsSell:{value:this.$t("pips")},profitSell:{value:this.$t("net_profit")},countBuy:{value:this.$t("trades")},pipsBuy:{value:this.$t("pips")},profitBuy:{value:this.$t("net_profit")}}].concat(Object(x["a"])(e))},bottomTableResult:function(){var t=this.bottomTableData.slice(1),e=0,i=0,o=0,n=0,s=0,r=0,a=0,c=0,l=0,u=0,d=0;return t.forEach((function(t){e+=t.count.absValue,i+=t.pips.absValue,o+=t.prof.absValue,n+=t.profitCount.absValue,s+=t.lossCount.absValue,r+=t.countSell.absValue,a+=t.pipsSell.absValue,c+=t.profitSell.absValue,l+=t.countBuy.absValue,u+=t.pipsBuy.absValue,d+=t.profitBuy.absValue})),[{title:this.$t("instruments"),value:t.length,dopClass:"orange"},{title:this.$t("trades"),value:Lm(e,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(i,2,!0),dopClass:i<0?"red":"green"},{title:this.$t("profit"),value:Lm(o,2,!0),dopClass:o<0?"red":""},{title:this.$t("profitable_trades"),value:Lm(n,2,!0),dopClass:"blue"},{title:this.$t("unprofitable_trades"),value:Lm(s,2,!0),dopClass:"red"},{title:this.$t("trades"),value:Lm(r,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(a,2,!0),dopClass:a<0?"red":""},{title:this.$t("profit"),value:Lm(c,2,!0),dopClass:c<0?"red":""},{title:this.$t("trades"),value:Lm(l,2,!0),dopClass:"blue"},{title:this.$t("pips"),value:Lm(u,2,!0),dopClass:u<0?"red":""},{title:this.$t("profit"),value:Lm(d,2,!0),dopClass:d<0?"red":""}]}})};function b$t(t,e){var i,o=t.contractName.split(".")[0],n=null===(i=(e||[]).find((function(t){return t.name===o})))||void 0===i?void 0:i.precision,s=Ph(n).toString().length-1,r={Buy:function(){return Math.round(+(t.closePrice-t.openPrice).toFixed(s)*Ph(n))},Sell:function(){return Math.round(+(t.openPrice-t.closePrice).toFixed(s)*Ph(n))}};return r[t.orderType]()}var S$t={computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({closedOrders:"statDataForPortfolio/closedOrders",getContracts:"contracts/getContracts"})),{},{dataDistributionLineGraph:function(){var t=this;return Object.entries(this.sortedOrdersByInstrument).map((function(e){var i=Object(D["a"])(e,2),o=i[0],n=i[1],s=n.filter((function(t){return"Sell"===t.orderType})),r=n.filter((function(t){return"Buy"===t.orderType})),a=n.filter((function(t){return t.profit>=0})).length,c=n.filter((function(t){return t.profit<0})).length,l=n.reduce((function(t,e){return t+e.profit}),0),u=s.reduce((function(t,e){return t+e.profit}),0),d=r.reduce((function(t,e){return t+e.profit}),0),h=n.reduce((function(t,e){return t+e.volume}),0),p=s.reduce((function(t,e){return t+e.volume}),0),g=r.reduce((function(t,e){return t+e.volume}),0),f=n.reduce((function(e,i){return e+b$t(i,t.getContracts)}),0),m=s.reduce((function(e,i){return e+b$t(i,t.getContracts)}),0),v=r.reduce((function(e,i){return e+b$t(i,t.getContracts)}),0),y=n.reduce((function(t,e){return e.profit>=0?t+e.profit:t}),0),C=n.reduce((function(t,e){return e.profit<0?t+e.profit:t}),0),b=n.reduce((function(e,i){return i.profit>=0?e+b$t(i,t.getContracts):e}),0),S=n.reduce((function(e,i){return i.profit<0?e+b$t(i,t.getContracts):e}),0);return{contract:o,count:n.length,countSell:s.length,countBuy:r.length,profitCount:a,lossCount:c,pips:f,pipsSell:m,pipsBuy:v,prof:l,profitSell:u,profitBuy:d,onlyProfit:y,onlyLoss:C,volume:h,volumeSell:p,volumeBuy:g,onlyProfitPip:b,onlyLossPip:S}}))}})},P$t={name:"ReportsActivePortfolio",components:{TopTable:Xet,BottomDetailTable:git,DistributionLineGraph:lot,OpenOrdersAnalitics:Sit,PeriodPortfolioChart:HMt},props:{},mixins:[C$t,S$t,qe,xt],data:function(){return{statData:[],statusNoStat:!1}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getDefaultAccount:"subscribeOrders/getDefaultAccount",apiUrl:"api/api",getSession:"auth/getSession",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders"})),{},{colors:function(){var t=[].concat(Object(x["a"])(this.openOrders),Object(x["a"])(this.closedOrders)).map((function(t){return t.contractName}));t=Array.from(new Set(t));var e=this.getSetRandomColors,i=[];return t.length>10&&Array.from(new Array(t.length-10)).forEach((function(){var t=uB(),e=t.color,o=t.fill;i.push({color:e,fill:o})})),[].concat(Object(x["a"])(e),i)},getSubscriptionsBySource:function(){var t=this;if(this.findPortfolio&&this.allSubscriptionCurrentDate){var e=this.allSubscriptionCurrentDate,i=e.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}));return i.map((function(t){return t.subscription.id.toString()}))}},statDataCommon:function(){var t;return this.statData&&null!==(t=this.statData)&&void 0!==t&&t.length?this.statData.find((function(t){return"Common"===t.dataType})):{}},statDataBuy:function(){var t;return this.statData&&null!==(t=this.statData)&&void 0!==t&&t.length?this.statData.find((function(t){return"Buy"===t.dataType})):{}},statDataSell:function(){var t;return this.statData&&null!==(t=this.statData)&&void 0!==t&&t.length?this.statData.find((function(t){return"Sell"===t.dataType})):{}},commonVolumeOpen:function(){return this.openOrders.reduce((function(t,e){return t+e.volume}),0)},dataForGetColorsPortfolios:function(){var t={};return this.openOrders.forEach((function(e){t[e.contractName]||0===t[e.contractName]||(t[e.contractName]=0),t[e.contractName]+=e.volume})),t},percentForGetColorsPortfolios:function(){var t={};return this.closedOrders.forEach((function(e){t[e.contractName]||(t[e.contractName]={all:0,profit:0}),t[e.contractName].all+=1,e.profit>=0&&(t[e.contractName].profit+=1)})),t},totalProfit:function(){var t=this.closedOrders.reduce((function(t,e){return t+e.profit}),0),e=this.openOrders.reduce((function(t,e){return t+e.profit}),0);return t+e},getColorsPortfolios:function(){var t,e,i=this,o={},n=0;return null!==(t=this.openOrders)&&void 0!==t&&t.length&&this.openOrders.forEach((function(t){if(!o[t.contractName]){var e,s=null===(e=i.percentForGetColorsPortfolios)||void 0===e?void 0:e[t.contractName];o[t.contractName]={color:i.colors[n].color,contract:t.contractName,volume:0,closedProfit:0,openProfit:0,percentProfit:s?Lm(100*s["profit"]/s["all"],2,!0):0,data:Math.ceil(100*i.dataForGetColorsPortfolios[t.contractName]/i.commonVolumeOpen)},n++}o[t.contractName].volume+=t.volume,o[t.contractName].openProfit+=t.profit})),null!==(e=this.closedOrders)&&void 0!==e&&e.length&&this.closedOrders.forEach((function(t){if(!o[t.contractName]){var e=i.percentForGetColorsPortfolios[t.contractName];o[t.contractName]={color:i.colors[n].color,contract:t.contractName,volume:0,closedProfit:0,openProfit:0,percentProfit:e?Lm(100*e["profit"]/e["all"],2,!0):0,data:0},n++}o[t.contractName].volume+=t.volume,o[t.contractName].closedProfit+=t.profit})),Object.values(o)}}),methods:{getStatData:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({AccountId:t.findPortfolio.subAccountId}),e.next=3,t.$workKeys.signMessage(i,t.getSession.sk);case 3:o=e.sent,t.$http.post("".concat(t.apiUrl,"GetAccountShortStatistic"),i,{headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":o,"Content-type":"application/json"}}).then((function(e){e.data&&e.data.data.length?t.statData=e.data.data:t.statusNoStat=!0}));case 5:case"end":return e.stop()}}),e)})))()}},mounted:function(){this.getStatData()},destroyed:function(){}},T$t=P$t,x$t=(i("52a6"),Object(C["a"])(T$t,m$t,v$t,!1,null,"150df4a9",null)),O$t=x$t.exports,w$t={name:"GraphBlocks",components:{StatWidgetForPortfolio:f$t,PortfolioIncome:EI,ComparisonPortfolioParticipants:QMt,UserProfileTable:qht,PeriodPrortfolioChart:HMt,IncomeProtfolio:o$t,ExtandStatPortfolio:l$t,DxPopup:xo.a,DayReportByPortfolioWidget:RMt,ReportsActivePortfolio:O$t},mixins:[Ot],data:function(){return{tooltipText:"",buttonsCreatedPortfolio:[{component:"PortfolioIncome",tooltip:this.$t("apioc"),text:this.$t("portfolio_income")},{component:"ComparisonPortfolioParticipants",tooltip:this.$t("coppp"),text:this.$t("comparison")},{component:"StatWidgetForPortfolio",tooltip:this.$t("additional_portfolio_statistics"),text:this.$t("statistic")}],buttonsActivePortfolio:[{component:"PortfolioIncome",tooltip:this.$t("yibpp"),text:this.$t("portfolio_income")},{component:"PeriodPrortfolioChart",tooltip:this.$t("ypifa"),text:this.$t("iftd")},{component:"IncomeProtfolio",tooltip:this.$t("yiotp"),text:this.$t("equity_increase")},{component:"ComparisonPortfolioParticipants",tooltip:this.$t("coppp"),text:this.$t("comparison")},{component:"ExtandStatPortfolio",tooltip:this.$t("posdm"),text:this.$t("of_success")},{component:"ReportsActivePortfolio",tooltip:this.$t("portfolio_profitability_report"),text:this.$t("report")}],activeComponent:"PortfolioIncome",statusDayReport:!1,xWidthPoint:0,statDay:null,loadedSessionTableData:!0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme",getActiveTab:"expertsPortfolio/getActiveTab",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders",isLoadingOrders:"statDataForPortfolio/isLoadingOrders",getUpdatingDataPortfolio:"expertsPortfolio/getUpdatingDataPortfolio",getServerTime:"serverTime/getServerTime"})),{},{countsOrders:function(){var t,e;return(null===(t=this.openOrders)||void 0===t?void 0:t.length)+(null===(e=this.closedOrders)||void 0===e?void 0:e.length)},getButtons:function(){if(this.getStatusBag)return"Active"===this.getStatusBag||"Stoped"===this.getStatusBag?this.buttonsActivePortfolio:this.buttonsCreatedPortfolio},getStatusBag:function(){if(this.findPortfolio)return this.findPortfolio.status},activeConfigComponent:function(){if(this.getStatusBag&&this.getActiveTab){var t={PortfolioIncome:{configObject:{mode:"Active"===this.getStatusBag||"Stoped"===this.getStatusBag?"tax":"abs"}},ComparisonPortfolioParticipants:{configObject:{mode:"Created"===this.getStatusBag?"statSubs":"myStat",type:"dollar"}}};return t[this.activeComponent]}}}),watch:{getStatusBag:function(){this.getOrdersAndStatistic()},getActiveTab:function(){this.activeComponent="PortfolioIncome",this.getOrdersAndStatistic()},isLoadingOrders:function(t){t||(this.loadedSessionTableData=!this.loadedSessionTableData)},getUpdatingDataPortfolio:function(){this.getOrdersAndStatistic()}},methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},setActiveComponent:function(t){this.activeComponent=t},checkStatusNowdate:function(t){return new Date(this.getServerTime.now).getFullYear()===new Date(t).getFullYear()&&new Date(this.getServerTime.now).getMonth()===new Date(t).getMonth()&&new Date(this.getServerTime.now).getDate()===new Date(t).getDate()},setReportDate:function(t){if(!this.checkStatusNowdate(t.point.date)){this.statusDayReport||(this.xWidthPoint=t.cPointX);var e="Active"===this.getStatusBag?"myStat":"statSubs";this.statDay={mode:e,date:t.point.date},this.statusDayReport=!0}},closeReport:function(){this.statusDayReport=!1},sendCommandByOrders:function(){var t;if(this.findPortfolio){var e={command:"GetSourceOrdersByInvestBag",data:{InvestBagId:null===(t=this.findPortfolio)||void 0===t?void 0:t.id,IsActiveBag:!0}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}},ordersHandler:function(t){var e=JSON.parse(t.data);this.$store.commit("statDataForPortfolio/setOpenOrders",e[0]||[]),this.$store.commit("statDataForPortfolio/setClosedOrders",e[1]||[]),this.$store.commit("statDataForPortfolio/setLoadingOrders",!1)},getOrdersAndStatistic:function(){this.findPortfolio&&(this.$store.commit("statDataForPortfolio/removeAllOrders"),["Created"].includes(this.findPortfolio.status)?this.$store.commit("statDataForPortfolio/setLoadingOrders",!1):(this.$store.commit("statDataForPortfolio/setLoadingOrders",!0),this.$store.commit("statDataForPortfolio/setLoadingContractHours",!0),this.$store.commit("statDataForPortfolio/clearStatDataHours"),this.sendCommandByOrders()))},setMessageHandler:function(t){switch(null===t||void 0===t?void 0:t.command){case"GetSourceOrdersByInvestBag":this.ordersHandler(t);break;default:return}},getDataForTable:function(){return{openOrders:this.openOrders,closedOrders:this.closedOrders}}},mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler),this.findPortfolio&&this.getOrdersAndStatistic()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},_$t=w$t,A$t=(i("4ff7"),Object(C["a"])(_$t,kMt,IMt,!1,null,"7ecb4f55",null)),D$t=A$t.exports,k$t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ComparingPortfolio",class:t.darkClass},[e("div",{class:"ComparingPortfolio-header ComparingPortfolio-header_".concat(t.getActiveTheme)},[e("div",{staticClass:"ComparingPortfolio-blockButton"},[e("ButtonIconFlat",{attrs:{modifier:{class:["ComparingPortfolio-button ".concat("openOrders"===t.mode?"ComparingPortfolio-button_isActive_".concat(t.getActiveTheme):"ComparingPortfolio-button_".concat(t.getActiveTheme))]}},on:{click:function(e){return t.setModeStat("openOrders")}}},[t._v(t._s(t.$t("current_income")))]),e("ButtonIconFlat",{attrs:{modifier:{class:["ComparingPortfolio-button ".concat("closeOrders"===t.mode?"ComparingPortfolio-button_isActive_".concat(t.getActiveTheme):"ComparingPortfolio-button_".concat(t.getActiveTheme))]}},on:{click:function(e){return t.setModeStat("closeOrders")}}},[t._v(t._s(t.$t("closed_trade")))])],1),e("div",{staticClass:"ComparingPortfolio-blockButton"},t._l(t.typeDataButtons,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{modifier:{class:["ComparingPortfolio-buttonIcon ".concat(i.type===t.typeData?"ComparingPortfolio-buttonIcon_isActive_".concat(t.getActiveTheme):"ComparingPortfolio-buttonIcon_".concat(t.getActiveTheme))]}},on:{click:function(e){return t.setTypeData(i.type)},mouseenter:function(e){t.viewTooltipHandler(e,t.$t(i.tooltip))},mouseleave:t.hideTooltip}},[e("svgIcon",{attrs:{name:i.icon}})],1)})),1)]),t.noStatStatus?e("div",{staticClass:"ComparingPortfolio-noStat",class:"ComparingPortfolio-noStat_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}}),e("div",[t._v(t._s(t.$t("tsabg")))])],1):e("div",{staticClass:"containerForCompare",class:"containerForCompare_".concat(t.getActiveTheme)},[e("div",{staticClass:"listPortfolios"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.checkedPortfolio?e("div",{key:"scrollData",staticClass:"scrollData"},[e("transition-group",{attrs:{name:"listExperts",tag:"div"}},t._l(t.portfoliosSorted,(function(i,o){return e("div",{key:i.investBagId,on:{mouseenter:function(e){return t.setHoverPortfolio(i.investBagId)},mouseleave:function(e){return t.setHoverPortfolio(null)}}},[e("DataPortfolio",{attrs:{lastDataChart:t.getLastPointPortFolio(o),portfolio:i,color:i.color,currencyChar:t.getCurrencyChar,checkedPortfolio:t.checkedPortfolio},on:{setStatus:t.setStatus}})],1)})),0),e("div",{class:"ComparingPortfolio-currentProfit ComparingPortfolio-currentProfit_".concat(t.getActiveTheme),style:{color:t.getAllProfitCount<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"ComparingPortfolio-currentProfit-arrow",style:{color:"up"===t.directionArrow?t.getGreenColor.color:t.getRedColor.color}},["openOrders"===t.mode?e("div",[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directionArrow,"_direct")}})],1):t._e()]),e("div",{staticClass:"ComparingPortfolio-currentProfit-data",class:"ComparingPortfolio-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(t.getAllProfitCount,2)," / ").concat(t.$moneyf(t.getPercentOnEquity,t.getPercentOnEquity<.01?5:2)," %")))]),e("div",{staticClass:"ComparingPortfolio-currentProfit-title",class:"ComparingPortfolio-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"ComparingPortfolio-currentProfit-text",class:"ComparingPortfolio-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("total_result")))])])])],1):e("div",{key:"loadingList",staticClass:"loadingList"},t._l(15,(function(t){return e("Sceleton",{key:t,attrs:{variant:"text",width:"300px",height:32}})})),1)])],1),e("div",{staticClass:"graph"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.checkedPortfolio?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.points?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.metaInfoLines,watermark:t.$t("comparison_of_investments"),typeXAxis:"dateClear",theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:t.hoverPoint}}):t._e()],1),t.positionHoverWidget?e("div",{class:"ComparingPortfolio-hoverWidget ComparingPortfolio-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"ComparingPortfolio-hoverWidgetRow ComparingPortfolio-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"ComparingPortfolio-hoverWidgetStat ComparingPortfolio-hoverWidgetStat_".concat(t.getActiveTheme),style:{color:i.color}},[t._v(t._s(i.stat))])])})),0):t._e()],1)])])},I$t=[],B$t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DataPortfolio",class:t.darkClass},[e("div",{staticClass:"checkboxBlock",class:{colored:t.color},style:t.styleColor},[e("DxCheckBox",{attrs:{value:t.getChecked,elementAttr:{class:"checkBoxCustom"},disabled:t.disabled,onValueChanged:t.setStatus}})],1),e("div",{staticClass:"namePortfolio"},[t._v(t._s(t.portfolioName))]),e("hr"),e("div",{staticClass:"diagramm"},[e("div",{staticClass:"DataPortfolio-profit",style:{color:t.color}},[t._v(t._s(t.closeAbsProfit))])])])},M$t=[],$$t={name:"DataPortfolio",mixins:[xt],props:{portfolio:{type:Object},currencyChar:{type:String},lastDataChart:{type:Number,default:0},typeData:{type:String},color:{type:String,default:"green"},checkedPortfolio:{type:Array}},components:{DxCheckBox:Th["DxCheckBox"],ProgressRoundDiagram:c$},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios"})),{},{getChecked:function(){var t=this;return this.checkedPortfolio.find((function(e){return e.investBagId===t.portfolio.investBagId})).status},portfolioName:function(){var t=this;return this.getCreatedPortfolios.find((function(e){return e.id===t.portfolio.investBagId})).name},disabled:function(){return!1},styleColor:function(){return this.color?{"--color-checkbox":this.color}:{}},closeAbsProfit:function(){return"".concat(this.currencyChar," ").concat(this.$moneyf(this.lastDataChart,this.lastDataChart>1e3?0:2))},expertsForStat:function(){var t=[];return this.portfolio.data.forEach((function(e){e[1].forEach((function(e){return t.push(e)}))})),t},totalClosedOrders:function(){var t=[];return this.expertsForStat.forEach((function(e){t.push(e[1].at(-1)[10])})),t.reduce((function(t,e){return t+e}),0)/t.length},ordersClosedProfit:function(){var t=[];return this.expertsForStat.forEach((function(e){t.push(e[1].at(-1)[11])})),t.reduce((function(t,e){return t+e}),0)/t.length},getProfitOrdersPercent:function(){return this.totalClosedOrders?Math.ceil(100/(this.totalClosedOrders/this.ordersClosedProfit)):0}}),methods:{setStatus:function(t){this.$emit("setStatus",{status:t.value,investBagId:this.portfolio.investBagId})}}},L$t=$$t,F$t=(i("76c8"),Object(C["a"])(L$t,B$t,M$t,!1,null,"047fa918",null)),j$t=F$t.exports,R$t={name:"ComparingPortfolio",mixins:[xt,qe,Ot],components:{DataPortfolio:j$t,Sceleton:nT,LineEventChart:Uk,DxTooltip:wt["DxTooltip"]},props:{commonStatisticsPortfolios:{default:null},commonNowStatisticsPortfolios:{default:null}},data:function(){return{mode:"openOrders",checkedPortfolio:null,hoverPortfolio:null,metaInfoLines:null,textTooltip:"",typeDataButtons:[{icon:"SortDollar",type:"abs",tooltip:this.$t("profit_in_money")},{icon:"SortPersent",type:"rel",tooltip:this.$t("prtae")}],typeData:"abs",positionHoverWidget:null,statsForHoverWidget:null,points:null,orders:null,directionArrow:"up",noStatStatus:!1}},watch:{commonStatisticsPortfolios:function(t){t&&this.setCheckedPortfolios()},getStatByOrders:function(t){t&&!this.orders&&(this.orders=this.$orderStorage.getOrdersOnStorage())},getActiveTheme:function(){this.setCheckedPortfolios()},getAllProfitCount:function(t,e){void 0!==t&&void 0!==e&&(this.directionArrow=t>e?"up":"down")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},isVisibleGraph:function(){return this.checkedPortfolio&&this.commonStatisticsPortfolios},portfoliosForStat:function(){var t=this;if(this.commonStatisticsPortfolios)return this.commonStatisticsPortfolios.map((function(e,i){var o=uB(),n=t.combinedData(e[1]),s=n.reduce((function(t,e){return e[1]}),0);return{investBagId:e[0],profit:s,data:e[1],subs:t.allSubscriptionCurrentDate.filter((function(t){return t.subscription.bagId===e[0]})).map((function(t){return t.subscription.id})),color:t.getSetRandomColors[i]?t.getSetRandomColors[i].color:o.color,fill:t.getSetRandomColors[i]?t.getSetRandomColors[i].fill:o.fill}}))},portfoliosSorted:function(){var t=this;if(this.checkedPortfolio&&this.portfoliosForStat)return this.portfoliosForStat.sort((function(e,i){return!!t.checkedPortfolio.find((function(t){return t.investBagId===i.investBagId})).status-!!t.checkedPortfolio.find((function(t){return t.investBagId===e.investBagId})).status}))},getPercentOnEquity:function(){if(!this.getAllProfitCount||!this.getStatistics)return 0;var t=this.getStatistics.accountDaily.at(-1).equityClose,e=100*this.getAllProfitCount/t;return e},getAllProfitCount:function(){if(!this.points||!this.points.length)return 0;var t=[];return this.points.forEach((function(e){e.length&&t.push(e.at(-1).y)})),t.length?t.reduce((function(t,e){return t+e}),0):0},portfoliosFiltered:function(){var t=this;if(this.checkedPortfolio&&this.portfoliosForStat)return this.portfoliosForStat.filter((function(e){var i=t.checkedPortfolio.find((function(t){return t.investBagId===e.investBagId}));return null===i||void 0===i?void 0:i.status})).sort((function(t,e){return e.profit-t.profit}))}}),methods:{getEquityByDate:function(t){if(this.getStatistics){if(this.getStatistics.accountDaily.length){var e=this.getStatistics.accountDaily.find((function(e){return new Date(t).getFullYear()===new Date(e.date).getFullYear()&&new Date(t).getMonth()===new Date(e.date).getMonth()&&new Date(t).getDate()===new Date(e.date).getDate()}));return e?e.equityClose:this.getStatistics.accountDaily.at(-1).equityClose}return this.getStatistics.equity}},setModeStat:function(t){this.mode=t,this.setPointsForChart()},viewTooltipHandler:function(t,e){this.textTooltip=e,this.viewTooltip(t)},setTypeData:function(t){this.typeData=t,this.setPointsForChart()},getLastPointPortFolio:function(t){if(this.points[t])return this.points[t].at(-1).y},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setMessageHandler:function(t){"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.orders.tradingOrders=t.data[0].openOrders.tradingOrders,this.setPointsForChart())},setStatus:function(t){var e=t.status,i=t.investBagId,o=this.checkedPortfolio.findIndex((function(t){return t.investBagId===i}));this.checkedPortfolio[o].status=e,this.setPointsForChart()},setCheckedPortfolios:function(){this.checkedPortfolio=this.portfoliosForStat.map((function(t){return{investBagId:t.investBagId,status:!0}})),this.setPointsForChart()},expertsForStat:function(t){var e=[];return t.data.forEach((function(t){t[1].forEach((function(t){return e.push(t)}))})),e},combinedData:function(t){var e=this,i={},o=[];t.forEach((function(t){return t[1].forEach((function(t){var e=t[1].map((function(t){return $W(t)}));o.push(e.some((function(t){return 2===t.statType})))}))})),t.forEach((function(t){t[1].forEach((function(t){var n=t[1].map((function(t){return $W(t)})),s=n.filter((function(t){return 1!==t.statType}));s.length?s.forEach((function(t){var o=new Date(t.date).getTime(),n=t.profitClose,s=t.equity,r=e.getEquityByDate(t.date),a="closeOrders"===e.mode?n:s,c=a?100*a/r:0,l="abs"===e.typeData?a:c;isNaN(l)&&(l=0),i[o]?i[o].push(l):i[o]=[l]})):(s=n.filter((function(t){return 1===t.statType})),o.every((function(t){return!t}))&&s.forEach((function(t){var o=new Date(t.date).getTime(),n=t.profitClose,s=t.equity,r=e.getEquityByDate(t.date),a="closeOrders"===e.mode?n:s,c=a?100*a/r:0,l="abs"===e.typeData?a:c;isNaN(l)&&(l=0),i[o]?i[o].push(l):i[o]=[l]})))}))}));var n=Object.entries(i).sort((function(t,e){return+t[0]-+e[0]})),s=n.map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return 1===o.length?[+i,o[0]]:[+i,o.reduce((function(t,e){return t+e}),0)]}));return this.averageIncome=s.at(-1)[1],s},setHoverPortfolio:function(t){this.hoverPortfolio=t,this.setPointsForChart()},setPointsForChart:function(){var t=this;this.portfoliosFiltered&&(this.metaInfoLines=[],this.points=[],this.portfoliosFiltered.forEach((function(e){t.points.push([]),t.metaInfoLines.push({type:"line",color:e.color,fill:e.investBagId===t.hoverPortfolio?e.color:e.fill,fillIndicator:"dark"===t.getActiveTheme?"#151924":"#fff",label:"",lineWidth:e.investBagId===t.hoverPortfolio?7:3,title:""});var i=0,o=0;if(t.orders.closedOrders.length){var n=t.orders.closedOrders.filter((function(t){return e.subs.some((function(e){return e===+t.subscriptionId}))}));n.length&&(i=n.reduce((function(t,e){return t+e.profit}),0))}if(t.orders.tradingOrders.length){var s=t.orders.tradingOrders.filter((function(t){return e.subs.some((function(e){return e===+t.subscriptionId}))}));s.length&&(o=s.reduce((function(t,e){return t+e.profit}),0))}var r=t.combinedData(e.data);r.forEach((function(e){t.points.at(-1).push({x:e[0],y:e[1],date:e[0]})})),"abs"===t.typeData&&("closeOrders"===t.mode?t.points.at(-1).at(-1).y=i:t.points.at(-1).at(-1).y=i+o)})))}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.$orderStorage.getOrdersOnStorage()&&(this.orders=this.$orderStorage.getOrdersOnStorage()),this.commonStatisticsPortfolios&&this.setCheckedPortfolios()},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},W$t=R$t,N$t=(i("9e5f"),Object(C["a"])(W$t,k$t,I$t,!1,null,"60d8de49",null)),E$t=N$t.exports,U$t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ExpandGraphBlock"},[e("UserProfileGrid",{attrs:{configObject:t.configObject}})],1)},V$t=[],H$t=function(){var t=this,e=t._self._c;return e("div",{ref:"contentGrid",staticClass:"userIncomeGrid",style:{gap:"".concat(t.getFullStatusForRows?0:.4,"rem"),padding:void 0!==t.configObject.paddingGrid?"".concat(t.configObject.paddingGrid,"px"):"0.4rem",minHeight:t.minHeight,height:t.getFullStatusForRows||t.recursive?"100%":"fit-content"}},t._l(t.getRows,(function(i,o){return t.getRows.length?e("div",{key:"".concat(o,"row"),staticClass:"userIncomeGrid-contentRow",class:"userIncomeGrid-contentRow_".concat(i.modeRow," ").concat(t.directionModeRows?"directionRowMode":""," ").concat(i.hiddenMode?"userIncomeGrid-contentRow_hidden-row":"")},t._l(i.columns,(function(n,s){return e("div",{key:"".concat(s,"cl"),staticClass:"userIncomeGrid-contentColumn",class:"userIncomeGrid-contentColumn_".concat(n.mode," ").concat(t.directionModeRows?"directionColumnMode":""," ").concat(n.hiddenMode?"userIncomeGrid-contentRow_hidden-row":""),style:{transform:"translateX(".concat(t.transform&&"fullMode"!==n.mode?"calc(".concat(-100*t.transform,"% - ").concat(4*t.transform,"px)"):0,")"),flexBasis:t.getMaxWidthForColumn(o,s),width:t.getMaxWidthForColumn(o,s)}},[e(n.component,{tag:"component",attrs:{topBarWidgetParams:{row:i.modeRow,col:{index:s,mode:n.mode},directionModeRows:t.directionModeRows},configObject:n.config},on:{setMinHorizontal:function(e){return t.setMinHorizontal(o,s)},setNormal:function(e){return t.setNormal(o,s)},setFullScreenMode:function(e){return t.setFullScreenMode(o,s)},setNormalScreenMode:function(e){return t.setNormalScreenMode(o,s)},setActiveDate:function(e){return t.setActiveDate(e,o,s)}}})],1)})),0):t._e()})),0)},G$t=[],q$t=function(){var t=this,e=t._self._c;return e("div",{class:"userProfileIncomeChart userProfileIncomeChart_".concat(t.getActiveTheme," ").concat("horizontalMin"===t.topBarWidgetParams.col.mode?"userProfileIncomeChart-minMode":"")},[e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode}},[e("transition",{attrs:{"enter-active-class":"animate__animated animate__fadeIn","leave-active-class":"animate__animated animate__fadeOut",duration:300}},[e("div",{class:"userProfileIncomeChart-groupButton userProfileIncomeChart-groupButton_".concat(t.getActiveTheme)},[e("div",{staticClass:"userProfileIncomeChart-holow-pig",on:{mouseenter:function(e){return t.viewTooltip(".userProfileIncomeChart-holow-pig")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:"holow-pig"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),"balanceEquity"===t.aciveComponent?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:function(e){return t.setActiveComponent("balanceEquity")}}})],1),e("div",{staticClass:"userProfileIncomeChart-clearProfit",on:{mouseenter:function(e){return t.viewTooltip(".userProfileIncomeChart-clearProfit")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:"Favorite_Invest"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),"clearProfit"===t.aciveComponent?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:function(e){return t.setActiveComponent("clearProfit")}}})],1),e("div",{staticClass:"userProfileIncomeChart-compareButton",on:{mouseenter:function(e){return t.viewTooltip(".userProfileIncomeChart-compareButton")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:"Compare"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),"compare"===t.aciveComponent?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:function(e){return t.setActiveComponent("compare")}}})],1)])])],1),"balanceEquity"===t.aciveComponent?e("div",{staticClass:"userProfileIncomeChart-balanceEquity"},[e("UserProfilePigWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,configObject:{modeWidget:"mono"}}})],1):t._e(),"clearProfit"===t.aciveComponent?e("div",{staticClass:"userProfileIncomeChart-balanceEquity"},[e("UserProfileClearProfit",{attrs:{topBarWidgetParams:t.topBarWidgetParams}})],1):t._e(),"compare"===t.aciveComponent?e("div",{staticClass:"userProfileIncomeChart-compare"},[e("UserProfileComparisonIncome",{attrs:{topBarWidgetParams:t.topBarWidgetParams}})],1):t._e(),e("DxTooltip",{key:t.tooltipVisible,attrs:{container:"body",visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.hintText))])],1)},z$t=[],Y$t=function(){var t=this,e=t._self._c;return e("div",{staticClass:"userProfileEquityBalanceChart"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!1},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(t._s("".concat(t.$t("headerAccountMenuGetLoad1"),"/").concat(t.$t("headerAccountMenuGetLoad2"))))]},proxy:!0},{key:"content",fn:function(){return[e("ChartWrapper",{attrs:{showTitle:!1,resizeStatus:t.getRowStatus},on:{initCanvas:t.getCanvasesObjects},scopedSlots:t._u([{key:"chartContent",fn:function(){return[e("div",{staticClass:"userProfileEquityBalanceChart-info"},[e("div",{staticClass:"userProfileEquityBalanceChart-info-row"},[e("div",{class:"userProfileEquityBalanceChart-info-title userProfileEquityBalanceChart-info-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("headerAccountMenuGetLoad1")))]),e("div",{class:"userProfileEquityBalanceChart-info-data userProfileEquityBalanceChart-info-data-balance_".concat(t.getActiveTheme)},[t._v("$ "+t._s(t.$moneyf(t.getBalanceClose)))])]),e("div",{staticClass:"userProfileEquityBalanceChart-info-row"},[e("div",{class:"userProfileEquityBalanceChart-info-title userProfileEquityBalanceChart-info-title_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("headerAccountMenuGetLoad2")))]),e("div",{class:"userProfileEquityBalanceChart-info-data userProfileEquityBalanceChart-info-data-equity_".concat(t.getActiveTheme)},[t._v("$ "+t._s(t.$moneyf(t.getEquityClose)))])]),t._l(t.getDataForInfo,(function(i,o){return e("div",{key:o,staticClass:"userProfileEquityBalanceChart-info-row"},[e("div",{class:"userProfileEquityBalanceChart-info-title userProfileEquityBalanceChart-info-title_".concat(t.getActiveTheme)},[t._v(t._s(i.title))]),e("div",{class:"userProfileEquityBalanceChart-info-data ".concat(i.data<0?"userProfileEquityBalanceChart-info-data-negative_".concat(t.getActiveTheme):"userProfileEquityBalanceChart-info-data-positive_".concat(t.getActiveTheme))},[t._v(t._s("".concat(i.unit," ").concat(t.$moneyf(i.data))))])])}))],2)]},proxy:!0},{key:"legend",fn:function(){return[e("ChartLegend",{attrs:{legends:t.getChartLegend}})]},proxy:!0}])})]},proxy:!0}])})],1)},X$t=[],Q$t=function(){var t=this,e=t._self._c;return e("div",{class:"LineChart".concat(t.getClass)},[e("canvas",{ref:"lineChart"})])},J$t=[],K$t=(i("2af1"),i("ace4"),i("4a9b"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("986a"),i("1d02"),i("d5d6"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("170b"),i("b39a"),i("6ce5"),i("2834"),i("72f7"),i("4ea1"),i("505f")),Z$t=void 0,tLt={props:{loadForResize:{default:!0},statYears:{default:null},configObject:{type:Object,require:!0,default:function(){return{type:"line",smooth:!1,indicatorAxis:!0,points:[],expandX:{maxExpand:0,minExpand:0},baseLine:{data:0,color:"#3c73f1"},expandY:{maxExpand:.15,minExpand:.15},size:{width:32,height:100,fixSize:!1},stroke:{strokeStyle:"red",lineWidth:2},zones:{positive:"light"===Z$t.getActiveTheme?"rgba(0, 142, 114, 1)":"rgba(30, 240, 177, 1)",negative:"light"===Z$t.getActiveTheme?"rgba(233, 18, 18,1)":"rgba(250, 76, 74,1)"},fill:!0,fillStyle:{color:"blue",gradient:""},shadow:{status:!0,options:{shadowColor:"rgba(255,255,255,0.5)",shadowBlur:10,shadowOffsetY:10}},multiline:!1,grid:{status:!0,xAxis:[],yAxis:[],color:"#fafafa"},modifier:{class:[],style:{},id:""}}}},refWrapper:{type:HTMLDivElement}},data:function(){return{canvasObject:null,ctx:null,smartObject:null,tickAnimation:0,lcoords:[],canvasCoords:[],xServiceObject:null,yServiceObject:null,maxPoint:null,minPoint:null,pointUtils:new PD}},watch:{getSize:function(){this.configObject.size.fixSize||this.initCanvas()},getAxisXPoints:function(t){t.length&&this.drawXLine(t)},getAxisYPoints:function(t){t.length&&this.drawYLine(t)},getPoints:function(t){t.length&&this.initDataForDraw(t)}},computed:{getColorsForMultiLine:function(){return ji},getSize:function(){return this.configObject.size},getClass:function(){return this.configObject.modifier.class.length?this.configObject.modifier.class.join(" "):""},getAxisXPoints:function(){return this.configObject.grid.xAxis},getAxisYPoints:function(){return this.configObject.grid.yAxis},getPoints:function(){return this.configObject.points},getMaxPoint:function(){if(this.getPoints)return Math.max.apply(null,this.getPoints[0].filter((function(t){return t.data&&t.data>0})).map((function(t){return t.data})))},getBasePoint:function(){var t=this;return this.getAxisYPoints.find((function(e){return e.text===t.configObject.baseLine.data}))}},methods:{initCanvas:function(){this.$refs.lineChart&&(this.canvasObject=this.$refs.lineChart,this.ctx=this.canvasObject.getContext("2d"),this.smartObject=new _B(this.canvasObject,this.ctx),this.smartObject.initCanvas(this.configObject.size.width,this.configObject.size.height))},initDataForDraw:function(t){var e=this;if(t[0].length){var i=[],o=[],n=[];this.lcoords=[],this.canvasCoords=[],t.forEach((function(t){t.length&&t.forEach((function(t){t.time&&(i.push(t.time),o.push(t.data),n.push(t.year))}))})),this.xServiceObject=this.getServiceData(i.sort(),this.configObject.expandX,this.configObject.size.width),this.yServiceObject=this.getServiceData(o.sort(),this.configObject.expandY,this.configObject.size.height),t.forEach((function(t){e.lcoords.push([]),e.canvasCoords.push([]),t.length&&t.forEach((function(t){void 0!==t.data&&(e.lcoords[e.lcoords.length-1].push({x:t.time,y:t.data,year:t.year}),e.canvasCoords[e.canvasCoords.length-1].push({x:e.mapLogicalToCanvasXCoordinate(t.time),y:e.mapLogicalToCanvasYCoordinate(t.data)}))}))}));var s=[];if(this.lcoords.forEach((function(t){t.length&&s.push(e.setSectors(t))})),this.$emit("setPoints",{lcoords:this.lcoords,canvasCoords:this.canvasCoords}),s.length&&s.forEach((function(t){t.forEach((function(t){var i=[];t.points.forEach((function(t){i.push(e.mapLogicalToCanvasXCoordinate(t.x)),i.push(e.mapLogicalToCanvasYCoordinate(t.y))})),e.drawSpline(e.smartObject.ctx,i,.3,!1,t.trend,!0,s.length>1?e.statYears.find((function(e){return t.year===e.year})).color:void 0),e.drawSpline(e.smartObject.ctx,i,.3,!1,t.trend,!1,s.length>1?e.statYears.find((function(e){return t.year===e.year})).color:void 0)})),e.configObject.indicatorAxis&&e.drawAxisIndicator(e.mapLogicalToCanvasYCoordinate(t[t.length-1].points[t[t.length-1].points.length-1].y),e.statYears.find((function(e){return t[0].year===e.year})).color)})),1===this.lcoords.length){var r=this.lcoords[0].find((function(t){return t.y===Math.max.apply(null,e.lcoords[0].map((function(t){return t.y})))}));this.$emit("setPoints",{lcoords:this.lcoords,canvasCoords:this.canvasCoords});var a=this.lcoords[0].find((function(t){return t.y===Math.min.apply(null,e.lcoords[0].map((function(t){return t.y})))}));a&&a!==this.lcoords[0][this.lcoords[0].length-1]&&0!==a.y&&a.y<0&&this.drawMaxLine(a,"negative"),r&&r!==this.lcoords[0][this.lcoords[0].length-1]&&0!==r.y&&r.y>0&&this.drawMaxLine(r,"positive"),this.configObject.indicatorAxis&&this.canvasCoords.length&&this.lcoords.length&&this.drawAxisIndicator(this.canvasCoords[0][this.canvasCoords[0].length-1].y,this.lcoords[0][this.lcoords[0].length-1].y<0?this.configObject.zones.negative:this.configObject.zones.positive)}else{var c={x:this.canvasCoords[this.canvasCoords.length-1][this.canvasCoords[this.canvasCoords.length-1].length-1].x,y:this.canvasCoords[this.canvasCoords.length-1][this.canvasCoords[this.canvasCoords.length-1].length-1].y};this.drawDashLine(c,this.statYears[this.statYears.length-1].color)}}},changeAlfa:function(t,e){if(t="".concat(t),!(t.length<5)){var i=t.replace(/[^,\d]/g,"").split(",");return i[3]=+e.toFixed(3),"rgba(".concat(i.join(),")")}},getControlPoints:function(t,e,i,o,n,s,r){var a=Math.sqrt(Math.pow(i-t,2)+Math.pow(o-e,2)),c=Math.sqrt(Math.pow(n-i,2)+Math.pow(s-o,2)),l=r*a/(a+c),u=r-l,d=i+l*(t-n),h=o+l*(e-s),p=i-u*(t-n),g=o-u*(e-s);return[d,h,p,g]},drawSpline:function(t,e,i,o,n,s,r){var a=this.mapLogicalToCanvasYCoordinate(0);t.lineWidth=this.configObject.stroke.lineWidth,t.lineCap="round",t.save();var c=[],l=e.length;if(e.length<=4)t.beginPath(),t.strokeStyle=void 0===r?n<0?this.configObject.zones.negative:this.configObject.zones.positive:r,t.fillStyle=void 0===r?n>0?this.configObject.zones.positiveFill:this.configObject.zones.negativeFill:this.changeAlfa(r,.2),t.lineTo(e[0],e[1]),t.lineTo(e[2],e[3]),s?(t.lineTo(e[2],a),t.lineTo(e[0],a),t.fill()):t.stroke(),t.closePath();else{for(var u=0;u0?this.configObject.zones.positiveFill:this.configObject.zones.negativeFill:this.changeAlfa(r,.2),t.beginPath(),t.lineTo(e[d],e[d+1]),t.bezierCurveTo(c[2*d-2],c[2*d-1],c[2*d],c[2*d+1],e[d+2],e[d+3]),s?(t.lineTo(e[d+2],a),t.lineTo(e[d],a),t.fill()):t.stroke(),t.closePath();t.strokeStyle=void 0===r?n<0?this.configObject.zones.negative:this.configObject.zones.positive:r,t.fillStyle=void 0===r?n>0?this.configObject.zones.positiveFill:this.configObject.zones.negativeFill:this.changeAlfa(r,.2),t.beginPath(),t.moveTo(e[0],e[1]),t.quadraticCurveTo(c[0],c[1],e[2],e[3]),s?(t.lineTo(e[2],this.mapLogicalToCanvasYCoordinate(0)),t.lineTo(e[0],this.mapLogicalToCanvasYCoordinate(0)),t.fill()):t.stroke(),t.closePath(),t.strokeStyle=void 0===r?n<0?this.configObject.zones.negative:this.configObject.zones.positive:r,t.fillStyle=void 0===r?n>0?this.configObject.zones.positiveFill:this.configObject.zones.negativeFill:this.changeAlfa(r,.2),t.beginPath(),t.moveTo(e[l-2],e[l-1]),t.quadraticCurveTo(c[2*l-10],c[2*l-9],e[l-4],e[l-3]),s?(t.lineTo(e[l-4],this.mapLogicalToCanvasYCoordinate(0)),t.lineTo(e[l-2],this.mapLogicalToCanvasYCoordinate(0)),t.fill()):t.stroke(),t.closePath()}t.restore()},setSectors:function(t){var e=[],i=t[0].y<0?-1:1;e.push({trend:i,year:t[0].year,points:[]});for(var o=[{x:0,y:this.mapLogicalToCanvasYCoordinate(0)},{x:this.configObject.size.width,y:this.mapLogicalToCanvasYCoordinate(0)}],n=0;ni[0].y){var f=this.mapCanvasToLogicalXCoordinate(d-1);if(f){var m=a(f),v=Math.max(-1e6,Math.min(1e6,this.mapLogicalToCanvasYCoordinate(m)));o=this.pointUtils.computeIntersection([[d,g],[d-1,v]],[[0,this.mapLogicalToCanvasYCoordinate(0)],[this.configObject.size.width,this.mapLogicalToCanvasYCoordinate(0)]])}}else if(gr){var p=this.mapCanvasToLogicalXCoordinate(l-1);if(p){var g=t(p),f=Math.max(-1e6,Math.min(1e6,this.mapLogicalToCanvasYCoordinate(g))),m=this.pointUtils.computeIntersection([[l,h],[l-1,f]],[[0,r],[this.configObject.size.width,r]]);c[c.length-1].points.push({x:m[0],y:m[1]}),c.push({trend:a,points:[{x:m[0],y:m[1]}]})}}else if(h0?e.configObject.zones.positive:e.configObject.zones.negative,i.lineWidth=2,i.fillStyle=o.trend>0?e.configObject.zones.positiveFill:e.configObject.zones.negativeFill,i.fill(),i.stroke(),i.closePath()}))},drawChart:function(t){var e=this,i=this.getServiceData(t.map((function(t){return t.time})),this.configObject.expandX,this.configObject.size.width),o=this.getServiceData(t.map((function(t){return t.data})),this.configObject.expandY,this.configObject.size.height),n=t.map((function(t){return{dataPoint:t,x:Math.floor((t.time-i.minPoint)*i.ratio),y:e.configObject.size.height-(t.data-o.minPoint)*o.ratio}}));if(void 0!==this.getBasePoint){for(var s in this.configObject.smooth?this.drawFunctionCurveFromKnots(n):this.drawLine(n),this.configObject.stroke)this.smartObject.ctx[s]=this.configObject.stroke[s];if(this.configObject.shadow&&this.configObject.shadow.status)for(var r in this.configObject.shadow.options)this.smartObject.ctx[r]=this.configObject.shadow.options[r]}},getServiceData:function(t,e,i){var o=Math.max.apply(null,t),n=Math.min.apply(null,t),s=o-n,r=o+s*e.maxExpand,a=n-s*e.minExpand,c=r-a,l=i/c;return{minPoint:a,maxPoint:r,ratio:l,range:c}},mapLogicalToCanvasXCoordinate:function(t){return(t-this.xServiceObject.minPoint)*this.configObject.size.width/(this.xServiceObject.maxPoint-this.xServiceObject.minPoint)},mapLogicalToCanvasYCoordinate:function(t){var e=this.configObject.size.height/(this.yServiceObject.maxPoint-this.yServiceObject.minPoint);return this.configObject.size.height-(t-this.yServiceObject.minPoint)*e},drawCurve:function(t,e,i){var o=[];t.forEach((function(t){o.push(t.x),o.push(t.y)})),this.drawLines(this.smartObject.ctx,this.getCurvePoints(o,.5,16),e,i,this.getBasePoint);for(var n=0;n610?e("div",{staticClass:"userProfilePeriodChart-lastDates"},t._l(t.getLastDates,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-lastDatesItem userProfilePeriodChart-lastDatesItem_".concat(t.getActiveTheme," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive"," userProfilePeriodChart-lastDatesItem_").concat(t.getActiveTheme,"-").concat(t.checkActiveDate(i.date)?"isAcitve":"noActive"),on:{click:function(e){return t.setActiveDate(i.date)},mouseenter:function(e){return t.setHoverIndex(o)},mouseleave:function(e){return t.setHoverIndex(null)}}},[t._v(t._s(i.title)),t.hoverIndex===o?e("div",{class:"userProfilePeriodChart-hoverWidgetlastDates userProfilePeriodChart-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profit<0?"negative":"positive")},[e("div",[t._v("$ "+t._s(t.$moneyf(i.profit,2)))]),e("div",[t._v("% "+t._s(t.$moneyf(i.profitRel,2)))])]):t._e()])})),0):t._e(),e("div",{staticClass:"userProfilePeriodChart-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1)])]),t.dateCheckerStatus?e("DataChartChecker",{attrs:{positionPopup:{my:"top right",at:"bottom right",of:t.containerForDataChecker,offset:{x:0,y:5}},statistic:t.getStatisticsByDateChecker,period:t.period,activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()]},proxy:!0},{key:"content",fn:function(){return[t.points&&t.getStatByDate.length?e("SectorLineEventChart",{key:t.points[0][0].y,attrs:{typeXAxis:t.period,points:t.points,theme:t.getActiveTheme,interval:t.intervalGrid,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},dayExchengeIndicator:"day"===t.period},on:{hover:t.hoverPoint}}):e("Preloader",{attrs:{enabled:!0}}),t.showHoverWidget?e("div",{class:"userProfilePeriodChart-hoverWidget userProfilePeriodChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"userProfilePeriodChart-hoverWidgetRow userProfilePeriodChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"userProfilePeriodChart-hoverWidgetStat userProfilePeriodChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):e("div",{staticClass:"userProfilePeriodChart-noStat"},[e("div",{staticClass:"userProfilePeriodChart-noStatWrap"},[e("div",{staticClass:"userProfilePeriodChart-noStatIcon"},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",{staticClass:"userProfilePeriodChart-noStatText"},[t._v(t._s(t.getTextNoData))])])])]},proxy:!0}])})],1),t.getStatusShowGistogram?e("div",{staticClass:"userProfilePeriodChart-gistogramm"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showTitle:!1},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"content",fn:function(){return[e("div",{staticClass:"userProfilePeriodChart-gistogrammWrap"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)]},proxy:!0}],null,!1,3972524605)})],1):t._e()])},bLt=[],SLt={props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{showControlButton:!0,showTabButtons:!0,mode:"account",contract:"EURUSD"}}}},components:{SectorLineEventChart:Fj,ChartWrapper:pM,ChartLegend:CM,GistogrammEventChart:TI,UserProfileWrapWidget:PB,DataChartChecker:M3,Preloader:ah},mixins:[ypt,yn,qe],data:function(){return{points:null,pointsForGistogramm:null,contractStatistic:null,widthForTitle:0,accountId:null,activeDate:null,period:"day",contractStatisticByHourse:null,hoverIndex:null,simpleChartSize:{width:0,height:0},periodsButtons:[{icon:"TimePeriod_2D",period:"day"},{icon:"TimePeriod_2W",period:"week"},{icon:"TimePeriod_2M",period:"month"}],containerForDataChecker:null,dateCheckerStatus:!1,intervalGrid:null,showHoverWidget:!1,positionHoverWidget:null,statsForHoverWidget:null}},watch:{getUTCTime:function(t){this.actualServerDate=t},period:function(){this.activeDate=this.actualServerDate},getStatByDate:function(t){t&&this.setPointsForChart()},getActiveTheme:function(){this.setPointsForChart()},getEquityClose:function(t){t&&this.setPointsForChart()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getServerTime:"serverTime/getServerTime",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getTextNoData:function(){return"За указанный период по контракту ".concat(this.configObject.contract," нет статистики")},getMetaInfoForGistogramm:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")}]},getMetaInfoForLines:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("account_equity")}]},serverTime:function(){var t=new Date(this.getServerTime.utcNow);return"".concat(t.getHours()<10?"0".concat(t.getHours()):t.getHours(),":").concat(t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes()," (UTC)")},getStatusShowGistogram:function(){if(this.simpleChartSize)return this.simpleChartSize.height>410&&this.simpleChartSize.width>460},getRowStatus:function(){return this.topBarWidgetParams},getUTCTime:function(){var t;return null===(t=this.getServerTime)||void 0===t?void 0:t.utcNow},getConfigObjectForGistogramm:function(){if(this.intervalGrid&&this.yPointsForGistogramm)return{period:this.period,sizeColumn:this.intervalGrid,grid:{status:!0,xPoints:this.xPoints,yPoints:this.yPointsForGistogramm,intervalGrid:this.intervalGrid,label:"month"===this.period||"day"===this.period?"value":"day",labelShow:!0}}},getTitle:function(){return"month"===this.period?this.getTitleForMonth:"week"===this.period?this.getTitleForWeek:"day"===this.period?this.getTitleForDay:void 0},getTitleForMonth:function(){return[this.configObject.contract,"".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()),this.$t("pl"),this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]},getProfitForDate:function(){if(this.getStatByDate&&this.getStatByDate.length){var t=100*(this.getEquityClose-this.getOpenEquity)/this.getOpenEquity;this.getOpenEquity<0&&this.getEquityClose<0&&(t*=-1);var e=this.getEquityClose-this.getOpenEquity;return{profitAbs:e,profitRel:t}}},getTitleForDay:function(){return this.getStatByDate&&this.getStatByDate.length?[this.configObject.contract,"".concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime),"P/L",this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]:[this.configObject.contract,"".concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime)]},getTitleForWeek:function(){if(this.getProfitForDate)return[this.configObject.contract,"".concat(this.$t("week")," ").concat(new Date(this.activeDate).getWeek()),"P/L",this.getProfitForDate.profitAbs,this.getProfitForDate.profitRel]},getStatByDay:function(){var t=this;if(this.activeDate&&this.contractStatisticByHourse){var e=this.contractStatisticByHourse.filter((function(e){return new Date(e[3]).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(e[3]).getMonth()===new Date(t.activeDate).getMonth()&&new Date(e[3]).getDate()===new Date(t.activeDate).getDate()}));return e}},getStrokeColors:function(){return{positive:"light"===this.getActiveTheme?"#008e72":"#00ffac",negative:"light"===this.getActiveTheme?"#da0000":"#ff3232"}},getFillColors:function(){return{positive:"light"===this.getActiveTheme?"rgba(0, 142, 114, 0.1)":"rgba(0, 255, 172, 0.1)",negative:"light"===this.getActiveTheme?"rgba(218, 0, 0, 0.1)":"rgba(255, 50, 50, 0.1)"}}}),methods:{setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},hoverPoint:function(t){if(t){var e=this.points[1].findIndex((function(e){return e.date===t.point.date}));if(this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+10,"px")},e>0){var i=100*(this.points[1][e].y-this.getOpenEquity)/this.getOpenEquity;this.points[1][e].y<0&&this.getOpenEquity<0&&(i*=-1),this.statsForHoverWidget=[{stat:"$ ".concat(this.$moneyf(this.points[1][e].y,this.points[1][e].y>=1e6?0:2)),color:i>=0?"green":"red"},{stat:"% ".concat(this.$moneyf(i,2)),color:i>=0?"green":"red"}]}this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setHoverIndex:function(t){this.hoverIndex=t},setMessageHandler:function(t){var e=this;if(t&&t.command&&"AccountsDetails"===t.command){var i=t.data.find((function(t){return t.account.id===e.accountId}));if(i){var o=i.openOrders.tradingOrders;if(o.length){var n=o.filter((function(t){return t.instrumentName===e.configObject.contract}));n.length&&this.checkActualDate()&&("day"===this.period?this.$set(this.contractStatisticByHourse.at(-1),1,n.reduce((function(t,e){return t+e.profit}),0)):this.$set(this.contractStatistic.at(-1),1,n.reduce((function(t,e){return t+e.profit}),0)))}}}},checkActualDate:function(){var t=new Date(this.activeDate),e=new Date(this.actualServerDate),i={day:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),month:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth(),week:t.getFullYear()===e.getFullYear()&&t.getWeek()===e.getWeek()};return i[this.period]},setPeriod:function(t){this.period=t},checkActiveDate:function(t){var e={month:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.activeDate).getMonth(),week:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getWeek()===new Date(this.activeDate).getWeek(),day:new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.activeDate).getMonth()&&new Date(t).getDate()===new Date(this.activeDate).getDate()};return e[this.period]},setStatForLastDates:function(t){return"day"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getDate(),profit:t.profitAbs,profitRel:t.profitRel}})):"week"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getWeek(),profit:t.profitAbs,profitRel:t.profitRel}})):"month"===this.period?t.map((function(t){return{date:t.date,title:new Date(t.date).getMonth()+1,profit:t.profitAbs,profitRel:t.profitRel}})):void 0},setActiveDate:function(t){this.activeDate=t},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},setPointsForChart:function(){var t=this;if(this.getStatByDate.length){var e;"week"===this.period?e=7:"month"===this.period?e=new Date(this.activeDate).daysInMonth():"day"===this.period&&(e=24),this.intervalGrid=Math.round(this.simpleChartSize.width/e),this.points=[[]],this.pointsForGistogramm=[[]];for(var i=function(e){var i;if("day"===t.period?i=t.getStatByDate.find((function(t){return new Date(t[3]).getHours()===e})):"week"===t.period?i=t.getStatByDate.find((function(t){return new Date(t[3]).getDay()?new Date(t[3]).getDay()-1===e:6})):"month"===t.period&&(i=t.getStatByDate.find((function(t){return new Date(t[3]).getDate()===e+1}))),i){t.points[0].push({x:e,y:i[1],date:i[3]});var o=100*(i[1]-t.getOpenEquity)/t.getOpenEquity;i[1]<0&&t.getOpenEquity&&(o*=-1),t.pointsForGistogramm[0].push({x:e,y:o,date:i[3]})}else t.points[0].push({x:e}),t.pointsForGistogramm[0].push({x:e})},o=0;o0?e+1:1}},getForecastMonth:function(){if(this.getStatByDate){var t;switch(this.configObject.period){case"year":t=new Date(this.configObject.activeDate).daysInYear();break;case"month":t=new Date(this.configObject.activeDate).daysInMonth();break;case"week":t=7;break;case"day":t=1;break}return FLt(t,this.getStatByDate,this.getTradePeriod,this.getStartDeposit,this.getOpenEquity)}},getRowStatus:function(){return this.topBarWidgetParams}}),watch:{getStatByDate:function(t){t&&this.initDataForDraw()},getActiveTheme:function(){this.initDataForDraw()},getEquityClose:function(t){t&&this.initDataForDraw()}},methods:{getImageCanvas:function(){this.$refs.chartWrapper.setImageToCanvas(),this.$refs.gistogramm.getImageCanvas()},setActiveDate:function(t){this.$emit("setActiveDate",t)},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},getCanvasesObjects:function(t){this.chartCanvas=t.chartCanvas,this.xAxisCanvas=t.xAxisCanvas,this.yAxisCanvas=t.yAxisCanvas,this.initDataForDraw()},checkActiveDate:function(t){var e={month:new Date(t).getFullYear()===new Date(this.configObject.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.configObject.activeDate).getMonth(),week:new Date(t).getFullYear()===new Date(this.configObject.activeDate).getFullYear()&&new Date(t).getWeek()===new Date(this.configObject.activeDate).getWeek(),day:new Date(t).getFullYear()===new Date(this.configObject.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.configObject.activeDate).getMonth()&&new Date(t).getDate()===new Date(this.configObject.activeDate).getDate(),year:new Date(t).getFullYear()===new Date(this.configObject.activeDate).getFullYear()};return e[this.configObject.period]},setForecastByHours:function(t){for(var e=0;ethis.getOpenEquity&&o!==t[t.length-1].y&&this.drawLineIndicator({x:e.mapLogicalToCanvasXCoordinate(this.xServiceObject,e.getSizeCanvas().width,n.x),y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y)},{x:e.getSizeCanvas().width,y:e.mapLogicalToCanvasYCoordinate(this.yServiceObject,e.getSizeCanvas().height,n.y),l:o},i,this.yAxisCanvas.ctx,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},this.getStrokeColors.positive,1,[2,2],"light"===this.getActiveTheme?"#fff":"#333"),s0?">".concat(this.percent<=1?1:this.getPercent,"%"):"".concat(this.percent?this.tickCount:0,"%"))}},methods:{initCanvas:function(){this.tickCount=0,this.$refs[this.refIdCanvas]&&(this.canvasObject=this.$refs[this.refIdCanvas],this.ctx=this.canvasObject.getContext("2d"),this.smartCanvas=new _B(this.canvasObject,this.ctx),this.smartCanvas.initCanvas(this.width,this.height),this.smartCanvas.animationCanvas({clear:function(){this.clearCanvas()},update:function(){this.tickCount++},render:function(){this.drawRedBagroundRing(),this.getPercent&&this.drawGreenRing(GLt(this.tickCount,this.widthBorder/2,this.width/2)),this.drawText(this.percent<1&&this.percent>0?">".concat(this.percent<=1?1:this.getPercent,"%"):"".concat(this.percent?this.tickCount:0,"%"))}},this.getPercent,this))},clearCanvas:function(){this.smartCanvas.ctx.clearRect(0,0,this.smartCanvas.canvasObject.width,this.smartCanvas.canvasObject.height)},drawRedBagroundRing:function(){this.smartCanvas.ctx.beginPath(),this.smartCanvas.ctx.arc(this.width/2,this.height/2,this.width/2-this.widthBorder/2,0,2*Math.PI),this.smartCanvas.ctx.lineWidth=this.widthBorder-.1*this.widthBorder,this.smartCanvas.ctx.strokeStyle=this.reverseMode?this.getGreenColor.color:this.getRedColor.color,this.smartCanvas.ctx.stroke(),this.smartCanvas.ctx.closePath()},drawGreenRing:function(t){this.smartCanvas.ctx.beginPath(),this.smartCanvas.ctx.arc(this.width/2,this.height/2,this.width/2-this.widthBorder/2,-Math.PI/2+Math.PI/180*qLt(this.widthBorder/2,this.width/2),t),this.smartCanvas.ctx.lineWidth=this.widthBorder,this.smartCanvas.ctx.strokeStyle=this.getColorsStroke[this.signal],this.smartCanvas.ctx.lineCap="round",this.smartCanvas.ctx.stroke(),this.smartCanvas.ctx.closePath()},drawText:function(t){this.smartCanvas.ctx.font="bold ".concat(this.fontSize,"px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"),this.smartCanvas.ctx.textAlign="center",this.smartCanvas.ctx.textBaseline="middle",this.smartCanvas.ctx.fillStyle=this.getColorsStroke[this.signal],this.smartCanvas.ctx.fillText(t,this.width/2,this.height/2)}},mounted:function(){var t=this;this.$nextTick((function(){setTimeout((function(){t.initCanvas()}),1e3)}))}};function GLt(t,e,i){return t<25?Math.PI/180*(3.6*(25-t)*-1+Math.PI/180*qLt(e,i)):t>=25&&t<100?Math.PI/180*(3.6*(t-25)-qLt(e,i)):100===t?Math.PI/180*(3.6*(t-25)+qLt(e,i)):void 0}function qLt(t,e){return Math.ceil(360*t/(2*Math.PI*e))}var zLt=HLt,YLt=(i("e59b"),Object(C["a"])(zLt,ULt,VLt,!1,null,"d1b32fec",null)),XLt=YLt.exports,QLt={mixins:[yn],components:{UserProfileWrapWidget:PB,LineEventChart:Uk,ProgressRoundDiagramSetColors:XLt,SimpleChart:jV},data:function(){return{gaudgeSize:{width:0,height:0},size:{width:0,height:0},roundDiagramSize:0,widthBorder:0,fontSize:0}},props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{statusGaudge:!1,percentRoundDiagram:95,statusRoundDiagram:!1,signal:"good",min:0,max:2,percent:64,percentTitle:655,revers:!1,status:!0,widgetTitle:"Коэффициент Шарпа",widgetData:!0,gaudgeTitle:"Sharp Ratio",pointsForChart:null,configChart:{}}}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getLineChartConfig:function(){return{type:"line",expandX:{maxExpand:0,minExpand:0},theme:this.getActiveTheme,baseLine:null,expandY:{maxExpand:.15,minExpand:.15},indicators:["minDataIndicator","maxDataIndicator","carrentDataIndicator"],grid:{status:!1,label:{units:""}},modifier:{class:[],style:{},id:""}}},getStatusGaudge:function(){return this.configObject.statusGaudge},getShowLabelsAxis:function(){return this.getStatusIndicatorVisibleForChart?{xAxis:!1,yAxis:!0}:{xAxis:!1,yAxis:!1}},getStatusIndicatorVisibleForChart:function(){return this.size.width>300&&this.size.height>100}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.size.width=t[0].contentRect.width,this.size.height=t[0].contentRect.height,this.gaudgeSize.width=this.observerElem.getBoundingClientRect().width,this.gaudgeSize.height=this.observerElem.getBoundingClientRect().height,this.roundDiagramSize=this.observerElem.getBoundingClientRect().height-.75*this.observerElem.getBoundingClientRect().height,this.widthBorder=10*this.roundDiagramSize/100,this.fontSize=30*this.roundDiagramSize/100}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.widgetWrapper,t.initObserver()}))}},JLt=QLt,KLt=(i("7f24"),Object(C["a"])(JLt,NLt,ELt,!1,null,null,null)),ZLt=KLt.exports,tFt={name:"UserProfileStat",props:{topBarWidgetParams:{type:Object},showControlButtons:{type:Boolean,default:!0},mode:{type:String,default:"profile"}},components:{DxPopup:xo.a,UserProfileGridWidgetTopBar:nM,UserProfileEquityBalanceChart:cLt,UserProfileForecastChart:WLt,UserProfilePeriodsWidget:R3,UserProfileWidgetGauge:ZLt},mixins:[opt,qe,Ot],data:function(){return{activeComponent:null,activeDateForDay:null,dataButtons:[{icon:"Windows4",hedler:"",status:!0},{icon:"Prognoz",hedler:"",status:!1},{icon:"TimePeriod_2D",hedler:"",status:!1},{icon:"TimePeriod_2W",hedler:"",status:!1},{icon:"TimePeriod_2M",hedler:"",status:!1}],configGrid:null}},watch:{getActiveTheme:function(){this.getReadyStat&&this.setConfigForGrid()},getReadyStat:function(t){t&&this.setConfigForGrid()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",getStatisticsByDay:"statistic/getStatisticsByDay",getStatByWeeks:"statistic/getStatByWeeks",getStatByMonth:"statistic/getStatByMonth"})),{},{getReadyStat:function(){return this.getStatisticsByDay&&this.getStatistics},getShowFullModeTopBar:function(){return"normal"===this.topBarWidgetParams.col.mode||"horizontalFull"===this.topBarWidgetParams.col.mode||"normal"===this.topBarWidgetParams.col.mode||"fullMode"===this.topBarWidgetParams.col.mode}}),methods:{viewTooltip:function(t,e){if(e)switch(this.selector=t.target,e){case"Windows4":this.hintText=this.$t("wadms");break;case"Prognoz":this.hintText=this.$t("pfftm");break;case"TimePeriod_2D":this.hintText=this.$t("coaed");break;case"TimePeriod_2W":this.hintText=this.$t("coaedt");break;case"TimePeriod_2M":this.hintText=this.$t("coaedtm");break;default:this.hintText=""}this.tooltipVisible=!0},setConfigForGrid:function(){this.configGrid=[{component:"UserProfileGrid",config:{arrayWidgets:[this.getConfigLeverage,this.getConfigMargin,this.getConfigSharp,this.getConfigMaxDD],directionSize:276,downMarginGrid:0,direction:!1}},{component:"UserProfileForecastChart",config:{period:"month",activeDate:new Date(this.getStatistics.accountDaily.at(-1).date).getTime()}},{component:"UserProfilePeriodsWidget",config:{period:"day",activeDate:this.setDateByDay(),showControlButton:!1}},{component:"UserProfilePeriodsWidget",config:{period:"week",activeDate:this.getStatistics.accountDaily.at(-1).date,showControlButton:!1}},{component:"UserProfilePeriodsWidget",config:{period:"month",activeDate:this.getStatistics.accountDaily.at(-1).date,showControlButton:!1}}],this.activeComponent=this.configGrid[0]},setNormal:function(){this.$emit("setNormal")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setActiveComponent:function(t){this.dataButtons.forEach((function(e,i){e.status=i===t})),this.activeComponent=this.configGrid[t]},setDateByDay:function(){for(var t=this.getStatisticsByDay.length-1;t>0;t--)if(new Date(this.getStatisticsByDay[t].date).getDay()&&6!==new Date(this.getStatisticsByDay[t].date).getDay()){this.activeDateForDay=this.getStatisticsByDay[t].date;break}if(this.activeDateForDay)return this.activeDateForDay},setActiveDate:function(t,e){switch(e){case"day":this.configGrid[2].config.activeDate=t;break;case"week":this.configGrid[3].config.activeDate=t;break;case"month":this.configGrid[4].config.activeDate=t;break}}},mounted:function(){this.getReadyStat&&this.setConfigForGrid()}},eFt=tFt,iFt=(i("2a93b"),Object(C["a"])(eFt,ILt,BLt,!1,null,"a9e0fcc2",null)),oFt=iFt.exports,nFt=function(){var t=this,e=t._self._c;return e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"userProfileEquityBalanceWidget-title"},[e("span",{style:{color:"light"===t.getActiveTheme?"#2462db":"#00b9fc"}},[t._v("Balance")]),t._v("/"),e("span",{style:{color:"light"===t.getActiveTheme?"#008e72":"#1ef0b1"}},[t._v("Equity")])])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"chartWrap",staticClass:"userProfileEquityBalanceWidget"},[t.points?e("SimpleChart",{attrs:{configObject:t.getLineChartConfig,points:t.points,resizeStatus:t.getRowStatus}}):t._e()],1)]},proxy:!0}])})},sFt=[],rFt={props:{topBarWidgetParams:{type:Object},configObject:{type:Object}},components:{UserProfileWrapWidget:PB,SimpleChart:jV},data:function(){return{points:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics"})),{},{getRowStatus:function(){return this.topBarWidgetParams},getEquityClose:function(){if(this.getStatistics&&this.getStatistics.length)return this.getStatistics.accountDaily[this.getStatistics.accountDaily.length-1].equityClose},getLineChartConfig:function(){return{type:"line",expandX:{maxExpand:0,minExpand:0},baseLine:null,expandY:{maxExpand:.15,minExpand:.15},indicators:["carrentDataIndicator"],theme:this.getActiveTheme,grid:{status:"normal"!==this.topBarWidgetParams.row,label:{status:!0,units:"$"},gridColor:"light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)",labelColor:"light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1"},modifier:{class:[],style:{},id:""}}}}),watch:{getEquityClose:function(t){void 0!==t&&null!==t&&this.getPointsForChart(this.getStatistics)},getActiveTheme:function(){this.getPointsForChart(this.getStatistics)}},methods:{getPointsForChart:function(t){var e=this;t&&(this.points=[[{stroke:"light"===this.getActiveTheme?"#2462db":"#00b9fc",fill:(this.getActiveTheme,"rgba(36, 98, 219, 0.1)")}]],t.accountDaily.forEach((function(t){e.points[0].push({data:t.balanceClose,time:new Date(t.date).getTime()})})),this.points.push([{stroke:"light"===this.getActiveTheme?"#008e72":"#1ef0b1",fill:"dark"===this.getActiveTheme?"rgba(0, 255, 172, 0.1)":"rgba(0, 142, 114, 0.1)"}]),t.accountDaily.forEach((function(t){e.points[1].push({data:t.equityClose,time:new Date(t.date).getTime()})})))},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")}},mounted:function(){this.getStatistics&&this.getPointsForChart(this.getStatistics)}},aFt=rFt,cFt=(i("c9be"),Object(C["a"])(aFt,nFt,sFt,!1,null,"96e19258",null)),lFt=cFt.exports,uFt=function(){var t=this,e=t._self._c;return e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"userProfileEquityBalanceWidget-title"},[e("span",{style:{color:"light"===t.getActiveTheme?"#e91212":"#ff3232"}},[t._v("Max DD")])])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"chartWrap",staticClass:"userProfileEquityBalanceWidget"},[t.points?e("SimpleChart",{attrs:{configObject:t.getLineChartConfig,points:t.points}}):t._e()],1)]},proxy:!0}])})},dFt=[],hFt={props:{topBarWidgetParams:{type:Object}},components:{UserProfileWrapWidget:PB,LineChart:nLt,SimpleChart:jV},data:function(){return{points:null,resizeObserver:null,simpleChartSize:{width:0,height:0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics"})),{},{getLineChartConfig:function(){return{type:"line",expandX:{maxExpand:0,minExpand:0},baseLine:{data:0,color:"light"===this.getActiveTheme?"#3c73f1":"#00b9fc"},expandY:{maxExpand:0,minExpand:.15},indicators:["carrentDataIndicator","minDataIndicator"],size:{width:this.simpleChartSize.width,height:this.simpleChartSize.height},grid:{status:"normal"!==this.topBarWidgetParams.row,label:{status:!0,units:"%"},gridColor:"light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)",labelColor:"light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1"},modifier:{class:[],style:{},id:""}}}}),watch:{getStatistics:function(t){t&&this.getPointsForChart(t)},getActiveTheme:function(){this.getPointsForChart(this.getStatistics)}},methods:{getPointsForChart:function(t){var e=this;t&&(this.points=[[{stroke:"light"===this.getActiveTheme?"#e91212":"#ff3232",fill:"light"===this.getActiveTheme?"rgba(233, 18, 18, 0.1)":"rgba(255, 50, 50, 0.1)"}]],t.accountDaily.forEach((function(t){e.points[0].push({data:-1*t.drawdown,time:new Date(t.date).getTime()})})))},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},initObserver:function(){var t=new ResizeObserver(this.onResize);t.observe(this.$refs.chartWrap),this.resizeObserver=t},onResize:function(){this.$refs.chartWrap&&(this.simpleChartSize.width=this.$refs.chartWrap.clientWidth,this.simpleChartSize.height=this.$refs.chartWrap.clientHeight)}},mounted:function(){var t=this;this.getStatistics&&this.getPointsForChart(this.getStatistics),this.$nextTick((function(){t.initObserver()}))}},pFt=hFt,gFt=(i("5283"),Object(C["a"])(pFt,uFt,dFt,!1,null,"6a0dcb61",null)),fFt=gFt.exports,mFt=function(){var t=this,e=t._self._c;return e("div",{class:"userProfileStat ".concat("horizontalMin"===t.topBarWidgetParams.col.mode?"userProfileStat-minMode":"")},[e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode}},t._l(t.dataButtons,(function(i,o){return e("ButtonIconFlat",{key:o,attrs:{icon:{name:i.icon},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),i.status?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:function(e){return t.setActiveComponent(o)}}})})),1),e("div",{staticClass:"userProfileStat-content"},[t.getShowFullModeTopBar&&t.activeComponent?e(t.activeComponent.component,{tag:"component",attrs:{configObject:t.activeComponent.config}}):t._e()],1)],1)},vFt=[],yFt={name:"UserProfileStat",props:{topBarWidgetParams:{type:Object}},components:{UserProfileGridWidgetTopBar:nM,UserProfileTVWidget:mR},data:function(){return{arrayTabsComponents:[{component:"UserProfileTVWidget",config:{videoOptions:{autoplay:!1,controls:!0,responsive:!0,sources:[{src:"https://e3-online-video.rbc.ru/online2/rbctv_480p/index.m3u8",type:"application/x-mpegURL "}],poster:"/img/player-splash.c292f27f.png"}}}],activeComponent:null,dataButtons:[{icon:"TV",status:!0}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme"})),{},{getShowFullModeTopBar:function(){return"normal"===this.topBarWidgetParams.col.mode||"horizontalFull"===this.topBarWidgetParams.col.mode||"normal"===this.topBarWidgetParams.col.mode||"fullMode"===this.topBarWidgetParams.col.mode}}),methods:{setNormal:function(){this.$emit("setNormal")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setActiveComponent:function(t){this.dataButtons.forEach((function(e,i){e.status=i===t})),this.activeComponent=this.arrayTabsComponents[t]}},mounted:function(){this.activeComponent=this.arrayTabsComponents[0]}},CFt=yFt,bFt=(i("6619"),Object(C["a"])(CFt,mFt,vFt,!1,null,"102c9038",null)),SFt=bFt.exports,PFt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profitInDD"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"profitInDD-title"},[t._v("Доход к просадке")])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"profitInDD-wrap"},[e("div",{ref:"progressWrap",staticClass:"profitInDD-progress"},[e("div",{staticClass:"profitInDD-progressPart",style:{width:"".concat(t.getPercentsProgressBar.profit,"%"),background:t.getGreenColor.color},attrs:{title:"Доход ".concat(t.getMaxProfit,"%")}},[e("div",{staticClass:"profitInDD-progressPart_count",style:{fontSize:"".concat(t.getFontCount,"px"),height:"".concat(t.getFontCount,"px")}},[e("span",{staticStyle:{height:"100%"}},[t._v(t._s(t.getMaxProfit)+"%")])]),e("div",{staticClass:"profitInDD-progressPart_title",style:{fontSize:"".concat(t.getFontTitle,"px"),height:"".concat(t.getFontTitle,"px")}},[e("span",[t._v("Доход")])])]),t.getMaxProfit&&t.getMaxDD?e("div",{staticClass:"profitInDD-devider"}):t._e(),e("div",{staticClass:"profitInDD-progressPart",style:{width:"".concat(t.getPercentsProgressBar.dd,"%"),background:t.getRedColor.color}},[e("div",{staticClass:"profitInDD-progressPart_count",style:{fontSize:"".concat(t.getFontCount,"px"),height:"".concat(t.getFontCount,"px"),textAlign:"right"},attrs:{title:"Просадка ".concat(t.getMaxDD,"%")}},[e("span",{staticStyle:{height:"100%"}},[t._v(t._s(t.getMaxDD)+"%")])]),e("div",{staticClass:"profitInDD-progressPart_title",style:{fontSize:"".concat(t.getFontTitle,"px"),textAlign:"right",height:"".concat(1.2*t.getFontTitle,"px")}},[t._v(" Просадка")])])])])]},proxy:!0}])})],1)},TFt=[],xFt={components:{UserProfileWrapWidget:PB},props:{topBarWidgetParams:{type:Object}},mixins:[yn,qe],data:function(){return{sizeProgress:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics"})),{},{getMaxDD:function(){if(this.getStatistics)return Math.round(this.getStatistics.accountDaily.at(-1).drawdownHigh)},getPercentsProgressBar:function(){if(this.getMaxDD||this.getMaxProfit){var t=this.getMaxDD+Math.abs(this.getMaxProfit),e=Math.round(100*Math.abs(this.getMaxProfit)/t);return{profit:e,dd:100-e}}},getMaxProfit:function(){if(this.getStatistics){var t=this.getStatistics.accountDaily.map((function(t){return 100*(t.equityClose-t.equityOpen)/t.equityOpen})),e=Math.max.apply(null,t.filter((function(t){return t>=0})));return Math.round(e)}},getFontCount:function(){return this.sizeProgress?Math.round(30*this.sizeProgress/100):10},getFontTitle:function(){return this.sizeProgress?Math.round(12*this.sizeProgress/100):10}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.sizeProgress=t[0].contentRect.height}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.progressWrap}))}},OFt=xFt,wFt=(i("5f66"),Object(C["a"])(OFt,PFt,TFt,!1,null,"50626268",null)),_Ft=wFt.exports,AFt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"widgetBalanceEquity"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"widgetBalanceEquity-title"},[t._v(t._s("".concat(t.$t("balance"),"/").concat(t.$t("equity"))))])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"widgetBalanceEquity-chart"})]},proxy:!0}])})],1)},DFt=[],kFt={props:{topBarWidgetParams:{type:Object},configObject:{type:Object}},components:{UserProfileWrapWidget:PB},methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")}}},IFt=kFt,BFt=(i("74ef"),Object(C["a"])(IFt,AFt,DFt,!1,null,"3dea1ffa",null)),MFt=BFt.exports,$Ft=function(){var t=this,e=t._self._c;return e("div",{class:"countOrders countOrders_".concat(t.getActiveTheme)},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"countOrders-title"},[t._v(t._s(t.$t("number_of_trades")))])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"wrap",staticClass:"countOrders-wrap"},[e("div",{staticClass:"countOrders-left",style:{background:t.getBlueColor.color},attrs:{title:"".concat(t.$t("total_closed_trades")," ").concat(t.getCount)}},[e("div",{staticClass:"countOrders-allCount"},[e("div",{staticClass:"countOrders-allCountTitle",style:{fontSize:"".concat(t.getTitle,"px"),height:"".concat(t.getTitle,"px")}},[t._v(t._s(t.$t("total_closed_trades")))]),e("div",{staticClass:"countOrders-allCountData",style:{fontSize:"".concat(t.getCountFont,"px"),height:"".concat(t.getCountFont,"px")}},[t._v(t._s(t.getCount))])])]),e("div",{staticClass:"countOrders-right"},[e("div",{staticClass:"countOrders-part",style:{background:t.getGreenColor.color},attrs:{title:"".concat(t.$t("successful_trades_full")," ").concat(t.getProfitOrders)}},[e("div",{staticClass:"countOrders-allCountTitle",style:{fontSize:"".concat(t.getTitle,"px"),height:"".concat(t.getTitle,"px")}},[t._v(t._s(t.$t("successful_trades_full")))]),e("div",{staticClass:"countOrders-allCountData",style:{fontSize:"".concat(t.getDataFont,"px"),height:"".concat(t.getDataFont,"px")}},[t._v(t._s(t.getProfitOrders))])]),e("div",{staticClass:"countOrders-part",style:{background:t.getRedColor.color},attrs:{title:"".concat(t.$t("unprofitable_trades")," ").concat(t.getCount-t.getProfitOrders)}},[e("div",{staticClass:"countOrders-allCountTitle",style:{fontSize:"".concat(t.getTitle,"px"),height:"".concat(t.getTitle,"px")}},[t._v(t._s(t.$t("unprofitable_trades")))]),e("div",{staticClass:"countOrders-allCountData",style:{fontSize:"".concat(t.getDataFont,"px"),height:"".concat(t.getDataFont,"px")}},[t._v(t._s(t.getCount-t.getProfitOrders))])])])])]},proxy:!0}])})],1)},LFt=[],FFt={components:{UserProfileWrapWidget:PB},props:{topBarWidgetParams:{type:Object}},mixins:[yn,qe],data:function(){return{size:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics"})),{},{getCountFont:function(){if(this.size)return 35*this.size/100},getCount:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.closedOrdersCount},getProfitOrders:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.positiveOrders},getTitle:function(){if(this.size)return 9*this.size/100},getDataFont:function(){if(this.size)return 20*this.size/100}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.size=t[0].contentRect.height}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},jFt=FFt,RFt=(i("4095"),Object(C["a"])(jFt,$Ft,LFt,!1,null,"5263cee6",null)),WFt=RFt.exports,NFt=function(){var t=this,e=t._self._c;return e("div",{class:"averProfitOrder averProfitOrder_".concat(t.getActiveTheme)},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"averProfitOrder-title"},[t._v(t._s(t.configObject.title))])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"wrap",staticClass:"averProfitOrder-wrap"},[e("div",{staticClass:"averProfitOrder-part"},[e("div",{staticClass:"averProfitOrder-profitAbs",style:{background:t.getProfitAbs>=0?t.getGreenColor.color:t.getRedColor.color}},[e("div",{staticClass:"averProfitOrder-title",style:{fontSize:"".concat(t.getTitleFont,"px"),height:"".concat(t.getTitleFont,"px")}},[t._v(t._s("".concat(t.$t("income"),", $")))]),e("div",{staticClass:"averProfitOrder-data",style:{fontSize:"".concat(t.getDataFont,"px"),height:"".concat(1.2*t.getDataFont,"px")}},[t._v("$ "+t._s(t.$moneyf(t.getProfitAbs,2)))])])]),e("div",{staticClass:"averProfitOrder-partTwo"},[e("div",{staticClass:"averProfitOrder-profitRel",style:{background:t.getProfitRel>=0?t.getGreenColor.color:t.getRedColor.color}},[e("div",{staticClass:"averProfitOrder-title",style:{fontSize:"".concat(t.getTitleFont,"px"),height:"".concat(t.getTitleFont,"px")}},[t._v(t._s("".concat(t.$t("income"),", %")))]),e("div",{staticClass:"averProfitOrder-data",style:{fontSize:"".concat(t.getDataFont,"px"),height:"".concat(1.2*t.getDataFont,"px")}},[t._v("% "+t._s(t.$moneyf(t.getProfitRel,2)))])]),e("div",{staticClass:"averProfitOrder-profitPip",style:{background:t.getProfitPip>=0?t.getGreenColor.color:t.getRedColor.color}},[e("div",{staticClass:"averProfitOrder-title",style:{fontSize:"".concat(t.getTitleFont,"px"),height:"".concat(t.getTitleFont,"px")}},[t._v(t._s("".concat(t.$t("income"),", PIP")))]),e("div",{staticClass:"averProfitOrder-data",style:{fontSize:"".concat(t.getDataFont,"px"),height:"".concat(1.2*t.getDataFont,"px")}},[t._v("pip "+t._s(t.$moneyf(t.getProfitPip)))])])])])]},proxy:!0}])})],1)},EFt=[],UFt={components:{UserProfileWrapWidget:PB},props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){}}},mixins:[yn,qe],data:function(){return{size:0,userOrders:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getContracts:"contracts/getContracts"})),{},{getDataFont:function(){if(this.size)return 18*this.size/100},getTitleFont:function(){if(this.size)return 10*this.size/100},getProfitAbs:function(){if(!this.userOrders)return 0;var t=this.userOrders.closedOrders;if(!t.length)return 0;var e=t.reduce((function(t,e){return t+e.profit}),0);return"order"===this.configObject.mode?e/t.length:e},getProfitRel:function(){if(!this.userOrders)return 0;var t=this.userOrders.closedOrders;if(!t.length)return 0;var e=t.reduce((function(t,e){return t+100*e.profit/e.volume}),0);return"order"===this.configObject.mode?e/t.length:e},getProfitPip:function(){var t=this;if(!this.userOrders)return 0;var e=this.userOrders.closedOrders;if(!e.length)return 0;var i=e.reduce((function(e,i){return e+(i.closePrice-i.openPrice)*t.getPrecision(i.instrumentName)*(i.profit<0?-1:1)}),0);return"order"===this.configObject.mode?Math.round(i/e.length):Math.round(i)}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.size=t[0].contentRect.height},getPrecision:function(t){var e=this.getContracts.find((function(e){return e.instrumentName===t}));return e?Ph(e.precision):0}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap})),this.userOrders=this.$orderStorage.getOrdersOnStorage()}},VFt=UFt,HFt=(i("188a"),Object(C["a"])(VFt,NFt,EFt,!1,null,"4bab5ea1",null)),GFt=HFt.exports,qFt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"tradeInstruments"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"tradeInstruments-title"},[t._v(t._s(t.$t("traded_instruments")))])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"wrap",staticClass:"tradeInstruments-wrap"},[e("div",{staticClass:"tradeInstruments-diagram",style:{minWidth:"".concat(t.getSizeDiagram.height,"px"),height:"".concat(t.getSizeDiagram.height,"px")}},[e("div",{staticClass:"tradeInstruments-chart"},[e("SectorDiagram",{key:t.getSizeDiagram.height,attrs:{percents:t.getSectorDiagramObject,width:t.getSizeDiagram.height,height:t.getSizeDiagram.height,widthBorder:t.getSizeDiagram.height/3,fontSize:Math.round(7*t.getSizeDiagram.height/100)}})],1)]),e("div",{staticClass:"tradeInstruments-list"},t._l(t.getSectorDiagramObject,(function(i,o){return e("div",{key:o,staticClass:"tradeInstruments-listItem"},[e("div",{staticClass:"tradeInstruments-listTitle",style:{color:i.color}},[t._v(t._s(i.symbol))]),e("div",{class:"tradeInstruments-devider tradeInstruments-devider_".concat(t.configObject.theme)}),e("div",{staticClass:"tradeInstruments-percent",style:{color:i.color}},[t._v("% "+t._s(i.data))])])})),0)])]},proxy:!0}])})],1)},zFt=[],YFt={components:{UserProfileWrapWidget:PB,SectorDiagram:MB},props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{theme:"light"}}}},mixins:[yn],data:function(){return{size:0,userOrders:null}},computed:{getSectorDiagramObject:function(){var t=this;if(this.userOrders){var e=[];return this.getAllUserInstruments.forEach((function(i){var o=t.getCommonOrders.filter((function(t){return t.instrumentName===i})).reduce((function(t,e){return t+e.volume}),0);e.push({symbol:i,color:XFt(),data:Number((100*o/t.getCommonVolume).toFixed(2))})})),e}},getSizeDiagram:function(){if(!this.size)return 0;var t=this.size.height>this.size.width?this.size.width:this.size.height,e=this.size.height>this.size.width?this.size.width:this.size.height;return{width:Math.round(t),height:Math.round(e)}},getAllUserInstruments:function(){if(this.userOrders)return Object(x["a"])(new Set(this.userOrders.closedOrders.concat(this.userOrders.tradingOrders).map((function(t){return t.instrumentName}))))},getCommonVolume:function(){if(this.userOrders)return this.userOrders.closedOrders.concat(this.userOrders.tradingOrders).reduce((function(t,e){return t+e.volume}),0)},getCommonOrders:function(){if(this.userOrders)return this.userOrders.closedOrders.concat(this.userOrders.tradingOrders)}},methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap})),this.userOrders=this.$orderStorage.getOrdersOnStorage()}};function XFt(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var QFt=YFt,JFt=(i("2eb2"),Object(C["a"])(QFt,qFt,zFt,!1,null,"755c4b99",null)),KFt=JFt.exports,ZFt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profitGistogram"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"profitGistogram-title"},[t._v(t._s(t.$t("hoibm")))])]},proxy:!0},{key:"content",fn:function(){return[e("div",{ref:"wrap",staticClass:"profitGistogram-content"},[t.pointsForGistogram?e("GistogrammEventChart",{key:t.pointsForGistogram[0][0].y,attrs:{points:t.pointsForGistogram,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[2]},maxIndicator:{lines:[2]}}}):t._e()],1)]},proxy:!0}])})],1)},tjt=[],ejt={components:{UserProfileWrapWidget:PB,GistogrammEventChart:TI},props:{topBarWidgetParams:{type:Object,default:function(){return{row:"normal",col:{index:1,mode:"normal"},directionModeRows:!1}}},configObject:{type:Object}},mixins:[qe,yn],data:function(){return{size:0,pointsForGistogram:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getYearsStat:"statistic/getYearsStat",getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getMetaInfoForLines:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("average")},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")}]}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},onResize:function(t){this.size=t[0].contentRect.width},setPoints:function(){var t=[],e=[],i=[],o=0;for(var n in this.getYearsStat)this.getYearsStat[n].forEach((function(e){t.push(e)}));var s=t.length<3?"day":"month",r="day"===s?this.getStatistics.accountDaily:t;r.forEach((function(t,n){o+="day"===s?100*(t.equityClose-t.equityOpen)/t.equityOpen:t.profitRel,e.push({x:n,y:"day"===s?100*(t.equityClose-t.equityOpen)/t.equityOpen:t.profitRel,date:t.date}),i.push({x:n,y:o/(n+1),date:t.date})})),this.pointsForGistogram=[[{x:0,y:0,date:t[0].date}],i,e]}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap})),this.getYearsStat&&this.setPoints()}},ijt=ejt,ojt=(i("0e93"),Object(C["a"])(ijt,ZFt,tjt,!1,null,"473bc4f8",null)),njt=ojt.exports,sjt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"countProfitOrders"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams,showControlButton:!0},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"countProfitOrders-wrap"})]},proxy:!0}])})],1)},rjt=[],ajt={components:{UserProfileWrapWidget:PB},props:{topBarWidgetParams:{type:Object}},methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")}}},cjt=ajt,ljt=(i("9097"),Object(C["a"])(cjt,sjt,rjt,!1,null,"2258286c",null)),ujt=ljt.exports,djt=function(){var t=this,e=t._self._c;return e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{ref:"titleWrap",staticClass:"userProfileComparisonPeriods-head"},[e("div",{staticClass:"userProfileComparisonPeriods-title"},[e("div",{staticClass:"userProfileComparisonPeriods-tabs"},[t._l(t.tabs,(function(i,o){return e("div",{key:o,class:"userProfileComparisonPeriods-tab ".concat(t.activeModeLine===i.mode?"userProfileComparisonPeriods-tab_isActive_".concat(t.getActiveTheme):"userProfileComparisonPeriods-tab_".concat(t.getActiveTheme)),on:{click:function(e){return t.setLineModeIndex(o)}}},[t._v(t._s(i.label))])})),t._l(t.tabsIcon,(function(i,o){return e("div",{key:"".concat(o,"_icon"),class:"userProfileComparisonPeriods-tabIcon ".concat(t.activeTypeMode===i.mode?"userProfileComparisonPeriods-tabIcon_isActive_".concat(t.getActiveTheme):"userProfileComparisonPeriods-tabIcon_".concat(t.getActiveTheme)),on:{click:function(e){return t.setModeType(o)}}},[e("svgIcon",{attrs:{name:i.icon}})],1)}))],2)]),e("div",{staticClass:"userProfileComparisonPeriods-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1)]),t.dateCheckerStatus&&t.activeDateForChecker?e("DataChartChecker",{attrs:{"multiсhoiceStatus":!0,positionPopup:{my:"top right",at:"bottom right",of:t.containerForDataChecker,offset:{x:0,y:5}},statistic:t.getStatisticsByDateChecker,period:t.configObject.period,activeDate:t.activeDateForChecker,multichoiceDate:t.dataForChecker.map((function(t){return t.date}))},on:{setActiveDate:t.setActiveDate,addDate:t.addDateToComparison}}):t._e()]},proxy:!0},{key:"content",fn:function(){return[t.points?e("LineEventChart",{attrs:{points:t.points,metaInfoForLines:t.metaInfoForLines,theme:t.getActiveTheme,maxIndicator:!1,minIndicator:!1,typeXAxis:t.configObject.period}}):t._e(),e("div",{staticClass:"userProfileComparisonPeriods-dataChecker"},t._l(t.dataForChecker,(function(i,o){return e("div",{key:o,staticClass:"userProfileComparisonPeriods-checkerItem"},[e("Checkbox",{attrs:{checked:i.status,colorState:i.color},on:{change:function(e){return t.setStatus(o)}}}),e("div",{style:{color:i.color}},[t._v(t._s(i.title))]),e("div",{staticClass:"userProfileComparisonPeriods-devider",style:{background:i.color}}),t.getLastDataForChecker?e("div",{style:{color:i.color}},[t._v(t._s("".concat("abs"===t.activeTypeMode?"$":"%"," ").concat(t.$moneyf(t.getLastDataForChecker[o]))))]):t._e()],1)})),0)]},proxy:!0}])})},hjt=[],pjt={mixins:[TM,xM],props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{period:"month",activeDates:[]}}}},components:{ChartWrapper:pM,LineEventChart:Uk,DataChartChecker:M3,Checkbox:Ya,UserProfileWrapWidget:PB},data:function(){return{metaInfoForLines:[],points:null,chartCanvas:null,yAxisCanvas:null,xAxisCanvas:null,canvasCoords:[],activeModeLine:"equity",activeTypeMode:"abs",dataForChecker:null,dateCheckerStatus:!1,activeDateForChecker:null,containerForDataChecker:null,tabsIcon:[{mode:"abs",icon:"SortDollar"},{mode:"rel",icon:"new-procent-icon"}],tabs:[{mode:"balance",label:this.$t("balance")},{mode:"equity",label:this.$t("equity")}]}},watch:{getStatByDates:function(t){t&&this.setCanvasCoords()},dataForChecker:function(){this.setCanvasCoords()},getActiveTheme:function(){this.getDataForChecker()},activeModeLine:function(){this.setCanvasCoords()},activeTypeMode:function(){this.setCanvasCoords()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getStatisticsByDay:"statistic/getStatisticsByDay",getStatByWeeks:"statistic/getStatByWeeks",getStatByMonth:"statistic/getStatByMonth",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getArrDates:function(){return this.configObject.activeDates},getRowStatus:function(){return this.topBarWidgetParams},getStatisticsByDateChecker:function(){return"month"===this.configObject.period?this.getStatByMonth:"week"===this.configObject.period?this.getStatByWeeks:"day"===this.configObject.period?this.getStatisticsByDay:void 0},getLastDataForChecker:function(){if(this.points&&this.points.length){var t=[];return this.points.forEach((function(e){t.push(e.at(-1).y)})),t}},getStatByDates:function(){return"month"===this.configObject.period?this.getStatByCheckMonths:"day"===this.configObject.period?this.getStatByDay:"week"===this.configObject.period?this.getStatByWeek:void 0},getStatByCheckMonths:function(){var t=this;if(this.getStatistics&&this.dataForChecker&&this.dataForChecker.length){var e=[];return this.dataForChecker.forEach((function(i){e.push(t.getStatistics.accountDaily.filter((function(t){return new Date(t.date).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.date).getMonth()===new Date(i.date).getMonth()&&i.status})))})),e}},getStatByDay:function(){var t=this;if(this.dataForChecker&&this.dataForChecker.length&&this.getStatisticsByDay){var e=[];return this.dataForChecker.forEach((function(i){var o=t.getStatisticsByDay.find((function(t){return new Date(t.date).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.date).getMonth()===new Date(i.date).getMonth()&&new Date(t.date).getDate()===new Date(i.date).getDate()&&i.status}));o?e.push(o.data):e.push([])})),e}},getStatByWeek:function(){var t=this;if(this.dataForChecker&&this.getStatByWeeks){var e=[];return this.dataForChecker.forEach((function(i){var o=t.getStatByWeeks.find((function(t){return new Date(t.date).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.date).getWeek()===new Date(i.date).getWeek()&&i.status}));o?e.push(o.data):e.push([])})),e}}}),methods:{setLineModeIndex:function(t){this.activeModeLine=this.tabs[t].mode},setModeType:function(t){this.activeTypeMode=this.tabsIcon[t].mode},setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},setActiveDate:function(t){this.activeDateForChecker=t},checkDateForPeriods:function(t,e,i){var o={day:new Date(e).getFullYear()===new Date(i).getFullYear()&&new Date(e).getMonth()===new Date(i).getMonth()&&new Date(e).getDate()===new Date(i).getDate(),month:new Date(e).getFullYear()===new Date(i).getFullYear()&&new Date(e).getMonth()===new Date(i).getMonth(),week:new Date(e).getFullYear()===new Date(i).getFullYear()&&new Date(e).getWeek()===new Date(i).getWeek()};return o[t]},addDateToComparison:function(t){var e=this;if(1!==this.dataForChecker.length||!t.status){if(t.status){var i=this.dataForChecker.findIndex((function(i){return e.checkDateForPeriods(e.configObject.period,i.date,t.date)}));this.metaInfoForLines.splice(i,1),this.dataForChecker.splice(i,1)}else{var o=uB();this.metaInfoForLines.push({type:"line",color:o.color,fill:"rgba(0,0,0,0)",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",lineWidth:3,label:""}),this.dataForChecker.push({date:t.date,color:o.color,text:o.text,status:!0,title:this.getTitleForLegend(t.date)})}this.setCanvasCoords()}},getDataForChecker:function(){var t=this;this.dataForChecker=[],this.getArrDates.forEach((function(e){var i=uB();t.metaInfoForLines.push({type:"line",color:i.color,fill:"rgba(0,0,0,0)",fillIndicator:"dark"===t.getActiveTheme?"#314456":"#fff",lineWidth:3,label:""}),t.dataForChecker.push({date:e,color:i.color,text:i.text,status:!0,title:t.getTitleForLegend(e)})}))},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},setStatus:function(t){var e=this;this.dataForChecker=this.dataForChecker.map((function(i,o){return{date:i.date,color:i.color,text:i.text,status:o===t?!i.status:i.status,title:e.getTitleForLegend(i.date)}}))},setDateByChartPeriod:function(t,e){return"week"===t?new Date(e).getDay()?new Date(e).getDay()-1:6:"month"===t?new Date(e).getDate():"day"===t?new Date(e).getHours():void 0},getTitleForLegend:function(t){var e={day:"".concat(new Date(t).getDate()<10?"0".concat(new Date(t).getDate()):new Date(t).getDate(),".").concat(new Date(t).getMonth()+1<10?"0".concat(new Date(t).getMonth()+1):new Date(t).getMonth()+1,".").concat(new Date(t).getFullYear()),week:"".concat(this.$t("W1")," ").concat(new Date(t).getWeek()," ").concat(new Date(t).getFullYear(),"г."),month:"".concat(this.$t("mounthArr")[new Date(t).getMonth()]," ").concat(new Date(t).getFullYear())};return e[this.configObject.period]},setCanvasCoords:function(){var t=this;this.points=[],this.getStatByDates.forEach((function(e){var i="equity"===t.activeModeLine?e[0].equityOpen:e[0].balanceLow,o=[];e.forEach((function(e,n){var s="equity"===t.activeModeLine?"equityClose":"balanceClose",r=e[s],a=100*(e[s]-i)/i;o.push({x:n,y:"abs"===t.activeTypeMode?r:a,date:t.setDateByChartPeriod(t.configObject.period,e.date)})})),t.points.push(o)}))}},mounted:function(){var t=this;this.$nextTick((function(){t.containerForDataChecker=t.$refs.titleWrap})),this.getStatByDates&&this.setCanvasCoords(),this.getDataForChecker(),this.activeDateForChecker=this.configObject.activeDates[0]}},gjt=pjt,fjt=(i("7207"),Object(C["a"])(gjt,djt,hjt,!1,null,"75126f86",null)),mjt=fjt.exports,vjt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AverageInvestorIncome",class:t.rootClass},[e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode}},[e("div",{staticClass:"titleWrap"},[e("div",{staticClass:"title"},[t._v(t._s(t.getTextTitle)),e("span",{class:"title-nameProtfolio title-nameProtfolio_".concat(t.getActiveTheme)},[t._v(t._s(t.portfolioName))]),e("span",{class:t.classTopValue},[t._v(t._s(t.getPofitByType)+" ")])]),e("div",{staticClass:"titleButtons"},[e("DollarOrPercentButtonBlock",{attrs:{dollarOrPercent:t.dollarOrPercent,activePortfolio:!0,typeChart:"month"},on:{setValue:t.setValue}})],1)])]),t.isLoadingStatData?e("div",{staticClass:"loader"},[e("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:35,circle:!0}})],1):t._e(),t.isLoadingStatData||t.getNoStatStatus?t._e():e("div",{staticClass:"container"},[e("div",{staticClass:"chartContainer"},[t.getMetaInfoLines?e("LineEventChart",{key:t.points.length,attrs:{points:t.points,metaInfoForLines:t.getMetaInfoLines,typeXAxis:"dateClear",theme:t.getActiveTheme,maxIndicator:{lines:[0]},minIndicator:{lines:[0]}},on:{hover:t.hoverPoint}}):t._e(),e("div",{class:"AverageInvestorIncome-statData AverageInvestorIncome-statData_".concat(t.getActiveTheme)},t._l(t.getStatForChart,(function(i,o){return e("div",{key:o,staticClass:"AverageInvestorIncome-statData-item"},[e("div",{class:"AverageInvestorIncome-statData-itemLabel AverageInvestorIncome-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"AverageInvestorIncome-statData-itemData AverageInvestorIncome-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(t.$moneyf(i.data,2)))])])})),0),t.showHoverWidget?e("div",{class:"AverageInvestorIncome-hoverWidget AverageInvestorIncome-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"AverageInvestorIncome-hoverWidgetRow AverageInvestorIncome-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"AverageInvestorIncome-hoverWidgetStat AverageInvestorIncome-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1),e("div",{staticClass:"gistogrammContainer"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:"date",metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)]),!t.isLoadingStatData&&t.getNoStatStatus?e("div",{class:"emptyContainer emptyContainer_".concat(t.getActiveTheme)},[e("div",[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",[t._v(t._s("Active"===t.getStatusPortfolio?"Статистика по портфелю формируется":"Вы пока не инвестируете в портфель"))])]):t._e()],1)},yjt=[],Cjt={name:"AverageInvestorIncome",mixins:[xt,FI,qe,ypt],props:{topBarWidgetParams:{type:Object}},components:{LineEventChart:Uk,GistogrammEventChart:TI,UserProfileGridWidgetTopBar:nM,DollarOrPercentButtonBlock:LI,ComparisonPortfolioParticipants:QMt,Preloader:ah},data:function(){return{noStat:!1,averageIncome:null,pointsForGistogramm:null,points:null,hoverIndex:null,showHoverWidget:!1,positionHoverWidget:null,statsForHoverWidget:null}},watch:{isLoadingStatData:function(t){t||this.combinedData(this.dollarOrPercent)},expertsForStat:function(t){t&&this.combinedData(this.dollarOrPercent)},countClosedOrders:function(t){t&&(this.setClosedProfit(),this.combinedData(this.dollarOrPercent))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingStatData:"expertsPortfolio/isLoadingStatData",getStatData:"statDataForPortfolio/getStatData",getStatusEmptyStat:"expertsPortfolio/getStatusEmptyStat",findPortfolio:"expertsPortfolio/findPortfolio",getActiveTheme:"headerSettings/getActiveTheme",closedOrders:"statDataForPortfolio/closedOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate"})),{},{countClosedOrders:function(){return this.closedOrders.length},getSubscriptionsByBag:function(){var t=this;return this.allSubscriptionCurrentDate.filter((function(e){return e.subscription.bagId===t.findPortfolio.id}))},getTextTitle:function(){return"Ваш Доход в месяц по портфелю, "},portfolioName:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.name},getStatusPortfolio:function(){var t;return null===(t=this.findPortfolio)||void 0===t?void 0:t.status},getStatForChart:function(){if(this.points&&this.points.length)return[{label:"Средний доход в мес.",data:this.points[0].at(-1).y,symbol:"dollar"===this.dollarOrPercent?"$":"%",color:this.points[0].at(-1).y<0?"red":"green"},{label:"Максимальный",data:Math.max.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"dollar"===this.dollarOrPercent?"$":"%",color:"green"},{label:"Минимальный",data:Math.min.apply(null,this.points[0].map((function(t){return t.y}))),symbol:"dollar"===this.dollarOrPercent?"$":"%",color:"red"}]},getMetaInfoForGistogramm:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Доход"}]},getMetaInfoLines:function(){if(this.points&&this.points[0].length)return[{type:"line",color:this.points[0].at(-1).y>=0?this.getGreenColor.color:this.getRedColor.color,fill:this.points[0].at(-1).y>=0?this.getGreenColor.fill:this.getRedColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средний % дохода по открытым сделкам"}]},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.activePortfolioClass),this.darkClass)},expertsForStat:function(){if(!this.isLoadingStatData)return this.getStatData},getNoStatStatus:function(){return!!this.isLoadingStatData||(!this.getStatData||!this.getStatData.myStat.length)},colors:function(){return this.darkClass.dark?{color:this.averageIncome>=0?"rgba(0,255,172,1)":"rgba(250,76,74,1)",fill:this.averageIncome>=0?"rgba(0,255,172,0.1)":"rgba(250,76,74,0.1)"}:{color:this.averageIncome>=0?"rgba(0,142,114,1)":"rgba(233,18,18,1)",fill:this.averageIncome>=0?"rgba(0,142,114,0.1)":"rgba(233,18,18,0.1)"}},classTopValue:function(){return{green:this.averageIncome>=0,red:this.averageIncome<0}},dollarValue:function(){var t;return this.expertsForStat&&this.points&&this.points[0].length&&"Created"!==(null===(t=this.findPortfolio)||void 0===t?void 0:t.status)?"$"+this.points[0].at(-1).y.toFixed(2):""},percentValue:function(){return this.expertsForStat&&this.points&&this.points[0].length?this.points[0].at(-1).y.toFixed(2)+"%":""},getPofitByType:function(){if(this.expertsForStat&&this.points&&this.points[0].length)return"".concat("percent"===this.dollarOrPercent?"%":"$"," ").concat(this.$moneyf(this.points[0].at(-1).y,2))}}),methods:{setClosedProfit:function(){if(this.profitCloseOrders=this.closedOrders.reduce((function(t,e){return t+e.profit}),0),this.profitCloseOrders&&this.profitCloseOrders>0){var t=33*this.profitCloseOrders/100;this.profitCloseOrders-=t}},setMessageHandler:function(t){if(null!==t&&void 0!==t&&t.command&&"BrokerPosition"===t.command){var e=t.data;if(e.accountId===this.getDefaultAccount.id&&e.closedDate&&this.getSubscriptionsByBag.some((function(t){return t.subscription.id===+e.subscriptionId}))){if(e.profit>0){var i=33*e.profit/100,o=e.profit-i;this.profitCloseOrders+=o}else this.profitCloseOrders+=e.profit;this.combinedData(this.dollarOrPercent)}}},hoverPoint:function(t){if(t){var e=this.points[0].findIndex((function(e){return e.x===t.point.x}));this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+10,"px")},e>0&&(this.statsForHoverWidget=[{stat:"".concat("dollar"===this.dollarOrPercent?"$":"%"," ").concat(this.$moneyf(this.points[0][e].y,this.points[0][e].y>=1e6?0:2)),color:this.points[0][e].y>=0?"green":"red"}]),this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},combinedData:function(t){var e={};if(!this.getNoStatStatus&&this.expertsForStat){this.expertsForStat.myStat.forEach((function(i){i.data.forEach((function(i){var o,n=new Date(i.date).getTime(),s="dollar"===t?i.profitClose:100*i.profitClose/i.usedVolume;"percent"!==t||!isNaN(s)&&i.usedVolume||(s=0);var r=33*s/100;o=s>0?s-r:s,e[n]?e[n].push(o):e[n]=[o]}))}));var i=Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})),o={};i.forEach((function(t){var e="".concat(new Date(+t[0]).getMonth(),".").concat(new Date(+t[0]).getFullYear()),i=t[1].reduce((function(t,e){return t+e}),0);o[e]?o[e]=i:o[e]=[i]}));var n=Object.entries(o).map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1],n=i.split(".");return{x:new Date(n[1],n[0],1).getTime(),y:o,date:new Date(n[1],n[0],1).getTime()}})),s=Object.entries(o).map((function(t,e){var i=Object(D["a"])(t,2),o=i[0],n=i[1],s=o.split(".");return{x:e,y:n,date:new Date(s[1],s[0],1).getTime()}}));return this.averageIncome=n.at(-1).y,this.points=[],this.pointsForGistogramm=[],this.points.push(n),this.pointsForGistogramm.push(s),this.pointsForGistogramm.unshift([{x:0,y:0,date:n.at(-1).date}]),"dollar"===this.dollarOrPercent&&this.profitCloseOrders&&(this.points[0].at(-1).y=this.profitCloseOrders,this.pointsForGistogramm[1].at(-1).y=this.profitCloseOrders),n}},daysCalcData:function(){return this.combinedData(this.dollarOrPercent)},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormal:function(){this.$emit("setNormal")}},mounted:function(){this.$socketStream.$on("apiWS",this.setMessageHandler),this.isLoadingStatData||(this.closedOrders.length&&this.setClosedProfit(),this.combinedData(this.dollarOrPercent))},destroyed:function(){this.$socketStream.$off("apiWS",this.setMessageHandler)}},bjt=Cjt,Sjt=(i("3d30"),Object(C["a"])(bjt,vjt,yjt,!1,null,"3421af78",null)),Pjt=Sjt.exports,Tjt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profitMonthChart"},[e("div",{staticClass:"profitMonthChart-chart"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"profitMonthChart-title"},[e("div",[t._v(t._s("% ".concat(t.$t("successful_months")))+", ")]),e("div",[t._v(" "+t._s(t.$t("total_monthes"))),e("span",{style:{color:t.getBlueColor.color}},[t._v(t._s(t.getStatByMonth.length))])]),e("div",[t._v(" "+t._s(t.$t("successful_months"))),e("span",{style:{color:t.getPercentProfitMonth>50?t.getGreenColor.color:t.getRedColor.color}},[t._v(" "+t._s(t.getProfitMonthes.length))])])])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"profitMonthChart-chartWrap"},[e("div",{staticClass:"profitMonthChart-chartLine"},[t.points?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:!1,maxIndicator:{lines:[1]}},on:{hover:t.hoverPoint}}):t._e(),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.showHoverWidget?e("div",{class:"profitMonthChart-hoverWidget profitMonthChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"profitMonthChart-hoverWidgetRow profitMonthChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"profitMonthChart-hoverWidgetStat profitMonthChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()]),e("div",{class:"profitMonthChart-statData profitMonthChart-statData_".concat(t.getActiveTheme)},t._l(t.getStat,(function(i,o){return e("div",{key:o,staticClass:"profitMonthChart-statData-item"},[e("div",{class:"profitMonthChart-statData-itemLabel profitMonthChart-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"profitMonthChart-statData-itemData profitMonthChart-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v("% "+t._s(t.$moneyf(i.data,2)))])])})),0)],1),e("div",{staticClass:"profitMonthChart-legend"})])]},proxy:!0}])})],1),e("div",{staticClass:"profitMonthChart-gistogram"})])},xjt=[],Ojt={components:{UserProfileWrapWidget:PB,LineEventChart:Uk},props:{topBarWidgetParams:{type:Object}},mixins:[qe],data:function(){return{points:null,metaInfoForLines:null,showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},statsForHoverWidget:null}},watch:{getStatistics:function(t){t&&this.setPointsForChart(t)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getStatByMonth:"statistic/getStatByMonth",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getMetaInfoForLines:function(){return[{type:"line",color:"orange",fill:"rgba(0,0,0,0)",label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"".concat(this.$t("average")," % ").concat(this.$t("successful_months")),lineWidth:3},{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"% ".concat(this.$t("successful_months")),lineWidth:3}]},getProfitMonthes:function(){if(this.getStatByMonth)return this.getStatByMonth.filter((function(t){return t.profitAbs>0}))},getPercentProfitMonth:function(){if(this.getStatByMonth)return this.getProfitMonthes.length?100*this.getProfitMonthes.length/this.getStatByMonth.length:0},getStat:function(){if(this.points)return[{label:"".concat(this.$t("current")," %"),data:this.points[1].at(-1).y,color:"green"},{label:this.$t("max"),data:Math.max.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("average"),data:this.points[0].at(-1).y,color:"orange"}]}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},hoverPoint:function(t){if(t){this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+5,"px"),height:"".concat(18*("pig"===this.activeType?3:2),"px")};var e=this.points[0].findIndex((function(e){return e.date===t.point.date}));e&&(this.statsForHoverWidget=[{stat:"% ".concat(this.$moneyf(this.points[1][e].y,0)),color:"green"},{stat:"% ".concat(this.$moneyf(this.points[0][e].y,0)),color:"orange"}]),this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setPointsForChart:function(t){var e=t.ordersStatistics.startTradingDT,i=[],o=[],n=0,s=0,r=0;this.getStatByMonth.forEach((function(t,a){if(new Date(t.date).getFullYear()===new Date(e).getFullYear()&&new Date(t.date).getMonth()>=new Date(e).getMonth()||new Date(t.date).getFullYear()>new Date(e).getFullYear()){n++,t.profitAbs>=0&&s++;var c=100*s/n;r+=c,i.push({x:a,y:c,date:t.date}),o.push({x:a,y:r/n,date:t.date})}})),this.points=[o,i]}},mounted:function(){this.getStatistics&&this.setPointsForChart(this.getStatistics)}},wjt=Ojt,_jt=(i("bfa9"),Object(C["a"])(wjt,Tjt,xjt,!1,null,"e9a26e26",null)),Ajt=_jt.exports,Djt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profitMonthChart"},[e("div",{staticClass:"profitMonthChart-chart"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[e("div",{staticClass:"profitMonthChart-title"},[e("div",[t._v(t._s("% ".concat(t.$t("successful_days"))))]),e("div",[t._v(t._s(t.$t("total_days"))),e("span",{style:{color:t.getBlueColor.color}},[t._v(t._s(t.getCountDays))])]),e("div",[t._v(t._s(t.$t("successful_days"))),e("span",{style:{color:t.getPercentProfitDays>=50?t.getGreenColor.color:t.getRedColor.color}},[t._v(t._s(t.getProfitDays))])])])]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"profitMonthChart-chartWrap"},[e("div",{staticClass:"profitMonthChart-chartLine"},[t.points?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:!1,maxIndicator:{lines:[1]}},on:{hover:t.hoverPoint}}):t._e(),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.showHoverWidget?e("div",{class:"profitMonthChart-hoverWidget profitMonthChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"profitMonthChart-hoverWidgetRow profitMonthChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"profitMonthChart-hoverWidgetStat profitMonthChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()]),e("div",{class:"profitMonthChart-statData profitMonthChart-statData_".concat(t.getActiveTheme)},t._l(t.getStat,(function(i,o){return e("div",{key:o,staticClass:"profitMonthChart-statData-item"},[e("div",{class:"profitMonthChart-statData-itemLabel profitMonthChart-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"profitMonthChart-statData-itemData profitMonthChart-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v("% "+t._s(t.$moneyf(i.data,2)))])])})),0)],1)])]},proxy:!0}])})],1),e("div",{staticClass:"profitMonthChart-gistogram"})])},kjt=[],Ijt={components:{UserProfileWrapWidget:PB,LineEventChart:Uk},props:{topBarWidgetParams:{type:Object}},mixins:[qe],data:function(){return{points:null,metaInfoForLines:null,profitDays:0,showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},statsForHoverWidget:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCountDays:function(){if(this.points)return this.points[0].length},getPercentProfitDays:function(){if(this.points)return this.getProfitDays?100*this.getProfitDays/this.getCountDays:0},getProfitDays:function(){return this.profitDays},getMetaInfoForLines:function(){return[{type:"line",color:"orange",fill:"rgba(0,0,0,0)",label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"".concat(this.$t("current")," % ").concat(this.$t("current")),lineWidth:3},{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"% ".concat(this.$t("successful_days")),lineWidth:3}]},getStat:function(){if(this.points)return[{label:"".concat(this.$t("current")," %"),data:this.points[1].at(-1).y,color:"green"},{label:this.$t("max"),data:Math.max.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("average"),data:this.points[0].at(-1).y,color:"orange"}]}}),watch:{getStatistics:function(t){t&&this.setPointsForChart(t)}},methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},hoverPoint:function(t){if(t){this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+5,"px"),height:"".concat(18*("pig"===this.activeType?3:2),"px")};var e=this.points[0].findIndex((function(e){return e.date===t.point.date}));e&&(this.statsForHoverWidget=[{stat:"% ".concat(this.$moneyf(this.points[1][e].y,0)),color:"green"},{stat:"% ".concat(this.$moneyf(this.points[0][e].y,0)),color:"orange"}]),this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setPointsForChart:function(t){var e=this,i=t.ordersStatistics.startTradingDT,o=[],n=[],s=0;this.profitDays=0;var r=0;t.accountDaily.forEach((function(t,a){if(new Date(t.date).getTime()>new Date(i).getTime()){s++;var c=t.equityClose-t.equityOpen;c>0&&e.profitDays++;var l=100*e.profitDays/s;r+=l,o.push({x:a,y:l,date:t.date}),n.push({x:a,y:r/s,date:t.date})}})),this.points=[n,o]}},mounted:function(){this.getStatistics&&this.setPointsForChart(this.getStatistics)}},Bjt=Ijt,Mjt=(i("7e5c"),Object(C["a"])(Bjt,Djt,kjt,!1,null,"2d2b40de",null)),$jt=Mjt.exports,Ljt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"profitMonthChart"},[e("div",{staticClass:"profitMonthChart-chart"},[e("UserProfileWrapWidget",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setFullScreenMode},scopedSlots:t._u([{key:"title",fn:function(){return[t.points?e("div",{staticClass:"profitMonthChart-title"},[e("div",[t._v(t._s("% ".concat(t.$t("successful_trades_full")))+", ")]),e("div",[t._v(" "+t._s(t.$t("total_closed_trades"))),e("span",{style:{color:t.getBlueColor.color}},[t._v(t._s(t.getCountOrders))])]),e("div",[t._v(" "+t._s(t.$t("successful_trades_full"))),e("span",{style:{color:t.points[1].at(-1).y>50?t.getGreenColor.color:t.getRedColor.color}},[t._v(" "+t._s(t.getProfittOrders))])])]):t._e()]},proxy:!0},{key:"content",fn:function(){return[e("div",{staticClass:"profitMonthChart-chartWrap"},[e("div",{staticClass:"profitMonthChart-chartLine"},[t.points?e("LineEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.metaInfoForLines,minIndicator:!1,maxIndicator:{lines:[1]}},on:{hover:t.hoverPoint}}):t._e(),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.showHoverWidget?e("div",{class:"profitMonthChart-hoverWidget profitMonthChart-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"profitMonthChart-hoverWidgetRow profitMonthChart-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"profitMonthChart-hoverWidgetStat profitMonthChart-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()]),e("div",{class:"profitMonthChart-statData profitMonthChart-statData_".concat(t.getActiveTheme)},t._l(t.getStat,(function(i,o){return e("div",{key:o,staticClass:"profitMonthChart-statData-item"},[e("div",{class:"profitMonthChart-statData-itemLabel profitMonthChart-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"profitMonthChart-statData-itemData profitMonthChart-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v("% "+t._s(t.$moneyf(i.data,2)))])])})),0)],1),e("div",{staticClass:"profitMonthChart-legend"})])]},proxy:!0}])})],1),e("div",{staticClass:"profitMonthChart-gistogram"})])},Fjt=[],jjt={components:{UserProfileWrapWidget:PB,LineEventChart:Uk},data:function(){return{points:null,metaInfoForLines:null,showHoverWidget:!1,positionHoverWidget:{top:"0px",right:"0px"},statsForHoverWidget:null}},props:{topBarWidgetParams:{default:Object}},mixins:[qe],watch:{getActiveTheme:function(){this.metaInfoForLines=[{type:"line",color:"orange",fill:"rgba(0,0,0,0)",label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"".concat(this.$t("averag")," % ").concat(this.$t("successful_trades_full")),lineWidth:3},{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"% ".concat(this.$t("successful_trades_full")),lineWidth:3}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCountOrders:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.closedOrdersCount},getProfittOrders:function(){if(this.getStatistics)return this.getStatistics.ordersStatistics.positiveOrders},getStat:function(){if(this.points)return[{label:"".concat(this.$t("current")," %"),data:this.points[1].at(-1).y,color:"green"},{label:this.$t("max"),data:Math.max.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("min"),data:Math.min.apply(null,this.points[1].map((function(t){return t.y}))),color:"green"},{label:this.$t("average"),data:this.points[0].at(-1).y,color:"orange"}]}}),methods:{setFullScreenMode:function(){"normal"===this.topBarWidgetParams.row?this.$emit("setFullScreenMode"):this.$emit("setNormalScreenMode")},hoverPoint:function(t){if(t){this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX+5,"px"),height:"".concat(18*("pig"===this.activeType?3:2),"px")};var e=this.points[0].findIndex((function(e){return e.date===t.point.date}));e&&(this.statsForHoverWidget=[{stat:"% ".concat(this.$moneyf(this.points[1][e].y,0)),color:"green"},{stat:"% ".concat(this.$moneyf(this.points[0][e].y,0)),color:"orange"}]),this.showHoverWidget=!0}else this.showHoverWidget=!1,this.positionHoverWidget=null,this.statsForHoverWidget=null},setPointsForChart:function(t){var e=t.ordersStatistics.startTradingDT,i=[],o=[],n=0,s=0;t.accountDaily.forEach((function(t,r){new Date(t.date).getTime()>=new Date(e).getTime()&&(n++,s+=t.procPosOrders,i.push({x:r,y:t.procPosOrders,date:t.date}),o.push({x:r,y:s/n,date:t.date}))})),this.metaInfoForLines=[{type:"line",color:"orange",fill:"rgba(0,0,0,0)",label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"".concat(this.$t("averag")," % ").concat(this.$t("successful_trades_full")),lineWidth:3},{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,label:"%",fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",title:"% ".concat(this.$t("successful_trades_full")),lineWidth:3}],this.points=[o,i]}},mounted:function(){this.getStatistics&&this.setPointsForChart(this.getStatistics)}},Rjt=jjt,Wjt=(i("82a6"),Object(C["a"])(Rjt,Ljt,Fjt,!1,null,"feb9d0a4",null)),Njt=Wjt.exports,Ejt=function(){var t=this,e=t._self._c;return e("div",{class:"ExtandStatPortfolioChart ExtandStatPortfolioChart_".concat(t.getActiveTheme)},[e("UserProfileGridWidgetTopBar",{attrs:{topBarWidgetParams:t.topBarWidgetParams},on:{setMinHorizontal:t.setMinHorizontal,setNormal:t.setNormal,setFullScreenMode:t.setFullScreenMode,setNormalScreenMode:t.setNormalScreenMode}},[e("div",{staticClass:"ExtandStatPortfolioChart-title"},[e("div",{staticClass:"ExtandStatPortfolioChart-titleButtonsBlock"},[e("div",{class:"ExtandStatPortfolioChart-titleYear ExtandStatPortfolioChart-titleYear_".concat(t.getActiveTheme)},[t._v(t._s(t.getActiveYear))]),e("div",{staticClass:"ExtandStatPortfolioChart-titleMonthes"},t._l(t.getMonthesInActiveYear,(function(i,o){return e("div",{staticClass:"ExtandStatPortfolioChart-titleMonthesItem",class:new Date(t.activeDate).getMonth()===i.number-1?"ExtandStatPortfolioChart-titleMonthesItem_isActive-".concat(t.getActiveTheme):"ExtandStatPortfolioChart-titleMonthesItem_".concat(t.getActiveTheme),style:{background:new Date(t.activeDate).getMonth()===i.number-1?t.getBlueColor.color:i.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s(i.label))])})),0)]),e("div",{class:"ExtandStatPortfolioChart-titleText ExtandStatPortfolioChart-titleText_".concat(t.getActiveTheme)},[t._v("Доход по дням, $")]),t.getStatForChart?e("div",{class:"ExtandStatPortfolioChart-statData-itemData ExtandStatPortfolioChart-statData-itemData_".concat(t.getActiveTheme,"-").concat(t.getStatForChart[0].color),staticStyle:{padding:"0.8rem","font-size":"1.2rem"}},[t._v(t._s("$ ".concat(t.$moneyf(t.getStatForChart[0].data,2))))]):t._e()])]),e("div",{staticClass:"ExtandStatPortfolioChart-content"},[t.points?e("GistogrammEventChart",{attrs:{points:t.points,theme:t.getActiveTheme,typeXAxis:"month",metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e(),e("div",{class:"ExtandStatPortfolioChart-statData ExtandStatPortfolioChart-statData_".concat(t.getActiveTheme)},t._l(t.getStatForChart,(function(i,o){return e("div",{key:o,staticClass:"ExtandStatPortfolioChart-statData-item"},[e("div",{class:"ExtandStatPortfolioChart-statData-itemLabel ExtandStatPortfolioChart-statData-itemLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"ExtandStatPortfolioChart-statData-itemData ExtandStatPortfolioChart-statData-itemData_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(t.$moneyf(i.data,2)))])])})),0)],1)],1)},Ujt=[],Vjt={components:{GistogrammEventChart:TI,UserProfileGridWidgetTopBar:nM},props:{topBarWidgetParams:{type:Object}},mixins:[qe],data:function(){return{points:null,activeDate:null,profitByOpenOrders:0}},watch:{activeMode:function(){this.setPointsForGistogramm()},getStatData:function(t){t&&this.setPointsForGistogramm()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatData:"statDataForPortfolio/getStatData",getServerTime:"serverTime/getServerTime",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders"})),{},{getYearsArray:function(){if(this.getMonthStat)return Object.keys(this.getMonthStat)},getActiveYear:function(){var t=this;if(this.getMonthStat)return this.getYearsArray.find((function(e){return+e===new Date(t.activeDate).getFullYear()}))},getStatForChart:function(){if(this.points&&this.points.length){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y})),e=this.points[1][t].y,i=Math.max.apply(null,this.points[1].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[])),o=Math.min.apply(null,this.points[1].reduce((function(t,e){return void 0!==e.y&&t.push(e.y),t}),[]));return[{label:"Доход",data:e,symbol:"$",color:e<0?"red":"green"},{label:"Максимум",data:i,symbol:"$",color:i<0?"red":"green"},{label:"Минимум",data:o,symbol:"$",color:o<0?"red":"green"}]}},getMonthesInActiveYear:function(){if(this.getMonthStat){var t=this.getMonthStat[new Date(this.activeDate).getFullYear()],e=[];for(var i in t){var o=Object.entries(t[i]),n=o[0][1].reduce((function(t,e){return t+e[0]}),0),s=o.at(-1)[1].reduce((function(t,e){return t+e[1]}),0),r=s-n;e.push({number:+i+1,label:this.$t("mounthArr")[+i],profitAbs:r,openProfit:n})}return this.getStatusNowDate&&(e.at(-1).profitAbs=this.profitByOpenOrders+this.getPofitByCloseOrders-e.at(-1).openProfit),e}},getPofitByCloseOrders:function(){if(this.closedOrders&&this.closedOrders.length)return this.closedOrders.reduce((function(t,e){return t+e.profit}),0)},getStatusNowDate:function(){return new Date(this.activeDate).getFullYear()===new Date(this.getServerTime.utcNow).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(this.getServerTime.utcNow).getMonth()&&new Date(this.activeDate).getDate()===new Date(this.getServerTime.utcNow).getDate()},getMetaInfoForGistogramm:function(){if(this.points&&this.points[1].length){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"bar",color:this.points[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Доход"}]}},getActiveLabel:function(){return this.titleButtons[this.activeIndex].label},getMetaInfoLines:function(){if(this.points&&this.points[0].length)return[{type:"line",color:this.getGreenColor.color,fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.getActiveLabel}]},getMonthStat:function(){if(this.getDaysStat&&this.getDaysStat.length){var t={};return this.getDaysStat.forEach((function(e){var i=new Date(e.date).getFullYear(),o=new Date(e.date).getMonth(),n=new Date(e.date).getTime(),s=e.floatingProfitOpen+e.profitOpen,r=e.profitClose+e.floatingProfitClose,a=r-s;t[i]?t[i][o]?t[i][o][n]?t[i][o][n].push([s,a]):t[i][o][n]=[[s,a]]:t[i][o]=Object(Vt["a"])({},n,[[s,a]]):t[i]=Object(Vt["a"])({},o,Object(Vt["a"])({},n,[[s,a]]))})),t}},getDaysStat:function(){if(this.getStatData&&this.getStatData.myStat.length){var t=[];return this.getStatData.myStat.forEach((function(e){if(e.data.length){var i=e.data.filter((function(t){return 2===t.statType}));if(i.length)i.forEach((function(e){t.push(e)}));else{var o=e.data.filter((function(t){return 1===t.statType}));o.length&&t.push(o.at(-1))}}})),t}}}),methods:{setMessageHandler:function(t){if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){var e=t.data[0].openOrders.tradingOrders,i=this.openOrders;if(e&&e.length&&i&&i.length&&this.getStatusNowDate){var o=e.filter((function(t){return i.some((function(e){return e.id===t.id}))}));o.length&&(this.profitByOpenOrders=o.reduce((function(t,e){return t+e.profit}),0),this.getMonthStat&&this.setPointsForGistogramm())}}},setPointsForGistogramm:function(){var t=this;this.points=[[]];for(var e=new Date(this.activeDate).daysInMonth(),i=Object.entries(this.getMonthStat[new Date(this.activeDate).getFullYear()][new Date(this.activeDate).getMonth()]).sort((function(t,e){return+t[0]-+e[0]})),o=function(e){var o=i.find((function(t){return new Date(+t[0]).getDate()===e+1}));o?t.points[0].push({x:e,y:o[1].reduce((function(t,e){return t+e[1]}),0),date:+o[0]}):t.points[0].push({x:e})},n=0;n1?Math.abs(t.getTitle[2])>1e4?0:2:5))))]),e("span",[t._v("Текущий доход")]),e("span",{style:{color:t.getTitle[3]<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("$".concat(t.$moneyf(t.getTitle[3],Math.abs(t.getTitle[3])>=1?Math.abs(t.getTitle[3])>1e4?0:2:5)," / %").concat(t.$moneyf(t.getTitle[4],Math.abs(t.getTitle[4])>=1?Math.abs(t.getTitle[4])>1e4?0:2:5))))])]):t._e(),e("div",{staticClass:"ForecastPrortfolio-checkDatesButtons"},[t.getLastDates&&t.widgetSize.width>610?e("div",{staticClass:"ForecastPrortfolio-lastDates"},[t._l(t.getLastDates,(function(i,o){return e("div",{key:o,class:"ForecastPrortfolio-lastDatesItem ForecastPrortfolio-lastDatesItem_".concat(t.getActiveTheme," ForecastPrortfolio-lastDatesItem_").concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive"," ForecastPrortfolio-lastDatesItem_").concat(t.getActiveTheme,"-").concat(t.checkActiveDate(i.date)?"isAcitve":"noActive"),on:{click:function(e){return t.setActiveDate(i.date)},mouseenter:function(e){return t.setHoverIndex(o)},mouseleave:function(e){return t.setHoverIndex(null)}}},[t._v(t._s(i.month+1)),t.hoverIndex===o?e("div",{class:"ForecastPrortfolio-hoverWidgetlastDates ForecastPrortfolio-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive")},[e("div",[t._v("$ "+t._s(t.$moneyf(i.profitAbs,2)))]),e("div",{directives:[{name:"show",rawName:"v-show",value:i.profitRel,expression:"item.profitRel"}]},[t._v("% "+t._s(t.$moneyf(i.profitRel,Math.abs(i.profitRel<1)?5:2)))])]):t._e()])})),e("div",{staticClass:"ForecastPrortfolio-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{toggle:t.setStatusDateChecker}})],1),t.dateCheckerStatus?e("DataChartChecker",{attrs:{positionPopup:{my:"top right",at:"bottom right",of:".ForecastPrortfolio-title",offset:{x:0,y:5}},statistic:t.getLastDates,period:"month",activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()],2):t._e()])])]),t.isLoadingStatData||t.getNoStatStatus?t._e():e("div",{staticClass:"ForecastPrortfolio-content"},[e("div",{staticClass:"ForecastPrortfolio-chart"},[e("div",{staticClass:"ForecastPrortfolio-gistogramm-titleButtons"},[e("div",{class:"ForecastPrortfolio-gistogramm-titleButton ".concat("rel"!==t.type?"ForecastPrortfolio-gistogramm-titleButton_".concat(t.getActiveTheme):"ForecastPrortfolio-gistogramm-titleButton_isActive_".concat(t.getActiveTheme)),on:{click:function(e){return t.setTypeGistogramm("rel")}}},[e("svgIcon",{attrs:{name:"new-procent-icon"}})],1),e("div",{class:"ForecastPrortfolio-gistogramm-titleButton ".concat("abs"!==t.type?"ForecastPrortfolio-gistogramm-titleButton_".concat(t.getActiveTheme):"ForecastPrortfolio-gistogramm-titleButton_isActive_".concat(t.getActiveTheme)),on:{click:function(e){return t.setTypeGistogramm("abs")}}},[e("svgIcon",{attrs:{name:"SortDollar"}})],1)]),t.points?e("SectorLineEventChart",{key:t.points[0][0].y,attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}},on:{hover:t.hoverPoint}}):t._e(),null!==t.hoverIndexPoint?e("div",{class:"ForecastPrortfolio-hoverWidget ForecastPrortfolio-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"ForecastPrortfolio-hoverWidgetRow ForecastPrortfolio-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"ForecastPrortfolio-hoverWidgetLabel ForecastPrortfolio-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"ForecastPrortfolio-hoverWidgetStat ForecastPrortfolio-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e()],1),e("div",{staticClass:"ForecastPrortfolio-gistogramm"},[e("div",{class:"ForecastPrortfolio-gistogramm-title ForecastPrortfolio-gistogramm-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"ForecastPrortfolio-gistogramm-text"},[t._v("Гистограмма дохода по дням")])]),t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)]),t.isLoadingStatData?e("div",{staticClass:"ForecastPrortfolio-loader"},[e("Preloader",{attrs:{enabled:!0,icon:!0,sizeIcon:35,circle:!0}})],1):t._e(),!t.isLoadingStatData&&t.getNoStatStatus?e("div",{class:"ForecastPrortfolio_emptyContainer ForecastPrortfolio_emptyContainer_".concat(t.getActiveTheme)},[e("div",[e("svgIcon",{attrs:{name:"BIG_Data",size:150}})],1),e("div",[t._v(t._s("Active"===t.getStatusPortfolio?"Статистика по портфелю формируется":"Вы пока не инвестируете в портфель"))])]):t._e()],1)},Yjt=[],Xjt={components:{UserProfileGridWidgetTopBar:nM,SectorLineEventChart:Fj,GistogrammEventChart:TI,DataChartChecker:M3,Preloader:ah},props:{topBarWidgetParams:{type:Object},configObject:{type:Object,default:function(){return{modeStat:"statSubs"}}}},mixins:[qe,ZMt,yn],data:function(){return{points:null,modeStat:"statSubs",hoverIndex:null,profitByOpenOrders:0,activeDate:null,activeYear:null,lastProfit:0,activeTabMonth:null,dateCheckerStatus:!1,widgetSize:{width:0,height:0},pointsForGistogramm:null,type:"abs",hoverIndexPoint:null,positionHoverWidget:{top:"0px",right:"0px"}}},watch:{isLoadingStatData:function(t){t||(this.activeDate=this.getServerTime.now)},getStatByPeriod:function(t){t&&this.setPointsForChart(this.getStatByPeriod)},activeDate:function(){this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",findPortfolio:"expertsPortfolio/findPortfolio",getActiveTab:"expertsPortfolio/getActiveTab",getStatData:"statDataForPortfolio/getStatData",getServerTime:"serverTime/getServerTime",isLoadingStatData:"expertsPortfolio/isLoadingStatData",openOrders:"statDataForPortfolio/openOrders",closedOrders:"statDataForPortfolio/closedOrders"})),{},{getStatusPortfolio:function(){if(this.findPortfolio)return this.findPortfolio.status},getYearsStatPortfolio:function(){var t=this;if(this.getAllStat&&this.getAllStat.length){var e={},i=0,o=0;if(this.getAllStat.forEach((function(n){var s=new Date(n.date).getFullYear();if(e[s])if(e[s].find((function(t){return t.month===new Date(n.date).getMonth()}))){var r=n.profitClose+n.floatingProfitClose,a=r-i,c=a?100*a/o:0;e[s].at(-1).profitAbs=a,e[s].at(-1).profitRel=c}else{i=n.profitOpen+n.floatingProfitOpen;var l=t.getStatistics.accountDaily.find((function(t){return new Date(n.date).getFullYear()===new Date(t.date).getFullYear()&&new Date(n.date).getMonth()===new Date(t.date).getMonth()&&new Date(n.date).getDate()===new Date(t.date).getDate()}));if(l){o="statSubs"===t.modeStat?i:l.equityClose;var u=n.profitClose+n.floatingProfitClose,d=u-i,h=d?100*d/o:0;e[s].push({date:new Date(n.date),month:new Date(n.date).getMonth(),profitAbs:d,profitRel:h,openProfit:i,equity:o})}}else{i=n.profitOpen+n.floatingProfitOpen;var p=t.getStatistics.accountDaily.find((function(t){return new Date(n.date).getFullYear()===new Date(t.date).getFullYear()&&new Date(n.date).getMonth()===new Date(t.date).getMonth()&&new Date(n.date).getDate()===new Date(t.date).getDate()}));if(!p)return;o="statSubs"===t.modeStat?i:p.equityClose;var g=n.profitClose+n.floatingProfitClose,f=g-i,m=f?100*f/o:0;e[s]=[{date:new Date(n.date),month:new Date(n.date).getMonth(),profitAbs:f,profitRel:m,openProfit:i,equity:o}]}})),"statSubs"!==this.modeStat&&this.getStatusNowDate){var n=e[Object.keys(e).at(-1)].at(-1);n.profitAbs=this.getEquityClose-n.openProfit,n.profitRel=n.profitAbs?100*n.profitAbs/("statSubs"===this.modeStat?n.openProfit:this.getIncomeEquity):0}return e}},getEquityOpenMonth:function(){if(this.getStatByPeriod)return this.getStatByPeriod[0].profitOpen+this.getStatByPeriod[0].floatingProfitOpen},getForecast:function(){if(this.getStatByPeriod){var t=new Date(this.activeDate).daysInMonth(),e=Qjt(t,this.getStatByPeriod,this.getAllStat.length);return e}},getEquityClose:function(){if(this.getStatByPeriod)return this.getStatusNowDate&&"statSubs"!==this.modeStat?this.profitByOpenOrders+this.getPofitByCloseOrders:this.getStatByPeriod.at(-1).profitClose+this.getStatByPeriod.at(-1).floatingProfitClose},getProfitAbsOnMonth:function(){return this.getEquityClose-this.getEquityOpenMonth},getProfitRelOnMonth:function(){var t=this.getProfitAbsOnMonth?100*this.getProfitAbsOnMonth/("statSubs"!==this.modeStat?this.getIncomeEquity:this.getEquityOpenMonth):0;return t},getTitle:function(){if(this.getForecast&&this.getStatByPeriod&&this.getStatByPeriod.length){var t=this.$t("mounthArr")[new Date(this.activeDate).getMonth()],e=new Date(this.activeDate).getFullYear(),i=this.getForecast.featureEquity,o=i-this.getEquityOpenMonth,n=o?100*o/("statSubs"!==this.modeStat?this.getIncomeEquity:this.getEquityOpenMonth):0;return[t,e,n,this.getProfitAbsOnMonth,this.getProfitRelOnMonth]}},getStatByPeriod:function(){if(this.getAllStat&&null!==this.activeDate){var t=new Date(this.activeDate).getMonth(),e=new Date(this.activeDate).getFullYear(),i=this.getAllStat.filter((function(i){return new Date(i.date).getFullYear()===e&&new Date(i.date).getMonth()===t&&0!==new Date(i.date).getDay()&&6!==new Date(i.date).getDay()}));return i}},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Доход"}]}},getStatForDataChecker:function(){if(this.getYearsStat){var t=[];for(var e in this.getYearsStat)this.getYearsStat[e].forEach((function(e){t.push(e)}));return t}},getLastDates:function(){if(this.getMonthTabs&&this.getMonthTabs.length)return this.getMonthTabs},getStatusNowDate:function(){if(!this.isLoadingStatData)return new Date(this.activeDate).getFullYear()===new Date(this.getServerTime.utcNow).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(this.getServerTime.utcNow).getMonth()&&new Date(this.activeDate).getDate()===new Date(this.getServerTime.utcNow).getDate()},getPofitByCloseOrders:function(){return this.closedOrders&&this.closedOrders.length?this.closedOrders.reduce((function(t,e){return t+e.profit}),0):0},getMetaInfoForLines:function(){if(this.points&&this.points.length&&this.getStatByPeriod){var t="rel"===this.type?this.getEquityClose:this.getProfitRelOnMonth;return"rel"===this.type?this.getEquityClose:this.getProfitRelOnMonth,[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Средства на начало месяца"},{type:"line",color:this.getProfitRelOnMonth<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getProfitRelOnMonth<0?this.getRedColor.fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Абсолютная прибыль",extandsIndicator:"".concat(this.$moneyf(t,"rel"===this.type?t>1e4?0:2:t<1?5:2)," ","".concat("rel"===this.type?"$":"%"))},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:"Прогноз на месяца"}]}}}),methods:{setHoverIndex:function(t){this.hoverIndex=t},hoverPoint:function(t){if(t){var e=this.widgetSize.width-t.cPointX,i=this.widgetSize.height-t.cPointY;this.positionHoverWidget={top:"".concat(i>54?Math.round(t.cPointY):Math.round(t.cPointY-59),"px"),left:"".concat(e>140?t.cPointX+8:t.cPointX-148,"px")};var o=this.getStatByPeriod.find((function(e){return e.date===t.point.date})),n=this.getStatistics.accountDaily.find((function(t){return new Date(t.date).getFullYear()===new Date(o.date).getFullYear()&&new Date(t.date).getMonth()===new Date(o.date).getMonth()&&new Date(t.date).getDate()===new Date(o.date).getDate()})),s=this.getStatByPeriod[0].profitOpen+this.getStatByPeriod[0].floatingProfitOpen,r=o.profitOpen+o.floatingProfitOpen,a=o.profitClose+o.floatingProfitClose-s,c=a?100*a/("statSubs"===this.modeStat?s:this.getEquityByDate(n.date)):0,l=o.profitClose+o.floatingProfitClose-r,u=l?100*l/("statSubs"===this.modeStat?r:this.getEquityByDate(n.date)):0;o&&(this.statsForHoverWidget="statSubs"===this.modeStat?[{label:"P/L День, %",stat:"% ".concat(this.$moneyf(u,Math.abs(u)<.01?5:2)),color:l<0?"red":"green"},{label:"P/L Месяц, %",stat:"% ".concat(this.$moneyf(c,Math.abs(c)<.01?5:2)),color:c<0?"red":"green"},{label:"Дата",stat:new Date(o.date).toLocaleDateString("ru"),color:c<0?"red":"green"}]:[{label:"Баланс",stat:"$ ".concat(this.$moneyf(n.balanceClose,n.balanceClose>1e4?0:2)),color:"blue"},{label:"Средства",stat:"$ ".concat(this.$moneyf(n.equityClose,n.equityClose>1e4?0:2)),color:"green"},{label:"P/L День, %",stat:"% ".concat(this.$moneyf(u,Math.abs(u)<.01?5:2)),color:l<0?"red":"green"},{label:"P/L Месяц, %",stat:"% ".concat(this.$moneyf(c,Math.abs(c)<.01?5:2)),color:c<0?"red":"green"},{label:"Дата",stat:new Date(o.date).toLocaleDateString("ru"),color:c<0?"red":"green"}]),this.hoverIndexPoint=this.getStatByPeriod.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}))}else this.hoverIndexPoint=null},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},setMinHorizontal:function(){this.$emit("setMinHorizontal")},setMessageHandler:function(t){if(null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command){if("statSubs"===this.modeStat)return;var e=t.data[0].openOrders.tradingOrders,i=this.openOrders;if(e&&e.length&&i&&i.length&&this.getStatusNowDate){var o=e.filter((function(t){return i.some((function(e){return e.id===t.id}))}));o.length?this.profitByOpenOrders=o.reduce((function(t,e){return t+e.profit}),0):this.profitByOpenOrders=0}this.getStatByPeriod&&this.setPointsForChart(this.getStatByPeriod)}},checkActiveDate:function(t){return new Date(t).getFullYear()===new Date(this.activeDate).getFullYear()&&new Date(t).getMonth()===new Date(this.activeDate).getMonth()},setActiveDate:function(t){this.activeDate=t,this.setPointsForChart(this.getStatByPeriod)},setNormalScreenMode:function(){this.$emit("setNormalScreenMode")},setFullScreenMode:function(){this.$emit("setFullScreenMode")},setNormal:function(){this.$emit("setNormal")},setTypeGistogramm:function(t){this.type=t,this.setPointsForChart(this.getStatByPeriod)},setPointsForChart:function(t){var e=this;this.points=[[]],this.pointsForGistogramm=[[]],6!==new Date(this.activeDate).getDay()&&0!==new Date(this.activeDate).getDay()||(this.activeDate=new Date(new Date(this.activeDate).getFullYear(),new Date(this.activeDate).getMonth(),6===new Date(this.activeDate).getDay()?new Date(this.activeDate).getDate()-1:new Date(this.activeDate).getDate()-2));for(var i=new Date(this.activeDate).daysInMonth(),o=new Date(this.activeDate).getFullYear(),n=new Date(this.activeDate).getMonth(),s=[],r=0;r=e?this.directions.splice(1,1,"up"):this.directions.splice(1,1,"down"))},getCloseProfit:function(t,e){void 0!==t&&void 0!==e&&(t>=e?this.directions.splice(0,1,"up"):this.directions.splice(0,1,"down"))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getWatermarkData:function(){return this.getCurrentProfit?{data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getCurrentProfit[1].data[0],2)," / ").concat(this.$moneyf(this.getCurrentProfit[1].data[1],Math.abs(this.getCurrentProfit[1].data[1])<.01&&0!==Math.abs(this.getCurrentProfit[1].data[1])?5:3)," %"),color:this.getCurrentProfit[1].data[0]<0?this.getRedColor.fill:this.getGreenColor.fill}:null},getStat:function(){if(this.pointsForGistogram&&this.pointsForGistogram.length&&this.pointsForGistogram[1].length&&this.pointsForGistogram[2].length){var t=this.pointsForGistogram[1].at(-1).y,e=Math.max.apply(null,this.pointsForGistogram[1].map((function(t){return t.y}))),i=Math.min.apply(null,this.pointsForGistogram[1].map((function(t){return t.y}))),o=this.pointsForGistogram[2].at(-1).y;return[{label:"P/L",symbol:this.getCurrencyChar,data:this.$moneyf(t,t<.01?5:3),color:t<0?"red":"green"},{label:this.$t("max"),symbol:this.getCurrencyChar,data:this.$moneyf(e,Math.abs(e)<.01?5:3),color:"green"},{label:this.$t("min"),symbol:this.getCurrencyChar,data:this.$moneyf(i,Math.abs(i)<.01?5:3),color:"red"},{label:this.$t("average"),symbol:this.getCurrencyChar,data:this.$moneyf(o,Math.abs(o)<.01?5:3),color:"orange"}]}},getCurrentProfit:function(){if(this.points&&this.points.length){var t=this.getCloseProfit?100*this.getCloseProfit/this.getInvestMoneyByPortfolios:0,e=this.getFloatingProfit?100*this.getFloatingProfit/this.getInvestMoneyByPortfolios:0;return[{data:[this.getCloseProfit,t],symbol:this.getCurrencyChar,color:this.getCloseProfit<0?this.getRedColor.color:this.getGreenColor.color,text:this.$t("poct")},{data:[this.getFloatingProfit,e],symbol:"$",color:this.getFloatingProfit<0?this.getRedColor.color:this.getGreenColor.color,text:this.$t("current_income")}]}},getProfitClosed:function(){var t=this;return this.allSubscriptionCurrentDate&&this.allSubscriptionCurrentDate.length&&this.closedOrders&&this.closedOrders.length?this.closedOrders.reduce((function(e,i){if(null!==i&&void 0!==i&&i.subscriptionId){var o=t.allSubscriptionCurrentDate.find((function(t){return t.subscription.id===+i.subscriptionId}));o&&t.getCreatedPortfolios.some((function(t){return t.id===o.subscription.bagId}))&&(e+=i.profit)}return e}),0):0},getInvestMoneyByPortfolios:function(){if(!this.getCreatedPortfolios||!this.getCreatedPortfolios.length)return 0;var t=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));return t.length?t.reduce((function(t,e){return t+e.investMoney}),0):0},getProfitOpenOrders:function(){var t=this;return this.allSubscriptionCurrentDate&&this.allSubscriptionCurrentDate.length&&this.openOrders?this.openOrders.reduce((function(e,i){if(null!==i&&void 0!==i&&i.subscriptionId){var o=t.allSubscriptionCurrentDate.find((function(t){return t.subscription.id===+i.subscriptionId}));o&&t.getCreatedPortfolios.some((function(t){return t.id===o.subscription.bagId}))&&(e+=i.profit)}return e}),0):0},getMetaInfoForGistogramm:function(){return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("income")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("average")}]},getMetaInfoLines:function(){if(this.points&&!this.points.every((function(t){return!t.length})))return[{type:"line",color:this.getBlueColor.color,fill:this.getBlueColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("poct")},{type:"line",color:this.points[1].at(-1).y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.points[1].at(-1).y<0?this.getRedColor.fill:this.getGreenColor.fill,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]},portfoliosForStat:function(){if(this.commonStatisticsPortfolios)return this.commonStatisticsPortfolios.map((function(t){return{investBagId:t[0],data:t[1]}}))},getFloatingProfit:function(){if(this.points&&this.points.length&&this.points[0].length)return this.points[1].at(-1).y},getCloseProfit:function(){if(this.points&&this.points.length&&this.points[0].length)return this.points[0].at(-1).y}}),methods:{hedlerClickChartPoint:function(t){this.$emit("setActiveDate",t)},setPointsNoStat:function(){this.points=[[],[]],this.points[0].push({x:(new Date).getTime(),y:this.getProfitClosed,date:new Date}),this.points[1].push({x:(new Date).getTime(),y:this.getProfitOpenOrders+this.getProfitClosed,date:new Date});var t=[];t.push({x:0,y:this.getProfitOpenOrders+this.getProfitClosed,date:(new Date).getTime()}),this.pointsForGistogram=[[{x:0,y:0,date:0}],t,t]},setPointsForChart:function(t){var e,i=this;if(null!==(e=this.commonStatisticsPortfolios)&&void 0!==e&&e.length&&this.portfoliosForStat){this.points=[[],[]],this.pointsForGistogram=[[{x:0,y:0,date:0}],[],[]];var o=[];this.portfoliosForStat.forEach((function(t){t.data.length&&t.data.forEach((function(t){o.push(t)}))}));var n=this.combinedData(o),s=0,r=0;if(n.forEach((function(t,e){i.points[0].push({x:new Date(t.date).getTime(),y:t.profitClose,date:t.date}),i.points[1].push({x:new Date(t.date).getTime(),y:t.profitClose+t.floatingProfitClose,date:t.date}),s=t.profitOpen+t.floatingProfitOpen;var o=t.profitClose+t.floatingProfitClose,n=o-s;r+=n,i.pointsForGistogram[1].push({x:e,y:n,date:new Date(t.date).getTime()}),i.pointsForGistogram[2].push({x:e,y:r/(e+1),date:new Date(t.date).getTime()})})),"first"==t&&this.commonNowStatisticsPortfolios){var a=this.commonNowStatisticsPortfolios.profitAbs,c=a-s;return this.points[1].at(-1).y=a,this.points[0].at(-1).y=this.commonNowStatisticsPortfolios.profitClose,void(this.pointsForGistogram[1].at(-1).y=c)}var l=this.getProfitOpenOrders+this.getProfitClosed,u=l-s;r+=u,this.points[1].at(-1).y=l,this.pointsForGistogram[1].at(-1).y=u,this.pointsForGistogram[2].at(-1).y=r/this.pointsForGistogram[1].length,this.getProfitClosed&&(this.points[0].at(-1).y=this.getProfitClosed)}else this.setPointsNoStat()},setMessageHandler:function(t){if("AccountsDetails"===(null===t||void 0===t?void 0:t.command))this.openOrders=t.data[0].openOrders.tradingOrders,this.setPointsForChart();else if("BrokerPosition"===(null===t||void 0===t?void 0:t.command)){if("Position_PoClose"===t.data.reason||"Position_PoCreate"===t.data.reason||"Position_PoModify"===t.data.reason)return;if("Closed"===t.data.status&&this.$orderStorage.getOrdersOnStorage()){var e=this.$orderStorage.getOrdersOnStorage();this.closedOrders=e.closedOrders,this.setPointsForChart()}}},combinedData:function(t){var e=this,i={};return t.forEach((function(t){t[1].forEach((function(t){var o=t[1].map((function(t){return $W(t)})),n=o.filter((function(t){return 1!==t.statType}));n.length?(e.typeStat="day",n.forEach((function(t){var e=new Date(t.date).getTime();i[e]?(i[e][0].push(t.profitOpen),i[e][1].push(t.profitClose),i[e][2].push(t.floatingProfitOpen),i[e][3].push(t.floatingProfitClose)):i[e]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]}))):(n=o.filter((function(t){return 1===t.statType})),e.typeStat="hours",n.forEach((function(t){var e=new Date(new Date(t.date).getFullYear(),new Date(t.date).getMonth(),new Date(t.date).getDate()).getTime(),o=new Date(t.date).getTime();i[o]||i[e]?i[e]?(i[e][0].push(t.profitOpen),i[e][1].push(t.profitClose),i[e][2].push(t.floatingProfitOpen),i[e][3].push(t.floatingProfitClose)):(i[o][0].push(t.profitOpen),i[o][1].push(t.profitClose),i[o][2].push(t.floatingProfitOpen),i[o][3].push(t.floatingProfitClose)):i[o]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]})))}))})),Object.entries(i).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}}))},setOrders:function(){if(this.$orderStorage.getOrdersOnStorage()){var t=this.$orderStorage.getOrdersOnStorage();this.closedOrders=t.closedOrders,this.openOrders=t.tradingOrders}},hoverPoint:function(t){var e=this;if(t){var i=t.point;this.checkPoint=t,this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat(e.getCurrencyChar," ").concat(e.$moneyf(n.y,2)),color:e.getMetaInfoLines[o].color})}))}else this.positionHoverWidget=null,this.checkPoint=null}},mounted:function(){this.getStatByOrders&&this.setOrders(),this.commonStatisticsPortfolios||(this.noStatStatus=!0),this.$socketStream.events.subscribe("apiWS",this.setMessageHandler)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},pRt=hRt,gRt=(i("3fa8"),Object(C["a"])(pRt,uRt,dRt,!1,null,"6b125939",null)),fRt=gRt.exports,mRt=function(){var t=this,e=t._self._c;return e("div",{ref:"reportWrap",class:"DayReportTotalIncomeInvesting DayReportTotalIncomeInvesting_".concat(t.getActiveTheme),style:"left"===t.side?{left:0}:{right:0}},[e("div",{staticClass:"DayReportTotalIncomeInvesting-wrapper"},[e("div",{class:"DayReportTotalIncomeInvesting-title DayReportTotalIncomeInvesting-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-titleText"},[t._v(t._s(t.$t("report_for"))+" "+t._s(t.getDateForDay))]),e("ButtonIconFlat",{attrs:{icon:{name:"Close"},modifier:{class:["DayReportTotalIncomeInvesting-controlButtonItem","DayReportTotalIncomeInvesting-controlButtonItem_".concat(t.getActiveTheme)]}},on:{toggle:t.closeReport}})],1),e("div",{class:"DayReportTotalIncomeInvesting-content DayReportTotalIncomeInvesting-content_".concat(t.getActiveTheme)},[e("DxAccordion",{attrs:{"data-source":t.getAccordionTabs,height:"100%",hoverStateEnabled:!1},scopedSlots:t._u([{key:"title",fn:function(i){var o=i.data;return[e("div",{class:"DayReportTotalIncomeInvesting-titleAccordion DayReportTotalIncomeInvesting-titleAccordion_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-textAccordionTitle"},[e("div",{class:"DayReportTotalIncomeInvesting-textItem DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-gray"),staticStyle:{"flex-basis":"auto"}},[t._v(t._s(o.title))]),e("div",{class:"DayReportTotalIncomeInvesting-count DayReportTotalIncomeInvesting-count_".concat(t.getActiveTheme)},[t._v(t._s(o.count))]),3===o.ID&&o.count?e("div",{class:"DayReportTotalIncomeInvesting-valueStat DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-").concat(t.getSumProfitClose<0?"red":"green"),staticStyle:{"margin-left":"auto"}},[t._v("$ "+t._s(t.$moneyf(t.getSumProfitClose,Math.abs(t.getSumProfitClose)>=1e4?0:2)))]):t._e()])])]}},{key:"item",fn:function(i){var o=i.data;return[e("VuePerfectScrollbar",{staticClass:"DayReportTotalIncomeInvesting-accordionWrap"},[1===o.ID?e("div",{staticClass:"DayReportTotalIncomeInvesting-contentAccordion"},t._l(o.data,(function(i,o){return e("div",{key:o,class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvesting-textItem DayReportTotalIncomeInvesting-textItem_".concat(t.getActiveTheme)},[t._v(t._s(t.$t(o)))]),e("div",{class:"DayReportTotalIncomeInvesting-valueStat DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.symbol)+" "+t._s(i.data))])])})),0):t._e(),2===o.ID?e("div",{staticClass:"DayReportTotalIncomeInvesting-contentAccordion"},[e("div",{class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvestingt-avatarTitle"}),e("div",{staticClass:"DayReportTotalIncomeInvesting-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-priceOpenTitle"},[t._v(t._s(t.$t("open_price")))])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvesting-avatarTitle"},[e("Avatar",{attrs:{src:i.sourceUserAvatar,theme:t.getActiveTheme,size:"2"}})],1),e("div",{class:"DayReportTotalIncomeInvesting-contactTitle DayReportTotalIncomeInvesting-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"DayReportTotalIncomeInvesting-typeOrderTitle ".concat("Buy"===i.orderType?"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-green"):"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"DayReportTotalIncomeInvesting-volumeTitle DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"DayReportTotalIncomeInvesting-priceOpenTitle DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.openPrice))])])}))],2):t._e(),3===o.ID?e("div",{staticClass:"DayReportTotalIncomeInvesting-contentAccordion"},[e("div",{class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvesting-avatarTitle"}),e("div",{staticClass:"DayReportTotalIncomeInvesting-contactTitle"},[t._v(t._s(t.$t("contract")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-typeOrderTitle"},[t._v(t._s(t.$t("type")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-volumeTitle"},[t._v(t._s(t.$t("volume")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitTitle"},[t._v("PL, $")]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitTitle"},[t._v("PL, %")])]),t._l(o.data,(function(i,o){return e("div",{key:o,class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvesting-avatarTitle"},[e("Avatar",{attrs:{src:i.sourceUserAvatar,theme:t.getActiveTheme,size:"2"}})],1),e("div",{class:"DayReportTotalIncomeInvesting-contactTitle DayReportTotalIncomeInvesting-textItem_".concat(t.getActiveTheme)},[t._v(t._s(i.contractName))]),e("div",{class:"DayReportTotalIncomeInvesting-typeOrderTitle ".concat("Buy"===i.orderType?"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-green"):"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-red"))},[t._v(t._s(i.orderType))]),e("div",{class:"DayReportTotalIncomeInvesting-volumeTitle DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-gray")},[t._v(t._s(i.volume))]),e("div",{class:"DayReportTotalIncomeInvesting-profitTitle ".concat(i.profit<0?"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-red"):"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s(i.profit))]),e("div",{class:"DayReportTotalIncomeInvesting-profitTitle ".concat(i.profit<0?"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-red"):"DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-green"))},[t._v(t._s((100/(i.volume/i.profit)).toFixed(2)))])])}))],2):t._e(),4===o.ID?e("div",{staticClass:"DayReportTotalIncomeInvesting-contentAccordion"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-contentWrap"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-title",class:"DayReportTotalIncomeInvesting-profitBlock-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-titleText"},[t._v(t._s(t.$t("investments")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-titleText"},[t._v(t._s(t.$t("current_income")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-titleText"},[t._v(t._s(t.$t("closed_trade")))])]),t._l(t.statDay,(function(i,o){return e("div",{key:o,staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow",class:"DayReportTotalIncomeInvesting-profitBlock-dataRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-name"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-nameData"},[i.avatar?e("Avatar",{attrs:{theme:t.getActiveTheme,src:i.avatar,size:"1.6"}}):t._e(),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-nameData-text",class:"DayReportTotalIncomeInvesting-profitBlock-dataRow-nameData-text_".concat(t.getActiveTheme)},[t._v(t._s(i.name))])],1)]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profit"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profitData",class:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profitData_".concat(t.getActiveTheme),style:{color:i.stat.profitClose+i.stat.floatingProfitClose<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.stat.profitClose+i.stat.floatingProfitClose,2))))])]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profit"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profitData",class:"DayReportTotalIncomeInvesting-profitBlock-dataRow-profitData_".concat(t.getActiveTheme),style:{color:i.stat.profitClose<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.stat.profitClose,2))))])]),e("hr")])}))],2),e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfit",class:"DayReportTotalIncomeInvesting-absProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfitData",style:{color:t.getCalcAbsProfit<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfitAbs"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCalcAbsProfit,2))))]),t._v("/"),e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfitRel"},[t._v(t._s("".concat(t.$moneyf(t.getCalcRelProfit,Math.abs(t.getCalcRelProfit)<.01?5:2),"%")))])]),e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfitTitle"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-absProfitTitleText",class:"DayReportTotalIncomeInvesting-absProfitTitleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("current_income")))])])]),e("div",{staticClass:"DayReportTotalIncomeInvesting-profitTabs"},[e("div",{staticClass:"DayReportTotalIncomeInvesting-profitTabWrap"},t._l(t.analiticsTabs,(function(i,o){return e("div",{key:o,staticClass:"DayReportTotalIncomeInvesting-profitTab",class:i.mode===t.analiticsMode?"DayReportTotalIncomeInvesting-profitTab_isActive_".concat(t.getActiveTheme):"DayReportTotalIncomeInvesting-profitTab_".concat(t.getActiveTheme),on:{click:function(e){return t.setAnaliticsMode(i.mode)}}},[t._v(t._s(i.text))])})),0)]),e("div",{staticClass:"DayReportTotalIncomeInvesting-closeVolumeWrap"},[t.getAnalitics?e("div",{staticClass:"DayReportTotalIncomeInvesting-diagramWrapper"},[e("SectorDiagram",{key:t.getRerenderStatus,attrs:{height:210,width:210,widthBorder:65,percents:t.getAnalitics}})],1):e("div",{class:"DayReportTotalIncomeInvesting-closeVolumeNoData DayReportTotalIncomeInvesting-closeVolumeNoData_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}}),e("div",{class:"DayReportTotalIncomeInvesting-closeVolumeTitle DayReportTotalIncomeInvesting-closeVolumeTitle_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("twenc")))])],1),e("div",{class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayReportTotalIncomeInvesting-contactTitle"},[t._v(t._s(t.$t("portfolio_provider")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-volumeTitle"},[t._v(t._s(t.$t("income")))]),e("div",{staticClass:"DayReportTotalIncomeInvesting-priceOpenTitle"},[t._v(t._s(t.$t("of_total")))])]),t._l(t.getAnalitics,(function(i,o){return e("div",{key:o,class:"DayReportTotalIncomeInvesting-listStatItem DayReportTotalIncomeInvesting-listStatItem_".concat(t.getActiveTheme)},[e("div",{class:"DayReportTotalIncomeInvesting-contactTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.name))]),e("div",{class:"DayReportTotalIncomeInvesting-volumeTitle DayReportTotalIncomeInvesting-valueStat_".concat(t.getActiveTheme,"-gray"),style:{color:i.profit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profit,2))))]),e("div",{class:"DayReportTotalIncomeInvesting-priceOpenTitle",style:{color:i.color,fontWeight:600}},[t._v(t._s(i.data))])])}))],2)])]):t._e()])]}}])})],1)])])},vRt=[],yRt={components:{DxAccordion:uw.a,VuePerfectScrollbar:Xt.a,Avatar:E,SectorDiagram:MB},props:{side:{default:"left"},statDay:{default:null}},mixins:[qe],data:function(){return{closedOrders:null,openOrders:null,analiticsMode:"income",analiticsTabs:[{mode:"income",text:this.$t("income")},{mode:"loss",text:this.$t("loss")}]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",getServerTime:"serverTime/getServerTime",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getActivePrortfolios:"expertsPortfolio/getActivePrortfolios",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getRerenderStatus:function(){return"".concat(this.getActiveTheme,"_").concat(this.analiticsMode)},getAnalitics:function(){return"income"===this.analiticsMode?this.getSectorDiagramObject:this.getSectorDiagramObjectByLoss},getEquityByDate:function(){var t=this,e=this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getFullYear()===new Date(t.statDay[0].date).getFullYear()&&new Date(e.date).getMonth()===new Date(t.statDay[0].date).getMonth()&&new Date(e.date).getDate()===new Date(t.statDay[0].date).getDate()})).equityClose:this.getStatistics.account.equity;return e},getCalcAbsProfit:function(){return this.statDay.reduce((function(t,e){return t+(e.stat.profitClose+e.stat.floatingProfitClose)}),0)},getCalcRelProfit:function(){return this.getCalcAbsProfit?100*this.getCalcAbsProfit/this.getEquityByDate:0},getAllLossByDay:function(){var t=this.statDay.reduce((function(t,e){var i=e.stat.floatingProfitClose+e.stat.profitClose;return i<0&&(t+=Math.abs(i)),t}),0);return t},getSectorDiagramObjectByLoss:function(){var t=this;if(this.getAllLossByDay){var e=[];return this.statDay.forEach((function(i,o){var n=i.stat.profitClose+i.stat.floatingProfitClose;n<0&&e.push({avatar:i.avatar,profit:n,name:i.name,color:t.getSetRandomColors[o]?t.getSetRandomColors[o].color:CRt,data:Math.round(100*Math.abs(n)/Math.abs(t.getAllLossByDay))})})),e}},getAllProfitByDay:function(){var t=this.statDay.reduce((function(t,e){var i=e.stat.floatingProfitClose+e.stat.profitClose;return i>0&&(t+=i),t}),0);return t},getSectorDiagramObject:function(){var t=this;if(this.getAllProfitByDay){var e=[];return this.statDay.forEach((function(i,o){var n=i.stat.profitClose+i.stat.floatingProfitClose;n>0&&e.push({avatar:i.avatar,profit:n,name:i.name,color:t.getSetRandomColors[o]?t.getSetRandomColors[o].color:CRt,data:Math.round(100*n/t.getAllProfitByDay)})})),e}},getSubsByPortfolios:function(){var t=this;if(this.allSubscriptionCurrentDate&&this.getActivePrortfolios){var e=[];return this.getActivePrortfolios.forEach((function(i){var o=t.allSubscriptionCurrentDate.filter((function(t){return t.subscription.bagId===i.id})).map((function(t){return t.subscription.id}));e.push({name:i.name,avatar:i.avatar,subs:o})})),e}},getSubscribersByActivePortfolios:function(){var t=this;if(this.allSubscriptionCurrentDate&&this.getActivePrortfolios){var e=[];return this.allSubscriptionCurrentDate.forEach((function(i){t.getActivePrortfolios.some((function(t){return t.id===i.subscription.bagId}))&&e.push(i.subscription.id)})),e}},getClosedOrders:function(){var t=this;if(this.getSubscribersByActivePortfolios&&this.closedOrders&&this.closedOrders.length){var e=this.closedOrders.filter((function(e){return new Date(e.closedDate).getFullYear()===new Date(t.statDay[0].date).getFullYear()&&new Date(e.closedDate).getMonth()===new Date(t.statDay[0].date).getMonth()&&new Date(e.closedDate).getDate()===new Date(t.statDay[0].date).getDate()&&t.getSubscribersByActivePortfolios.some((function(t){return t===+e.subscriptionId}))}));return e}},getOpenOrders:function(){var t=this;if(this.getSubscribersByActivePortfolios){var e=[],i=[];return this.openOrders&&this.openOrders.length&&(e=this.openOrders.filter((function(e){return new Date(e.createdDate).getFullYear()===new Date(t.statDay[0].date).getFullYear()&&new Date(e.createdDate).getMonth()===new Date(t.statDay[0].date).getMonth()&&new Date(e.createdDate).getDate()===new Date(t.statDay[0].date).getDate()&&t.getSubscribersByActivePortfolios.some((function(t){return t===+e.subscriptionId}))}))),this.closedOrders&&this.closedOrders.length&&(i=this.closedOrders.filter((function(e){return new Date(e.createdDate).getFullYear()===new Date(t.statDay[0].date).getFullYear()&&new Date(e.createdDate).getMonth()===new Date(t.statDay[0].date).getMonth()&&new Date(e.createdDate).getDate()===new Date(t.statDay[0].date).getDate()&&t.getSubscribersByActivePortfolios.some((function(t){return t===+e.subscriptionId}))}))),e.concat(i)}},getDateForDay:function(){return new Date(this.statDay[0].date).toLocaleDateString("ru")},getAccordionTabs:function(){return[{ID:1,title:this.$t("psftd"),data:this.getStatDataForReport},{ID:2,title:this.$t("open_trades"),count:this.getOpenOrders?this.getOpenOrders.length:0,data:this.getOpenOrders},{ID:3,title:this.$t("closed_trades"),count:this.getClosedOrders?this.getClosedOrders.length:0,data:this.getClosedOrders},{ID:4,title:this.$t("analytics"),data:0}]},getSumProfitOpen:function(){return this.statDay.reduce((function(t,e){return t+e.stat.profitOpen}),0)},getSumProfitClose:function(){return this.statDay.reduce((function(t,e){return t+e.stat.profitClose}),0)},getDeltaProfitCloseByDay:function(){return this.getSumProfitClose-Math.abs(this.getSumProfitOpen)},getSumPercentProfitClose:function(){return this.getDeltaProfitCloseByDay?this.getSumProfitOpen?this.getDeltaProfitCloseByDay<0&&this.getSumProfitOpen<0&&this.getDeltaProfitCloseByDay30&&this.getSumPercentProfitCloseOrders<65?"orange":"green",symbol:"%"},sharpe_ratio:{data:Math.round(this.getSharp),color:this.getSharp<1?"red":"green"},ioota:{data:this.$moneyf(this.getSumFloatingOpen,2),color:this.getSumFloatingOpen<0?"red":"green",symbol:this.getCurrencyChar},iootat:{data:this.$moneyf(this.getSumFloatingClose,2),color:this.getSumFloatingClose?"red":"green",symbol:this.getCurrencyChar},iootf:{data:this.$moneyf(this.getDeltaFloatingCloseByDay,2),color:this.getDeltaFloatingCloseByDay<0?"red":"green",symbol:this.getCurrencyChar},iootfp:{data:this.$moneyf(this.getDeltaFloatingClosePercentByDay,2),color:this.getDeltaFloatingClosePercentByDay<0?"red":"green",symbol:"%"},volume_of_open_trades:{data:this.$moneyf(this.getSumVolumegClose,0),color:"gray",symbol:this.getCurrencyChar},apatb:{data:this.$moneyf(this.getAbsoluteOpenProfit,2),color:this.getAbsoluteOpenProfit<0?"red":"green",symbol:this.getCurrencyChar},apate:{data:this.$moneyf(this.getAbsoluteCloseProfit,2),color:this.getAbsoluteCloseProfit<0?"red":"green",symbol:this.getCurrencyChar},appd:{data:this.$moneyf(this.getAbsoluteDeltaProfit,2),color:this.getAbsoluteDeltaProfit<0?"red":"green",symbol:this.getCurrencyChar},appdp:{data:this.$moneyf(this.getAbsoluteDeltaPercentProfit,Math.abs(this.getAbsoluteDeltaPercentProfit)<.01?5:2),color:this.getAbsoluteDeltaPercentProfit<0?"red":"green",symbol:"%"}}}}),methods:{closeReport:function(){this.$emit("close")},setAnaliticsMode:function(t){this.analiticsMode=t},setOrders:function(){if(this.$orderStorage.getOrdersOnStorage()){var t=this.$orderStorage.getOrdersOnStorage();this.closedOrders=t.closedOrders,this.openOrders=t.tradingOrders}}},mounted:function(){this.setOrders()}};function CRt(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var bRt=yRt,SRt=(i("0bd9"),Object(C["a"])(bRt,mRt,vRt,!1,null,"238a64cb",null)),PRt=SRt.exports,TRt={name:"ProfitMyInvestings",mixins:[xt,qe,Ot],components:{CommonIncomePortfolios:fRt,DayReportTotalIncomeInvesting:PRt,DxPopup:wt["DxPopup"]},props:{commonStatisticsPortfolios:{default:null},commonNowStatisticsPortfolios:{default:null}},data:function(){return{xWidthPoint:0,statusDayReport:!1,statDay:null,timeOut:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getServerTime:"serverTime/getServerTime",getActiveTheme:"headerSettings/getActiveTheme",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getDayInvesting:function(){var t=this;if(this.getServerTime&&this.getCreatedPortfolios){var e=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));if(!e.length)return 0;var i=Math.min.apply(null,e.map((function(e){return new Date(e.startDateTime?e.startDateTime:t.getServerTime.now).getTime()}))),o=new Date(this.getServerTime.now).getTime(),n=(o-i)/864e5;return Math.trunc(n)}},getInvestMoneyByPortfolios:function(){if(!this.getCreatedPortfolios||!this.getCreatedPortfolios.length)return 0;var t=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));return t.length?t.reduce((function(t,e){return t+e.investMoney}),0):0}}),methods:{checkStatusNowdate:function(t){return new Date(this.getServerTime.now).getFullYear()===new Date(t).getFullYear()&&new Date(this.getServerTime.now).getMonth()===new Date(t).getMonth()&&new Date(this.getServerTime.now).getDate()===new Date(t).getDate()},openReport:function(t){var e=t.point.date;this.checkStatusNowdate(e)||(this.statDay=this.getStatDayForReport(e),this.xWidthPoint=t.cPointX,this.statusDayReport=!0)},closeReport:function(){this.statusDayReport=!1},getStatDayForReport:function(t){var e=this,i=[];return this.commonStatisticsPortfolios.forEach((function(o){var n=o[0],s=[];o[1].forEach((function(e){e[1].forEach((function(e){var i=e[1].map((function(t){return $W(t)})),o=i.filter((function(e){return 1===e.statType&&new Date(e.date).getFullYear()===new Date(t).getFullYear()&&new Date(e.date).getMonth()===new Date(t).getMonth()&&new Date(e.date).getDate()===new Date(t).getDate()})),n=i.filter((function(e){return 2===e.statType&&new Date(e.date).getFullYear()===new Date(t).getFullYear()&&new Date(e.date).getMonth()===new Date(t).getMonth()&&new Date(e.date).getDate()===new Date(t).getDate()}));if(n.length&&o.length){var r=o.at(-1),a=n[0];a.profitClose=r.profitClose,a.floatingProfitClose=r.floatingProfitClose,s.push(a)}else if(!n.length&&o.length){var c=o.at(-1),l=o[0];c.profitOpen=l.profitOpen,c.floatingProfitOpen=l.floatingProfitOpen,s.push(c)}else if(!o.length&&n.length){var u=n[0];s.push(u)}}))}));var r={profitClose:0,profitOpen:0,floatingProfitOpen:0,floatingProfitClose:0,volumeClose:0,closeCount:0,pCloseCount:0,sharp:0,volumeOpen:0,usedVolume:0};s.length&&(r.profitClose=s.reduce((function(t,e){return t+e.profitClose}),0),r.profitOpen=s.reduce((function(t,e){return t+e.profitOpen}),0),r.floatingProfitOpen=s.reduce((function(t,e){return t+e.floatingProfitOpen}),0),r.floatingProfitClose=s.reduce((function(t,e){return t+e.floatingProfitClose}),0),r.volumeClose=s.reduce((function(t,e){return t+e.volumeClose}),0),r.usedVolume=s.reduce((function(t,e){return t+e.usedVolume}),0),r.volumeOpen=s.reduce((function(t,e){return t+e.volumeOpen}),0),r.closeCount=s.reduce((function(t,e){return t+e.closedCount}),0),r.pCloseCount=s.reduce((function(t,e){return t+e.pClosedCount}),0),r.sharp=s.reduce((function(t,e){return t+e.sharp}),0)?s.reduce((function(t,e){return t+e.sharp}),0)/s.length:0),i.push({name:e.getCreatedPortfolios.find((function(t){return t.id===n})).name,avatar:e.getCreatedPortfolios.find((function(t){return t.id===n})).avatar,id:n,stat:r,date:t})})),i}}},xRt=TRt,ORt=(i("c08c"),Object(C["a"])(xRt,cRt,lRt,!1,null,"511c74b9",null)),wRt=ORt.exports,_Rt=function(){var t=this,e=t._self._c;return e("div",{ref:"widgetWrap",staticClass:"DayInvestingStat"},[e("div",{staticClass:"DayInvestingStat-header",class:"DayInvestingStat-header_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayInvestingStat-periodSwitch",class:"DayInvestingStat-periodSwitch_".concat(t.getActiveTheme)},t._l(t.getPeriodsButtons,(function(i,o){return e("div",{key:o,staticClass:"DayInvestingStat-period",class:i.active?"DayInvestingStat-period_isActive_".concat(t.getActiveTheme):"DayInvestingStat-period_".concat(t.getActiveTheme),on:{click:function(e){return t.setPriod(i.period)}}},[e("svgIcon",{attrs:{name:i.icon}})],1)})),0),t.getTitle&&t.wrapperSize&&t.wrapperSize.width>600?e("div",{staticClass:"DayInvestingStat-name"},[e("div",{staticClass:"DayInvestingStat-nameText"},[t._v(t._s(t.getTitle[0]))]),e("div",{staticClass:"DayInvestingStat-currentProfit",style:{color:t.getTitle[1]<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getTitle[1],2))))])]):t._e(),e("div",{staticClass:"DayInvestingStat-dateSwitch"},[e("div",{staticClass:"DayInvestingStat-lastDates"},t._l(t.getLastDates,(function(i,o){return e("div",{key:o,staticClass:"DayInvestingStat-lastDatesItem",class:"DayInvestingStat-lastDatesItem_".concat(t.getActiveTheme),style:{background:t.checkActiveDate(i.date)?t.getBlueColor.color:i.profitAbs<0?t.getRedColor.color:t.getGreenColor.color},on:{click:function(e){return t.setActiveDate(i.date)}}},[t._v(t._s(i.title))])})),0),e("div",{staticClass:"DayInvestingStat-calendar"},[e("ButtonIconFlat",{attrs:{icon:{name:"Calendar-event"},modifier:{class:["buttonFlat-icon-groupButtonItem","buttonFlat-icon-groupButtonItem_".concat(t.getActiveTheme),t.dateCheckerStatus?"buttonFlat-icon-groupButtonItem_isActive-".concat(t.getActiveTheme):""]}},on:{click:t.setStatusDateChecker}})],1)]),t.dateCheckerStatus?e("DataChartChecker",{key:t.period,attrs:{positionPopup:{my:"top right",at:"bottom right",of:".DayInvestingStat-calendar",offset:{x:0,y:5}},statistic:t.getDateForCalendar,period:t.period,activeDate:t.activeDate},on:{setActiveDate:t.setActiveDate}}):t._e()],1),t.noStatStatus?e("div",{staticClass:"DayInvestingStat-noStat",class:"DayInvestingStat-noStat_".concat(t.getActiveTheme)},[e("svgIcon",{attrs:{name:"BIG_Data",size:150}}),e("div",[t._v("Статистика формируется, либо по потфелю ещё не было сделок")])],1):e("div",{staticClass:"DayInvestingStat-content",class:"DayInvestingStat-content_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayInvestingStat-chart"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.points?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.points?e("SectorLineEventChart",{key:t.period,attrs:{typeXAxis:t.period,points:t.points,watermark:t.$t(t.getWatermarks),watermarkData:t.getWaterMarkData,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1),t.getCurrentProfit?e("div",{staticClass:"DayInvestingStat_chartData"},t._l(t.getCurrentProfit,(function(i,o){return t.getCurrentProfit?e("div",{key:o,class:"DayInvestingStat-chartDataItem DayInvestingStat-chartDataItem_".concat(t.getActiveTheme),style:{color:i.data<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"DayInvestingStat-chartDataItem-arrow",style:{color:"up"===t.directions[o]?t.getGreenColor.color:t.getRedColor.color}},[e("div",[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directions[o],"_direct")}})],1)]),e("div",{staticClass:"DayInvestingStat-chartDataItem-data",class:"DayInvestingStat-chartDataItem-data_".concat(t.getActiveTheme)},[t._v(t._s(o?"".concat(t.$moneyf(i.data,Math.abs(i.data)>.01?2:5)," %"):"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.data,2))))]),e("div",{staticClass:"DayInvestingStat-chartDataItem-title",class:"DayInvestingStat-chartDataItem-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"DayInvestingStat-chartDataItem-text",class:"DayInvestingStat-chartDataItem-text_".concat(t.getActiveTheme)},[t._v(t._s(i.text))])])]):t._e()})),0):t._e()],1),e("div",{staticClass:"DayInvestingStat-title"},[t._v(t._s(t.$t("hotgo")))]),e("div",{staticClass:"DayInvestingStat-gistogramm"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.pointsForGistogramm?t._e():e("Sceleton",{attrs:{width:"100%",height:"100%",variant:"text"}}),t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,typeXAxis:t.period,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1),t.getStat?e("TitlesForGistogram",{attrs:{data:t.getStat}}):t._e()],1)])])},ARt=[],DRt={components:{SectorLineEventChart:Fj,GistogrammEventChart:TI,TitlesForGistogram:DI,DataChartChecker:M3,Sceleton:nT},mixins:[qe,yn,TIt],props:{commonStatisticsPortfolios:{default:null},commonNowStatisticsPortfolios:{default:null}},data:function(){return{points:null,pointsForGistogramm:null,activeDate:new Date,period:"day",directions:["up","up"],closedOrders:null,openOrders:null,dateCheckerStatus:!1,wrapperSize:null,noStatStatus:!1}},watch:{period:function(){this.activeDate=new Date},commonStatisticsPortfolios:function(t){t&&this.setPointsForChart()},getProfitOpenOrders:function(t){t&&this.noStatStatus&&(this.noStatStatus=!1,this.commonStatisticsPortfolios=[])},getProfitCloseOrders:function(t){t&&this.noStatStatus&&(this.noStatStatus=!1,this.commonStatisticsPortfolios=[])},getCurrentProfit:function(t,e){var i=this;void 0!==t&&void 0!==e&&(this.getStatusNowDate?t.forEach((function(t,o){t.data>e[o].data?i.directions[o]="up":i.directions[o]="down"})):t.forEach((function(t,e){t.data>0?i.directions[e]="up":i.directions[e]="down"})))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTheme:"headerSettings/getActiveTheme",getStatByOrders:"contracts/getStatByOrders",getServerTime:"serverTime/getServerTime",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getStatistics:"statistic/getStatistics",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getCryptoStatus:function(){var t;return"Crypto"===(null===(t=this.getDefaultAccount)||void 0===t?void 0:t.groupType)},getStat:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm.length&&this.pointsForGistogramm[1].length&&this.pointsForGistogramm[2].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));if(!(t<0)){var e=this.pointsForGistogramm[1][t].y,i=this.pointsForGistogramm[1].filter((function(t){return t.y})),o=i.length?Math.max.apply(null,i.map((function(t){return t.y}))):0,n=i.length?Math.min.apply(null,i.filter((function(t){return t.y})).map((function(t){return t.y}))):0,s=this.pointsForGistogramm[2][t].y;return[{label:"P/L",symbol:this.getCurrencyChar,data:this.$moneyf(e,e<.01?5:3),color:e<0?"red":"green"},{label:this.$t("max"),symbol:this.getCurrencyChar,data:this.$moneyf(o,Math.abs(o)<.01?5:3),color:"green"},{label:this.$t("min"),symbol:this.getCurrencyChar,data:this.$moneyf(n,Math.abs(n)<.01?5:3),color:"red"},{label:this.$t("average"),symbol:this.getCurrencyChar,data:this.$moneyf(s,Math.abs(s)<.01?5:3),color:"orange"}]}}},getWatermarks:function(){var t={day:"Доход за ".concat(new Date(this.activeDate).toLocaleDateString("ru")),week:"Доход ".concat(new Date(this.activeDate).getWeek()," неделя ").concat(new Date(this.activeDate).getFullYear()),month:"Доход ".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear())};return t[this.period]},getPeriodsButtons:function(){return[{icon:"TimePeriod_2D",active:"day"===this.period,period:"day"},{icon:"TimePeriod_2W",active:"week"===this.period,period:"week"},{icon:"TimePeriod_2M",active:"month"===this.period,period:"month"}]},getWaterMarkData:function(){return this.getCurrentProfit?{data:"".concat(this.getCurrencyChar).concat(this.$moneyf(this.getCurrentProfit[0].data,2)," / ").concat(this.$moneyf(this.getCurrentProfit[1].data,2),"%"),color:this.getCurrentProfit[0].data<0?this.getRedColor.fill:this.getGreenColor.fill}:null},getCurrentProfit:function(){if(this.points&&this.pointsForGistogramm){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y}));return[{data:this.points[1][t].y,text:this.$t("income")},{data:this.pointsForGistogramm[1][t].y,text:this.$t("equity_increase")}]}},serverTime:function(){var t=new Date(this.getServerTime.utcNow);return"".concat(t.getHours()<10?"0".concat(t.getHours()):t.getHours(),":").concat(t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes()," (UTC)")},getTitle:function(){if(this.points&&this.points[1]&&this.wrapperSize){var t=this.points[1].findLastIndex((function(t){return void 0!==t.y})),e=this.points[1][t].y-this.points[0][0].y,i={day:this.wrapperSize.width>1e3?"".concat(this.$t("pftdb")," ").concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()," ").concat(this.serverTime):"".concat(new Date(this.activeDate).getDate()<10?"0".concat(new Date(this.activeDate).getDate()):new Date(this.activeDate).getDate(),".").concat(new Date(this.activeDate).getMonth()+1<10?"0".concat(new Date(this.activeDate).getMonth()+1):new Date(this.activeDate).getMonth()+1,".").concat(new Date(this.activeDate).getFullYear()),week:this.wrapperSize.width>1e3?"".concat(this.$t("iftw")," ").concat(new Date(this.activeDate).getWeek()," ").concat(this.$t("by_portfolios")):"".concat(this.$t("week")," ").concat(new Date(this.activeDate).getWeek()),month:this.wrapperSize.width>1e3?"".concat(this.$t("profit_by_portfolios")," ").concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()," г."):" ".concat(this.$t("mounthArr")[new Date(this.activeDate).getMonth()]," ").concat(new Date(this.activeDate).getFullYear()," г.")};return[i[this.period],e]}},getEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getProfitCloseOrders:function(){var t=this;if(!this.closedOrders||!this.closedOrders.length)return 0;var e=this.closedOrders.filter((function(e){return e.subscriptionId&&t.allSubscriptionCurrentDate.some((function(t){return t.subscription.id===+e.subscriptionId}))}));return e.length?e.reduce((function(t,e){return t+e.profit}),0):0},getStatForDay:function(){var t=this;if(this.getAllStatByPortfolios){var e=[];return this.getCryptoStatus||6!==new Date(this.activeDate).getDay()&&0!==new Date(this.activeDate).getDay()||(this.activeDate=new Date(new Date(this.activeDate).getFullYear(),new Date(this.activeDate).getMonth(),6===new Date(this.activeDate).getDay()?new Date(this.activeDate).getDate()-1:new Date(this.activeDate).getDate()-2)),this.getAllStatByPortfolios.forEach((function(i){if(i.length){var o=i.map((function(t){return $W(t)}));o.forEach((function(i){1===i.statType&&new Date(t.activeDate).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.activeDate).getMonth()===new Date(i.date).getMonth()&&new Date(t.activeDate).getDate()===new Date(i.date).getDate()&&e.push(i)}))}})),e}},getDatesForDay:function(){var t=this;if(this.getAllStatByHours||this.getAllStatByDays){var e=[];return this.getAllStatByDays&&this.getAllStatByDays.forEach((function(i){if(t.getAllStatByHours.some((function(t){return new Date(i.date).getFullYear()===new Date(t.date).getFullYear()&&new Date(i.date).getMonth()===new Date(t.date).getMonth()&&new Date(i.date).getDate()===new Date(t.date).getDate()}))){var o,n=i.profitOpen+i.floatingProfitOpen;o=new Date(i.date).getFullYear()===new Date(t.getServerTime.utcNow).getFullYear()&&new Date(i.date).getMonth()===new Date(i.date).getMonth()&&new Date(i.date).getDate()===new Date(t.getServerTime.utcNow).getDate()?t.getProfitOpenOrders+t.getProfitCloseOrders:i.profitClose+i.floatingProfitClose;var s=o-n,r=t.getEquityByDate(i.date),a=s?100*s/r:0;e.push({date:i.date,title:new Date(i.date).getDate(),equityOpen:n,profitAbs:s,profitRel:a})}})),e}},getProfitOpenOrders:function(){var t=this;if(!this.openOrders||!this.openOrders.length)return 0;var e=this.openOrders.filter((function(e){return e.subscriptionId&&t.allSubscriptionCurrentDate.some((function(t){return t.subscription.id===+e.subscriptionId}))}));return e.length?e.reduce((function(t,e){return t+e.profit}),0):0},getStatusNowDate:function(){return new Date(this.activeDate).getFullYear()===new Date(this.getServerTime.utcNow).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(this.getServerTime.utcNow).getMonth()&&new Date(this.activeDate).getDate()===new Date(this.getServerTime.utcNow).getDate()},getLastDates:function(){if(this.getAllStatByHours||this.getAllStatByDays){var t={day:this.getDatesForDay,month:this.getDateForMonth,week:this.getDateForWeek};return t[this.period].length>5?t[this.period].slice(-5):t[this.period]}},getDateForCalendar:function(){if(this.getAllStatByHours||this.getAllStatByDays){var t={day:this.getDatesForDay,month:this.getDateForMonth,week:this.getDateForWeek};return t[this.period]}},getDateForWeek:function(){if(this.getAllStatByHours||this.getAllStatByDays)return this.getAllStatByDays&&this.getAllStatByDays.length?this.compinePeriodStatForDateTabs(this.getAllStatByDays,"week"):this.getAllStatByHours&&this.getAllStatByHours.length?this.compinePeriodStatForDateTabs(this.getAllStatByHours,"week"):void 0},getDateForMonth:function(){if(this.getAllStatByHours||this.getAllStatByDays)return this.getAllStatByDays&&this.getAllStatByDays.length?this.compinePeriodStatForDateTabs(this.getAllStatByDays,"month"):this.getAllStatByHours&&this.getAllStatByHours.length?this.compinePeriodStatForDateTabs(this.getAllStatByHours,"month"):void 0},getStatByPeriod:function(){if(this.getAllStatByPortfolios){var t={day:this.getStatForDay,week:this.getStatForWeek,month:this.getStatForMonth};return t[this.period]}},getStatForMonth:function(){var t=this;if(this.getAllStatByPortfolios){var e=[];return this.getAllStatByPortfolios.forEach((function(i){if(i.length){var o=i.map((function(t){return $W(t)}));o.forEach((function(i){2===i.statType&&new Date(t.activeDate).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.activeDate).getMonth()===new Date(i.date).getMonth()&&e.push(i)}))}})),e}},getStatForWeek:function(){var t=this;if(this.getAllStatByPortfolios){var e=[];return this.getAllStatByPortfolios.forEach((function(i){if(i.length){var o=i.map((function(t){return $W(t)}));o.forEach((function(i){2===i.statType&&new Date(t.activeDate).getFullYear()===new Date(i.date).getFullYear()&&new Date(t.activeDate).getWeek()===new Date(i.date).getWeek()&&e.push(i)}))}})),e}},getMetaInfoForLines:function(){if(this.points&&this.points.length){var t=this.points[1].findLast((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"line",color:t.y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("current_income")}]}},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("income")},{type:"line",color:this.getOrangeColor.color,fillIndicator:"dark"===this.getActiveTheme?"#151924":"#fff",label:"",lineWidth:3,title:this.$t("average")}]}}}),methods:{setPriod:function(t){this.period=t,this.setPointsForChart()},checkActiveDate:function(t){var e={day:new Date(this.activeDate).getFullYear()===new Date(t).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(t).getMonth()&&new Date(this.activeDate).getDate()===new Date(t).getDate(),week:new Date(this.activeDate).getFullYear()===new Date(t).getFullYear()&&new Date(this.activeDate).getWeek()===new Date(t).getWeek(),month:new Date(this.activeDate).getFullYear()===new Date(t).getFullYear()&&new Date(this.activeDate).getMonth()===new Date(t).getMonth()};return e[this.period]},setActiveDate:function(t){this.activeDate=t,this.setPointsForChart()},compinePeriodStatForDateTabs:function(t,e){var i,o=this,n="week"===e?new Date(t[0].date).getWeek():new Date(t[0].date).getMonth(),s=t[0].profitOpen+t[0].floatingProfitOpen;i=new Date(t[0].date).getFullYear()===new Date(this.getServerTime.utcNow).getFullYear()&&new Date(t[0].date).getMonth()===new Date(t[0].date).getMonth()&&new Date(t[0].date).getDate()===new Date(this.getServerTime.utcNow).getDate()?this.getProfitOpenOrders+this.getProfitCloseOrders:t[0].profitClose+t[0].floatingProfitClose;var r=i-s,a=this.getEquityByDate(t[0].date),c=r?100*r/a:0,l=[{date:new Date(t[0].date),title:"week"===e?n:n+1,equityOpen:s,profitAbs:r,profitRel:c}];return t.forEach((function(t){var a="week"===e?new Date(t.date).getWeek()===n:new Date(t.date).getMonth()===n;if(a){var u;u=new Date(t.date).getFullYear()===new Date(o.getServerTime.utcNow).getFullYear()&&new Date(t.date).getMonth()===new Date(t.date).getMonth()&&new Date(t.date).getDate()===new Date(o.getServerTime.utcNow).getDate()?o.getProfitOpenOrders+o.getProfitCloseOrders:t.profitClose+t.floatingProfitClose,r=u-s;var d=o.getEquityByDate(t.date);c=r?100*r/d:0,l.at(-1).profitAbs=r,l.at(-1).profitRel=c}else{n="week"===e?new Date(t.date).getWeek():new Date(t.date).getMonth(),s=t.profitOpen+t.floatingProfitOpen,i=new Date(t.date).getFullYear()===new Date(o.getServerTime.utcNow).getFullYear()&&new Date(t.date).getMonth()===new Date(t.date).getMonth()&&new Date(t.date).getDate()===new Date(o.getServerTime.utcNow).getDate()?o.getProfitOpenOrders+o.getProfitCloseOrders:t.profitClose+t.floatingProfitClose,r=i-s;var h=o.getEquityByDate(t.date);c=r?100*r/h:0,l.push({date:new Date(t.date),title:"week"===e?n:n+1,equityOpen:s,profitAbs:r,profitRel:c})}})),l},getEquityByDate:function(t){if(this.getStatistics){if(this.getStatistics.accountDaily.length){var e=this.getStatistics.accountDaily.find((function(e){return new Date(t).getFullYear()===new Date(e.date).getFullYear()&&new Date(t).getMonth()===new Date(e.date).getMonth()&&new Date(t).getDate()===new Date(e.date).getDate()}));return e?e.equityClose:this.getStatistics.accountDaily.at(-1).equityClose}return this.getStatistics.equity}},setStatusDateChecker:function(){this.dateCheckerStatus=!this.dateCheckerStatus},setMessageHandler:function(t){null!==t&&void 0!==t&&t.command&&"AccountsDetails"===t.command&&(this.openOrders=t.data[0].openOrders.tradingOrders,this.noStatStatus||this.setPointsForChart())},getStatDayForStatHours:function(){var t=this,e=[],i=[],o=[];this.getAllStatByPortfolios.forEach((function(t){if(t.length){var e=t.map((function(t){return $W(t)}));e.forEach((function(t){2===t.statType?i.push(t):o.push(t)}))}}));var n=i.length;return n?i.forEach((function(i){new Date(i.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(i.date).getMonth()===new Date(t.activeDate).getMonth()&&new Date(i.date).getDate()===new Date(t.activeDate).getDate()&&2===i.statType&&e.push(i)})):o.forEach((function(i){new Date(i.date).getFullYear()===new Date(t.activeDate).getFullYear()&&new Date(i.date).getMonth()===new Date(t.activeDate).getMonth()&&new Date(i.date).getDate()===new Date(t.activeDate).getDate()&&2===i.statType&&e.push(i)})),this.combinedData(e)},combinedData:function(t){var e={};return t.forEach((function(t){var i=new Date(t.date).getTime();e[i]?(e[i][0].push(t.profitOpen),e[i][1].push(t.profitClose),e[i][2].push(t.floatingProfitOpen),e[i][3].push(t.floatingProfitClose)):e[i]=[[t.profitOpen],[t.profitClose],[t.floatingProfitOpen],[t.floatingProfitClose]]})),Object.entries(e).sort((function(t,e){return+t[0]-+e[0]})).map((function(t){return{date:new Date(+t[0]),profitOpen:t[1][0].reduce((function(t,e){return t+e}),0),profitClose:t[1][1].reduce((function(t,e){return t+e}),0),floatingProfitOpen:t[1][2].reduce((function(t,e){return t+e}),0),floatingProfitClose:t[1][3].reduce((function(t,e){return t+e}),0)}}))},getItemsPeriod:function(){var t;return"week"===this.period?t=7:"month"===this.period?t=new Date(this.activeDate).daysInMonth():"day"===this.period&&(t=24),t},setPointsNoStat:function(){this.points=[[]],this.pointsForGistogramm=[[],[]];for(var t=this.getItemsPeriod(),e=0;e5&&l<10?this.getOrangeColor.color:this.getRedColor.color}]},{title:this.$t("invested"),tooltip:this.$t("affiw"),data:[{data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(s,2)," (").concat(this.$moneyf(r,2),"%)"),color:r>=75?this.getRedColor.color:r<75&&r>=50?this.getOrangeColor.color:this.getGreenColor.color}]},{title:this.$t("available_for_investment"),tooltip:this.$t("fffiw"),data:[{data:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(a,2)," (").concat(this.$moneyf(c,2),"%)"),color:c<30?this.getRedColor.color:c>=30&&c<=70?this.getOrangeColor.color:this.getGreenColor.color}]}]}}}),methods:{mouseenterHandler:function(t,e){this.tooltipText=e,this.viewTooltip(t)},onResize:function(t){this.size=t[0].contentRect.width}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},RRt=jRt,WRt=(i("8588"),Object(C["a"])(RRt,LRt,FRt,!1,null,"b1358c56",null)),NRt=WRt.exports,ERt=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",staticClass:"AnaliticsSectorDiagram"},[e("div",{staticClass:"AnaliticsSectorDiagram-chart"},[t.getSizeDiagram?e("SectorDiagram",{key:"".concat(t.getSizeDiagram.height,"_").concat(t.getActiveTheme,"_").concat(t.getSizeDiagram.width),attrs:{percents:t.getSectorDiagramObject,width:t.getSizeDiagram.height,height:t.getSizeDiagram.height,widthBorder:t.getSizeDiagram.height/3,fontSize:Math.round(7*t.getSizeDiagram.height/100)}}):t._e()],1)])},URt=[],VRt={components:{SectorDiagram:MB},mixins:[yn,qe],props:{colors:{type:Array}},data:function(){return{size:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getInvestingPortfolios:function(){if(this.getCreatedPortfolios)return this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}))},getFullEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getSizeDiagram:function(){if(this.size){var t=this.size.width-100,e=this.size.height>t?t:this.size.height,i=this.size.height>t?t:this.size.height;return{width:Math.round(e),height:Math.round(i)}}},getSectorDiagramObject:function(){var t=this;if(this.getInvestingPortfolios){var e=[];if(this.getInvestingPortfolios.length){var i=this.getInvestingPortfolios.reduce((function(t,e){return t+e.investMoney}),0),o=i?100*i/this.getFullEquityClose:0,n=100-o;return this.getInvestingPortfolios.forEach((function(i,o){e.push({symbol:i.defaultName,color:t.colors[o].color,data:100*i.investMoney/t.getFullEquityClose})})),e.push({symbol:"Свободно",color:n<=30?this.getRedColor.color:n>30&&n<70?this.getOrangeColor.color:this.getGreenColor.color,data:n}),e}}}}),methods:{onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},HRt=VRt,GRt=(i("4755"),Object(C["a"])(HRt,ERt,URt,!1,null,"4553d5b5",null)),qRt=GRt.exports,zRt=function(){var t=this,e=t._self._c;return t.getCreatedPortfolios?e("div",{ref:"wrap",staticClass:"AnaliticsProgressBar"},[e("div",{class:"AnaliticsProgressBar-investing AnaliticsProgressBar-investing_".concat(t.getActiveTheme),style:{width:"".concat(t.getWidthInvestingEquity.rel,"%"),background:t.getBlueColor.color},attrs:{title:"Инвестированно ".concat(t.$moneyf(t.getWidthInvestingEquity.rel,t.getWidthInvestingEquity.rel<.01?5:2),"% (").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthInvestingEquity.abs,t.getWidthInvestingEquity.abs>1e4?0:2),"/").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthInvestingEquity.abs/t.getStatistics.account.maxLeverage,2),")")}},[e("div",[t._v(t._s(t.getTitleInvesting))])]),e("div",{class:"AnaliticsProgressBar-free AnaliticsProgressBar-free_".concat(t.getActiveTheme),style:{background:t.getWidthFeeEquity.rel>=70?t.getGreenColor.color:t.getWidthFeeEquity.rel<70&&t.getWidthFeeEquity.rel>=30?t.getOrangeColor.color:t.getRedColor.color},attrs:{title:"Свободно для инвестиций ".concat(t.$moneyf(t.getWidthFeeEquity.rel,t.getWidthFeeEquity.rel<.01?5:2),"% (").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthFeeEquity.abs,t.getWidthFeeEquity.abs>1e4?0:2),"/").concat(t.getCurrencyChar).concat(t.$moneyf(t.getWidthFeeEquity.abs/t.getStatistics.account.maxLeverage,0),")")}},[e("div",[t._v(t._s(t.getTitleFreeEquity))])])]):t._e()},YRt=[],XRt={mixins:[qe,yn],data:function(){return{wrapSize:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatistics:"statistic/getStatistics",getActiveTheme:"headerSettings/getActiveTheme",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getFullEquityClose:function(){return this.getStatistics,this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getInvestingPortfolios:function(){if(this.getCreatedPortfolios)return this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}))},getWidthFeeEquity:function(){if(this.getStatistics&&this.getInvestingPortfolios){var t=100-this.getWidthInvestingEquity.rel,e=this.getFullEquityClose-this.getWidthInvestingEquity.abs;return{rel:t,abs:e}}},getWidthInvestingEquity:function(){if(this.getStatistics&&this.getInvestingPortfolios){var t=this.getInvestingPortfolios.length?this.getInvestingPortfolios.reduce((function(t,e){return t+e.investMoney}),0):0,e=100*t/this.getFullEquityClose;return{rel:e,abs:t}}},getPixelWidthInvestingEquity:function(){return this.wrapSize&&this.getWidthInvestingEquity?Math.round(this.wrapSize*(this.getWidthInvestingEquity.rel/100)):0},getPixelWidthFreeEquity:function(){return this.wrapSize&&this.getWidthFeeEquity?Math.round(this.wrapSize*(this.getWidthFeeEquity.rel/100)):0},getTitleFreeEquity:function(){if(this.getPixelWidthFreeEquity)return this.getPixelWidthFreeEquity>=405?"".concat(this.$t("available_for_investment")," ").concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthFeeEquity.abs,2),")"):this.getPixelWidthFreeEquity<450&&this.getPixelWidthFreeEquity>220?"".concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthFeeEquity.abs,2),")"):"".concat(this.$moneyf(this.getWidthFeeEquity.rel,this.getWidthFeeEquity.rel<.01?5:2),"% ")},getTitleInvesting:function(){if(this.getWidthInvestingEquity)return this.getPixelWidthInvestingEquity>300?"".concat(this.$t("invested")," ").concat(this.$moneyf(this.getWidthInvestingEquity.rel,this.getWidthInvestingEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthInvestingEquity.abs,2),")"):this.getPixelWidthInvestingEquity<300&&this.getPixelWidthInvestingEquity>220?"".concat(this.$moneyf(this.getWidthInvestingEquity.rel,this.getWidthInvestingEquity.rel<.01?5:2),"% (").concat(this.getCurrencyChar).concat(this.$moneyf(this.getWidthInvestingEquity.abs,2),")"):"".concat(this.$moneyf(this.getWidthInvestingEquity.rel,this.getWidthInvestingEquity.rel<.01?5:2),"%")}}),methods:{onResize:function(t){this.wrapSize=t[0].contentRect.width}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}},QRt=XRt,JRt=(i("7987"),Object(C["a"])(QRt,zRt,YRt,!1,null,"7c13470e",null)),KRt=JRt.exports,ZRt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnaliticsTables"},[t.getPortfolios&&t.getPortfolios.length?e("div",{class:"AnaliticsTable AnaliticsTable_".concat(t.getActiveTheme)},[e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("portfolios")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("current_income")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("invested")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("for_closed_trades")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("success_rate")))])]),t._l(t.getDataTableForPrortfolios,(function(i,o){return e("div",{key:o,class:"AnaliticsTable-dataRow AnaliticsTable-dataRow_".concat(t.getActiveTheme),style:{color:t.colors.find((function(t){return t.id===i.id})).color}},[e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s(i.name))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.currentProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.investing,2)," / ").concat(i.investingPercent,"%")))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.closeProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("%".concat(Math.round(i.percentProfitCloseOrders))))])])})),e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s(t.$t("total_for_portfolios")))]),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountProfitsForPortfolio<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountProfitsForPortfolio,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"}),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountClosedProfitsForPortfolio<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountClosedProfitsForPortfolio,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"})])],2):t._e(),t.getProviders&&t.getProviders.length?e("div",{class:"AnaliticsTable AnaliticsTable_".concat(t.getActiveTheme)},[e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("providers_1")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("current_income")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("invested")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("for_closed_trades")))]),e("div",{staticClass:"AnaliticsTable-titleRow-title"},[t._v(t._s(t.$t("success_rate")))])]),t._l(t.getDataTableForProviders,(function(i,o){return e("div",{key:o,class:"AnaliticsTable-dataRow AnaliticsTable-dataRow_".concat(t.getActiveTheme),style:{color:t.colors.find((function(t){return t.id===i.id})).color}},[e("div",{staticClass:"AnaliticsTable-dataRow-itemAvatar"},[e("div",{staticClass:"AnaliticsTable-dataRow-itemAvatar-avatar"},[e("Avatar",{attrs:{src:i.avatar,theme:t.getActiveTheme,size:"2.4"}})],1),e("div",{staticClass:"AnaliticsTable-dataRow-itemAvatar-text"},[t._v(t._s(i.name))])]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.currentProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.investing,2)," / ").concat(i.investingPercent,"%")))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(i.closeProfit,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s("%".concat(Math.round(i.percentProfitCloseOrders))))])])})),e("div",{class:"AnaliticsTable-titleRow AnaliticsTable-titleRow_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-dataRow-item"},[t._v(t._s(t.$t("result_by_providers")))]),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountProfitsForProvider<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountProfitsForProvider,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"}),e("div",{staticClass:"AnaliticsTable-dataRow-item",style:{color:t.getCountClosedProfitsForProvider<0?this.getRedColor.color:this.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getCountClosedProfitsForProvider,2))))]),e("div",{staticClass:"AnaliticsTable-dataRow-item"})])],2):t._e(),e("div",{staticClass:"AnaliticsTable-absolutProfit",class:"AnaliticsTable-absolutProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"AnaliticsTable-absolutProfitTitle"},[t._v(t._s(t.$t("current_income")))]),e("div",{staticClass:"AnaliticsTable-absolutProfitData",style:{color:t.getAbsolutProfit<0?t.getRedColor.color:t.getGreenColor.color}},[t._v(t._s("".concat(t.getCurrencyChar).concat(t.$moneyf(t.getAbsolutProfit,2)," / ").concat(t.$moneyf(t.getAbsoluteRelProfit,Math.abs(t.getAbsoluteRelProfit)<.01?5:2),"%")))])])])},tWt=[],eWt={components:{Avatar:E},props:{colors:{type:Array}},data:function(){return{userOrders:null,openOrders:null}},mixins:[qe],watch:{getStatByOrders:function(t){t&&(this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.openOrders=this.userOrders.tradingOrders)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTheme:"headerSettings/getActiveTheme",getStatistics:"statistic/getStatistics",allSubscriptionCurrentDate:"subscriptionsContract/allSubscriptionCurrentDate",getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getInvestMoneyByPortfolios:function(){if(!this.getCreatedPortfolios||!this.getCreatedPortfolios.length)return 0;var t=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));return t.length?t.reduce((function(t,e){return t+e.investMoney}),0):0},getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},getFullEquityClose:function(){if(this.getStatistics)return this.getStatistics.accountDaily.length?this.getStatistics.accountDaily.at(-1).equityClose:this.getStatistics.account.equity},getAbsoluteRelProfit:function(){return this.getAbsolutProfit?100*this.getAbsolutProfit/this.getInvestMoneyByPortfolios:0},getInvestingPortfolios:function(){if(this.getCreatedPortfolios)return this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}))},getCountProfitsForPortfolio:function(){return this.getDataTableForPrortfolios&&this.getDataTableForPrortfolios.length?this.getDataTableForPrortfolios.reduce((function(t,e){return t+e.currentProfit}),0):0},getCountClosedProfitsForPortfolio:function(){return this.getDataTableForPrortfolios&&this.getDataTableForPrortfolios.length?this.getDataTableForPrortfolios.reduce((function(t,e){return t+e.closeProfit}),0):0},getCountClosedProfitsForProvider:function(){return this.getDataTableForProviders&&this.getDataTableForProviders.length?this.getDataTableForProviders.reduce((function(t,e){return t+e.closeProfit}),0):0},getAbsolutProfit:function(){return this.getCountProfitsForProvider+this.getCountProfitsForPortfolio},getCountProfitsForProvider:function(){return this.getDataTableForProviders&&this.getDataTableForProviders.length?this.getDataTableForProviders.reduce((function(t,e){return t+e.currentProfit}),0):0},getDataTableForPrortfolios:function(){if(this.getPortfolios&&this.getPortfolios.length&&this.userOrders&&this.openOrders)return this.getStatDataForTable(this.getPortfolios,"portfolio")},getDataTableForProviders:function(){if(this.getProviders&&this.getProviders.length&&this.userOrders&&this.openOrders)return this.getStatDataForTable(this.getProviders,"provider")},getProviders:function(){if(this.getInvestingPortfolios&&this.getInvestingPortfolios.length)return this.getInvestingPortfolios.filter((function(t){return"Signal"===t.type}))},getPortfolios:function(){if(this.getInvestingPortfolios&&this.getInvestingPortfolios.length)return this.getInvestingPortfolios.filter((function(t){return"Invest"===t.type||"InvestTop"===t.type}))}}),methods:{setMessageHendler:function(t){t&&t.command&&"AccountsDetails"===t.command&&(this.openOrders=t.data[0].openOrders.tradingOrders)},getSubscriptionsBySource:function(t){var e=this.allSubscriptionCurrentDate,i=e.filter((function(e){return e.subscription.bagId===t.id}));return i.length?i.map((function(t){return t.subscription.id})):[]},getStatDataForTable:function(t,e){var i=this,o=[];return t.forEach((function(t){var n=i.getSubscriptionsBySource(t),s=i.openOrders.filter((function(t){return n.some((function(e){return e===+t.subscriptionId}))})),r=s.length?s.reduce((function(t,e){return t+e.profit}),0):0,a=i.userOrders.closedOrders.filter((function(t){return n.some((function(e){return e===+t.subscriptionId}))})),c=a.length?a.reduce((function(t,e){return t+e.profit}),0):0,l=a.length?a.filter((function(t){return t.profit>0})):[],u=a.length&&l.length?100*l.length/a.length:0;o.push({avatar:"portfolio"===e?t.avatar:t.sources[0].userInfo.avatarURL,id:t.id,investing:t.investMoney,investingPercent:i.$moneyf(100*t.investMoney/i.getFullEquityClose,2),name:t.name,currentProfit:r+c,closeProfit:c,percentProfitCloseOrders:u})})),o}},mounted:function(){this.$socketStream.events.subscribe("apiWS",this.setMessageHendler),this.$orderStorage.getOrdersOnStorage()&&(this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.openOrders=this.userOrders.tradingOrders)},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},iWt=eWt,oWt=(i("9d5f"),Object(C["a"])(iWt,ZRt,tWt,!1,null,"ffa43294",null)),nWt=oWt.exports,sWt={props:{reports:{type:Boolean}},components:{AnaliticsAccount:NRt,AnaliticsProgressBar:KRt,AnaliticsSectorDiagram:qRt,AnaliticsTable:nWt},mixins:[yn,qe],data:function(){return{size:{width:0,height:0}}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios"})),{},{getCreatedPortfoliosCounts:function(){var t;return null===(t=this.getCreatedPortfolios)||void 0===t?void 0:t.length},getColorsInvestingPortfolios:function(){var t=this;if(!this.getCreatedPortfoliosCounts)return[];var e=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));return e.map((function(e,i){return{color:t.getSetRandomColors[i]?t.getSetRandomColors[i].color:rWt(),id:e.id}}))},getWrapWidth:function(){return this.size.width}}),methods:{onResize:function(t){this.size={height:t[0].contentRect.height,width:t[0].contentRect.width}}},mounted:function(){var t=this;this.$nextTick((function(){t.observerElem=t.$refs.wrap}))}};function rWt(){return"hsla(".concat(360*Math.random(),", 70%, 50%, 1)")}var aWt=sWt,cWt=(i("1081"),Object(C["a"])(aWt,MRt,$Rt,!1,null,"c0b83a96",null)),lWt=cWt.exports,uWt=function(){var t=this,e=t._self._c;return e("div",{ref:"wrap",class:"incomeEquityTab incomeEquityTab_".concat(t.getActiveTheme)},[e("div",{class:"incomeEquityTab-head incomeEquityTab-head_".concat(t.getActiveTheme)},[e("DxSelectBox",{attrs:{items:t.getTabsForYear,value:t.getTabsForYear.at(-1).year,"display-expr":"year","value-expr":"year","field-template":"field","item-template":"item",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1,dropDownOptions:{container:".incomeEquityTab"}},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{class:"incomeEquityTab-yearTab ".concat(t.activeYear===o.year?"incomeEquityTab-yearTab_isActive_".concat(t.getActiveTheme):"incomeEquityTab-yearTab_".concat(t.getActiveTheme)),style:{background:t.activeYear===o.year?"light"===t.getActiveTheme?"#2462db":"#00b9fc":o.color}},[t._v(t._s(o.year)),t.hoverIndexYear===o.year?e("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(o.profitAbs<0?"negative":"positive")},[e("div",[t._v("$ "+t._s(t.$moneyf(o.profitAbs,2)))]),e("div",[t._v("% "+t._s(t.$moneyf(o.profitRel,2)))])]):t._e(),e("DxTextBox",{attrs:{visible:!1}})],1)]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{class:"incomeEquityTab-yearTab ".concat(t.activeYear===o.year?"incomeEquityTab-yearTab_isActive_".concat(t.getActiveTheme):"incomeEquityTab-yearTab_".concat(t.getActiveTheme)),style:{background:t.activeYear===o.year?"light"===t.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{click:function(e){return t.setActiveYear(o.year)}}},[t._v(t._s(o.year))])]}}])}),e("div",{class:"incomeEquityTab-head incomeEquityTab-head_".concat(t.getActiveTheme)},[t.getListTabs&&t.getListTabs.length?e("div",{class:"incomeEquityTab-yearTabsList"},[e("DxSelectBox",{key:t.getListTabs.length,attrs:{items:t.getListTabs,placeholder:"",value:t.getListTabs.at(-1).title,"display-expr":"title","value-expr":"title","field-template":"field","item-template":"item",hoverStateEnabled:!1,focusStateEnabled:!1,activeStateEnabled:!1},scopedSlots:t._u([{key:"field",fn:function(i){var o=i.data;return[e("div",{class:"incomeEquityTab-yearTab ".concat(t.activeTabMonth===o.month?"incomeEquityTab-yearTab_isActive_".concat(t.getActiveTheme):"incomeEquityTab-yearTab_".concat(t.getActiveTheme)),style:{background:t.activeTabMonth===o.month?"light"===t.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{mouseenter:function(e){return t.setHoverIndex(o.month,"month")},mouseleave:function(e){return t.setHoverIndex(null,"month")}}},[t._v(t._s(o.title)),t.hoverIndexMonth===o.month?e("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(o.profitAbs<0?"negative":"positive")},[e("div",[t._v("$ "+t._s(t.$moneyf(o.profitAbs,2)))]),e("div",[t._v("% "+t._s(t.$moneyf(o.profitRel,2)))])]):t._e(),e("DxTextBox",{attrs:{visible:!1}})],1)]}},{key:"item",fn:function(i){var o=i.data;return[e("div",{class:"incomeEquityTab-yearTab ".concat(t.activeTabMonth===o.month?"incomeEquityTab-yearTab_isActive_".concat(t.getActiveTheme):"incomeEquityTab-yearTab_".concat(t.getActiveTheme)),style:{background:t.activeTabMonth===o.month?"light"===t.getActiveTheme?"#2462db":"#00b9fc":o.color},on:{click:function(e){return t.setActiveMonth(o.month)}}},[t._v(t._s(o.title))])]}}],null,!1,1615902957)})],1):t._e(),t._l(t.getLineTabs,(function(i,o){return e("div",{key:o,class:"incomeEquityTab-yearTab ".concat(t.activeTabMonth===i.month?"incomeEquityTab-yearTab_isActive_".concat(t.getActiveTheme):"incomeEquityTab-yearTab_".concat(t.getActiveTheme)),style:{background:t.activeTabMonth===i.month?"light"===t.getActiveTheme?"#2462db":"#00b9fc":i.color},on:{mouseenter:function(e){return t.setHoverIndex(i.month,"month")},mouseleave:function(e){return t.setHoverIndex(null,"month")},click:function(e){return t.setActiveMonth(i.month)}}},[t._v(t._s(i.title)),t.hoverIndexMonth===i.month?e("div",{class:"incomeEquityTab-hoverWidgetlastDates incomeEquityTab-hoverWidgetlastDates_".concat(t.getActiveTheme,"-").concat(i.profitAbs<0?"negative":"positive")},[e("div",[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.$moneyf(i.profitAbs,2))))]),e("div",[t._v("% "+t._s(t.$moneyf(i.profitRel,2)))])]):t._e()])}))],2),e("div",{staticClass:"incomeEquityTab-titleButtons"},[e("div",{class:"incomeEquityTab-titleButton ".concat("abs"!==t.type?"incomeEquityTab-titleButton_".concat(t.getActiveTheme):"incomeEquityTab-titleButton_isActive_".concat(t.getActiveTheme)),on:{click:function(e){return t.setTypeGistogramm("abs")}}},[e("svgIcon",{attrs:{name:"SortDollar"}})],1),e("div",{class:"incomeEquityTab-titleButton ".concat("rel"!==t.type?"incomeEquityTab-titleButton_".concat(t.getActiveTheme):"incomeEquityTab-titleButton_isActive_".concat(t.getActiveTheme)),on:{click:function(e){return t.setTypeGistogramm("rel")}}},[e("svgIcon",{attrs:{name:"new-procent-icon"}})],1)])],1),e("div",{staticClass:"incomeEquityTab-content"},[e("div",{class:t.widthWrap>=950?"incomeEquityTab-contentWrap":"incomeEquityTab-contentWrapDirection"},[e("div",{class:"incomeEquityTab-dataTable incomeEquityTab-dataTable_".concat(t.getActiveTheme),style:{maxHeight:t.widthWrap>=950?"100%":"30rem"}},[e("VuePerfectScrollbar",{staticClass:"incomeEquityTab-table"},[e("TableColumnsCustom",{key:t.widthWrap,attrs:{dataTable:t.getDataForTable,columns:t.getColumnsForTable,indexHoverRow:t.hoverIndex,stickyHeader:!0},scopedSlots:t._u([{key:"column",fn:function(i){var o=i.data,n=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell",style:{color:o.color}},[t._v(t._s(n))])]}},{key:"date",fn:function(i){var o=i.cellData;i.indexRow;return[e("div",{staticClass:"incomeEquityTab-tableCell"},[t._v(t._s(o))])]}}])})],1),e("div",{staticClass:"incomeEquityTab-absProfit",class:"incomeEquityTab-absProfit_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-absProfitData",style:{color:t.getMonthProfit<0?t.getRedColor.color:t.getGreenColor.color}},[e("div",{staticClass:"incomeEquityTab-absProfitDataIcon",style:{color:"up"===t.directionsMonthProfit?t.getGreenColor.color:t.getRedColor.color}},[e("svgIcon",{attrs:{name:"Arrow_".concat(t.directionsMonthProfit,"_direct"),size:14}})],1),e("div",{staticClass:"incomeEquityTab-absProfitAbs"},[t._v(t._s(t.getTotalMonthPercent))])]),e("div",{staticClass:"incomeEquityTab-absProfitTitle"},[e("div",{staticClass:"incomeEquityTab-absProfitTitleText",class:"incomeEquityTab-absProfitTitleText_".concat(t.getActiveTheme)},[t._v(t._s(t.$t("ipfm")))])])])],1),e("div",{ref:"chart",staticClass:"incomeEquityTab-chart"},[e("div",{staticClass:"incomeEquityTab-chartTitle"},t._l(t.getStatForTitleChart,(function(i,o){return t.getStatForTitleChart?e("div",{key:o,class:"incomeEquityTab-currentProfit incomeEquityTab-currentProfit_".concat(t.getActiveTheme),style:{color:o?t.getGreenColor.color:t.getBlueColor.color}},[e("div",{staticClass:"incomeEquityTab-currentProfit-arrow"},["down"===t.directions[o]?e("div",{style:{color:o?t.getRedColor.color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Arrow_down_direct"}})],1):e("div",{style:{color:o?t.getGreenColor.color:t.getBlueColor.color}},[e("svgIcon",{attrs:{name:"Arrow_up_direct"}})],1)]),e("div",{staticClass:"incomeEquityTab-currentProfit-data",class:"incomeEquityTab-currentProfit-data_".concat(t.getActiveTheme)},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(i.data)))]),e("div",{staticClass:"incomeEquityTab-currentProfit-title",class:"incomeEquityTab-currentProfit-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-currentProfit-text",class:"incomeEquityTab-currentProfit-text_".concat(t.getActiveTheme)},[t._v(t._s(i.label))])])]):t._e()})),0),e("div",{staticClass:"incomeEquityTab-lineChart"},[t.points?e("SectorLineEventChart",{key:t.points[0][0].y,attrs:{points:t.points,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForLines,minIndicator:{lines:[1]},maxIndicator:{lines:[1]},watermark:t.$t("equity_increase")},on:{hover:t.hoverPoint,clickPoint:t.hedlerClickChartPoint}}):t._e(),null!==t.hoverIndex?e("div",{class:"incomeEquityTab-hoverWidget incomeEquityTab-hoverWidget_".concat(t.getActiveTheme),style:t.positionHoverWidget},t._l(t.statsForHoverWidget,(function(i,o){return e("div",{key:o,class:"incomeEquityTab-hoverWidgetRow incomeEquityTab-hoverWidgetRow_".concat(t.getActiveTheme)},[e("div",{class:"incomeEquityTab-hoverWidgetLabel incomeEquityTab-hoverWidgetLabel_".concat(t.getActiveTheme)},[t._v(t._s(i.label))]),e("div",{class:"incomeEquityTab-hoverWidgetStat incomeEquityTab-hoverWidgetStat_".concat(t.getActiveTheme,"-").concat(i.color)},[t._v(t._s(i.stat))])])})),0):t._e(),e("DxPopup",{attrs:{visible:t.statusDayReport,shading:!1,width:360,height:800,maxHeight:"calc(100vh - 200px)",dragEnabled:!0,container:".userIncomeTab",dragOutsideBoundary:!0},scopedSlots:t._u([{key:"title",fn:function(){return[t.statusDayReport?e("UserProfileDayReportWidget",{attrs:{statDay:t.statDay,side:t.xWidthPoint>=360?"left":"right"},on:{close:t.closeReport}}):t._e()]},proxy:!0}])})],1),e("div",{staticClass:"incomeEquityTab-gistogrammChart"},[e("div",{class:"incomeEquityTab-gistogrammChart-title incomeEquityTab-gistogrammChart-title_".concat(t.getActiveTheme)},[e("div",{staticClass:"incomeEquityTab-gistogrammChart-text"},[t._v(t._s(t.$t("income_by_days")))])]),e("div",{staticClass:"incomeEquityTab-gistogrammChart-chart"},[t.pointsForGistogramm?e("GistogrammEventChart",{key:t.pointsForGistogramm[0][0].y,attrs:{points:t.pointsForGistogramm,theme:t.getActiveTheme,metaInfoForLines:t.getMetaInfoForGistogramm,minIndicator:{lines:[1]},maxIndicator:{lines:[1]}}}):t._e()],1)])])])])])},dWt=[],hWt={components:{TableColumnsCustom:p2,GistogrammEventChart:TI,SectorLineEventChart:Fj,VuePerfectScrollbar:Xt.a,UserProfileDayReportWidget:RB,DxPopup:xo.a,DxSelectBox:Bo.a,DxTextBox:rc.a},mixins:[qe,yn],data:function(){return{activeYear:null,activeTabMonth:null,statusDayReport:!1,widthWrap:0,statDay:null,points:null,pointsForGistogramm:null,accountId:null,hoverIndexYear:null,hoverIndexMonth:null,hoverIndex:null,directions:["up","up"],directionsMonthProfit:"up",positionHoverWidget:{top:"0px",right:"0px"},type:"abs",statsForHoverWidget:null}},watch:{getStatByPeriod:function(t){t&&this.setPointsForChart(t)},getMonthProfit:function(t,e){void 0===t&&void 0===e||(this.directionsMonthProfit=t1e4?0:2)," / %").concat(this.$moneyf(i,2))}},getStatByPeriod:function(){if(this.getStatistics&&null!==this.activeYear){var t=this.activeTabMonth,e=this.activeYear,i=this.getStatistics.accountDaily.filter((function(i){return new Date(i.date).getFullYear()===e&&new Date(i.date).getMonth()===t}));return i}},getDataForTable:function(){var t=this;if(this.getStatByPeriod)return this.getStatByPeriod.map((function(e){var i=e.equityClose-e.equityOpen,o=100*(e.equityClose-e.equityOpen)/e.equityOpen;return{date:"".concat(new Date(e.date).getDate()>9?new Date(e.date).getDate():"0".concat(new Date(e.date).getDate()),".").concat(new Date(e.date).getMonth()+1>9?new Date(e.date).getMonth()+1:"0".concat(new Date(e.date).getMonth()+1)),equity:t.$moneyf(e.equityClose,e.equityClose>1e4?0:2),profitDay:"".concat(t.getCurrencyChar," ").concat(t.$moneyf(i,Math.abs(i)>1e4?0:2),"/ %").concat(t.$moneyf(o,2)),color:i<0?t.getRedColor.color:t.getGreenColor.color,profitMonth:100*(e.equityClose-t.getStatByPeriod[0].equityOpen)/t.getStatByPeriod[0].equityOpen}}))},getMetaInfoForGistogramm:function(){if(this.pointsForGistogramm&&this.pointsForGistogramm[1].length){var t=this.pointsForGistogramm[1].findLastIndex((function(t){return void 0!==t.y}));return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:""},{type:"bar",color:this.pointsForGistogramm[1][t].y<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("income")}]}},getMetaInfoForLines:function(){if(this.points){var t=this.getStatByPeriod[0].equityOpen,e=this.getStatByPeriod.at(-1).equityClose-t,i=t&&e?100*e/t:0;return[{type:"line",color:this.getBlueColor.color,fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("eatbo")},{type:"line",color:e<0?this.getRedColor.color:this.getGreenColor.color,fill:this.getGreenColor.fill,positive:{color:this.getGreenColor.color,fill:this.getGreenColor.fill},negative:{color:this.getRedColor.color,fill:this.getRedColor.fill},fillIndicator:"dark"===this.getActiveTheme?"#314456":"#fff",label:"",lineWidth:3,title:this.$t("equity"),extandsIndicator:"rel"===this.type?"".concat(this.getCurrencyChar," ").concat(this.$moneyf(this.getStatByPeriod.at(-1).equityClose,0)):"".concat(this.$moneyf(i,2)," %")}]}},getColumnsForTable:function(){return[{title:this.$t("date"),field:"date",sortingEnabled:!1,cellTemplate:"date",width:"60px",align:"center"},{title:"".concat(this.getCurrencyChar,", ").concat(this.$t("equity")),field:"equity",sortingEnabled:!1,cellTemplate:"column",align:"center"},{title:this.$t("day"),field:"profitDay",sortingEnabled:!1,cellTemplate:"column",width:"170px",align:"center"}]},getLineTabs:function(){if(this.getMonthTabs){var t=Math.floor((this.widthWrap-102)/78);return t=this.getMonthTabs.length||t<0))return this.getMonthTabs.slice(0,this.getMonthTabs.length-t)}},getMonthTabs:function(){var t=this;if(this.getYearsStat&&null!==this.activeYear&&this.getTabsForYear)return this.getYearsStat[this.activeYear].map((function(e){return{title:t.$t("mounthArr")[e.month],month:e.month,profitAbs:e.profitAbs,profitRel:e.profitRel,color:e.profitAbs<0?t.getRedColor.color:t.getGreenColor.color}}))},getStatForTitleChart:function(){if(this.getStatByPeriod)return[{label:this.$t("balance"),data:this.$moneyf(this.getStatByPeriod.at(-1).balanceClose,2),color:"blue"},{label:this.$t("equity"),data:this.$moneyf(this.getStatByPeriod.at(-1).equityClose,2),color:"green"}]}}),methods:{closeReport:function(){this.statusDayReport=!1},setTypeGistogramm:function(t){this.type=t,this.setPointsForChart(this.getStatByPeriod)},hedlerClickChartPoint:function(t){var e=this.getStatistics.accountDaily.find((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()})),i=this.getStatistics.accountDaily.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}));this.statDay={index:i,statDay:e},this.statusDayReport=!0},hoverPoint:function(t){if(t){var e=this.$refs.chart.clientWidth-t.cPointX,i=this.$refs.chart.clientHeight-t.cPointY;this.positionHoverWidget={top:"".concat(i>54?Math.round(t.cPointY-5):Math.round(t.cPointY-59),"px"),left:"".concat(e>140?t.cPointX+8:t.cPointX-148,"px")};var o=this.getStatByPeriod.find((function(e){return e.date===t.point.date})),n=this.getStatByPeriod[0].equityOpen,s=o.equityClose-n,r=n&&s?100*s/n:0,a=o.equityClose-o.equityOpen,c=a&&o.equityOpen?100*a/o.equityOpen:0;o&&(this.statsForHoverWidget=[{label:this.$t("balance"),stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(o.balanceClose)),color:"blue"},{label:this.$t("equity"),stat:"".concat(this.getCurrencyChar," ").concat(this.$moneyf(o.equityClose)),color:"green"},{label:"P/L ".concat(this.$t("day"),", %"),stat:"% ".concat(this.$moneyf(c,c<.01?3:2)),color:a<0?"red":"green"},{label:"P/L ".concat(this.$t("month"),", %"),stat:"% ".concat(this.$moneyf(r,r<.01?3:2)),color:r<0?"red":"green"},{label:this.$t("date"),stat:new Date(o.date).toLocaleDateString("ru"),color:r<0?"red":"green"}]),this.hoverIndex=this.getStatByPeriod.findIndex((function(e){return new Date(e.date).getTime()===new Date(t.point.date).getTime()}))}else this.hoverIndex=null},setHoverIndex:function(t,e){"year"===e?this.hoverIndexYear=t:this.hoverIndexMonth=t},setActiveMonth:function(t){this.activeTabMonth=t},setActiveYear:function(t){this.activeYear=t,this.activeTabMonth=this.getYearsStat[t].at(-1).month},setPointsForChart:function(t){for(var e=this,i=new Date(t[0].date).daysInMonth(),o=t[0].equityOpen,n=this.activeTabMonth,s=this.activeYear,r=[],a=0;a=0?"green":"red"}},rootClass:function(){return[this.profit.dopClass,Object(c["a"])({},this.darkClass)]}})},MWt=BWt,$Wt=(i("450c"),Object(C["a"])(MWt,kWt,IWt,!1,null,"00d9c02a",null)),LWt=$Wt.exports,FWt=i("9cfb"),jWt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyProfitPortfolio",class:t.rootClass},[t._v(t._s(t.myProfit.valueFormatted))])},RWt=[],WWt={name:"MyProfitPortfolio",mixins:[xt],props:{cellData:{type:Object},userOrders:{type:[Boolean,Object]}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{profit:function(){var t=this,e=this.fullListSubscription.filter((function(e){return e.subscription.bagId===t.cellData.id})),i=e.map((function(t){return t.subscription.id})),o=this.userOrders.closedOrders.filter((function(t){return i.includes(+t.subscriptionId)}));return o.length?o.reduce((function(t,e){return t+e.profit}),0):0},myProfit:function(){if(!this.profit)return{value:0,valueFormatted:"$ 0"};if("Money"===this.cellData.bagContents[0].priceType||this.profit<=0)return{value:this.profit,valueFormatted:"$ ".concat(Lm(this.profit,2,!0))};var t=this.cellData.bagContents.reduce((function(t,e){return t+e.price}),0);if(0===t)return{value:this.profit,valueFormatted:"$ ".concat(Lm(this.profit,2,!0))};var e=t/this.cellData.bagContents.length,i=this.profit*e/100;return{value:this.profit-i,valueFormatted:"$ "+Lm(this.profit-i,2,!0)}},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{red:this.myProfit.value<0})}}),watch:{},mounted:function(){},destroyed:function(){},methods:{}},NWt=WWt,EWt=(i("b855"),Object(C["a"])(NWt,jWt,RWt,!1,null,"4d493bf7",null)),UWt=EWt.exports,VWt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SfCommissionPortfolio",class:t.darkClass},[t._v(t._s(t.value))])},HWt=[],GWt={name:"SfCommissionPortfolio",mixins:[xt],props:{cellData:{type:Object},userOrders:{type:[Boolean,Object]}},components:{},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({fullListSubscription:"subscriptionsContract/fullListSubscription"})),{},{profit:function(){var t=this,e=this.fullListSubscription.filter((function(e){return e.subscription.bagId===t.cellData.id})),i=e.map((function(t){return t.subscription.id})),o=this.userOrders.closedOrders.filter((function(t){return i.includes(+t.subscriptionId)}));return o.length?o.reduce((function(t,e){return t+e.profit}),0):0},value:function(){if("Money"===this.cellData.bagContents[0].priceType){var t=this.cellData.bagContents.reduce((function(t,e){return t+e.price}),0);return"FIX $ ".concat(t)}var e=this.cellData.bagContents.reduce((function(t,e){return t+e.price}),0),i=e?e/this.cellData.bagContents.length:0,o=this.profit*i/100;return"$ ".concat(Lm(o,2,!0)," (SF ").concat(Lm(i,1,!0),"%)")}})},qWt=GWt,zWt=(i("c3d8"),Object(C["a"])(qWt,VWt,HWt,!1,null,"d37700f6",null)),YWt=zWt.exports,XWt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SearchAndFilter",class:t.darkClass},[e("DxSelectBox",{attrs:{items:t.contractsList,width:100,height:32,elementAttr:{class:"selectBoxPercent"},hoverStateEnabled:!1,value:t.contractsList[0],"drop-down-options":t.getDropDownOptions},on:{"value-changed":t.onValueChanged}}),e("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.valueInput,expression:"valueInput",modifiers:{trim:!0}}],staticClass:"searchInput",attrs:{type:"text",placeholder:"Поиск по имени..."},domProps:{value:t.valueInput},on:{input:function(e){e.target.composing||(t.valueInput=e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}})],1)},QWt=[],JWt={name:"SearchAndFilter",mixins:[xt],props:{searchValue:{type:String},contractsList:{type:Array}},components:{DxSelectBox:Bo.a},data:function(){return{valueInput:""}},computed:{getDropDownOptions:function(){return{wrapperAttr:{class:"vp_listDropdown ".concat(this.darkClass.dark?"dark":"")}}}},watch:{valueInput:function(t){var e=this;setTimeout((function(){t===e.valueInput&&e.$emit("setSearchValue",t)}),1e3)}},methods:{onValueChanged:function(t){this.$emit("setContract",t.value)}}},KWt=JWt,ZWt=(i("edba"),i("80a9"),Object(C["a"])(KWt,XWt,QWt,!1,null,"e0ad5714",null)),tNt=ZWt.exports,eNt={name:"HistoryInvest",mixins:[xt],components:{TableColumnsCustom:p2,NamePortfolio:TWt,DatePeriod:DWt,ProfitPortfolio:LWt,MyProfitPortfolio:UWt,SfCommissionPortfolio:YWt,InstrumentsPortfolio:FWt["default"],ContractData:q$,SearchAndFilter:tNt,TablePagination:Ult},data:function(){return{searchValue:"",currentContract:"",pageSize:[25,50],currentCount:25,currentPage:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getHistoryPortfolios:"expertsPortfolio/getHistoryPortfolios"})),{},{columns:function(){return[{title:"Дата",field:"date",align:"left",cellTemplate:"cell-date-period",sortFunction:function(t){return new Date(t.stopDateTime).getTime()}},{title:"Портфель",field:"name",align:"left",cellTemplate:"cell-name-portfolio"},{title:"Инструменты",field:"instruments",align:"center",sortingEnabled:!1,cellTemplate:"cell-instruments-portfolio"},{title:"Доход порфеля, $/%",field:"profit",align:"center",cellTemplate:"cell-profit-portfolio"},{title:"Мой доход, $/%",field:"profitPercent",align:"center",cellTemplate:"cell-myProfit-portfolio"},{title:"Комиссия за управление",field:"sfCommission",align:"center",cellTemplate:"cell-portfolio-sf-commission"}]},contractsList:function(){var t=[];return this.getHistoryPortfolios.forEach((function(e){t.push.apply(t,Object(x["a"])(e.sources.map((function(t){return t.contract}))))})),["Все"].concat(Object(x["a"])(new Set(t)))},dataTable:function(){var t=this,e=Object(x["a"])(this.getHistoryPortfolios).sort((function(t,e){return new Date(e.stopDateTime).getTime()-new Date(t.stopDateTime).getTime()}));return this.searchValue&&(e=e.filter((function(e){return e.name.toLowerCase().includes(t.searchValue.toLowerCase())}))),this.currentContract&&this.currentContract!==this.contractsList[0]?e.filter((function(e){return!!e.sources.find((function(e){return e.contract===t.currentContract}))})):e},isPagination:function(){return this.getHistoryPortfolios.length>this.pageSize[0]},pageCount:function(){var t;return Math.ceil((null===(t=this.dataTable)||void 0===t?void 0:t.length)/this.currentCount)},dataTableLength:function(){var t;return null===(t=this.dataTable)||void 0===t?void 0:t.length}}),methods:{setCount:function(t){this.currentCount=t},setPage:function(t){this.currentPage=t},setSearchValue:function(t){this.searchValue=t.trim(),this.currentPage=0},setContract:function(t){this.currentContract=t,this.currentPage=0}}},iNt=eNt,oNt=(i("b224"),Object(C["a"])(iNt,mWt,vWt,!1,null,"f0cc9300",null)),nNt=oNt.exports;function sNt(t){return{accountId:t[0],date:t[1],contract:t[2],volumeOpen:t[3],volumeClose:t[4],profitOpen:t[5],profitClose:t[6],floatingProfitOpen:t[7],floatingProfitClose:t[8],usedVolume:t[9],closedCount:t[10],pClosedCount:t[11],forecast:t[12],equity:t[13],sharp:t[14],isFake:t[15],pip:t[16],margin:t[17],leverage:t[18],floatingPip:t[19]}}var rNt,aNt={name:"MyInvestContent",mixins:[xt,Ot],props:{createPortfolio:{type:Boolean},currentPage:{type:String},commonStatisticsPortfolios:{default:null},commonNowStatisticsPortfolios:{default:null}},components:{ProfitMyInvestings:wRt,Strategies:Dnt,UserProfileIncomeEquityTab:fWt,AnaliticsPortfolio:lWt,GraphBlocks:D$t,ExpandGraphBlock:aRt,AdaptiveTabBlock:$1,ComparingPortfolio:E$t,HistoryInvest:nNt,DayInvestingStat:BRt},data:function(){return{timeStamp:0,isLoadingStat:!1,isLoadingPortfolioStat:!0,expertsByFindPortfolio:{myStat:[],statSubs:[]},refContainer:null,serverTime:null,timeOut:null}},watch:{getActiveTab:function(t){t&&(this.isLoadingPortfolioStat=!0,this.$store.commit("expertsPortfolio/setIsLoadingStatData",!0),this.expertsByFindPortfolio={myStat:[],statSubs:[]},this.getStatisticData())},getStatusBag:function(t,e){if(t&&e){if(this.isLoadingPortfolioStat=!0,this.$store.commit("expertsPortfolio/setIsLoadingStatData",!0),this.expertsByFindPortfolio={myStat:[],statSubs:[]},this.isLoadingStat)return;this.getStatisticData()}},getServerTime:function(t){var e=this;if(t){if(!this.serverTime)return void(this.serverTime=t.now);new Date(this.serverTime).getHours()!==new Date(t.now).getHours()&&(this.serverTime=t.now,this.findPortfolio&&setTimeout((function(){e.isLoadingPortfolioStat=!0,e.expertsByFindPortfolio={myStat:[],statSubs:[]},e.getStatByPortfolio()}),12e4))}},isLoadingPortfolioStat:function(t){t||(this.$store.commit("statDataForPortfolio/setStatData",this.expertsByFindPortfolio),this.$store.commit("expertsPortfolio/setIsLoadingStatData",!1))},getCreatedPortfolios:function(t){var e=this;t.length>0&&!this.refContainer&&this.$nextTick((function(){e.refContainer=e.$refs.container}))}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatusPortfolio:"expertsPortfolio/getStatusPortfolio",findPortfolio:"expertsPortfolio/findPortfolio",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getTabsForInvesting:"subscriptionsContract/getTabsForInvesting",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTab:"expertsPortfolio/getActiveTab",getServerTime:"serverTime/getServerTime",getSession:"auth/getSession",api:"api/api"})),{},{getStatusBag:function(){if(this.findPortfolio)return this.findPortfolio.status},getPropsForComponents:function(){var t={ProfitMyInvestings:{commonStatisticsPortfolios:this.commonStatisticsPortfolios,commonNowStatisticsPortfolios:this.commonNowStatisticsPortfolios},ComparingPortfolio:{commonStatisticsPortfolios:this.commonStatisticsPortfolios,commonNowStatisticsPortfolios:this.commonNowStatisticsPortfolios},DayInvestingStat:{commonStatisticsPortfolios:this.commonStatisticsPortfolios,commonNowStatisticsPortfolios:this.commonNowStatisticsPortfolios},ExpandGraphBlock:null,AnaliticsPortfolio:null,UserProfileIncomeEquityTab:null,HistoryInvest:null,GraphBlocks:null,Strategies:null};return t[this.currentComponent]},currentComponent:function(){if(!this.getActiveTab&&"strategies"===this.currentPage)return"Strategies";switch(this.currentPage){case"comparingPortfolio":return"ComparingPortfolio";case"ExpandGraphBlock":return"ExpandGraphBlock";case"analiticsPortfolio":return"AnaliticsPortfolio";case"UserProfileIncomeEquityTab":return"UserProfileIncomeEquityTab";case"historyInvest":return"HistoryInvest";case"profitMyInvesting":return"ProfitMyInvestings";case"DayInvestingStat":return"DayInvestingStat";default:if(this.getActiveTab)return"GraphBlocks"}}}),methods:{getProfitOrdersPercentByContract:function(t){if(t&&t.length){var e=t.at(-1)[10],i=t.at(-1)[11];return e?Math.ceil(100/(e/i)):0}},iAmProvider:function(t){var e=[];if(0===this.getDefaultAccount.source.length)return[];var i=this.getDefaultAccount.source;return i.includes(t)&&e.push(t),e},setStatPortfolio:function(t){var e=this;if(this.expertsByFindPortfolio={statSubs:[],myStat:[],nowMyStat:null},t[0]&&t[0].length?t[0][0][1].forEach((function(t){var i=t[0];t[1].forEach((function(o){var n=o[0],s=e.findPortfolio.sources.find((function(t){return t.accountId===n}));e.expertsByFindPortfolio.statSubs.push({data:o[1].map((function(t){return $W(t)})),sequenceId:s.accountSequenceId,accountGroupCode:s.accountGroupCode,uniqueId:n+i,login:n,avatar:s.userInfo.avatarURL,symbol:i,profitOrdersPercent:e.getProfitOrdersPercentByContract(t[1]),traderName:"".concat(s.userInfo.firstName," ").concat(s.userInfo.lastName||""),iAmProvider:e.iAmProvider(i),status:!0})}))})):this.expertsByFindPortfolio.statSubs=[],t[1]&&t[1].length?t[1][0][1].forEach((function(t){var i=t[0];t[1].forEach((function(o){var n=o[0],s=e.findPortfolio.sources.find((function(t){return t.accountId===n}));e.expertsByFindPortfolio.myStat.push({data:o[1].map((function(t){return $W(t)})),sequenceId:s.accountSequenceId,accountGroupCode:s.accountGroupCode,uniqueId:n+i,login:n,avatar:s.userInfo.avatarURL,symbol:i,profitOrdersPercent:e.getProfitOrdersPercentByContract(t[1]),traderName:"".concat(s.userInfo.firstName," ").concat(s.userInfo.lastName||""),iAmProvider:e.iAmProvider(i),status:!0})}))})):this.expertsByFindPortfolio.myStat=[],t[2]&&t[2].length){var i=t[2].map((function(t){return sNt(t)})),o=i.reduce((function(t,e){return t+e.profitClose}),0),n=i.reduce((function(t,e){return t+e.floatingProfitClose}),0)+o;this.expertsByFindPortfolio.nowMyStat={profitClose:o,profitAbs:n}}else this.expertsByFindPortfolio.nowMyStat=null},getStatisticData:function(){this.getActiveTab&&this.findPortfolio&&this.getStatByPortfolio()},getStatByPortfolio:function(){this.isLoadingStat=!0;var t={command:"ContractStatisticsByInvestBags",method:"get",data:{requestId:this.findPortfolio.id,InvestBagIds:[this.findPortfolio.id],IsStoredData:"Stoped"===this.getStatusBag,StatisticType:"Active"===this.getStatusBag||"Stoped"===this.getStatusBag?0:1}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHandler:function(t){if("ContractStatisticsByInvestBags"===(null===t||void 0===t?void 0:t.command)&&this.getActiveTab&&!this.currentPage){if(t.requestId!==this.findPortfolio.id)return;if(this.isLoadingPortfolioStat=!1,this.isLoadingStat=!1,localStorage.getItem("controlButtonGetStatistic"))return;this.setStatPortfolio(JSON.parse(t.data))}}},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)},mounted:function(){this.getActiveTab&&"profitMyInvesting"!==this.currentPage&&this.getStatisticData(),this.$socketStream.$on("apiWS3",this.setMessageHandler),this.refContainer=this.$refs.container,this.getServerTime&&(this.serverTime=this.getServerTime.now)}},cNt=aNt,lNt=(i("a4d8"),Object(C["a"])(cNt,AMt,DMt,!1,null,"ae7ec24e",null)),uNt=lNt.exports,dNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TopButtonsBlock",class:t.darkClass},[t.isVisibleBlock?e("div",{staticClass:"containerAdaptiveTabBlock"},[e("div",{staticClass:"wrapButton buttonComparison"},[e("div",{staticClass:"buttonBlock",staticStyle:{"margin-right":"0.4rem"}},[e("ButtonIconFlat",{attrs:{modifier:{class:["buttonGroup","profitMyInvesting"===t.currentPage?"buttonGroup_isActive_".concat(t.getActiveTheme):"buttonGroup_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.goToPage("profitMyInvesting")},mouseenter:function(e){t.viewTooltipHandler(e,t.$t("tioi"))},mouseleave:t.hideTooltip}},[t._v(t._s(t.$t("portfolio")))]),e("ButtonIconFlat",{attrs:{icon:{name:"TimePeriod_2D"},modifier:{class:["buttonGroup","DayInvestingStat"===t.currentPage?"buttonGroup_isActive_".concat(t.getActiveTheme):"buttonGroup_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.goToPage("DayInvestingStat")},mouseenter:function(e){t.viewTooltipHandler(e,t.$t("soift"))},mouseleave:t.hideTooltip}}),e("ButtonIconFlat",{attrs:{icon:{name:"Compare"},modifier:{class:["buttonGroup","comparingPortfolio"===t.currentPage?"buttonGroup_isActive_".concat(t.getActiveTheme):"buttonGroup_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.goToPage("comparingPortfolio")},mouseenter:function(e){t.viewTooltipHandler(e,t.$t("comparison_of_investments"))},mouseleave:t.hideTooltip}}),e("ButtonIconFlat",{attrs:{icon:{name:"PrirostSredstv"},modifier:{class:["buttonGroup","UserProfileIncomeEquityTab"===t.currentPage?"buttonGroup_isActive_".concat(t.getActiveTheme):"buttonGroup_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.goToPage("UserProfileIncomeEquityTab")},mouseenter:function(e){t.viewTooltipHandler(e,t.$t("equity_increase"))},mouseleave:t.hideTooltip}}),e("ButtonIconFlat",{attrs:{icon:{name:"DataGraph_Data"},modifier:{class:["buttonGroup","analiticsPortfolio"===t.currentPage?"buttonGroup_isActive_".concat(t.getActiveTheme):"buttonGroup_".concat(t.getActiveTheme)]}},on:{click:function(e){return t.goToPage("analiticsPortfolio")},mouseenter:function(e){t.viewTooltipHandler(e,t.$t("statistics_on_investments"))},mouseleave:t.hideTooltip}})],1)]),e("div",{ref:"container",staticClass:"adaptiveBlockContainer adaptiveBlockContainer_main",on:{mouseleave:t.mouseleaveHandler}},[t.refContainer?e("AdaptiveLineButtons",{key:t.buttonsArray.length,attrs:{idDropDown:"investList",tabsSet:t.buttonsArray,refTabWrapper:t.refContainer},on:{mouseenter:t.mouseenterHandler,setActiveTab:t.setActiveTab},scopedSlots:t._u([{key:"default",fn:function(i){var o=i.data;return[e("ViewButton",{attrs:{buttonData:o,getListInvestPortfolios:t.getListInvestPortfolios}})]}}],null,!1,1240772430)}):t._e()],1)]):t._e(),e("div",{staticClass:"buttonsRight"},[e("div",{staticClass:"wrapButton history"},[e("ButtonIconFlat",{attrs:{icon:{name:"Provider"},modifier:{class:["button",t.strategyStatus?"button-Active_".concat(t.getActiveTheme):"button_".concat(t.getActiveTheme)]}},on:{click:t.setStrategyStatus}})],1),e("div",{staticClass:"wrapButton history"},[e("ButtonIconFlat",{attrs:{icon:{name:"Tops2"},modifier:{class:["button",t.topsStatus?"button-Active_".concat(t.getActiveTheme):"button_".concat(t.getActiveTheme)]}},on:{click:t.setTopsStatus}})],1),e("div",{staticClass:"wrapButton gotoviePortfeli",on:{mouseenter:function(e){return t.viewTooltip(".gotoviePortfeli")},mouseleave:t.hideTooltip}},[e("ButtonIconFlat",{attrs:{icon:{name:t.getLeftAndRightSidebarsStatus?"UnExpand-bottom-blocks":"Expand-bottom-blocks"},modifier:{class:["TopButtonsBlock_resize","TopButtonsBlock_resize_".concat(t.getActiveTheme)]}},on:{toggle:t.closeAllSideBars}})],1)]),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:200,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.text))]),t.popupVisible||t.controlVisible||t.loadingCopyControlButtons?e("DxPopup",{attrs:{visible:t.popupVisible||t.controlVisible||t.loadingCopyControlButtons,"drag-enabled":!1,closeOnOutsideClick:!1,"show-title":!1,position:t.positionPopup,shading:!1,width:250,height:"auto",container:"body",wrapperAttr:t.wrapperAttrPopup},on:{hidden:t.hidePopup}},[e("ControlButtons",{attrs:{dataButton:t.dataHoverButton},on:{hidden:t.hidePopup,mouseenter:t.mouseenterControlHandler,mouseleave:t.mouseleaveControlHandler,setDataModalPortfolio:t.setDataModalPortfolio,setLoadingCopyControlButtons:t.setLoadingCopyControlButtons}})],1):t._e(),t.visibleModalPortfolioExperts?e("ModalPortfolioExperts",{attrs:{portfolio:!0,providerCopy:"Signal"===t.findPortfolioSelected.type,findPortfolioSelected:t.findPortfolioSelected,expertsByFindPortfolio:t.expertsByFindPortfolio,visiblePopup:t.visibleModalPortfolioExperts,closeModal:t.hiddenModalPortfolioExperts},on:{hidden:t.hiddenModalPortfolioExperts}}):t._e()],1)},hNt=[],pNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ViewButton",class:t.rootClass,style:{background:t.getBackgroundForView}},[e("div",{staticClass:"text"},[e("div",{staticClass:"avatarsBlock"},[t._l(t.avatarsSlice,(function(i,o){return e("div",{key:o,staticClass:"avatarsBlock-item"},[e("Avatar",{attrs:{size:"2.4",src:i,theme:t.getActiveTheme}})],1)})),t.dopAvatars?e("div",{staticClass:"dopAvatar"},[t._v("+"+t._s(t.dopAvatars))]):t._e()],2),e("div",{staticClass:"textWrap"},[t._v(t._s(t.buttonData.text))]),t.activePortfolio?e("div",{staticClass:"dopData",class:{downArrow:t.profitPortfolio.value<0}},[e("svgIcon",t._b({},"svgIcon",t.iconArrow,!1)),e("div",{staticClass:"dataNum"},[e("div",{staticClass:"money",class:t.profitPortfolio.dopClass},[t._v(t._s("".concat(t.getCurrencyChar," ").concat(t.profitPortfolio.valueFormatted)))]),e("div",{staticClass:"percent",class:t.profitPortfolio.dopClass},[t._v(t._s(t.percent)+" %")])])],1):t._e()])])},gNt=[],fNt={name:"ViewButton",mixins:[xt,rT,qe],props:{buttonData:{type:Object},getListInvestPortfolios:{type:Array}},components:{Avatar:E},data:function(){return{intervalID:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getDefaultAccount:"subscribeOrders/getDefaultAccount",getActiveTheme:"headerSettings/getActiveTheme"})),{},{getCurrencyChar:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.currencyChar},rootClass:function(){return Object(c["a"])({myActivePortfolio:this.buttonData.dopClass,active:this.buttonData.isActive},this.darkClass)},findPortfolio:function(){var t=this;return this.getCreatedPortfolios.find((function(e){return e.id===t.buttonData.component}))},avatars:function(){var t=this.findPortfolio.sources.map((function(t){var e=t.userInfo.avatarURL;return"User-profile.png"===e&&(e=i("81bc")),e}));return Array.from(new Set(t))},avatarsSlice:function(){return this.avatars.slice(0,3)},dopAvatars:function(){var t=this.avatars.length-3;return!(t<=0)&&t},activePortfolio:function(){return"Active"===this.buttonData.status},iconArrow:function(){var t=this.darkClass.dark?"#00ffac":"#008e72";return this.profitPortfolio.value<0&&(t=this.darkClass.dark?"#fa4c4a":"#E91212"),{name:"Arrow-micro-top",color:t}},profitPortfolio:function(){var t=this;if(!this.activePortfolio||!Array.isArray(this.getListInvestPortfolios))return{value:0,valueFormatted:0,dopClass:"green"};var e=this.getListInvestPortfolios.find((function(e){return e.id===t.buttonData.component}));if(!e)return{value:0,valueFormatted:0,dopClass:"green"};var i=e.profitAbs;return{value:i,valueFormatted:Lm(i,2,!0),dopClass:i>=0?"green":"red"}},getBackgroundForView:function(){return"Active"===this.buttonData.status?this.getGreenColor.fill:"Created"===this.buttonData.status?this.getBlueColor.blue:this.getRedColor.fill},percent:function(){var t=this.profitPortfolio.value,e=this.findPortfolio.investMoney,i=100*t/e;return 0===i?0:Math.abs(i)<.01?.01:Lm(i,2,!0)}}),methods:{mouseenterHandler:function(t){var e=this;clearInterval(this.intervalID),this.intervalID=setTimeout((function(){e.mouseEnterFunction(t,{imageForSource:e.buttonData.avatarURL,nameSource:e.buttonData.text,accountId:e.buttonData.login,sequenceId:e.buttonData.sequenceId,noActiveButton:!0,locationCall:e.location,position:"right"})}),1500)},mouseleaveHandler:function(){clearInterval(this.intervalID),this.mouseLeaveFunction()}}},mNt=fNt,vNt=(i("98d4"),Object(C["a"])(mNt,pNt,gNt,!1,null,"6e632a22",null)),yNt=vNt.exports,CNt={data:function(){return{openOrders:null,investPortolios:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{getListInvestPortfolios:function(){var t=this;if(this.investPortolios&&this.investPortolios[1]){var e=Object(x["a"])(new Set(this.investPortolios[1].map((function(t){return t[0]})))),i=[];return e.forEach((function(e){var o=t.investPortolios[1].filter((function(t){return t[0]===e})).map((function(t){return t[1]})),n=t.investPortolios[1].find((function(t){return t[0]===e}))[2],s=t.investPortolios[1].find((function(t){return t[0]===e}))[3],r=t.investPortolios[0]&&t.investPortolios[0].length?t.investPortolios[0].filter((function(t){return t[0]===e})).map((function(t){return t[3]})).reduce((function(t,e){return t+e}),0):0,a=t.openOrders&&t.openOrders.length?t.getProfitPrortfolio(o):0;i.push({id:e,subs:o,name:n,avatar:s,profitClose:r,profitAbs:a+r})})),i}}}),watch:{getDefaultAccount:function(t){t&&!this.getLeftSideBar&&this.getInvestorStat()}},methods:{getInvestorStat:function(){var t={command:"GetInvestorStatisticByContract",data:{id:this.getDefaultAccount.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHandler:function(t){if("GetInvestorStatisticByContract"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);e&&e[0]&&e[1]&&(this.investPortolios=JSON.parse(t.data))}else"AccountsDetails"===(null===t||void 0===t?void 0:t.command)&&(this.openOrders=t.data[0].openOrders.tradingOrders)},getProfitPrortfolio:function(t){var e=this.openOrders.filter((function(e){return t.some((function(t){return+e.subscriptionId===t}))}));if(!e.length)return 0;var i=e.reduce((function(t,e){return t+e.profit}),0);return i}},mounted:function(){if(this.$socketStream.events.subscribe("apiWS3",this.setMessageHandler),this.$socketStream.events.subscribe("apiWS",this.setMessageHandler),this.getDefaultAccount&&!this.getLeftSideBar&&this.getInvestorStat(),this.$orderStorage.getOrdersOnStorage()){var t=this.$orderStorage.getOrdersOnStorage();this.openOrders=t.tradingOrders}},destroyed:function(){this.$socketStream.events.unsubscribe("apiWS3",this.setMessageHandler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHandler)}},bNt=function(t,e){return function(){var i=arguments,o=this;clearInterval(rNt),rNt=setTimeout((function(){t.apply(o,i)}),e)}},SNt={name:"TopButtonsBlock",mixins:[Ot,xt,CNt],props:{currentPage:{type:String},strategyStatus:{type:Boolean},topsStatus:{type:Boolean}},components:{AdaptiveTabBlock:$1,ViewButton:yNt,DxPopup:To["DxPopup"],AdaptiveLineButtons:Jg,ControlButtons:R9,ModalPortfolioExperts:JU},data:function(){return{popupVisible:!1,visibleModalPortfolioExperts:!1,expertsByFindPortfolio:[],findPortfolioSelected:[],controlVisible:!1,dataHoverButton:null,target:null,prevCurrentPage:"",refContainer:null,reports:!1,text:"",loadingCopyControlButtons:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActiveTheme:"headerSettings/getActiveTheme",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",findPortfolio:"expertsPortfolio/findPortfolio",getActiveTab:"expertsPortfolio/getActiveTab",isLoadingStatData:"expertsPortfolio/isLoadingStatData",getRightSideBar:"userSettings/getRightSideBar",getLeftSideBar:"userSettings/getLeftSideBar"})),{},{getLeftAndRightSidebarsStatus:function(){return!this.getRightSideBar&&!this.getLeftSideBar},getStatusBag:function(){if(this.findPortfolio)return this.findPortfolio.status},isVisibleBlock:function(){var t;return(null===(t=this.getCreatedPortfolios)||void 0===t?void 0:t.length)>0},buttonsArray:function(){var t=this;return this.getCreatedPortfolios.map((function(e){var i="Signal"===e.type;return{provider:i,avatarURL:e.avatar,login:e.sources[0].accountId,sequenceId:e.sources[0].accountSequenceId,idBtn:Math.random().toString(36).substring(7),text:e.name,component:e.id,disabled:t.isLoadingStatData,isActive:t.getActiveTab===e.id&&"profitMyInvesting"!==t.currentPage&&"analiticsPortfolio"!==t.currentPage&&"UserProfileIncomeEquityTab"!==t.currentPage&&"comparingPortfolio"!==t.currentPage&&"DayInvestingStat"!==t.currentPage,minWidth:i?40:135,status:e.status,dopClass:["Active","Pause"].includes(e.status)?"activePortfolio prov_".concat(e.id):"prov_".concat(e.id)}}))},classForButtonHistoryInvest:function(){return["buttonCustom",{active:"historyInvest"===this.currentPage}]},classForButtonComparePortfolio:function(){return["buttonCustom",{active:"comparingPortfolio"===this.currentPage}]},iconHistory:function(){return{name:"History",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},positionPopup:function(){return{my:"top center",at:"bottom center",of:this.target}},wrapperAttrPopup:function(){var t="buttonPortfolio";return this.darkClass.dark&&(t+=" dark"),{class:t}}}),watch:{getCreatedPortfolios:function(t){var e=this;t&&t.length&&!this.refContainer&&this.$nextTick((function(){e.refContainer=e.$refs.container}))}},methods:{closeAllSideBars:function(){var t=this.getLeftAndRightSidebarsStatus;this.$store.commit("userSettings/redactSettings",{widget:"leftSidebar",key:"visible",data:t}),this.$store.commit("userSettings/redactSettings",{widget:"rightSidebar",key:"visible",data:t})},setActiveTab:function(t){this.$store.commit("expertsPortfolio/setActiveTab",t.component),this.$emit("setCurrentPage","")},goToPage:function(t){if(this.currentPage===t){if(!this.getActiveTab)return;this.$emit("setCurrentPage",this.getActiveTab)}else this.$emit("setCurrentPage",t)},setStrategyStatus:function(){this.$emit("setStratedy")},setTopsStatus:function(){this.$emit("setTops")},viewTooltipHandler:function(t,e){this.text=e,this.viewTooltip(t)},mouseenterHandler:bNt((function(t){var e,i,o=this;(null===(e=this.findPortfolio)||void 0===e?void 0:e.id)===(null===(i=t.dataButton)||void 0===i?void 0:i.component)&&(this.target=t.e.target,this.dataHoverButton=t.dataButton,this.$nextTick((function(){o.popupVisible=!0})))}),500),mouseleaveHandler:function(){var t=this;clearInterval(rNt),setTimeout((function(){t.popupVisible=!1}),0)},mouseenterControlHandler:function(){this.controlVisible=!0},mouseleaveControlHandler:function(){var t=this;clearInterval(rNt),setTimeout((function(){t.controlVisible=!1}),0)},hidePopup:function(){this.popupVisible=!1},hiddenModalPortfolioExperts:function(){this.visibleModalPortfolioExperts=!1,this.expertsByFindPortfolio=[],this.findPortfolioSelected=[],this.popupVisible=!1,this.controlVisible=!1},setDataModalPortfolio:function(t){this.expertsByFindPortfolio=t.expertsByFindPortfolio,this.findPortfolioSelected=t.findPortfolio,this.visibleModalPortfolioExperts=t.visibleModalPortfolioExperts},setLoadingCopyControlButtons:function(t){this.loadingCopyControlButtons=t}},mounted:function(){var t=this;this.refContainer=this.$refs.container,document.onmousemove=function(e){var i=e.target.closest(".ButtonComponent"),o=e.target.closest(".ControlButtons");i||o||t.loadingCopyControlButtons||(t.popupVisible||t.controlVisible)&&(clearInterval(rNt),t.popupVisible=!1,t.controlVisible=!1)}},destroyed:function(){document.onmousemove=null}},PNt=SNt,TNt=(i("5c72"),Object(C["a"])(PNt,dNt,hNt,!1,null,"2848cb68",null)),xNt=TNt.exports,ONt={name:"UserProfileMyInvestments",mixins:[xt],components:{EmptyPortfolio:_Bt,StrategysForInvesting:JBt,TopsForInvesting:_Mt,MyInvestContent:uNt,TopButtonsBlock:xNt,DxLoadIndicator:OT["DxLoadIndicator"],NoStartPortfolio:WBt},props:{commonStatisticsPortfolios:{default:null},activeAccountTypeFilter:{default:2},commonNowStatisticsPortfolios:{default:null},defaultFilterByTraders:{type:Object}},data:function(){return{createPortfolio:!1,currentPage:"profitMyInvesting",strategyStatus:!1,topsStatus:!1}},watch:{getDefaultAccount:function(){this.currentPage="profitMyInvesting",this.$emit("setCurrentPage",this.currentPage),this.$store.commit("expertsPortfolio/clearCreatedPortfolio")}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserAccountsRequestStatus:"statusRequests/getUserAccountsRequestStatus",getTabsForInvesting:"subscriptionsContract/getTabsForInvesting",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getActiveTab:"expertsPortfolio/getActiveTab",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{noStartedPortfolios:function(){if(this.getCreatedPortfolios&&this.getCreatedPortfolios.length)return this.getCreatedPortfolios.every((function(t){return"Active"!==t.status}))},emptyPortfolio:function(){var t;return"historyInvest"!==this.currentPage&&(0===(null===(t=this.getCreatedPortfolios)||void 0===t?void 0:t.length)&&!this.createPortfolio)}}),methods:{setActiveTop:function(t){this.$emit("setActiveTop",t)},setStatusBlockFilter:function(t){this.$emit("statusBlockFilter",t)},setTopsStat:function(t){this.$emit("setTopsStat",t)},setCreatePortfolio:function(){this.currentPage="strategies",this.createPortfolio=!0},setTops:function(){this.strategyStatus=!1,this.topsStatus=!this.topsStatus,this.$emit("setTops",this.topsStatus)},setStrategy:function(){this.topsStatus=!1,this.strategyStatus=!this.strategyStatus,this.$emit("setStrategy",this.strategyStatus)},setCurrentPage:function(t){this.strategyStatus=!1,this.topsStatus=!1,this.currentPage=t,this.$emit("setCurrentPage",t)}},destroyed:function(){this.$store.commit("expertsPortfolio/clearCreatedPortfolio")}},wNt=ONt,_Nt=(i("bd20"),Object(C["a"])(wNt,bBt,SBt,!1,null,"45423ed0",null)),ANt=_Nt.exports,DNt={components:{Layout:oV,WelcomeModals:J6,DxPopup:wt["DxPopup"],RightBar:RZ,LeftBar:yIt,LeftBarCalcInvestProfit:VIt,LeftBarFilterStrategy:XIt,LeftBarTops:CBt,Preloader:ah,MyInvestments:ANt,ModalPortfolioExperts:JU},data:function(){return{loadItemsComplete:0,commonStatisticsPortfolios:null,commonNowStatisticsPortfolios:null,loadingItems:4,loadStatus:!0,userOrders:null,currentPage:"profitMyInvesting",strategyStatus:!1,topsStatus:!1,statusWelcomeModal:!1,statusCommonStatisticsPortfolios:!1,timeOutHistoryOrders:null,timeOutGetStatisticsByAccounts:null,timeOutGetInvestBagInfo:null,activeTop:null,activeAccountTypeFilter:2,topsStat:null,statusBlockFilter:!0,defaultFilterByTraders:{takeCount:0,isOrderDesc:!1,order:7,minEquity:1e3,IsActiveSource:!0,ProcPosOrdersFrom:50,ProcPosOrdersTo:100,isPublish:!0}}},mixins:[KU],watch:{getDefaultAccount:function(t){var e=this;t&&(this.$store.dispatch("statistic/getStatisticByAccounts",[this.getDefaultAccount.id]),this.timeOutGetStatisticsByAccounts=(new Date).getTime(),this.getHistoryOrdersForAccount(),this.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:this.getDefaultAccount.id}).then((function(){e.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:e.getDefaultAccount.id,filter:["Active","Created","Stoped"]}),e.timeOutGetInvestBagInfo=(new Date).getTime()})))},getStatus:function(t){t&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Portfolios"===t})):!this.getWelcomsModals.length)},loadItemsComplete:function(t){t===this.loadingItems&&(this.loadStatus=!1)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getWelcomsModals:"userSettings/getWelcomsModals",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",api:"api/api"})),{},{getCryptoStatus:function(){if(this.getDefaultAccount)return"Crypto"===this.getDefaultAccount.groupType},getCommonPortfolioStatus:function(){return("profitMyInvesting"===this.currentPage||"analiticsPortfolio"===this.currentPage||"UserProfileIncomeEquityTab"===this.currentPage||"DayInvestingStat"===this.currentPage||"comparingPortfolio"==this.currentPage)&&!this.emptyPortfolios},emptyPortfolios:function(){var t;return 0===(null===(t=this.getCreatedPortfolios)||void 0===t?void 0:t.length)},getStatus:function(){return"ready"===this.getUserDetailRequestStatus||"noSent"===this.getAuthRequestStatus}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio",getAllTradingInstrumnets:"contracts/getAllTradingInstrumnets",getAllTradingAssets:"contracts/getAllTradingAssets"})),{},{setStatusBlockFilter:function(t){this.statusBlockFilter=t},setParamFiltering:function(t){this.defaultFilterByTraders=Object(c["a"])(Object(c["a"])({},this.defaultFilterByTraders),{},Object(Vt["a"])({},t.param,t.data))},setTypeAccountFilter:function(t){this.activeAccountTypeFilter=t},setStrategy:function(t){this.topsStatus=!1,this.defaultFilterByTraders={takeCount:0,isOrderDesc:!1,order:7,minEquity:1e3,IsActiveSource:!0,ProcPosOrdersFrom:50,ProcPosOrdersTo:100,isPublish:!0,GroupType:this.getCryptoStatus?1:0},this.strategyStatus=t},setActiveTop:function(t){this.activeTop=t},setTopsStat:function(t){this.topsStat=t},setTops:function(t){this.strategyStatus=!1,this.topsStatus=t},hideWelcome:function(){this.statusWelcomeModal=!1},setCurrentPage:function(t){this.strategyStatus=!1,this.currentPage=t,"profitMyInvesting"===t&&this.$store.commit("expertsPortfolio/clearActiveTab")},updateStatistic:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id}));this.$store.commit("statistic/updateAccountDailyStatistic",i)},updateStatisticMonth:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id}));this.$store.commit("statistic/updateStatistic",i)},updateStatisticDay:function(t){var e=this,i=t.find((function(t){return t.account.id===e.getDefaultAccount.id}));this.$store.commit("statistic/updateStatisticDay",i)},setMessageHendler:function(t){if(t&&t.command&&"HistoryOrders"===t.command){this.loadItemsComplete++;var e=JSON.parse(t.data);this.getDefaultAccount.id===e[0]&&(this.$orderStorage.setOrdersToStorage(e),this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.$store.commit("contracts/setStatusByOrders",!0))}else if(t&&t.command&&"GetStatisticsByAccounts"===t.command)this.getDefaultAccount.id===t.data[0].account.id&&(this.$store.commit("statistic/setStatistics",t.data),this.$store.commit("statistic/setOrdersStatistics",t.data),this.loadItemsComplete++);else if(t&&t.command&&"AccountsDetails"===t.command)this.updateStatistic(t.data),this.updateStatisticMonth(t.data),this.updateStatisticDay(t.data);else if("BrokerPosition"===(null===t||void 0===t?void 0:t.command))this.getDefaultAccount.id===t.data.accountId&&this.$orderStorage.setUserOrder(t.data);else if(t&&t.command&&"GetInvestBagInfo"===t.command)this.getListsPortfolio(Kq(JSON.parse(t.data))),this.loadItemsComplete++,this.getStatByContract();else if("ContractStatisticsByInvestBags"===(null===t||void 0===t?void 0:t.command)){if("all"!==t.requestId)return;var i=JSON.parse(t.data);if(this.commonStatisticsPortfolios=i[1],this.statusCommonStatisticsPortfolios=!0,i[2]&&i[2].length){var o=i[2].map((function(t){return sNt(t)})),n=o.reduce((function(t,e){return t+e.profitClose}),0),s=o.reduce((function(t,e){return t+e.floatingProfitClose}),0)+n;this.commonNowStatisticsPortfolios={profitClose:n,profitAbs:s}}this.loadItemsComplete++}},getStatByContract:function(){this.statusCommonStatisticsPortfolios=!1;var t=this.getCreatedPortfolios.filter((function(t){return"Active"===t.status}));if(t.length){var e={command:"ContractStatisticsByInvestBags",method:"get",data:{requestId:"all",InvestBagIds:Object(x["a"])(t.map((function(t){return t.id}))),StatisticType:0}};this.$socketStream.sendCommand({ws:"apiWS3",command:e})}else this.statusCommonStatisticsPortfolios=!0,this.loadItemsComplete++},getHistoryOrdersForAccount:function(){this.$store.commit("contracts/setStatusByOrders",!1),this.timeOutHistoryOrders=(new Date).getTime();var t={Command:"HistoryOrders",Data:{accountId:this.getDefaultAccount.id,filter:{orderTypes:["All"],startTime:null,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},sendSubscriptionCommand:function(){var t={Command:"GetSubscriptions",Data:{Id:this.getDefaultAccount.id,Type:"Account",AllData:!0}};this.$socketStream.sendCommand({ws:"apiWS",command:t})}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.getTradingInstruments||(t.getAllTradingInstrumnets(),t.getAllTradingAssets()),t.$socketStream.events.subscribe("apiWS",t.setMessageHendler),t.$socketStream.$on("apiWS3",t.setMessageHendler),t.getDefaultAccount&&(t.$store.dispatch("statistic/getStatisticByAccounts",[t.getDefaultAccount.id]),t.getHistoryOrdersForAccount(),t.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:t.getDefaultAccount.id}).then((function(){t.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:t.getDefaultAccount.id,filter:["Active","Created","Stoped"]})}))),t.getStatus&&(t.statusWelcomeModal=t.getWelcomsModals.length?!t.getWelcomsModals.some((function(t){return"Portfolios"===t})):!t.getWelcomsModals.length);case 5:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHendler),this.$socketStream.events.unsubscribe("apiWS",this.setMessageHendler)}},kNt=DNt,INt=(i("739c"),Object(C["a"])(kNt,ADt,DDt,!1,null,"28698bc6",null)),BNt=INt.exports,MNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Report",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isVisible?e("Reports",{key:"report"}):e("Preloader",{key:"preloader",attrs:{opacity:"1",enabled:!0,sizeIcon:70,icon:!0}})],1),e("DxPopup",{attrs:{width:"740px",height:"386px",shading:!1,visible:t.statusWelcomeModal,showTitle:!1}},[e("WelcomeModals",{attrs:{routeName:"Report"},on:{hideWelcome:t.hideWelcome}})],1)],1)},$Nt=[],LNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Reports",class:t.darkClass},[e("ControlBlock",t._b({on:{changedDate:t.changedDate}},"ControlBlock",t.propsControlBlock,!1)),t.isProvider?e("div",{staticClass:"providerVerification"},[e("svgIcon",t._b({},"svgIcon",t.providerDataIcon,!1)),t._v(t._s(t.$t("yavaapots")))],1):t._e(),e("div",{staticClass:"scrollContent"},[e("StatByAccount",t._b({},"StatByAccount",t.propsStatByAccount,!1)),e("header",[t._v(t._s(t.$t("balance"))+"/"+t._s(t.$t("equity")))]),e("UserProfilePigWidget",{attrs:{configObject:{modeWidget:"mono"}}}),e("OpenPositionReports",t._b({on:{setCountPosition:t.setCountPosition}},"OpenPositionReports",t.propsOpenPositionReports,!1)),e("ClosedPositionReports",t._b({on:{setCountPosition:t.setCountPosition}},"ClosedPositionReports",t.propsClosedPositionReports,!1)),t.isProvider||t.emptyPortfolio||t.noStartedPortfolios?t._e():e("header",[t._v(t._s(t.$t("capital_distribution")))]),t.isProvider||t.emptyPortfolio||t.noStartedPortfolios?t._e():e("AnaliticsPortfolio",{attrs:{reports:!0}}),e("header",[t._v(t._s(t.$t("current_day_result"))+" ("+t._s(t.date)+")")]),e("UserProfilePeriodsWidget",{key:t.getActiveTheme,attrs:{configObject:t.configObject,topBarWidgetParams:t.topBarWidgetParams,visibleHead:!1}}),t.isPageBreakForPrint?e("div",{staticClass:"pageBreakForPrint"}):t._e(),e("TradingAnalytics",t._b({},"TradingAnalytics",t.propsTradingAnalytics,!1)),t.isProvider?[e("MyLastFiveSubscribers"),e("ProfitByCopy")]:e("MyLastFiveInvestments"),e("Commission"),e("footer",{staticClass:"footerReports"},[e("div",{staticClass:"logoContent"},[e("Logo")],1),e("div",{staticClass:"addrress"},[e("p",{staticClass:"dataLine"},[e("b",[t._v(t._s(t.nameCompany))])]),e("p",{staticClass:"dataLine"},[t._v(t._s(t.addressCompany))]),e("p",{staticClass:"dataLine"},[t._v(t._s(t.emailCompany))])])])],2)],1)},FNt=[],jNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ControlBlock",class:t.darkClass},[e("div",{staticClass:"wrapTabPanel"},[e("div",{staticClass:"calendarBoxReport"},[t.showCalendar?e("DxDateBox",{attrs:{displayFormat:"formatDate.displayFormat",type:"date",opened:t.isOpenedCalendar,width:0,height:0,"element-attr":{class:"vp_dateBox"},dropDownOptions:t.dropDownOptions,"show-week-numbers":!0},on:{closed:t.closedCalendar},scopedSlots:t._u([{key:"custom",fn:function(i){var o=i.data;return[e("CellCalendar",{attrs:{dataCell:o,isWeekPeriod:t.isWeekPeriod,selectedDay:t.date,startTradingDate:t.startTradingDate},on:{clickCellDateBox:t.clickCellDateBox}})]}}],null,!1,1631968771),model:{value:t.date,callback:function(e){t.date=e},expression:"date"}},[e("DxCalendarOptions",{attrs:{maxZoomLevel:t.formatDate.maxZoomLevel,cellTemplate:"custom"}})],1):t._e(),e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconCalendar},on:{toggle:t.openCalendar}})],1),e("div",{staticClass:"datesBlock"},[e("div",{staticClass:"wrapTabPanelDate"},[e("TabsPanel",{attrs:{active:t.tabsDate.length-1,tabs:[t.tabsDate],height:32,tooltipPosition:t.tooltipPosition,selectedTabWatch:t.selectedTabWatch},on:{tabClick:t.tabClickDate}})],1)])]),e("div",{staticClass:"dateBlock"},[t._v(t._s(t.$t("report_for"))+" "+t._s(t.dateHeader))]),e("div",{staticClass:"rightButtons"},[e("div",{staticClass:"printBox"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.iconPrint},on:{toggle:t.printBlock}})],1)])])},RNt=[],WNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CellCalendar",class:{disabledDate:t.disabledDate,selected:t.selected},on:{click:t.clickCellDateBox}},[t._v(t._s(t.outputValue))])},NNt=[],ENt={name:"CellCalendar",props:{dataCell:{type:Object},isWeekPeriod:{type:Boolean,default:!1},selectedDay:{type:Date},startTradingDate:{type:String}},components:{},data:function(){return{}},computed:{outputValue:function(){if(this.isWeekPeriod&&"month"===this.dataCell.view){var t=new Date(this.dataCell.date);return t.getWeek()+" неделя"}return this.dataCell.text},selected:function(){return nL(this.dataCell.date)===nL(this.selectedDay)},disabledDate:function(){var t=new Date(this.startTradingDate);return sL(this.dataCell.date,t,"less")}},methods:{clickCellDateBox:function(t){this.disabledDate?t.stopPropagation():this.$emit("clickCellDateBox")}}},UNt=ENt,VNt=(i("fe84"),Object(C["a"])(UNt,WNt,NNt,!1,null,"14f8957c",null)),HNt=VNt.exports,GNt={methods:{printBlock:function(){window.print()}}},qNt={name:"ControlBlock",mixins:[xt,GNt],props:{serverTime:{type:Date},calendarDate:{type:Date},accountDailyDate:{type:Array}},components:{TabsPanel:Nct,DxDateBox:Iz.a,DxCalendarOptions:kz["DxCalendarOptions"],CellCalendar:HNt},data:function(){return{showCalendar:!0,isOpenedCalendar:!1,selectedTabWatch:4,date:new Date,selectedDate:null,tabsDate:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getStatistics:"statistic/getStatistics",getOrdersStatistic:"statistic/getOrdersStatistic"})),{},{startTradingDate:function(){return this.getOrdersStatistic.startTradingDT},today:function(){return sL(this.calendarDate,this.serverTime,"equally")},lang:function(){var t;switch(null===(t=this.getUserSettings)||void 0===t||null===(t=t.lang)||void 0===t?void 0:t.code){case"en":return"en-US";case"ru":return"ru-RU";default:return"en-US"}},dateHeader:function(){var t=sL(this.calendarDate,this.serverTime,"more"),e=new Intl.DateTimeFormat(this.lang,{day:"2-digit",month:"long",year:"numeric"}).format(t?this.serverTime:this.calendarDate),i=new Intl.DateTimeFormat(this.lang,{hour:"numeric",minute:"numeric"}).format(this.calendarDate);return"".concat(e).concat(this.today?", "+i:"")},isWeekPeriod:function(){var t;return 1===(null===(t=this.selectedPeriod)||void 0===t?void 0:t.itemIndex)},isMonthPeriod:function(){var t;return 2===(null===(t=this.selectedPeriod)||void 0===t?void 0:t.itemIndex)},formatDate:function(){return{displayFormat:"month",maxZoomLevel:this.isMonthPeriod?"year":"day"}},lastFiveDays:function(){return this.accountDailyDate.slice(-5)},getActiveLang:function(){var t;if(this.getUserSettings)return null===(t=this.getUserSettings.lang)||void 0===t?void 0:t.code},dopClassDropDown:function(){return this.isWeekPeriod?"isWeekPeriod":this.isMonthPeriod?"isMonthPeriod":"isDayPeriod"},dropDownOptions:function(){return{wrapperAttr:{class:"vp_dropDownReports ".concat(this.dopClassDropDown," ").concat(this.darkClass.dark?"dark":"")},position:{my:"top left",at:"bottom left",of:".wrapTabPanel"}}},iconCalendar:function(){return{name:"CalendarEvents",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},iconPrint:function(){return{name:"Print",color:this.darkClass.dark?"#bbcee0":"#8c8c8c"}},tooltipPosition:function(){return{my:"center top",at:"center bottom",offset:"0 -8"}}}),watch:{getActiveLang:function(){var t=this;this.showCalendar=!1,this.$nextTick((function(){Object(qH["c"])(t.getActiveLang),t.showCalendar=!0}))},date:function(t){this.$emit("changedDate",t)}},created:function(){this.getActiveLang&&Object(qH["c"])(this.getActiveLang),this.setTabsDate()},methods:{clickCellDateBox:function(){var t=this;setTimeout((function(){t.setTabsDate()}),0)},tabClickDate:function(t){this.selectedTabWatch=t.itemIndex,this.selectedDate=t,this.date=t.tabData.date},closedCalendar:function(){this.isOpenedCalendar=!1},openCalendar:function(){this.isOpenedCalendar=!this.isOpenedCalendar},setTabsDate:function(){this.tabsDate=this.lastFiveDays.map((function(t,e){var i=t.equityClose-t.equityOpen,o=100*i/t.equityOpen,n=new Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(t.date));return{id:e,date:new Date(t.date),title:new Date(t.date).getDate(),tooltipText:'\n '.concat(n,"
\n $ ").concat(Lm(i,2,!0),"
\n % ").concat(Lm(o,2,!0),"\n "),tooltipClass:i>=0?"green":"red",dopClass:i>=0?"green":"red"}})),this.selectedTabWatch=this.lastFiveDays.length-1}}},zNt=qNt,YNt=(i("670e"),i("ed05"),Object(C["a"])(zNt,jNt,RNt,!1,null,"acb13cd0",null)),XNt=YNt.exports,QNt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatByAccount",class:t.darkClass,style:t.styleRoot},[t.getDefaultAccount&&"report"===t.mode?e("header",[t._v(t._s(t.$t("statistics_for_account"))+" № "+t._s(t.getDefaultAccount.sequenceId))]):t._e(),e("div",{class:"report"===t.mode?"containerStatData":"containerStatDataList"},t._l(t.manyStatDataFiltered,(function(i,o){return e("div",{key:o,staticClass:"statData"},[e("div",{staticClass:"title",class:i.dopClassTitle,on:{mouseenter:function(e){return t.viewTooltipHandler(e,i.tooltipText)},mouseleave:t.hideTooltip}},[t._v(t._s(i.title))]),e("div",{staticClass:"value",class:i.dopClass},[t._v(t._s(i.value))])])})),0),e("DxTooltip",{key:t.tooltipVisible,attrs:{visible:t.tooltipVisible,maxWidth:300,target:t.selector,position:t.positionTopCenter,animation:t.animationConfig,wrapperAttr:t.wrapperAttr}},[t._v(t._s(t.textTooltip))])],1)},JNt=[],KNt={name:"StatByAccount",mixins:[Ot,xt],props:{mode:{type:String,default:"report"},accountId:{type:String},quotes:{type:Object},accountDailyDate:{type:Array},dataClosedPositionDate:{type:[Boolean,Array]},dataOpenPositionDate:{type:[Boolean,Array]}},data:function(){return{dataProfit:null,textTooltip:""}},watch:{getDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!t||e.accountId){i.next=5;break}if(o=e.getDefaultAccount.id,!o){i.next=5;break}return i.next=5,e.getProfitData(o);case 5:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",getDefaultAccount:"subscribeOrders/getDefaultAccount",getContracts:"contracts/getContracts",getStatistics:"statistic/getStatistics",getOrdersStatistic:"statistic/getOrdersStatistic",getStatByMonth:"statistic/getStatByMonth",getStatByYears:"statistic/getStatByYears",isProvider:"subscribeOrders/isProvider"})),{},{accountDailyDateLastDate:function(){if(this.getStatistics)return this.accountDailyDate.length?this.accountDailyDate.at(-1):{equityClose:this.getStatistics.account.equity,equityOpen:this.getStatistics.account.equity,balanceClose:this.getStatistics.account.balance}},dateCreated:function(){var t=this.getStatistics.account.registrationDate,e=new Date(t).getTime();return rL(e)},balance:function(){var t=this.accountDailyDateLastDate.balanceClose;return Lm(t,2,!0)},equity:function(){var t=this.accountDailyDateLastDate.equityClose;return Lm(t,2,!0)},tradesDays:function(){return this.accountDailyDate.length},closedProfitSum:function(){if(!this.dataClosedPositionDate)return{value:""};var t=this.dataClosedPositionDate.reduce((function(t,e){return t+e.profit}),0);return{clearValue:t,value:t?Lm(t,2,!0):0,dopClass:t>0?"green":"red"}},depositDraws:function(){var t=this.getStatistics.sumDeposits,e=Object.values(t).reduce((function(t,e){return t+e}),0),i=this.getStatistics.sumWithdraws,o=Object.values(i).reduce((function(t,e){return t+e}),0);return"".concat(Lm(e,2,!0)," / ").concat(Lm(o,2,!0))},dayGeometry:function(){var t=this.accountDailyDate.reduce((function(t,e){var i=e.equityClose-e.equityOpen,o=i?100*i/e.equityOpen:1;return t*o}),1),e=Math.pow(t,1/this.accountDailyDate.length);return isNaN(e)?"--":Lm(e,1,!0)},monthGeometry:function(){var t=this.getStatByMonth.length?this.getStatByMonth.reduce((function(t,e){var i=e.profitRel?e.profitRel:1;return t*i}),1):1;return Lm(Math.pow(Math.abs(t),1/(this.getStatByMonth.length?this.getStatByMonth.length:1)),2,!0)},yearGeometry:function(){var t=this.getStatByYears.length?this.getStatByYears.reduce((function(t,e){var i=e.profitRel?e.profitRel:1;return t*i}),1):1;return Lm(Math.pow(Math.abs(t),1/(this.getStatByYears.length?this.getStatByYears.length:1)),2,!0)},netProfit:function(){return{value:this.closedProfitSum.value,dopClass:this.closedProfitSum.dopClass}},netProfitPips:function(){var t=this;if(!this.dataClosedPositionDate)return{value:""};var e=this.dataClosedPositionDate.reduce((function(e,i){var o,n=i.contractName.split(".")[0],s=null===(o=(t.getContracts||[]).find((function(t){return t.name===n})))||void 0===o?void 0:o.precision,r=Ph(s).toString().length-1,a={Buy:function(){return Math.round(+(i.closePrice-i.openPrice).toFixed(r)*Ph(s))},Sell:function(){return Math.round(+(i.openPrice-i.closePrice).toFixed(r)*Ph(s))}};return e+a[i.orderType]()}),0);return{value:e,dopClass:e>=0?"green":"red"}},netProfitPipsByTransaction:function(){if(!this.dataClosedPositionDate||!this.dataClosedPositionDate.length)return{value:0};var t=this.netProfitPips.value/this.dataClosedPositionDate.length;return{value:Lm(t.toFixed(0),0,!0),dopClass:t>=0?"green":"red"}},pipsOpenOrders:function(){var t=this;if(this.dataOpenPositionDate)return this.dataOpenPositionDate.reduce((function(e,i){var o,n=i.instrumentName,s=t.quotes[n];if(!s)return e;var r=null===(o=(t.getContracts||[]).find((function(t){return t.name===n})))||void 0===o?void 0:o.precision,a=Ph(r).toString().length-1,c={Buy:function(){return Math.round(+(s["Buy"]-i.openPrice).toFixed(a)*Ph(r))},Sell:function(){return Math.round(+(i.openPrice-s["Sell"]).toFixed(a)*Ph(r))}};return e+c[i.orderType]()}),0)},allPips:function(){if(!this.pipsOpenOrders)return{value:0,dopClass:"green"};var t=this.pipsOpenOrders+this.netProfitPips.value;return{value:t?Lm(t,2,!0):0,dopClass:t>=0?"green":"red"}},profitFactor:function(){if(!this.dataClosedPositionDate)return{value:""};var t=this.dataClosedPositionDate.reduce((function(t,e){return e.profit<0?t+e.profit:t}),0),e=this.dataClosedPositionDate.reduce((function(t,e){return e.profit>=0?t+e.profit:t}),0),i=e/Math.abs(t);return{value:0!==t?Lm(i,2,!0):0,dopClass:i>=1?"green":"red"}},matExpectation:function(){if(!this.dataClosedPositionDate)return{value:""};var t=this.closedProfitSum.clearValue/this.dataClosedPositionDate.length;return{value:t?Lm(t,2,!0):0,dopClass:t>=0?"green":"red"}},recoveryFactor:function(){if(!this.dataClosedPositionDate)return"";var t=null;return this.dataClosedPositionDate.forEach((function(e){var i=e.profit;(null===t||i=0?"green":"red"}},allOrders:function(){var t,e;return(null===(t=this.dataOpenPositionDate)||void 0===t?void 0:t.length)+(null===(e=this.dataClosedPositionDate)||void 0===e?void 0:e.length)},onlyProfitTransition:function(){if(!this.dataClosedPositionDate||!this.dataOpenPositionDate)return"";var t=this.dataClosedPositionDate.filter((function(t){return t.profit>=0})),e=this.dataOpenPositionDate.filter((function(t){return t.profit>=0})),i=[].concat(Object(x["a"])(t),Object(x["a"])(e));return{all:i.length,buy:i.filter((function(t){return"Buy"===t.orderType})).length,sell:i.filter((function(t){return"Sell"===t.orderType})).length}},onlyLossTransition:function(){if(!this.dataClosedPositionDate||!this.dataOpenPositionDate)return"";var t=this.dataClosedPositionDate.filter((function(t){return t.profit<0})),e=this.dataOpenPositionDate.filter((function(t){return t.profit<0})),i=[].concat(Object(x["a"])(t),Object(x["a"])(e));return{all:i.length,buy:i.filter((function(t){return"Buy"===t.orderType})).length,sell:i.filter((function(t){return"Sell"===t.orderType})).length}},openOrdersLength:function(){var t;return null===(t=this.dataOpenPositionDate)||void 0===t?void 0:t.length},closedOrdersLength:function(){var t;return null===(t=this.dataClosedPositionDate)||void 0===t?void 0:t.length},openOrderProfit:function(){if(!this.dataOpenPositionDate)return{value:""};var t=this.dataOpenPositionDate.reduce((function(t,e){return t+e.profit}),0);return{value:Lm(t,2,!0),dopClass:t>=0?"green":"red"}},losingTrade:function(){if(!this.dataClosedPositionDate)return"";if(!this.closedOrdersLength)return 0;var t=this.dataClosedPositionDate.filter((function(t){return t.profit<0})).length;return"".concat(t," (").concat(Lm(100*t/this.closedOrdersLength,2,!0)," %)")},averageProfitValue:function(){if(!this.dataClosedPositionDate)return{value:""};var t=this.dataClosedPositionDate.filter((function(t){return t.profit>=0})).length,e=this.closedProfitSum.clearValue/t;return t||(e=0),{value:Lm(e,1,!0),dopClass:e>=0?"green":"red"}},profitTradePercent:function(){if(!this.dataClosedPositionDate)return"";if(!this.closedOrdersLength)return 0;var t=this.dataClosedPositionDate.filter((function(t){return t.profit>=0})).length;return Lm(100*t/this.closedOrdersLength,2,!0)},maxDDAbs:function(){if(!this.dataClosedPositionDate)return"";var t=null;return this.dataClosedPositionDate.forEach((function(e){(null===t||e.profit=0})).length;return"".concat(t," (").concat(Lm(100*t/this.closedOrdersLength,2,!0)," %)")},commission:function(){return"$ "+Lm(.25*this.accountDailyDateLastDate.equityClose/100,2,!0)},countSubscriber:function(){return this.dataProfit&&this.isProvider?this.dataProfit.length:0},investVolume:function(){if(!this.dataProfit||!this.isProvider)return"";var t=this.dataProfit.reduce((function(t,e){return t+e.investMoney}),0);return Lm(t,2,!0)},capital:function(){if(!this.dataProfit||!this.isProvider)return"";var t=this.dataProfit.reduce((function(t,e){return t+2*e.usedVolume}),0);return Lm(t,2,!0)},tradingActivity:function(){var t,e=this;if(!this.dataClosedPositionDate||!this.dataOpenPositionDate)return"";if(null===(t=this.accountDailyDate)||void 0===t||!t.length)return 0;var i=0;return this.accountDailyDate.forEach((function(t){var o=new Date(t.date).getTime(),n=e.dataOpenPositionDate.find((function(t){return o>=new Date(t.openDate).getTime()})),s=e.dataClosedPositionDate.find((function(t){var e=new Date(t.openDate).getTime(),i=new Date(t.closedDate).getTime();return o>=e&&o=0,red:this.dataRow.pips<0})}}},pEt=hEt,gEt=(i("fd4f"),Object(C["a"])(pEt,uEt,dEt,!1,null,"2fb37433",null)),fEt=gEt.exports,mEt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Percent",class:t.rootClass},[t._v(t._s(t.getPercent))])},vEt=[],yEt={name:"Percent",mixins:[xt],props:{dataRow:{type:Object}},computed:{getPercent:function(){return Lm(this.dataRow.percent,2,!0)},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{green:this.dataRow.percent>=0,red:this.dataRow.percent<0})}}},CEt=yEt,bEt=(i("ae67"),Object(C["a"])(CEt,mEt,vEt,!1,null,"4bc8831c",null)),SEt=bEt.exports,PEt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Profit",class:t.rootClass},[t._v(t._s(t.getProf))])},TEt=[],xEt={name:"Profit",mixins:[xt],props:{dataRow:{type:Object}},computed:{getProf:function(){return Lm(this.dataRow.prof,2,!0)},rootClass:function(){return Object(c["a"])(Object(c["a"])({},this.darkClass),{},{green:this.dataRow.prof>=0,red:this.dataRow.prof<0})}}},OEt=xEt,wEt=(i("9340"),Object(C["a"])(OEt,PEt,TEt,!1,null,"67dbeaeb",null)),_Et=wEt.exports,AEt={name:"OpenPositionReports",mixins:[xt],props:{dataOpenPositionDate:{type:[Boolean,Array]},quotes:{type:Object},calendarDate:{type:Date}},components:{TableColumnsCustom:p2,OrdersCount:lEt,Pips:fEt,Percent:SEt,Profit:_Et,ResultTableData:lit},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings",getContracts:"contracts/getContracts"})),{},{lang:function(){var t;switch(null===(t=this.getUserSettings)||void 0===t||null===(t=t.lang)||void 0===t?void 0:t.code){case"en":return"en-US";case"ru":return"ru-RU";default:return"en-US"}},date:function(){return new Intl.DateTimeFormat(this.lang,{day:"2-digit",month:"long",year:"numeric"}).format(this.calendarDate)},workPiece:function(){var t=this;if(!this.dataOpenPositionDate)return[];var e={};return this.dataOpenPositionDate.forEach((function(i){var o,n=i.contractName,s=t.quotes,r=n.split(".")[0],a=null===(o=(t.getContracts||[]).find((function(t){return t.name===r})))||void 0===o?void 0:o.precision;e[n]||(e[n]={contract:n,count:0,profitCount:0,pips:0,volume:0,prof:0}),e[n].count+=1;var c=e[n].profitCount;e[n].profitCount=i.profit>=0?c+1:c,e[n].pips+=dot({order:i,getPrecision:a,Get10PowerF:Ph,quotes:s}),e[n].prof+=i.profit,e[n].volume+=i.volume})),Object.values(e)},dataTable:function(){return this.dataOpenPositionDate?this.workPiece.map((function(t){return{contract:t.contract,count:t.count,prof:t.prof,pips:t.pips,percent:100*t.prof/t.volume,profCopy:0,commission:0}})):[]},columns:function(){return[{id:1,title:this.$t("instruments"),field:"contract",align:"center"},{id:2,title:this.$t("trades_open"),field:"count",align:"center",cellTemplate:"cell-orders-count"},{id:3,title:"P/L, PIP",field:"pips",align:"center",cellTemplate:"cell-pips"},{id:4,title:"P/L, %",field:"percent",align:"center",cellTemplate:"cell-percent"},{id:5,title:"P/L, $",align:"center",field:"prof",cellTemplate:"cell-profit"}]},allClosedCount:function(){return this.dataOpenPositionDate?this.workPiece.reduce((function(t,e){return t+e.count}),0):""},allPips:function(){return this.dataOpenPositionDate?this.workPiece.reduce((function(t,e){return t+e.pips}),0):""},allPipsFormatted:function(){return Lm(this.allPips,2,!0)},allPercent:function(){return this.dataOpenPositionDate?this.workPiece.reduce((function(t,e){return t+100*e.prof/e.volume}),0):""},allPercentFormatted:function(){return Lm(this.allPercent,1,!0)+" %"},allProf:function(){return this.dataOpenPositionDate?this.workPiece.reduce((function(t,e){return t+e.prof}),0):""},allProfFormatted:function(){return"$ "+Lm(this.allProf,2,!0)},dataResult:function(){return[{title:this.$t("trades_open"),value:this.allClosedCount},{title:"P/L, PIP",value:this.allPipsFormatted,dopClass:this.allPips>=0?"green":"red"},{title:"P/L, %",value:this.allPercentFormatted,dopClass:this.allPercent>=0?"green":"red"},{title:"P/L, $",value:this.allProfFormatted,dopClass:this.allProf>=0?"green":"red"}]}}),watch:{workPiece:function(t,e){(null===t||void 0===t?void 0:t.length)!==(null===e||void 0===e?void 0:e.length)&&this.$emit("setCountPosition",{field:"open",count:t.length})}}},DEt=AEt,kEt=(i("b415"),Object(C["a"])(DEt,iEt,oEt,!1,null,"15308756",null)),IEt=kEt.exports,BEt=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"ClosedPositionReports",class:e.darkClass},[i("header",[i("span",{staticClass:"big"},[e._v(e._s(e.$t("closed_trades")))]),e._v("("+e._s((null===(t=e.dataClosedPositionDate)||void 0===t?void 0:t.length)||0)+") "+e._s(e.$t("on"))+" "+e._s(e.date))]),i("div",{staticClass:"wrapTable"},[i("TableColumnsCustom",{attrs:{dataTable:e.dataTable,columns:e.columns,resizeEnabled:!1},scopedSlots:e._u([{key:"cell-orders-count",fn:function(t){var e=t.data;return[i("OrdersCount",{attrs:{dataRow:e,closed:!0}})]}},{key:"cell-orders-count-profit",fn:function(t){var e=t.data;return[i("OrdersCountProfit",{attrs:{dataRow:e}})]}},{key:"cell-pips",fn:function(t){var e=t.data;return[i("Pips",{attrs:{dataRow:e}})]}},{key:"cell-percent",fn:function(t){var e=t.data;return[i("Percent",{attrs:{dataRow:e}})]}},{key:"cell-profit",fn:function(t){var e=t.data;return[i("Profit",{attrs:{dataRow:e}})]}}])}),i("ResultTableData",e._b({attrs:{dataResult:e.dataResult,columns:6}},"ResultTableData",e.resultProps,!1))],1)])},MEt=[],$Et=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OrdersCountProfit",class:t.darkClass},[t._v(t._s(t.dataRow.profitCount))])},LEt=[],FEt={name:"OrdersCountProfit",mixins:[xt],props:{dataRow:{type:Object}}},jEt=FEt,REt=(i("a8cd"),Object(C["a"])(jEt,$Et,LEt,!1,null,"0022b733",null)),WEt=REt.exports,NEt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitCopy"},[t._v(t._s(t.dataRow.profCopy))])},EEt=[],UEt={name:"ProfitCopy",props:{dataRow:{type:Object}},components:{},data:function(){return{}},computed:{},watch:{},mounted:function(){},destroyed:function(){},methods:{}},VEt=UEt,HEt=(i("1669"),Object(C["a"])(VEt,NEt,EEt,!1,null,"4af30a76",null)),GEt=HEt.exports,qEt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Commission"},[t._v(t._s(t.dataRow.commission))])},zEt=[],YEt={name:"Commission",props:{dataRow:{type:Object}},components:{},data:function(){return{}},computed:{},watch:{},mounted:function(){},destroyed:function(){},methods:{}},XEt=YEt,QEt=(i("7fc8"),Object(C["a"])(XEt,qEt,zEt,!1,null,"7920d3a4",null)),JEt=QEt.exports,KEt={name:"ClosedPositionReports",mixins:[hot,xt],props:{dataClosedPositionDate:{type:[Boolean,Array]},calendarDate:{type:Date}},components:{TableColumnsCustom:p2,OrdersCount:lEt,OrdersCountProfit:WEt,Pips:fEt,Percent:SEt,Profit:_Et,ProfitCopy:GEt,Commission:JEt,ResultTableData:lit},data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getUserSettings:"userSettings/getUserSettings"})),{},{lang:function(){var t;switch(null===(t=this.getUserSettings)||void 0===t||null===(t=t.lang)||void 0===t?void 0:t.code){case"en":return"en-US";case"ru":return"ru-RU";default:return"en-US"}},date:function(){return new Intl.DateTimeFormat(this.lang,{day:"2-digit",month:"long",year:"numeric"}).format(this.calendarDate)},dataTable:function(){return this.dataClosedPositionDate?this.workPiece.map((function(t){return{contract:t.contract,count:t.count,profitCount:t.profitCount,prof:t.prof,pips:t.pips,percent:100*t.prof/t.volume}})):[]},columns:function(){return[{id:1,title:this.$t("instruments"),field:"contract",align:"center"},{id:2,title:this.$t("trades_closed"),field:"count",align:"center",cellTemplate:"cell-orders-count"},{id:3,title:this.$t("successful_trades"),field:"profitCount",align:"center",cellTemplate:"cell-orders-count-profit"},{id:4,title:"P/L, PIP",field:"pips",align:"center",cellTemplate:"cell-pips"},{id:5,title:"P/L, %",field:"percent",align:"center",cellTemplate:"cell-percent"},{id:6,title:"P/L, $",align:"center",field:"prof",cellTemplate:"cell-profit"}]},allClosedCount:function(){return this.dataClosedPositionDate?this.workPiece.reduce((function(t,e){return t+e.count}),0):""},allProfitCount:function(){if(!this.dataClosedPositionDate)return"";var t=this.workPiece.reduce((function(t,e){return t+e.profitCount}),0);if(!t)return 0;var e=Lm(100*t/this.allClosedCount,2,!0);return"".concat(Lm(t,2,!0)," (").concat(e," %)")},allPips:function(){return this.dataClosedPositionDate?this.workPiece.reduce((function(t,e){return t+e.pips}),0):""},allPipsFormatted:function(){return Lm(this.allPips,2,!0)},allPercent:function(){return this.dataClosedPositionDate?this.workPiece.reduce((function(t,e){return t+100*e.prof/e.volume}),0):""},allPercentFormatted:function(){return Lm(this.allPercent,2,!0)+" %"},allProf:function(){return this.dataClosedPositionDate?this.workPiece.reduce((function(t,e){return t+e.prof}),0):""},allProfFormatted:function(){return"$ "+Lm(this.allProf,2,!0)},dataResult:function(){return[{title:this.$t("trades_closed"),value:this.allClosedCount},{title:this.$t("successful_trades"),value:this.allProfitCount},{title:"P/L, PIP",value:this.allPipsFormatted,dopClass:this.allPips>=0?"green":"red"},{title:"P/L, %",value:this.allPercentFormatted,dopClass:this.allPercent>=0?"green":"red"},{title:"P/L, $",value:this.allProfFormatted,dopClass:this.allProf>=0?"green":"red"}]},resultProps:function(){return{pipsClass:this.allPips>=0?"green":"red",profitClass:this.allProf>=0?"green":"red",percentClass:this.allPercent>=0?"green":"red"}}}),watch:{workPiece:function(t,e){(null===t||void 0===t?void 0:t.length)!==(null===e||void 0===e?void 0:e.length)&&this.$emit("setCountPosition",{field:"closed",count:t.length})}}},ZEt=KEt,tUt=(i("8cd70"),Object(C["a"])(ZEt,BEt,MEt,!1,null,"14ea6537",null)),eUt=tUt.exports,iUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyLastFiveInvestments",class:t.darkClass},[e("header",[t._v(t._s(t.$t("ml5si"))),t.isVisibleLink?e("span",{staticClass:"linkToSubscription"},[t._v(t._s(t.$t("all_subscribers")))]):t._e()]),e("TableCopy",{attrs:{report:!0}})],1)},oUt=[],nUt=function(){var t=this,e=t._self._c;return e("div",{ref:"table",staticClass:"TableCopy",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.loadingData?e("SceletonTable"):t.noDataVisible?e("NoData"):e("div",{staticClass:"contentSection"},[e("div",{staticClass:"tableWrapper"},[e("TableColumnsCustom",{attrs:{dataTable:t.getActivePortfolios,columns:t.columns,resizeEnabled:!0,heightRow:36,stickyHeader:!0,emitSize:!0},on:{getSizeArr:t.getSizeArr},scopedSlots:t._u([{key:"cell-startDate",fn:function(t){var i=t.data;return[e("DateCreated",{attrs:{dataRow:i}})]}},{key:"cell-name",fn:function(t){var i=t.data;return[e("NameUserOrPortfolio",{attrs:{dataRow:i,tableCopy:!0}})]}},{key:"cell-instrument",fn:function(t){var i=t.data;return[e("ContractData",{attrs:{dataRow:i,portfolio:!0}})]}},{key:"cell-commission",fn:function(i){var o=i.data;return[e("PriceData",{attrs:{dataRow:o,tableCopy:!0,getListInvestPortfolios:t.getListInvestPortfolios}})]}},{key:"cell-current-copy-profit",fn:function(i){var o=i.data;return[e("CurrentProfitCopy",{attrs:{dataRow:o,getListInvestPortfolios:t.getListInvestPortfolios}})]}},{key:"cell-myProfit",fn:function(i){var o=i.data;return[e("MyProfitCopy",{attrs:{dataRow:o,getListInvestPortfolios:t.getListInvestPortfolios}})]}},{key:"cell-closeDate",fn:function(t){var i=t.data;return[e("TimeEnd",{attrs:{dataRow:i}})]}},{key:"cell-status",fn:function(t){var i=t.data;return[e("Status",{attrs:{dataRow:i}})]}},{key:"cell-active",fn:function(i){var o=i.data;return[e("ActiveButton",{attrs:{dataRow:o,sequenceId:t.sequenceId,tableCopy:!0}})]}}])})],1),t.loadingData||t.noDataVisible?t._e():e("footer",{class:{report:t.report}},t._l(t.sizeColumnsTable,(function(i,o){return e("div",{staticClass:"section",style:{minWidth:[0,1,2,3].includes(o)?i+"%":"none"}},[1===o?e("LabelBlock",{staticClass:"countCopy",attrs:{title:t.$t("copying2"),value:t.countCopy}}):t._e(),3===o?e("LabelBlock",{staticClass:"sf",attrs:{title:t.$t("fee"),value:"$ "+t.fee}}):t._e(),4===o?e("LabelBlock",{class:["allIncome",{red:t.allIncome.value<0}],attrs:{title:t.$t("total_income"),value:"$ "+t.allIncome.valueFormatted}}):t._e(),5===o?e("LabelBlock",{class:["myIncome",{red:t.allIncome.value<0}],attrs:{title:t.$t("my_income"),value:t.myIncome}}):t._e()],1)})),0)])],1)],1)},sUt=[],rUt=i("d30a"),aUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SceletonTable"},t._l(25,(function(t){return e("Sceleton",{key:t,attrs:{height:40}})})),1)},cUt=[],lUt={name:"SceletonTable",components:{Sceleton:nT}},uUt=lUt,dUt=(i("b812"),Object(C["a"])(uUt,aUt,cUt,!1,null,"6b288054",null)),hUt=dUt.exports,pUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NoData",class:t.darkClass},[e("div",{staticClass:"contentNoData"},[e("svgIcon",{attrs:{name:"NewPortfel_BIG",size:100}}),e("div",{staticClass:"textNoData"},[t._v(t._s(t.$t("tnhy")))])],1)])},gUt=[],fUt={name:"NoData",mixins:[xt]},mUt=fUt,vUt=(i("7216"),Object(C["a"])(mUt,pUt,gUt,!1,null,"3703acf4",null)),yUt=vUt.exports,CUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DateCreated",class:t.darkClass},[t._v(t._s(t.dateCreated))])},bUt=[],SUt={computed:{dateCreated:function(){var t,e;Array.isArray(this.dataRow)?t=this.dataRow[0].startDateTime:t=(null===(e=this.dataRow.subscription)||void 0===e?void 0:e.startDateTime)||this.dataRow.startDateTime||this.dataRow.createDateTime;return this.subscriber?Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):new Date(t).toLocaleDateString()}}},PUt={name:"DateCreated",mixins:[SUt,xt],props:{dataRow:{type:[Object,Array]},content:{type:Boolean,default:!1},subscriber:{type:Boolean,default:!1}}},TUt=PUt,xUt=(i("0fed"),Object(C["a"])(TUt,CUt,bUt,!1,null,"62e886e5",null)),OUt=xUt.exports,wUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NameUserOrPortfolio",class:t.darkClass},[t.isPortfolio?e("div",{staticClass:"svgWrapper",on:{click:t.openModalWithUserInformation}},[e("svgIcon",{attrs:{name:"RegPartner"}})],1):t._e(),t.isVisibleImg?e("img",{staticClass:"avatar",attrs:{alt:"",src:t.getAvatar},on:{click:t.openModalWithUserInformation}}):t._e(),e("div",{staticClass:"nameAndSequenceId"},[e("div",{staticClass:"name"},[t._v(t._s(t.getName))]),t.isPortfolio?t._e():e("div",{staticClass:"sequenceId"},[t._v(t._s(t.getSequenceId))])])])},_Ut=[],AUt=function(){var t=this,e=t._self._c;return e("DxPopup",{attrs:{width:t.widthPopup,height:t.heightPopup,visible:!1,"drag-enabled":!0,"close-on-outside-click":!0,"show-close-button":!1,"show-title":!0,shading:!1,deferRendering:!1},on:{shown:t.onShown,hidden:t.hidden}})},DUt=[],kUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UserInformation"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoadingStatData?e("div",{key:"sceletonSectionUserInformation",staticClass:"sceletonSection"},[e("SceletonUserInformation",{attrs:{subscriber:t.subscriber}})],1):e("div",{key:"contentUserInformation",staticClass:"wrapContentUserInformation"},[e("header",{staticClass:"headerPopup"},[t.subscriber?e("div",{staticClass:"name"},[t._v("Подробнее о “"+t._s(t.nameUser)+"”")]):e("div",{staticClass:"name"},[t._v("Подробнее о “"+t._s(t.nameUser)+"” по счету"),e("span",{class:t.classGroup},[t._v("  "+t._s(t.getAccountGroup))]),t._v("  "+t._s(t.getSequenceId))]),e("div",{staticClass:"buttonBlock"},[e("ButtonIconFlat",{staticClass:"buttonCustom",attrs:{icon:t.getIconData("Close")},on:{toggle:t.closeModal}})],1)]),e("div",{staticClass:"contentModal"},[e("div",{staticClass:"leftBlock"},[e("AvatarBlock",{attrs:{dataRow:t.dataRow,nameUser:t.nameUser,subscriber:t.subscriber,getProfitOrdersPercent:t.getProfitOrdersPercent}}),e("CommonInfoBlock",{attrs:{dataRow:t.dataRow,isVisiblePopup:t.isVisiblePopup,subscriber:t.subscriber,subscription:t.subscription}})],1),e("div",{staticClass:"rightBlock"},[e("ProfitGraph",{attrs:{nameUser:t.nameUser,statByAccount:t.statByAccount,subscription:t.subscription,subscriber:t.subscriber}}),t.subscriber?t._e():e("StatDataGraph",{attrs:{keyVisibleModal:t.keyVisibleModal,getProfitOrdersPercent:t.getProfitOrdersPercent,ordersClosedProfit:t.ordersClosedProfit,totalClosedOrders:t.totalClosedOrders,getChartPoints:t.getChartPoints,profitabilityPortfolio:t.profitabilityPortfolio,ratioSharpPortfolioFormatted:t.ratioSharpPortfolioFormatted,stat:t.statByAccount}})],1)])])])],1)},IUt=[],BUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AvatarBlock",class:{subscriber:t.subscriber}},[e("img",{class:{subscriber:t.subscriber},attrs:{src:t.srcAvatar,alt:""}}),e("div",{staticClass:"infoUser"},[e("div",{staticClass:"name"},[t._v(t._s(t.nameUser))]),e("div",{staticClass:"successRate"},[t._v(t._s(t.getProfitOrdersPercent)+"%")]),e("div",{staticClass:"indicatorLine"},[e("div",{staticClass:"indicator",style:{width:t.getProfitOrdersPercent+"%"}})])]),t.subscriber?t._e():e("div",{staticClass:"buttonsBlock"},[e("div",{staticClass:"pseudoButton"},[e("svgIcon",{attrs:{name:"User"}}),e("div",{staticClass:"nameButton"},[t._v("Профиль")])],1),e("div",{staticClass:"pseudoButton"},[e("svgIcon",{attrs:{name:"Chat"}}),e("div",{staticClass:"nameButton"},[t._v("Написать")])],1),e("div",{staticClass:"pseudoButton"},[e("svgIcon",{attrs:{name:"Stream"}}),e("div",{staticClass:"nameButton"},[t._v("Трансляции")])],1),e("div",{staticClass:"pseudoButton"},[e("svgIcon",{attrs:{name:"Groups"}}),e("div",{staticClass:"nameButton"},[t._v("Группы")])],1)])])},MUt=[],$Ut={name:"AvatarBlock",props:{dataRow:{type:Object},nameUser:{type:String},subscriber:{type:Boolean},getProfitOrdersPercent:{type:Number}},computed:{srcAvatar:function(){var t;return this.subscriber?this.dataRow.avatarURL:this.dataRow.portfolioUser?this.dataRow.sourceAvatar:null===(t=this.dataRow.subscription)||void 0===t?void 0:t.sourceAvatar}}},LUt=$Ut,FUt=(i("b682"),Object(C["a"])(LUt,BUt,MUt,!1,null,"bbaa904e",null)),jUt=FUt.exports,RUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CommonInfoBlock"},[e("div",{staticClass:"infoBlock"},[e("div",{staticClass:"lineInfo"},[e("div",{staticClass:"text"},[t._v("Дата подписки")]),e("hr"),e("div",{staticClass:"value"},[t._v(t._s(t.startDateTime))])]),e("div",{staticClass:"lineInfo"},[e("div",{staticClass:"text"},[t._v("Окончание подписки")]),e("hr"),e("div",{staticClass:"value"},[t._v(t._s(t.stopDateTime))])]),t.subscription?t._e():e("div",{staticClass:"lineInfo"},[e("div",{staticClass:"text"},[t._v("Тип подписки")]),e("hr"),e("div",{staticClass:"value"},[t._v(t._s(t.subscriptionType))])]),t.subscription?t._e():e("div",{staticClass:"lineInfo"},[e("div",{staticClass:"text"},[t._v("Стоимость подписки")]),e("hr"),e("div",{staticClass:"value green"},[t._v(t._s(t.subscriptionPrice))])]),t.subscription?t._e():e("div",{staticClass:"lineInfo"},[e("div",{staticClass:"text"},[t._v("Ваш доход")]),e("hr"),e("div",{staticClass:"value green"},[t._v("$ 754")])]),e("div",{staticClass:"lineInfo",class:t.anchorSelector},[e("div",{staticClass:"text"},[t._v("Инструменты")]),e("hr"),t.isVisiblePopup?e("ContractData",{attrs:{dataRow:t.dataRow,subscriber:t.subscriber,anchorSelector:".".concat(t.anchorSelector)}}):t._e()],1)]),t.subscription?t._e():e("div",{staticClass:"statusBlock"},[t._v("Активная подписка")])])},WUt=[],NUt={name:"CommonInfoBlock",mixins:[xt],props:{dataRow:{type:Object},isVisiblePopup:{type:Boolean},subscriber:{type:Boolean},subscription:{type:Boolean}},components:{ContractData:q$},computed:{startDateTime:function(){var t;return this.dataRow.portfolioUser||this.subscriber?new Date(this.dataRow.startDateTime).toLocaleDateString():new Date(null===(t=this.dataRow.subscription)||void 0===t?void 0:t.startDateTime).toLocaleDateString()},stopDateTime:function(){var t;return this.dataRow.portfolioUser||this.subscriber?new Date(this.dataRow.stopDateTime).toLocaleDateString():new Date(null===(t=this.dataRow.subscription)||void 0===t?void 0:t.stopDateTime).toLocaleDateString()},subscriptionType:function(){var t;return null!==(t=this.dataRow.subscription)&&void 0!==t&&t.priceType||"Percent"===this.dataRow.priceType?"Процент от дохода (SF)":"Фиксированная оплата"},subscriptionPrice:function(){var t,e,i;if(!this.subscription)return"Percent"===((null===(t=this.dataRow.subscription)||void 0===t?void 0:t.priceType)||this.dataRow.priceType||this.dataRow.sources[0].priceType)?((null===(i=this.dataRow.subscription)||void 0===i?void 0:i.price)||this.dataRow.price||this.dataRow.sources[0].price)+" %":"$ "+((null===(e=this.dataRow.subscription)||void 0===e?void 0:e.price)||this.dataRow.price||this.dataRow.sources[0].price)},anchorSelector:function(){return this.dataRow.portfolioUser||this.subscriber?"contractListLine_"+(this.dataRow.sourceSequenceId||this.dataRow.accountId):""}}},EUt=NUt,UUt=(i("000b"),Object(C["a"])(EUt,RUt,WUt,!1,null,"00937939",null)),VUt=UUt.exports,HUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitGraph",class:{subscriber:t.subscriber}},[e("div",{staticClass:"titleText"},[t._v(t._s(t.titleText))]),e("div",{staticClass:"chartContainer"},[e("ChartWrapper",{attrs:{showTitle:!1},on:{initCanvas:t.getCanvasesObjects}})],1)])},GUt=[],qUt={mixins:[lM,TM,MV,xM],data:function(){return{chartCanvas:null,yAxisCanvas:null,xAxisCanvas:null,xPoints:[],xServiceObject:null,yPoints:[],yServiceObject:null}},methods:{getCanvasesObjects:function(t){this.chartCanvas=t.chartCanvas,this.xAxisCanvas=t.xAxisCanvas,this.yAxisCanvas=t.yAxisCanvas,this.initDataForDraw()},initDataForDraw:function(){this.chartCanvas.clearCanvas(),this.yAxisCanvas.clearCanvas(),this.xAxisCanvas.clearCanvas(),this.setXPoints(),this.setYPoints(),this.drawGrid(),this.drawCharts()},setXPoints:function(){this.xPoints=[],this.xPoints=this.calcXPoints(),this.xServiceObject=this.chartCanvas.getServiceData(this.xPoints,{maxExpand:9/this.chartCanvas.getSizeCanvas().width*100/100,minExpand:0},this.chartCanvas.getSizeCanvas().width)},setYPoints:function(){this.yPoints=[],this.yPoints=this.calcYPoints(),this.yServiceObject=this.chartCanvas.getServiceData(this.yPoints,{maxExpand:.15,minExpand:.1},this.chartCanvas.getSizeCanvas().height)},drawGrid:function(){var t=this.getGridParams(this.xServiceObject,66),e=this.getGridParams(this.yServiceObject,50);this.drawXYGrid(!0,t,this.chartCanvas,this.xServiceObject,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.drawXYGrid(!0,t,this.xAxisCanvas,this.xServiceObject,{width:this.chartCanvas.getSizeCanvas().width,height:this.xAxisCanvas.getSizeCanvas().width},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out","month"),this.drawXYGrid(!1,e,this.chartCanvas,this.yServiceObject,{width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},"line","light"===this.getActiveTheme?"#f2f2f2":"rgba(143, 168, 193, 0.1)"),this.drawXYGrid(!1,e,this.yAxisCanvas,this.yServiceObject,{width:this.yAxisCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height},"label","light"===this.getActiveTheme?"#8c8c8c":"#8fa8c1","out","price")},drawCharts:function(){this.drawSplineLine(this.daysCalcData(),this.colors.color,this.colors.fill)},drawSplineLine:function(t,e,i){var o=this,n=[],s={width:this.chartCanvas.getSizeCanvas().width,height:this.chartCanvas.getSizeCanvas().height};t.forEach((function(t){n.push(o.chartCanvas.mapLogicalToCanvasXCoordinate(o.xServiceObject,s.width,t[0])),n.push(o.chartCanvas.mapLogicalToCanvasYCoordinate(o.yServiceObject,s.height,t[1]))})),this.drawSpline(this.chartCanvas.ctx,n,.3,!0,i,s),this.drawSpline(this.chartCanvas.ctx,n,.3,!1,e,s),this.drawAxisIndicator(n[n.length-1],e,this.chartCanvas.ctx,s);var r=t.at(-1)[1].toFixed(2);this.drawIndicator(n[n.length-1],r,e,this.yAxisCanvas.ctx,{width:this.yAxisCanvas.getSizeCanvas().width,height:this.yAxisCanvas.getSizeCanvas().height},"#fff")}}},zUt={name:"ProfitGraph",mixins:[xt,qUt],props:{nameUser:{type:String},statByAccount:{type:Array},subscription:{type:Boolean},subscriber:{type:Boolean}},components:{ChartWrapper:pM},data:function(){return{averageIncome:null}},computed:{colors:function(){return this.darkClass.dark?{color:this.averageIncome>=0?"rgba(0,255,172,1)":"rgba(250,76,74,1)",fill:this.averageIncome>=0?"rgba(0,255,172,0.1)":"rgba(250,76,74,0.1)"}:{color:this.averageIncome>=0?"rgba(0,142,114,1)":"rgba(233,18,18,1)",fill:this.averageIncome>=0?"rgba(0,142,114,0.1)":"rgba(233,18,18,0.1)"}},titleText:function(){return this.subscriber?"Доход от пользователя ".concat(this.nameUser):"Доход ".concat(this.subscription?"провайдера":"от подписки на"," ").concat(this.nameUser)}},methods:{combinedData:function(){var t={};this.statByAccount.forEach((function(e){e.data.forEach((function(e){var i=new Date(e.date).getTime(),o=100*e.profitClose/e.usedVolume;!isNaN(o)&&e.usedVolume||(o=0),t[i]?t[i].push(o):t[i]=[o]}))}));var e=Object.entries(t).sort((function(t,e){return+t[0]-+e[0]})),i=e.map((function(t){var e=Object(D["a"])(t,2),i=e[0],o=e[1];return 1===o.length?[+i,o[0]]:[+i,o.reduce((function(t,e){return t+e}),0)/o.length]}));return this.averageIncome=i.at(-1)[1],i},calcXPoints:function(){var t=[];return this.statByAccount.forEach((function(e){e.data.forEach((function(e){return t.push(new Date(e.date).getTime())}))})),t},calcYPoints:function(){var t=[];return this.combinedData().forEach((function(e){return t.push(e[1])})),t},daysCalcData:function(){return this.combinedData()}}},YUt=zUt,XUt=(i("402b"),Object(C["a"])(YUt,HUt,GUt,!1,null,"1d133fe3",null)),QUt=XUt.exports,JUt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"StatDataGraph"},[e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"graph"},[e("SimpleChart",{attrs:{fixedWidth:294,fixedHeight:200,points:t.getChartPoints,margin:{top:3,right:3,bottom:0,left:3},smooth:t.getChartPoints.length>2,color:t.dark?"rgba(204,232,227, .2)":"#CCE8E3",zeroGradient:t.dark?"rgba(137, 239, 215, 0.23)":"rgba(137, 239, 215, 0.53)",firstGradient:"rgba(220, 255, 237, 0)"}})],1),e("h5",[t._v("Успешных сделок")]),e("div",{staticClass:"descriptionText"},[t._v(t._s(t.ordersClosedProfit)+" из "+t._s(t.totalClosedOrders)),e("br"),t._v("прибыльных сделок")]),e("ProgressRoundDiagram",{key:t.keyVisibleModal,attrs:{width:100,height:100,widthBorder:12,percent:t.getProfitOrdersPercent}})],1),e("div",{staticClass:"averageIncome"},[e("img",{staticClass:"mock",attrs:{src:i("fd0c"),alt:""}}),e("h5",[t._v("Средний доход по сделке")]),e("div",{staticClass:"value green"},[t._v("+126.7%")])]),e("div",{staticClass:"profitability"},[e("h5",[t._v("Доходность")]),e("div",{staticClass:"value",class:t.profitabilityClass},[t._v(t._s(t.profitabilityPortfolioFormatted)+"%")])]),e("div",{staticClass:"maxDd"},[e("h5",[t._v("MaxDD")]),e("div",{staticClass:"value red"},[t._v(t._s(t.drawDown)+"%")])]),e("div",{staticClass:"coefSharp"},[e("h5",[t._v("Коэф. Шарпа")]),e("div",{staticClass:"value orange"},[t._v(t._s(t.ratioSharpPortfolioFormatted))])])])},KUt=[],ZUt={name:"StatDataGraph",mixins:[xt],props:{keyVisibleModal:{type:Boolean},getProfitOrdersPercent:{type:Number},ordersClosedProfit:{type:Number},totalClosedOrders:{type:Number},getChartPoints:{type:Array},profitabilityPortfolio:{type:Number},ratioSharpPortfolioFormatted:{type:Number},stat:{type:Array}},components:{ProgressRoundDiagram:c$,SimpleChart:BT},computed:{dark:function(){return this.darkClass.dark},profitabilityPortfolioFormatted:function(){return this.profitabilityPortfolio.toFixed(2)},profitabilityClass:function(){return{green:this.profitabilityPortfolio>=0,red:this.profitabilityPortfolio<0}},drawDown:function(){var t=[];return this.stat.forEach((function(e){var i,o;if(e.data.forEach((function(t,e,i){if(0!==e){var n,s=100*t.profitClose/t.usedVolume,r=100*i[e-1].profitClose/i[e-1].usedVolume;isNaN(s)&&(s=0),isNaN(r)&&(r=0),n=s>=r?0:s-r,(!o||n=0)t.push(0);else{var n=100*o.dropDown/o.profitOpen;n=n>0?-1*n:n;var s=n.toFixed(2);"-0.00"!==s&&"0.00"!==s?t.push(+s):t.push(0)}})),Math.min.apply(Math,t)}}},tVt=ZUt,eVt=(i("63e0"),Object(C["a"])(tVt,JUt,KUt,!1,null,"40b164fd",null)),iVt=eVt.exports,oVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SceletonUserInformation"},[e("div",{staticClass:"headerPopup"},[e("Sceleton")],1),e("div",{staticClass:"contentModal"},[e("div",{staticClass:"leftBlock"},[e("div",{staticClass:"avatarBlock",class:{subscriber:t.subscriber}},[e("Sceleton")],1),e("div",{staticClass:"commonInfoBlock"},[e("Sceleton")],1)]),e("div",{staticClass:"rightBlock"},[e("div",{staticClass:"profitGraph",class:{subscriber:t.subscriber}},[e("Sceleton")],1),t.subscriber?t._e():e("div",{staticClass:"statDataGraph"},[e("div",{staticClass:"successfulTransactions"},[e("Sceleton")],1),e("div",{staticClass:"averageIncome"},[e("Sceleton")],1),e("div",{staticClass:"profitability"},[e("Sceleton")],1),e("div",{staticClass:"maxDd"},[e("Sceleton")],1),e("div",{staticClass:"coefSharp"},[e("Sceleton")],1)])])])])},nVt=[],sVt={name:"SceletonUserInformation",props:{subscriber:{type:Boolean,default:!1}},components:{Sceleton:nT}},rVt=sVt,aVt=(i("df14"),Object(C["a"])(rVt,oVt,nVt,!1,null,"8dd1f69e",null)),cVt=aVt.exports,lVt={name:"UserInformation",mixins:[xt,oH],props:{nameUser:{type:String},dataRow:{type:Object},keyVisibleModal:{type:Boolean},isVisiblePopup:{type:Boolean},subscriber:{type:Boolean},subscription:{type:Boolean},content:{type:Boolean}},components:{AvatarBlock:jUt,CommonInfoBlock:VUt,ProfitGraph:QUt,StatDataGraph:iVt,SceletonUserInformation:cVt},data:function(){return{isLoadingStatData:!0,statByAccount:[]}},computed:{expertsForStat:function(){if(this.statByAccount.length>0)return this.statByAccount},totalClosedOrders:function(){if(this.statByAccount.length>0)return this.statByAccount.reduce((function(t,e){return t+e.data.at(-1).closedCount}),0)},ordersClosedProfit:function(){if(this.statByAccount.length>0)return this.statByAccount.reduce((function(t,e){return t+e.data.at(-1).pClosedCount}),0)},getAccountGroup:function(){return this.dataRow.sourceAccountGroup},getSequenceId:function(){return this.dataRow.sourceSequenceId},classGroup:function(){return{red:"Demo"===this.getAccountGroup}},accountId:function(){return this.subscriber?this.dataRow.accountId:this.dataRow.sourceAccountId},symbols:function(){return this.dataRow.portfolioUser||this.subscriber?this.dataRow.sources.map((function(t){return t.contract})):[this.dataRow.contract]}},watch:{isVisiblePopup:function(t){t?(this.getStatByContract(),this.$socketStream.$on("apiWS3",this.setMessageHandler)):(this.isLoadingStatData=!0,this.$socketStream.$off("apiWS3",this.setMessageHandler),this.statByAccount=[])}},methods:{closeModal:function(){this.$emit("closeModal")},getStatByContract:function(){var t={command:"ContractStatisticsByAccount",method:"get",data:{AccountId:this.accountId,contracts:this.symbols}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHandler:function(t){if("ContractStatisticsByAccount"===(null===t||void 0===t?void 0:t.command)){var e=Td(JSON.parse(t.data));this.setStat(e)}},setStat:function(t){var e=this;t&&t.dailyData.accountId===this.accountId&&(this.symbols.forEach((function(i){var o=t.data.filter((function(t){return t.contract===i}));e.statByAccount.push({data:o})})),this.isLoadingStatData=!1)}}},uVt=lVt,dVt=(i("8158"),Object(C["a"])(uVt,kUt,IUt,!1,null,"37cc3584",null)),hVt=dVt.exports,pVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PortfolioInformation"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.isLoadingPortfolioStat?e("div",{key:"loadingSceleton",staticClass:"loadingSceleton"},[e("SceletonForPortfolio")],1):e("div",{key:"portfolioContent",staticClass:"wrapperContent"},[e("header",{staticClass:"headerPopup"},[e("div",{staticClass:"leftHeaderPart"},[e("svgIcon",{attrs:{name:"RegPartner"}}),e("div",{staticClass:"namePortfolio"},[t._v(t._s(t.namePortfolio))])],1),e("div",{staticClass:"usersRightPart"},[t._l(t.avatarsSlice,(function(t){return e("img",{key:t.id,staticClass:"imgAvatar",attrs:{src:t.avatar}})})),t.avatars.length>5?e("div",{staticClass:"imgAvatar avatarMore"},[t._v("+"+t._s(t.dopAvatarLength))]):t._e()],2)]),e("div",{staticClass:"contentPopupPortfolio"},[e("div",{staticClass:"commonBlock"},[e("div",{staticClass:"graph"},[e("SimpleChart",{attrs:{fixedWidth:300,fixedHeight:158,points:t.getChartPoints,margin:{top:3,right:3,bottom:0,left:3},smooth:t.getChartPoints.length>2,color:t.dark?"rgba(204,232,227, .2)":"#CCE8E3",zeroGradient:t.dark?"rgba(137, 239, 215, 0.23)":"rgba(137, 239, 215, 0.53)",firstGradient:"rgba(220, 255, 237, 0)"}})],1),e("div",{staticClass:"successfulTransactions"},[e("div",{staticClass:"titleText"},[t._v("Успешных сделок")]),e("div",{staticClass:"circleGraph"},[e("ProgressRoundDiagram",{attrs:{width:100,height:100,widthBorder:12,percent:t.getProfitOrdersPercent}})],1),e("div",{staticClass:"infoText"},[t._v("438 из 468"),e("br"),t._v("прибыльных сделок")])]),e("div",{staticClass:"averageAndGrowt"},[e("div",{staticClass:"averageValue"},[e("div",{staticClass:"title"},[t._v("Средний доход в мес.")]),e("div",{staticClass:"value",class:t.valueClassMontPortfolio},[t._v(t._s(t.monthProfitPortfolioFormatted))])]),e("div",{staticClass:"growtValue"},[e("div",{staticClass:"title"},[t._v("Текущий доход")]),e("div",{staticClass:"value",class:t.valueClassCurrentIncomePortfolio},[t._v(t._s(t.currentIncomePortfolioFormatted))])])])]),e("div",{staticClass:"profitability"},[e("div",{staticClass:"title"},[t._v("Доходность")]),e("div",{staticClass:"value",class:t.incomeClass},[t._v(t._s(t.averageIncomeFormatted)+"%")])]),e("div",{staticClass:"maxdd"},[e("div",{staticClass:"title"},[t._v("MaxDD")]),e("div",{staticClass:"value red"},[t._v("-0.34%")])]),e("div",{staticClass:"coefSharpe"},[e("div",{staticClass:"title"},[t._v("Коэф. Шарпа")]),e("div",{staticClass:"value green"},[t._v(t._s(t.ratioSharpPortfolioFormatted))])])])])])],1)},gVt=[],fVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"wrapperContent"},[e("div",{staticClass:"headerPopup"},[e("Sceleton")],1),e("div",{staticClass:"contentPopupPortfolio"},[e("div",{staticClass:"commonBlock"},[e("div",{staticClass:"successfulTransactions"},[e("Sceleton")],1),e("div",{staticClass:"averageAndGrowt"},[e("div",{staticClass:"averageValue"},[e("Sceleton")],1),e("div",{staticClass:"growtValue"},[e("Sceleton")],1)])]),e("div",{staticClass:"profitability"},[e("Sceleton")],1),e("div",{staticClass:"maxdd"},[e("Sceleton")],1),e("div",{staticClass:"coefSharpe"},[e("Sceleton")],1)])])},mVt=[],vVt={name:"SceletonForPortfolio",components:{Sceleton:nT}},yVt=vVt,CVt=(i("2e04e"),Object(C["a"])(yVt,fVt,mVt,!1,null,"28cc54b0",null)),bVt=CVt.exports,SVt={name:"PortfolioInformation",mixins:[xt,oH],props:{dataRow:{type:Object},keyVisibleModal:{type:Boolean},isVisiblePopup:{type:Boolean}},components:{ProgressRoundDiagram:c$,SceletonForPortfolio:bVt,SimpleChart:BT},data:function(){return{expertsByFindPortfolio:[],isLoadingPortfolioStat:!0}},computed:{dark:function(){return this.darkClass.dark},expertsForStat:function(){if(this.expertsByFindPortfolio.length>0)return this.expertsByFindPortfolio},namePortfolio:function(){return this.dataRow.name},avatars:function(){return this.dataRow.sources.map((function(t){return{avatar:t.userInfo.avatarURL,id:t.id}}))},avatarsSlice:function(){return this.avatars.slice(0,5)},dopAvatarLength:function(){return this.avatars.length-5}},watch:{isVisiblePopup:function(t){t?(this.getStatByPortfolio(),this.$socketStream.$on("apiWS3",this.setMessageHandler)):(this.isLoadingPortfolioStat=!0,this.$socketStream.$off("apiWS3",this.setMessageHandler),this.expertsByFindPortfolio=[])}},methods:{getStatByPortfolio:function(){var t={command:"ContractStatisticsByInvestBags",method:"get",data:{InvestBagIds:[this.dataRow.id],StatisticType:0}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHandler:function(t){if("ContractStatisticsByInvestBags"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);this.setStatPortfolio(e[1][0][1]),this.isLoadingPortfolioStat=!1}},setStatPortfolio:function(t){var e=this;t.forEach((function(t){var i=t[1][0][1];e.expertsByFindPortfolio.push({data:i})}))}}},PVt=SVt,TVt=(i("80f8"),Object(C["a"])(PVt,pVt,gVt,!1,null,"2ecab5a6",null)),xVt=TVt.exports,OVt={name:"PopupInformation",props:{getName:{type:String},keyVisibleModal:{type:Boolean},isVisiblePopup:{type:Boolean},isPortfolio:{type:Boolean},onShown:{type:Function},hidden:{type:Function},dataRow:{type:Object},subscriber:{type:Boolean,default:!1},subscription:{type:Boolean,default:!1},content:{type:Boolean,default:!1}},components:{UserInformation:hVt,PortfolioInformation:xVt,DxPopup:To["DxPopup"]},computed:{widthPopup:function(){return this.isPortfolio?300:this.subscriber?850:900},heightPopup:function(){return this.isPortfolio?250:this.subscriber?608:700}}},wVt=OVt,_Vt=(i("7dee"),Object(C["a"])(wVt,AUt,DUt,!1,null,"2ab48f11",null)),AVt=_Vt.exports,DVt={data:function(){return{isVisiblePopup:!1,keyVisibleModal:!1}},computed:{isVisibleImg:function(){return!(!this.subscriber||!Array.isArray(this.dataRow))||!this.isPortfolio},isPortfolio:function(){return!!Array.isArray(this.dataRow)||(this.dataRow.portfolio||this.tableCopy)},getAvatar:function(){var t,e,i;return this.subscriber?Array.isArray(this.dataRow)?null===(t=this.dataRow[0])||void 0===t?void 0:t.avatarURL:null===(e=this.dataRow)||void 0===e?void 0:e.avatarURL:this.content?this.dataRow.srcAvatarURL:this.portfolio?void 0:this.dataRow.sourceAvatar||(null===(i=this.dataRow.subscription)||void 0===i?void 0:i.sourceAvatar)},getName:function(){if(this.content){var t=this.dataRow,e=t.srcFirstName,i=t.srcLastName;return"".concat(e||""," ").concat(i||"")}return Array.isArray(this.dataRow)?this.dataRow[0].name:this.dataRow.name},getSequenceId:function(){return this.content?this.dataRow.srcAccountSequenceId:this.dataRow.sourceSequenceId},propsForPopupInformation:function(){return{dataRow:this.dataRow,getName:this.getName,keyVisibleModal:this.keyVisibleModal,isVisiblePopup:this.isVisiblePopup,isPortfolio:this.isPortfolio,onShown:this.onShown,hidden:this.hidden,subscriber:this.subscriber}}},methods:{openModalWithUserInformation:function(){this.content||(this.isVisiblePopup=!0)},hidden:function(){this.isVisiblePopup=!1},onShown:function(){this.keyVisibleModal=!this.keyVisibleModal}}},kVt={name:"NameUserOrPortfolio",mixins:[DVt,xt],props:{dataRow:{type:[Object,Array]},content:{type:Boolean,default:!1},subscriber:{type:Boolean,default:!1},subscription:{type:Boolean,default:!1},subscriptionSubscriber:{type:Boolean,default:!1},tableCopy:{type:Boolean}},components:{PopupInformation:AVt}},IVt=kVt,BVt=(i("3c10"),Object(C["a"])(IVt,wUt,_Ut,!1,null,"5f6f57e0",null)),MVt=BVt.exports,$Vt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PriceData",class:t.darkClass},[t._v(t._s(t.price))])},LVt=[],FVt={name:"PriceData",mixins:[xt],props:{dataRow:{type:Object},subscriber:{type:Boolean,default:!1},tableCopy:{type:Boolean},getListInvestPortfolios:{type:Array}},computed:{profit:function(){var t=this,e=this.getListInvestPortfolios.find((function(e){return e.id===t.dataRow.id}));return e.profitClose},price:function(){if("Percent"===this.dataRow.bagContents[0].priceType){var t=this.dataRow.bagContents.reduce((function(t,e){return t+e.price}),0),e=t/this.dataRow.bagContents.length,i=this.profit<=0?0:e*this.profit/100;return"$ ".concat(Lm(i,2,!0)," (SF ").concat(Lm(e,2,!0)," %)")}return"FIX $ "+this.dataRow.bagContents.reduce((function(t,e){return t+e.price}),0)}}},jVt=FVt,RVt=(i("a73a"),Object(C["a"])(jVt,$Vt,LVt,!1,null,"2a1b5ee8",null)),WVt=RVt.exports,NVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TimeEnd",class:t.darkClass},[e("svgIcon",{attrs:{name:"time-validity",size:16}}),e("div",{staticClass:"valueTime"},[t._v(t._s(t.dateEndValue))])],1)},EVt=[],UVt={computed:{dateEndValue:function(){if(this.subscriber){var t,e=(null===(t=this.dataRow)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.priceType)||this.dataRow.priceType;if("Money"===e){var i,o=(null===(i=this.dataRow)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.startDateTime)||this.dataRow.startDateTime,n=new Date(o).getTime(),s=n+2592e6;return"до ".concat(new Date(s).toLocaleDateString())}return this.$t("before_cancelled").toLocaleLowerCase()}if("Money"===this.dataRow.bagContents[0].priceType){var r=new Date(this.dataRow.startDateTime).getTime(),a=r+2592e6;return"до ".concat(new Date(a).toLocaleDateString())}return this.$t("before_cancelled").toLocaleLowerCase()}}},VVt={name:"TimeEnd",mixins:[UVt,xt],props:{dataRow:{type:[Object,Array]},content:{type:Boolean,default:!1},subscriber:{type:Boolean}},computed:{isPortfolio:function(){return this.dataRow.portfolio}}},HVt=VVt,GVt=(i("0a6d"),Object(C["a"])(HVt,NVt,EVt,!1,null,"2e8a2971",null)),qVt=GVt.exports,zVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Status",class:t.rootClass},[t._v(t._s(t.statusValue))])},YVt=[],XVt={name:"Status",mixins:[xt],props:{dataRow:{type:Object}},computed:{isPortfolio:function(){return this.dataRow.portfolio},activeStatus:function(){return!!this.dataRow.startDateTime},statusValue:function(){return this.isPortfolio?"Active"===this.dataRow.status?this.$t("investing"):this.$t("paused"):this.activeStatus?this.$t("active"):this.$t("inactive")},rootClass:function(){return Object(c["a"])({red:!this.isPortfolio&&!this.activeStatus,blue:this.isPortfolio&&"Pause"===this.dataRow.status},this.darkClass)}}},QVt=XVt,JVt=(i("a0f9"),Object(C["a"])(QVt,zVt,YVt,!1,null,"44458502",null)),KVt=JVt.exports,ZVt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitData",class:t.darkClass},[t._v("$ 10")])},tHt=[],eHt={name:"ProfitData",mixins:[xt]},iHt=eHt,oHt=(i("fa8c"),Object(C["a"])(iHt,ZVt,tHt,!1,null,"37c90c63",null)),nHt=oHt.exports,sHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ToBePaid",class:t.darkClass},[t._v("$ 1.25")])},rHt=[],aHt={name:"ToBePaid",mixins:[xt]},cHt=aHt,lHt=(i("e9a7"),Object(C["a"])(cHt,sHt,rHt,!1,null,"4acd2e27",null)),uHt=lHt.exports,dHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ActiveButton",class:t.darkClass},[t.isPortfolio?e("div",{staticClass:"portfolioButtons"},["Play"===t.pauseOrPlay?e("div",{staticClass:"pauseOrPlayWrapper"},[t.isLoadingPauseOrPlay?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",{staticClass:"pauseOrPlay",on:{click:t.pauseOrPlayHandler}},[e("svgIcon",{attrs:{name:t.pauseOrPlay}})],1)],1):t._e(),e("div",{staticClass:"stopPortfolioWrapper"},[t.isLoadingStop?e("DxLoadIndicator",{attrs:{height:20,width:20}}):e("span",{staticClass:"stopPortfolio",on:{click:t.stopPortfolioHandler}},[e("svgIcon",{attrs:{name:"Stop"}})],1)],1)]):e("div",{staticClass:"contractButtons"},[t.content?t._e():e("span",{staticClass:"settings",on:{click:function(e){return t.openModal({follow:"exist"})}}},[e("svgIcon",{attrs:{name:"Settings"}})],1),e("span",{staticClass:"closedContract",on:{click:t.deleteRow}},[e("svgIcon",{attrs:{name:"Close-mini"}})],1)])])},hHt=[],pHt={data:function(){return{isLoadingPauseOrPlay:!1,isLoadingStop:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getServerTime:"serverTime/getServerTime",getUserInfo:"user/getUserDetail",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{isPortfolio:function(){return this.dataRow.portfolio||this.tableCopy},isPortfolioUser:function(){return this.dataRow.portfolioUser},pauseOrPlay:function(){return"Pause"===this.dataRow.status?"Play":"Pause"},messageText:function(){return this.content?"Деньги за контент не возвращаются и не пересчитываются. \n Вы уверены, что хотите отписаться от контента пользователя?":"\n ".concat("subscription"!==this.typeTable?" Деньги за автоследование не возвращаются и не пересчитываются.":"","\n Вы уверены, что хотите отменить подписку на ").concat(this.isPortfolioUser?"портфель":"сигналы"," \n пользователя?")}}),methods:Object(c["a"])(Object(c["a"])(Object(c["a"])({},Object(p["d"])({setStatusPortfolio:"subscriptionsContract/setStatusPortfolio"})),Object(p["b"])({showToast:"toast/showToast",setPopupData:"modalSubscribe/setPopupData",changeInvestBagStatus:"expertsPortfolio/changeInvestBagStatus",deleteSubscription:"subscriptionsContract/deleteSubscription",getDataByBagOpenOrders:"expertsPortfolio/getDataByBagOpenOrders",deleteContent:"subscriptionsContract/deleteContent",getAccountsUser:"subscribeOrders/getAccountsUser",getSubscription:"subscription/getSubscription"})),{},{arrayFunctionPortfolioUser:function(){var t=this,e=[];return this.dataRow.sources.forEach((function(i){var o=Object(c["a"])(Object(c["a"])({},i),{},{stopDateTime:t.getServerTime.now});e.push(t.deleteSubscription.bind(null,{objectData:o,portfolioUser:!0}))})),this.getDefaultAccount.sequenceId===this.sequenceId&&e.push(this.getSubscription.bind(null,{type:"Account",id:this.getDefaultAccount.id,allData:!1})),e},arrayFunctionOneSubscription:function(){var t=[],e=Object(c["a"])(Object(c["a"])({},this.dataRow.subscription),{},{stopDateTime:this.getServerTime.now});return t.push(this.deleteSubscription.bind(null,{objectData:e,typeTable:this.typeTable})),t.push(this.getSubscription.bind(null,{type:"Account",id:this.getDefaultAccount.id,allData:!1})),t},arrayFunctionContent:function(){return[this.deleteContent.bind(null,this.dataRow)]},deleteRow:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=[],t.isPortfolioUser?i.push.apply(i,Object(x["a"])(t.arrayFunctionPortfolioUser())):t.content?i.push.apply(i,Object(x["a"])(t.arrayFunctionContent())):i.push.apply(i,Object(x["a"])(t.arrayFunctionOneSubscription())),t.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{visibleButtonAction:!0,functionArray:i,message:t.messageText}});case 3:case"end":return e.stop()}}),e)})))()},changeStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,e.changeInvestBagStatus({bagId:e.dataRow.id,status:t,changeStatus:!0});case 2:case"end":return i.stop()}}),i)})))()},getInvestBagOpenOrders:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getDataByBagOpenOrders(t.dataRow.id);case 2:return i=e.sent,e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)})))()},setStatus:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var o;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if("Active"!==t){i.next=5;break}return i.next=3,e.changeStatus(t);case 3:return e.setStatusPortfolio({newStatus:"Active",bagId:e.dataRow.id}),i.abrupt("return");case 5:return i.next=7,e.getInvestBagOpenOrders();case 7:o=i.sent,e.showToast({visible:!0,componentName:"ToastMessage",shading:!0,dopInfo:{visibleButtonAction:!0,functionArray:[e.changeStatus.bind(null,t),e.setStatusPortfolio.bind(null,{newStatus:t,bagId:e.dataRow.id})],message:e.getTextMessage(t,o)}});case 9:case"end":return i.stop()}}),i)})))()},getTextMessage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.count?"".concat(this.$t("tanotitp")[0](e.count),"
\n ").concat(this.$t("tanotitp")[1]," ≈ $ ").concat(Math.abs(e.profit),". \n ").concat(this.$t("aystywtsi")):this.$t("aystywtsi")},pauseOrPlayHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoadingStop){e.next=2;break}return e.abrupt("return");case 2:if(t.isLoadingPauseOrPlay=!0,"Play"!==t.pauseOrPlay){e.next=8;break}return e.next=6,t.setStatus("Active");case 6:return t.isLoadingPauseOrPlay=!1,e.abrupt("return");case 8:return e.next=10,t.setStatus("Pause");case 10:t.isLoadingPauseOrPlay=!1;case 11:case"end":return e.stop()}}),e)})))()},stopPortfolioHandler:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isLoadingPauseOrPlay){e.next=2;break}return e.abrupt("return");case 2:return t.isLoadingStop=!0,e.next=5,t.setStatus("Stoped");case 5:t.isLoadingStop=!1;case 6:case"end":return e.stop()}}),e)})))()}})},gHt={name:"ActiveButton",mixins:[pHt,xt],props:{dataRow:{type:Object},typeTable:{type:String,default:"copy"},content:{type:Boolean,default:!1},sequenceId:{type:[Number,Boolean]},tableCopy:{type:Boolean}},components:{DxLoadIndicator:OT["DxLoadIndicator"]}},fHt=gHt,mHt=(i("c302"),Object(C["a"])(fHt,dHt,hHt,!1,null,"da4e24ce",null)),vHt=mHt.exports,yHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyProfitCopy",class:t.dopClass},[t._v(" $ "+t._s(t.myProfit.valueFormatted))])},CHt=[],bHt={name:"MyProfitCopy",mixins:[xt],props:{dataRow:{type:Object},getListInvestPortfolios:{type:Array}},components:{},data:function(){return{}},computed:{profit:function(){var t=this,e=this.getListInvestPortfolios.find((function(e){return e.id===t.dataRow.id}));return e.profitClose},myProfit:function(){if(!this.profit||this.profit<0)return{value:0,valueFormatted:0};if("Percent"===this.dataRow.bagContents[0].priceType){var t=this.dataRow.bagContents[0].price,e=this.profit*t/100;return{value:this.profit-e,valueFormatted:Lm(this.profit-e,2,!0)}}return{value:this.profit,valueFormatted:Lm(this.profit,2,!0)}},dopClass:function(){return Object(c["a"])({red:this.myProfit.value<0},this.darkClass)}},watch:{},mounted:function(){},destroyed:function(){},methods:{}},SHt=bHt,PHt=(i("1b23"),Object(C["a"])(SHt,yHt,CHt,!1,null,"5e02a46c",null)),THt=PHt.exports,xHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CurrentProfitCopy",class:t.dopClass},[t._v("$ "+t._s(t.profit.valueFormatted))])},OHt=[],wHt={name:"CurrentProfitCopy",mixins:[xt],props:{dataRow:{type:Object},getListInvestPortfolios:{type:Array}},components:{},data:function(){return{}},computed:{profit:function(){var t=this,e=this.getListInvestPortfolios.find((function(e){return e.id===t.dataRow.id}));return{valueFormatted:Lm(e.profitClose,2,!0),value:e.profitClose}},dopClass:function(){return Object(c["a"])({red:this.profit.value<0},this.darkClass)}}},_Ht=wHt,AHt=(i("25b6"),Object(C["a"])(_Ht,xHt,OHt,!1,null,"f0248466",null)),DHt=AHt.exports,kHt={name:"TableCopy",mixins:[xt],props:{sequenceId:{type:[Number,Boolean],default:null},sliceBySignals:{type:[Array,Boolean]},report:{type:Boolean,default:!1}},components:{DxDataGrid:rUt["DxDataGrid"],DxColumn:rUt["DxColumn"],SceletonTable:hUt,NoData:yUt,DateCreated:OUt,NameUserOrPortfolio:MVt,PriceData:WVt,ContractData:q$,TimeEnd:qVt,Status:KVt,ProfitData:nHt,ToBePaid:uHt,ActiveButton:vHt,LabelBlock:sit,MyProfitCopy:THt,CurrentProfitCopy:DHt,TableColumnsCustom:p2},data:function(){return{investPortolios:null,sizeColumnsTable:null,loadingData:!0}},getDefaultAccount:function(t){t&&this.mountedHandler()},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getActivePortfolios:"expertsPortfolio/getActivePrortfolios",getIncome:"statistic/getYearsStat",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{columns:function(){var t=[{id:1,title:this.$t("date"),field:"startDateTime",align:"left",cellTemplate:"cell-startDate"},{id:2,title:this.$t("portfolio_provider"),field:"name",align:"left",cellTemplate:"cell-name"},{id:3,title:this.$t("instruments"),field:"openDate",align:"left",cellTemplate:"cell-instrument"},{id:4,title:this.$t("fee"),field:"commission",align:"left",cellTemplate:"cell-commission"},{id:5,title:this.$t("portfolio_income"),field:"currentCopyProfit",align:"left",cellTemplate:"cell-current-copy-profit"},{id:6,title:this.$t("my_income"),field:"profit",align:"left",cellTemplate:"cell-myProfit"},{id:7,title:this.$t("ending_at"),field:"closeDate",align:"left",cellTemplate:"cell-closeDate"},{id:8,title:this.$t("status"),field:"status",align:"left",cellTemplate:"cell-status"}];return this.report||t.push({id:9,title:"",field:"activeButton",align:"right",cellTemplate:"cell-active"}),t},isTablet:function(){var t=document.documentElement.clientWidth;return t<1150},noDataVisible:function(){var t;return 0===(null===(t=this.getActivePortfolios)||void 0===t?void 0:t.length)},countCopy:function(){return this.getActivePortfolios.length},allIncome:function(){var t=this,e=0;return this.getActivePortfolios.forEach((function(i){var o=t.getListInvestPortfolios.find((function(t){return t.id===i.id}));e+=o.profitClose})),{value:e,valueFormatted:Lm(e,2,!0)}},myIncome:function(){var t=this,e=0;return this.getActivePortfolios.forEach((function(i){var o=t.getListInvestPortfolios.find((function(t){return t.id===i.id}));if("Percent"===i.bagContents[0].priceType){var n=i.bagContents[0].price,s=o.profitClose*n/100;e+=o.profitClose-s}else e+=o.profitClose})),"$ "+Lm(e,2,!0)},fee:function(){var t=this;if(!this.investPortolios||!this.investPortolios[1])return 0;var e=0;return this.getActivePortfolios.forEach((function(i){var o=t.getListInvestPortfolios.find((function(t){return t.id===i.id}));if("Percent"===i.bagContents[0].priceType){var n=i.bagContents[0].price,s=o.profitClose*n/100;e+=s}else{var r=i.bagContents.reduce((function(t,e){return t+e.price}),0);e+=r}})),Lm(e,2,!0)},getListInvestPortfolios:function(){var t=this;if(this.investPortolios&&this.investPortolios[1]){var e=Object(x["a"])(new Set(this.investPortolios[1].map((function(t){return t[0]})))),i=[];return e.forEach((function(e){var o=t.investPortolios[0]&&t.investPortolios[0].length?t.investPortolios[0].filter((function(t){return t[0]===e})).map((function(t){return t[3]})).reduce((function(t,e){return t+e}),0):0;i.push({id:e,profitClose:o})})),i}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio"})),{},{getSizeArr:function(t){this.sizeColumnsTable=t},getInvestorStat:function(){var t={command:"GetInvestorStatisticByContract",data:{id:this.getDefaultAccount.id}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHendler:function(t){var e=this;if("GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command))this.getListsPortfolio(Kq(JSON.parse(t.data))),this.$nextTick((function(){e.loadingData=!1}));else if("GetInvestorStatisticByContract"===(null===t||void 0===t?void 0:t.command)){var i=JSON.parse(t.data);i&&i[0]&&i[1]&&(this.investPortolios=JSON.parse(t.data))}},mountedHandler:function(){this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Active"]}),this.getInvestorStat()}}),mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHendler),this.getDefaultAccount&&this.mountedHandler()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHendler)}},IHt=kHt,BHt=(i("aa1a"),Object(C["a"])(IHt,nUt,sUt,!1,null,"47bcd089",null)),MHt=BHt.exports,$Ht={data:function(){return{}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({defaultAccount:"subscribeOrders/getDefaultAccount",copyData:"subscriptionsContract/copyData",isLoadingData:"subscriptionsContract/isLoadingData",apiUri:"api/api",getSession:"auth/getSession"})),{},{componentName:function(){var t;return null===(t=this.$route.meta)||void 0===t?void 0:t.componentName},isMountedAction:function(){var t=["Investing","Report","Subscribers"];return t.includes(this.componentName)}}),watch:{defaultAccount:{handler:function(t){t.id&&this.getSubscriptionAndPortfolio({accountId:t.id})},deep:!0}},activated:function(){this.isMountedAction||this.mountedHandler()},mounted:function(){this.isMountedAction&&this.mountedHandler()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getSubscriptionAndPortfolio:"subscriptionsContract/getSubscriptionAndPortfolio"})),{},{mountedHandler:function(){var t;null!==(t=this.defaultAccount)&&void 0!==t&&t.id&&this.getSubscriptionAndPortfolio({accountId:this.defaultAccount.id})}})},LHt={name:"MyLastFiveInvestments",inject:{goToSelectedTab:{from:"goToSelectedTab",default:function(){}}},mixins:[$Ht,xt],props:{},components:{TableCopy:MHt},computed:{isVisibleLink:function(){var t;return"UserProfile"===(null===(t=this.$route.meta)||void 0===t?void 0:t.componentName)}}},FHt=LHt,jHt=(i("2762"),Object(C["a"])(FHt,iUt,oUt,!1,null,"252cd795",null)),RHt=jHt.exports,WHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyLastFiveSubscribers",class:t.darkClass},[e("header",[t._v(t._s(t.$t("ml5s"))),t.isVisibleLink?e("span",{staticClass:"linkToSubscriber",on:{click:function(e){return t.goToSelectedTab("MySubscribersProfile")}}},[t._v(t._s(t.$t("all_subscribers")))]):t._e()]),e("TableCopySubscriber",{attrs:{report:!0}})],1)},NHt=[],EHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TableCopySubscriber",class:t.darkClass},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.sceletonVisible?e("SceletonTable"):t.noDataVisible?e("NoData"):e("div",{staticClass:"contentTable"},[t.isPagination?e("TablePagination",{attrs:{pageCount:t.pageCount,currentPage:t.currentPage,currentCount:t.currentCount,pageSize:t.pageSize,dataTableLength:t.dataTableLength},on:{setPage:t.setPage,setCount:t.setCount}},[e("SearchAndFilter",{attrs:{searchValue:t.searchValue,contractsList:t.contractsList},on:{setSearchValue:t.setSearchValue,setContract:t.setContract}})],1):t._e(),e("div",{staticClass:"scrollContent"},[e("TableColumnsCustom",{attrs:{dataTable:t.tableData,columns:t.columns,resizeEnabled:!0,heightRow:36,stickyHeader:!0,emitSize:!0},on:{getSizeArr:t.getSizeArr},scopedSlots:t._u([{key:"cell-startDate",fn:function(t){var i=t.data;return[e("DateCreated",{attrs:{dataRow:i,subscriber:!0}})]}},{key:"cell-name",fn:function(t){var i=t.data;return[e("NameUserOrPortfolio",{attrs:{dataRow:i,subscriber:!0}})]}},{key:"cell-instrument",fn:function(t){var i=t.data;return[e("ContractData",{attrs:{dataRow:i,subscriber:!0}})]}},{key:"cell-investCapital",fn:function(i){var o=i.data;return[e("InvestCapitalSubscriber",{attrs:{dataRow:o,allDataProfit:t.allDataProfit}})]}},{key:"cell-commission",fn:function(t){var i=t.data;return[e("Commission",{attrs:{dataRow:i}})]}},{key:"cell-netIncome",fn:function(i){var o=i.data;return[e("NetIncomeSubscriber",{attrs:{dataRow:o,allDataProfit:t.allDataProfit}})]}},{key:"cell-closeDate",fn:function(t){var i=t.data;return[e("TimeEnd",{attrs:{dataRow:i,subscriber:!0}})]}},{key:"cell-status",fn:function(t){var i=t.data;return[e("Status",{attrs:{dataRow:i}})]}}])})],1)],1)],1),t.sceletonVisible||t.noDataVisible?t._e():e("footer",{class:{report:t.report}},[e("div",{staticClass:"emptyBlock",style:{"--width":t.sizes[0]+"%"}}),e("LabelBlock",{staticClass:"countSubscriber",style:{"--width":t.sizes[1]+"%"},attrs:{title:t.$t("number"),value:t.subscriberCopy.length}}),e("div",{staticClass:"emptyBlock",style:{"--width":t.sizes[2]+"%"}}),e("div",{staticClass:"emptyBlock",style:{"--width":t.sizes[3]+"%"}}),e("LabelBlock",{staticClass:"allIncome",style:{"--width":t.sizes[4]+"%"},attrs:{title:t.$t("my_net_income"),value:t.myProfitForProfitCells}})],1)],1)},UHt=[],VHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InstrumentSubscriber",class:t.darkClass},[t._v(t._s(t.dataRow.contract))])},HHt=[],GHt={name:"InstrumentSubscriber",mixins:[xt],props:{dataRow:{type:Object}}},qHt=GHt,zHt=(i("dd16"),Object(C["a"])(qHt,VHt,HHt,!1,null,"63df68bc",null)),YHt=zHt.exports,XHt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Commission",class:t.darkClass},[t._v(t._s(t.commission))])},QHt=[],JHt={name:"Commission",mixins:[xt],props:{dataRow:{type:Object}},computed:{commission:function(){return"Percent"===this.dataRow.priceType?"SF "+this.dataRow.price+" %":"FIX $ "+this.dataRow.price}}},KHt=JHt,ZHt=(i("2615"),Object(C["a"])(KHt,XHt,QHt,!1,null,"536cf526",null)),tGt=ZHt.exports,eGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"InvestCapitalSubscriber",class:t.darkClass},[t._v(t._s(t.investCapital))])},iGt=[],oGt={name:"InvestCapitalSubscriber",mixins:[xt],props:{dataRow:{type:Object},allDataProfit:{type:Array,default:function(){return[]}}},computed:{investCapital:function(){var t=this;if(this.allDataProfit){var e=this.allDataProfit.find((function(e){return e.subscriptionId===t.dataRow.id}));return null!==e&&void 0!==e&&e.investMoney?"$ "+Lm(e.investMoney,2,!0):"-"}}}},nGt=oGt,sGt=(i("9106"),Object(C["a"])(nGt,eGt,iGt,!1,null,"5bd7cd38",null)),rGt=sGt.exports,aGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"NetIncomeSubscriber",class:t.rootClass},[t._v(t._s(t.netIncome))])},cGt=[],lGt={name:"NetIncomeSubscriber",mixins:[xt],props:{dataRow:{type:[Object,Array]},allDataProfit:{type:Array,default:function(){return[]}}},computed:{netIncome:function(){var t,e,i=this,o=(null===(t=this.dataRow)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.priceType)||this.dataRow.priceType;if("Money"===o)return e=Array.isArray(this.dataRow)?this.dataRow.reduce((function(t,e){return t+e.price}),0):this.dataRow.price,"$ ".concat(e," FIX");if("Percent"===o){var n=[];this.dataRow.forEach((function(t){var e=i.allDataProfit.find((function(e){return e.subscriptionId===t.id})),o=null===e||void 0===e?void 0:e.closedProfit;o?n.push({profit:o*t.price/100,pricePercent:t.price}):n.push({profit:0,pricePercent:t.price})}));var s=n.reduce((function(t,e){return t+e.profit}),0),r=n.reduce((function(t,e){return t+e.pricePercent}),0);return s<=0?"$ 0 (SF ".concat(Lm(r/n.length),"%)"):"$ ".concat(Lm(s,2,!0)," (SF ").concat(Lm(r/n.length),"%)")}},rootClass:function(){return Object(c["a"])({},this.darkClass)}}},uGt=lGt,dGt=(i("adcf"),Object(C["a"])(uGt,aGt,cGt,!1,null,"6e5a49de",null)),hGt=dGt.exports,pGt={name:"TableCopySubscriber",mixins:[xt,Wht],props:{report:{type:Boolean,default:!1}},components:{TableColumnsCustom:p2,SceletonTable:hUt,NoData:yUt,DateCreated:OUt,NameUserOrPortfolio:MVt,PriceData:WVt,ContractData:q$,TimeEnd:qVt,Status:KVt,InstrumentSubscriber:YHt,Commission:tGt,InvestCapitalSubscriber:rGt,NetIncomeSubscriber:hGt,LabelBlock:sit,TablePagination:Ult,SearchAndFilter:tNt},data:function(){return{dataProfit:null,allDataProfit:null,searchValue:"",currentContract:"",pageSize:[25,50],currentCount:25,currentPage:0,sizes:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({subscriberCopy:"subscriptionsContract/subscriberCopy",isLoadingData:"subscriptionsContract/isLoadingData",getStatByOrders:"contracts/getStatByOrders"})),{},{subscriberCopySorted:function(){var t,e=this;if(null===(t=this.subscriberCopy)||void 0===t||!t.length)return[];var i=Object(x["a"])(this.subscriberCopy).sort((function(t,e){var i,o,n=new Date((null===(i=t.subscription)||void 0===i?void 0:i.startDateTime)||t.startDateTime||t.createDateTime).getTime(),s=new Date((null===(o=e.subscription)||void 0===o?void 0:o.startDateTime)||e.startDateTime||e.createDateTime).getTime();return s-n}));return this.report?i.slice(0,5):(this.searchValue&&(i=i.filter((function(t){return t.name.toLowerCase().includes(e.searchValue.toLowerCase())}))),this.currentContract&&this.currentContract!==this.contractsList[0]?i.filter((function(t){return t.contract===e.currentContract})):i)},tableData:function(){var t={};return this.subscriberCopySorted.forEach((function(e){t[e.bagId]||(t[e.bagId]=[]),t[e.bagId].push(e)})),Object.entries(t).map((function(t){return t[1]}))},dataTableLength:function(){var t;return null===(t=this.subscriberCopySorted)||void 0===t?void 0:t.length},noDataVisible:function(){var t;return 0===(null===(t=this.subscriberCopy)||void 0===t?void 0:t.length)},sceletonVisible:function(){return null===this.subscriberCopy||!this.allDataProfit},isTablet:function(){var t=document.documentElement.clientWidth;return t<1150},columns:function(){var t=this;return[{id:1,title:this.$t("date"),width:"150px",field:"startDateTime",align:"left",cellTemplate:"cell-startDate",sortFunction:function(t){var e,i=(null===(e=t.subscription)||void 0===e?void 0:e.startDateTime)||t.startDateTime||t.createDateTime;return new Date(i).getTime()}},{id:2,title:this.$t("user"),field:"name",align:"left",cellTemplate:"cell-name"},{id:3,title:this.$t("instruments"),field:"openDate",align:"left",cellTemplate:"cell-instrument"},{id:7,title:this.$t("expiration"),field:"closeDate",align:"left",cellTemplate:"cell-closeDate"},{id:6,title:this.$t("my_net_income"),field:"profit",align:"left",cellTemplate:"cell-netIncome",sortFunction:function(e){if(!t.allDataProfit)return 0;var i=t.allDataProfit.find((function(t){return t.subscriptionId===e.id}));return(null===i||void 0===i?void 0:i.closedProfit)||0}}]},myProfitForProfitCells:function(){var t=this;if(!this.allDataProfit)return 0;var e=0;return this.subscriberCopySorted.forEach((function(i){var o=t.allDataProfit.find((function(t){return t.subscriptionId===i.id})),n=o.closedProfit;"Money"===i.priceType?e+=i.price:n&&n>0&&(e+=n*i.price/100)})),"$ ".concat(Lm(e,2,!0))},contractsList:function(){var t=this.subscriberCopy.map((function(t){return t.contract}));return["Все"].concat(Object(x["a"])(new Set(t)))},isPagination:function(){var t;return(null===(t=this.subscriberCopy)||void 0===t?void 0:t.length)>this.pageSize[0]},pageCount:function(){var t;return Math.ceil((null===(t=this.subscriberCopySorted)||void 0===t?void 0:t.length)/this.currentCount)}}),methods:{setCount:function(t){this.currentCount=t},setPage:function(t){this.currentPage=t},setSearchValue:function(t){this.searchValue=t.trim(),this.currentPage=0},setContract:function(t){this.currentContract=t,this.currentPage=0},getSizeArr:function(t){this.sizes=t}}},gGt=pGt,fGt=(i("e6c4"),Object(C["a"])(gGt,EHt,UHt,!1,null,"079fa87e",null)),mGt=fGt.exports,vGt={computed:Object(c["a"])({},Object(p["c"])({defaultAccount:"subscribeOrders/getDefaultAccount"})),watch:{defaultAccount:{handler:function(t){t.id&&this.getSubscribers({accountId:t.id})},deep:!0}},activated:function(){this.componentName(),this.mountedHandler()},mounted:function(){this.componentName(),this.mountedHandler()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getSubscribers:"subscriptionsContract/getSubscribers"})),{},{mountedHandler:function(){var t;null!==(t=this.defaultAccount)&&void 0!==t&&t.id&&this.getSubscribers({accountId:this.defaultAccount.id})},componentName:function(){var t;return null===(t=this.$route.meta)||void 0===t?void 0:t.componentName}})},yGt={name:"MyLastFiveSubscribers",inject:{goToSelectedTab:{from:"goToSelectedTab",default:function(){}}},mixins:[vGt,xt],props:{},components:{TableCopySubscriber:mGt},computed:{isVisibleLink:function(){var t;return"UserProfile"===(null===(t=this.$route.meta)||void 0===t?void 0:t.componentName)}}},CGt=yGt,bGt=(i("dd8e"),Object(C["a"])(CGt,WHt,NHt,!1,null,"3c5ac5ea",null)),SGt=bGt.exports,PGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ProfitByCopy",class:t.darkClass},[e("header",[t._v(t._s(t.$t("income_from_copying")))]),e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.dataProfit?0===t.dataProfit.length?e("NoData"):e("div",[e("ProfitPosition",{attrs:{dataProfit:t.dataProfit,allDataProfit:t.allDataProfit,report:!0}}),e("ResultTableData",{attrs:{dataResult:t.dataResult,columns:6}})],1):e("SceletonTable")],1)],1)},TGt=[],xGt={name:"ProfitByCopy",mixins:[Wht,xct,xt],props:{},components:{ProfitPosition:Oht,ResultTableData:lit,SceletonTable:hUt,NoData:yUt},data:function(){return{dataOpenPosition:null,dataClosedPosition:null,report:!0,dataProfit:null,allDataProfit:null}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getStatByOrders:"contracts/getStatByOrders",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{dataResult:function(){return[{title:this.$t("yabc"),value:this.countSubscriber,dopClass:"orange"},{title:"".concat(this.$t("vofi"),", $"),value:Lm(this.investVolume,2,!0)},{title:"".concat(this.$t("profit_from_copying"),", $"),value:Lm(this.profitForProfitCells,2,!0)},{title:"".concat(this.$t("your_income"),", $"),value:this.myProfitForProfitCells.value},{title:"".concat(this.$t("equity_turnover"),", $"),value:Lm(this.capitalTurnover,2,!0)}]}}),watch:{getStatByOrders:function(t){t&&this.getDataForTable()},getDefaultAccount:function(t){t&&this.getSubscribers({accountId:t.id})}},mounted:function(){this.getDataForTable(),this.getDefaultAccount&&this.getSubscribers({accountId:this.getDefaultAccount.id})},destroyed:function(){},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getSubscribers:"subscriptionsContract/getSubscribers"})),{},{getDataForTable:function(){this.dataClosedPosition=qV(this),this.dataOpenPosition=HV(this)}})},OGt=xGt,wGt=(i("08be"),Object(C["a"])(OGt,PGt,TGt,!1,null,"0dc0115f",null)),_Gt=wGt.exports,AGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Commission",class:t.darkClass},[e("header",{on:{click:function(e){t.indexHoverRow+=1}}},[t._v(t._s(t.$t("project_fee")))]),e("TableColumnsCustom",{attrs:{dataTable:t.getProfileAccounts,columns:t.columns,resizeEnabled:!1},scopedSlots:t._u([{key:"cell-name",fn:function(t){var i=t.data;return[e("BrokerName",{attrs:{dataCell:i}})]}},{key:"cell-account-number",fn:function(t){var i=t.data;return[e("AccountNumber",{attrs:{dataCell:i}})]}},{key:"cell-equity",fn:function(t){var i=t.data;return[e("AccountEquity",{attrs:{dataCell:i}})]}},{key:"until-end",fn:function(t){var i=t.data;return[e("UntilEnd",{attrs:{dataCell:i}})]}},{key:"cell-commission",fn:function(t){var i=t.data;return[e("Deductions",{attrs:{dataCell:i}})]}},{key:"cell-paid",fn:function(t){var i=t.data;return[e("Paid",{attrs:{dataCell:i}})]}}])}),e("ResultBlock",{attrs:{lengthAccount:t.getProfileAccounts.length}})],1)},DGt=[],kGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"BrokerName",class:t.darkClass},[e("img",{staticClass:"brokerAvatar",attrs:{src:t.imgSrc,alt:""}}),e("div",{staticClass:"name"},[t._v(t._s(t.getName))])])},IGt=[],BGt={name:"BrokerName",mixins:[xt],props:{dataCell:{type:Object}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getBrokers:"brokers/getBrokers"})),{},{imgSrc:function(){var t=this.dataCell.brokerId?"broker-sample.png":"tt_broker.png";return i("7584")("./".concat(t))},getName:function(){var t,e=this;return this.dataCell.brokerId?(null===(t=this.getBrokers.find((function(t){return t.id===e.dataCell.brokerId})))||void 0===t?void 0:t.name)||"unknow":"TopTrader"}})},MGt=BGt,$Gt=(i("1a97"),Object(C["a"])(MGt,kGt,IGt,!1,null,"21be1f0e",null)),LGt=$Gt.exports,FGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AccountNumber",class:t.darkClass},[t._v(t._s(t.accountNumber))])},jGt=[],RGt={name:"AccountNumber",mixins:[xt],props:{dataCell:{type:Object}},computed:{accountNumber:function(){return this.dataCell.sequenceId}}},WGt=RGt,NGt=(i("681d"),Object(C["a"])(WGt,FGt,jGt,!1,null,"1564a95d",null)),EGt=NGt.exports,UGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AccountEquity",class:t.darkClass},[t._v("$ "+t._s(t.equity))])},VGt=[],HGt={name:"AccountEquity",mixins:[xt],props:{dataCell:{type:Object}},computed:{equity:function(){return Lm(this.dataCell.equity,2,!0)}}},GGt=HGt,qGt=(i("e0ea"),Object(C["a"])(GGt,UGt,VGt,!1,null,"6f788d61",null)),zGt=qGt.exports,YGt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Deductions",class:t.darkClass},[t._v("₽ 370")])},XGt=[],QGt={name:"Deductions",mixins:[xt],props:{dataCell:{type:Object}}},JGt=QGt,KGt=(i("dad4"),Object(C["a"])(JGt,YGt,XGt,!1,null,"800141e2",null)),ZGt=KGt.exports,tqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ResultBlock",class:t.darkClass},[e("div",{staticClass:"emptyBlock"}),e("div",{staticClass:"emptyBlock"}),e("div",{staticClass:"emptyBlock"}),e("div",{staticClass:"dataBlock"},[e("LabelBlock",{staticClass:"red",attrs:{title:t.$t("general_fee"),value:"₽ ".concat(370*t.lengthAccount)}})],1),e("div",{staticClass:"emptyBlock"})])},eqt=[],iqt={name:"ResultBlock",mixins:[xt],props:{lengthAccount:{type:Number}},components:{LabelBlock:sit},data:function(){return{}},computed:{}},oqt=iqt,nqt=(i("396f"),Object(C["a"])(oqt,tqt,eqt,!1,null,"2c20c4c3",null)),sqt=nqt.exports,rqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"UntilEnd",class:t.darkClass},[t._v("7д. 21 ч.")])},aqt=[],cqt={name:"UntilEnd",components:{},props:{dataCell:{type:Object}},mixins:[xt],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},lqt=cqt,uqt=(i("f7ef"),Object(C["a"])(lqt,rqt,aqt,!1,null,"6905b440",null)),dqt=uqt.exports,hqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Paid"},[e("svgIcon",t._b({},"svgIcon",t.checkIcon,!1))],1)},pqt=[],gqt={name:"Paid",components:{},props:{},mixins:[xt],data:function(){return{}},watch:{},computed:{checkIcon:function(){return{name:"Check",color:this.darkClass.dark?"#00ffac":"#008E72"}}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},fqt=gqt,mqt=(i("c378"),Object(C["a"])(fqt,hqt,pqt,!1,null,"3f693471",null)),vqt=mqt.exports,yqt={name:"Commission",mixins:[xt],components:{TableColumnsCustom:p2,BrokerName:LGt,AccountNumber:EGt,AccountEquity:zGt,Deductions:ZGt,ResultBlock:sqt,UntilEnd:dqt,Paid:vqt},data:function(){return{indexHoverRow:0}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getProfileAccounts:"subscribeOrders/getProfileAccount"})),{},{columns:function(){return[{id:1,title:"TopTrader / ".concat(this.$t("broker")),field:"name",align:"left",cellTemplate:"cell-name"},{id:2,title:this.$t("account_number"),field:"sequenceId",align:"left",cellTemplate:"cell-account-number"},{id:3,title:"До окончания",field:"until",align:"left",cellTemplate:"until-end"},{id:4,title:this.$t("fee"),field:"commission",align:"left",cellTemplate:"cell-commission"},{id:5,title:"Оплачено",field:"paid",align:"right",cellTemplate:"cell-paid"}]}})},Cqt=yqt,bqt=(i("4b28"),Object(C["a"])(Cqt,AGt,DGt,!1,null,"c0cf4138",null)),Sqt=bqt.exports,Pqt={data:function(){return{quotes:{}}},computed:Object(c["a"])({},Object(p["c"])({getCatalogs:"quotesCatalogs/getCatalogs",getTradingTopBarSettings:"tradingTopBarSettings/getTradingTopBarSettings"})),mounted:function(){["Investing","Report"].includes(this.componentName())&&this.mountedHandler()},activated:function(){["Investing","Report"].includes(this.componentName())||this.mountedHandler()},destroyed:function(){["Investing","Report"].includes(this.componentName())&&this.unMountedHandler()},deactivated:function(){["Investing","Report"].includes(this.componentName())||this.unMountedHandler()},watch:{getCatalogs:{handler:function(t){this.setForexQuotes(t)},deep:!0},dataOpenPosition:function(t){null!==t&&void 0!==t&&t.length&&this.subscribeOfQuotes()}},methods:{mountedHandler:function(){var t;null!==(t=this.getCatalogs)&&void 0!==t&&t["Forex"]&&this.setForexQuotes(this.getCatalogs),this.$socketStream.$on("apiWS",this.setMessageHandler),this.$socketStream.$on("apiWS2",this.setMessageHandler)},unMountedHandler:function(){this.$socketStream.$off("apiWS",this.setMessageHandler),this.$socketStream.$off("apiWS2",this.setMessageHandler)},componentName:function(){var t;return null===(t=this.$route.meta)||void 0===t?void 0:t.componentName},setForexQuotes:function(t){var e=this;for(var i in t)t[i].length&&t[i].forEach((function(t){e.$set(e.quotes,t.s,{Buy:t.b,Sell:t.a})}));this.forexQuotes=t["Forex"]},symbolsOpenPosition:function(){var t;if(null!==(t=this.dataOpenPosition)&&void 0!==t&&t.length)return Array.from(new Set(this.dataOpenPosition.map((function(t){return t.contractName}))))},subscribeOfQuotes:function(){var t=this.symbolsOpenPosition(),e={command:"Quotes",method:"Subscribe",data:{Quotes:t}};this.$socketStream.sendCommand({ws:"apiWS2",command:e})},setMessageHandler:function(t){var e=this;if("BrokerPosition"===(null===t||void 0===t?void 0:t.command)){var i=this.$route.query.accountId===t.data.accountId,o="Position_Create"===t.data.reason,n="Closed"===t.status,s="Rejected"===t.data.status;i&&o&&!s&&this.dataOpenPosition.push(t.data),i&&n&&!s&&(this.dataClosedPosition.push(t.data),this.dataOpenPosition=this.dataOpenPosition.filter((function(e){return e.id!==t.data.id})))}"Quotes"===t.command&&t.data.forEach((function(t){e.quotes[t.s]?(e.quotes[t.s]["Buy"]=t.b,e.quotes[t.s]["Sell"]=t.a):e.$set(e.quotes,t.s,{Buy:t.b,Sell:t.a})}))}}},Tqt="ООО «ТопТрейдер»",xqt="117105, г. Москва, Варшавское шоссе, д.1, стр. 6, этаж 2",Oqt="company@toptrader.ru",wqt={name:"Reports",mixins:[xt,Pqt],components:{ControlBlock:XNt,UserProfilePigWidget:QM,UserProfilePeriodsWidget:R3,StatByAccount:eEt,OpenPositionReports:IEt,ClosedPositionReports:eUt,TradingAnalytics:mot,MyLastFiveInvestments:RHt,MyLastFiveSubscribers:SGt,ProfitByCopy:_Gt,Commission:Sqt,AnaliticsPortfolio:lWt,Logo:S},data:function(){return{serverTime:new Date,dataOpenPosition:null,dataClosedPosition:null,calendarDate:new Date,forBreak:{},nameCompany:Tqt,addressCompany:xqt,emailCompany:Oqt}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getServerTime:"serverTime/getServerTime",isProvider:"subscribeOrders/isProvider",getStatByOrders:"contracts/getStatByOrders",getStatistics:"statistic/getStatistics",getOrdersStatistic:"statistic/getOrdersStatistic",getCreatedPortfolios:"expertsPortfolio/getCreatedPortfolios",getStatisticsByDay:"statistic/getStatisticsByDay",getUserSettings:"userSettings/getUserSettings"})),{},{lang:function(){var t;switch(null===(t=this.getUserSettings)||void 0===t||null===(t=t.lang)||void 0===t?void 0:t.code){case"en":return"en-US";case"ru":return"ru-RU";default:return"en-US"}},noStartedPortfolios:function(){if(this.getCreatedPortfolios&&this.getCreatedPortfolios.length)return this.getCreatedPortfolios.every((function(t){return"Active"!==t.status}))},emptyPortfolio:function(){if(this.getCreatedPortfolios)return 0===this.getCreatedPortfolios.length},date:function(){return new Intl.DateTimeFormat(this.lang,{day:"2-digit",month:"long",year:"numeric"}).format(this.calendarDate)},activeDays:function(){var t=this.getOrdersStatistic.startTradingDT,e=new Date(t).getTime(),i=this.getStatistics.accountDaily.filter((function(t){return new Date(t.date).getTime()>=e&&t.equityClose-t.equityOpen!==0}));return i},accountDailyDate:function(){var t=this;return this.activeDays.filter((function(e){return uL(new Date(e.date)).getTime()<=uL(t.calendarDate).getTime()}))},dataClosedPositionDate:function(){var t=this;return this.dataClosedPosition?this.dataClosedPosition.filter((function(e){return uL(new Date(e.closedDate)).getTime()<=uL(t.calendarDate).getTime()})):null},dataOpenPositionDate:function(){var t=this;if(!this.dataOpenPosition)return null;var e=this.dataOpenPosition.filter((function(e){return uL(new Date(e.openDate)).getTime()<=uL(t.calendarDate).getTime()})),i=this.dataClosedPosition.filter((function(e){return uL(new Date(e.closedDate)).getTime()>uL(t.calendarDate).getTime()&&uL(new Date(e.openDate)).getTime()<=uL(t.calendarDate).getTime()}));return[].concat(Object(x["a"])(e),Object(x["a"])(i))},providerDataIcon:function(){return{name:"Provider",color:this.darkClass.dark?"#00b9fc":"#3C73F1"}},propsControlBlock:function(){return{serverTime:this.serverTime,accountDailyDate:this.accountDailyDate,calendarDate:this.calendarDate}},propsStatByAccount:function(){return{quotes:this.quotes,accountDailyDate:this.accountDailyDate,dataClosedPositionDate:this.dataClosedPositionDate,dataOpenPositionDate:this.dataOpenPositionDate}},propsOpenPositionReports:function(){return{calendarDate:this.calendarDate,dataOpenPositionDate:this.dataOpenPositionDate,quotes:this.quotes}},propsClosedPositionReports:function(){return{calendarDate:this.calendarDate,dataClosedPositionDate:this.dataClosedPositionDate}},propsTradingAnalytics:function(){return{calendarDate:this.calendarDate,dataClosedPositionDate:this.dataClosedPositionDate}},isPageBreakForPrint:function(){return this.forBreak.closed+this.forBreak.open<14},configObject:function(){return{period:"day",activeDate:this.calendarDate,showControlButton:!1}},topBarWidgetParams:function(){return{row:"normal",col:{index:0,mode:"normal"},directionModeRows:!1}}}),watch:{getStatByOrders:function(t){t&&!this.dataOpenPosition&&this.getOpenPositions()}},activated:function(){"UserProfile"===this.componentName()&&this.mountHandler()},deactivated:function(){"UserProfile"===this.componentName()&&this.unMountHandler()},mounted:function(){if(!this.getStatisticsByDay){this.$socketStream.$on("apiWS3",this.setMessageHandler);var t=this.getDefaultAccount.id;this.getStatisticByAccountsForDay(t)}["Report","Investing"].includes(this.componentName())&&this.mountHandler()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler),["Report","Investing"].includes(this.componentName())&&this.unMountHandler()},methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getStatisticByAccountsForDay:"statistic/getStatisticByAccountsForDay"})),{},{setMessageHandler:function(t){"GetAccountDailyByHourse"===(null===t||void 0===t?void 0:t.command)&&this.$store.commit("statistic/setStatisticsByDay",t.data)},componentName:function(){var t;return null===(t=this.$route.meta)||void 0===t?void 0:t.componentName},mountHandler:function(){document.body.classList.add("printReports"),this.calendarDate=new Date(this.getServerTime.now),this.serverTime=new Date(this.getServerTime.now),this.getOpenPositions(),this.getClosedPosition()},unMountHandler:function(){document.body.classList.remove("printReports"),this.dataOpenPosition=null,this.dataClosedPosition=null},getOpenPositions:function(){this.dataOpenPosition=HV(this)},getClosedPosition:function(){this.dataClosedPosition=qV(this)},changedDate:function(t){this.calendarDate=t},setCountPosition:function(t){var e=t.field,i=t.count;this.$set(this.forBreak,e,i)}})},_qt=wqt,Aqt=(i("a11b"),i("a30b"),Object(C["a"])(_qt,LNt,FNt,!1,null,"75e3d99c",null)),Dqt=Aqt.exports,kqt={name:"Report",components:{Reports:Dqt,Preloader:ah,WelcomeModals:J6,DxPopup:wt["DxPopup"]},props:{},mixins:[xt],data:function(){return{statusWelcomeModal:!1}},watch:{getDefaultAccount:function(t){t&&this.mountedHandler()},getStatus:function(t){t&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Report"===t})):!this.getWelcomsModals.length)}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getStatistics:"statistic/getStatistics",getCreatedPortfoliosNoSorted:"expertsPortfolio/getCreatedPortfoliosNoSorted",getWelcomsModals:"userSettings/getWelcomsModals",getAuthRequestStatus:"statusRequests/getAuthRequestStatus",getUserDetailRequestStatus:"statusRequests/getUserDetailRequestStatus"})),{},{isVisible:function(){return this.getStatistics&&this.getCreatedPortfoliosNoSorted&&this.$orderStorage.getOrdersOnStorage()},getStatus:function(){return"ready"===this.getUserDetailRequestStatus||"noSent"===this.getAuthRequestStatus}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio"})),{},{hideWelcome:function(){this.statusWelcomeModal=!1},getHistoryOrdersForAccount:function(){this.$store.commit("contracts/setStatusByOrders",!1);var t={Command:"HistoryOrders",Data:{accountId:this.getDefaultAccount.id,filter:{orderTypes:["All"],startTime:null,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},setMessageHendler:function(t){var e;if("GetStatisticsByAccounts"===(null===t||void 0===t?void 0:t.command))t.data.length&&t.data[0].account.id===(null===(e=this.getDefaultAccount)||void 0===e?void 0:e.id)&&(this.$store.commit("statistic/setStatistics",t.data),this.$store.commit("statistic/setOrdersStatistics",t.data));else if("HistoryOrders"===(null===t||void 0===t?void 0:t.command)){var i=JSON.parse(t.data);this.getDefaultAccount.id===i[0]&&(this.$orderStorage.setOrdersToStorage(i),this.$store.commit("contracts/setStatusByOrders",!0))}else"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&this.getListsPortfolio(Kq(JSON.parse(t.data)))},mountedHandler:function(){var t=this;this.$store.dispatch("statistic/getStatisticByAccounts",[this.getDefaultAccount.id]),this.getHistoryOrdersForAccount(),this.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:this.getDefaultAccount.id}).then((function(){t.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:t.getDefaultAccount.id,filter:["Active","Created","Stoped"]})})),this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Active","Created","Stoped"]})}}),mounted:function(){this.getDefaultAccount&&this.mountedHandler(),this.getStatus&&(this.statusWelcomeModal=this.getWelcomsModals.length?!this.getWelcomsModals.some((function(t){return"Report"===t})):!this.getWelcomsModals.length),this.$socketStream.$on("apiWS3",this.setMessageHendler)},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHendler)}},Iqt=kqt,Bqt=(i("0ceb"),Object(C["a"])(Iqt,MNt,$Nt,!1,null,"26cbaf5c",null)),Mqt=Bqt.exports,$qt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Subscribers"},[e("Layout",{scopedSlots:t._u([{key:"left",fn:function(){return[t.isProvider?e("LeftBarSubscriber",{attrs:{statCountSubscribers:t.statCountSubscribers}}):e("LeftBarCalcInvestProfit")]},proxy:!0},{key:"center",fn:function(){return[e("SubscribersCentralPart",{attrs:{userOrders:t.userOrders,statCountSubscribersByDay:t.statCountSubscribersByDay}})]},proxy:!0}])})],1)},Lqt=[],Fqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SubscribersCentralPart",class:t.darkClass},[e("div",{staticClass:"tabsPanelWrap"},[e("TabsPanel",{attrs:{tabs:t.tabs,active:0},on:{tabClick:t.tabClick}})],1),e("div",{staticClass:"componentView"},[e("transition",{attrs:{name:"fade",mode:"out-in",appear:""}},[t.activeComponent?e(t.activeComponent,t._b({tag:"component"},"component",t.props[t.activeComponent],!1)):t._e()],1)],1)])},jqt=[],Rqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Subscription"},[e("TableCopy")],1)},Wqt=[],Nqt={name:"Subscription",components:{TableCopy:MHt},props:{},mixins:[$Ht],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){}},Eqt=Nqt,Uqt=(i("75cd"),Object(C["a"])(Eqt,Rqt,Wqt,!1,null,"1ac0e734",null)),Vqt=Uqt.exports,Hqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"Subscriber"},[e("TableCopySubscriber")],1)},Gqt=[],qqt={name:"Subscriber",components:{TableCopySubscriber:mGt},props:{},mixins:[vGt],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},zqt=qqt,Yqt=(i("bef1"),Object(C["a"])(zqt,Hqt,Gqt,!1,null,"68ac4989",null)),Xqt=Yqt.exports,Qqt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"TableHistory",class:t.darkClass,style:t.adaptiveFontSize},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.loadingData?e("SceletonTable"):t.noDataVisible?e("NoData"):e("div",{staticClass:"contentTable"},[t.isPagination?e("TablePagination",{attrs:{pageCount:t.pageCount,currentPage:t.currentPage,currentCount:t.currentCount,pageSize:t.pageSize,dataTableLength:t.dataTableLength},on:{setPage:t.setPage,setCount:t.setCount}},[e("SearchAndFilter",{attrs:{searchValue:t.searchValue,contractsList:t.contractsList},on:{setSearchValue:t.setSearchValue,setContract:t.setContract}})],1):t._e(),e("div",{staticClass:"tableWrapper"},[e("TableColumnsCustom",{attrs:{dataTable:t.dataTable,columns:t.columns,resizeEnabled:!1,stickyHeader:!0,pagination:!0,currentPage:t.currentPage,count:t.currentCount,emitSize:!0},on:{getSizeArr:t.getSizeArr},scopedSlots:t._u([{key:"cell-date-period",fn:function(t){var i=t.data;t.index;return[e("DatePeriod",{attrs:{cellData:i}})]}},{key:"cell-name-portfolio",fn:function(t){var i=t.data;t.index;return[e("NamePortfolio",{attrs:{cellData:i}})]}},{key:"cell-instruments-portfolio",fn:function(t){var i=t.data;t.index;return[e("ContractData",{attrs:{dataRow:i,portfolio:!!i.status}})]}},{key:"cell-profit-portfolio",fn:function(i){var o=i.data;i.index;return[e("ProfitPortfolio",{attrs:{cellData:o,userOrders:t.userOrders}})]}},{key:"cell-myProfit-portfolio",fn:function(i){var o=i.data;i.index;return[e("MyProfitPortfolio",{attrs:{cellData:o,userOrders:t.userOrders}})]}},{key:"cell-portfolio-sf-commission",fn:function(i){var o=i.data;i.index;return[e("SfCommissionPortfolio",{attrs:{cellData:o,userOrders:t.userOrders}})]}}])})],1),t.noDataVisible||t.loadingData?t._e():e("footer",t._l(t.sizeColumnsTable,(function(i,o){return e("div",{staticClass:"section",style:{minWidth:i+"%"}},[1===o?e("LabelBlock",{staticClass:"countCopy",attrs:{title:t.$t("copying2"),value:t.dataTable.length}}):t._e(),3===o?e("LabelBlock",{class:t.incomeTotal.incomeClass,attrs:{title:t.$t("income"),value:t.incomeTotal.income}}):t._e(),4===o?e("LabelBlock",{class:t.incomeTotal.myIncomeClass,attrs:{title:t.$t("my_income"),value:t.incomeTotal.myIncome}}):t._e(),5===o?e("LabelBlock",{class:"sf",attrs:{title:t.$t("fee"),value:t.incomeTotal.fee}}):t._e()],1)})),0)],1)],1)],1)},Jqt=[],Kqt={name:"TableHistory",mixins:[xt],props:{userOrders:{type:[Object,Boolean]}},components:{NamePortfolio:TWt,DatePeriod:DWt,ProfitPortfolio:LWt,MyProfitPortfolio:UWt,SfCommissionPortfolio:YWt,InstrumentsPortfolio:FWt["default"],ContractData:q$,SceletonTable:hUt,NoData:yUt,SearchAndFilter:tNt,TablePagination:Ult,TableColumnsCustom:p2,LabelBlock:sit},data:function(){return{searchValue:"",currentContract:"",pageSize:[25,50],currentCount:25,currentPage:0,sizeColumnsTable:null,loadingData:!0}},watch:{getDefaultAccount:function(t){t&&this.mountedHandler()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({getDefaultAccount:"subscribeOrders/getDefaultAccount",getHistoryPortfolios:"expertsPortfolio/getHistoryPortfolios",fullListSubscription:"subscriptionsContract/fullListSubscription",getWidthCentralBlock:"user/getWidthCentralBlock"})),{},{adaptiveFontSize:function(){var t=this.getWidthCentralBlock/100*2*.9;return t>21&&(t=21),{"--fz":t+"px"}},contractsList:function(){var t=[],e=Object(x["a"])(this.getHistoryPortfolios);return e.forEach((function(e){e.status?t.push.apply(t,Object(x["a"])(e.sources.map((function(t){return t.contract})))):t.push(e.contract)})),["Все"].concat(Object(x["a"])(new Set(t)))},dataTable:function(){var t=this,e=Object(x["a"])(this.getHistoryPortfolios).sort((function(t,e){return new Date(e.status?e.stopDateTime:e.subscription.stopDateTime).getTime()-new Date(t.status?t.stopDateTime:t.subscription.stopDateTime).getTime()}));return this.searchValue&&(e=e.filter((function(e){return e.name.toLowerCase().includes(t.searchValue.toLowerCase())}))),this.currentContract&&this.currentContract!==this.contractsList[0]?e.filter((function(e){return e.status?!!e.sources.find((function(e){return e.contract===t.currentContract})):e.contract===t.currentContract})):e},columns:function(){return[{title:"Дата",field:"date",align:"left",cellTemplate:"cell-date-period",sortFunction:function(t){return new Date(t.status?t.stopDateTime:t.subscription.stopDateTime).getTime()}},{title:"Портфель/Провайдер",field:"name",align:"left",cellTemplate:"cell-name-portfolio"},{title:"Инструменты",field:"instruments",align:"left",cellTemplate:"cell-instruments-portfolio"},{title:"Доход, $/%",field:"profit",align:"center",cellTemplate:"cell-profit-portfolio"},{title:"Мой доход, $/%",field:"profitPercent",align:"center",cellTemplate:"cell-myProfit-portfolio"},{title:"Комиссия за управление",field:"sfCommission",align:"center",cellTemplate:"cell-portfolio-sf-commission"}]},noDataVisible:function(){var t;return 0===(null===(t=this.getHistoryPortfolios)||void 0===t?void 0:t.length)},dataTableLength:function(){var t;return null===(t=this.dataTable)||void 0===t?void 0:t.length},pageCount:function(){var t;return Math.ceil((null===(t=this.dataTable)||void 0===t?void 0:t.length)/this.currentCount)},isPagination:function(){return this.getHistoryPortfolios.length>this.pageSize[0]},incomeTotal:function(){var t=this,e={income:0,myIncome:0,fee:0};return this.dataTable.forEach((function(i){var o=t.fullListSubscription.filter((function(t){return t.subscription.bagId===i.id})),n=o.map((function(t){return t.subscription.id})),s=t.userOrders.closedOrders.filter((function(t){return n.includes(+t.subscriptionId)})),r=s.reduce((function(t,e){return t+e.profit}),0);if(e.income+=r,"Money"===i.bagContents[0].priceType){var a=i.bagContents.reduce((function(t,e){return t+e.price}),0);e.fee+=a}if(r)if("Money"===i.bagContents[0].priceType||r<=0)e.myIncome+=r;else{var c=i.bagContents.reduce((function(t,e){return t+e.price}),0);if(0===c)e.myIncome+=r;else{var l=c/i.bagContents.length,u=r*l/100;e.fee+=u,e.myIncome+=r-u}}})),{income:"$ ".concat(Lm(e.income,2,!0)),incomeClass:"income "+(e.income>=0?"green":"red"),myIncome:"$ ".concat(Lm(e.myIncome,2,!0)),myIncomeClass:"myIncome "+(e.myIncome>=0?"green":"red"),fee:"$ ".concat(Lm(e.fee,2,!0))}}}),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio"})),{},{setCount:function(t){this.currentCount=t},setPage:function(t){this.currentPage=t},setSearchValue:function(t){this.searchValue=t.trim(),this.currentPage=0},setContract:function(t){this.currentContract=t,this.currentPage=0},getSizeArr:function(t){this.sizeColumnsTable=t},setMessageHandler:function(t){var e=this;"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&(this.getListsPortfolio(Kq(JSON.parse(t.data))),this.$nextTick((function(){e.loadingData=!1})))},mountedHandler:function(){this.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:this.getDefaultAccount.id,filter:["Deleted","Active"]})}}),mounted:function(){this.$socketStream.$on("apiWS3",this.setMessageHandler),this.getDefaultAccount&&this.mountedHandler()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},Zqt=Kqt,tzt=(i("3388"),Object(C["a"])(Zqt,Qqt,Jqt,!1,null,"23652144",null)),ezt=tzt.exports,izt=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"TableHistorySubscriber",class:e.darkClass},[i("transition",{attrs:{name:"fade",mode:"out-in"}},[e.sceletonVisible?i("SceletonTable"):e.noDataVisible?i("NoData"):i("div",{staticClass:"contentTable"},[e.isPagination?i("TablePagination",{attrs:{pageCount:e.pageCount,currentPage:e.currentPage,currentCount:e.currentCount,pageSize:e.pageSize,dataTableLength:e.dataTableLength},on:{setPage:e.setPage,setCount:e.setCount}},[i("SearchAndFilter",{attrs:{searchValue:e.searchValue,contractsList:e.contractsList},on:{setSearchValue:e.setSearchValue,setContract:e.setContract}})],1):e._e(),i("div",{staticClass:"scrollContent"},[i("TableColumnsCustom",{attrs:{dataTable:e.subscriberCopyHistorySorted,columns:e.columns,resizeEnabled:!0,heightRow:36,stickyHeader:!0,pagination:!0,currentPage:e.currentPage,count:e.currentCount,emitSize:!0},on:{getSizeArr:e.getSizeArr},scopedSlots:e._u([{key:"cell-datePeriod",fn:function(t){var e=t.data;return[i("DatePeriod",{attrs:{dataRow:e}})]}},{key:"cell-name",fn:function(t){var e=t.data;return[i("NameUserOrPortfolio",{attrs:{dataRow:e,subscriber:!0}})]}},{key:"cell-instrument",fn:function(t){var e=t.data;return[i("InstrumentSubscriber",{attrs:{dataRow:e}})]}},{key:"cell-base",fn:function(t){t.data;return[i("div",[e._v("Копирование сигналов")])]}},{key:"cell-profit-subscriber",fn:function(t){t.data;return[i("div",{staticClass:"green"},[e._v("--")])]}},{key:"cell-myProfit",fn:function(t){var o=t.data;return[i("MyProfitSubscriber",{attrs:{dataRow:o,getProfitBySubscription:e.getProfitBySubscription}})]}},{key:"cell-commission",fn:function(t){var e=t.data;return[i("Commission",{attrs:{dataRow:e}})]}}])})],1),(null===(t=e.subscriberCopyHistorySorted)||void 0===t?void 0:t.length)>0?i("footer",[i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[0]+"%"}}),i("LabelBlock",{staticClass:"countSubscriber",style:{"--width":e.sizes[1]+"%"},attrs:{title:e.$t("number"),value:e.allHistorySubscribers}}),i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[2]+"%"}}),i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[3]+"%"}}),i("LabelBlock",{staticClass:"allIncome",style:{"--width":e.sizes[4]+"%"},attrs:{title:e.$t("my_income"),value:"$ "+e.allProfitSubscriber}})],1):e._e()],1)],1)],1)},ozt=[],nzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"DatePeriod",class:t.darkClass},[t._v(t._s(t.startDate)+" - "+t._s(t.stopDate))])},szt=[],rzt={name:"DatePeriod",mixins:[xt],props:{dataRow:{type:Object}},computed:{startDate:function(){return Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(this.dataRow.startDateTime||this.dataRow.createDateTime))},stopDate:function(){return Intl.DateTimeFormat("ru-RU",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(this.dataRow.stopDateTime))}}},azt=rzt,czt=(i("d0f6"),Object(C["a"])(azt,nzt,szt,!1,null,"fd92bac8",null)),lzt=czt.exports,uzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"MyProfitSubscriber",class:t.darkClass},[t._v(t._s(t.value))])},dzt=[],hzt={name:"MyProfitSubscriber",mixins:[xt],props:{dataRow:{type:Object},getProfitBySubscription:{type:Array}},computed:{value:function(){var t=this,e=this.getProfitBySubscription.find((function(e){return e.subId===t.dataRow.id}));return!e||e.profit<=0?"$ 0":"$ "+Lm(33*e.profit/100,2,!0)}}},pzt=hzt,gzt=(i("2dad"),Object(C["a"])(pzt,uzt,dzt,!1,null,"5d67039a",null)),fzt=gzt.exports,mzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LabelBlock",class:t.darkClass},[e("div",{staticClass:"label"},[t._v(t._s(t.title))]),e("div",{staticClass:"value"},[t._v(t._s(t.value))])])},vzt=[],yzt={name:"LabelBlock",mixins:[xt],props:{title:{type:String},value:{type:[Number,String]}}},Czt=yzt,bzt=(i("0498"),Object(C["a"])(Czt,mzt,vzt,!1,null,"e78f061c",null)),Szt=bzt.exports,Pzt={name:"TableHistorySubscriber",mixins:[xt],components:{TableColumnsCustom:p2,SceletonTable:hUt,NoData:yUt,DatePeriod:lzt,NameUserOrPortfolio:MVt,InstrumentSubscriber:YHt,Commission:tGt,TablePagination:Ult,MyProfitSubscriber:fzt,SearchAndFilter:tNt,LabelBlock:Szt},data:function(){return{searchValue:"",currentContract:"",pageSize:[25,50],currentCount:25,currentPage:0,sizes:[]}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isLoadingData:"subscriptionsContract/isLoadingData",subscriberCopyHistory:"subscriptionsContract/subscriberCopyHistory",fullListSubscription:"subscriptionsContract/fullListSubscription",getProfitBySubscription:"subscriptionsContract/getProfitBySubscription"})),{},{contractsList:function(){var t=this.subscriberCopyHistory.map((function(t){return t.contract}));return["Все"].concat(Object(x["a"])(new Set(t)))},isPagination:function(){var t;return(null===(t=this.subscriberCopyHistory)||void 0===t?void 0:t.length)>this.pageSize[0]},subscriberCopyHistorySorted:function(){var t,e=this;if(null===(t=this.subscriberCopyHistory)||void 0===t||!t.length)return[];var i=Object(x["a"])(this.subscriberCopyHistory).sort((function(t,e){var i=new Date(t.stopDateTime).getTime(),o=new Date(e.stopDateTime).getTime();return o-i})),o=i;return this.searchValue&&(o=i.filter((function(t){return t.name.toLowerCase().includes(e.searchValue.toLowerCase())}))),this.currentContract&&this.currentContract!==this.contractsList[0]?o.filter((function(t){return t.contract===e.currentContract})):o},dataTableLength:function(){var t;return null===(t=this.subscriberCopyHistorySorted)||void 0===t?void 0:t.length},pageCount:function(){var t;return Math.ceil((null===(t=this.subscriberCopyHistorySorted)||void 0===t?void 0:t.length)/this.currentCount)},sceletonVisible:function(){return this.isLoadingData||null===this.subscriberCopyHistory},noDataVisible:function(){var t;return 0===(null===(t=this.subscriberCopyHistory)||void 0===t?void 0:t.length)},columns:function(){return[{id:1,title:"Дата создания",field:"datePeriod",align:"left",cellTemplate:"cell-datePeriod",sortFunction:function(t){return new Date(t.stopDateTime).getTime()}},{id:2,title:"Подписчики",field:"name",align:"left",cellTemplate:"cell-name"},{id:3,title:"Инструменты",field:"openDate",align:"left",cellTemplate:"cell-instrument"},{id:4,title:"Основание",field:"base",align:"left",cellTemplate:"cell-base"},{id:6,title:"Мой доход",field:"myProfit",align:"left",cellTemplate:"cell-myProfit"}]},allHistorySubscribers:function(){return this.subscriberCopyHistorySorted?this.subscriberCopyHistorySorted.length:0},allProfitSubscriber:function(){var t,e=this;if(!this.subscriberCopyHistorySorted||null===(t=this.getProfitBySubscription)||void 0===t||!t.length)return 0;var i=this.subscriberCopyHistorySorted.reduce((function(t,i){var o=e.getProfitBySubscription.find((function(t){return t.subId===i.id}));return!o||o.profit<0?t:t+33*o.profit/100}),0);return Lm(i,2,!0)}}),methods:{setCount:function(t){this.currentCount=t},setPage:function(t){this.currentPage=t},setSearchValue:function(t){this.searchValue=t.trim(),this.currentPage=0},setContract:function(t){this.currentContract=t,this.currentPage=0},getSizeArr:function(t){this.sizes=t}}},Tzt=Pzt,xzt=(i("78a6"),Object(C["a"])(Tzt,izt,ozt,!1,null,"9147f754",null)),Ozt=xzt.exports,wzt=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"GrowthSubscription",class:e.darkClass},[i("div",{staticClass:"counterSubscriber"},[i("div",{staticClass:"floatingLabel"},[e._v("Подписчиков")]),e._v(e._s(null===(t=e.subscriberCopy)||void 0===t?void 0:t.length))]),e.visibleGraph?i("LineEventChart",{key:e.renderTheme,attrs:{points:e.points,metaInfoForLines:e.metaInfoLines,typeXAxis:"dateClear",widthYaxis:"7rem",theme:e.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:e.hoverPoint}}):e._e()],1)},_zt=[],Azt={name:"GrowthSubscription",components:{LineEventChart:Uk},props:{statCountSubscribersByDay:{type:[Array,Boolean]}},mixins:[xt],data:function(){return{visibleGraph:!1,points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,renderTheme:!1}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({subscriberCopy:"subscriptionsContract/subscriberCopy"})),{},{colors:function(){return this.darkClass.dark?{color:"rgba(0, 185, 252, 1)",fill:"rgba(0, 185, 252, 0.1)"}:{color:"rgba(60, 115, 241, 1)",fill:"rgba(60, 115, 241, 0.1)"}},dataForGraph:function(){var t={};return this.statCountSubscribersByDay.forEach((function(e){t[e.date]||(t[e.date]=0),t[e.date]+=e.count})),Object.entries(t).sort((function(t,e){return new Date(t[0]).getTime()-new Date(e[0]).getTime()}))}}),methods:{hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setPointsForChart:function(){this.metaInfoLines=[{type:"line",color:this.colors.color,fill:this.colors.fill,fillIndicator:this.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""}],this.points=[];var t=this.dataForGraph.map((function(t){return{x:new Date(t[0]).getTime(),y:t[1],date:new Date(t[0]).getTime()}}));this.points.push(t),this.visibleGraph=!0}},mounted:function(){this.setPointsForChart()},destroyed:function(){},activated:function(){},deactivated:function(){}},Dzt=Azt,kzt=(i("1dfc"),Object(C["a"])(Dzt,wzt,_zt,!1,null,"7f99bbed",null)),Izt=kzt.exports,Bzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"AnalyticSubscription"},[t._v("AnalyticSubscription")])},Mzt=[],$zt={name:"AnalyticSubscription",components:{},props:{},mixins:[],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},Lzt=$zt,Fzt=(i("bc61"),Object(C["a"])(Lzt,Bzt,Mzt,!1,null,"5e8082b2",null)),jzt=Fzt.exports,Rzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"PaymentSubscription"},[t._v("PaymentSubscription")])},Wzt=[],Nzt={name:"PaymentSubscription",components:{},props:{},mixins:[],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},Ezt=Nzt,Uzt=(i("c0fa"),Object(C["a"])(Ezt,Rzt,Wzt,!1,null,"42828448",null)),Vzt=Uzt.exports,Hzt=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"DetailSubscriber",class:e.darkClass},[i("div",{staticClass:"contractCheckedList"},e._l(e.checkedData,(function(t){return i("div",{staticClass:"checkbox",class:{colored:t.color},style:{"--color-checkbox":t.color}},[i("DxCheckBox",{attrs:{disabled:t.checked&&1==e.checkedDataFiltered.length,value:t.checked,elementAttr:{class:"checkBoxCustom"},onValueChanged:function(i){return e.setStatus(i,t.contract)}}}),i("CheckBoxViewData",{attrs:{checkElem:t}})],1)})),0),i("div",{staticClass:"graph"},[e.visibleGraph?i("LineEventChart",{attrs:{points:e.points,metaInfoForLines:e.metaInfoLines,typeXAxis:"dateClear",widthYaxis:"7rem",theme:e.getActiveTheme,maxIndicator:!1,minIndicator:!1},on:{hover:e.hoverPoint}}):e._e()],1),i("div",{staticClass:"profitPositionContainer"},[e.dataProfit?i("ProfitPosition",{attrs:{dataProfit:e.dataProfit,allDataProfit:e.allDataProfit,report:!0},on:{getSizeArr:e.getSizeArr}}):e._e()],1),(null===(t=e.dataProfit)||void 0===t?void 0:t.length)>0?i("footer",[i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[0]+"%"}}),i("LabelBlock",{staticClass:"countSubscriber",style:{"--width":e.sizes[1]+"%"},attrs:{title:e.$t("number"),value:e.allCountSubscriber}}),i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[2]+"%"}}),i("LabelBlock",{staticClass:"allIncome",style:{"--width":e.sizes[3]+"%"},attrs:{title:e.$t("profit_from_copying"),value:"$ "+e.allProfit}}),i("LabelBlock",{staticClass:"allIncome",style:{"--width":e.sizes[4]+"%"},attrs:{title:e.$t("your_income"),value:e.myAllProfit}}),i("div",{staticClass:"emptyBlock",style:{"--width":e.sizes[5]+"%"}})],1):e._e()])},Gzt=[],qzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"LabelBlock",class:t.darkClass},[e("div",{staticClass:"label"},[t._v(t._s(t.title))]),e("div",{staticClass:"value"},[t._v(t._s(t.value))])])},zzt=[],Yzt={name:"LabelBlock",mixins:[xt],props:{title:{type:String},value:{type:[Number,String]}}},Xzt=Yzt,Qzt=(i("0a38"),Object(C["a"])(Xzt,qzt,zzt,!1,null,"5a25d450",null)),Jzt=Qzt.exports,Kzt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"CheckBoxViewData"},[e("div",{staticClass:"contract"},[t._v(t._s(t.checkElem.contract))]),e("div",{staticClass:"count"},[t._v(t._s(t.countSubscriber))])])},Zzt=[],tYt={name:"CheckBoxViewData",components:{},props:{checkElem:{type:Object}},mixins:[],data:function(){return{}},watch:{},computed:{countSubscriber:function(){return this.checkElem.data.at(-1)[1]}},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},eYt=tYt,iYt=(i("0f0b"),Object(C["a"])(eYt,Kzt,Zzt,!1,null,"1cd035f7",null)),oYt=iYt.exports,nYt={name:"DetailSubscriber",components:{ProfitPosition:Oht,LineEventChart:Uk,LabelBlock:Jzt,DxCheckBox:Th["DxCheckBox"],CheckBoxViewData:oYt},props:{statCountSubscribersByDay:{type:[Array,Boolean]}},mixins:[Wht,xt],data:function(){return{visibleGraph:!1,points:null,metaInfoLines:null,statsForHoverWidget:null,positionHoverWidget:null,dataProfit:null,allDataProfit:null,checkedData:[],sizes:[]}},watch:{},computed:{dataGraph:function(){var t={};return this.statCountSubscribersByDay.forEach((function(e){t[e.contract]||(t[e.contract]=[]),t[e.contract].push(e)})),t},dopColors:function(){var t=Object.keys(this.dataGraph).length;if(t>5){var e=t-5,i=[];return Array.from(new Array(e)).forEach((function(){var t=uB(),e=t.color,o=t.fill;i.push({color:e,fill:o})})),i}return[]},colors:function(){return this.darkClass.dark?[{color:"rgba(0, 185, 252, 1)",fill:"rgba(0, 185, 252, 0.1)"},{color:"rgba(0, 255, 172, 1)",fill:"rgba(0, 255, 172, 0.1)"},{color:"rgba(250, 76, 74, 1)",fill:"rgba(250, 76, 74, 0.1)"},{color:"rgba(211, 190, 0, 1)",fill:"rgba(211, 190, 0, 0.1)"},{color:"rgba(202, 117, 255, 1)",fill:"rgba(202, 117, 255, 0.1)"}].concat(Object(x["a"])(this.dopColors)):[{color:"rgba(60, 115, 241, 1)",fill:"rgba(60, 115, 241, 0.1)"},{color:"rgba(0, 142, 114, 1)",fill:"rgba(0, 142, 114, 0.1)"},{color:"rgba(233, 18, 18, 1)",fill:"rgba(233, 18, 18, 0.1)"},{color:"rgba(165, 124, 0, 1)",fill:"rgba(165, 124, 0, 0.1)"},{color:"rgba(172, 60, 241, 1)",fill:"rgba(172, 60, 241, 0.1)"}].concat(Object(x["a"])(this.dopColors))},checkedDataFiltered:function(){return this.checkedData.filter((function(t){return t.checked}))},allCountSubscriber:function(){return this.dataProfit?this.dataProfit.reduce((function(t,e){return t+e.count}),0):0},allProfit:function(){if(!this.dataProfit)return 0;var t=this.dataProfit.reduce((function(t,e){return t+e.profit}),0);return Lm(t,2,!0)},myAllProfit:function(){var t=this;if(!this.allDataProfit)return 0;var e=0;return this.subscriberCopy.forEach((function(i){var o=t.allDataProfit.find((function(t){return t.subscriptionId===i.id})),n=o.closedProfit;"Money"===i.priceType?e+=i.price:n&&n>0&&(e+=n*i.price/100)})),"$ ".concat(Lm(e,2,!0))}},methods:{hoverPoint:function(t){var e=this;if(t){var i=t.point;this.statsForHoverWidget=[],this.positionHoverWidget={top:"".concat(Math.round(t.cPointY),"px"),left:"".concat(t.cPointX-80,"px")},this.points.forEach((function(t,o){var n=t.find((function(t){return t.x===i.x}));n&&e.statsForHoverWidget.push({stat:"".concat("abs"===e.typeData?"$":"%"," ").concat(e.$moneyf(n.y,n.y>1e3?0:2)),color:e.metaInfoLines[o].color})}))}else this.positionHoverWidget=null},setPointsForChart:function(){var t=this;this.metaInfoLines=[],this.points=[],this.checkedDataFiltered.forEach((function(e){t.metaInfoLines.push({type:"line",color:e.color,fill:e.fill,fillIndicator:t.darkClass.dark?"#314456":"#fff",label:"",lineWidth:3,title:""}),t.points.push(e.data.map((function(t){return{x:new Date(t[0]).getTime(),date:new Date(t[0]).getTime(),y:t[1]}})))})),this.visibleGraph=!0},formatDataByContract:function(t){var e={};return t.forEach((function(t){e[t.date]||(e[t.date]=0),e[t.date]+=t.count})),Object.entries(e).sort((function(t,e){return new Date(t[0]).getTime()-new Date(e[0]).getTime()}))},setStatus:function(t,e){var i=this.checkedData.findIndex((function(t){return t.contract===e}));this.checkedData[i].checked=t.value,this.setPointsForChart()},getSizeArr:function(t){this.sizes=t}},mounted:function(){var t=this;this.checkedData=Object.entries(this.dataGraph).map((function(e,i){return{contract:e[0],checked:!0,color:t.colors[i].color,fill:t.colors[i].fill,data:t.formatDataByContract(e[1])}})),this.setPointsForChart()},destroyed:function(){},activated:function(){},deactivated:function(){}},sYt=nYt,rYt=(i("e2fd"),Object(C["a"])(sYt,Hzt,Gzt,!1,null,"12c8c890",null)),aYt=rYt.exports,cYt={name:"SubscribersCentralPart",components:{TabsPanel:Nct,Subscription:Vqt,Subscriber:Xqt,TableHistory:ezt,TableHistorySubscriber:Ozt,GrowthSubscription:Izt,AnalyticSubscription:jzt,PaymentSubscription:Vzt,DetailSubscriber:aYt},props:{userOrders:{type:[Object,Boolean]},statCountSubscribersByDay:{type:[Array,Boolean]}},mixins:[xt],data:function(){return{activeComponent:null}},watch:{getDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t&&(e.activeComponent=e.isProvider?"Subscriber":"Subscription");case 1:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),{},{tabsSubscriber:function(){return[[{width:"auto",title:"Подписчики",icon:"MySubscribers",component:"Subscriber"},{width:"auto",title:"Прирост",icon:"StatsGraph",component:"GrowthSubscription"},{width:"auto",title:"Детально",icon:"Instruments",component:"DetailSubscriber"},{width:"auto",title:"История",icon:"History",component:"TableHistorySubscriber"}]]},tabsSubscription:function(){return[[{width:"auto",title:"Подписки",icon:"MySubscribers",component:"Subscription"},{width:"auto",title:"История",icon:"History",component:"TableHistory"}]]},tabs:function(){return this.isProvider?this.tabsSubscriber:this.tabsSubscription},props:function(){return{TableHistory:{userOrders:this.userOrders},GrowthSubscription:{statCountSubscribersByDay:this.statCountSubscribersByDay},DetailSubscriber:{statCountSubscribersByDay:this.statCountSubscribersByDay}}}}),methods:{tabClick:function(t){var e=t.tabData;e.component&&e.component!==this.activeComponent&&(this.activeComponent=e.component)}},mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.getDefaultAccount&&(t.activeComponent=t.isProvider?"Subscriber":"Subscription");case 1:case"end":return e.stop()}}),e)})))()},destroyed:function(){["Subscription","TableHistory"].includes(this.activeComponent)&&(this.$store.commit("subscriptionsContract/setData",{copyData:null,subsData:null}),this.$store.commit("subscriptionsContract/setSubscriptionCopyHistory",null),this.$store.commit("subscriptionsContract/setPortfolioHistoryByAccountId",null)),["Subscriber","TableHistorySubscriber"].includes(this.activeComponent)&&this.$store.commit("subscriptionsContract/setSubscriberData",{subscriberCopy:null,subscriberCopyHistory:null,subscriberSubs:null})}},lYt=cYt,uYt=(i("dd31"),Object(C["a"])(lYt,Fqt,jqt,!1,null,"0687d053",null)),dYt=uYt.exports,hYt=function(){var t,e=this,i=e._self._c;return i("div",{staticClass:"LeftBarSubscriber",class:e.darkClass},[i("div",{staticClass:"topBar"},[i("UserProfileLeftSideTopBar",{attrs:{accountGroupCodeProps:e.accountGroupCode,sequenceIdProps:e.sequenceId}})],1),e.getLeftSideBar?i("div",{staticClass:"contentBar"},[i("UserProfileLeftSideMicroCard",{attrs:{getLeftSideBar:e.getLeftSideBar,userData:e.userData,providerStatus:e.isProvider}}),i("div",{staticClass:"sectorDiagramm"},[i("div",{staticClass:"wrapCanvas"},[i("SectorDiagram",{key:e.getSectorDiagramObject.length,attrs:{height:90,width:90,widthBorder:33,fontSize:.1,percents:e.getSectorDiagramObject}})],1),i("div",{staticClass:"detailContract"},e._l(e.getSectorDiagramObject,(function(t){return i("div",{key:t.contract,staticClass:"line",style:{color:t.color}},[i("div",{staticClass:"symbol"},[e._v(e._s(t.contract))]),i("div",{staticClass:"horizontalLine w80"}),i("div",{staticClass:"percent"},[e._v(e._s(t.data)+"%")]),i("div",{staticClass:"horizontalLine"}),i("div",{staticClass:"count"},[e._v(e._s(t.count))])])})),0)]),i("div",{staticClass:"datesValues"},[i("div",{staticClass:"buttonSection"},e._l(e.yearButton,(function(t){return i("button",{key:t,class:{active:t===e.selectedYear},on:{click:function(i){return e.setYear(t)}}},[e._v(e._s(t))])})),0),i("div",{staticClass:"tableSection"},[e._m(0),i("div",{staticClass:"tBody"},e._l(e.getSubscribersByMonth,(function(t,o){return t.count?i("div",{key:o,staticClass:"tr"},[i("div",{staticClass:"td"},[e._v(e._s(t.name))]),i("div",{staticClass:"td"},[e._v(e._s(t.count))])]):e._e()})),0)])]),i("div",{staticClass:"moreData"},[i("div",{staticClass:"dataWithLabel"},[i("div",{staticClass:"floatingLabel"},[e._v("Подписчиков")]),e._v(" "+e._s(null===(t=e.subscriberCopy)||void 0===t?void 0:t.length))])])],1):e._e()])},pYt=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"tHead"},[e("div",{staticClass:"tr"},[e("div",{staticClass:"th"},[t._v("Месяц")]),e("div",{staticClass:"th"},[t._v("Подписчиков")])])])}],gYt={name:"LeftBarSubscriber",components:{UserProfileLeftSideTopBar:qZ,UserProfileLeftSideMicroCard:KZ,SectorDiagram:MB},props:{statCountSubscribers:{type:[Array,Boolean]}},mixins:[xt],data:function(){return{selectedYear:"",month:(new Date).getMonth(),year:(new Date).getTime()}},watch:{},computed:Object(c["a"])(Object(c["a"])({},Object(p["c"])({isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount",getLeftSideBar:"userSettings/getLeftSideBar",getUserDetail:"user/getUserDetail",subscriberCopyHistory:"subscriptionsContract/subscriberCopyHistory",subscriberCopy:"subscriptionsContract/subscriberCopy",getServerTime:"serverTime/getServerTime"})),{},{accountGroupCode:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.accountGroupCode},sequenceId:function(){var t;return null===(t=this.getDefaultAccount)||void 0===t?void 0:t.sequenceId},userData:function(){return{avatarURL:this.getUserDetail.avatarURL,background:null,createDate:this.getUserDetail.createDate,firstName:this.getUserDetail.firstName,lastName:this.getUserDetail.lastName}},currentSubscriberCopyByContract:function(){if(!this.subscriberCopy)return[];var t={};return this.subscriberCopy.forEach((function(e){t[e.contract]||(t[e.contract]=0),t[e.contract]+=1})),Object.entries(t).sort((function(t,e){return e[1]-t[1]}))},dopColors:function(){if(this.currentSubscriberCopyByContract.length>5){var t=this.currentSubscriberCopyByContract.length-5,e=[];return Array.from(new Array(t)).forEach((function(){var t=uB(),i=t.color,o=t.fill;e.push({color:i,fill:o})})),e}return[]},colors:function(){return this.darkClass.dark?[{color:"rgba(0, 185, 252, 1)",fill:"rgba(0, 185, 252, 0.1)"},{color:"rgba(0, 255, 172, 1)",fill:"rgba(0, 255, 172, 0.1)"},{color:"rgba(250, 76, 74, 1)",fill:"rgba(250, 76, 74, 0.1)"},{color:"rgba(211, 190, 0, 1)",fill:"rgba(211, 190, 0, 0.1)"},{color:"rgba(202, 117, 255, 1)",fill:"rgba(202, 117, 255, 0.1)"}].concat(Object(x["a"])(this.dopColors)):[{color:"rgba(60, 115, 241, 1)",fill:"rgba(60, 115, 241, 0.1)"},{color:"rgba(0, 142, 114, 1)",fill:"rgba(0, 142, 114, 0.1)"},{color:"rgba(233, 18, 18, 1)",fill:"rgba(233, 18, 18, 0.1)"},{color:"rgba(165, 124, 0, 1)",fill:"rgba(165, 124, 0, 0.1)"},{color:"rgba(172, 60, 241, 1)",fill:"rgba(172, 60, 241, 0.1)"}].concat(Object(x["a"])(this.dopColors))},yearButton:function(){if(!this.statCountSubscribers)return[];var t=this.statCountSubscribers.map((function(t){return new Date(t.date).getFullYear()}));return Object(x["a"])(new Set(t))},getSectorDiagramObject:function(){var t=this;return this.currentSubscriberCopyByContract.map((function(e,i){return{contract:e[0],count:e[1],data:Math.round(100*e[1]/t.subscriberCopy.length),color:t.colors[i].color}}))},filteredStatCountSubscribers:function(){var t=this;return this.statCountSubscribers?this.statCountSubscribers.filter((function(e){return new Date(e.date).getFullYear()===t.selectedYear})):[]},getSubscribersByMonth:function(){var t=this;if(!this.statCountSubscribers)return[];var e={0:{name:"Январь",monthNum:0,count:0},1:{name:"Февраль",monthNum:1,count:0},2:{name:"Март",monthNum:2,count:0},3:{name:"Апрель",monthNum:3,count:0},4:{name:"Май",monthNum:4,count:0},5:{name:"Июнь",monthNum:5,count:0},6:{name:"Июль",monthNum:6,count:0},7:{name:"Август",monthNum:7,count:0},8:{name:"Сентябрь",monthNum:8,count:0},9:{name:"Октябрь",monthNum:9,count:0},10:{name:"Ноябрь",monthNum:10,count:0},11:{name:"Декабрь",monthNum:11,count:0}};this.filteredStatCountSubscribers.forEach((function(t){var i=new Date(t.date).getMonth();e[i].count+=t.count}));var i=Object.values(e);return this.selectedYear!==this.year?i:i.map((function(e){var i,o=e.monthNum>t.month?null:e.count;return e.monthNum===t.month&&(o="".concat(null===(i=t.subscriberCopy)||void 0===i?void 0:i.length," (").concat(o,")")),Object(c["a"])(Object(c["a"])({},e),{},{count:o})}))}}),methods:{setYear:function(t){this.selectedYear=t}},mounted:function(){var t,e,i=null!==(t=this.getServerTime)&&void 0!==t&&t.now?new Date(null===(e=this.getServerTime)||void 0===e?void 0:e.now):new Date;this.selectedYear=i.getFullYear(),this.year=i.getFullYear(),this.month=i.getMonth()}},fYt=gYt,mYt=(i("dbca"),Object(C["a"])(fYt,hYt,pYt,!1,null,"7d259b68",null)),vYt=mYt.exports,yYt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"SubscribersRightBar",class:t.darkClass},[t._v("SubscribersRightBar")])},CYt=[],bYt={name:"SubscribersRightBar",components:{},props:{},mixins:[xt],data:function(){return{}},watch:{},computed:{},methods:{},mounted:function(){},destroyed:function(){},activated:function(){},deactivated:function(){}},SYt=bYt,PYt=(i("2f91"),Object(C["a"])(SYt,yYt,CYt,!1,null,"3571cb9e",null)),TYt=PYt.exports,xYt={name:"Subscribers",components:{Layout:oV,SubscribersCentralPart:dYt,LeftBarSubscriber:vYt,SubscribersRightBar:TYt,LeftBarCalcInvestProfit:VIt},props:{},mixins:[],data:function(){return{userOrders:null,statCountSubscribers:null,statCountSubscribersByDay:null}},watch:{getDefaultAccount:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t&&(e.getHistoryOrdersForAccount(),e.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:e.getDefaultAccount.id}),e.isProvider?e.getStatCountSubscriber():e.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:e.getDefaultAccount.id,filter:["Active","Created","Stoped"]}));case 1:case"end":return i.stop()}}),i)})))()}},computed:Object(c["a"])({},Object(p["c"])({getApiUrl:"api/api",getSession:"auth/getSession",isProvider:"subscribeOrders/isProvider",getDefaultAccount:"subscribeOrders/getDefaultAccount"})),methods:Object(c["a"])(Object(c["a"])({},Object(p["b"])({getListsPortfolio:"expertsPortfolio/getListsPortfolio"})),{},{setMessageHandler:function(t){if("HistoryOrders"===(null===t||void 0===t?void 0:t.command)){var e=JSON.parse(t.data);this.getDefaultAccount.id===e[0]&&(this.$orderStorage.setOrdersToStorage(e),this.userOrders=this.$orderStorage.getOrdersOnStorage(),this.$store.commit("contracts/setStatusByOrders",!0))}else"BrokerPosition"===(null===t||void 0===t?void 0:t.command)?this.getDefaultAccount.id===t.data.accountId&&this.$orderStorage.setUserOrder(t.data):"GetInvestBagInfo"===(null===t||void 0===t?void 0:t.command)&&this.getListsPortfolio(Kq(JSON.parse(t.data)))},getHistoryOrdersForAccount:function(){this.$store.commit("contracts/setStatusByOrders",!1);var t={Command:"HistoryOrders",Data:{accountId:this.getDefaultAccount.id,filter:{orderTypes:["All"],startTime:null,skipCount:0,maxCount:0,sortDirection:"Ascending"}}};this.$socketStream.sendCommand({ws:"apiWS3",command:t})},getStatCountSubscriber:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){var i,o,n,s,a,c,l,u;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=JSON.stringify({accountId:t.getDefaultAccount.id,byDay:!1}),o=JSON.stringify({accountId:t.getDefaultAccount.id,byDay:!0}),e.next=4,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 4:return n=e.sent,e.next=7,t.$http.get("".concat(t.getApiUrl,"Subscription/GetSourceStatisticByAccountId"),{params:i,headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":n}});case 7:return s=e.sent,a=s.data,e.next=11,t.$workKeys.signMessage(JSON.stringify(i),t.getSession.sk);case 11:return c=e.sent,e.next=14,t.$http.get("".concat(t.getApiUrl,"Subscription/GetSourceStatisticByAccountId"),{params:o,headers:{"X-TAPI-FP":t.getSession.fp,"X-TAPI-SIGN":c}});case 14:l=e.sent,u=l.data,t.statCountSubscribers=a,t.statCountSubscribersByDay=u;case 18:case"end":return e.stop()}}),e)})))()}}),mounted:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$socketStream.$on("apiWS3",t.setMessageHandler),t.getDefaultAccount&&(t.getHistoryOrdersForAccount(),t.$store.dispatch("subscriptionsContract/getAllSubscriptions",{accountId:t.getDefaultAccount.id}),t.isProvider?t.getStatCountSubscriber():t.$store.dispatch("expertsPortfolio/sendCommandListPortfolio",{accountId:t.getDefaultAccount.id,filter:["Active","Created","Stoped"]}));case 2:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.$socketStream.$off("apiWS3",this.setMessageHandler)}},OYt=xYt,wYt=(i("4e95a"),Object(C["a"])(OYt,$qt,Lqt,!1,null,"704dc2db",null)),_Yt=wYt.exports;o["default"].use(IR["a"]);var AYt,DYt=new IR["a"]({mode:"history",base:"/",routes:[{path:"/",name:"home",redirect:{name:"Trading"}},{path:"*",redirect:{name:"Trading"}},{path:"/strategies",name:"Strategies",component:Dnt},{path:"/user-profile",name:"UserProfile",component:e7,meta:{componentName:"UserProfile"},props:function(t){return{accountId:t.query.accountId,userId:t.query.userId,activeTabLoad:t.query.activeTabLoad,profileCardCollapsed:t.query.profileCardCollapsed}}},{path:"/chat",name:"Chat",component:_Dt,props:function(t){return{roomId:t.query.roomId}}},{path:"/personal-area",name:"Personal Area",component:krt},{path:"/trading",name:"Trading",meta:{componentName:"Trading"},component:SDt},{path:"/investing",name:"Investing",meta:{componentName:"Investing"},component:BNt},{path:"/report",name:"Report",meta:{componentName:"Report"},component:Mqt},{path:"/Subscribers",name:"Subscribers",meta:{componentName:"Subscribers"},component:_Yt}]}),kYt=(i("5cc6"),i("d096")),IYt=[{id:"apiWS",url:"wss://api.toptrader.ru/ws"},{id:"apiWS2",url:"wss://api.toptrader.ru/ws2"},{id:"apiWS3",url:"wss://api.toptrader.ru/ws3"},{id:"apiWS_NOTI",url:"wss://noti.toptrader.ru/ws"},{id:"chatWS",url:"wss://chat.toptrader.org/websocket"},{id:"streamWS",url:"wss://streamingservice.toptrader.ru/ws2"},{id:"streamChatWS",url:"wss://streamingservice.toptrader.ru/ws"}],BYt={install:function(t){var e=new t,o=[];t.prototype.$socketStream=e,e.events=new Kh;var n={};IYt.forEach((function(t){n[t.id]={id:t.id,connection:new kYt["a"](t.url)}})),window.addEventListener("offline",(function(){for(var t in n)n[t].connection.close()})),window.addEventListener("online",(function(){for(var t in n)n[t].connection.reconnect()}));var s=function(t){n[t].connection.onopen=function(){if(e.$emit("WSSstatus",{status:"connect",ws:n[t].id}),o.length){var i=o.filter((function(e){return e.ws===n[t].id}));i.forEach((function(e){n[t].connection.send(JSON.stringify(e.command))}))}}};for(var r in n)s(r);var a=function(t){n[t].connection.onclose=function(){e.$emit("WSSstatus",{status:"disconnect",ws:n[t].id})}};for(var c in n)a(c);function l(t){var e=new Promise((function(e,i){var o=new FileReader;o.onload=function(t){e(t.target.result)},o.onerror=function(t){i(t)},o.readAsArrayBuffer(t)}));return e}e.getActiveConnection=function(){return Object.keys(n)},e.addConnection=function(t){n[t.id]={id:t.id,connection:new kYt["a"](t.url)},n[t.id].connection.onopen=function(){if(e.$emit("WSSstatus",{status:"connect",ws:n[t.id].id}),o.length){var i=o.filter((function(e){return e.ws===n[t.id].id}));i.forEach((function(e){n[t.id].connection.send(JSON.stringify(e.command))}))}},n[t.id].connection.onmessage=function(i){l(i.data).then((function(i){var o=new Uint8Array(i),s=u.inflate(o,{to:"string"});e.$emit(n[t.id].id,JSON.parse(s)),e.events.emit(n[t.id].id,JSON.parse(s))}),(function(){var o=JSON.parse(i.data);o.msg&&"ping"===o.msg?n[t.id].connection.send(JSON.stringify({msg:"pong"})):e.$emit(n[t.id].id,o)}))}},e.removeConnection=function(t){n[t]&&n[t].connection.close()},e.sendScriptCommands=function(t){t.forEach((function(t){n[t.ws].connection.send(JSON.stringify(t.command))}))},e.sendCommand=function(t){t.command.method&&"Subscribe"===t.command.method&&o.push({ws:t.ws,command:t.command}),n[t.ws].connection.send(JSON.stringify(t.command))};var u=i("d7ac"),d=function(t){n[t].connection.onmessage=function(i){l(i.data).then((function(i){var o=new Uint8Array(i),s=u.inflate(o,{to:"string"});e.$emit(n[t].id,JSON.parse(s)),e.events.emit(n[t].id,JSON.parse(s))}),(function(){var o=JSON.parse(i.data);o.msg&&"ping"===o.msg?n[t].connection.send(JSON.stringify({msg:"pong"})):e.$emit(n[t].id,o)}))}};for(var h in n)d(h)}},MYt={namespaced:!0,state:{apiUri:"https://api.toptrader.ru/api/",apiUriNoti:"https://noti.toptrader.ru/api/",apiStream:"https://streamingservice.toptrader.ru/api/",apiStreamWS:"wss://streamingservice.toptrader.ru/ws2",apiUriPartner:"https://epapi.toptrader.ru/api/",apiChat:"https://chat.toptrader.org/api/v1/",apiUriPartnerSiteBuilder:"https://dcasapi.toptrader.ru/api/"},getters:{apiStreamWS:function(t){return t.apiStreamWS},restApi:function(t){return t.restApiUri},apiStream:function(t){return t.apiStream},apiChat:function(t){return t.apiChat},api:function(t){return t.apiUri},apiNoti:function(t){return t.apiUriNoti},apiUriPartnerSiteBuilder:function(t){return t.apiUriPartnerSiteBuilder},apiPartner:function(t){return t.apiUriPartner},devApi:function(t){return t.devApi},emailApi:function(t){return t.emailApi},emailTTApi:function(t){return t.emailTTUrl}}},$Yt=["regModal"],LYt={namespaced:!0,state:{login:"",session:null,wsKey:"",authError:"",userID:"",hadshake:null},getters:{getAuthUri:function(t,e,i,o){return o["api/api"]+"auth/auth"},getHandshake:function(t){return t.hadshake},getSession:function(t){return t.session},getWsKey:function(t){return t.wsKey},getAuthError:function(t){return t.authError},getUserID:function(t){return t.userID},getLogin:function(t){return t.login}},mutations:{setError:function(t,e){t.authError=e},setSession:function(t,e){t.session=e},setHandshake:function(t,e){t.hadshake=e},setWsKey:function(t,e){t.wsKey=e},setLogin:function(t,e){t.login=e},setUserID:function(t,e){t.userID=e},clearCreds:function(t){t.login="",t.wsKey=""}},actions:{subscribeNotification:function(t){var e=t.getters,i={command:"Connect",FingerPrint:e["getSession"].fp,Sign:""};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS_NOTI",command:i})},performLogin:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.dispatch,c=t.getters,l=e.regModal,u=Object(jv["a"])(e,$Yt),i.next=4,o["default"].prototype.$http.post(c["getAuthUri"],JSON.stringify(e[0])).then(function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(i){var a,c;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(401!==i.data.errorCode&&!1!==i.data.passValid){t.next=6;break}return 401===i.data.errorCode&&n("setError","invalid_password"),!1===i.data.passValid&&n("setError","anopaetaa10"),t.abrupt("return",i);case 6:if(!i.data.message){t.next=9;break}return n("setError","invalid_password"),t.abrupt("return",i);case 9:return t.next=11,o["default"].prototype.$workKeys.signMessage(i.data.fingerPrint,e[1].sk);case 11:a=t.sent,c={fp:i.data.fingerPrint,ek:e[1].ek,sk:e[1].sk,singFP:a},o["default"].prototype.$workStorage.getWorker().postMessage(JSON.stringify(c)),n("setError",""),n("setSession",c),s("subscribeNotification"),n("setLogin",u.username),n("setUserID",i.data.userID),s("chat/authChatByToken",null,{root:!0}),s("user/getUserData",null,{root:!0}).then((function(){var t={command:"AccountsByUser",data:{userId:i.data.userID}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS",command:t})})),l||s("modal/setPopupData",{visiblePopup:!1},{root:!0});case 22:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 4:case"end":return i.stop()}}),i)})))()},exitAuth:function(t){var e=t.commit,i=t.dispatch;i("statusRequests/loadStateRquest",{field:"authRequest",data:"noSent"},{root:!0}),i("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"noSent"},{root:!0}),i("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"noSent"},{root:!0}),e("clearCreds"),e("user/clearUserData",null,{root:!0}),e("paymentService/clearPaymentServices",null,{root:!0}),e("userSettings/clearSettings",null,{root:!0}),e("subscribeOrders/clearAccountsData",null,{root:!0}),window.localStorage.removeItem("TTUserInfo")}}},FYt={namespaced:!0,state:{userId:"",role:"",errorsReg:{errorEmail:!1,errorLogin:!1},statusSucces:!1,regLogin:"",regPass:""},getters:{getRegUri:function(t,e,i,o){return o["api/api"]+"user"},getError:function(t){return t.errorsReg},getUserId:function(t){return t.userId},getStatus:function(t){return t.statusSucces},getRegLogin:function(t){return t.regLogin},getRegRole:function(t){return t.role},getRegPass:function(t){return t.regPass}},mutations:{setErrors:function(t,e){t.errorsReg.errorEmail=e.emailExist,t.errorsReg.errorLogin=e.loginExist},setUserId:function(t,e){t.userId=e},setRegRole:function(t,e){t.role=e},setStatus:function(t,e){t.statusSucces=e},setRegLogin:function(t,e){t.regLogin=e},setRegPass:function(t,e){t.regPass=e}},actions:{registartion:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,o["default"].prototype.$http.post(t.getters["getRegUri"],e);case 3:n={emailExist:!1,loginExist:!1},t.commit("setRegLogin",e.login),t.commit("setRegPass",e.password),t.commit("setRegRole",e.role),t.commit("setErrors",n),t.commit("setStatus",!0),i.next=14;break;case 11:i.prev=11,i.t0=i["catch"](0),i.t0.response.data.existCredentials&&(s=i.t0.response.data.existCredentials,t.commit("setErrors",s),t.commit("setStatus",!1));case 14:case"end":return i.stop()}}),i,null,[[0,11]])})))()}}},jYt={namespaced:!0,state:{user:{login:"",password:"",email:"",role:"",firstName:"",lastName:"",id:"",avatar:"",phone:"",secondName:"",timeSettings:(new Date).getTime(),detail:null,isVarifiedPhone:"",isVarifiedEmail:""},profile:{},listenUser:"",error:!1,timeSettings:(new Date).getTime(),screenWidth:null,widthCentralBlock:null},getters:{getWidthCentralBlock:function(t){return t.widthCentralBlock},getSession:function(t,e,i,o){return o["auth/getSession"]},getScreenWidth:function(t){return t.screenWidth},getTimeSettings:function(t){return t.timeSettings},getApiUri:function(t,e,i,o){return o["api/api"]+"user"},getUserDetail:function(t){return t.user},getUserProfile:function(t){return t.profile},getError:function(t){return t.error},customData:function(t){var e;if(!t.user.customData)return{};var i=JSON.parse(null===(e=t.user)||void 0===e?void 0:e.customData);return i}},mutations:{setWidthCentralBlock:function(t,e){t.widthCentralBlock=e},setUserProfile:function(t,e){t.profile=e.profile},setUserDetails:function(t,e){e.user&&(t.user=e.user)},redactUserDetails:function(t,e){e.key?t.user[e.option]=Object(Vt["a"])({},e.key,e.data):t.user[e.option]=e.data},redactContactInfo:function(t,e){t.user.detail.userDetails[e.index].value=e.value},clearUserData:function(t){t.user={login:"",password:"",email:"",role:"",firstName:"",lastName:"",id:"",avatar:"",timeSettings:0}},setError:function(t,e){t.error=e},setListenUser:function(t,e){t.listenUser=e},setCustomData:function(t,e){if("string"!==typeof t.user.customData)return t.user.customData={},t.user.customData[e.field]=e.data,void(t.user.customData=JSON.stringify(t.user.customData));var i=JSON.parse(t.user.customData);i[e.field]=e.data,t.user.customData=JSON.stringify(i)},setScreenWidth:function(t,e){t.screenWidth=e}},actions:{saveSettings:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.getters,s=n["getApiUri"],!n["getApiUri"]){i.next=9;break}return i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify(n["getUserDetail"]));case 5:return a=i.sent,c=n["getSession"],i.next=9,o["default"].prototype.$http.put(s,JSON.stringify(n["getUserDetail"]),{headers:{"Content-Type":"application/json","X-TAPI-FP":c.fp,"X-TAPI-SIGN":a}}).then((function(){e.dispatch("user/getUserData")})).catch((function(t){window.console.log(t)}));case 9:case"end":return i.stop()}}),i)})))()},getUserData:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.commit,n=t.getters,s=t.dispatch,a=n["getApiUri"],s("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"pending"},{root:!0}),e.next=5,o["default"].prototype.$http.get(a,{headers:{"Content-Type":"application/json","X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":n["getSession"].singFP}}).then((function(t){var e=t.data.user.role;"User"===e||"Guest"===e?(i("setUserDetails",t.data),i("setUserProfile",t.data),t.data.profile?(i("userSettings/setUserSettings",t.data.profile.uiSettings,{root:!0}),s("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"ready"},{root:!0})):(i("userSettings/setUserSettings",null,{root:!0}),s("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"err"},{root:!0}))):"Partner"===e&&i("setUserDetails",t.data)})).catch((function(t){i("setError",t.response.status),s("statusRequests/loadStateRquest",{field:"userDetailRequest",data:"err"},{root:!0}),s("auth/exitAuth",null,{root:!0})}));case 5:case"end":return e.stop()}}),e)})))()},saveCustomData:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["user/getSession"],c=n["user/getUserDetail"],l=JSON.parse(JSON.stringify(c)),null===l.customData?l.customData={}:l.customData=JSON.parse(l.customData),l.customData[e.field]=e.data,l.customData=JSON.stringify(l.customData),i.next=10,o["default"].prototype.$workKeys.signMessage(JSON.stringify(l));case 10:return u=i.sent,i.next=13,o["default"].prototype.$http.put("".concat(s,"User"),l,{headers:{"X-TAPI-FP":a.fp,"X-TAPI-SIGN":u}});case 13:case"end":return i.stop()}}),i)})))()},setCustomData:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=t.commit,n=t.dispatch,i.next=3,n("saveCustomData",{field:e.field,data:e.data});case 3:o("setCustomData",{field:e.field,data:e.data});case 4:case"end":return i.stop()}}),i)})))()}}},RYt={namespaced:!0,state:{overlay:!1,regModal:!1,settingsHeaderMenu:!1,finishModal:{status:!1,data:{firstName:"Name",lastName:"lastName"}},settingsScreenQuotes:!1,recoverPassModal:!1,ordersPanel:{status:!1,data:null},followSettings:{status:!1,data:null},uploadImageOnServer:{status:!1,data:null,link:null},followOffModal:{status:!1,data:null},ChartTradingModalCat:{status:!1,data:[]},ChartTradingNewModalCat:!1,addAccountModal:!1,signAccountModal:!1,compareProvidersModal:{status:!1,data:null},filterModal:{status:!1,data:null},brokersModal:!1,checkCode:{status:!1,check:""},notifications:{status:!1,event:"order"},pig:{status:!1,data:null},subscriptionModal:!1,loadImageForUser:{status:!1,data:null},newOrder:{status:!1,data:null},meetingModal:!1,videoCall:{status:!1,data:null},videoConference:{status:!1,data:null},subscriptionBuyModal:!1,disclaimerModal:!1,indicatorsModal:!1,settingsIndicatorModal:{status:!1,data:""},expertsOpenTradingAccountModal:!1,profileSubsModal:!1,profileSubsModalTitle:"",modalServices:!1,selfieModal:!1,streamPlayer:{status:!1,data:""},streamSettingsModal:{status:!1,data:""},tradeNotification:!1,chatStreamModal:!1,numberStepsForRegistration:4,modalData:{modalComponentName:"",payload:null,visible:!1,titlePopup:"",dragEnabled:!1,numberSteps:null,currentStep:null,width:300,height:"auto"},tvWidget:!1},getters:{getTradeNotification:function(t){return t.tradeNotification},getConfigPopup:function(t){return t.modalData},getNumberStepsForRegistration:function(t){return t.numberStepsForRegistration},getChatStreamModal:function(t){return t.chatStreamModal},getStreamSettingsModal:function(t){return t.streamSettingsModal},getStreamPlayer:function(t){return t.streamPlayer},getSelfieModal:function(t){return t.selfieModal},getOrdersPanel:function(t){return t.ordersPanel},getSettingsScreenQuotes:function(t){return t.settingsScreenQuotes},getloadImageForUserModal:function(t){return t.loadImageForUser},getSettingsHeaderMenuModal:function(t){return t.settingsHeaderMenu},getUploadImageModal:function(t){return t.uploadImageOnServer},getIndicatorsModalStatus:function(t){return t.indicatorsModal},getSettingsIndicatorModal:function(t){return t.settingsIndicatorModal},getCheckCodeModalStatus:function(t){return t.checkCode},getNewOrderModal:function(t){return t.newOrder},getPigModal:function(t){return t.pig},getDisclaimerModal:function(t){return t.disclaimerModal},getFollowSettings:function(t){return t.followSettings},getFollowOffModal:function(t){return t.followOffModal},getVideoCallStatus:function(t){return t.videoCall},getVideoConferenceStatus:function(t){return t.videoConference},getRegModalStatus:function(t){return t.regModal},getNotificationsStatus:function(t){return t.notifications},getAuthModalStatus:function(t){return t.authModal},getFinishModalStatus:function(t){return t.finishModal.status},getFinishModalData:function(t){return t.finishModal.data},getRecoverPassModalStatus:function(t){return t.recoverPassModal},getChartTradingModalCatStatus:function(t){return t.ChartTradingModalCat},getChartTradingNewModalCatStatus:function(t){return t.ChartTradingNewModalCat},getAddAccountModalStatus:function(t){return t.addAccountModal},getSignAccountModalStatus:function(t){return t.signAccountModal},getCompareProvidersModalStatus:function(t){return t.compareProvidersModal},getFilterModalStatus:function(t){return t.filterModal},getBrokersModalStatus:function(t){return t.brokersModal},getSubscriptionModalStatus:function(t){return t.subscriptionModal},getMeetingModalStatus:function(t){return t.meetingModal},getSubscriptionBuyModalStatus:function(t){return t.subscriptionBuyModal},getExpertsOpenTradingAccountModal:function(t){return t.expertsOpenTradingAccountModal},getProfileSubsModal:function(t){return t.profileSubsModal},getProfileSubsModalTitle:function(t){return t.profileSubsModalTitle},getModalServicesStatus:function(t){return t.modalServices},getTvWidgetStatus:function(t){return t.tvWidget}},mutations:{setTradeNotification:function(t,e){t.tradeNotification=e},setPopupData:function(t,e){t.modalData=e},setTvWidget:function(t,e){t.tvWidget=e},setChatStreamModal:function(t){t.chatStreamModal=!t.chatStreamModal},setStreamSettingsModal:function(t,e){t.streamSettingsModal.status=e.status,t.streamSettingsModal.data=e.data},setStreamPlayer:function(t,e){t.streamPlayer.status=e.status,t.streamPlayer.data=e.data},setSelfieModal:function(t){t.selfieModal=!t.selfieModal},setSettingsHeaderMenuModal:function(t){t.settingsHeaderMenu=!t.settingsHeaderMenu},setSettingsScreenQuotes:function(t){t.settingsScreenQuotes=!t.settingsScreenQuotes},setIndicatorsModal:function(t){t.indicatorsModal=!t.indicatorsModal},setRegModal:function(t){t.regModal=!t.regModal},setDisclaimerModal:function(t){t.disclaimerModal=!t.disclaimerModal},setCheckCodeModalStatus:function(t,e){t.checkCode=e},setOrdersPanel:function(t,e){t.ordersPanel.status=e.status,t.ordersPanel.data=e.data},setLoadImageForUserModal:function(t,e){t.loadImageForUser.status=!t.loadImageForUser.status,t.loadImageForUser.data=e},setFinishModal:function(t,e){t.finishModal.status=!t.finishModal.status,t.finishModal.data=e},setRecoverPassModal:function(t){t.recoverPassModal=!t.recoverPassModal},setChartTradingModalCat:function(t,e){t.ChartTradingModalCat.status=!t.ChartTradingModalCat.status,t.ChartTradingModalCat.data=e},setChartTradingNewModalCat:function(t){t.ChartTradingNewModalCat=!t.ChartTradingNewModalCat},setAddAccountModal:function(t){t.addAccountModal=!t.addAccountModal},setSignAccountModal:function(t){t.signAccountModal=!t.signAccountModal},setVideoConferenceModal:function(t,e){t.videoConference.status=!t.videoConference.status,t.videoConference.data=e},setVideoCallModal:function(t,e){t.videoCall.status=!t.videoCall.status,t.videoCall.data=e},setCompareProvidersModal:function(t,e){t.compareProvidersModal.status=!t.compareProvidersModal.status,t.compareProvidersModal.data=e},setRedyLinkToUploadImageModal:function(t,e){t.uploadImageOnServer.link=e},setUploadImageModal:function(t,e){t.uploadImageOnServer.status=!t.uploadImageOnServer.status,t.uploadImageOnServer.data=e,t.uploadImageOnServer.link=null},setSettingsIndicatorModal:function(t,e){t.settingsIndicatorModal.status=!t.settingsIndicatorModal.status,t.settingsIndicatorModal.data=e},setPigModal:function(t,e){t.pig.status=!t.pig.status,t.pig.data=e},setNewOrderModal:function(t,e){t.newOrder.status=!t.newOrder.status,e&&(t.newOrder.data=e)},setFilterModal:function(t,e){t.filterModal.status=!t.filterModal.status,e&&(t.filterModal.data=e)},setBrokersModal:function(t,e){t.brokersModal=!0===e},setNotificationsStatus:function(t,e){t.notifications.status=!t.notifications.status,t.notifications.event=e},setNotificationActiveEvent:function(t,e){t.notifications.event=e},setSubscriptionModal:function(t){t.subscriptionModal=!t.subscriptionModal},setMeetingModal:function(t){t.meetingModal=!t.meetingModal},setSubscriptionBuyModal:function(t){t.subscriptionBuyModal=!t.subscriptionBuyModal},setFollowSettings:function(t,e){t.followSettings.status=!t.followSettings.status,t.followSettings.data=e},setFollowOffModal:function(t,e){t.followOffModal.status=!t.followOffModal.status,t.followOffModal.data=e},setExpertsOpenTradingAccountModal:function(t){t.expertsOpenTradingAccountModal=!t.expertsOpenTradingAccountModal},setProfileSubsModal:function(t,e){t.profileSubsModal=!t.profileSubsModal,t.profileSubsModalTitle=e},setServicesModal:function(t){t.modalServices=!t.modalServices}},actions:{switchTvWidget:function(t,e){t.commit("setTvWidget",e)},switchChatStreamModal:function(t){t.commit("setChatStreamModal")},switchStreamSettingsModal:function(t,e){t.commit("setStreamSettingsModal",e)},switchStreamPlayer:function(t,e){t.commit("setStreamPlayer",e)},switchSelfieModal:function(t){t.commit("setSelfieModal")},switchOrdersPanel:function(t,e){t.commit("setOrdersPanel",e)},switchLoadImageForUserModal:function(t,e){t.commit("setLoadImageForUserModal",e)},switchSettingsScreenQuotes:function(t){t.commit("setSettingsScreenQuotes")},switchSettingsHeaderMenuModal:function(t){t.commit("setSettingsHeaderMenuModal")},switchSettingsIndicatorModal:function(t,e){t.commit("setSettingsIndicatorModal",e)},switchRegModal:function(t){t.commit("setRegModal")},switchIndicatorsModal:function(t){t.commit("setIndicatorsModal")},switchDisclaimerModal:function(t){t.commit("setDisclaimerModal")},switchFollowSettings:function(t,e){t.commit("setFollowSettings",e)},switchPigModal:function(t,e){t.commit("setPigModal",e)},switchUploadImageModal:function(t,e){t.commit("setUploadImageModal",e)},switchNewOrderModal:function(t,e){t.commit("setNewOrderModal",e)},switchFollowOffModal:function(t,e){t.commit("setFollowOffModal",e)},switchCheckCodeModal:function(t,e){t.commit("setCheckCodeModalStatus",e)},switchFinishModal:function(t,e){t.commit("setFinishModal",e)},switchRecoverPassModal:function(t){t.commit("setRecoverPassModal")},switchChartTradingModalCat:function(t,e){t.commit("setChartTradingModalCat",e)},addInstrumentToChartTradingModalCat:function(t,e){var i=t.getters;i["getChartTradingModalCatStatus"].data.listContracts.push(e)},removeInstrumentToChartTradingModalCat:function(t,e){var i=t.getters,o=i["getChartTradingModalCatStatus"].data.listContracts.findIndex((function(t){return t===e}));i["getChartTradingModalCatStatus"].data.listContracts.splice(o,1)},switchChartTradingNewModalCat:function(t){t.commit("setChartTradingNewModalCat")},switchAddAccountModal:function(t){t.commit("setAddAccountModal")},switchSignAccountModal:function(t){t.commit("setSignAccountModal")},switchCompareProvidersModal:function(t,e){t.commit("setCompareProvidersModal",e)},switchFilterModal:function(t,e){t.commit("setFilterModal",e)},switchBrokersModal:function(t,e){t.commit("setBrokersModal",e)},switchNotifications:function(t,e){t.commit("setNotificationsStatus",e)},switchSubscriptionModal:function(t){t.commit("setSubscriptionModal")},switchMeetingModal:function(t){t.commit("setMeetingModal")},switchSubscriptionBuyModal:function(t){t.commit("setSubscriptionBuyModal")},switchExpertsOpenTradingAccountModal:function(t){t.commit("setExpertsOpenTradingAccountModal")},switchProfileSubsModal:function(t,e){t.commit("setProfileSubsModal",e)},switchServicesModal:function(t){t.commit("setServicesModal")},setPopupData:function(t,e){var i=t.commit;i("setPopupData",e)}}},WYt={namespaced:!0,state:{contracts:null,allInstruments:null,tradingAssets:null,usingContracts:null,statByContractsStatus:!1,statByOrders:!1},getters:{getContracts:function(t){return t.contracts},getStatByOrders:function(t){return t.statByOrders},getUsingAccountContracts:function(t){return t.usingContracts},getStatusStatByContract:function(t){return t.statByContractsStatus},getTradingInstruments:function(t){return t.allInstruments},getTradingAssets:function(t){return t.tradingAssets}},mutations:{setStatusByContractStat:function(t,e){t.statByContractsStatus=e},setAllTradingInstrumnets:function(t,e){t.allInstruments=e},setAllTradingAssets:function(t,e){t.tradingAssets=e},setStatusByOrders:function(t,e){t.statByOrders=e},setContracts:function(t,e){t.contracts=[],t.contracts=e},setUsingAccountContracts:function(t,e){t.usingContracts&&(t.usingContracts=null),t.usingContracts=e}},actions:{getAllTradingInstrumnets:function(t){var e=t.rootGetters,i=t.commit;o["default"].prototype.$http.get("".concat(e["api/api"],"AllTradingInstruments")).then((function(t){i("setAllTradingInstrumnets",t.data)}))},getAllTradingAssets:function(t){var e=t.rootGetters,i=t.commit;o["default"].prototype.$http.get("".concat(e["api/api"],"GetAllTradingAssets")).then((function(t){i("setAllTradingAssets",t.data)}))},LoadContracts:function(t,e){var i=t.commit;i("setContracts",e)},LoadUsingAccountContracts:function(t,e){var i=t.commit;i("setUsingAccountContracts",e)}}},NYt={namespaced:!0,state:{catalogs:{all:null}},getters:{getCatalogsByType:function(t){return function(e){return t.catalogs[e]}},getCatalogs:function(t){return t.catalogs}},mutations:{setTypeCatalogs:function(t,e){var i=e.filter((function(t){return t.groupName}));t.catalogs.all=i.sort((function(t,e){return t.se.s?1:0})),Object(x["a"])(new Set(i.map((function(t){return t.groupName})))).forEach((function(e){var o=[];i.forEach((function(i){e===i.groupName&&(o.push(i),t.catalogs[e]=o.sort((function(t,e){return t.se.s?1:0})))}))}))}},actions:{setLastQuotes:function(t,e){t.commit("setTypeCatalogs",e)}}},EYt={namespaced:!0,state:{brokers:[]},getters:{getApiUrl:function(t,e,i,o){return o["api/api"]+"Brokers"},getBrokers:function(t){return t.brokers}},mutations:{setBrokers:function(t,e){t.brokers=e}},actions:{getListBrokers:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o["default"].prototype.$http.get(t.getters["getApiUrl"]).then((function(e){t.commit("setBrokers",e.data)}));case 2:case"end":return e.stop()}}),e)})))()}}},UYt=new Promise((function(t){AYt=t})),VYt={namespaced:!0,state:{accountSubscribe:[],providerSubscribe:[],providerSubscribePay:[],listingSubscribe:[],listingAccounts:[],profileAccounts:[],subscribeProfileAccounts:[],defaultAccount:null,listingAccount:null},getters:{getAccountUri:function(t,e,i,o){return o["api/api"]+"UserAccount"},getSubscriptionUri:function(t,e,i,o){return o["api/api"]+"Subscription/"},getListingAccount:function(t){return t.listingAccount},getListingAccounts:function(t){return t.listingAccounts},getListingSubscribe:function(t){return t.listingSubscribe},getAccountSubscribe:function(t){return t.accountSubscribe},getProviderSubscribe:function(t){return t.providerSubscribe},getProviderSubscribePay:function(t){return t.providerSubscribePay},getProfileAccount:function(t){return t.profileAccounts},getDefaultAccount:function(t){return t.defaultAccount},isProvider:function(t){var e;return(null===(e=t.defaultAccount)||void 0===e||null===(e=e.source)||void 0===e?void 0:e.length)>0}},mutations:{clearAccountsData:function(t){t.accountSubscribe=[],t.providerSubscribe=[],t.listingSubscribe=[],t.listingAccounts=[],t.profileAccounts=[],t.defaultAccount=null,t.listingAccount=null,UYt=new Promise((function(t){AYt=t}))},clearListingAccount:function(t){t.listingAccount=null},setProfileAccounts:function(t,e){if(e&&e.length){var i=e[0],o=e[1];t.profileAccounts=i.map((function(t){return{id:t[0],sequenceId:t[1],balance:t[2],equity:t[3],closedProfit:t[4],margin:t[5],maxLeverage:t[6],assetCode:t[7],accountGroupCode:t[8],owner:t[9],registrationDate:t[10],brokerId:t[11],isPublish:t[12],isDefault:t[13],brokerGroup:t[14],isDelete:t[15],leverage:t[16],source:o.length?HYt(t[0],o):[],currencyChar:t[17],groupType:t[18],isReal:t[19]}})),AYt(),this.commit("subscribeOrders/setDefaultAccount",t.profileAccounts),this.commit("subscribeOrders/setAccountSubscribe",[t.defaultAccount])}},setProviderAccounts:function(t,e){e.length&&(t.providerSubscribe=Object(x["a"])(new Set(e.map((function(t){return t.sourceAccountId})))),t.providerSubscribePay=Object(x["a"])(new Set(e.filter((function(t){return t.subscription.startDateTime})).map((function(t){return t.sourceAccountId})))))},setListingAccounts:function(t,e){e.data.accountsData.forEach((function(i){t.listingAccounts.push({id:i.id,sequenceId:i.sequenceId,brokerId:i.brokerId,isPublishing:i.isPublish,isDefault:i.isDefault,userId:e.guid,balance:i.balance,equity:i.equity,group:i.accountGroupCode,owner:i.owner,regDate:i.registrationDate})}))},setListingAccount:function(t,e){t.listingAccount={id:e.id,userId:e.userId}},resetDefaultAccount:function(t,e){t.profileAccounts.forEach((function(t){t.id===e?t.isDefault=!0:t.isDefault=!1})),t.defaultAccount=t.profileAccounts.find((function(t){return t.isDefault}))},setDefaultAccount:function(t){var e=t.profileAccounts.find((function(t){return t.isDefault}));t.defaultAccount=e||t.profileAccounts[0]},addAccountToSubscribe:function(t,e){t.accountSubscribe.push(e)},setAccountSubscribe:function(t,e){t.accountSubscribe=[],e.forEach((function(e){t.accountSubscribe.push(e.id)}))}},actions:{readyPromise:function(){return UYt},getAccountsUser:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=t.commit,n=t.rootGetters,s=t.dispatch,i.next=3,n["serverTime/readyPromise"];case 3:s("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"pending"},{root:!0}),o("setProfileAccounts",e),s("statusRequests/loadStateRquest",{field:"userAccountsRequest",data:"ready"},{root:!0}),s("getProviderAccounts",n["user/getUserDetail"].id).then((function(){s("setSubscribe")}));case 7:case"end":return i.stop()}}),i)})))()},getProviderAccounts:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.getters,i.next=3,o["default"].prototype.$http.get(s["getSubscriptionUri"]+"Subscriptions?Id="+e+"&type=User").then((function(t){n("setProviderAccounts",t.data)}));case 3:case"end":return i.stop()}}),i)})))()},setSubscribe:function(t){var e={command:"BrokerPosition",method:"Subscribe",data:{AccountsId:[t.getters["getDefaultAccount"].id]}},i={command:"AccountsDetails",method:"Subscribe",data:{AccountsId:[t.getters["getDefaultAccount"].id],OrdersInfoQuery:0}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS",command:e}),o["default"].prototype.$socketStream.sendCommand({ws:"apiWS",command:i})}}};function HYt(t,e){var i=[];return e.forEach((function(e){e[1]===t&&i.push({id:e[0],accountId:e[1],contract:e[2],monthPrice:e[3],profitPercent:e[4],subscribers:e[5]})})),i}var GYt="ru",qYt="Русский",zYt={namespaced:!0,state:{uiSettings:{rightSidebar:{visible:!0},leftSidebar:{visible:!0},lang:{name:qYt,code:GYt},welcoms:[]},itemData:null},getters:{getUserSettings:function(t){return t.uiSettings},getWelcomsModals:function(t){return t.uiSettings.welcoms},getRightSideBar:function(t){var e,i;return null===(e=null===(i=t.uiSettings.rightSidebar)||void 0===i?void 0:i.visible)||void 0===e||e},getLeftSideBar:function(t){var e,i;return null===(e=null===(i=t.uiSettings.leftSidebar)||void 0===i?void 0:i.visible)||void 0===e||e},getUserId:function(t,e,i,o){return o["user/getUserDetail"]},getSession:function(t,e,i,o){return o["auth/getSession"]}},mutations:{setUserSettings:function(t,e){e?(t.uiSettings=e,e.welcoms||(t.uiSettings.welcoms=[]),e.lang&&(va(e.lang.code),fa.locale=e.lang.code)):(t.uiSettings={},t.uiSettings.welcoms=[]),this.dispatch("tableSettings/setFirstSettingsTable",t.uiSettings.table),this.dispatch("favoriteSettings/setFirstSettingsFavorite",t.uiSettings.favorites||{}),this.dispatch("quotesFavoriteSettings/setFirstSettingsQuotesFavorite",t.uiSettings.quoteFavorites||{}),this.dispatch("periodReportsSettings/setFirstPeriodReports",t.uiSettings.periodReports||{}),this.dispatch("headerSettings/serversSettingsHeader",t.uiSettings.header?t.uiSettings.header:t.uiSettings),this.dispatch("settingsTradingChart/setSettingsOnServer",t.uiSettings.tradingChartSettings?t.uiSettings.tradingChartSettings:null)},redactWelcomeModals:function(t,e){var i=t.uiSettings.welcoms;i.push(e.name),t.uiSettings.welcoms=Object(x["a"])(new Set(i)),this.dispatch("userSettings/saveUISettings",t.uiSettings)},redactSettings:function(t,e){e.key?(t.uiSettings[e.widget]||(t.uiSettings[e.widget]={},t.uiSettings[e.widget][e.key]=e.data),t.uiSettings[e.widget][e.key]=e.data):t.uiSettings[e.widget]=e.data,this.dispatch("userSettings/saveUISettings",t.uiSettings)},clearSettings:function(t){t.uiSettings={}}},actions:{saveUISettings:function(t,e){var i=t.getters;if(i["getSession"]){var n={Command:"SaveUserProfileData",Token:i["getSession"],data:{UserId:i["getUserId"].id,UISettings:e}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS",command:n})}}}},YYt={namespaced:!0,state:{accountsTradingSettings:{version:1.4,accounts:[]}},getters:{getAccountsSettings:function(t){return t.accountsTradingSettings},getSession:function(t,e,i,o){return o["auth/getSession"]}},mutations:{setAccountsSettings:function(t,e){var i=e.uiSettings.accountsTradingSettings;i&&i.version===t.accountsTradingSettings.version?t.accountsTradingSettings=i:t.accountsTradingSettings.accounts=e.accounts.map((function(t){return{accountId:t.id,hedging:[]}}))},addSettingInSettingsSet:function(t,e){t.accountsTradingSettings.accounts[e.index][e.key].push(e.data)},removeSettingInSettingsSet:function(t,e){var i=t.accountsTradingSettings.accounts.find((function(t){return t.id===e.accountId}));if(i){var o=i.hedging.findIndex((function(t){return t.symbol===e.symbol}));-1!==o&&i.hedging.splice(o,1)}},renewSettingInSettingsSet:function(t,e){t.accountsTradingSettings.accounts[e.index][e.key][e.keyIndex][e.option]=e.data},createAccountSettings:function(t,e){t.accountsTradingSettings.accounts.push(e)}},actions:{addAccountsSettings:function(t,e){t.commit("setAccountsSettings",e)},setSettingsAccountsSettings:function(t,e){var i=t.getters,o=t.commit;o(e.mutation,e.data),i["getSession"]&&o("userSettings/redactSettings",{widget:"accountsTradingSettings",data:i["getAccountsSettings"]},{root:!0})}}},XYt={namespaced:!0,state:{statistic:null,statisticByDay:null,yearsStat:null,orderStat:null,statByMonth:null,statByWeeks:null,statByYears:null},getters:{getStatistics:function(t){return t.statistic},getStatByYears:function(t){return t.statByYears},getStatisticsByDay:function(t){return t.statisticByDay},getYearsStat:function(t){return t.yearsStat},getStatByMonth:function(t){return t.statByMonth},getStatByWeeks:function(t){return t.statByWeeks},getOrdersStatistic:function(t){return t.orderStat}},mutations:{setOrdersStatistics:function(t,e){t.orderStat=e[0].ordersStatistics},updateStatisticYear:function(t,e){if(t.yearsStat&&!Array.isArray(t.yearsStat)){var i=Object.keys(t.yearsStat)[Object.keys(t.yearsStat).length-1];t.yearsStat[i].at(-1).equityClose=e.account.equity,t.yearsStat[i].at(-1).balanceClose=e.account.balance}},updateStatisticDay:function(t,e){t.statisticByDay&&t.statisticByDay.statistic.length&&(t.statisticByDay.statistic.at(-1).data.at(-1).equityClose=e.account.equity,t.statisticByDay.statistic.at(-1).data.at(-1).balanceClose=e.account.balance)},updateAccountDailyStatistic:function(t,e){t.statistic&&(t.statistic.accountDaily.length?(t.statistic.accountDaily[t.statistic.accountDaily.length-1].equityClose=e.account.equity,t.statistic.accountDaily[t.statistic.accountDaily.length-1].balanceClose=e.account.balance):(t.statistic.account.equity=e.account.equity,t.statistic.account.balance=e.account.balance))},updateStatistic:function(t,e){t.statByMonth&&t.statByMonth.length&&(t.statByMonth[t.statByMonth.length-1].balanceClose=e.account.balance,t.statByMonth[t.statByMonth.length-1].equityClose=e.account.equity,t.statByMonth[t.statByMonth.length-1].profitAbs=e.account.equity-t.statByMonth[t.statByMonth.length-1].equityOpen,t.statByMonth[t.statByMonth.length-1].profitRel=100/(e.account.equity/t.statByMonth[t.statByMonth.length-1].profitAbs))},setStatistics:function(t,e){TY.storeStat(e),TY.getStat()&&(t.statistic=TY.getStat()[0],t.yearsStat=TY.getYearsStat(),t.statByYears=TY.getStatByYears(t.statistic.accountDaily),t.statByMonth=TY.getStatByMonth(t.statistic.accountDaily),t.statByWeeks=TY.getStatByWeeks(t.statistic.accountDaily))},setStatisticsByDay:function(t,e){t.statisticByDay={},t.statisticByDay.statistic=e}},actions:{getStatisticByAccountsForDay:function(t,e){var i={Command:"GetAccountDailyByHourse",data:{AccountId:e}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS3",command:i})},getStatisticByAccounts:function(t,e){var i={Command:"GetStatisticsByAccounts",data:{AccountIds:e}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS3",command:i})}}},QYt={namespaced:!0,state:{paid:!1,mySubscriptions:[]},getters:{getPaidStatus:function(t){return t.paid},activeSubscriptions:function(t,e,i,o){var n,s=null===(n=o["serverTime/getServerTime"])||void 0===n?void 0:n.now;return t.mySubscriptions.filter((function(t){return new Date(t.subscription.stopDateTime).getTime()>new Date(s).getTime()}))},activeSubscriptionByAccount:function(t,e){return function(t){var i=e.activeSubscriptions.filter((function(e){return e.sourceAccountId===t}));return 0===i.length?[]:i.map((function(t){return t.subscription}))}},getMySubscriptions:function(t){return t.mySubscriptions}},mutations:{setPaid:function(t,e){t.paid=e},setMySubscriptions:function(t,e){t.mySubscriptions=e}},actions:{switchPaidStatus:function(t,e){t.commit("setPaid",e)},getSubscription:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],i.next=4,o["default"].prototype.$http.get("".concat(a,"Subscription/Subscriptions"),{params:e});case 4:c=i.sent,l=c.data,s("setMySubscriptions",l);case 7:case"end":return i.stop()}}),i)})))()}}},JYt={screenQuote:[{screen:{type:"number",color:"#3c73f1",avatar:"",name:"",screenId:Math.random().toString(36).substring(7)},content:[{setId:Math.random().toString(36).substring(7),selected:!0,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"EURUSD",listText:"EURUSD",groupName:"Forex",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]},{setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"USDJPY",listText:"USDJPY",groupName:"Forex",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]},{setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"GBPUSD",listText:"GBPUSD",groupName:"Forex",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]},{setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"BTCUSDT",listText:"BTCUSDT",groupName:"Crypto",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]},{setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"ETHUSDT",listText:"ETHUSDT",groupName:"Crypto",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]},{setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[{symbol:"XRPUSDT",listText:"XRPUSDT",groupName:"Crypto",timeFrame:"H1",chartType:"candlestick",groupPreset:"",selected:!0,id:Math.random().toString(36).substring(7)}]}]}],defaultMenu:[{name:"newOrder",activeStatus:!0,isActive:!1},{name:"newChart",activeStatus:!0,isActive:!1}]},KYt={namespaced:!0,state:{ownerSettings:null,tradingTopBar:{versionSettings:2.7,modeButtonInfo:"quote",configMenu:JYt.defaultMenu,fullModeLeftMenu:!0,screensQuotes:JYt.screenQuote,activeScreen:0}},getters:{getTradingTopBarSettings:function(t){return t.tradingTopBar},getUiSettings:function(t,e,i,o){return o["userSettings/getUserSettings"]},getSession:function(t,e,i,o){return o["auth/getSession"]},getSelectedButtonForActiveScreen:function(t){var e=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.selected}));return e.setButtons.find((function(t){return t.selected}))},getUserQuotesLibrary:function(t){var e=[];return t.tradingTopBar.screensQuotes.forEach((function(t){t.content.forEach((function(t){t.setButtons.forEach((function(t){e.push(t.symbol)}))}))})),Object(x["a"])(new Set(e))},getConfigMenuTradingChart:function(t){return t.tradingTopBar.configMenu}},mutations:{setGuestScreensQuotesSettings:function(t,e){t.ownerSettings=t.tradingTopBar.screensQuotes,t.tradingTopBar.screensQuotes=e,t.tradingTopBar.activeScreen=0},setOwnerScreensQuotesSettings:function(t){t.tradingTopBar.screensQuotes=t.ownerSettings},setSettingsMenuTradingTopBar:function(t,e){if(e.versionSettings===t.tradingTopBar.versionSettings){for(var i in t.tradingTopBar)e[i]&&(t.tradingTopBar[i]=e[i]);var o=ZYt(t.tradingTopBar.screensQuotes);o.forEach((function(e,i){e||(t.tradingTopBar.screensQuotes[i].content[0].selected=!0)})),t.ownerSettings=t.tradingTopBar}else t.ownerSettings=t.tradingTopBar},changeActiveStatusMenuTopBar:function(t,e){t.tradingTopBar.configMenu[e.index].activeStatus=e.status},reorderConfigMenuTopBar:function(t,e){var i=t.tradingTopBar.configMenu[e.fromIndex];t.tradingTopBar.configMenu.splice(e.fromIndex,1),t.tradingTopBar.configMenu.splice(e.toIndex,0,i)},setActiveStatusForToogleButtonCongigMenuTopBar:function(t,e){t.tradingTopBar.configMenu[e].isActive=!t.tradingTopBar.configMenu[e].isActive},setModeButtonInfoTopBar:function(t,e){t.tradingTopBar.modeButtonInfo=e},setModeLeftTopBarMenu:function(t,e){t.tradingTopBar.fullModeLeftMenu=e},setDefaultSettingsTradingTopBar:function(t){t.tradingTopBar.modeButtonInfo="quote",t.tradingTopBar.configMenu=JYt.defaultMenu,t.tradingTopBar.fullModeLeftMenu=!0,t.tradingTopBar.screensQuotes=JYt.screenQuote,t.tradingTopBar.activeScreen=0},setNewActiveScreenAndButtonQuote:function(t,e){t.tradingTopBar.activeScreen=e},setNewSelectButtonInScreen:function(t,e){t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.forEach((function(t){e===t.setId?t.selected=!0:t.selected=!1}))},setNewButtonForActiveSet:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.selected}));i.setButtons.forEach((function(t){t.id===e?t.selected=!0:t.selected=!1}))},addNewButtonInMultichartSet:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content[e.fromIndex].setButtons[0];i.selected=!1,t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content[e.toIndex].setButtons.push(i),t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.splice(e.fromIndex,1)},removeNewButtonInMultichartSet:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content[e.fromIndex],o=i.setButtons.findIndex((function(t){return t.id===e.btn.id}));i.setButtons.splice(o,1),e.btn.selected&&(i.setButtons[0].selected=!0),e.btn.selected=!0,t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.push({setId:Math.random().toString(36).substring(7),selected:!1,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[e.btn]})},setNewOptionForButtonQuoteActiveScreen:function(t,e){var i;i=e.setId?t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.setId===e.setId})):t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.selected}));var o=i.setButtons.find((function(t){return t.id===e.id}));o[e.keyOption]=e.newValue},deleteSetButtonsOnScreen:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content,o=i.findIndex((function(t){return t.setId===e.setId})),n=i.find((function(t){return t.setId===e.setId}));if(1===n.setButtons.length)n.selected&&(t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content[0].selected=!0),i.splice(o,1);else{var s=n.setButtons.findIndex((function(t){return t.id===e.btn.id}));n.setButtons.splice(s,1),n.typeMultichart=Vrt[n.setButtons.length-1][0].name,e.btn.selected&&(n.setButtons[0].selected=!0)}},addQuoteButtonOnScreen:function(t,e){e.selected=!0;var i=!t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.length;t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.push(JSON.parse(JSON.stringify({setId:Math.random().toString(36).substring(7),selected:i,label:"",color:"",typeMultichart:"one-chart-first",setButtons:[e]})))},addNewScreen:function(t){t.tradingTopBar.screensQuotes.push({screen:{type:"number",color:"#3c73f1",avatar:"",name:"",screenId:Math.random().toString(36).substring(7)},content:[]})},deleteScreen:function(t,e){t.tradingTopBar.screensQuotes.splice(e,1),e<=t.tradingTopBar.activeScreen&&0!==t.tradingTopBar.activeScreen?t.tradingTopBar.activeScreen=t.tradingTopBar.activeScreen-1:e===t.tradingTopBar.activeScreen&&0===t.tradingTopBar.activeScreen&&(t.tradingTopBar.activeScreen=0)},deleteEmptyScreen:function(t){var e=t.tradingTopBar.screensQuotes.findIndex((function(t){return!t.content.length}));e>=0&&t.tradingTopBar.screensQuotes.splice(e,1)},reorderSetsInScreen:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content[e.fromIndex];t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.splice(e.fromIndex,1),t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.splice(e.toIndex,0,i)},reorderQuoteButtonsInSet:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.setId===e.setId})),o=i.setButtons[e.fromIndex];i.setButtons.splice(e.fromIndex,1),i.setButtons.splice(e.toIndex,0,o)},reorderQuoteChartsInSet:function(t,e){var i=t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.setId===e.setId})),o=JSON.parse(JSON.stringify(i.setButtons[e.fromIndex])),n=JSON.parse(JSON.stringify(i.setButtons[e.toIndex]));i.setButtons=i.setButtons.map((function(t,i){return i===e.fromIndex&&(t=n),i===e.toIndex&&(t=o),t}))},setColorForSetQuoteButton:function(t,e){t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.setId===e.setId})).color=e.color},setLabelForSetQuoteButton:function(t,e){t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.setId===e.setId})).label=e.text},setModeForScreenTopBar:function(t,e){t.tradingTopBar.screensQuotes[e.index].screen.type=e.mode},setColorForScreenTopBar:function(t,e){t.tradingTopBar.screensQuotes[e.index].screen.color=e.color},setAvatarForScreenTopBar:function(t,e){t.tradingTopBar.screensQuotes[e.index].screen.avatar=e.data},setNewTypeChartForActiveScreen:function(t,e){t.tradingTopBar.screensQuotes[e.indexActiveScreen].content[e.indexActiveSet].typeMultichart=e.data},setChartPresetForButton:function(t,e){t.tradingTopBar.screensQuotes[t.tradingTopBar.activeScreen].content.find((function(t){return t.selected})).setButtons.find((function(t){return t.selected})).groupPreset=e.idGroup}},actions:{addUserSettingsTradingTopBar:function(t){var e,i=t.getters,o=t.commit;null!==(e=i["getUiSettings"])&&void 0!==e&&e.tradingTopBar&&o("setSettingsMenuTradingTopBar",i["getUiSettings"].tradingTopBar)},setSettingsTradingTopBar:function(t,e){var i=t.getters,o=t.commit;o(e.mutation,e.data),i["getSession"]&&"ghost"!==e.role&&o("userSettings/redactSettings",{widget:"tradingTopBar",data:i["getTradingTopBarSettings"]},{root:!0})}}};function ZYt(t){var e=[];return t.forEach((function(t){e.push(t.content.some((function(t){return t.selected})))})),e}var tXt,eXt={namespaced:!0,state:{defaultMenu:[{id:"profit",label:"brokerInfoTitle0",value:"Доходность",component:"WidgetProfit",open:!0,checked:!0,status:!0},{id:"experts",label:"widgetMenuDefaultMenu_experts",value:"Эксперты EUR/USD",component:"WidgetProviders",open:!0,checked:!0,status:!0},{id:"subs",label:"widgetMenuDefaultMenu_subs",value:"Мои подписчики",component:"WidgetSubscribers",open:!0,checked:!0,status:!0},{id:"subscriptions",label:"widgetMenuDefaultMenu_subscriptions",value:"Мои подписки",component:"WidgetSubs",open:!0,checked:!0,status:!0},{id:"tv",label:"TV",value:"TV",open:!0,component:"WidgetTv",checked:!0,status:!0},{id:"tableStat",label:"widgetMenuDefaultMenu_tableStat",value:"Статистика",open:!0,component:"StatTable",checked:!0,status:!0}],defaultSubsMenu:[{id:"widgetMySubsProfit",label:"Доход",value:"Доход",open:!0,component:"WidgetMySubsProfit",checked:!0,status:!0},{id:"widgetMySubsCount",label:"Подписки",value:"Подписки",open:!0,component:"WidgetMySubsCount",checked:!0,status:!0},{id:"widgetMySubsProfitMonth",label:"Доход за месяц",value:"Доход за месяц",open:!0,component:"WidgetMySubsProfitMonth",checked:!0,status:!0},{id:"widgetMySubsInformer",label:"Информер",value:"Информер",open:!0,component:"WidgetMySubsInformer",checked:!0,status:!0},{id:"widgetMySubsStats",label:"Статистика подписок",value:"Статистика подписок",open:!0,component:"WidgetMySubsStats",checked:!0,status:!0}]},getters:{getWidgetMenu:function(t){return t.defaultMenu},getWidgetSubsMenu:function(t){return t.defaultSubsMenu},getDefaultWidgetMenu:function(t){return t.defaultMenu},getDefaultWidgetSubsMenu:function(t){return t.defaultSubsMenu}},mutations:{removeWidgetItem:function(t,e){e.arr.forEach((function(t,i,o){e.e.id===t.id&&o.splice(i,1)})),this.dispatch("widgetMenu/saveMenu",e.arr)},removeWidgetItemSubs:function(t,e){e.arr.forEach((function(t,i,o){e.e.id===t.id&&o.splice(i,1)})),this.dispatch("widgetMenu/saveMenuSubs",e.arr)},addWidgetItem:function(t,e){e.arr.push(e.e),this.dispatch("widgetMenu/saveMenu",e.arr)},addWidgetItemSubs:function(t,e){e.arr.push(e.e),this.dispatch("widgetMenu/saveMenuSubs",e.arr)},changeExpand:function(t,e){e.arr[e.index].open=!e.arr[e.index].open,this.dispatch("widgetMenu/saveMenu",e.arr)}},actions:{saveMenu:function(t,e){var i=t.commit;i("userSettings/redactSettings",{widget:"sidebarMenuWidgets",data:e},{root:!0})},saveMenuSubs:function(t,e){var i=t.commit;i("userSettings/redactSettings",{widget:"sidebarMenuWidgetsSubs",data:e},{root:!0})}}},iXt={namespaced:!0,state:{globalEmail:"info@toptrader.org"},getters:{getGlobalEmail:function(t){return t.globalEmail}}},oXt={namespaced:!0,state:{userActiveStream:null,playersStreams:[],subscriptionsOnChat:[],chatVisible:!1,activeStreamChatConnection:!1},getters:{getActiveUserStream:function(t){return t.userActiveStream},getPlayersStreams:function(t){return t.playersStreams},getStreamApiUri:function(t,e,i,o){return o["api/apiStream"]},getVisibleStreamChat:function(t){return t.chatVisible},getSubscriptionsOnChat:function(t){return t.subscriptionsOnChat}},mutations:{setUserActiveStream:function(t,e){t.userActiveStream=e},addSubscriptionOnChat:function(t,e){t.subscriptionsOnChat.push(e)},removeSubscriptionOnChat:function(t,e){var i=t.subscriptionsOnChat.findIndex((function(t){return t===e}));-1!==i&&t.subscriptionsOnChat.splice(i,1)},setStatusForChat:function(t,e){t.chatVisible=e},addPlayerStream:function(t,e){t.playersStreams.length&&t.playersStreams.some((function(t){return t.id===e.id}))||t.playersStreams.push(e)},deletePlayerStream:function(t,e){var i=t.playersStreams.findIndex((function(t){return t.id===e}));-1!==i&&(t.playersStreams[i].status=!1,t.playersStreams.every((function(t){return!t.status}))&&(t.playersStreams=[]))},setNewDataForStream:function(t,e){t.userStream[e.field]=e.data},setStatusUserStream:function(t,e){t.userStream["status"]=e}},actions:{getActiveStreamsByUser:function(t,e){var i=t.commit,n=t.getters;o["default"].prototype.$http.post("".concat(n["getStreamApiUri"],"Stream/activestreams"),JSON.stringify({UserId:e,Contracts:null}),{headers:{"Content-Type":"application/json"}}).then((function(t){t.data&&t.data.length&&i("setUserActiveStream",t.data[0])}))}}},nXt={namespaced:!0,state:{userSources:[]},getters:{getUserSources:function(t){return t.userSources},getUserId:function(t,e,i,o){return o["user/getUserDetail"]},getSession:function(t,e,i,o){return o["auth/getSession"]},getApiSave:function(t,e,i,o){return o["api/api"]+"SaveUserExternalResource"},getApi:function(t,e,i,o){return o["api/api"]+"GetUserExternalResource"}},mutations:{setUserSources:function(t,e){e?t.userSources=e:t.usersources=[]}},actions:{createUserSource:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=t.dispatch,a=n.getApiSave,c={},"Video"===e.type?c={userId:e.userId?e.userId:"",title:e.title?e.title:n["getUserSources"].title,poster:e.poster?e.poster:n["getUserSources"].poster,link:e.link?e.link:n["getUserSources"].link,type:"Video",description:e.description?e.description:n["getUserSources"].description}:"News"===e.type&&(c={userId:e.userId?e.userId:"",title:e.title?e.title:n["getUserSources"].title,poster:e.poster?e.poster:n["getUserSources"].poster,text:e.text?e.text:n["getUserSources"].text,type:"News",description:e.description?e.description:n["getUserSources"].description}),i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify(c));case 6:return l=i.sent,u={headers:{"Content-Type":"application/json","X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":l}},i.next=10,o["default"].prototype.$http.post(a,c,u).then((function(t){t&&s("getUserSourceById",e.userId)})).catch((function(t){return t}));case 10:case"end":return i.stop()}}),i)})))()},deleteUserSource:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=t.dispatch,a=n.getApiSave,i.next=4,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e));case 4:return c=i.sent,l={headers:{"Content-Type":"application/json","X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":c}},i.next=8,o["default"].prototype.$http.post(a,e,l).then((function(t){t&&s("getUserSourceById",e.userId)})).catch((function(t){return t}));case 8:case"end":return i.stop()}}),i)})))()},saveUserSource:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=t.dispatch,a=n.getApiSave,i.next=4,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e));case 4:return c=i.sent,l={headers:{"Content-Type":"application/json","X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":c}},i.next=8,o["default"].prototype.$http.post(a,e,l).then((function(t){t&&s("getUserSourceById",e.userId)})).catch((function(t){return t}));case 8:case"end":return i.stop()}}),i)})))()},getUserSourceById:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.getters,a=s["getApi"]+"/"+e,c={headers:{"Content-Type":"application/json"}},i.next=5,o["default"].prototype.$http.get(a,c).then((function(t){t&&n("setUserSources",t.data)})).catch((function(t){return t}));case 5:case"end":return i.stop()}}),i)})))()}}},sXt={namespaced:!0,state:{tile:!1},getters:{getStatusTile:function(t){return t.tile}},mutations:{setTile:function(t){t.tile=!t.tile}},actions:{toggleTile:function(t){t.commit("setTile")}}},rXt=new Promise((function(t){tXt=t})),aXt={namespaced:!0,state:{serverTime:null},getters:{getServerTime:function(t){return t.serverTime},readyPromise:function(){return rXt}},mutations:{setServerTime:function(t,e){t.serverTime=e}},actions:{actionServerTime:function(t,e){var i=t.commit;i("setServerTime",e),tXt()}}},cXt=[{name:"quoteWidget",activeStatus:!0,isActive:!1},{name:"marketGaudgeWidget",activeStatus:!0,isActive:!1},{name:"nightSheme",activeStatus:!0,isActive:!1},{name:"tradingStage",activeStatus:!0,isActive:!0},{name:"newsOnChart",activeStatus:!0,isActive:!0},{name:"resultOrders",activeStatus:!0,isActive:!0},{name:"medianAveragePrice",activeStatus:!0,isActive:!0},{name:"minMaxCandleDays",activeStatus:!0,isActive:!0},{name:"openPositions",activeStatus:!0,isActive:!0},{name:"closePositions",activeStatus:!0,isActive:!0},{name:"closeOtherPositions",activeStatus:!0,isActive:!1},{name:"openOtherPositions",activeStatus:!0,isActive:!0},{name:"hightImportance",activeStatus:!0,isActive:!0},{name:"middleImportance",activeStatus:!0,isActive:!0},{name:"lowImportance",activeStatus:!0,isActive:!0},{name:"blackThemeChart",activeStatus:!0,isActive:!1}],lXt={showAllDateScale:!0,showEnterPin:!0,showDirectionPin:!0,qoute:!0,qouteofDay:!0,avarageValue:!0,tradeLevels:!0,totalForOpen:!0,averagePrice:!0,showAllData:!0,showDollars:!0,showProcent:!0,showPips:!0,showMyActions:!0,myAvatar:!0,myOpenOrders:!0,myClosedOrders:!0,showProviders:!0,showAvatarsProviders:!0,providersOpenOrders:!0,providersClosedOrders:!0,providersMessage:!0,providersStreams:!0},uXt={versionSettings:1.5,bottomControlPanel:{currentBar:"currentQuote",historyClosedOrders:!1,news:!0,streams:!0,newsHistory:!1,fonChart:!0,profitLeftWidgets:!0},openOrders:{my:!0,another:!0},closeOrders:{my:!0,another:!0},favorits:[],averPrice:!0,showAvatars:!0,hideAvatars:!1,tradingLines:!0,news:{high:!0,midle:!0,low:!0},ordersXaxis:!0,peakDays:!0},dXt={namespaced:!0,state:{statusWidgetsAccount:!1,statusWidgetsContracts:{status:!1,id:null},groupChatSettings:[],positionsSettings:null,tradingChartSettings:null,settingsParam:null,configMenu:null,structLeftBar:null,modeButtonInfo:"quote",leftBarMenu:null,indicators:null,contextMenu:null},getters:{getBottomControlPanelSettings:function(t){var e;return null===(e=t.tradingChartSettings)||void 0===e?void 0:e.bottomControlPanel},getStatusWidgetsAccount:function(t){return t.statusWidgetsAccount},getStatusWidgetsContracts:function(t){return t.statusWidgetsContracts},getSettingsParamsLeftBar:function(t){return t.settingsParam},getFavoritsLeftBarChart:function(t){return t.favorits},getTradingChartSettings:function(t){return t.tradingChartSettings},getConfigMenuLeftBarTradingChart:function(t){return t.leftBarMenu},getStructLeftBar:function(t){return t.structLeftBar},getIndicators:function(t){return t.indicators},getUiSettings:function(t,e,i,o){return o["userSettings/getUserSettings"]},getProfileAccounts:function(t,e,i,o){return o["subscribeOrders/getProfileAccount"]},getSession:function(t,e,i,o){return o["auth/getSession"]}},mutations:{setStatusWidgetsAccount:function(t,e){t.statusWidgetsAccount=e},setStatusWidgetsContracts:function(t,e){t.statusWidgetsContracts=e},activedGroupChatSettings:function(t,e){t.groupChatSettings=e},changeFavorits:function(t,e){var i=t.favorits.findIndex((function(t){return e.overlay===t.overlay}));i>=0?t.favorits.splice(i,1):t.favorits.push(e)},setFavorits:function(t,e){t.favorits=e},changeSettingsParams:function(t,e){t.settingsParam[e.name]=e},setStructLeftBar:function(t,e){t.structLeftBar=e},setSettingsParams:function(t,e){t.settingsParam=e},setPositionsSettings:function(t,e){e&&(t.positionsSettings=e)},changePositionSettings:function(t,e){t.positionsSettings[e.name]=e},setConfigMenuLeftBarTradingChart:function(t,e){t.leftBarMenu=e},setDefaultMenuLeftBarTradingChart:function(t){t.leftBarMenu=cXt},setIndicators:function(t,e){e[0].description?t.indicators=e:t.indicators=ATt},setActiveStatusForIndicator:function(t,e){var i=t.indicators.findIndex((function(t){return t.name===e.name}));i<0?(t.indicators.push(ATt.find((function(t){return t.name===e.name}))),t.indicators.forEach((function(t){t.name===e.name&&(t.isActive=!t.isActive)}))):("add"===e.param&&(t.indicators[i].isActive=!t.indicators[i].isActive),e.settings&&(t.indicators[i].settings=e.settings))},setStatusActiveLeftBarOptions:function(t,e){if(e){var i=t.leftBarMenu.findIndex((function(t){return t.name===e}));i<0?(t.leftBarMenu.push(cXt.find((function(t){return t.name===e}))),t.leftBarMenu.forEach((function(t){t.name===e&&(t.isActive=!t.isActive)}))):t.leftBarMenu[i].isActive=!t.leftBarMenu[i].isActive}},setSettingsTradingChartSettings:function(t,e){e?e.versionSettings!==uXt.versionSettings?t.tradingChartSettings=uXt:t.tradingChartSettings=e:t.tradingChartSettings=uXt},setSettingForTradingChartSettings:function(t,e){e.key?t.tradingChartSettings[e.option][e.key]=e.data:t.tradingChartSettings[e.option]=e.data}},actions:{setSettingsOnServer:function(t,e){var i=t.commit;i("setSettingsTradingChartSettings",e)},setSettingsTradingChartSettings:function(t,e){var i=t.getters,o=t.commit;o(e.mutation,e.data),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingChartSettings",data:i["getTradingChartSettings"]},{root:!0})},addUserSettingsTradingChartSettings:function(t){var e,i=t.getters,o=t.commit;null!==(e=i["getUiSettings"])&&void 0!==e&&e.tradingChartSettings&&o("setSettingsTradingChartSettings",i["getUiSettings"].tradingChartSettings)},setNewSettingsParamLeftBar:function(t,e){var i=t.getters,o=t.commit;o("setSettingsParams",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingLeftBar",key:"settingsParam",data:i["getSettingsParamsLeftBar"]},{root:!0}),o("setSettingsParams",i["getSettingsParamsLeftBar"])},addUserSettingsSettingsParam:function(t){var e=t.getters,i=t.commit;e["getUiSettings"]&&e["getUiSettings"].tradingLeftBar&&e["getUiSettings"].tradingLeftBar.settingsParam?i("setSettingsParams",e["getUiSettings"].tradingLeftBar.settingsParam):i("setSettingsParams",lXt)},addUserSettingsStructLeftBar:function(){},addPositionsSettings:function(t){var e=t.getters,i=t.commit;e["getUiSettings"]&&e["getUiSettings"].tradingLeftBar&&e["getUiSettings"].tradingLeftBar.positionsSettings?i("setPositionsSettings",e["getUiSettings"].tradingLeftBar.positionsSettings):i("setPositionsSettings",{leftBarPositions:{option:{option:"marginLeft",offset:"32px"},flexDirection:"column",pos:"left",positionOffset:{right:"auto",left:"0px"}}})},setPositionsSettings:function(t,e){var i=t.getters,o=t.commit;o("setPositionsSettings",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingLeftBar",key:"positionsSettings",data:i["getPositionsSettings"]},{root:!0}),o("setPositionsSettings",i["positionsSettings"])},setSettingsStructLeftBar:function(t,e){var i=t.getters,o=t.commit;o("setStructLeftBar",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingLeftBar",key:"structLeftBar",data:i["getStructLeftBar"]},{root:!0}),o("setStructLeftBar",i["getStructLeftBar"])},setSettingsFavorsitLeftBar:function(t,e){var i=t.getters,o=t.commit;o("changeFavorits",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingLeftBar",key:"favorits",data:i["getFavoritsLeftBarChart"]},{root:!0}),o("setSettingsFavorsitLeftBar",i["getFavoritsLeftBarChart"])},addUserSettingsFavorits:function(t){var e=t.getters,i=t.commit;e["getUiSettings"]&&e["getUiSettings"].tradingLeftBar&&e["getUiSettings"].tradingLeftBar.favorits&&e["getUiSettings"].tradingLeftBar.favorits.length?i("setFavorits",e["getUiSettings"].tradingLeftBar.favorits):i("setFavorits",[])},addUserSettingsIndicators:function(t){var e=t.getters,i=t.commit;e["getUiSettings"]&&e["getUiSettings"].indicators&&e["getUiSettings"].indicators.length?i("setIndicators",e["getUiSettings"].indicators):i("setIndicators",ATt)},addUserSettingsLeftBarMenu:function(t){var e=t.getters,i=t.commit;e["getUiSettings"]&&e["getUiSettings"].tradingLeftBar&&e["getUiSettings"].tradingLeftBar.menu&&e["getUiSettings"].tradingLeftBar.menu.length?i("setConfigMenuLeftBarTradingChart",e["getUiSettings"].tradingLeftBar.menu):i("setConfigMenuLeftBarTradingChart",cXt)},setSaveChartGroups:function(t,e){var i=t.commit;i("activedGroupChatSettings",e)},setSettingsLeftBar:function(t,e){var i=t.getters,o=t.commit;o("setStatusActiveLeftBarOptions",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"tradingLeftBar",key:"menu",data:i["getConfigMenuLeftBarTradingChart"]},{root:!0}),o("setConfigMenuLeftBarTradingChart",i["getConfigMenuLeftBarTradingChart"])},setSettingIndicator:function(t,e){var i=t.getters,o=t.commit;o("setActiveStatusForIndicator",e),i["getSession"]&&o("userSettings/redactSettings",{widget:"indicators",data:i["getIndicators"]},{root:!0})}}},hXt={namespaced:!0,state:{investing:{left:!0,right:!1},blogs:{left:!0},post:{right:!0},about:{left:!0,right:!0}},getters:{getInvestingStateLeft:function(t){return t.investing.left},getInvestingStateRight:function(t){return t.investing.right},getBlogsStateLeft:function(t){return t.blogs.left},getPostStateRight:function(t){return t.post.right},getAboutStateRight:function(t){return t.about.right},getAboutStateLeft:function(t){return t.about.left}},mutations:{setLeft:function(t){t.investing.left=!t.investing.left},setRight:function(t){t.investing.right=!t.investing.right},setBlogsLeft:function(t){t.blogs.left=!t.blogs.left},setPostRight:function(t){t.post.right=!t.post.right},setAboutLeft:function(t){t.about.left=!t.about.left},setAboutRight:function(t){t.about.right=!t.about.right}},actions:{toggleInvestingLeft:function(t){t.commit("setLeft")},toggleInvestingRight:function(t){t.commit("setRight")},toggleBlogsLeft:function(t){t.commit("setBlogsLeft")},togglePostRight:function(t){t.commit("setPostRight")},toggleAboutRight:function(t){t.commit("setAboutRight")},toggleAboutLeft:function(t){t.commit("setAboutLeft")}}},pXt={namespaced:!0,state:{activeTab:0,chatAuth:null,paidChatGroupUser:null,currentRoom:null,videoCallMessage:null,callToUserInfo:null,callFromUserInfo:null,currentThread:null,recentMsg:null,subsNotifyUser:["webrtc","notification"]},getters:{getChatAuth:function(t){return t.chatAuth},getSession:function(t,e,i,o){return o["auth/getSession"]},getCallToUserInfo:function(t){return t.callToUserInfo},getCallFromUserInfo:function(t){return t.callFromUserInfo},getCurrentVideoCall:function(t){return t.videoCallMessage},getSubsNotifyUser:function(t){return t.subsNotifyUser},getPaidChatGroupUser:function(t){return t.paidChatGroupUser},getRecentMessage:function(t){return t.recentMsg},getChatCurrentThread:function(t){return t.currentThread},getChatCurrentRoom:function(t){return t.currentRoom},getActiveTab:function(t){return t.activeTab},getApiUrl:function(t,e,i,o){return o["api/api"]},getAuthUri:function(t,e,i,o){return o["api/api"]+"auth"},getUserDetail:function(t,e,i,o){return o["user/getUserDetail"]},getApiChat:function(t,e,i,o){return o["api/apiChat"]}},mutations:{setChatAuth:function(t,e){t.chatAuth=e},addClientForVideoCall:function(t,e){t.videoCallMessage.to.push(e)},setCallToUserInfo:function(t,e){t.callToUserInfo=e},setCallFromUserInfo:function(t,e){t.callFromUserInfo=e},setCurrentVideoCall:function(t,e){t.videoCallMessage=e},setRecentMessage:function(t,e){t.recentMsg=e},setPaidChatGroupUser:function(t,e){t.paidChatGroupUser=e},setChatCurrentThread:function(t,e){t.currentThread=e},setCurrentRoom:function(t,e){t.currentRoom=e},setActiveTab:function(t,e){t.activeTab=e}},actions:{toggleChat:function(t,e){var i=t.commit;i("setCurrentRoom",e)},authChatForGuest:function(t){var e=t.getters,i=t.commit,n=t.dispatch;o["default"].prototype.$http.get(e["getAuthUri"]+"/ChatGuest").then((function(t){i("setChatAuth",t.data.chatAuth),n("loginToWS"),n("subsOnMessageUser")}))},authChatByToken:function(t){var e=t.getters,i=t.commit,n=t.dispatch;o["default"].prototype.$http.get("".concat(e["getAuthUri"],"/ChatAuth"),{headers:{"Content-Type":"application/json","X-TAPI-FP":e["getSession"].fp,"X-TAPI-SIGN":e["getSession"].singFP}}).then((function(t){i("setChatAuth",t.data.chatAuth),n("loginToWS"),n("subsOnMessageUser"),n("subsOnChangeRooms")}))},paymentsChatGroups:function(t,e){var i=t.getters,n=t.commit;o["default"].prototype.$http.get(i["getApiUrl"]+"Subscription/ChatGroup?userId="+encodeURIComponent(i["getUserDetail"].id),{headers:{"Content-Type":"application/json",Authorization:"".concat(e)}}).then((function(t){n("setPaidChatGroupUser",t.data)}))},addMeteorSubs:function(){var t={msg:"sub",id:Math.random().toString(36).substring(7),name:"meteor.loginServiceConfiguration",params:[]};o["default"].prototype.$socketStream.sendCommand({ws:"chatWS",command:t});var e={msg:"sub",id:Math.random().toString(36).substring(7),name:"meteor_autoupdate_clientVersions",params:[]};o["default"].prototype.$socketStream.sendCommand({ws:"chatWS",command:e})},subsOnMessageUser:function(t){var e=t.getters;e["getSubsNotifyUser"].forEach((function(t){var i={msg:"sub",id:Math.random().toString(36).substring(7),name:"stream-notify-user",params:["".concat(e["getChatAuth"].userId,"/").concat(t),!1]};o["default"].prototype.$socketStream.sendCommand({ws:"chatWS",command:i})}))},subsOnChangeRooms:function(){var t={msg:"sub",id:Math.random().toString(36).substring(7),name:"stream-notify-logged",params:["Users:Deleted",!1]};o["default"].prototype.$socketStream.sendCommand({ws:"chatWS",command:t})},loginToWS:function(t){var e=t.getters,i=t.dispatch,n={msg:"method",method:"login",params:[{resume:e["getChatAuth"].authToken}],id:"1"};o["default"].prototype.$socketStream.sendCommand({ws:"chatWS",command:n}),i("addMeteorSubs")},changeActiveTab:function(t,e){t.commit("setActiveTab",e)}}},gXt={namespaced:!0,state:{paymentServices:null,paymentReference:null,invoices:null,subscriptionAfterCurrentDate:null,listSubscriptionOnSite:null,currentSubscription:null,currenSiteSubscriptions:null,descriptionsSiteServices:null,activeServices:null},getters:{readyPromise:function(){return 1},getApi:function(t,e,i,o){return o["api/api"]+"payment"},getSession:function(t,e,i,o){return o["auth/getSession"]},getPaymentReference:function(t){return t.paymentReference},getUserPaymentServices:function(t){return t.paymentServices},getUserInvoices:function(t){return t.invoices},getDescriptionsSiteServices:function(t){return t.descriptionsSiteServices},getActiveServices:function(t){return t.activeServices},getCurrenSiteSubscriptions:function(t){return t.currenSiteSubscriptions}},mutations:{getListSubscriptionOnSite:function(t,e){t.listSubscriptionOnSite=e},setPaymentReference:function(t,e){t.paymentReference=e},setSubscriptionAfterCurrentDate:function(t,e){var i=e.services.filter((function(t){return"Site"===t.serviceType}));t.subscriptionAfterCurrentDate=i},setPaymentServices:function(t,e){var i;null!==e?(t.paymentServices||(t.paymentServices=[]),(i=t.paymentServices).push.apply(i,Object(x["a"])(e))):t.paymentServices=null},setInvoices:function(t,e){t.invoices=e},clearPaymentServices:function(t){t.paymentServices=null,t.paymentReference=null,t.invoices=null}},actions:{getPaymentReference:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a,c;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.getters,n=t.commit,s=i["getApi"]+"/GetPaymentReference",e.next=4,o["default"].prototype.$http.get(s,{headers:{"X-TAPI-FP":i["getSession"].fp,"X-TAPI-SIGN":i["getSession"].singFP}});case 4:a=e.sent,c=a.data,n("setPaymentReference",c),n("setSubscriptionAfterCurrentDate",c);case 8:case"end":return e.stop()}}),e)})))()},getPaymentService:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=t.commit,a=n["getApi"],i.next=4,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e),n["getSession"].sk);case 4:return c=i.sent,i.next=7,o["default"].prototype.$http.post("".concat(a,"/GetUserServices"),e,{headers:{"X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":c}});case 7:return l=i.sent,u=l.data,s("setPaymentServices",u),i.abrupt("return",u);case 11:case"end":return i.stop()}}),i)})))()},getInvoiceByFilter:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a,c,l,u,d,h;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.getters,n=t.rootGetters,s=t.commit,a=i["getApi"]+"/GetInvoicesByFilter",c=n["subscribeOrders/getDefaultAccount"].id,l={data:[c],dataType:"AccountId",allData:!1},e.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify(l),i["getSession"].sk);case 6:return u=e.sent,e.next=9,o["default"].prototype.$http.post(a,l,{headers:{"X-TAPI-FP":i["getSession"].fp,"X-TAPI-SIGN":u}});case 9:return d=e.sent,h=d.data,s("setInvoices",h),e.abrupt("return",h);case 13:case"end":return e.stop()}}),e)})))()},createUserService:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=t.commit,a=n["getApi"],i.next=4,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e),n["getSession"].sk);case 4:return c=i.sent,i.next=7,o["default"].prototype.$http.post("".concat(a,"/CreateUserService"),e,{headers:{"X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":c}});case 7:return l=i.sent,u=l.data,s("setPaymentServices",[u.service]),s("setInvoices",[u.invoice]),i.abrupt("return",u);case 12:case"end":return i.stop()}}),i)})))()},updatePaymentService:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=n["getApi"],a={serviceId:e,isCanceled:!0,isReNewal:!0},i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify(a),n["getSession"].sk);case 5:return c=i.sent,i.next=8,o["default"].prototype.$http.post("".concat(s,"/UpdatePaymentService"),a,{headers:{"X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":c}});case 8:return l=i.sent,u=l.data,i.abrupt("return",u);case 11:case"end":return i.stop()}}),i)})))()},payInvoice:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.getters,s=n["getApi"],i.next=4,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e),n["getSession"].sk);case 4:return a=i.sent,i.next=7,o["default"].prototype.$http.post("".concat(s,"/PayInvoice"),e,{headers:{"X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":a}});case 7:return c=i.sent,l=c.data,i.abrupt("return",l);case 10:case"end":return i.stop()}}),i)})))()}}},fXt={btnsLibrary:[{key:"profile",screens:[{number:0,index:0,mode:"text"}],btnText:"profile",color:"#3C73F1",icon:{name:"Home",color:"#3C73F1"},iconSrc:"",avatarSrc:"",isActive:!0,url:"/user-profile"},{key:"trading",screens:[{number:0,index:1,mode:"text"}],btnText:"market",color:"#00AD88",icon:{name:"GR_Chart_candle-2",color:"#00AD88"},iconSrc:"",avatarSrc:"",isActive:!0,url:"/trading"},{key:"strategies",screens:[{number:0,index:2,mode:"text"}],btnText:"tops",color:"#FF2626",icon:{name:"Tops2",color:"#FF2626"},iconSrc:"",avatarSrc:"",isActive:!1,url:"/strategies"},{key:"investing",screens:[{number:0,index:3,mode:"text"}],btnText:"investments",color:"#FFC000",icon:{name:"RegPartner",color:"#FFC000"},iconSrc:"",avatarSrc:"",isActive:!0,url:"/investing"},{key:"report",screens:[{number:0,index:4,mode:"text"}],btnText:"report",color:"#FA860A",icon:{name:"report",color:"#FA860A"},iconSrc:"",avatarSrc:"",isActive:!0,url:"/report"},{key:"subscribers",screens:[{number:0,index:5,mode:"text"}],btnText:"subscribers",color:"#FA00FF",icon:{name:"MySubscribers",color:"#FA00FF"},iconSrc:"",avatarSrc:"",isActive:!0,url:"/subscribers"}],activeScreen:0,backgroundButton:"",logo:[{textList:"full_TT_logo",mode:"fullTT",active:!0},{textList:"shoty_TT_logo",mode:"cropTT",active:!1},{data:null,textList:"my_text",mode:"customText",color:null,background:null,active:!1},{textList:"my_logo",mode:"image",data:null,active:!1}]},mXt={namespaced:!0,state:{version:2.5,dataForWidgets:null,btnsMenu:fXt.btnsLibrary,activeScreen:fXt.activeScreen,backgroundButton:fXt.backgroundButton,listAccounts:null,listWidgets:null,visibleListWidgets:null,theme:"dark",logo:fXt.logo,statViewMethod:"move"},getters:{getHeaderBtns:function(t){return t.btnsMenu},getStatViewMethod:function(t){return t.statViewMethod},getLogo:function(t){return t.logo},getDataForWidgets:function(t){return t.dataForWidgets},getVersionSettings:function(t){return t.version},getBackgroundNavButtons:function(t){return t.backgroundButton},getSession:function(t,e,i,o){return o["auth/getSession"]},getActiveTheme:function(t){return t.theme},getActiveThemePrefix:function(t){return"$".concat(t.theme,"-")},getVisibleListWidgets:function(t){return t.visibleListWidgets},getListWidgets:function(t){return t.listWidgets},getListAccounts:function(t){return t.listAccounts},getActiveButtonForScreen:function(t){return vXt(t.btnsMenu.filter((function(e){return e.screens.some((function(e){return e.number===t.activeScreen}))})),t.activeScreen)},getActiveModeButtons:function(t){var e=t.btnsMenu.filter((function(e){return e.screens.some((function(e){return e.number===t.activeScreen}))}));return e.length?e[0].screens.find((function(e){return e.number===t.activeScreen})).mode:"text"},getActiveScreen:function(t){return t.activeScreen}},mutations:{setStatViewMethod:function(t,e){t.statViewMethod=e},setBackgroundNavigationMenu:function(t,e){t.backgroundButton=e},setDefaultNavigationMenu:function(t){t.btnsMenu=fXt.btnsLibrary,t.backgroundButton=""},setServersHeaderSettings:function(t,e){return e&&e.version&&e.version===t.version?(e.statViewMethod&&(t.statViewMethod=e.statViewMethod),e.btnsMenu&&(t.btnsMenu=e.btnsMenu),e.backgroundButton&&(t.backgroundButton=e.backgroundButton),e.logo&&(t.logo=e.logo),e.activeScreen&&(t.activeScreen=e.activeScreen),e.listWidgets?(t.listWidgets=e.listWidgets,t.visibleListWidgets=t.listWidgets.filter((function(t){return t.status}))):(t.listWidgets=JSON.parse(JSON.stringify(Mn)),t.visibleListWidgets=t.listWidgets.filter((function(t){return t.status}))),void(e.theme&&(t.theme=e.theme))):(t.listWidgets=JSON.parse(JSON.stringify(Mn)),void(t.visibleListWidgets=t.listWidgets.filter((function(t){return t.status}))))},setStatusListIndicators:function(t,e){t.listWidgets.forEach((function(t){t.component===e.component&&t.data===e.data&&(t.status=!t.status)})),t.visibleListWidgets=t.listWidgets.filter((function(t){return t.status}))},setReorderListIndicators:function(t,e){var i=t.visibleListWidgets[e.fromIndex];t.visibleListWidgets.splice(e.fromIndex,1),t.visibleListWidgets.splice(e.toIndex,0,i),t.listWidgets=t.visibleListWidgets.concat(t.listWidgets.filter((function(t){return!t.status})))},setLogoMode:function(t,e){t.logo.splice(e.index,1,e.data)},setActiveLogoMode:function(t,e){t.logo.forEach((function(t){t.mode===e?t.active=!0:t.active=!1}))},setDefaultListWidgets:function(t){t.listWidgets=JSON.parse(JSON.stringify(Mn)),t.visibleListWidgets=t.listWidgets.filter((function(t){return t.status}))},changeActiveScreen:function(t,e){t.activeScreen=e},setNewOptionsForButton:function(t,e){t.btnsMenu.forEach((function(t){t.key===e.btn&&(t[e.param]=e.data)}))},addNewScreen:function(t,e){t.btnsMenu.forEach((function(t){t.key===e.btn&&t.screens.push({number:e.screen,index:0,mode:"text"})}))},deleteScreen:function(t,e){var i=Object(x["a"])(new Set(Array.from(yXt(t.btnsMenu))));e===i.length?(t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e-1}));-1!==i&&t.screens.splice(i,1)})),t.activeScreen=e-2):i.length-e===1?(t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e-1}));-1!==i&&t.screens.splice(i,1)})),t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e}));-1!==i&&(t.screens[i].number=e-1)})),t.activeScreen=e-1):i.length-e>1&&(t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e-1}));-1!==i&&t.screens.splice(i,1)})),t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e}));-1!==i&&(t.screens[i].number=e-1)})),t.btnsMenu.forEach((function(t){var i=t.screens.findIndex((function(t){return t.number===e+1}));-1!==i&&(t.screens[i].number=e)})),t.activeScreen=e-1)},setModeButtonsForScreen:function(t,e){t.btnsMenu.forEach((function(i){var o=i.screens.find((function(e){return e.number===t.activeScreen}));o&&(o.mode=e)}))},reorderButtonsOnScreen:function(t,e){var i=[];t.btnsMenu.filter((function(e){return e.screens.some((function(e){return e.number===t.activeScreen}))})).forEach((function(e){i[e.screens.find((function(e){return e.number===t.activeScreen})).index]=e.key}));var o=i[e.fromIndex];i.splice(e.fromIndex,1),i.splice(e.toIndex,0,o),t.btnsMenu.forEach((function(e){e.screens.find((function(e){return e.number===t.activeScreen}))&&(e.screens.find((function(e){return e.number===t.activeScreen})).index=i.findIndex((function(t){return t===e.key})))}))},setRemoveButtonOnScreen:function(t,e){var i=t.btnsMenu.find((function(t){return t.key===e})).screens.findIndex((function(e){return e.number===t.activeScreen}));t.btnsMenu.find((function(t){return t.key===e})).screens.splice(i,1);var o=t.btnsMenu.filter((function(e){return e.screens.some((function(e){return e.number===t.activeScreen}))}));t.btnsMenu.forEach((function(e){e.screens.find((function(e){return e.number===t.activeScreen}))&&(e.screens.find((function(e){return e.number===t.activeScreen})).index=o.findIndex((function(t){return t.key===e.key})))}))},setAddButtonOnScreen:function(t,e){var i=t.btnsMenu.find((function(t){return t.key===e})),o=t.btnsMenu.filter((function(e){return e.screens.some((function(e){return e.number===t.activeScreen}))}));i.screens.push({number:t.activeScreen,index:o.length,mode:"text"})},changeActiveTheme:function(t,e){t.theme=e,"dark"===e?document.body.classList.add("dark"):document.body.classList.remove("dark")},setDefaultSettingsForScreens:function(t){t.btnsMenu=fXt.btnsLibrary,t.activeScreen=fXt.activeScreen,t.listAccounts=null,t.listWidgets=fXt.widgetIndicators,t.theme="light"},setFieldDataForWidget:function(t,e){t.dataForWidgets&&(t.dataForWidgets[e.field]=e.data)},setDataForWidgets:function(t,e){t.dataForWidgets=K$(e)}},actions:{serversSettingsHeader:function(t,e){var i=t.commit;i("setServersHeaderSettings",e)},dataForWidgets:function(t,e){var i=t.commit;i("setDataForWidgets",e)},redactSettings:function(t,e){var i=t.commit,o=t.getters;i(e.mutation,e.data),o["getSession"]&&i("userSettings/redactSettings",{widget:"header",data:{version:o["getVersionSettings"],btnsMenu:o["getHeaderBtns"],activeScreen:o["getActiveScreen"],backgroundButton:o["getBackgroundNavButtons"],listAccounts:o["getListAccounts"],listWidgets:o["getListWidgets"],theme:o["getActiveTheme"],logo:o["getLogo"],statViewMethod:o["getStatViewMethod"]}},{root:!0})},setActiveScreen:function(t,e){var i=t.commit;i("changeActiveScreen",e)}}};function vXt(t,e){return t.sort((function(t,i){return t.screens.find((function(t){return t.number===e})).index-i.screens.find((function(t){return t.number===e})).index}))}function yXt(t){var e=t.map((function(t){return t.screens.map((function(t){return t.number}))}));return e.flat()}var CXt=["data","dateFrom","dateTo"],bXt={namespaced:!0,state:{events:null},getters:{getCalendarEventUri:function(t,e,i,o){return o["api/api"]+"kb/GetUserEvensCalendar"},getSaveCalendarEventUri:function(t,e,i,o){return o["api/api"]+"kb/SaveUserEventCalendar"},getEventsCalendar:function(t){return t.events}},mutations:{addNewEvent:function(t,e){t.events.push(e)},editEvent:function(t,e){t.events=t.events.map((function(t){return t.id===e.id?e:t}))},deleteEvent:function(t,e){t.events=t.events.filter((function(t){return t.id!==e}))},setEvents:function(t,e){t.events=e}},actions:{postEvents:function(t){var e=arguments;return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h,p,g;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.getters,a=t.rootGetters,l=e.length>1&&void 0!==e[1]?e[1]:{},u=a["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify(l),u.sk);case 5:return d=i.sent,i.next=8,o["default"].prototype.$http.post(s["getCalendarEventUri"],l,{headers:{"X-TAPI-FP":u.fp,"X-TAPI-SIGN":d}});case 8:h=i.sent,p=h.data,g=p.map((function(t){var e=t.data,i=t.dateFrom,o=t.dateTo,n=Object(jv["a"])(t,CXt);return Object(c["a"])(Object(c["a"])({},n),{},{dateFrom:dL(new Date(i)),dateTo:dL(new Date(o)),data:JSON.parse(e)})})),n("setEvents",g);case 12:case"end":return i.stop()}}),i)})))()},eventHandlers:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.getters,a=t.rootGetters,i.prev=1,i.next=4,o["default"].prototype.$http.post(s["getSaveCalendarEventUri"],e,{headers:{Authorization:"".concat(a["auth/getSession"])}});case 4:return l=i.sent,u=l.data,u.isOK&&(d=Object(c["a"])(Object(c["a"])({},e),{},{id:u.id,dateFrom:new Date(e.dateFrom),dateTo:new Date(e.dateTo),data:JSON.parse(e.data)}),e.isDeleted?n("deleteEvent",e.id):e.id?n("editEvent",d):n("addNewEvent",d)),i.abrupt("return",[!1]);case 10:return i.prev=10,i.t0=i["catch"](1),i.abrupt("return",[!0]);case 13:case"end":return i.stop()}}),i,null,[[1,10]])})))()}}},SXt={namespaced:!0,state:{modalData:{modalComponentName:"",visiblePopup:!1,hiddenSteps:!1,titlePopup:"",numberSteps:null,currentStep:null,width:300,userData:{},dopInfo:null,follow:"",closeFunction:null}},getters:{getDopInfo:function(t){return t.modalData.dopInfo},getModalComponentName:function(t){return t.modalData.modalComponentName},getVisiblePopup:function(t){return t.modalData.visiblePopup},getTitlePopup:function(t){return t.modalData.titlePopup},getNumberSteps:function(t){return t.modalData.numberSteps},getCurrentStep:function(t){return t.modalData.currentStep},getWidthModal:function(t){return t.modalData.width},getUserData:function(t){return t.modalData.userData},getFollow:function(t){return t.modalData.follow},getHiddenSteps:function(t){return t.modalData.hiddenSteps},getCloseFunction:function(t){return t.modalData.closeFunction}},mutations:{setPopupData:function(t,e){t.modalData=Object(c["a"])({follow:t.modalData.follow,userData:t.modalData.userData},e)}},actions:{setPopupData:function(t,e){var i=t.commit;i("setPopupData",e)}}},PXt={namespaced:!0,state:{visible:!1,shading:!1,outSideClick:!1,componentName:null,dopInfo:null,background:"",height:"",width:""},getters:{getVisible:function(t){return t.visible},getShading:function(t){return t.shading},getBackground:function(t){return t.background},getComponentName:function(t){return t.componentName},getHeight:function(t){return t.height},getWidth:function(t){return t.width},getDopInfo:function(t){return t.dopInfo},getOutSideClick:function(t){return t.outSideClick}},mutations:{setDataToast:function(t,e){t.visible=e.visible,t.background=e.background||"#FFFDD1",t.width=e.width,t.height=e.height,t.componentName=e.componentName,t.dopInfo=e.dopInfo,t.shading=e.shading||!1,t.outSideClick=e.outSideClick||!1}},actions:{showToast:function(t,e){var i=t.commit;i("setDataToast",e)}}},TXt={namespaced:!0,state:{dataForCart:null,userService:[],dataPayInvoice:null,contentSubscribed:[]},getters:{getDataForCart:function(t){return t.dataForCart},getPayInvoice:function(t){return t.dataPayInvoice},getContentSubscribed:function(t){return t.contentSubscribed}},mutations:{setBuySignals:function(t,e){t.dataForCart=e},setUserService:function(t,e){t.userService=e},setDataPayInvoice:function(t,e){t.dataPayInvoice=e},setContentSubscribed:function(t,e){t.contentSubscribed=e},deleteFromCart:function(t,e){var i=e.content,o=e.signal,n=e.id;if(i){var s=t.dataForCart.findIndex((function(t){return t.sourceId===n}));t.dataForCart.splice(s,1)}else if(o.subscription.autoGenerated){var r=t.dataForCart.findIndex((function(t){return Array.isArray(t)&&t.find((function(t){return t.subscription.id===n}))}));1===t.dataForCart[r].length?t.dataForCart.splice(r,1):t.dataForCart[r]=t.dataForCart[r].filter((function(t){return t.subscription.id!==n}))}else{var a=t.dataForCart.findIndex((function(t){return!Array.isArray(t)&&t.subscription.id===n}));t.dataForCart.splice(a,1)}},clearPayInvoice:function(t){t.dataPayInvoice=null}},actions:{getContentSubscription:function(t){var e=arguments;return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.rootGetters,a=e.length>1&&void 0!==e[1]&&e[1],c=s["auth/getToken"],l=s["api/api"],i.next=6,o["default"].prototype.$http.get("".concat(l,"Subscription/ContentSubscriptions"),{headers:{Authorization:"".concat(c)},params:{allData:a}});case 6:return u=i.sent,d=u.data,a||n("setContentSubscribed",d),i.abrupt("return",d);case 10:case"end":return i.stop()}}),i)})))()},getUserContent:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],i.next=4,o["default"].prototype.$http.get("".concat(s,"UserContent"),{params:{userId:e}});case 4:return a=i.sent,c=a.data,i.abrupt("return",c);case 7:case"end":return i.stop()}}),i)})))()},saveContentSubscription:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getToken"],i.next=5,o["default"].prototype.$http.post("".concat(s,"Subscription/Save/ContentSubscription"),e,{headers:{Authorization:"".concat(a)}});case 5:return c=i.sent,l=c.data,i.abrupt("return",l.subscriptionId);case 8:case"end":return i.stop()}}),i)})))()},saveSubscription:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getToken"],i.next=5,o["default"].prototype.$http.post("".concat(s,"Subscription/Save/Subscription"),e,{headers:{Authorization:"".concat(a)}});case 5:return c=i.sent,l=c.data,i.abrupt("return",l.map((function(t){return t.subscriptionId})));case 8:case"end":return i.stop()}}),i)})))()},getInvoices:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getToken"],i.next=5,o["default"].prototype.$http.post("".concat(s,"payment/GetInvoicesByFilter"),{data:e,dataType:"SubscriptionId",allData:!1},{headers:{Authorization:"".concat(a)}});case 5:return c=i.sent,l=c.data,i.abrupt("return",l.map((function(t){return t.id})));case 8:case"end":return i.stop()}}),i)})))()},payInvoice:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getToken"],i.next=5,o["default"].prototype.$http.post("".concat(s,"payment/PayInvoice"),e,{headers:{Authorization:"".concat(a)}});case 5:return c=i.sent,l=c.data,i.abrupt("return",l);case 8:case"end":return i.stop()}}),i)})))()},getContentForCart:function(t){var e=this;return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h,p,g,f,m,v,y,C,b,S,P,T,O,w,_,A,k,I,B,M,$,L,F;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return a=t.commit,l=t.rootGetters,u=t.dispatch,i.next=3,u("subscribeOrders/readyPromise",null,{root:!0});case 3:return d=l["api/api"],h=l["auth/getToken"],p=l["subscribeOrders/getDefaultAccount"],g=l["paymentService/getPaymentReference"],f=null===p||void 0===p?void 0:p.owner,i.next=10,o["default"].prototype.$http.get("".concat(d,"payment/GetUserServices"),{headers:{Authorization:"".concat(h)},params:{userId:f}});case 10:return m=i.sent,v=m.data,i.next=14,o["default"].prototype.$http.get("".concat(d,"Subscription/Subscriptions"),{headers:{Authorization:"".concat(e.getToken)},params:{id:f,type:"User",allData:!0}});case 14:return y=i.sent,C=y.data,i.next=18,u("getContentSubscription",!0);case 18:return b=i.sent,i.next=21,u("getContentSubscription",!1);case 21:return i.next=23,l["paymentService/readyPromise"];case 23:if(S="0001-01-01T00:00:00",P=null===(n=((null===g||void 0===g?void 0:g.services)||[]).find((function(t){return"subscription"===t.serviceType.toLowerCase()})))||void 0===n?void 0:n.id,T=null===(s=((null===g||void 0===g?void 0:g.services)||[]).find((function(t){return"usercontent"===t.serviceType.toLowerCase()})))||void 0===s?void 0:s.id,O=v.filter((function(t){return!t.isCanceled&&t.activeDueDateTime.includes(S)&&[P,T].includes(t.serviceId)})),a("setUserService",O),w=O.map((function(t){return t.externalId})),_=C.filter((function(t){return w.includes(t.subscription.id.toString())})),A=b.filter((function(t){return w.includes(t.id)})),k=[],!(A.length>0)){i.next=52;break}I=Object(WD["a"])(A),i.prev=34,I.s();case 36:if((B=I.n()).done){i.next=44;break}return M=B.value,i.next=40,u("getUserContent",M.contentId);case 40:$=i.sent,k.push(Object(c["a"])({type:"content",content:$,sourceId:M.id},M));case 42:i.next=36;break;case 44:i.next=49;break;case 46:i.prev=46,i.t0=i["catch"](34),I.e(i.t0);case 49:return i.prev=49,I.f(),i.finish(49);case 52:L={},F=[],_.forEach((function(t){L[t.sourceAccountId]||(L[t.sourceAccountId]=[]),L[t.sourceAccountId].push(t)})),Object.entries(L).forEach((function(t){var e=Object(D["a"])(t,2),i=e[1];i[0].subscription.autoGenerated?F.push(i):F=[].concat(Object(x["a"])(F),Object(x["a"])(i))})),a("setBuySignals",[].concat(Object(x["a"])(F),k));case 57:case"end":return i.stop()}}),i,null,[[34,46,49,52]])})))()},removeContent:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p,g;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.state,s=t.rootGetters,a=t.commit,c=t.dispatch,l=s["api/api"],u=s["auth/getToken"],d=s["serverTime/getServerTime"],h=n.userService.find((function(t){return t.externalId===e})).id,i.next=7,o["default"].prototype.$http.post("".concat(l,"payment/UpdatePaymentService"),{serviceId:h,isCanceled:!0,isReNewal:!1},{headers:{Authorization:"".concat(u)}});case 7:return p=Object(x["a"])(n.dataForCart).find((function(t){return t.sourceId===e})),g={id:p.id,userId:p.userId,contentId:p.contentId,createDateTime:p.createDateTime,startDateTime:p.startDateTime,stopDateTime:new Date(d.now).toISOString(),period:p.period,price:p.price,isDemo:p.isDemo,autoReNewal:p.autoReNewal},i.next=11,c("saveContentSubscription",g);case 11:a("deleteFromCart",{id:e,content:p});case 12:case"end":return i.stop()}}),i)})))()},deleteItemCart:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p,g,f;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.state,s=t.commit,a=t.rootGetters,c=t.dispatch,l=a["api/api"],u=a["auth/getToken"],d=a["subscribeOrders/getDefaultAccount"],h=a["serverTime/getServerTime"],p=n.userService.find((function(t){return+t.externalId===e})).id,i.next=8,o["default"].prototype.$http.post("".concat(l,"payment/UpdatePaymentService"),{serviceId:p,isCanceled:!0,isReNewal:!1},{headers:{Authorization:"".concat(u)}});case 8:return g=Object(x["a"])(n.dataForCart).flat().find((function(t){return t.subscription.id===e})),f=[{id:g.subscription.id,accountId:d.id,sourceId:g.sourceId,autoTrade:g.subscription.autoTrade,smsNotification:g.subscription.smsNotification,emailNotification:g.subscription.emailNotification,signalVolume:g.subscription.signalVolume,signalVolumeType:g.subscription.signalVolumeType,maxOpenPositions:g.subscription.maxOpenPositions,priceType:g.subscription.priceType,price:g.subscription.price,createDateTime:g.subscription.createDateTime,autoGenerated:g.subscription.autoGenerated,period:g.subscription.period,ddPercentMin:g.subscription.ddPercentMin,ddPercentMax:g.subscription.ddPercentMax,startDateTime:g.subscription.startDateTime,stopDateTime:new Date(h.now).toISOString()}],i.next=12,c("saveSubscription",f);case 12:s("deleteFromCart",{id:e,signal:g});case 13:case"end":return i.stop()}}),i)})))()},paySignals:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,c,l,u,d,h,p,g;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(o=t.commit,n=t.dispatch,s=t.rootGetters,a=s["subscribeOrders/getDefaultAccount"],e.length){i.next=4;break}return i.abrupt("return");case 4:if(c=e.filter((function(t){return!(null!==t&&void 0!==t&&t.type)})).map((function(t){return{id:t.id,accountId:a.id,sourceId:t.sourceId,autoTrade:t.autoTrade,smsNotification:t.smsNotification,emailNotification:t.emailNotification,signalVolume:t.signalVolume,signalVolumeType:t.signalVolumeType,maxOpenPositions:t.maxOpenPositions,priceType:t.priceType,price:t.price,createDateTime:t.createDateTime,autoGenerated:t.autoGenerated,period:t.period,ddPercentMin:t.ddPercentMin,ddPercentMax:t.ddPercentMax,startDateTime:t.startDateTime,stopDateTime:t.stopDateTime}})),l=e.filter((function(t){return"content"===(null===t||void 0===t?void 0:t.type)})).map((function(t){return{id:t.id,userId:t.userId,contentId:t.contentId,createDateTime:t.createDateTime,startDateTime:t.startDateTime,stopDateTime:t.stopDateTime,period:t.period,price:t.price,isDemo:t.isDemo,autoReNewal:t.autoReNewal}})),u=[],!c.length){i.next=12;break}return i.next=10,n("saveSubscription",c);case 10:d=i.sent,u.push.apply(u,Object(x["a"])(d));case 12:if(!l.length){i.next=18;break}return i.next=15,n("saveContentForPay",l);case 15:h=i.sent,localStorage.setItem("successPayContent","true"),u.push.apply(u,Object(x["a"])(h));case 18:return i.next=20,n("getInvoices",u);case 20:return p=i.sent,i.next=23,n("payInvoice",p);case 23:g=i.sent,o("setDataPayInvoice",g);case 25:case"end":return i.stop()}}),i)})))()},saveContentForPay:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:o=t.dispatch,n=[],s=Object(WD["a"])(e),i.prev=3,s.s();case 5:if((a=s.n()).done){i.next=13;break}return c=a.value,i.next=9,o("saveContentSubscription",c);case 9:l=i.sent,n.push(l);case 11:i.next=5;break;case 13:i.next=18;break;case 15:i.prev=15,i.t0=i["catch"](3),s.e(i.t0);case 18:return i.prev=18,s.f(),i.finish(18);case 21:return i.abrupt("return",n);case 22:case"end":return i.stop()}}),i,null,[[3,15,18,21]])})))()},clearPayInvoice:function(t){var e=t.commit;e("clearPayInvoice")}}},xXt={namespaced:!0,state:{notifications:[],statData:[],isLoading:!1,unreadNotification:0},getters:{getNotifications:function(t){return t.notifications},getSession:function(t,e,i,o){return o["auth/getSession"]},statData:function(t){return t.statData},isLoading:function(t){return t.isLoading},getUnreadNotification:function(t){return t.unreadNotification},unreadNotificationsCount:function(t){return t.notifications.filter((function(t){return null===t.readedDateTime})).length}},mutations:{setNotifications:function(t,e){t.notifications=e},setUnreadNotifications:function(t,e){t.unreadNotification=e},updateNotification:function(t,e){var i=e.map((function(t){return t.id}));t.notifications.forEach((function(t){i.includes(t.id)&&(t.readedDateTime=!0)}))},addOrder:function(t,e){t.notifications.unshift(e)},setStateData:function(t,e){t.statData=e},setIsLoading:function(t,e){t.isLoading=e}},actions:{getNotifications:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a,c,l,u,d,h,p;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.commit,n=t.getters,s=t.rootGetters,i("setIsLoading",!0),a=s["api/apiNoti"],e.next=5,s["serverTime/readyPromise"];case 5:return c=s["serverTime/getServerTime"],l=new Date(c.utcNow).getTime(),u=JSON.stringify({fromDt:new Date(l-2592e6).toISOString()}),e.next=10,o["default"].prototype.$workKeys.signMessage(u,n["getSession"].sk);case 10:return d=e.sent,e.next=13,o["default"].prototype.$http.post("".concat(a,"GetNotificationHistory"),u,{headers:{"X-TAPI-FP":n["getSession"].fp,"X-TAPI-SIGN":d}});case 13:if(h=e.sent,p=h.data,p.data){e.next=17;break}return e.abrupt("return");case 17:i("setUnreadNotifications",p.data.reduce((function(t,e){return t+e.unReadedCount}),0),0),i("setStateData",p.data),i("setIsLoading",!1);case 20:case"end":return e.stop()}}),e)})))()},saveNotificationHistory:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.rootGetters,a=s["auth/getSession"],l=s["api/apiNoti"],u=e.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:JSON.stringify(t.data)})})),i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify(u),a.sk);case 6:return d=i.sent,i.next=9,o["default"].prototype.$http.post("".concat(l,"SaveNotificationHistory"),u,{headers:{"X-TAPI-FP":a.fp,"X-TAPI-SIGN":d}});case 9:n("updateNotification",u);case 10:case"end":return i.stop()}}),i)})))()},addOrder:function(t,e){var i=t.commit;i("addOrder",e)},showTheReport:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a,l,u,d,h,p,g,f,m,v,y;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.getters,n=t.rootGetters,s=t.commit,a=n["api/apiNoti"],e.next=4,o["default"].prototype.$http.get("".concat(a,"GetLastReportByUser"),{headers:{"X-TAPI-FP":i["getSession"].fp,"X-TAPI-SIGN":i["getSession"].singFP}});case 4:if(l=e.sent,u=l.data,!u.length){e.next=21;break}if(h=u.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:JSON.parse(t.data)})})),p=null===(d=n["subscribeOrders/getDefaultAccount"])||void 0===d?void 0:d.id,h.length&&p){e.next=11;break}return e.abrupt("return");case 11:if(g=h.filter((function(t){return 10===t.dataType&&t.data.AccountId===p})),f=g.filter((function(t){return 0===t.data.DataType})),m=g.filter((function(t){return 1===t.data.DataType})),v=g.filter((function(t){return 2===t.data.DataType})),y=[],f.length&&!f[0].readedDateTime&&f[0].data.AccountId===p&&(y.push(f[0]),s("reportsModal/setVisibleDay",{dataPeriod:f[0]},{root:!0})),m.length&&!m[0].readedDateTime&&m[0].data.AccountId===p&&(y.push(m[0]),s("reportsModal/setVisibleWeek",{dataPeriod:m[0]},{root:!0})),v.length>0&&!v[0].readedDateTime&&v[0].data.AccountId===p&&(y.push(v[0]),s("reportsModal/setVisibleMonth",{dataPeriod:v[0]},{root:!0})),0!==y.length){e.next=21;break}return e.abrupt("return");case 21:case"end":return e.stop()}}),e)})))()}}},OXt={namespaced:!0,state:{authRequest:null,userDetailRequest:null,userAccountsRequest:null},getters:{getAuthRequestStatus:function(t){return t.authRequest},getUserDetailRequestStatus:function(t){return t.userDetailRequest},getUserAccountsRequestStatus:function(t){return t.userAccountsRequest}},mutations:{setStateRquest:function(t,e){t[e.field]=e.data}},actions:{loadStateRquest:function(t,e){var i=t.commit;i("setStateRquest",e)}}},wXt=["changeStatus"],_Xt={namespaced:!0,state:function(){return{activeTab:null,createdPortfolios:null,portfolioHistory:null,experts:[],shortSourcesByAccounts:[],shortPrice:[],isLoadingStatData:!0,emptyStat:!1,newCreated:{bagId:null,sources:[]},updatingDataPortfolio:!0}},getters:{getShortPrice:function(t){return t.shortPrice},getUpdatingDataPortfolio:function(t){return t.updatingDataPortfolio},getStatusPortfolio:function(t,e){if(e.findPortfolio)return e.findPortfolio.status},isLoadingStatData:function(t){return t.isLoadingStatData},getStatusEmptyStat:function(t){return t.emptyStat},getActiveTab:function(t){return t.activeTab},getCreatedPortfoliosNoSorted:function(t){return t.createdPortfolios},getActivePrortfolios:function(t){if(t.createdPortfolios)return t.createdPortfolios.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{name:t.name,defaultName:t.name})})).filter((function(t){return"Active"===t.status}))},getCreatedPortfolios:function(t){if(t.createdPortfolios)return t.createdPortfolios.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{name:t.name,defaultName:t.name})})).sort((function(t,e){return["Active","Pause"].includes(e.status)-["Active","Pause"].includes(t.status)}))},getPortfolioOnlyStatusCreated:function(t,e){return e.getCreatedPortfolios?e.getCreatedPortfolios.filter((function(t){return"Created"===t.status})):[]},getHistoryPortfolios:function(t){return t.portfolioHistory},findPortfolio:function(t,e){return t.activeTab?e.getCreatedPortfolios.find((function(e){return e.id===t.activeTab})):null},indexFindPortfolio:function(t,e){return t.activeTab?e.getCreatedPortfolios.findIndex((function(e){return e.id===t.activeTab})):null},findPortfolioMembers:function(t,e){var i={},o=e.findPortfolio;if(o)return o.sources.forEach((function(t){i[t.accountId]?i[t.accountId].instruments.push(t.contract):i[t.accountId]={avatar:t.userInfo.avatarURL,name:"".concat(t.userInfo.firstName," ").concat(t.userInfo.lastName),instruments:[t.contract],accountId:t.accountId,accountSequenceId:t.accountSequenceId}})),Object.values(i)},getExperts:function(t){return t.experts},statusCreated:function(t){return!!t.newCreated.bagId},createdData:function(t){return t.newCreated},countPortfolio:function(t){return t.experts.length},selectedExpertsSources:function(t){var e={};return t.experts.forEach((function(t){null===t.symbol?e[t.uniqueId]=t.sources.map((function(t){return t.id})):e[t.uniqueId]=t.sources.filter((function(e){return e.contract===t.symbol})).map((function(t){return t.id}))})),e},expertsFace:function(t){return 0===t.experts.length?null:t.experts.slice(0,5).map((function(t){return t.avatar}))},expertsLogin:function(t){return 0===t.experts.length?[]:t.experts.map((function(t){return t.login}))},findExpert:function(t){return function(e){return t.experts.find((function(t){return t.login===e}))}},sourcesByAccount:function(t){return function(e){var i;return null===(i=t.shortSourcesByAccounts.find((function(t){return t.accountId===e})))||void 0===i?void 0:i.data}}},mutations:{setIsLoadingStatData:function(t,e){t.isLoadingStatData=e},setEmptyStatus:function(t,e){t.emptyStat=e},setNamePortfolio:function(t,e){var i=t.createdPortfolios.find((function(t){return t.id===e.id}));i.name=e.newName},setNextFindPortfolio:function(t,e){if(e.getCreatedPortfolios&&0!==e.getCreatedPortfolios.length){var i=e.getCreatedPortfolios[0];t.activeTab=null===i||void 0===i?void 0:i.id}else t.activeTab=null},physicalDeletePortfolio:function(t,e){t.createdPortfolios=t.createdPortfolios.filter((function(t){return t.id!==e}))},changeStatus:function(t,e){var i;if(t.createdPortfolios){if("Active"===(null===(i=e.data)||void 0===i?void 0:i.status)){var o=t.createdPortfolios.findIndex((function(t){return t.id===e.data.parentId}));if(o>-1){var n=JSON.parse(JSON.stringify(e.data));return n.type=n.investBagType,n.avatar=n.avatarURL,t.createdPortfolios.splice(o,1,n),void(t.activeTab=e.data.id)}}var s=t.createdPortfolios.findIndex((function(t){return t.id===e.bagId}));s<0||("Deleted"!==e.status?t.createdPortfolios[s].status=e.status:t.createdPortfolios=t.createdPortfolios.filter((function(t){return t.id!==e.bagId})))}},setActiveTab:function(t,e){t.activeTab=e},setCreatedPortfolios:function(t,e){var i;e.portfolios.length&&(i=e.portfolios.map((function(t){return{name:t.name,sources:t.sources,chain:t.chain,subAccountId:t.subAccountId,avatar:t.avatarURL,type:t.investBagType,investMoney:t.investMoney,investLeverage:t.investLeverage,status:t.status,id:t.id,createdDateTime:t.createdDateTime,startDateTime:t.startDateTime,bagContents:t.bagContents}})));var o=e.subs.filter((function(t){return!t.subscription.bagId})),n=Object(x["a"])(new Set(Array.from(o.map((function(t){return t.sourceAccountId}))))),s=[],r=o.filter((function(t){return!t.subscription.autoGenerated}));r.length&&(r=r.map((function(t){return{name:t.name,sources:[t],avatar:t.subscription.sourceAvatar,type:t.investBagType,sequenceId:t.sourceSequenceId,id:t.sourceAccountId,status:"Active"}}))),n.length&&n.forEach((function(t){var e=o.filter((function(e){return e.sourceAccountId===t&&e.subscription.autoGenerated}));e.length&&s.push({name:e[0].name,sources:e,avatar:e[0].subscription.sourceAvatar,type:"provider",sequenceId:e[0].sourceSequenceId,id:e[0].sourceAccountId,status:"Active"})})),t.createdPortfolios=s.concat(i||[]).concat(r||[]),e.stopActiveTab},clearActiveTab:function(t){t.activeTab=null},clearCreatedPortfolio:function(t){t.activeTab=null,t.createdPortfolios=null},setExpert:function(t,e){t.experts=e},addExpertInPortfolio:function(t,e){t.experts.push(e)},deleteExpert:function(t,e){t.experts=t.experts.filter((function(t){return t.uniqueId!==e})),Q$(e)},clearExperts:function(t){t.experts=[],t.newCreated.bagId=null,t.newCreated.sources=[]},clearStatus:function(t){t.newCreated.bagId=null,t.newCreated.sources=[]},setSources:function(t,e){t.newCreated.sources=[].concat(Object(x["a"])(t.newCreated.sources),[e])},setBagId:function(t,e){t.newCreated.bagId=e},setShortSourcesByAccounts:function(t,e){t.shortSourcesByAccounts=e},setShortPriceByAccounts:function(t,e){t.shortPrice=e},setUpdatingDataPortfolio:function(t){t.updatingDataPortfolio=!t.updatingDataPortfolio},setPortfolioHistory:function(t,e){t.portfolioHistory=e.flat().filter((function(t){return["Deleted"].includes(t.status)}))}},actions:{setExpert:function(t,e){var i=t.commit;i("setExpert",e)},addExpertInPortfolio:function(t,e){var i=t.commit,o=t.getters;i("addExpertInPortfolio",e),o.statusCreated&&i("clearStatus")},deleteExpert:function(t,e){var i=t.commit;i("deleteExpert",e),i("clearStatus")},clearStatus:function(t){var e=t.commit;e("clearStatus")},clearExperts:function(t){var e=t.commit;e("clearExperts"),J$()},getShortSourcesByAccountIds:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.rootGetters,a=t.commit,l=s["api/api"],i.next=4,o["default"].prototype.$http.post("".concat(l,"GetShortSourcesByAccountIds"),{ids:e.logins,checkStat:null===(n=null===e||void 0===e?void 0:e.checkStat)||void 0===n||n});case 4:if(u=i.sent,d=u.data,!d.status.isOK){i.next=12;break}if(h=e.checkStat?Object(x["a"])(d.data).map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{data:t.data.filter((function(t){return!t.statIsOut}))})})):Object(x["a"])(d.data),!e.onlyReturn){i.next=10;break}return i.abrupt("return",h);case 10:null!==e&&void 0!==e&&e.checkStat&&a("setShortSourcesByAccounts",h),null!==e&&void 0!==e&&e.checkStat||a("setShortPriceByAccounts",h);case 12:case"end":return i.stop()}}),i)})))()},saveInvestBag:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p,g;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.rootGetters,a=t.commit,c=s["api/api"],l=s["auth/getSession"],u=s["subscribeOrders/getDefaultAccount"],d={accountId:u.id,name:e.name||"default",investBagType:e.investBagType,status:e.status||"Created",investMoney:e.investMoney,investLeverage:e.investLeverage,avatarURL:e.avatarURL||"",parentId:e.parentId},e.id&&(d.id=e.id),i.next=8,o["default"].prototype.$workKeys.signMessage(JSON.stringify(d),l.sk);case 8:return h=i.sent,i.next=11,o["default"].prototype.$http.post("".concat(c,"InvestBag/SaveInvestBag"),d,{headers:{"X-TAPI-FP":l.fp,"X-TAPI-SIGN":h}});case 11:return p=i.sent,g=p.data,a("setBagId",g.id),null!==g&&void 0!==g&&null!==(n=g.requestStatus)&&void 0!==n&&n.isOK||window.console.log("%cОшибка в запросе InvestBag/SaveInvestBag","font-size: 16px; color: orange"),i.abrupt("return",g);case 16:case"end":return i.stop()}}),i)})))()},saveInvestBagContent:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p,g;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.rootGetters,a=t.commit,c=t.dispatch,l=s["api/api"],u=s["auth/getSession"],d=s["subscribeOrders/getDefaultAccount"],i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify({data:e}),u.sk);case 6:return h=i.sent,i.next=9,o["default"].prototype.$http.post("".concat(l,"InvestBag/SaveInvestBagContent"),{data:e},{headers:{"X-TAPI-FP":u.fp,"X-TAPI-SIGN":h}});case 9:p=i.sent,g=p.data,a("setSources",g.data),null!==g&&void 0!==g&&null!==(n=g.requestStatus)&&void 0!==n&&n.isOK&&c("sendCommandListPortfolio",{accountId:d.id,filter:["Active","Created","Stoped"]});case 13:case"end":return i.stop()}}),i)})))()},changeInvestBagStatus:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],c=n["auth/getSession"],l=e.changeStatus,u=Object(jv["a"])(e,wXt),i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify(u),c.sk);case 6:return d=i.sent,i.next=9,o["default"].prototype.$http.post("".concat(a,"InvestBag/ChangeInvestBagStatus"),u,{headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":d}});case 9:h=i.sent,p=h.data,l&&s("changeStatus",{bagId:e.bagId,status:e.status,data:p.data});case 12:case"end":return i.stop()}}),i)})))()},beginInvest:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return o=t.rootGetters,n=t.dispatch,s=o["user/getUserDetail"],a=o["subscribeOrders/getDefaultAccount"],i.next=5,n("changeInvestBagStatus",e);case 5:return i.next=7,n("subscribeOrders/getAccountsUser",{guid:s.id,accId:0},{root:!0});case 7:return i.next=9,n("subscriptionsContract/getAllSubscriptions",{accountId:a.id},{root:!0});case 9:case"end":return i.stop()}}),i)})))()},sendCommandListPortfolio:function(t,e){var i={Command:"GetInvestBagInfo",Data:{AccountId:e.accountId,InvestBagId:"",Statuses:e.filter}};o["default"].prototype.$socketStream.sendCommand({ws:"apiWS3",command:i})},getListsPortfolio:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var o,n,s,a;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:o=t.rootGetters,n=t.getters,s=t.commit,a=[],e.forEach((function(t){if(t.length>1){var e=t.slice(1),i=e.map((function(t){return{createdDateTime:t.createdDateTime,stopDateTime:t.stopDateTime?t.stopDateTime:t.createdDateTime}}));a.push(Object(c["a"])(Object(c["a"])({},t[0]),{},{chain:i}))}else a.push(Object(c["a"])({},t[0]))})),s("setPortfolioHistory",e),s("setCreatedPortfolios",{subs:o["subscriptionsContract/allSubscriptionCurrentDate"],portfolios:a,getters:n});case 5:case"end":return i.stop()}}),i)})))()},getDataByBagOpenOrders:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify({id:e}),a.sk);case 5:return c=i.sent,i.next=8,o["default"].prototype.$http.post("".concat(s,"InvestBag/GetInvestBagOpenOrders"),{id:e},{headers:{"X-TAPI-FP":a.fp,"X-TAPI-SIGN":c}});case 8:return l=i.sent,u=l.data,i.abrupt("return",u);case 11:case"end":return i.stop()}}),i)})))()},physicalDeletePortfolio:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],c=n["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage("id=".concat(e),c.sk);case 5:return l=i.sent,i.next=8,o["default"].prototype.$http.delete("".concat(a,"InvestBag/DeleteInvestBag/?id=").concat(e),{headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":l}});case 8:s("physicalDeletePortfolio",e);case 9:case"end":return i.stop()}}),i)})))()},setUpdatingDataPortfolio:function(t){var e=t.commit;e("setUpdatingDataPortfolio")},setNextFindPortfolio:function(t){var e=t.commit,i=t.getters;e("setNextFindPortfolio",i)},getAccountCloseOrderStatisticByContract:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=n["api/api"],a=n["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify(e),a.sk);case 5:return c=i.sent,i.next=8,o["default"].prototype.$http.post("".concat(s,"GetAccountCloseOrderStatisticByContract"),e,{headers:{"X-TAPI-FP":a.fp,"X-TAPI-SIGN":c}});case 8:return l=i.sent,i.abrupt("return",l);case 10:case"end":return i.stop()}}),i)})))()}}},AXt={namespaced:!0,state:{statData:{},statDataHours:[],openOrders:[],closedOrders:[],isLoadingOrders:!0,isLoadingContractHours:!0},getters:{getStatDataHours:function(t){var e={};return t.statDataHours.forEach((function(t){var i=new Date(t.date).getHours(),o=new Date(t.date).getDate(),n=new Date(t.date).getMonth(),s=new Date(t.date).getFullYear(),r=new Date(s,n,o,i).getTime(),a=t.volumeOpen&&t.floatingProfitClose?100*t.floatingProfitClose/t.volumeOpen:0;e[r]||(e[r]=[]),e[r].push(a)})),e},getStatData:function(t){return t.statData||[]},openOrders:function(t){var e;return null!==(e=t.openOrders)&&void 0!==e&&e.length?t.openOrders.map((function(t){return{id:t[0],accountId:t[1],accountSequenceId:t[2],sequenceId:t[3],createdDate:t[4][0],orderType:t[5],contractName:t[6],volumeAbs:t[7]*t[18],volume:t[7],stopLoss:t[8],takeProfit:t[9],comment:t[11],externalId:t[12],parentOrderId:t[13],instrumentName:t[14],status:t[15],trailingSL:t[16],trailingStart:t[17],openPrice:t[18],openDate:t[19][0],pendingOrderId:t[20],swaps:t[21],profit:t[22],closePrice:t[23],subscriptionId:t[24],userAvatar:t[25],userName:t[26]+" "+t[27],sourceUserAvatar:t[28],sourceUserName:t[29]+" "+t[30],openFee:t[31]}})):[]},closedOrders:function(t){var e;return null!==(e=t.closedOrders)&&void 0!==e&&e.length?t.closedOrders.map((function(t){return{id:t[0],accountId:t[1],accountSequenceId:t[2],sequenceId:t[3],createdDate:t[4][0],orderType:t[5],contractName:t[6],volume:t[7],volumeAbs:t[7]*t[18],stopLoss:t[8],takeProfit:t[9],comment:t[11],externalId:t[12],parentOrderId:t[13],instrumentName:t[14],status:"Closed",trailingSL:t[16],trailingStart:t[17],openPrice:t[18],openDate:t[19][0],pendingOrderId:t[20],swaps:t[21],profit:t[22],closePrice:t[23],subscriptionId:t[24],closeType:t[25],closedDate:t[26][0],userAvatar:t[29],userName:t[30]+" "+t[31],sourceUserAvatar:t[32],sourceUserName:t[33]+" "+t[34],closeFee:t[35]+t[36]}})):[]},isLoadingContractHours:function(t){return t.isLoadingContractHours},isLoadingOrders:function(t){return t.isLoadingOrders}},mutations:{setStatDataHours:function(t,e){var i;(i=t.statDataHours).push.apply(i,Object(x["a"])(e))},updateNowStatistic:function(t,e){var i;null!==(i=t.statData)&&void 0!==i&&i.nowMyStat&&(t.statData.nowMyStat.profitAbs=e.profitAbs,t.statData.nowMyStat.profitClose=e.profitClose)},setStatData:function(t,e){t.statData=e},setOpenOrders:function(t,e){t.openOrders=e},addCloseOrders:function(t,e){t.closedOrders.push([e.id,e.accountId,e.accountSequenceId,e.sequenceId,[e.createdDate],e.orderType,e.contractName,e.volume,e.stopLoss,e.takeProfit,"",e.comment,e.externalId,e.parentOrderId,e.instrumentName,e.status,e.trailingSL,e.trailingStart,e.openPrice,[e.openDate],e.pendingOrderId,e.swaps,e.profit,e.closePrice,e.subscriptionId,e.closeType,[e.closedDate],"","",e.userAvatar,e.userName.split(" ")[0],e.userName.split(" ")[1],e.sourceUserAvatar,e.sourceUserName,"",e.openFee,e.closeFee]);var i=t.openOrders.findIndex((function(t){return t.id===e.id}));t.openOrders.splice(i,1)},addOpenOrders:function(t,e){t.openOrders.push([e.id,e.accountId,e.accountSequenceId,e.sequenceId,[e.createdDate],e.orderType,e.contractName,e.volume,e.stopLoss,e.takeProfit,0,e.comment,e.externalId,e.parentOrderId,e.instrumentName,0,e.trailingSL,e.trailingStart,e.openPrice,[e.openDate],e.pendingOrderId,e.swaps,e.profit,e.closePrice,e.subscriptionId,e.userAvatar,e.userName.split(" ")[0],e.userName.split(" ")[1],e.sourceUserAvatar,e.sourceUserName.split(" ")[0],e.sourceUserName.split(" ")[1],e.openFee])},setClosedOrders:function(t,e){t.closedOrders=e},clearStatDataHours:function(t){t.statDataHours=[]},removeAllOrders:function(t){t.openOrders=[],t.closedOrders=[]},setLoadingOrders:function(t,e){t.isLoadingOrders=e},setLoadingContractHours:function(t,e){t.isLoadingContractHours=e}}},DXt={namespaced:!0,state:function(){return{allSubscription:[],portfolioByAccountId:[],portfolioHistoryByAccountId:null,copyData:null,subsData:null,contents:null,contentsSubscriber:null,subscriberCopy:null,subscriberCopyHistory:null,subscriberSubs:null,isLoadingData:!0,subscriptionCopyHistory:null,tabsForInvestings:null,profitBySubscription:[]}},getters:{getHistoryForSubscription:function(t){return t.subscriptionCopyHistory},getHistoryPortfolio:function(t){return t.portfolioHistoryByAccountId},fullListSubscription:function(t){return t.allSubscription},allSubscriptionCurrentDate:function(t,e,i,o){var n;if(!t.allSubscription||0===t.allSubscription.length)return[];var s=null===(n=o["serverTime/getServerTime"])||void 0===n?void 0:n.now;return t.allSubscription.filter((function(t){return!t.subscription.stopDateTime||new Date(t.subscription.stopDateTime).getTime()>=new Date(s).getTime()}))},getTabsForInvesting:function(t){return t.tabsForInvestings},isLoadingData:function(t){return t.isLoadingData},copyData:function(t){return t.copyData},subsData:function(t){return t.subsData},contents:function(t){return t.contents},contentsSubscriber:function(t){return t.contentsSubscriber},subscriberCopy:function(t){return t.subscriberCopy},subscriberCopyHistory:function(t){return t.subscriberCopyHistory},subscriberSubs:function(t){return t.subscriberSubs},getProfitBySubscription:function(t){return t.profitBySubscription}},mutations:{setAllSubscription:function(t,e){t.allSubscription=e},setLoadingData:function(t,e){t.isLoadingData=e},setContents:function(t,e){t.contents=e},setContentsSubscriber:function(t,e){t.contentsSubscriber=e},setData:function(t,e){t.copyData=e.copyData,t.subsData=e.subsData},setSubscriberData:function(t,e){t.subscriberCopy=e.subscriberCopy,t.subscriberCopyHistory=e.subscriberCopyHistory,t.subscriberSubs=e.subscriberSubs},setPortfolio:function(t,e){var i=e.data;t.portfolioByAccountId=i.map((function(t){return Object(c["a"])(Object(c["a"])({},t[0]),{},{name:t[0].name,defaultName:t[0].name})})),t.portfolioHistoryByAccountId=i.flat().filter((function(t){return"Active"!==t.status}))},deleteContent:function(t,e){var i=t.contents.findIndex((function(t){return t.contentId===e}));t.contents.splice(i,1)},removeFromStoreDeletedContract:function(t,e){var i,o="subscription"===e.typeTable?"subsData":"copyData";i=e.portfolioUser?t.copyData.findIndex((function(t){var i;return t.portfolioUser&&(null===(i=t.sources[0])||void 0===i?void 0:i.id)===e.subscriptionId})):t[o].findIndex((function(t){var i;return(null===(i=t.subscription)||void 0===i?void 0:i.id)===e.subscriptionId})),-1!==i&&t[o].splice(i,1)},setStatusPortfolio:function(t,e){var i=t.copyData.findIndex((function(t){return t.id===e.bagId}));["Active","Pause"].includes(e.newStatus)&&(t.copyData[i].status=e.newStatus),"Stoped"===e.newStatus&&t.copyData.splice(i,1)},setSubscriptionCopyHistory:function(t,e){t.subscriptionCopyHistory=e},setPortfolioHistoryByAccountId:function(t,e){t.portfolioHistoryByAccountId=e},setProfitBySubscription:function(t,e){t.profitBySubscription=e}},actions:{getContentSubscribers:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],c=n["auth/getSession"],l={accountId:e,allData:!1},i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify(l),c.sk);case 6:return u=i.sent,i.prev=7,i.next=10,o["default"].prototype.$http.get("".concat(a,"Subscription/ContentSubscribers"),{params:l,headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":u}});case 10:d=i.sent,h=d.data,s("setContentsSubscriber",h),i.next=18;break;case 15:i.prev=15,i.t0=i["catch"](7),s("setContentsSubscriber",[]);case 18:case"end":return i.stop()}}),i,null,[[7,15]])})))()},getContentsSubscription:function(t){return Object(a["a"])(Object(r["a"])().mark((function e(){var i,n,s,a,c,l;return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.rootGetters,n=t.commit,s=i["api/api"],a=i["auth/getSession"],e.next=5,o["default"].prototype.$http.get("".concat(s,"Subscription/ContentSubscriptions"),{headers:{"X-TAPI-FP":a.fp,"X-TAPI-SIGN":a.signFP}});case 5:c=e.sent,l=c.data,n("setContents",l);case 8:case"end":return e.stop()}}),e)})))()},deleteContent:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h,p;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.rootGetters,a=t.commit,l=Object(c["a"])({},e),u=s["api/api"],d=null===(n=s["serverTime/getServerTime"])||void 0===n?void 0:n.now,h=s["auth/getSession"],l.stopDateTime=d,i.next=8,o["default"].prototype.$workKeys.signMessage(JSON.stringify(l),h.sk);case 8:return p=i.sent,i.next=11,o["default"].prototype.$http.post("".concat(u,"Subscription/Save/ContentSubscription"),l,{headers:{"X-TAPI-FP":h.fp,"X-TAPI-SIGN":p}});case 11:a("deleteContent",e.contentId);case 12:case"end":return i.stop()}}),i)})))()},getSubscriptionAndPortfolio:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h,p,g,f,m,v,y,C,b,S,P,T,O,w,_;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.state,a=t.rootGetters,l=t.commit,u=t.dispatch,d=a["api/api"],h=a["auth/getSession"],p=null===(n=a["serverTime/getServerTime"])||void 0===n?void 0:n.now,l("setLoadingData",!0),i.next=7,u("getContentsSubscription");case 7:return i.next=9,o["default"].prototype.$workKeys.signMessage(JSON.stringify({accountId:e.accountId}),h.sk);case 9:return g=i.sent,i.next=12,o["default"].prototype.$http.post("".concat(d,"InvestBag/GetInvestBagInfo"),{accountId:e.accountId},{headers:{"X-TAPI-FP":h.fp,"X-TAPI-SIGN":g}});case 12:return f=i.sent,m=f.data,l("setPortfolio",m),i.next=17,o["default"].prototype.$workKeys.signMessage(JSON.stringify({id:e.accountId,type:"Account",allData:!0}),h.sk);case 17:return v=i.sent,i.next=20,o["default"].prototype.$http.get("".concat(d,"Subscription/Subscriptions"),{headers:{"X-TAPI-FP":h.fp,"X-TAPI-SIGN":v},params:{id:e.accountId,type:"Account",allData:!0}});case 20:if(y=i.sent,C=y.data,b=C.filter((function(t){return!t.subscription.stopDateTime||new Date(t.subscription.stopDateTime).getTime()>=new Date(p).getTime()})),S=C.filter((function(t){return t.subscription.stopDateTime&&new Date(t.subscription.stopDateTime).getTime()0)){i.next=35;break}return i.next=31,u("createdPortfolioFromSignals",P);case 31:P=i.sent,w=s.portfolioByAccountId.filter((function(t){return"Pause"===t.status})),w.length>0&&(w=w.map((function(t){return Object(c["a"])(Object(c["a"])({},t),{},{portfolio:!0})})),(_=P).push.apply(_,Object(x["a"])(w))),P=Dht(P);case 35:l("setData",{copyData:P,subsData:O}),l("setLoadingData",!1);case 37:case"end":return i.stop()}}),i)})))()},createdPortfolioFromSignals:function(t,e){var i=t.state,o=Object(x["a"])(e),n=o.map((function(t){return t.subscription.bagId}));return n=Array.from(new Set(n.filter(Boolean))),n.length>0&&n.forEach((function(t){o=o.filter((function(e){var i;return(null===(i=e.subscription)||void 0===i?void 0:i.bagId)!==t}));var e=i.portfolioByAccountId.find((function(e){return e.id===t}));"Active"===(null===e||void 0===e?void 0:e.status)&&o.push(Object(c["a"])(Object(c["a"])({},e),{},{portfolio:!0}))})),o},deleteSubscription:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],c=n["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify([e.objectData]),c.sk);case 5:return l=i.sent,i.next=8,o["default"].prototype.$http.post("".concat(a,"Subscription/Save/Subscription"),[e.objectData],{headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":l}});case 8:u=i.sent,d=u.data,s("removeFromStoreDeletedContract",{subscriptionId:d[0].subscriptionId,portfolioUser:e.portfolioUser,typeTable:e.typeTable});case 11:case"end":return i.stop()}}),i)})))()},getSubscribers:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h,p,g,f,m,v,y,C,b;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return s=t.rootGetters,a=t.commit,c=t.dispatch,l=s["api/api"],u=null===(n=s["serverTime/getServerTime"])||void 0===n?void 0:n.now,d=s["auth/getSession"],i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify({id:e.accountId,type:"Account"}),d.sk);case 6:return h=i.sent,a("setLoadingData",!0),i.next=10,c("getContentSubscribers",e.accountId);case 10:return i.next=12,o["default"].prototype.$http.get("".concat(l,"Subscription/Sources"),{headers:{"X-TAPI-FP":d.fp,"X-TAPI-SIGN":h},params:{id:e.accountId,type:"Account"}});case 12:return p=i.sent,g=p.data,f=g.filter((function(t){var e;return(null===(e=t.subscribersInfo)||void 0===e?void 0:e.length)>0})),m=[],v=[],f.length>0&&f.forEach((function(t){t.subscribersInfo.forEach((function(e){var i=wht(e.subscriptions,u),o=_ht(e.subscriptions,u);i.length>0&&m.push.apply(m,Object(x["a"])(Aht(i,e,t))),o.length>0&&v.push.apply(v,Object(x["a"])(Aht(o,e,t)))}))})),y=m.filter((function(t){return t.autoTrade&&t.startDateTime})),C=v.filter((function(t){return t.autoTrade&&t.startDateTime&&t.stopDateTime})),b=m.filter((function(t){return!t.autoTrade})),i.next=23,c("getProfitBySubscription",C);case 23:a("setSubscriberData",{subscriberCopy:y,subscriberCopyHistory:C,subscriberSubs:b}),a("setLoadingData",!1);case 25:case"end":return i.stop()}}),i)})))()},getProfitBySubscription:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d,h;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.rootGetters,a=s["api/api"],c=s["auth/getSession"],l=e.map((function(t){return t.id})),i.next=6,o["default"].prototype.$workKeys.signMessage(JSON.stringify({ids:l}),c.sk);case 6:return u=i.sent,i.next=9,o["default"].prototype.$http.post("".concat(a,"Subscription/GetProfitBySubscription"),{ids:l},{headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":u}});case 9:d=i.sent,h=d.data,n("setProfitBySubscription",h.data);case 12:case"end":return i.stop()}}),i)})))()},getAllSubscriptions:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l,u,d;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.commit,s=t.rootGetters,a=s["api/api"],c=s["auth/getSession"],i.next=5,o["default"].prototype.$workKeys.signMessage(JSON.stringify({id:e.accountId,type:"Account",allData:!0}),c.sk);case 5:return l=i.sent,i.next=8,o["default"].prototype.$http.get("".concat(a,"Subscription/Subscriptions"),{headers:{"X-TAPI-FP":c.fp,"X-TAPI-SIGN":l},params:{id:e.accountId,type:"Account",allData:!0}});case 8:u=i.sent,d=u.data,n("setAllSubscription",d);case 11:case"end":return i.stop()}}),i)})))()}}},kXt={namespaced:!0,state:function(){return{statusWS:[],mainConnection:["apiWS","apiWS2","apiWS3"]}},getters:{getStatusWs:function(t){if(!t.statusWS.length)return null;var e=t.statusWS.filter((function(e){return"connect"===e.status&&t.mainConnection.some((function(t){return e.ws===t}))}));return 3===e.length},getConnections:function(t){return t.statusWS}},mutations:{setWsStatus:function(t,e){if(t.statusWS.length){var i=t.statusWS.findIndex((function(t){return t.ws===e.ws}));-1!==i?t.statusWS.splice(i,1,e):t.statusWS.push(e)}else t.statusWS.push(e)}},actions:{subsForConnectStatus:function(t){var e=t.commit;o["default"].prototype.$socketStream.$on("WSSstatus",(function(t){return e("setWsStatus",t)}))}}},IXt={namespaced:!0,state:{telegramData:[],youtubeData:[],otherVideoSource:null,currentVideoId:null},getters:{telegramData:function(t){return t.telegramData},youtubeData:function(t){return Object(x["a"])(t.youtubeData).sort((function(t,e){return new Date(e.published).getTime()-new Date(t.published).getTime()}))},currentVideo:function(t){if(t.currentVideoId)return t.youtubeData.find((function(e){return e.videoId===t.currentVideoId}))},otherVideoSource:function(t){return t.otherVideoSource}},mutations:{setTelegramData:function(t,e){t.telegramData=e},addNewMessage:function(t,e){t.telegramData.push(e)},setYoutubeData:function(t,e){t.youtubeData=e},setCurrentVideoId:function(t,e){t.currentVideoId=e},setOtherVideo:function(t,e){t.otherVideoSource=e}},actions:{addNewTelegramMessage:function(t,e){var i=t.commit,o=t.state,n=1e3*e.Message.Date,s=rL(n),r=aL(n),a={id:e.Message.Id,chatId:e.Message.ChatId,date:s,time:r,messageId:e.Message.MessageId,editDate:null,nameChat:e.ChatInfo.Title,text:e.Message.Text},c=o.telegramData.find((function(t){return t.isDate&&t.id===rL(n)}));if(!c){var l={id:s,isDate:!0,text:s};i("addNewMessage",l)}i("addNewMessage",a)},getTelegramMessagesByUser:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,l,u,d,h,p,g,f,m,v,y,C,b,S;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],l=n["auth/getSession"],u=null===e||void 0===e?void 0:e.endIndex,d={AccountId:e.accountId,UserId:e.userId},i.next=7,o["default"].prototype.$workKeys.signMessage(JSON.stringify(d));case 7:return h=i.sent,i.next=10,o["default"].prototype.$http.post("".concat(a,"GetTelegramMessagesByUser"),d,{headers:{"X-TAPI-FP":l.fp,"X-TAPI-SIGN":h}});case 10:return p=i.sent,g=p.data,f={accountId:e.accountId},i.next=15,o["default"].prototype.$workKeys.signMessage(JSON.stringify(f));case 15:return m=i.sent,i.next=18,o["default"].prototype.$http.get("".concat(a,"GetTelegramMessagesForSubscriber"),{params:f,headers:{"X-TAPI-FP":l.fp,"X-TAPI-SIGN":m}});case 18:v=i.sent,y=v.data,C={messanges:[].concat(Object(x["a"])(g.messanges),Object(x["a"])(y.messanges)),chatInfo:[].concat(Object(x["a"])(g.chatInfo),Object(x["a"])(y.chatInfo))},C.messanges.length>0&&(b={},C.messanges.sort((function(t,e){return t.date-e.date})).forEach((function(t){var e=1e3*t.date,i=rL(e),o=aL(e),n=C.chatInfo.find((function(e){return e.chatId===t.chatId})).title;b[i]||(b[i]=[]),b[i].push(Object(c["a"])(Object(c["a"])({},t),{},{time:o,nameChat:n}))})),S=Object.entries(b).flat(2).map((function(t){return"string"===typeof t?{id:t,text:t,isDate:!0}:t})),u&&S.length-u>1&&S.splice(u-2,0,{id:"notRead",notRead:!0,text:"Непрочитанные сообщения"}),s("setTelegramData",S));case 22:case"end":return i.stop()}}),i)})))()},getChannelDataYoutube:function(t,e){return Object(a["a"])(Object(r["a"])().mark((function i(){var n,s,a,c,l;return Object(r["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.rootGetters,s=t.commit,a=n["api/api"],i.next=4,o["default"].prototype.$http.get("".concat(a,"YouTube/").concat(e));case 4:c=i.sent,l=c.data,s("setYoutubeData",l);case 7:case"end":return i.stop()}}),i)})))()},setCurrentVideoId:function(t,e){var i=t.commit;i("setCurrentVideoId",e)},setOtherVideo:function(t,e){var i=t.commit;i("setOtherVideo",e)}}},BXt={namespaced:!0,state:{isVisible:!1,pendingStatus:!1,endPeriodDemoStatus:!1,endPeriodPayStatus:!1},getters:{getVisible:function(t){return t.isVisible},getPendingStatus:function(t){return t.pendingStatus},getEndPeriodDemoStatus:function(t){return t.endPeriodDemoStatus},getEndPeriodPayStatus:function(t){return t.endPeriodPayStatus}},mutations:{setVisible:function(t,e){t.isVisible=e},setPendingStatus:function(t,e){t.pendingStatus=e},setEndPeriodDemoStatus:function(t,e){t.endPeriodDemoStatus=e},setEndPeriodPayStatus:function(t,e){t.endPeriodPayStatus=e}},actions:{setVisible:function(t,e){var i=t.commit;i("setVisible",e)},setPendingStatus:function(t,e){var i=t.commit;i("setPendingStatus",e)},setEndPeriodDemoStatus:function(t,e){var i=t.commit;i("setEndPeriodDemoStatus",e)},setEndPeriodPayStatus:function(t,e){var i=t.commit;i("setEndPeriodPayStatus",e)}}},MXt={namespaced:!0,state:{version:1,openSettingsTable:null,closedSettingsTable:null},getters:{getSession:function(t,e,i,o){return o["auth/getSession"]},getOpenSettingsTable:function(t){return t.openSettingsTable},getClosedSettingsTable:function(t){return t.closedSettingsTable}},mutations:{setSettingsTable:function(t,e){var i="".concat(e.typeOrders,"SettingsTable");t[i]=e.columns}},actions:{setFirstSettingsTable:function(t,e){var i=t.commit,o=null===e||void 0===e?void 0:e.openSettingsTable,n=null===e||void 0===e?void 0:e.closedSettingsTable;o&&i("setSettingsTable",{typeOrders:"open",columns:o}),n&&i("setSettingsTable",{typeOrders:"closed",columns:n})},redactSettings:function(t,e){var i=t.commit,o=t.getters;i(e.mutation,e.data),o["getSession"]&&i("userSettings/redactSettings",{widget:"table",data:{openSettingsTable:o["getOpenSettingsTable"],closedSettingsTable:o["getClosedSettingsTable"]}},{root:!0})}}},$Xt={namespaced:!0,state:{lastOrdersNotification:null},getters:{getLastOrdersNotification:function(t){return t.lastOrdersNotification}},mutations:{setLastOrders:function(t,e){t.lastOrdersNotification=e},setNewNotification:function(t,e){if(e.command&&"BrokerPosition"===e.command){var i,o=e.data;if("NoError"!==o.errorCode)return;if("Position_Modify"===o.reason){if(o.subscriptionId)return;i="modifyOrder",o.modifyDate=(new Date).toLocaleString("ru",{timeZone:"UTC"})}if("Position_PoCreate"===o.reason&&(i="pendingOrder"),"Position_PoClose"===o.reason){if("Filled"===o.pendingCloseReason)return;i="pendingClose"}"Position_PoModify"===o.reason&&(i="modifyPendingOrder"),"Position_Create"===o.reason&&"Opened"===o.status&&(i="openedOrder"),"Position_Close"===o.reason&&"Closed"===o.status&&(i="closedOrder"),o.typeNoti=i,t.lastOrdersNotification.unshift(o)}}},actions:{lastOrders:function(t,e){var i=t.commit;o["default"].prototype.$socketStream.events.subscribe("apiWS",(function(t){return i("setNewNotification",t)})),i("setLastOrders",e)}}},LXt={namespaced:!0,state:{version:1.1,favorites:{}},getters:{getSession:function(t,e,i,o){return o["auth/getSession"]},getFavorites:function(t){return t.favorites},getFavoritesByContract:function(t,e,i,o){var n,s=null===(n=o["subscribeOrders/getDefaultAccount"])||void 0===n?void 0:n.id;return function(e){var i;return null!==(i=t.favorites[s])&&void 0!==i&&i[e]?t.favorites[s][e]:[]}},getAllFavorites:function(t,e,i,o){var n,s=null===(n=o["subscribeOrders/getDefaultAccount"])||void 0===n?void 0:n.id;return t.favorites[s]?Object.values(t.favorites[s]).flat():[]}},mutations:{setFirstData:function(t,e){t.favorites=e},addNewFavorite:function(t,e){var i=JSON.parse(JSON.stringify(t.favorites));i[e.myAccount]||(i[e.myAccount]={}),i[e.myAccount][e.contract]||(i[e.myAccount][e.contract]=[]),i[e.myAccount][e.contract].push(e),t.favorites=i},deleteFavorite:function(t,e){var i=JSON.parse(JSON.stringify(t.favorites));i[e.myAccount][e.contract]=i[e.myAccount][e.contract].filter((function(t){return t.accountId!==e.accountId})),0===i[e.myAccount][e.contract].length&&delete i[e.myAccount][e.contract],0===Object.keys(i[e.myAccount]).length&&delete i[e.myAccount],t.favorites=i}},actions:{setFirstSettingsFavorite:function(t,e){var i=t.commit;i("setFirstData",e)},redactSettings:function(t,e){var i=t.commit,o=t.getters;i(e.mutation,e.data),o["getSession"]&&i("userSettings/redactSettings",{widget:"favorites",data:o["getFavorites"]},{root:!0})}}},FXt={namespaced:!0,state:{version:1,quoteFavorites:[],sortedSignals:{}},getters:{getSession:function(t,e,i,o){return o["auth/getSession"]},getQuoteFavorites:function(t){return t.quoteFavorites},getSortedSignals:function(t){return t.sortedSignals}},mutations:{setFirstData:function(t,e){t.quoteFavorites=e.quoteFavorites||[],t.sortedSignals=e.sortedSignals||{}},addNewQuoteFavorite:function(t,e){t.quoteFavorites.push(e)},deleteQuoteFavorite:function(t,e){t.quoteFavorites=t.quoteFavorites.filter((function(t){return t!==e})),t.sortedSignals["Favorite"]&&(t.sortedSignals["Favorite"]=t.sortedSignals["Favorite"].filter((function(t){return t!==e})))},addIndex:function(t,e){t.sortedSignals[e[0]]=e[1]}},actions:{setFirstSettingsQuotesFavorite:function(t,e){var i=t.commit;i("setFirstData",e)},redactSettings:function(t,e){var i=t.commit,o=t.getters;i(e.mutation,e.data),o["getSession"]&&i("userSettings/redactSettings",{widget:"quoteFavorites",data:{quoteFavorites:o["getQuoteFavorites"],sortedSignals:o["getSortedSignals"]}},{root:!0})}}},jXt={namespaced:!0,state:{version:1,selectedViewNotification:null,selectedReportsPeriods:[]},getters:{getSession:function(t,e,i,o){return o["auth/getSession"]},getSelectedViewNotification:function(t){return t.selectedViewNotification},getSelectedReportsPeriods:function(t){return t.selectedReportsPeriods}},mutations:{setFirstData:function(t,e){t.selectedViewNotification=e.selectedViewNotification||"event",t.selectedReportsPeriods=e.selectedReportsPeriods||[]},setSelectedViewNotification:function(t,e){t.selectedViewNotification=e},setSelectedReportsPeriods:function(t,e){t.selectedReportsPeriods=e}},actions:{setFirstPeriodReports:function(t,e){var i=t.commit;i("setFirstData",e)},redactSettings:function(t,e){var i=t.commit,o=t.getters;i(e.mutation,e.data),o["getSession"]&&i("userSettings/redactSettings",{widget:"periodReports",data:{selectedViewNotification:o["getSelectedViewNotification"],selectedReportsPeriods:o["getSelectedReportsPeriods"]}},{root:!0})}}},RXt={namespaced:!0,state:{visibleDay:!1,visibleWeek:!1,visibleMonth:!1,dataPeriodDay:null,dataPeriodWeek:null,dataPeriodMonth:null},getters:{getVisibleDay:function(t){return t.visibleDay},getVisibleWeek:function(t){return t.visibleWeek},getVisibleMonth:function(t){return t.visibleMonth},getDataPeriodDay:function(t){return t.dataPeriodDay},getDataPeriodWeek:function(t){return t.dataPeriodWeek},getDataPeriodMonth:function(t){return t.dataPeriodMonth}},mutations:{setVisibleDay:function(t,e){if(!e)return t.visibleDay=!1,void(t.dataPeriodDay=null);t.dataPeriodDay=e.dataPeriod,t.visibleDay=!0},setVisibleWeek:function(t,e){if(!e)return t.visibleWeek=!1,void(t.dataPeriodWeek=null);var i=e.dataPeriod.data.MoneyChart.reverse();e.dataPeriod.data.MoneyChart=i.slice(-6),e.dataPeriod.data.EquityOpen=i.at(-7)?i.at(-7).Y2:i[0].Y2,t.dataPeriodWeek=e.dataPeriod,t.visibleWeek=!0},setVisibleMonth:function(t,e){if(!e)return t.visibleMonth=!1,void(t.dataPeriodMonth=null);t.dataPeriodMonth=e.dataPeriod,t.visibleMonth=!0}}},WXt={namespaced:!0,state:{isPaymentsPage:!1},getters:{getIsPaymentsPage:function(t){return t.isPaymentsPage}},mutations:{setIsPaymentsPage:function(t,e){t.isPaymentsPage=e}}};o["default"].use(p["a"]),o["default"].use(BYt);var NXt=new p["a"].Store({modules:{api:MYt,auth:LYt,reg:FYt,user:jYt,modal:RYt,contracts:WYt,quotesCatalogs:NYt,brokers:EYt,statistic:XYt,subscribeOrders:VYt,userSettings:zYt,accountsTradeSettings:YYt,subscription:QYt,widgetMenu:eXt,globals:iXt,userExternalResources:nXt,investing:sXt,serverTime:aXt,settingsTradingChart:dXt,tradingTopBarSettings:KYt,layouts:hXt,chat:pXt,tradeNotification:$Xt,paymentService:gXt,headerSettings:mXt,userStreams:oXt,eventsCalendar:bXt,modalSubscribe:SXt,toast:PXt,cart:TXt,notifications:xXt,statusRequests:OXt,expertsPortfolio:_Xt,statDataForPortfolio:AXt,subscriptionsContract:DXt,messenger:IXt,connectionStatus:kXt,modalPay:BXt,tableSettings:MXt,favoriteSettings:LXt,quotesFavoriteSettings:FXt,periodReportsSettings:jXt,reportsModal:RXt,misc:WXt},strict:"production"!==Object({NODE_ENV:"production",VUE_APP_API_CHAT_LINK:"https://chat.toptrader.org/api/v1/",VUE_APP_API_CHAT_WS_LINK:"wss://chat.toptrader.org/websocket",VUE_APP_API_LINK:"https://api.toptrader.ru/api/",VUE_APP_API_WS2_LINK:"wss://api.toptrader.ru/ws2",VUE_APP_API_WS3_LINK:"wss://api.toptrader.ru/ws3",VUE_APP_API_WS4_LINK:"wss://api.toptrader.ru/ws4",VUE_APP_API_WS_LINK:"wss://api.toptrader.ru/ws",VUE_APP_API_WS_NOTI_LINK:"wss://noti.toptrader.ru/ws",VUE_APP_CHAT_LINK:"https://chat.toptrader.org",VUE_APP_COMPANY_ADDRESS:"117105, г. Москва, Варшавское шоссе, д.1, стр. 6, этаж 2",VUE_APP_COMPANY_EMAIL:"company@toptrader.ru",VUE_APP_COMPANY_NAME:"ООО «ТопТрейдер»",VUE_APP_DOCSPAGE:"https://about.toptrader.ru/docs/",VUE_APP_DOMEN_NAME:"toptrader.ru",VUE_APP_ID_STREAM_TV1:"72c9a0a4-c610-47b5-b434-6388034b2431",VUE_APP_ID_STREAM_TV2:"b26ec8fe-2f78-4c99-8962-f68257b0176b",VUE_APP_LANG:"Русский",VUE_APP_LANGCODE:"ru",VUE_APP_LANGSWITCH:"false",VUE_APP_LENDING_LINK:"https://about.toptrader.ru",VUE_APP_LOGODARK:"dark-logo",VUE_APP_LOGOLG:"lg-logo",VUE_APP_LOGOMIN:"min-logo",VUE_APP_NOTI_API_LINK:"https://noti.toptrader.ru/api/",VUE_APP_PARTNER_API_LINK:"https://epapi.toptrader.ru/api/",VUE_APP_STREAM_API_LINK:"https://streamingservice.toptrader.ru/api/",VUE_APP_STREAM_CHAT_WS_API_LINK:"wss://streamingservice.toptrader.ru/ws",VUE_APP_STREAM_WS_API_LINK:"wss://streamingservice.toptrader.ru/ws2",BASE_URL:"/"}).NODE_ENT}),EXt=i("bc3a"),UXt=i.n(EXt),VXt=i("760d"),HXt=i("3304"),GXt=new WeakSet,qXt=new WeakSet,zXt=function(){function t(){Object(Qh["a"])(this,t),Object(MA["a"])(this,qXt),Object(MA["a"])(this,GXt),this.storage=null}return Object(Jh["a"])(t,[{key:"getOrdersOnStorage",value:function(){return this.storage}},{key:"setOrdersToStorage",value:function(t){this.storage=Object($A["a"])(this,GXt,YXt).call(this,t)}},{key:"getLast24HOrders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(new Date).getTime();if(this.storage){var e=[],i=t,o=i-864e5;if(this.storage.tradingOrders.length){var n=this.storage.tradingOrders.filter((function(t){return new Date(t.openDate).getTime()>=o}));n.length&&(e=e.concat(n.map((function(t){return t.typeNoti="openedOrder",t}))))}if(this.storage.closedOrders.length){var s=this.storage.closedOrders.filter((function(t){return new Date(t.closedDate).getTime()>=o}));s.length&&(e=e.concat(s.map((function(t){return t.typeNoti="closedOrder",t}))))}if(this.storage.pendingOrders.length){var r=this.storage.pendingOrders.filter((function(t){return new Date(t.createdDate).getTime()>=o}));r.length&&(e=e.concat(r.map((function(t){return t.typeNoti="pendingOrder",t}))))}return e=e.sort((function(t,e){var i=t.closedDate?new Date(t.closedDate).getTime():new Date(t.createdDate).getTime(),o=e.closedDate?new Date(e.closedDate).getTime():new Date(e.createdDate).getTime();return o-i})),e}}},{key:"setUserOrder",value:function(t){if(this.storage&&"NoError"===t.errorCode)if("Closed"===t.status)if("Position_PoClose"===t.reason){var e=this.storage.pendingOrders.findIndex((function(e){return e.id===t.id}));-1!==e&&this.storage.pendingOrders.splice(e,1)}else{var i=this.storage.tradingOrders.findIndex((function(e){return e.id===t.id}));-1!==i&&(this.storage.tradingOrders.splice(i,1),this.storage.closedOrders.push(t))}else if("Position_Create"===t.reason){if(this.storage.tradingOrders.push(t),t.pendingOrderId){var o=this.storage.pendingOrders.findIndex((function(e){return e.id===t.pendingOrderId}));-1!==o&&this.storage.pendingOrders.splice(o,1)}}else if("Position_Modify"===t.reason){var n=this.storage.tradingOrders.findIndex((function(e){return e.id===t.id}));-1!==n&&t.openPrice&&this.storage.tradingOrders.splice(n,1,t)}else if("Position_PoCreate"===t.reason)this.storage.pendingOrders.push(t);else if("Position_PoClose"===t.reason){var s=this.storage.pendingOrders.findIndex((function(e){return e.id===t.id}));-1!==s&&this.storage.pendingOrders.splice(s,1)}else if("Position_PoModify"===t.reason){var r=this.storage.pendingOrders.findIndex((function(e){return e.id===t.id}));-1!==r&&this.storage.pendingOrders.splice(r,1,t)}}},{key:"cancelPendingOrder",value:function(t){var e=this.storage.pendingOrders.findIndex((function(e){return e.id===t.id}));-1!==e&&this.storage.pendingOrders.splice(e,1)}},{key:"setOrderTrailingSL",value:function(t){var e=this.storage.tradingOrders.findIndex((function(e){e.id,t.OrderId}));e>-1&&(this.storage.tradingOrders[e].sl=t.Sl)}},{key:"setOrdersToStorageLegacy",value:function(t){this.storage=[t.accountId,t.closedOrders.map((function(t){return[t.accountId,t.accountSequenceId,t.brokerId,t.closePrice,t.closedDate,t.comment,t.contractName,t.createdDate,t.createddateutc,t.errorCode,t.externalId,t.id,t.instrumentName,t.openDate,t.openPrice,t.orderType,t.parentOrderId,t.pendingOrderId,t.pendingPrice,t.pendingStartDT,t.pendingStopDT,t.profit,t.reason,t.sequenceId,t.sourceUserAvatar,t.sourceUserName,t.status,t.stopLoss,t.subscriptionId,t.swaps,t.takeProfit,t.trailingSL,t.trailingStart,t.userAvatar,t.userName,t.volume]})),t.pendingOrders,t.tradingOrders.map((function(t){return[t.accountId,t.accountSequenceId,t.brokerId,t.closePrice,t.closedDate,t.comment,t.contractName,t.createdDate,t.createddateutc,t.errorCode,t.externalId,t.id,t.instrumentName,t.openDate,t.openPrice,t.orderType,t.parentOrderId,t.pendingOrderId,t.pendingPrice,t.pendingStartDT,t.pendingStopDT,t.profit,t.reason,t.sequenceId,t.sourceUserAvatar,t.sourceUserName,t.status,t.stopLoss,t.subscriptionId,t.swaps,t.takeProfit,t.trailingSL,t.trailingStart,t.userAvatar,t.userName,t.volume]}))]}},{key:"orderToArr",value:function(t){return[t.accountId,t.accountSequenceId,t.brokerId,t.closePrice,t.closedDate,t.comment,t.contractName,t.createdDate,t.createddateutc,t.errorCode,t.externalId,t.id,t.instrumentName,t.openDate,t.openPrice,t.orderType,t.parentOrderId,t.pendingOrderId,t.pendingPrice,t.pendingStartDT,t.pendingStopDT,t.profit,t.reason,t.sequenceId,t.sourceUserAvatar,t.sourceUserName,t.status,t.stopLoss,t.subscriptionId,t.swaps,t.takeProfit,t.trailingSL,t.trailingStart,t.userAvatar,t.userName,t.volume]}}]),t}();function YXt(t){var e=this,i={accountId:t[0],tradingOrders:t[1].length?t[1].map((function(t){return Object($A["a"])(e,qXt,XXt).call(e,t)})):t[1],closedOrders:t[2].length?t[2].map((function(t){return Object($A["a"])(e,qXt,XXt).call(e,t)})):t[2],pendingOrders:t[3].length?t[3].map((function(t){return Object($A["a"])(e,qXt,XXt).call(e,t)})):t[3]};return i}function XXt(t){return{accountId:t[0],accountSequenceId:t[1],brokerId:t[2],closePrice:t[3],comment:t[4],contractName:t[5],createdDate:t[6],createddateutc:t[7],externalId:t[8],id:t[9],sequenceId:t[10],openDate:t[11],closedDate:t[12],openPrice:t[13],orderType:t[14],profit:t[15],status:t[16],stopLoss:t[17],swaps:t[18],takeProfit:t[19],userAvatar:t[20],userName:t[21],volume:t[22],volumeAbs:t[22]*t[13],instrumentName:t[23],reason:t[24],pendingStartDT:t[25],pendingStopDT:t[26],pendingPrice:t[27],pendingOrderId:t[28],trailingSL:t[29],trailingStart:t[30],parentOrderId:t[31],subscriptionId:t[32],sourceUserName:t[33],sourceUserAvatar:t[34],errorCode:t[35],openFee:t[38],closeFee:t[39]+t[38]}}i("c19f"),i("81b2");var QXt=new WeakSet,JXt=new WeakSet,KXt=new WeakSet,ZXt=new WeakSet,tQt=new WeakSet,eQt=new WeakSet,iQt=new WeakSet,oQt=new WeakSet,nQt=new WeakSet,sQt=new WeakSet,rQt=function(){function t(e,i){Object(Qh["a"])(this,t),Object(MA["a"])(this,sQt),Object(MA["a"])(this,nQt),Object(MA["a"])(this,oQt),Object(MA["a"])(this,iQt),Object(MA["a"])(this,eQt),Object(MA["a"])(this,tQt),Object(MA["a"])(this,ZXt),Object(MA["a"])(this,KXt),Object(MA["a"])(this,JXt),Object(MA["a"])(this,QXt),this.crypto=e,this.oneUseKey=null,this.oneUseSingKey=null,this.btoa=i}return Object(Jh["a"])(t,[{key:"getUUIDSession",value:function(){return this.crypto.randomUUID()}},{key:"getOneUseKey",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(){var e;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object($A["a"])(this,QXt,aQt).call(this,{name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},["encrypt","decrypt"]);case 2:return this.oneUseKey=t.sent,t.next=5,Object($A["a"])(this,JXt,lQt).call(this,this.oneUseKey.publicKey);case 5:return e=t.sent,t.abrupt("return",e);case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"getOneUseSignKey",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(){var e,i;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object($A["a"])(this,QXt,aQt).call(this,{name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},["sign","verify"]);case 2:return this.oneUseSingKey=t.sent,t.next=5,Object($A["a"])(this,JXt,lQt).call(this,this.oneUseSingKey.publicKey);case 5:return e=t.sent,t.next=8,Object($A["a"])(this,KXt,dQt).call(this,this.oneUseSingKey.privateKey);case 8:return i=t.sent,t.abrupt("return",{exportKeyPublic:e,exportKeyPrivate:i});case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"encryptMessage",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e,i){var o,n,s,a=arguments;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return o=a.length>2&&void 0!==a[2]?a[2]:{name:"RSA-OAEP",hash:"SHA-256"},t.next=3,Object($A["a"])(this,tQt,gQt).call(this,i,o,"encrypt");case 3:return n=t.sent,t.next=6,Object($A["a"])(this,iQt,yQt).call(this,e,n,o);case 6:return s=t.sent,t.abrupt("return",s);case 8:case"end":return t.stop()}}),t,this)})));function e(e,i){return t.apply(this,arguments)}return e}()},{key:"decryptData",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e){var i;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object($A["a"])(this,eQt,mQt).call(this,e);case 2:return i=t.sent,t.abrupt("return",i.join(""));case 4:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"signMessage",value:function(){var t=Object(a["a"])(Object(r["a"])().mark((function t(e,i){var o,n,s,a,c;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object($A["a"])(this,oQt,bQt).call(this,i);case 2:return o=t.sent,n=Object($A["a"])(this,ZXt,pQt).call(this,e),t.next=6,this.crypto.subtle.sign({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},o,n);case 6:return s=t.sent,a=Object($A["a"])(this,nQt,PQt).call(this,s),c=window.btoa(a),t.abrupt("return",c);case 10:case"end":return t.stop()}}),t,this)})));function e(e,i){return t.apply(this,arguments)}return e}()}]),t}();function aQt(t,e){return cQt.apply(this,arguments)}function cQt(){return cQt=Object(a["a"])(Object(r["a"])().mark((function t(e,i){var o;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.crypto.subtle.generateKey(e,!0,i);case 2:return o=t.sent,t.abrupt("return",o);case 4:case"end":return t.stop()}}),t,this)}))),cQt.apply(this,arguments)}function lQt(t){return uQt.apply(this,arguments)}function uQt(){return uQt=Object(a["a"])(Object(r["a"])().mark((function t(e){var i,o,n,s;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.crypto.subtle.exportKey("spki",e);case 2:return i=t.sent,o=Object($A["a"])(this,nQt,PQt).call(this,i),n=window.btoa(o),s=n,t.abrupt("return",s);case 7:case"end":return t.stop()}}),t,this)}))),uQt.apply(this,arguments)}function dQt(t){return hQt.apply(this,arguments)}function hQt(){return hQt=Object(a["a"])(Object(r["a"])().mark((function t(e){var i,o,n,s;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.crypto.subtle.exportKey("pkcs8",e);case 2:return i=t.sent,o=Object($A["a"])(this,nQt,PQt).call(this,i),n=window.btoa(o),s=n,t.abrupt("return",s);case 7:case"end":return t.stop()}}),t,this)}))),hQt.apply(this,arguments)}function pQt(t){var e=new TextEncoder;return e.encode(t)}function gQt(t,e,i){return fQt.apply(this,arguments)}function fQt(){return fQt=Object(a["a"])(Object(r["a"])().mark((function t(e,i,o){var n,s;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=window.atob(e),s=Object($A["a"])(this,sQt,TQt).call(this,n),t.next=4,this.crypto.subtle.importKey("spki",s,{name:"RSA-OAEP",hash:"SHA-256"},!0,[o]);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),fQt.apply(this,arguments)}function mQt(t){return vQt.apply(this,arguments)}function vQt(){return vQt=Object(a["a"])(Object(r["a"])().mark((function t(e){var i,o,n,s,a,c,l;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=256,o=[],n=window.atob(e),s=0;case 4:if(!(s0||this.getFullYear()%400==0?366:365},Date.prototype.getWeek=function(){var t=new Date(this.valueOf()),e=(this.getDay()+6)%7;t.setDate(t.getDate()-e+3);var i=t.valueOf();return t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7),1+Math.ceil((i-t)/6048e5)},Date.prototype.getTimeWithoutUTC=function(){var t=new Date(this).getTime(),e=-1*new Date(this).getTimezoneOffset()*60*1e3;return+t+ +e},o["default"].prototype.$moneyf=function(t,e,i){return RA.formatNumber(t,"money",e,i)},o["default"].prototype.$pricef=function(t,e,i){return RA.formatNumber(t,"price",e,i)},o["default"].prototype.$orderStorage=new zXt,o["default"].prototype.$decimalAdjust=function(t,e,i){return"undefined"===typeof i||0===+i?Math[t](e):(e=+e,i=+i,isNaN(e)||"number"!==typeof i||i%1!==0?NaN:(e=e.toString().split("e"),e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i))),e=e.toString().split("e"),+(e[0]+"e"+(e[1]?+e[1]+i:i))))};var NQt=UXt.a.create({headers:{"Content-Type":"application/json"},timeout:25e4});o["default"].prototype.$http=NQt,o["default"].prototype.$workStorage=new OQt,o["default"].prototype.$workKeys=new rQt(window.crypto,window.btoa),o["default"].prototype.$frames=Oxt,o["default"].prototype.$iconPath=function(t){var e=i("8a78");return'\n \n